@eifi1/ui-kit 0.51.3 → 0.51.5

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 (780) hide show
  1. package/README.md +6 -6
  2. package/dist/account/account-settings-labels.js.map +1 -1
  3. package/dist/account/account-settings.js +11 -9
  4. package/dist/account/account-settings.js.map +1 -1
  5. package/dist/account/delete-account-setting.js +56 -65
  6. package/dist/account/delete-account-setting.js.map +1 -1
  7. package/dist/account/email-change-setting-labels.js.map +1 -1
  8. package/dist/account/email-change-setting.js.map +1 -1
  9. package/dist/account/passkeys-setting.js.map +1 -1
  10. package/dist/account/sessions-setting.js.map +1 -1
  11. package/dist/admin/admin-action-confirm.js +1 -3
  12. package/dist/admin/admin-action-confirm.js.map +1 -1
  13. package/dist/admin/admin-action-log.js.map +1 -1
  14. package/dist/admin/admin-area-labels.js +4 -1
  15. package/dist/admin/admin-area-labels.js.map +1 -1
  16. package/dist/admin/admin-overview.js +19 -11
  17. package/dist/admin/admin-overview.js.map +1 -1
  18. package/dist/admin/admin-sections.js.map +1 -1
  19. package/dist/admin/admin-tool-links.d.ts +1 -1
  20. package/dist/admin/admin-tool-links.js +7 -1
  21. package/dist/admin/admin-tool-links.js.map +1 -1
  22. package/dist/admin/invitations-panel.js +2 -13
  23. package/dist/admin/invitations-panel.js.map +1 -1
  24. package/dist/admin/mail-test-card.js.map +1 -1
  25. package/dist/admin/reviewer-scope-editor.js +4 -11
  26. package/dist/admin/reviewer-scope-editor.js.map +1 -1
  27. package/dist/admin/role-select.js.map +1 -1
  28. package/dist/admin/user-roster.js +1 -9
  29. package/dist/admin/user-roster.js.map +1 -1
  30. package/dist/auth/accept-invitation.js.map +1 -1
  31. package/dist/auth/auth-errors.js.map +1 -1
  32. package/dist/auth/forgot-password-form.js +23 -31
  33. package/dist/auth/forgot-password-form.js.map +1 -1
  34. package/dist/auth/register-form.js.map +1 -1
  35. package/dist/auth/reset-password-form.js.map +1 -1
  36. package/dist/auth/sign-in-form.js +13 -5
  37. package/dist/auth/sign-in-form.js.map +1 -1
  38. package/dist/auth/verify-email.js +1 -8
  39. package/dist/auth/verify-email.js.map +1 -1
  40. package/dist/billing/billing-banner.js.map +1 -1
  41. package/dist/billing/billing-labels.js.map +1 -1
  42. package/dist/billing/checkout-processing.js.map +1 -1
  43. package/dist/billing/plan-card.js +91 -85
  44. package/dist/billing/plan-card.js.map +1 -1
  45. package/dist/billing/plan-limit-toast.js.map +1 -1
  46. package/dist/billing/plan-limit.js.map +1 -1
  47. package/dist/billing/plan-price.js.map +1 -1
  48. package/dist/billing/plan-switch.js.map +1 -1
  49. package/dist/billing/subscription-actions.js.map +1 -1
  50. package/dist/bin/eifi1-pay-page.mjs +6 -1
  51. package/dist/components/account-chips.js.map +1 -1
  52. package/dist/components/alert-banner.js +1 -5
  53. package/dist/components/alert-banner.js.map +1 -1
  54. package/dist/components/amount-input.js +29 -12
  55. package/dist/components/amount-input.js.map +1 -1
  56. package/dist/components/authed-image.js.map +1 -1
  57. package/dist/components/autocomplete.js.map +1 -1
  58. package/dist/components/bulk-action-bar.js +1 -4
  59. package/dist/components/bulk-action-bar.js.map +1 -1
  60. package/dist/components/button-group.js.map +1 -1
  61. package/dist/components/button-look.js.map +1 -1
  62. package/dist/components/button.js +1 -7
  63. package/dist/components/button.js.map +1 -1
  64. package/dist/components/calculator.js +5 -5
  65. package/dist/components/calculator.js.map +1 -1
  66. package/dist/components/calendar-heatmap.js +4 -10
  67. package/dist/components/calendar-heatmap.js.map +1 -1
  68. package/dist/components/card.js +1 -8
  69. package/dist/components/card.js.map +1 -1
  70. package/dist/components/chart-zoom-core.js +3 -17
  71. package/dist/components/chart-zoom-core.js.map +1 -1
  72. package/dist/components/chart.d.ts +1 -1
  73. package/dist/components/chart.js +4 -22
  74. package/dist/components/chart.js.map +1 -1
  75. package/dist/components/checkbox-group.js +1 -4
  76. package/dist/components/checkbox-group.js.map +1 -1
  77. package/dist/components/chip-input.js +4 -1
  78. package/dist/components/chip-input.js.map +1 -1
  79. package/dist/components/chip.js +10 -5
  80. package/dist/components/chip.js.map +1 -1
  81. package/dist/components/choice-card.js +58 -74
  82. package/dist/components/choice-card.js.map +1 -1
  83. package/dist/components/column-mapper-labels.js.map +1 -1
  84. package/dist/components/column-mapper.js +167 -227
  85. package/dist/components/column-mapper.js.map +1 -1
  86. package/dist/components/combobox-core.js +5 -9
  87. package/dist/components/combobox-core.js.map +1 -1
  88. package/dist/components/combobox.js +1 -4
  89. package/dist/components/combobox.js.map +1 -1
  90. package/dist/components/confirm-dialog.js.map +1 -1
  91. package/dist/components/copy-button.js.map +1 -1
  92. package/dist/components/country-select.d.ts +5 -4
  93. package/dist/components/country-select.js +3 -19
  94. package/dist/components/country-select.js.map +1 -1
  95. package/dist/components/currency-option-list.js +13 -11
  96. package/dist/components/currency-option-list.js.map +1 -1
  97. package/dist/components/currency-select.js +1 -6
  98. package/dist/components/currency-select.js.map +1 -1
  99. package/dist/components/danger-confirm.js.map +1 -1
  100. package/dist/components/data-table-cells.js.map +1 -1
  101. package/dist/components/data-table-column-settings.js.map +1 -1
  102. package/dist/components/data-table-filter-popover.js +2 -18
  103. package/dist/components/data-table-filter-popover.js.map +1 -1
  104. package/dist/components/data-table-filters.js.map +1 -1
  105. package/dist/components/data-table-fit.js +7 -5
  106. package/dist/components/data-table-fit.js.map +1 -1
  107. package/dist/components/data-table-groups.js +3 -1
  108. package/dist/components/data-table-groups.js.map +1 -1
  109. package/dist/components/data-table-head.js +49 -57
  110. package/dist/components/data-table-head.js.map +1 -1
  111. package/dist/components/data-table-mobile.js +31 -44
  112. package/dist/components/data-table-mobile.js.map +1 -1
  113. package/dist/components/data-table-pagination.js.map +1 -1
  114. package/dist/components/data-table-row-actions.js +19 -16
  115. package/dist/components/data-table-row-actions.js.map +1 -1
  116. package/dist/components/data-table-row.js.map +1 -1
  117. package/dist/components/data-table-shared.js.map +1 -1
  118. package/dist/components/data-table-sort.js.map +1 -1
  119. package/dist/components/data-table-virtual.js +4 -1
  120. package/dist/components/data-table-virtual.js.map +1 -1
  121. package/dist/components/data-table.d.ts +8 -0
  122. package/dist/components/data-table.js +30 -39
  123. package/dist/components/data-table.js.map +1 -1
  124. package/dist/components/date-picker.js +1 -6
  125. package/dist/components/date-picker.js.map +1 -1
  126. package/dist/components/date-range-picker.js.map +1 -1
  127. package/dist/components/description-list.js +10 -10
  128. package/dist/components/description-list.js.map +1 -1
  129. package/dist/components/dialog-frame.js +9 -2
  130. package/dist/components/dialog-frame.js.map +1 -1
  131. package/dist/components/disclosure.js +17 -27
  132. package/dist/components/disclosure.js.map +1 -1
  133. package/dist/components/dropdown.js +25 -35
  134. package/dist/components/dropdown.js.map +1 -1
  135. package/dist/components/empty-state.js.map +1 -1
  136. package/dist/components/entity-combobox.js.map +1 -1
  137. package/dist/components/error-boundary.js.map +1 -1
  138. package/dist/components/field-base.js +5 -5
  139. package/dist/components/field-base.js.map +1 -1
  140. package/dist/components/field-parts.d.ts +1 -1
  141. package/dist/components/field-parts.js +10 -14
  142. package/dist/components/field-parts.js.map +1 -1
  143. package/dist/components/field-sync.js +8 -10
  144. package/dist/components/field-sync.js.map +1 -1
  145. package/dist/components/file-button.js.map +1 -1
  146. package/dist/components/file-dropzone.js.map +1 -1
  147. package/dist/components/floating-panel.js +4 -1
  148. package/dist/components/floating-panel.js.map +1 -1
  149. package/dist/components/focus-ring.js.map +1 -1
  150. package/dist/components/form-actions.js.map +1 -1
  151. package/dist/components/grouped-picker.js +11 -12
  152. package/dist/components/grouped-picker.js.map +1 -1
  153. package/dist/components/hover-menu.js +1 -4
  154. package/dist/components/hover-menu.js.map +1 -1
  155. package/dist/components/iban-input-labels.js.map +1 -1
  156. package/dist/components/icon-button.js +4 -1
  157. package/dist/components/icon-button.js.map +1 -1
  158. package/dist/components/icon-picker.js +6 -10
  159. package/dist/components/icon-picker.js.map +1 -1
  160. package/dist/components/image-grid.js +41 -50
  161. package/dist/components/image-grid.js.map +1 -1
  162. package/dist/components/inline-edit-field.js.map +1 -1
  163. package/dist/components/inline-entity-combobox.js +6 -12
  164. package/dist/components/inline-entity-combobox.js.map +1 -1
  165. package/dist/components/input.js +14 -2
  166. package/dist/components/input.js.map +1 -1
  167. package/dist/components/jump-calendar.js +1 -7
  168. package/dist/components/jump-calendar.js.map +1 -1
  169. package/dist/components/legal-labels.js +8 -2
  170. package/dist/components/legal-labels.js.map +1 -1
  171. package/dist/components/legal-page.d.ts +18 -1
  172. package/dist/components/legal-page.js +27 -2
  173. package/dist/components/legal-page.js.map +1 -1
  174. package/dist/components/legal.d.ts +40 -5
  175. package/dist/components/legal.js +41 -5
  176. package/dist/components/legal.js.map +1 -1
  177. package/dist/components/lightbox.js.map +1 -1
  178. package/dist/components/line-items.js +26 -36
  179. package/dist/components/line-items.js.map +1 -1
  180. package/dist/components/list-labels.js +3 -1
  181. package/dist/components/list-labels.js.map +1 -1
  182. package/dist/components/list.d.ts +18 -1
  183. package/dist/components/list.js +54 -13
  184. package/dist/components/list.js.map +1 -1
  185. package/dist/components/measured-grid.js +29 -53
  186. package/dist/components/measured-grid.js.map +1 -1
  187. package/dist/components/menu-item.js.map +1 -1
  188. package/dist/components/mini-calendar.js +13 -31
  189. package/dist/components/mini-calendar.js.map +1 -1
  190. package/dist/components/money-field.js.map +1 -1
  191. package/dist/components/month-picker.js +10 -21
  192. package/dist/components/month-picker.js.map +1 -1
  193. package/dist/components/multi-entity-combobox.js +3 -16
  194. package/dist/components/multi-entity-combobox.js.map +1 -1
  195. package/dist/components/multi-select.js.map +1 -1
  196. package/dist/components/nav-pills.js +10 -1
  197. package/dist/components/nav-pills.js.map +1 -1
  198. package/dist/components/number-field.js.map +1 -1
  199. package/dist/components/number-input.js +1 -7
  200. package/dist/components/number-input.js.map +1 -1
  201. package/dist/components/numpad-sheet.js +1 -4
  202. package/dist/components/numpad-sheet.js.map +1 -1
  203. package/dist/components/one-time-code-input.js +1 -7
  204. package/dist/components/one-time-code-input.js.map +1 -1
  205. package/dist/components/page-contents.js +13 -22
  206. package/dist/components/page-contents.js.map +1 -1
  207. package/dist/components/page-header.js +1 -11
  208. package/dist/components/page-header.js.map +1 -1
  209. package/dist/components/password-strength-labels.js.map +1 -1
  210. package/dist/components/password-strength.js +2 -8
  211. package/dist/components/password-strength.js.map +1 -1
  212. package/dist/components/phone-input.js +42 -57
  213. package/dist/components/phone-input.js.map +1 -1
  214. package/dist/components/picker-sheet.js.map +1 -1
  215. package/dist/components/pie-chart.js +1 -8
  216. package/dist/components/pie-chart.js.map +1 -1
  217. package/dist/components/popover.js.map +1 -1
  218. package/dist/components/progress-bar.js +16 -9
  219. package/dist/components/progress-bar.js.map +1 -1
  220. package/dist/components/qr-code.js +1 -8
  221. package/dist/components/qr-code.js.map +1 -1
  222. package/dist/components/row-actions.js +5 -1
  223. package/dist/components/row-actions.js.map +1 -1
  224. package/dist/components/search-field.js.map +1 -1
  225. package/dist/components/select.js +28 -38
  226. package/dist/components/select.js.map +1 -1
  227. package/dist/components/separator.js +1 -5
  228. package/dist/components/separator.js.map +1 -1
  229. package/dist/components/series-chart-axes.js +4 -1
  230. package/dist/components/series-chart-axes.js.map +1 -1
  231. package/dist/components/series-chart-budget.js.map +1 -1
  232. package/dist/components/series-chart-ticks.js.map +1 -1
  233. package/dist/components/series-chart.js +29 -45
  234. package/dist/components/series-chart.js.map +1 -1
  235. package/dist/components/settings-fields.js +21 -17
  236. package/dist/components/settings-fields.js.map +1 -1
  237. package/dist/components/share-card.js +4 -9
  238. package/dist/components/share-card.js.map +1 -1
  239. package/dist/components/sign-chip.js.map +1 -1
  240. package/dist/components/signature-pad.js +4 -13
  241. package/dist/components/signature-pad.js.map +1 -1
  242. package/dist/components/signed-amount.js +12 -5
  243. package/dist/components/signed-amount.js.map +1 -1
  244. package/dist/components/skeleton.js +2 -17
  245. package/dist/components/skeleton.js.map +1 -1
  246. package/dist/components/slider.js +13 -36
  247. package/dist/components/slider.js.map +1 -1
  248. package/dist/components/sparkline.js.map +1 -1
  249. package/dist/components/stat-tile.js +14 -10
  250. package/dist/components/stat-tile.js.map +1 -1
  251. package/dist/components/swatch-picker.js +14 -4
  252. package/dist/components/swatch-picker.js.map +1 -1
  253. package/dist/components/swipeable-row.d.ts +1 -1
  254. package/dist/components/swipeable-row.js +1 -8
  255. package/dist/components/swipeable-row.js.map +1 -1
  256. package/dist/components/table-skeleton.js +4 -1
  257. package/dist/components/table-skeleton.js.map +1 -1
  258. package/dist/components/table.js +12 -9
  259. package/dist/components/table.js.map +1 -1
  260. package/dist/components/tabs.js +5 -24
  261. package/dist/components/tabs.js.map +1 -1
  262. package/dist/components/text-link.js.map +1 -1
  263. package/dist/components/text.js.map +1 -1
  264. package/dist/components/tile-radio.js +1 -7
  265. package/dist/components/tile-radio.js.map +1 -1
  266. package/dist/components/time-input.js.map +1 -1
  267. package/dist/components/toast.js.map +1 -1
  268. package/dist/components/toggle-group.js +6 -1
  269. package/dist/components/toggle-group.js.map +1 -1
  270. package/dist/components/toggle-legend.js +2 -11
  271. package/dist/components/toggle-legend.js.map +1 -1
  272. package/dist/components/tooltip.js +2 -22
  273. package/dist/components/tooltip.js.map +1 -1
  274. package/dist/components/translation-review-editor.js +1 -4
  275. package/dist/components/translation-review-editor.js.map +1 -1
  276. package/dist/components/translation-review-parts.d.ts +1 -1
  277. package/dist/components/translation-review-parts.js +7 -1
  278. package/dist/components/translation-review-parts.js.map +1 -1
  279. package/dist/components/translation-review.js +18 -7
  280. package/dist/components/translation-review.js.map +1 -1
  281. package/dist/components/tree-view.js +14 -10
  282. package/dist/components/tree-view.js.map +1 -1
  283. package/dist/components/treemap.js +1 -13
  284. package/dist/components/treemap.js.map +1 -1
  285. package/dist/components/trigger-aria.js.map +1 -1
  286. package/dist/components/use-table-state.js +14 -11
  287. package/dist/components/use-table-state.js.map +1 -1
  288. package/dist/components/user-avatar.js +3 -26
  289. package/dist/components/user-avatar.js.map +1 -1
  290. package/dist/demo/demo-start.js +8 -4
  291. package/dist/demo/demo-start.js.map +1 -1
  292. package/dist/eslint/index.js +1 -1
  293. package/dist/feedback/feedback-attachment-labels.js.map +1 -1
  294. package/dist/feedback/feedback-attachment.js +1 -8
  295. package/dist/feedback/feedback-attachment.js.map +1 -1
  296. package/dist/feedback/feedback-capture.d.ts +1 -1
  297. package/dist/feedback/feedback-capture.js +3 -1
  298. package/dist/feedback/feedback-capture.js.map +1 -1
  299. package/dist/feedback/feedback-comment-thread.js +27 -13
  300. package/dist/feedback/feedback-comment-thread.js.map +1 -1
  301. package/dist/feedback/feedback-context.js +1 -4
  302. package/dist/feedback/feedback-context.js.map +1 -1
  303. package/dist/feedback/feedback-dialog.js.map +1 -1
  304. package/dist/feedback/feedback-inbox.js.map +1 -1
  305. package/dist/feedback/feedback-public-list.js +7 -1
  306. package/dist/feedback/feedback-public-list.js.map +1 -1
  307. package/dist/feedback/feedback-record.js +1 -5
  308. package/dist/feedback/feedback-record.js.map +1 -1
  309. package/dist/feedback/feedback-replies.js +25 -10
  310. package/dist/feedback/feedback-replies.js.map +1 -1
  311. package/dist/feedback/feedback-row-detail.js.map +1 -1
  312. package/dist/feedback/feedback-status-undo.js.map +1 -1
  313. package/dist/feedback/feedback-submit-dialog.js.map +1 -1
  314. package/dist/feedback/feedback-table.d.ts +3 -1
  315. package/dist/feedback/feedback-table.js +22 -5
  316. package/dist/feedback/feedback-table.js.map +1 -1
  317. package/dist/feedback/feedback-thread.js +2 -13
  318. package/dist/feedback/feedback-thread.js.map +1 -1
  319. package/dist/feedback/feedback-vocabulary.js.map +1 -1
  320. package/dist/feedback/feedback-vote-button.js.map +1 -1
  321. package/dist/hooks/use-anchored-rect.js.map +1 -1
  322. package/dist/hooks/use-document-title.js.map +1 -1
  323. package/dist/hooks/use-file-drop.js.map +1 -1
  324. package/dist/hooks/use-file-picker-labels.js.map +1 -1
  325. package/dist/hooks/use-file-picker.js.map +1 -1
  326. package/dist/hooks/use-focus-trap.js.map +1 -1
  327. package/dist/hooks/use-overlay-history.js +10 -5
  328. package/dist/hooks/use-overlay-history.js.map +1 -1
  329. package/dist/hooks/use-row-swipe.d.ts +1 -1
  330. package/dist/hooks/use-row-swipe.js +1 -6
  331. package/dist/hooks/use-row-swipe.js.map +1 -1
  332. package/dist/i18n/defaults.js +1 -4
  333. package/dist/i18n/defaults.js.map +1 -1
  334. package/dist/i18n/german.js +15 -4
  335. package/dist/i18n/german.js.map +1 -1
  336. package/dist/i18n/kit-labels.js +2 -8
  337. package/dist/i18n/kit-labels.js.map +1 -1
  338. package/dist/i18n/languages.js.map +1 -1
  339. package/dist/i18n/locales/en.js +19 -4
  340. package/dist/i18n/locales/en.js.map +2 -2
  341. package/dist/i18n/locales/es.js +15 -4
  342. package/dist/i18n/locales/es.js.map +1 -1
  343. package/dist/i18n/locales/fr.js +15 -4
  344. package/dist/i18n/locales/fr.js.map +1 -1
  345. package/dist/i18n/locales/hu.js +15 -4
  346. package/dist/i18n/locales/hu.js.map +1 -1
  347. package/dist/i18n/locales/it.js +15 -4
  348. package/dist/i18n/locales/it.js.map +1 -1
  349. package/dist/i18n/locales/zh.js +11 -3
  350. package/dist/i18n/locales/zh.js.map +1 -1
  351. package/dist/i18n/plurals.js.map +1 -1
  352. package/dist/i18n/review.js +15 -7
  353. package/dist/i18n/review.js.map +1 -1
  354. package/dist/i18n/shared-labels.js.map +1 -1
  355. package/dist/index.d.ts +17 -17
  356. package/dist/index.js +40 -23
  357. package/dist/index.js.map +1 -1
  358. package/dist/landing/access.js +1 -4
  359. package/dist/landing/access.js.map +1 -1
  360. package/dist/landing/landing-sections.js +35 -38
  361. package/dist/landing/landing-sections.js.map +1 -1
  362. package/dist/landing/page-seo.js.map +1 -1
  363. package/dist/lib/calc.js.map +1 -1
  364. package/dist/lib/clipboard-minus.js.map +1 -1
  365. package/dist/lib/dates.js.map +1 -1
  366. package/dist/lib/decimal-marks.js.map +1 -1
  367. package/dist/lib/device-settings.js +2 -1
  368. package/dist/lib/device-settings.js.map +1 -1
  369. package/dist/lib/direction.js.map +1 -1
  370. package/dist/lib/iban.js.map +1 -1
  371. package/dist/lib/logger.js +1 -5
  372. package/dist/lib/logger.js.map +1 -1
  373. package/dist/lib/person-name.js.map +1 -1
  374. package/dist/lib/phone.js.map +1 -1
  375. package/dist/lib/qr-encode.js +344 -8
  376. package/dist/lib/qr-encode.js.map +1 -1
  377. package/dist/lib/session-refresh.js.map +1 -1
  378. package/dist/lib/table-text.js +15 -3
  379. package/dist/lib/table-text.js.map +1 -1
  380. package/dist/lib/text-match.d.ts +20 -0
  381. package/dist/lib/text-match.js +11 -1
  382. package/dist/lib/text-match.js.map +1 -1
  383. package/dist/lib/translation-review.js.map +1 -1
  384. package/dist/notifications/notification-inbox.js +63 -44
  385. package/dist/notifications/notification-inbox.js.map +1 -1
  386. package/dist/notifications/notification-parts.js.map +1 -1
  387. package/dist/notifications/notification-types-setting.js.map +1 -1
  388. package/dist/notifications/notifications-labels.js.map +1 -1
  389. package/dist/notifications/push-device-setting.js +6 -1
  390. package/dist/notifications/push-device-setting.js.map +1 -1
  391. package/dist/notifications/push-devices-setting.js.map +1 -1
  392. package/dist/notifications/push-worker.js.map +1 -1
  393. package/dist/notifications/quiet-hours-setting.js.map +1 -1
  394. package/dist/notifications/use-push-device.js +4 -1
  395. package/dist/notifications/use-push-device.js.map +1 -1
  396. package/dist/offline/pwa-update-prompt.d.ts +1 -1
  397. package/dist/offline/pwa-update-prompt.js +7 -1
  398. package/dist/offline/pwa-update-prompt.js.map +1 -1
  399. package/dist/offline/query-persistence.js.map +1 -1
  400. package/dist/offline.d.ts +1 -1
  401. package/dist/offline.js +6 -1
  402. package/dist/offline.js.map +1 -1
  403. package/dist/pay/pay.css +8 -1
  404. package/dist/rhf/fields.d.ts +1 -2
  405. package/dist/rhf/fields.js +1 -10
  406. package/dist/rhf/fields.js.map +1 -1
  407. package/dist/rhf/form-core.js +1 -4
  408. package/dist/rhf/form-core.js.map +1 -1
  409. package/dist/rhf/line-items.js.map +1 -1
  410. package/dist/rhf/use-rhf-wizard-step.js.map +1 -1
  411. package/dist/search/command-palette.js +71 -62
  412. package/dist/search/command-palette.js.map +1 -1
  413. package/dist/search/global-search.js +34 -5
  414. package/dist/search/global-search.js.map +1 -1
  415. package/dist/search/search-index.js.map +1 -1
  416. package/dist/settings/device-reset-setting.js +1 -6
  417. package/dist/settings/device-reset-setting.js.map +1 -1
  418. package/dist/settings/settings-heading.js.map +1 -1
  419. package/dist/settings/settings-layout.js +9 -20
  420. package/dist/settings/settings-layout.js.map +1 -1
  421. package/dist/settings/use-settings-focus.d.ts +7 -0
  422. package/dist/settings/use-settings-focus.js +2 -0
  423. package/dist/settings/use-settings-focus.js.map +1 -1
  424. package/dist/settings/use-settings-route.js.map +1 -1
  425. package/dist/shell/app-shell.js +62 -31
  426. package/dist/shell/app-shell.js.map +1 -1
  427. package/dist/shell/auth-layout.js +1 -10
  428. package/dist/shell/auth-layout.js.map +1 -1
  429. package/dist/shell/dev-menu.d.ts +5 -0
  430. package/dist/shell/dev-menu.js +14 -7
  431. package/dist/shell/dev-menu.js.map +1 -1
  432. package/dist/shell/option-switcher-menu.js.map +1 -1
  433. package/dist/shell/sync-status-indicator.js +7 -6
  434. package/dist/shell/sync-status-indicator.js.map +1 -1
  435. package/dist/shell/top-bar-parts-labels.js.map +1 -1
  436. package/dist/shell/topbar-action-menu.d.ts +14 -1
  437. package/dist/shell/topbar-action-menu.js +85 -34
  438. package/dist/shell/topbar-action-menu.js.map +1 -1
  439. package/dist/shell/topbar-controls.js +1 -10
  440. package/dist/shell/topbar-controls.js.map +1 -1
  441. package/dist/shell/tour-menu.js +9 -1
  442. package/dist/shell/tour-menu.js.map +1 -1
  443. package/dist/shell.d.ts +1 -1
  444. package/dist/shell.js +2 -1
  445. package/dist/shell.js.map +1 -1
  446. package/dist/sync/db.js.map +1 -1
  447. package/dist/sync/engine.js +24 -6
  448. package/dist/sync/engine.js.map +1 -1
  449. package/dist/sync.d.ts +2 -2
  450. package/dist/sync.js +7 -1
  451. package/dist/sync.js.map +1 -1
  452. package/dist/testing/css-variables.js.map +1 -1
  453. package/dist/testing/index.d.ts +1 -1
  454. package/dist/testing/index.js +1 -3
  455. package/dist/testing/index.js.map +1 -1
  456. package/dist/testing/react.js.map +1 -1
  457. package/dist/testing/viewport.js +7 -4
  458. package/dist/testing/viewport.js.map +1 -1
  459. package/dist/theme/contrast-tokens.js +13 -2
  460. package/dist/theme/contrast-tokens.js.map +1 -1
  461. package/dist/theme/palette-derive.d.ts +1 -1
  462. package/dist/theme/palette-derive.js +18 -29
  463. package/dist/theme/palette-derive.js.map +1 -1
  464. package/dist/theme/palette-presets.js.map +1 -1
  465. package/dist/theme/palette-store.js.map +1 -1
  466. package/dist/theme/text-size.js.map +1 -1
  467. package/dist/theme/theme-store.js +1 -3
  468. package/dist/theme/theme-store.js.map +1 -1
  469. package/dist/tour/tour-catalogue.js.map +1 -1
  470. package/dist/tour/tour-dock.js +5 -1
  471. package/dist/tour/tour-dock.js.map +1 -1
  472. package/dist/tour/tour-engine.js +1 -4
  473. package/dist/tour/tour-engine.js.map +1 -1
  474. package/dist/tour/tour.js +21 -12
  475. package/dist/tour/tour.js.map +1 -1
  476. package/dist/tour/use-tour-progress.js.map +1 -1
  477. package/dist/tour/use-tour-url-sync.js.map +1 -1
  478. package/dist/wizard/stepper-nav.js +3 -24
  479. package/dist/wizard/stepper-nav.js.map +1 -1
  480. package/dist/wizard/types.js.map +1 -1
  481. package/dist/wizard/use-wizard.js +24 -28
  482. package/dist/wizard/use-wizard.js.map +1 -1
  483. package/dist/wizard/validation.js.map +1 -1
  484. package/dist/wizard/wizard-context.js.map +1 -1
  485. package/dist/wizard/wizard-step.d.ts +1 -1
  486. package/dist/wizard/wizard-step.js +1 -8
  487. package/dist/wizard/wizard-step.js.map +1 -1
  488. package/dist/wizard/wizard-summary.js.map +1 -1
  489. package/package.json +5 -2
  490. package/src/account/account-settings-labels.ts +1 -2
  491. package/src/account/account-settings.tsx +11 -17
  492. package/src/account/delete-account-setting.tsx +1 -6
  493. package/src/account/email-change-setting-labels.ts +1 -2
  494. package/src/account/email-change-setting.tsx +3 -1
  495. package/src/account/passkeys-setting.tsx +1 -3
  496. package/src/account/sessions-setting.tsx +4 -2
  497. package/src/admin/admin-action-confirm.tsx +4 -7
  498. package/src/admin/admin-action-log.tsx +29 -29
  499. package/src/admin/admin-area-labels.ts +4 -1
  500. package/src/admin/admin-overview.tsx +8 -2
  501. package/src/admin/admin-sections.tsx +3 -1
  502. package/src/admin/admin-tool-links.tsx +7 -1
  503. package/src/admin/invitations-panel.tsx +5 -11
  504. package/src/admin/mail-test-card.tsx +1 -2
  505. package/src/admin/reviewer-scope-editor.tsx +4 -9
  506. package/src/admin/role-select.tsx +4 -2
  507. package/src/admin/user-roster.tsx +2 -11
  508. package/src/auth/accept-invitation.tsx +1 -7
  509. package/src/auth/auth-errors.ts +1 -6
  510. package/src/auth/forgot-password-form.tsx +2 -7
  511. package/src/auth/register-form.tsx +7 -8
  512. package/src/auth/reset-password-form.tsx +2 -5
  513. package/src/auth/sign-in-form.tsx +15 -14
  514. package/src/auth/verify-email.tsx +2 -7
  515. package/src/billing/billing-banner.tsx +3 -7
  516. package/src/billing/billing-labels.ts +6 -4
  517. package/src/billing/checkout-processing.ts +0 -1
  518. package/src/billing/plan-card.tsx +9 -8
  519. package/src/billing/plan-limit-toast.tsx +1 -2
  520. package/src/billing/plan-limit.ts +1 -2
  521. package/src/billing/plan-price.ts +1 -4
  522. package/src/billing/plan-switch.tsx +1 -2
  523. package/src/billing/subscription-actions.tsx +5 -2
  524. package/src/components/account-chips.tsx +1 -7
  525. package/src/components/alert-banner.tsx +2 -8
  526. package/src/components/amount-input.tsx +206 -178
  527. package/src/components/authed-image.tsx +7 -4
  528. package/src/components/autocomplete.tsx +7 -9
  529. package/src/components/bulk-action-bar.tsx +2 -7
  530. package/src/components/button-group.tsx +1 -2
  531. package/src/components/button-look.ts +6 -17
  532. package/src/components/button.tsx +1 -4
  533. package/src/components/calculator.tsx +6 -9
  534. package/src/components/calendar-heatmap.tsx +5 -10
  535. package/src/components/card.tsx +9 -13
  536. package/src/components/chart-zoom-core.tsx +6 -33
  537. package/src/components/chart.tsx +8 -31
  538. package/src/components/checkbox-group.tsx +1 -4
  539. package/src/components/chip-input.tsx +6 -6
  540. package/src/components/chip.tsx +14 -26
  541. package/src/components/choice-card.tsx +4 -18
  542. package/src/components/column-mapper-labels.ts +3 -10
  543. package/src/components/column-mapper.tsx +33 -122
  544. package/src/components/combobox-core.tsx +17 -47
  545. package/src/components/combobox.tsx +2 -6
  546. package/src/components/confirm-dialog.tsx +1 -3
  547. package/src/components/copy-button.tsx +2 -4
  548. package/src/components/country-select.tsx +9 -21
  549. package/src/components/currency-option-list.tsx +16 -18
  550. package/src/components/currency-select.tsx +2 -7
  551. package/src/components/danger-confirm.tsx +8 -9
  552. package/src/components/data-table-cells.tsx +1 -2
  553. package/src/components/data-table-column-settings.tsx +1 -3
  554. package/src/components/data-table-filter-popover.tsx +5 -19
  555. package/src/components/data-table-filters.ts +1 -6
  556. package/src/components/data-table-fit.ts +7 -7
  557. package/src/components/data-table-groups.tsx +3 -1
  558. package/src/components/data-table-head.tsx +32 -46
  559. package/src/components/data-table-mobile.tsx +99 -108
  560. package/src/components/data-table-pagination.tsx +2 -6
  561. package/src/components/data-table-row-actions.tsx +25 -24
  562. package/src/components/data-table-row.tsx +16 -17
  563. package/src/components/data-table-shared.tsx +10 -16
  564. package/src/components/data-table-sort.ts +1 -2
  565. package/src/components/data-table-virtual.ts +9 -4
  566. package/src/components/data-table.tsx +497 -501
  567. package/src/components/date-picker.tsx +1 -7
  568. package/src/components/date-range-picker.tsx +3 -13
  569. package/src/components/description-list.tsx +7 -13
  570. package/src/components/dialog-frame.tsx +12 -3
  571. package/src/components/disclosure.tsx +8 -12
  572. package/src/components/dropdown.tsx +3 -11
  573. package/src/components/empty-state.tsx +1 -3
  574. package/src/components/entity-combobox.tsx +2 -6
  575. package/src/components/error-boundary.tsx +7 -7
  576. package/src/components/field-base.tsx +8 -14
  577. package/src/components/field-parts.tsx +12 -23
  578. package/src/components/field-sync.tsx +7 -11
  579. package/src/components/file-button.tsx +7 -3
  580. package/src/components/file-dropzone.tsx +7 -12
  581. package/src/components/floating-panel.tsx +44 -51
  582. package/src/components/focus-ring.ts +1 -2
  583. package/src/components/form-actions.tsx +1 -4
  584. package/src/components/grouped-picker.tsx +21 -16
  585. package/src/components/hover-menu.tsx +1 -4
  586. package/src/components/iban-input-labels.ts +1 -2
  587. package/src/components/icon-button.tsx +46 -48
  588. package/src/components/icon-picker.tsx +9 -20
  589. package/src/components/image-grid.tsx +1 -6
  590. package/src/components/inline-edit-field.tsx +1 -5
  591. package/src/components/inline-entity-combobox.tsx +11 -25
  592. package/src/components/input.tsx +14 -2
  593. package/src/components/jump-calendar.tsx +2 -6
  594. package/src/components/legal-labels.ts +8 -3
  595. package/src/components/legal-page.tsx +56 -6
  596. package/src/components/legal.tsx +83 -10
  597. package/src/components/lightbox.tsx +1 -3
  598. package/src/components/line-items.tsx +7 -15
  599. package/src/components/list-labels.ts +2 -0
  600. package/src/components/list.tsx +81 -27
  601. package/src/components/measured-grid.tsx +8 -30
  602. package/src/components/menu-item.tsx +1 -3
  603. package/src/components/mini-calendar.tsx +129 -159
  604. package/src/components/money-field.tsx +4 -2
  605. package/src/components/month-picker.tsx +14 -21
  606. package/src/components/multi-entity-combobox.tsx +6 -26
  607. package/src/components/multi-select.tsx +5 -9
  608. package/src/components/nav-pills.tsx +10 -2
  609. package/src/components/number-field.tsx +18 -15
  610. package/src/components/number-input.tsx +3 -19
  611. package/src/components/numpad-sheet.tsx +9 -13
  612. package/src/components/one-time-code-input.tsx +6 -11
  613. package/src/components/page-contents.tsx +2 -9
  614. package/src/components/page-header.tsx +5 -10
  615. package/src/components/password-strength-labels.ts +1 -2
  616. package/src/components/password-strength.tsx +6 -9
  617. package/src/components/phone-input.tsx +2 -13
  618. package/src/components/picker-sheet.tsx +2 -5
  619. package/src/components/pie-chart.tsx +6 -12
  620. package/src/components/popover.tsx +2 -1
  621. package/src/components/progress-bar.tsx +16 -25
  622. package/src/components/qr-code.tsx +2 -9
  623. package/src/components/row-actions.tsx +9 -1
  624. package/src/components/search-field.tsx +4 -5
  625. package/src/components/select.tsx +2 -10
  626. package/src/components/separator.tsx +1 -5
  627. package/src/components/series-chart-axes.ts +5 -5
  628. package/src/components/series-chart-budget.ts +1 -4
  629. package/src/components/series-chart-ticks.ts +1 -4
  630. package/src/components/series-chart.tsx +43 -83
  631. package/src/components/settings-fields.tsx +20 -15
  632. package/src/components/share-card.tsx +6 -14
  633. package/src/components/sign-chip.tsx +16 -16
  634. package/src/components/signature-pad.tsx +21 -13
  635. package/src/components/signed-amount.tsx +6 -14
  636. package/src/components/skeleton.tsx +2 -13
  637. package/src/components/slider.tsx +9 -20
  638. package/src/components/sparkline.tsx +2 -13
  639. package/src/components/stat-tile.tsx +13 -24
  640. package/src/components/swatch-picker.tsx +8 -3
  641. package/src/components/swipeable-row.tsx +2 -11
  642. package/src/components/table-skeleton.tsx +4 -1
  643. package/src/components/table.tsx +12 -8
  644. package/src/components/tabs.tsx +24 -39
  645. package/src/components/text-link.tsx +6 -6
  646. package/src/components/text.tsx +1 -2
  647. package/src/components/tile-radio.tsx +6 -19
  648. package/src/components/time-input.tsx +4 -5
  649. package/src/components/toast.tsx +3 -12
  650. package/src/components/toggle-group.tsx +9 -9
  651. package/src/components/toggle-legend.tsx +4 -16
  652. package/src/components/tooltip.tsx +9 -48
  653. package/src/components/translation-review-editor.tsx +4 -4
  654. package/src/components/translation-review-parts.tsx +7 -1
  655. package/src/components/translation-review.tsx +15 -16
  656. package/src/components/tree-view.tsx +17 -20
  657. package/src/components/treemap.tsx +3 -15
  658. package/src/components/trigger-aria.ts +1 -4
  659. package/src/components/use-table-state.ts +16 -17
  660. package/src/components/user-avatar.tsx +4 -21
  661. package/src/demo/demo-start.tsx +8 -4
  662. package/src/feedback/feedback-attachment-labels.ts +2 -1
  663. package/src/feedback/feedback-attachment.tsx +16 -29
  664. package/src/feedback/feedback-capture.ts +3 -1
  665. package/src/feedback/feedback-comment-thread.tsx +9 -6
  666. package/src/feedback/feedback-context.tsx +1 -4
  667. package/src/feedback/feedback-dialog.tsx +3 -4
  668. package/src/feedback/feedback-inbox.tsx +3 -9
  669. package/src/feedback/feedback-public-list.tsx +7 -1
  670. package/src/feedback/feedback-record.ts +6 -14
  671. package/src/feedback/feedback-replies.tsx +10 -5
  672. package/src/feedback/feedback-row-detail.tsx +2 -5
  673. package/src/feedback/feedback-status-undo.ts +1 -4
  674. package/src/feedback/feedback-submit-dialog.tsx +4 -4
  675. package/src/feedback/feedback-table.tsx +29 -9
  676. package/src/feedback/feedback-thread.tsx +4 -16
  677. package/src/feedback/feedback-vocabulary.ts +72 -82
  678. package/src/feedback/feedback-vote-button.tsx +9 -8
  679. package/src/hooks/use-anchored-rect.ts +1 -4
  680. package/src/hooks/use-document-title.ts +3 -1
  681. package/src/hooks/use-file-drop.ts +1 -3
  682. package/src/hooks/use-file-picker-labels.ts +1 -2
  683. package/src/hooks/use-file-picker.tsx +1 -5
  684. package/src/hooks/use-focus-trap.ts +1 -2
  685. package/src/hooks/use-overlay-history.ts +10 -5
  686. package/src/hooks/use-row-swipe.ts +1 -6
  687. package/src/i18n/defaults.ts +1 -4
  688. package/src/i18n/german.ts +42 -50
  689. package/src/i18n/kit-labels.tsx +5 -20
  690. package/src/i18n/languages.ts +2 -8
  691. package/src/i18n/locales/en.ts +15 -31
  692. package/src/i18n/locales/es.ts +44 -50
  693. package/src/i18n/locales/fr.ts +43 -52
  694. package/src/i18n/locales/hu.ts +35 -38
  695. package/src/i18n/locales/it.ts +44 -53
  696. package/src/i18n/locales/zh.ts +23 -33
  697. package/src/i18n/plurals.ts +4 -1
  698. package/src/i18n/review.ts +20 -7
  699. package/src/i18n/shared-labels.ts +1 -2
  700. package/src/index.ts +107 -32
  701. package/src/landing/access.ts +2 -7
  702. package/src/landing/landing-sections.tsx +14 -15
  703. package/src/landing/page-seo.ts +1 -3
  704. package/src/lib/calc.ts +4 -1
  705. package/src/lib/clipboard-minus.ts +4 -1
  706. package/src/lib/dates.ts +2 -10
  707. package/src/lib/decimal-marks.ts +1 -3
  708. package/src/lib/device-settings.ts +2 -1
  709. package/src/lib/direction.ts +1 -3
  710. package/src/lib/iban.ts +89 -9
  711. package/src/lib/logger.ts +1 -5
  712. package/src/lib/person-name.ts +1 -3
  713. package/src/lib/phone.ts +5 -8
  714. package/src/lib/qr-encode.ts +32 -8
  715. package/src/lib/session-refresh.ts +5 -6
  716. package/src/lib/table-text.ts +24 -6
  717. package/src/lib/text-match.ts +43 -1
  718. package/src/lib/translation-review.ts +1 -3
  719. package/src/notifications/notification-inbox.tsx +17 -4
  720. package/src/notifications/notification-parts.tsx +1 -2
  721. package/src/notifications/notification-types-setting.tsx +19 -18
  722. package/src/notifications/notifications-labels.ts +1 -2
  723. package/src/notifications/push-device-setting.tsx +7 -1
  724. package/src/notifications/push-devices-setting.tsx +7 -3
  725. package/src/notifications/push-worker.ts +10 -2
  726. package/src/notifications/quiet-hours-setting.tsx +4 -1
  727. package/src/notifications/use-push-device.ts +4 -1
  728. package/src/offline/pwa-update-prompt.tsx +7 -1
  729. package/src/offline/query-persistence.ts +9 -6
  730. package/src/offline.ts +6 -1
  731. package/src/rhf/fields.tsx +50 -19
  732. package/src/rhf/form-core.tsx +2 -6
  733. package/src/rhf/line-items.tsx +5 -7
  734. package/src/rhf/use-rhf-wizard-step.ts +3 -12
  735. package/src/search/command-palette.tsx +15 -23
  736. package/src/search/global-search.tsx +38 -8
  737. package/src/search/search-index.ts +5 -1
  738. package/src/settings/device-reset-setting.tsx +5 -8
  739. package/src/settings/settings-heading.tsx +3 -1
  740. package/src/settings/settings-layout.tsx +6 -13
  741. package/src/settings/use-settings-focus.ts +8 -0
  742. package/src/settings/use-settings-route.ts +4 -3
  743. package/src/shell/app-shell.tsx +48 -24
  744. package/src/shell/auth-layout.tsx +1 -6
  745. package/src/shell/dev-menu.tsx +18 -6
  746. package/src/shell/option-switcher-menu.tsx +1 -3
  747. package/src/shell/sync-status-indicator.tsx +14 -12
  748. package/src/shell/top-bar-parts-labels.ts +1 -3
  749. package/src/shell/topbar-action-menu.tsx +130 -45
  750. package/src/shell/topbar-controls.tsx +5 -19
  751. package/src/shell/tour-menu.tsx +9 -1
  752. package/src/shell.ts +1 -1
  753. package/src/sync/db.ts +5 -1
  754. package/src/sync/engine.ts +44 -12
  755. package/src/sync.ts +16 -2
  756. package/src/testing/css-variables.ts +1 -2
  757. package/src/testing/index.ts +1 -6
  758. package/src/testing/react.ts +1 -2
  759. package/src/testing/viewport.ts +9 -9
  760. package/src/theme/contrast-tokens.ts +13 -2
  761. package/src/theme/palette-derive.ts +24 -50
  762. package/src/theme/palette-presets.ts +0 -1
  763. package/src/theme/palette-store.ts +1 -4
  764. package/src/theme/text-size.ts +1 -1
  765. package/src/theme/theme-store.ts +2 -6
  766. package/src/tour/tour-catalogue.tsx +4 -2
  767. package/src/tour/tour-dock.ts +5 -1
  768. package/src/tour/tour-engine.ts +2 -6
  769. package/src/tour/tour.tsx +28 -12
  770. package/src/tour/use-tour-progress.ts +8 -2
  771. package/src/tour/use-tour-url-sync.ts +3 -1
  772. package/src/vite-env.d.ts +1 -4
  773. package/src/wizard/stepper-nav.tsx +10 -35
  774. package/src/wizard/types.ts +1 -4
  775. package/src/wizard/use-wizard.ts +28 -43
  776. package/src/wizard/validation.ts +1 -5
  777. package/src/wizard/wizard-context.tsx +2 -6
  778. package/src/wizard/wizard-step.tsx +1 -8
  779. package/src/wizard/wizard-summary.tsx +2 -6
  780. package/tokens.css +393 -152
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/admin/admin-action-log.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { cn } from \"../lib/cn\";\nimport type { DateInput } from \"../lib/format\";\nimport { useKitLabels } from \"../i18n/kit-labels\";\nimport type { LabelOverride } from \"../i18n/kit-labels\";\nimport { DateMark } from \"../components/account-chips\";\nimport { Chip } from \"../components/chip\";\nimport { Pagination } from \"../components/data-table-pagination\";\nimport { Caption } from \"../components/text\";\nimport { Button } from \"../components/button\";\nimport { Spinner } from \"../components/spinner\";\nimport { usePersonLabel } from \"./admin-parts\";\nimport type { AdminPerson } from \"./admin-parts\";\nimport { DEFAULT_ADMIN_ACTION_LOG_LABELS } from \"./admin-action-log-labels\";\n\n/**\n * The admin actions, as the audit table records them (docs/user-admin-harmonization.md\n * §2.3, §4.3): `GET /admin/actions?limit=&offset=&target=`, newest first, on the admin\n * page and filtered to one account from its row.\n *\n * Every app writes the same small `admin_actions` row in the transaction of the action\n * (keksdose and Kurvenschmiede had log lines; kastlan has an HTTP log with no named\n * action), so the vocabulary is shared — {@link AdminActionKind} — and an app's own\n * actions join it through `labels.actions`.\n *\n * What a row says, and what it never does: who, what, to whom, when, and a summary of the\n * `detail` the APP writes (ids, roles, counts — never content, §4.3). Three kinds of\n * actor: an admin; **the user themselves** (`deletion_request`: the actor is the target);\n * and **nobody** (the scheduled erasure, the hand-over at erasure, §2.7), said as\n * \"automatically\". After an erasure the target's name and address are scrubbed and the\n * row stays: it reads \"an erased account\".\n *\n * GROUPS (round 0.34, §11): Kurvenschmiede's teams, kastlan's companies and keksdose's\n * budgets are groups of accounts, and the vocabulary has words for what is done to one\n * (`group_create`, `group_rename`, `group_delete`) and to who is in it (`membership_add`,\n * `membership_role`, `membership_remove`). A row about the group itself has the group as\n * its `target`; a row about a person in it has the person as its target and the group as\n * its `group`, drawn after the person by its name alone, muted — no preposition, so no\n * language has to inflect the name. The kinds and codes say \"group\"; the labels say the\n * app's own noun, picked with `groupNoun` — whole phrases per noun, since a noun dropped\n * into one phrase breaks the participle's agreement in fr and it and the suffix in hu\n * (decision 4). A group with no name left reads as the noun's \"a deleted team\"; only a\n * missing PERSON is \"an erased account\".\n *\n * It never fetches: the page of rows and the paging are the app's.\n */\n\n/** The shared vocabulary of `admin_actions.action` (§4.3). */\nexport type AdminActionKind =\n | \"deactivate\"\n | \"reactivate\"\n | \"role\"\n | \"membership_remove\"\n | \"password_change_require\"\n | \"password_change_withdraw\"\n | \"mail_verification\"\n | \"mail_reset\"\n | \"reviewer\"\n | \"invite\"\n | \"invite_resend\"\n | \"invite_revoke\"\n | \"transfer\"\n | \"deletion_request\"\n | \"deletion_cancel\"\n | \"erase\"\n // 0.32.1 (keksdose's 0.32 report): server-kit 0.6's `AdminAction.PLAN`, an operator's\n // plan change or grant (docs/billing-harmonization.md §6).\n | \"plan\"\n // 0.34 (§11.3): what is done to a group of accounts, and to who is in it — beside\n // `membership_remove`. server-kit 0.8's `AdminAction` has the same five.\n | \"group_create\"\n | \"group_rename\"\n | \"group_delete\"\n | \"membership_add\"\n | \"membership_role\"\n // 0.45 (admin §9.1.3): a group switched off or on again — kastlan's company PATCH\n // (`is_active`). server-kit 0.15's `AdminAction.GROUP_DEACTIVATE` / `GROUP_REACTIVATE`.\n | \"group_deactivate\"\n | \"group_reactivate\";\n\n/** Every {@link AdminActionKind}, in the contract's order. */\nexport const ADMIN_ACTION_KINDS: readonly AdminActionKind[] = [\n \"deactivate\",\n \"reactivate\",\n \"role\",\n \"membership_remove\",\n \"password_change_require\",\n \"password_change_withdraw\",\n \"mail_verification\",\n \"mail_reset\",\n \"reviewer\",\n \"invite\",\n \"invite_resend\",\n \"invite_revoke\",\n \"transfer\",\n \"deletion_request\",\n \"deletion_cancel\",\n \"erase\",\n \"plan\",\n \"group_create\",\n \"group_rename\",\n \"group_delete\",\n \"membership_add\",\n \"membership_role\",\n \"group_deactivate\",\n \"group_reactivate\",\n];\n\n/** The app's word for its groups (§11.5): Kurvenschmiede's teams, kastlan's companies,\n * keksdose's budgets; `group` is the neutral word. Picks the set of phrases the group\n * actions are said in. */\nexport type AdminGroupNoun = \"group\" | \"team\" | \"company\" | \"budget\";\n\n/** The kinds said in the noun's words: the five of 0.34, `membership_remove`, and 0.45's\n * `group_deactivate` / `group_reactivate`. */\ntype AdminGroupActionKind =\n | \"group_create\"\n | \"group_rename\"\n | \"group_delete\"\n | \"group_deactivate\"\n | \"group_reactivate\"\n | \"membership_add\"\n | \"membership_role\"\n | \"membership_remove\";\n\nconst GROUP_ACTION_KINDS: ReadonlySet<string> = new Set<AdminGroupActionKind>([\n \"group_create\",\n \"group_rename\",\n \"group_delete\",\n \"group_deactivate\",\n \"group_reactivate\",\n \"membership_add\",\n \"membership_role\",\n \"membership_remove\",\n]);\n\n/**\n * A group as a log target (§11.4): a row about the group itself (`group_*`, kastlan's\n * `plan`), or the `group` a person was added to, moved in or taken out of. The app joins\n * its `name` when the log is read — from the live group, else from its `group_delete`\n * row's stamp (`target_group_name`, decision 6) — as it joins a person's. With no name\n * left it reads as the noun's \"a deleted team\".\n */\nexport interface AdminGroupTarget {\n kind: \"group\";\n id?: string | number | null;\n name?: string | null;\n}\n\n/** A target that is neither a person nor a group (§11.4): an app's own action on a demo\n * dataset or a setting, said by its `label`. */\nexport interface AdminOtherTarget {\n kind: \"other\";\n /** What it was done to, in the app's words, as it is drawn. */\n label: string;\n /** The app's id for it, when it has one. Beyond §11.4's shape so that code reading\n * `entry.target.id` on any target — keksdose's filter, the showcase's — still\n * type-checks against the wider union. */\n id?: string | number | null;\n}\n\n/** Whether a target is a group. A person has no `kind`; an object whose `kind` is\n * anything else is read as a person too. */\nexport function isGroupTarget(target: unknown): target is AdminGroupTarget {\n return typeof target === \"object\" && target !== null && (target as { kind?: unknown }).kind === \"group\";\n}\n\nfunction isOtherTarget(target: unknown): target is AdminOtherTarget {\n return typeof target === \"object\" && target !== null && (target as { kind?: unknown }).kind === \"other\";\n}\n\n/** One logged action — the app's `admin_actions` row with the people joined in. */\nexport interface AdminActionLogEntry {\n id: string | number;\n /** When, as the row's `at`. */\n at: DateInput;\n /**\n * Who did it: a person; `\"self\"` — the user themselves (a deletion request); or `null`\n * — nobody, the scheduled job. A person whose `id` (or address) is the target's is\n * read as `\"self\"` too.\n */\n actor: AdminPerson | \"self\" | null;\n /** A {@link AdminActionKind}, or one of the app's own (named in `labels.actions`). */\n action: AdminActionKind | (string & {});\n /**\n * What it was done to (§11.4): a person (no `kind`) — `null`, or a person with nothing\n * left in it, is \"an erased account\", and an invitation's person is its address\n * (`target_email`); a group (`kind: \"group\"`), for a row about the group itself; or\n * something else (`kind: \"other\"`), said by its label. Left out: nothing is drawn\n * (until 0.34 it read as erased).\n */\n target?: AdminPerson | AdminGroupTarget | AdminOtherTarget | null;\n /** The group a `membership_*` or invitation row happened in, drawn after the person\n * by its name (§11.4). */\n group?: AdminGroupTarget | null;\n /** The `detail` in the app's words — \"Member → Admin\", \"12 items to Ben Example\". */\n detail?: ReactNode;\n /**\n * 0.45 (admin §9.4, Marcel 2026-10-19): a `group_rename` row's `detail.{from, to}` —\n * kastlan's company rename logs both names. With both, the row reads \"Company renamed\n * from A to B\" (`renamedFromTo`) in place of the target. A rename that logs `{}` (KS's\n * team rename: never a name) leaves it out and reads \"Team renamed\" and the group.\n */\n renamed?: { from?: string | null; to?: string | null } | null;\n}\n\n/** The `adminActionLog` namespace. */\nexport interface AdminActionLogLabels {\n /** The list's accessible name. */\n title: string;\n empty: string;\n loading: string;\n /** \"by Ada Example\". */\n by: (actor: string) => string;\n /** The user acted on their own account. */\n bySelf: string;\n /** No actor: a scheduled job. */\n automatic: string;\n /** A target scrubbed by an erasure. */\n erased: string;\n /** The filter chip: only one account's actions are shown. */\n filteredTo: (target: string) => string;\n /** The chip's ×. */\n showAll: string;\n /** A target name as a filter button — \"Show only the actions on Ada Example\". */\n filterBy: (target: string) => string;\n /** 0.45: after \"Company renamed\" when the row carries both names — \"from A to B\". */\n renamedFromTo: (from: string, to: string) => string;\n /** What each action is called, past tense, keyed by the vocabulary. An app adds its\n * own here (`labels={{ actions: { plan: \"Plan changed\" } }}`). A word given here\n * outranks the noun's in `groupActions` — so no catalogue holds the group kinds\n * here, `membership_remove` included (0.34). */\n actions: { [K in AdminActionKind]?: string } & { [action: string]: string | undefined };\n /** The group actions in each noun's words (§11.5), picked with `groupNoun`. */\n groupActions: Record<AdminGroupNoun, AdminGroupActionLabels>;\n}\n\n/** One noun's phrases (§11.5): whole phrases, never a noun dropped into one. */\ninterface AdminGroupActionLabels {\n /** \"Team created\". */\n group_create: string;\n /** \"Team renamed\". */\n group_rename: string;\n /** \"Team deleted\". */\n group_delete: string;\n /** \"Company deactivated\" (0.45, admin §9.1.3): the group switched off — its people\n * locked out — not a person's `deactivate`. */\n group_deactivate: string;\n /** \"Company reactivated\" (0.45). */\n group_reactivate: string;\n /** \"Added to the team\" — said of the person, so it agrees with the account where a\n * language agrees (es \"Añadida\", fr \"Ajouté\"). */\n membership_add: string;\n /** \"Role in the team changed\" — the role in the group, not the account's (`role`). */\n membership_role: string;\n /** \"Removed from the team\". The `company` set's is the string `actions` held until\n * 0.34, in every language. */\n membership_remove: string;\n /** A group target with no name left: \"a deleted team\". */\n deleted: string;\n}\n\n// Defined in ./admin-action-log-labels, which holds no component code (0.34, KS U8).\nexport { DEFAULT_ADMIN_ACTION_LOG_LABELS };\n\n/** The paging of `GET /admin/actions` — DataTable's `ServerPagination`, which the\n * footer is. */\nexport interface AdminActionLogPaging {\n /** 0-based. */\n page: number;\n pageSize: number;\n total: number;\n onPageChange: (page: number) => void;\n onPageSizeChange?: (pageSize: number) => void;\n}\n\nexport interface AdminActionLogProps {\n /** One page, newest first, as the server sends it. */\n entries: readonly AdminActionLogEntry[];\n /** Left out: no footer (a short list on a row). */\n paging?: AdminActionLogPaging;\n /** The page is being fetched. */\n loading?: boolean;\n /** The filter in force: only this account's actions are shown (`?target=`). With\n * `onTargetFilter`, a chip says so and its × clears it. */\n target?: AdminPerson | null;\n /** Filter by an account — or clear it with `null`. Given, every person target's name\n * is a button that narrows the list to it; a group or other target never is (0.34:\n * `?target=` stays a person's). Left out, the list is not filterable here. */\n onTargetFilter?: (target: AdminPerson | null) => void;\n /** The app's word for its groups (§11.5): picks the phrases the group actions and \"a\n * deleted …\" are said in. Default `group`; `labels.actions[kind]` still wins. */\n groupNoun?: AdminGroupNoun;\n className?: string;\n /** Any part, at any depth: `{ groupActions: { team: { group_create: \"…\" } } }`. */\n labels?: LabelOverride<AdminActionLogLabels>;\n}\n\n/** Whether a person has nothing left that names them — an erased target. */\nfunction scrubbed(person: AdminPerson | null | undefined): boolean {\n return !person || ![person.first, person.last, person.name, person.email].some((part) => (part ?? \"\").trim());\n}\n\n/** Whether two people are the same account. A group or other target is never a person\n * (§11.4), so it never reads \"by the user themselves\". */\nfunction samePerson(a: AdminPerson, b: AdminActionLogEntry[\"target\"]): boolean {\n if (!b || isGroupTarget(b) || isOtherTarget(b)) return false;\n if (a.id !== undefined && a.id !== null && b.id !== undefined && b.id !== null) return a.id === b.id;\n const ea = (a.email ?? \"\").trim().toLowerCase();\n return ea !== \"\" && ea === (b.email ?? \"\").trim().toLowerCase();\n}\n\nexport function AdminActionLog({\n entries,\n paging,\n loading = false,\n target,\n onTargetFilter,\n groupNoun = \"group\",\n className,\n labels: labelsProp,\n}: AdminActionLogProps) {\n // Merged key by key at every depth, so a deep override is what `useKitLabels` takes.\n const labels = useKitLabels(\"adminActionLog\", DEFAULT_ADMIN_ACTION_LOG_LABELS, labelsProp);\n const nameOf = usePersonLabel();\n const filtered = target !== undefined && target !== null && !scrubbed(target);\n // A noun the type doesn't know (an app in plain JS) says the neutral word.\n const groupWords = labels.groupActions[groupNoun] ?? labels.groupActions.group;\n\n /** An app's own word first, then the noun's phrase for a group kind, else the key. */\n const actionText = (action: string): string =>\n labels.actions[action] ??\n (GROUP_ACTION_KINDS.has(action) ? groupWords[action as AdminGroupActionKind] : undefined) ??\n action;\n\n /** A group by its name, or — muted, as an erased person is — the noun's \"a deleted\n * team\" when none is left. */\n const groupText = (group: AdminGroupTarget, className?: string): ReactNode => {\n const name = (group.name ?? \"\").trim();\n return name ? (\n <span data-private className={className}>\n {name}\n </span>\n ) : (\n <span className=\"italic text-muted\">{groupWords.deleted}</span>\n );\n };\n\n const actorText = (entry: AdminActionLogEntry): string => {\n const { actor } = entry;\n if (actor === null) return labels.automatic;\n if (actor === \"self\" || samePerson(actor, entry.target)) return labels.bySelf;\n return labels.by(nameOf(actor) || labels.erased);\n };\n\n const targetNode = (entry: AdminActionLogEntry): ReactNode => {\n const subject = entry.target;\n // Left out: nothing (§11.4). `null` is a person the erasure took.\n if (subject === undefined) return null;\n if (isGroupTarget(subject)) return groupText(subject, \"font-medium text-primary\");\n if (isOtherTarget(subject)) return <span className=\"font-medium text-primary\">{subject.label}</span>;\n if (scrubbed(subject)) return <span className=\"italic text-muted\">{labels.erased}</span>;\n const person = subject!;\n const name = nameOf(person);\n const address = (person.email ?? \"\").trim();\n const text = (\n <>\n <span data-private className=\"font-medium text-primary\">\n {name}\n </span>\n {address && address !== name && (\n <span data-private className=\"ms-1 text-xs text-muted\">\n {address}\n </span>\n )}\n </>\n );\n if (!onTargetFilter || (filtered && samePerson(person, target))) return text;\n return (\n <Button\n type=\"button\"\n variant=\"link\"\n size=\"sm\"\n className=\"h-auto min-h-0 p-0 text-start\"\n aria-label={labels.filterBy(name)}\n onClick={() => onTargetFilter(person)}\n >\n {text}\n </Button>\n );\n };\n\n return (\n <div className={cn(\"space-y-3\", className)}>\n {filtered && onTargetFilter && (\n <Chip size=\"sm\" tone=\"brand\" onRemove={() => onTargetFilter(null)} removeLabel={labels.showAll}>\n <span data-private>{labels.filteredTo(nameOf(target))}</span>\n </Chip>\n )}\n {loading && entries.length === 0 ? (\n <div className=\"flex justify-center py-4\">\n <Spinner label={labels.loading} />\n </div>\n ) : entries.length === 0 ? (\n <Caption>{labels.empty}</Caption>\n ) : (\n <ol\n aria-label={labels.title}\n aria-busy={loading || undefined}\n className={cn(\"divide-y divide-subtle\", loading && \"opacity-60\")}\n >\n {entries.map((entry) => {\n const from = (entry.renamed?.from ?? \"\").trim();\n const to = (entry.renamed?.to ?? \"\").trim();\n const renamed = entry.action === \"group_rename\" && from !== \"\" && to !== \"\";\n return (\n <li key={entry.id} data-action={entry.action} className=\"space-y-0.5 py-2 first:pt-0 last:pb-0\">\n <div className=\"flex flex-wrap items-baseline justify-between gap-x-3 gap-y-0.5\">\n <div className=\"flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-0.5 text-sm\">\n <span className=\"font-medium text-primary\">{actionText(entry.action)}</span>\n {renamed ? (\n <span data-private data-renamed className=\"min-w-0 break-words text-primary\">\n {labels.renamedFromTo(from, to)}\n </span>\n ) : (\n entry.target !== undefined && <span className=\"min-w-0 break-words\">{targetNode(entry)}</span>\n )}\n {entry.group && (\n <span data-group className=\"min-w-0 break-words text-xs text-muted\">\n {groupText(entry.group)}\n </span>\n )}\n </div>\n <DateMark value={entry.at} display=\"relative\" className=\"text-xs text-muted\" />\n </div>\n <div className=\"text-xs text-muted\">\n <span data-private={entry.actor !== null && entry.actor !== \"self\" ? true : undefined}>\n {actorText(entry)}\n </span>\n {entry.detail !== undefined && entry.detail !== null && entry.detail !== \"\" && (\n <>\n {\" · \"}\n <span className=\"text-secondary\">{entry.detail}</span>\n </>\n )}\n </div>\n </li>\n );\n })}\n </ol>\n )}\n {paging && paging.total > 0 && (\n <Pagination\n page={paging.page}\n pageSize={paging.pageSize}\n total={paging.total}\n totalPages={Math.max(1, Math.ceil(paging.total / Math.max(1, paging.pageSize)))}\n onPage={paging.onPageChange}\n onPageSize={paging.onPageSizeChange}\n />\n )}\n </div>\n );\n}\n"],"mappings":";AAoVM,SA0BA,UA1BA,KA0BA,YA1BA;AAnVN,SAAS,UAAU;AAEnB,SAAS,oBAAoB;AAE7B,SAAS,gBAAgB;AACzB,SAAS,YAAY;AACrB,SAAS,kBAAkB;AAC3B,SAAS,eAAe;AACxB,SAAS,cAAc;AACvB,SAAS,eAAe;AACxB,SAAS,sBAAsB;AAE/B,SAAS,uCAAuC;AAoEzC,MAAM,qBAAiD;AAAA,EAC5D;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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M,SACL,oBAAC,UAAK,cAAU,MAAC,WAAU,0CACxB,oBAAU,MAAM,KAAK,GACxB;AAAA,iBAEJ;AAAA,cACA,oBAAC,YAAS,OAAO,MAAM,IAAI,SAAQ,YAAW,WAAU,sBAAqB;AAAA,eAC/E;AAAA,YACA,qBAAC,SAAI,WAAU,sBACb;AAAA,kCAAC,UAAK,gBAAc,MAAM,UAAU,QAAQ,MAAM,UAAU,SAAS,OAAO,QACzE,oBAAU,KAAK,GAClB;AAAA,cACC,MAAM,WAAW,UAAa,MAAM,WAAW,QAAQ,MAAM,WAAW,MACvE,iCACG;AAAA;AAAA,gBACD,oBAAC,UAAK,WAAU,kBAAkB,gBAAM,QAAO;AAAA,iBACjD;AAAA,eAEJ;AAAA,eA7BO,MAAM,EA8Bf;AAAA,QAEF,CAAC;AAAA;AAAA,IACH;AAAA,IAED,UAAU,OAAO,QAAQ,KACxB;AAAA,MAAC;AAAA;AAAA,QACC,MAAM,OAAO;AAAA,QACb,UAAU,OAAO;AAAA,QACjB,OAAO,OAAO;AAAA,QACd,YAAY,KAAK,IAAI,GAAG,KAAK,KAAK,OAAO,QAAQ,KAAK,IAAI,GAAG,OAAO,QAAQ,CAAC,CAAC;AAAA,QAC9E,QAAQ,OAAO;AAAA,QACf,YAAY,OAAO;AAAA;AAAA,IACrB;AAAA,KAEJ;AAEJ;","names":["className"]}
1
+ {"version":3,"sources":["../../src/admin/admin-action-log.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { cn } from \"../lib/cn\";\nimport type { DateInput } from \"../lib/format\";\nimport { useKitLabels } from \"../i18n/kit-labels\";\nimport type { LabelOverride } from \"../i18n/kit-labels\";\nimport { DateMark } from \"../components/account-chips\";\nimport { Chip } from \"../components/chip\";\nimport { Pagination } from \"../components/data-table-pagination\";\nimport { Caption } from \"../components/text\";\nimport { Button } from \"../components/button\";\nimport { Spinner } from \"../components/spinner\";\nimport { usePersonLabel } from \"./admin-parts\";\nimport type { AdminPerson } from \"./admin-parts\";\nimport { DEFAULT_ADMIN_ACTION_LOG_LABELS } from \"./admin-action-log-labels\";\n\n/**\n * The admin actions, as the audit table records them (docs/user-admin-harmonization.md\n * §2.3, §4.3): `GET /admin/actions?limit=&offset=&target=`, newest first, on the admin\n * page and filtered to one account from its row.\n *\n * Every app writes the same small `admin_actions` row in the transaction of the action\n * (keksdose and Kurvenschmiede had log lines; kastlan has an HTTP log with no named\n * action), so the vocabulary is shared — {@link AdminActionKind} — and an app's own\n * actions join it through `labels.actions`.\n *\n * What a row says, and what it never does: who, what, to whom, when, and a summary of the\n * `detail` the APP writes (ids, roles, counts — never content, §4.3). Three kinds of\n * actor: an admin; **the user themselves** (`deletion_request`: the actor is the target);\n * and **nobody** (the scheduled erasure, the hand-over at erasure, §2.7), said as\n * \"automatically\". After an erasure the target's name and address are scrubbed and the\n * row stays: it reads \"an erased account\".\n *\n * GROUPS (round 0.34, §11): Kurvenschmiede's teams, kastlan's companies and keksdose's\n * budgets are groups of accounts, and the vocabulary has words for what is done to one\n * (`group_create`, `group_rename`, `group_delete`) and to who is in it (`membership_add`,\n * `membership_role`, `membership_remove`). A row about the group itself has the group as\n * its `target`; a row about a person in it has the person as its target and the group as\n * its `group`, drawn after the person by its name alone, muted — no preposition, so no\n * language has to inflect the name. The kinds and codes say \"group\"; the labels say the\n * app's own noun, picked with `groupNoun` — whole phrases per noun, since a noun dropped\n * into one phrase breaks the participle's agreement in fr and it and the suffix in hu\n * (decision 4). A group with no name left reads as the noun's \"a deleted team\"; only a\n * missing PERSON is \"an erased account\".\n *\n * It never fetches: the page of rows and the paging are the app's.\n */\n\n/** The shared vocabulary of `admin_actions.action` (§4.3). */\nexport type AdminActionKind =\n | \"deactivate\"\n | \"reactivate\"\n | \"role\"\n | \"membership_remove\"\n | \"password_change_require\"\n | \"password_change_withdraw\"\n | \"mail_verification\"\n | \"mail_reset\"\n | \"reviewer\"\n | \"invite\"\n | \"invite_resend\"\n | \"invite_revoke\"\n | \"transfer\"\n | \"deletion_request\"\n | \"deletion_cancel\"\n | \"erase\"\n // 0.32.1 (keksdose's 0.32 report): server-kit 0.6's `AdminAction.PLAN`, an operator's\n // plan change or grant (docs/billing-harmonization.md §6).\n | \"plan\"\n // 0.34 (§11.3): what is done to a group of accounts, and to who is in it — beside\n // `membership_remove`. server-kit 0.8's `AdminAction` has the same five.\n | \"group_create\"\n | \"group_rename\"\n | \"group_delete\"\n | \"membership_add\"\n | \"membership_role\"\n // 0.45 (admin §9.1.3): a group switched off or on again — kastlan's company PATCH\n // (`is_active`). server-kit 0.15's `AdminAction.GROUP_DEACTIVATE` / `GROUP_REACTIVATE`.\n | \"group_deactivate\"\n | \"group_reactivate\";\n\n/** Every {@link AdminActionKind}, in the contract's order. */\nexport const ADMIN_ACTION_KINDS: readonly AdminActionKind[] = [\n \"deactivate\",\n \"reactivate\",\n \"role\",\n \"membership_remove\",\n \"password_change_require\",\n \"password_change_withdraw\",\n \"mail_verification\",\n \"mail_reset\",\n \"reviewer\",\n \"invite\",\n \"invite_resend\",\n \"invite_revoke\",\n \"transfer\",\n \"deletion_request\",\n \"deletion_cancel\",\n \"erase\",\n \"plan\",\n \"group_create\",\n \"group_rename\",\n \"group_delete\",\n \"membership_add\",\n \"membership_role\",\n \"group_deactivate\",\n \"group_reactivate\",\n];\n\n/** The app's word for its groups (§11.5): Kurvenschmiede's teams, kastlan's companies,\n * keksdose's budgets; `group` is the neutral word. Picks the set of phrases the group\n * actions are said in. */\nexport type AdminGroupNoun = \"group\" | \"team\" | \"company\" | \"budget\";\n\n/** The kinds said in the noun's words: the five of 0.34, `membership_remove`, and 0.45's\n * `group_deactivate` / `group_reactivate`. */\ntype AdminGroupActionKind =\n | \"group_create\"\n | \"group_rename\"\n | \"group_delete\"\n | \"group_deactivate\"\n | \"group_reactivate\"\n | \"membership_add\"\n | \"membership_role\"\n | \"membership_remove\";\n\nconst GROUP_ACTION_KINDS: ReadonlySet<string> = new Set<AdminGroupActionKind>([\n \"group_create\",\n \"group_rename\",\n \"group_delete\",\n \"group_deactivate\",\n \"group_reactivate\",\n \"membership_add\",\n \"membership_role\",\n \"membership_remove\",\n]);\n\n/**\n * A group as a log target (§11.4): a row about the group itself (`group_*`, kastlan's\n * `plan`), or the `group` a person was added to, moved in or taken out of. The app joins\n * its `name` when the log is read — from the live group, else from its `group_delete`\n * row's stamp (`target_group_name`, decision 6) — as it joins a person's. With no name\n * left it reads as the noun's \"a deleted team\".\n */\nexport interface AdminGroupTarget {\n kind: \"group\";\n id?: string | number | null;\n name?: string | null;\n}\n\n/** A target that is neither a person nor a group (§11.4): an app's own action on a demo\n * dataset or a setting, said by its `label`. */\nexport interface AdminOtherTarget {\n kind: \"other\";\n /** What it was done to, in the app's words, as it is drawn. */\n label: string;\n /** The app's id for it, when it has one. Beyond §11.4's shape so that code reading\n * `entry.target.id` on any target — keksdose's filter, the showcase's — still\n * type-checks against the wider union. */\n id?: string | number | null;\n}\n\n/** Whether a target is a group. A person has no `kind`; an object whose `kind` is\n * anything else is read as a person too. */\nexport function isGroupTarget(target: unknown): target is AdminGroupTarget {\n return typeof target === \"object\" && target !== null && (target as { kind?: unknown }).kind === \"group\";\n}\n\nfunction isOtherTarget(target: unknown): target is AdminOtherTarget {\n return typeof target === \"object\" && target !== null && (target as { kind?: unknown }).kind === \"other\";\n}\n\n/** One logged action — the app's `admin_actions` row with the people joined in. */\nexport interface AdminActionLogEntry {\n id: string | number;\n /** When, as the row's `at`. */\n at: DateInput;\n /**\n * Who did it: a person; `\"self\"` — the user themselves (a deletion request); or `null`\n * — nobody, the scheduled job. A person whose `id` (or address) is the target's is\n * read as `\"self\"` too.\n */\n actor: AdminPerson | \"self\" | null;\n /** A {@link AdminActionKind}, or one of the app's own (named in `labels.actions`). */\n action: AdminActionKind | (string & {});\n /**\n * What it was done to (§11.4): a person (no `kind`) — `null`, or a person with nothing\n * left in it, is \"an erased account\", and an invitation's person is its address\n * (`target_email`); a group (`kind: \"group\"`), for a row about the group itself; or\n * something else (`kind: \"other\"`), said by its label. Left out: nothing is drawn\n * (until 0.34 it read as erased).\n */\n target?: AdminPerson | AdminGroupTarget | AdminOtherTarget | null;\n /** The group a `membership_*` or invitation row happened in, drawn after the person\n * by its name (§11.4). */\n group?: AdminGroupTarget | null;\n /** The `detail` in the app's words — \"Member → Admin\", \"12 items to Ben Example\". */\n detail?: ReactNode;\n /**\n * 0.45 (admin §9.4, Marcel 2026-10-19): a `group_rename` row's `detail.{from, to}` —\n * kastlan's company rename logs both names. With both, the row reads \"Company renamed\n * from A to B\" (`renamedFromTo`) in place of the target. A rename that logs `{}` (KS's\n * team rename: never a name) leaves it out and reads \"Team renamed\" and the group.\n */\n renamed?: { from?: string | null; to?: string | null } | null;\n}\n\n/** The `adminActionLog` namespace. */\nexport interface AdminActionLogLabels {\n /** The list's accessible name. */\n title: string;\n empty: string;\n loading: string;\n /** \"by Ada Example\". */\n by: (actor: string) => string;\n /** The user acted on their own account. */\n bySelf: string;\n /** No actor: a scheduled job. */\n automatic: string;\n /** A target scrubbed by an erasure. */\n erased: string;\n /** The filter chip: only one account's actions are shown. */\n filteredTo: (target: string) => string;\n /** The chip's ×. */\n showAll: string;\n /** A target name as a filter button — \"Show only the actions on Ada Example\". */\n filterBy: (target: string) => string;\n /** 0.45: after \"Company renamed\" when the row carries both names — \"from A to B\". */\n renamedFromTo: (from: string, to: string) => string;\n /** What each action is called, past tense, keyed by the vocabulary. An app adds its\n * own here (`labels={{ actions: { plan: \"Plan changed\" } }}`). A word given here\n * outranks the noun's in `groupActions` — so no catalogue holds the group kinds\n * here, `membership_remove` included (0.34). */\n actions: { [K in AdminActionKind]?: string } & { [action: string]: string | undefined };\n /** The group actions in each noun's words (§11.5), picked with `groupNoun`. */\n groupActions: Record<AdminGroupNoun, AdminGroupActionLabels>;\n}\n\n/** One noun's phrases (§11.5): whole phrases, never a noun dropped into one. */\ninterface AdminGroupActionLabels {\n /** \"Team created\". */\n group_create: string;\n /** \"Team renamed\". */\n group_rename: string;\n /** \"Team deleted\". */\n group_delete: string;\n /** \"Company deactivated\" (0.45, admin §9.1.3): the group switched off — its people\n * locked out — not a person's `deactivate`. */\n group_deactivate: string;\n /** \"Company reactivated\" (0.45). */\n group_reactivate: string;\n /** \"Added to the team\" — said of the person, so it agrees with the account where a\n * language agrees (es \"Añadida\", fr \"Ajouté\"). */\n membership_add: string;\n /** \"Role in the team changed\" — the role in the group, not the account's (`role`). */\n membership_role: string;\n /** \"Removed from the team\". The `company` set's is the string `actions` held until\n * 0.34, in every language. */\n membership_remove: string;\n /** A group target with no name left: \"a deleted team\". */\n deleted: string;\n}\n\n// Defined in ./admin-action-log-labels, which holds no component code (0.34, KS U8).\nexport { DEFAULT_ADMIN_ACTION_LOG_LABELS };\n\n/** The paging of `GET /admin/actions` — DataTable's `ServerPagination`, which the\n * footer is. */\nexport interface AdminActionLogPaging {\n /** 0-based. */\n page: number;\n pageSize: number;\n total: number;\n onPageChange: (page: number) => void;\n onPageSizeChange?: (pageSize: number) => void;\n}\n\nexport interface AdminActionLogProps {\n /** One page, newest first, as the server sends it. */\n entries: readonly AdminActionLogEntry[];\n /** Left out: no footer (a short list on a row). */\n paging?: AdminActionLogPaging;\n /** The page is being fetched. */\n loading?: boolean;\n /** The filter in force: only this account's actions are shown (`?target=`). With\n * `onTargetFilter`, a chip says so and its × clears it. */\n target?: AdminPerson | null;\n /** Filter by an account — or clear it with `null`. Given, every person target's name\n * is a button that narrows the list to it; a group or other target never is (0.34:\n * `?target=` stays a person's). Left out, the list is not filterable here. */\n onTargetFilter?: (target: AdminPerson | null) => void;\n /** The app's word for its groups (§11.5): picks the phrases the group actions and \"a\n * deleted …\" are said in. Default `group`; `labels.actions[kind]` still wins. */\n groupNoun?: AdminGroupNoun;\n className?: string;\n /** Any part, at any depth: `{ groupActions: { team: { group_create: \"…\" } } }`. */\n labels?: LabelOverride<AdminActionLogLabels>;\n}\n\n/** Whether a person has nothing left that names them — an erased target. */\nfunction scrubbed(person: AdminPerson | null | undefined): boolean {\n return !person || ![person.first, person.last, person.name, person.email].some((part) => (part ?? \"\").trim());\n}\n\n/** Whether two people are the same account. A group or other target is never a person\n * (§11.4), so it never reads \"by the user themselves\". */\nfunction samePerson(a: AdminPerson, b: AdminActionLogEntry[\"target\"]): boolean {\n if (!b || isGroupTarget(b) || isOtherTarget(b)) return false;\n if (a.id !== undefined && a.id !== null && b.id !== undefined && b.id !== null) return a.id === b.id;\n const ea = (a.email ?? \"\").trim().toLowerCase();\n return ea !== \"\" && ea === (b.email ?? \"\").trim().toLowerCase();\n}\n\nexport function AdminActionLog({\n entries,\n paging,\n loading = false,\n target,\n onTargetFilter,\n groupNoun = \"group\",\n className,\n labels: labelsProp,\n}: AdminActionLogProps) {\n // Merged key by key at every depth, so a deep override is what `useKitLabels` takes.\n const labels = useKitLabels(\"adminActionLog\", DEFAULT_ADMIN_ACTION_LOG_LABELS, labelsProp);\n const nameOf = usePersonLabel();\n const filtered = target !== undefined && target !== null && !scrubbed(target);\n // A noun the type doesn't know (an app in plain JS) says the neutral word.\n const groupWords = labels.groupActions[groupNoun] ?? labels.groupActions.group;\n\n /** An app's own word first, then the noun's phrase for a group kind, else the key. */\n const actionText = (action: string): string =>\n labels.actions[action] ??\n (GROUP_ACTION_KINDS.has(action) ? groupWords[action as AdminGroupActionKind] : undefined) ??\n action;\n\n /** A group by its name, or — muted, as an erased person is — the noun's \"a deleted\n * team\" when none is left. */\n const groupText = (group: AdminGroupTarget, className?: string): ReactNode => {\n const name = (group.name ?? \"\").trim();\n return name ? (\n <span data-private className={className}>\n {name}\n </span>\n ) : (\n <span className=\"italic text-muted\">{groupWords.deleted}</span>\n );\n };\n\n const actorText = (entry: AdminActionLogEntry): string => {\n const { actor } = entry;\n if (actor === null) return labels.automatic;\n if (actor === \"self\" || samePerson(actor, entry.target)) return labels.bySelf;\n return labels.by(nameOf(actor) || labels.erased);\n };\n\n const targetNode = (entry: AdminActionLogEntry): ReactNode => {\n const subject = entry.target;\n // Left out: nothing (§11.4). `null` is a person the erasure took.\n if (subject === undefined) return null;\n if (isGroupTarget(subject)) return groupText(subject, \"font-medium text-primary\");\n if (isOtherTarget(subject)) return <span className=\"font-medium text-primary\">{subject.label}</span>;\n if (scrubbed(subject)) return <span className=\"italic text-muted\">{labels.erased}</span>;\n const person = subject!;\n const name = nameOf(person);\n const address = (person.email ?? \"\").trim();\n const text = (\n <>\n <span data-private className=\"font-medium text-primary\">\n {name}\n </span>\n {address && address !== name && (\n <span data-private className=\"ms-1 text-xs text-muted\">\n {address}\n </span>\n )}\n </>\n );\n if (!onTargetFilter || (filtered && samePerson(person, target))) return text;\n return (\n <Button\n type=\"button\"\n variant=\"link\"\n size=\"sm\"\n className=\"h-auto min-h-0 p-0 text-start\"\n aria-label={labels.filterBy(name)}\n onClick={() => onTargetFilter(person)}\n >\n {text}\n </Button>\n );\n };\n\n return (\n <div className={cn(\"space-y-3\", className)}>\n {filtered && onTargetFilter && (\n <Chip size=\"sm\" tone=\"brand\" onRemove={() => onTargetFilter(null)} removeLabel={labels.showAll}>\n <span data-private>{labels.filteredTo(nameOf(target))}</span>\n </Chip>\n )}\n {loading && entries.length === 0 ? (\n <div className=\"flex justify-center py-4\">\n <Spinner label={labels.loading} />\n </div>\n ) : entries.length === 0 ? (\n <Caption>{labels.empty}</Caption>\n ) : (\n <ol\n aria-label={labels.title}\n aria-busy={loading || undefined}\n className={cn(\"divide-y divide-subtle\", loading && \"opacity-60\")}\n >\n {entries.map((entry) => {\n const from = (entry.renamed?.from ?? \"\").trim();\n const to = (entry.renamed?.to ?? \"\").trim();\n const renamed = entry.action === \"group_rename\" && from !== \"\" && to !== \"\";\n return (\n <li key={entry.id} data-action={entry.action} className=\"space-y-0.5 py-2 first:pt-0 last:pb-0\">\n <div className=\"flex flex-wrap items-baseline justify-between gap-x-3 gap-y-0.5\">\n <div className=\"flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-0.5 text-sm\">\n <span className=\"font-medium text-primary\">{actionText(entry.action)}</span>\n {renamed ? (\n <span data-private data-renamed className=\"min-w-0 break-words text-primary\">\n {labels.renamedFromTo(from, to)}\n </span>\n ) : (\n entry.target !== undefined && <span className=\"min-w-0 break-words\">{targetNode(entry)}</span>\n )}\n {entry.group && (\n <span data-group className=\"min-w-0 break-words text-xs text-muted\">\n {groupText(entry.group)}\n </span>\n )}\n </div>\n <DateMark value={entry.at} display=\"relative\" className=\"text-xs text-muted\" />\n </div>\n <div className=\"text-xs text-muted\">\n <span data-private={entry.actor !== null && entry.actor !== \"self\" ? true : undefined}>\n {actorText(entry)}\n </span>\n {entry.detail !== undefined && entry.detail !== null && entry.detail !== \"\" && (\n <>\n {\" · \"}\n <span className=\"text-secondary\">{entry.detail}</span>\n </>\n )}\n </div>\n </li>\n );\n })}\n </ol>\n )}\n {paging && paging.total > 0 && (\n <Pagination\n page={paging.page}\n pageSize={paging.pageSize}\n total={paging.total}\n totalPages={Math.max(1, Math.ceil(paging.total / Math.max(1, paging.pageSize)))}\n onPage={paging.onPageChange}\n onPageSize={paging.onPageSizeChange}\n />\n )}\n </div>\n );\n}\n"],"mappings":";AAoVM,SA0BA,UA1BA,KA0BA,YA1BA;AAnVN,SAAS,UAAU;AAEnB,SAAS,oBAAoB;AAE7B,SAAS,gBAAgB;AACzB,SAAS,YAAY;AACrB,SAAS,kBAAkB;AAC3B,SAAS,eAAe;AACxB,SAAS,cAAc;AACvB,SAAS,eAAe;AACxB,SAAS,sBAAsB;AAE/B,SAAS,uCAAuC;AAoEzC,MAAM,qBAAiD;AAAA,EAC5D;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;AAmBA,MAAM,qBAA0C,oBAAI,IAA0B;AAAA,EAC5E;AAAA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qB;AAAA,eAC/E;AAAA,YACA,qBAAC,SAAI,WAAU,sBACb;AAAA,kCAAC,UAAK,gBAAc,MAAM,UAAU,QAAQ,MAAM,UAAU,SAAS,OAAO,QACzE,oBAAU,KAAK,GAClB;AAAA,cACC,MAAM,WAAW,UAAa,MAAM,WAAW,QAAQ,MAAM,WAAW,MACvE,iCACG;AAAA;AAAA,gBACD,oBAAC,UAAK,WAAU,kBAAkB,gBAAM,QAAO;AAAA,iBACjD;AAAA,eAEJ;AAAA,eA7BO,MAAM,EA8Bf;AAAA,QAEJ,CAAC;AAAA;AAAA,IACH;AAAA,IAED,UAAU,OAAO,QAAQ,KACxB;AAAA,MAAC;AAAA;AAAA,QACC,MAAM,OAAO;AAAA,QACb,UAAU,OAAO;AAAA,QACjB,OAAO,OAAO;AAAA,QACd,YAAY,KAAK,IAAI,GAAG,KAAK,KAAK,OAAO,QAAQ,KAAK,IAAI,GAAG,OAAO,QAAQ,CAAC,CAAC;AAAA,QAC9E,QAAQ,OAAO;AAAA,QACf,YAAY,OAAO;AAAA;AAAA,IACrB;AAAA,KAEJ;AAEJ;","names":["className"]}
@@ -11,7 +11,10 @@ const DEFAULT_ADMIN_AREA_LABELS = {
11
11
  sections: {
12
12
  overview: { title: "Overview", help: "What is waiting, at a glance." },
13
13
  users: { title: "Users", help: "Who has an account, and what each may do." },
14
- invitations: { title: "Invitations", help: "Invite people by e-mail in their language; resend or revoke what\u2019s still open." },
14
+ invitations: {
15
+ title: "Invitations",
16
+ help: "Invite people by e-mail in their language; resend or revoke what\u2019s still open."
17
+ },
15
18
  billing: { title: "Billing", help: "The plan, the payment and the invoices." },
16
19
  activity: { title: "Activity", help: "What the admins did, newest first." }
17
20
  },
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/admin/admin-area-labels.ts"],"sourcesContent":["import { useKitLabels, type LabelOverride } from \"../i18n/kit-labels\";\nimport type { SettingsGroupLabels } from \"../settings/settings-labels\";\n\n/**\n * The `adminArea` namespace (0.42, docs/admin-harmonization.md §3.1): the kit's words of\n * the admin area every app shares — the account menu's \"Administration\" row, the 403\n * page, the shared sections' names and help lines, the overview's tiles and the Tools\n * list. A module of words with no component code, like every `*-labels.ts` (0.34, KS U8).\n * An app's own sections and tiles bring their own words.\n */\n\n/** The sections every app's admin area shares, in the template's order (§2.3). */\nexport type AdminSharedSection = \"overview\" | \"users\" | \"invitations\" | \"billing\" | \"activity\";\n\n/** The overview's shared tiles (§2.4, §6.1). */\nexport interface AdminTileLabels {\n /** `feedback_waiting`: OPEN reports, crash reports included (§6.1). */\n feedbackWaiting: string;\n /** `deletion_requests`. */\n deletionRequests: string;\n /** `invitations_pending`. */\n invitationsPending: string;\n /** `users_total`. */\n users: string;\n /** `users_new_7d`, the line under the users tile. */\n usersNew: (count: number) => string;\n /** 0.46 (Kurvenschmiede 1, admin §9.5): server-kit's `awaiting_verdict` as an `extra`\n * tile — answered reports that wait on a verdict (IN_EVALUATION, NEEDS_LIVE_TEST). */\n awaitingVerdict: string;\n /** Its line under the count. */\n awaitingVerdictHint: string;\n /** 0.46: server-kit's `released_for_work` — the reports released for the work queue. */\n releasedForWork: string;\n /** Its line under the count. */\n releasedForWorkHint: string;\n}\n\nexport interface AdminAreaLabels {\n /** \"Administration\": the account menu's row, and the admin page's heading. */\n title: string;\n /** The row's waiting count, for a reader (\"Administration, 3 waiting\"); the eye sees\n * the number in the badge. */\n waiting: (count: number) => string;\n /**\n * 0.45 (admin §9.3.4): a button's whole name with its count — \"Platform, 2 waiting\" —\n * for an `IconButton` whose `badge` is an `AdminWaitingBadge`: the badge is decorative\n * there, so the name carries the count. `label` is the button's own name.\n */\n waitingLabel: (label: string, count: number) => string;\n /** The 403 page's heading (§2.2 decision 8). */\n forbiddenTitle: string;\n /**\n * Under it. Says only that THIS area is closed to the account — never that the person\n * administers nothing anywhere (§6.7: a kastlan superuser who isn't ADMIN in the acting\n * company gets this page).\n */\n forbiddenBody: (appName: string) => string;\n /** The button back to the app's start, unless the app names its own (`homeLabel`). */\n forbiddenHome: string;\n /** A reviewer's second way out, to the translations review. */\n forbiddenReviewer: string;\n /** The shared sections' names and help lines (§2.3 decision 11). */\n sections: Record<AdminSharedSection, SettingsGroupLabels>;\n /** The overview's tiles. */\n tiles: AdminTileLabels;\n /** 0.43: `AdminOverview`'s `error` — the counts could not be loaded. */\n overviewError: string;\n /** 0.43: its button, which calls `onRetry`. */\n retry: string;\n /** The Tools list's heading and name (§2.5 decision 16). */\n tools: string;\n}\n\nexport const DEFAULT_ADMIN_AREA_LABELS: AdminAreaLabels = {\n title: \"Administration\",\n waiting: (count) => `${count} waiting`,\n waitingLabel: (label, count) => `${label}, ${count} waiting`,\n forbiddenTitle: \"Only for administrators\",\n forbiddenBody: (appName) => `This is where administrators run ${appName}. Your account cannot open this page.`,\n forbiddenHome: \"Go to the start page\",\n forbiddenReviewer: \"Review translations\",\n sections: {\n overview: { title: \"Overview\", help: \"What is waiting, at a glance.\" },\n users: { title: \"Users\", help: \"Who has an account, and what each may do.\" },\n invitations: { title: \"Invitations\", help: \"Invite people by e-mail in their language; resend or revoke what’s still open.\" },\n billing: { title: \"Billing\", help: \"The plan, the payment and the invoices.\" },\n activity: { title: \"Activity\", help: \"What the admins did, newest first.\" },\n },\n tiles: {\n feedbackWaiting: \"To triage\",\n deletionRequests: \"Deletion requests\",\n invitationsPending: \"Pending invitations\",\n users: \"Users\",\n usersNew: (count) => `${count} new in 7 days`,\n awaitingVerdict: \"Awaiting a verdict\",\n awaitingVerdictHint: \"Answered, and waiting for you or the reporter to confirm the fix\",\n releasedForWork: \"Released for work\",\n releasedForWorkHint: \"Ready, rework requested or in progress\",\n },\n overviewError: \"The overview couldn’t be loaded.\",\n retry: \"Try again\",\n tools: \"Tools\",\n};\n\n/**\n * The `adminArea` namespace, resolved — English, then the provider, then `labels`. What\n * an app reads to hand {@link adminSections} its words from inside a component.\n */\nexport function useAdminAreaLabels(labels?: LabelOverride<AdminAreaLabels>): AdminAreaLabels {\n return useKitLabels(\"adminArea\", DEFAULT_ADMIN_AREA_LABELS, labels);\n}\n"],"mappings":";AAAA,SAAS,oBAAwC;AAyE1C,MAAM,4BAA6C;AAAA,EACxD,OAAO;AAAA,EACP,SAAS,CAAC,UAAU,GAAG,KAAK;AAAA,EAC5B,cAAc,CAAC,OAAO,UAAU,GAAG,KAAK,KAAK,KAAK;AAAA,EAClD,gBAAgB;AAAA,EAChB,eAAe,CAAC,YAAY,oCAAoC,OAAO;AAAA,EACvE,eAAe;AAAA,EACf,mBAAmB;AAAA,EACnB,UAAU;AAAA,IACR,UAAU,EAAE,OAAO,YAAY,MAAM,gCAAgC;AAAA,IACrE,OAAO,EAAE,OAAO,SAAS,MAAM,4CAA4C;AAAA,IAC3E,aAAa,EAAE,OAAO,eAAe,MAAM,sFAAiF;AAAA,IAC5H,SAAS,EAAE,OAAO,WAAW,MAAM,0CAA0C;AAAA,IAC7E,UAAU,EAAE,OAAO,YAAY,MAAM,qCAAqC;AAAA,EAC5E;AAAA,EACA,OAAO;AAAA,IACL,iBAAiB;AAAA,IACjB,kBAAkB;AAAA,IAClB,oBAAoB;AAAA,IACpB,OAAO;AAAA,IACP,UAAU,CAAC,UAAU,GAAG,KAAK;AAAA,IAC7B,iBAAiB;AAAA,IACjB,qBAAqB;AAAA,IACrB,iBAAiB;AAAA,IACjB,qBAAqB;AAAA,EACvB;AAAA,EACA,eAAe;AAAA,EACf,OAAO;AAAA,EACP,OAAO;AACT;AAMO,SAAS,mBAAmB,QAA0D;AAC3F,SAAO,aAAa,aAAa,2BAA2B,MAAM;AACpE;","names":[]}
1
+ {"version":3,"sources":["../../src/admin/admin-area-labels.ts"],"sourcesContent":["import { useKitLabels, type LabelOverride } from \"../i18n/kit-labels\";\nimport type { SettingsGroupLabels } from \"../settings/settings-labels\";\n\n/**\n * The `adminArea` namespace (0.42, docs/admin-harmonization.md §3.1): the kit's words of\n * the admin area every app shares — the account menu's \"Administration\" row, the 403\n * page, the shared sections' names and help lines, the overview's tiles and the Tools\n * list. A module of words with no component code, like every `*-labels.ts` (0.34, KS U8).\n * An app's own sections and tiles bring their own words.\n */\n\n/** The sections every app's admin area shares, in the template's order (§2.3). */\nexport type AdminSharedSection = \"overview\" | \"users\" | \"invitations\" | \"billing\" | \"activity\";\n\n/** The overview's shared tiles (§2.4, §6.1). */\nexport interface AdminTileLabels {\n /** `feedback_waiting`: OPEN reports, crash reports included (§6.1). */\n feedbackWaiting: string;\n /** `deletion_requests`. */\n deletionRequests: string;\n /** `invitations_pending`. */\n invitationsPending: string;\n /** `users_total`. */\n users: string;\n /** `users_new_7d`, the line under the users tile. */\n usersNew: (count: number) => string;\n /** 0.46 (Kurvenschmiede 1, admin §9.5): server-kit's `awaiting_verdict` as an `extra`\n * tile — answered reports that wait on a verdict (IN_EVALUATION, NEEDS_LIVE_TEST). */\n awaitingVerdict: string;\n /** Its line under the count. */\n awaitingVerdictHint: string;\n /** 0.46: server-kit's `released_for_work` — the reports released for the work queue. */\n releasedForWork: string;\n /** Its line under the count. */\n releasedForWorkHint: string;\n}\n\nexport interface AdminAreaLabels {\n /** \"Administration\": the account menu's row, and the admin page's heading. */\n title: string;\n /** The row's waiting count, for a reader (\"Administration, 3 waiting\"); the eye sees\n * the number in the badge. */\n waiting: (count: number) => string;\n /**\n * 0.45 (admin §9.3.4): a button's whole name with its count — \"Platform, 2 waiting\" —\n * for an `IconButton` whose `badge` is an `AdminWaitingBadge`: the badge is decorative\n * there, so the name carries the count. `label` is the button's own name.\n */\n waitingLabel: (label: string, count: number) => string;\n /** The 403 page's heading (§2.2 decision 8). */\n forbiddenTitle: string;\n /**\n * Under it. Says only that THIS area is closed to the account — never that the person\n * administers nothing anywhere (§6.7: a kastlan superuser who isn't ADMIN in the acting\n * company gets this page).\n */\n forbiddenBody: (appName: string) => string;\n /** The button back to the app's start, unless the app names its own (`homeLabel`). */\n forbiddenHome: string;\n /** A reviewer's second way out, to the translations review. */\n forbiddenReviewer: string;\n /** The shared sections' names and help lines (§2.3 decision 11). */\n sections: Record<AdminSharedSection, SettingsGroupLabels>;\n /** The overview's tiles. */\n tiles: AdminTileLabels;\n /** 0.43: `AdminOverview`'s `error` — the counts could not be loaded. */\n overviewError: string;\n /** 0.43: its button, which calls `onRetry`. */\n retry: string;\n /** The Tools list's heading and name (§2.5 decision 16). */\n tools: string;\n}\n\nexport const DEFAULT_ADMIN_AREA_LABELS: AdminAreaLabels = {\n title: \"Administration\",\n waiting: (count) => `${count} waiting`,\n waitingLabel: (label, count) => `${label}, ${count} waiting`,\n forbiddenTitle: \"Only for administrators\",\n forbiddenBody: (appName) => `This is where administrators run ${appName}. Your account cannot open this page.`,\n forbiddenHome: \"Go to the start page\",\n forbiddenReviewer: \"Review translations\",\n sections: {\n overview: { title: \"Overview\", help: \"What is waiting, at a glance.\" },\n users: { title: \"Users\", help: \"Who has an account, and what each may do.\" },\n invitations: {\n title: \"Invitations\",\n help: \"Invite people by e-mail in their language; resend or revoke what’s still open.\",\n },\n billing: { title: \"Billing\", help: \"The plan, the payment and the invoices.\" },\n activity: { title: \"Activity\", help: \"What the admins did, newest first.\" },\n },\n tiles: {\n feedbackWaiting: \"To triage\",\n deletionRequests: \"Deletion requests\",\n invitationsPending: \"Pending invitations\",\n users: \"Users\",\n usersNew: (count) => `${count} new in 7 days`,\n awaitingVerdict: \"Awaiting a verdict\",\n awaitingVerdictHint: \"Answered, and waiting for you or the reporter to confirm the fix\",\n releasedForWork: \"Released for work\",\n releasedForWorkHint: \"Ready, rework requested or in progress\",\n },\n overviewError: \"The overview couldn’t be loaded.\",\n retry: \"Try again\",\n tools: \"Tools\",\n};\n\n/**\n * The `adminArea` namespace, resolved — English, then the provider, then `labels`. What\n * an app reads to hand {@link adminSections} its words from inside a component.\n */\nexport function useAdminAreaLabels(labels?: LabelOverride<AdminAreaLabels>): AdminAreaLabels {\n return useKitLabels(\"adminArea\", DEFAULT_ADMIN_AREA_LABELS, labels);\n}\n"],"mappings":";AAAA,SAAS,oBAAwC;AAyE1C,MAAM,4BAA6C;AAAA,EACxD,OAAO;AAAA,EACP,SAAS,CAAC,UAAU,GAAG,KAAK;AAAA,EAC5B,cAAc,CAAC,OAAO,UAAU,GAAG,KAAK,KAAK,KAAK;AAAA,EAClD,gBAAgB;AAAA,EAChB,eAAe,CAAC,YAAY,oCAAoC,OAAO;AAAA,EACvE,eAAe;AAAA,EACf,mBAAmB;AAAA,EACnB,UAAU;AAAA,IACR,UAAU,EAAE,OAAO,YAAY,MAAM,gCAAgC;AAAA,IACrE,OAAO,EAAE,OAAO,SAAS,MAAM,4CAA4C;AAAA,IAC3E,aAAa;AAAA,MACX,OAAO;AAAA,MACP,MAAM;AAAA,IACR;AAAA,IACA,SAAS,EAAE,OAAO,WAAW,MAAM,0CAA0C;AAAA,IAC7E,UAAU,EAAE,OAAO,YAAY,MAAM,qCAAqC;AAAA,EAC5E;AAAA,EACA,OAAO;AAAA,IACL,iBAAiB;AAAA,IACjB,kBAAkB;AAAA,IAClB,oBAAoB;AAAA,IACpB,OAAO;AAAA,IACP,UAAU,CAAC,UAAU,GAAG,KAAK;AAAA,IAC7B,iBAAiB;AAAA,IACjB,qBAAqB;AAAA,IACrB,iBAAiB;AAAA,IACjB,qBAAqB;AAAA,EACvB;AAAA,EACA,eAAe;AAAA,EACf,OAAO;AAAA,EACP,OAAO;AACT;AAMO,SAAS,mBAAmB,QAA0D;AAC3F,SAAO,aAAa,aAAa,2BAA2B,MAAM;AACpE;","names":[]}
@@ -76,18 +76,26 @@ function AdminOverview({
76
76
  })
77
77
  ].filter((t) => loading || t.count !== null && t.count !== void 0);
78
78
  if (!loading && tiles.length === 0) return error ? errorBox(true) : null;
79
- const grid = /* @__PURE__ */ jsx(StatTileGrid, { "data-slot": error ? void 0 : "admin-overview", loading, className: error ? void 0 : className, children: tiles.map((t) => /* @__PURE__ */ jsx(
80
- AttentionTile,
79
+ const grid = /* @__PURE__ */ jsx(
80
+ StatTileGrid,
81
81
  {
82
- ...tileProps,
83
- "data-attention": t.key,
84
- label: t.label,
85
- count: t.count,
86
- href: t.href,
87
- description: t.description
88
- },
89
- t.key
90
- )) });
82
+ "data-slot": error ? void 0 : "admin-overview",
83
+ loading,
84
+ className: error ? void 0 : className,
85
+ children: tiles.map((t) => /* @__PURE__ */ jsx(
86
+ AttentionTile,
87
+ {
88
+ ...tileProps,
89
+ "data-attention": t.key,
90
+ label: t.label,
91
+ count: t.count,
92
+ href: t.href,
93
+ description: t.description
94
+ },
95
+ t.key
96
+ ))
97
+ }
98
+ );
91
99
  if (!error) return grid;
92
100
  return /* @__PURE__ */ jsxs("div", { "data-slot": "admin-overview", "data-state": "error", className: cn("space-y-4", className), children: [
93
101
  errorBox(false),
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/admin/admin-overview.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { AlertBanner } from \"../components/alert-banner\";\nimport { Button } from \"../components/button\";\nimport { StatTile, StatTileGrid } from \"../components/stat-tile\";\nimport type { StatTileProps } from \"../components/stat-tile\";\nimport type { LabelOverride } from \"../i18n/kit-labels\";\nimport { cn } from \"../lib/cn\";\nimport { useAdminAreaLabels } from \"./admin-area-labels\";\nimport type { AdminAreaLabels } from \"./admin-area-labels\";\n\n/**\n * The admin's start page (0.42.0, docs/admin-harmonization.md §2.4, §6.1–§6.5): a grid\n * of tiles, each a count of what is waiting and a link to where the work is, fed by one\n * server answer.\n */\n\n/**\n * `GET /admin/attention` (§2.4 decision 14, §6.4) — server-kit's `AdminAttention`\n * (`eifi1_server_kit.user_admin.attention`), as the API sends it.\n *\n * Each count is `null` where the app has no such thing or this viewer cannot act on it,\n * and every count is `null` in a demo session. Demo accounts never count. `extra` holds\n * the app's own counts, keyed as its overview names them (keksdose `support_waiting`,\n * Kurvenschmiede `released_for_work`).\n */\nexport interface AdminAttention {\n /** \"To triage\": OPEN reports, crash reports included (§6.1). */\n feedback_waiting: number | null;\n /** Accounts that asked to be deleted — only where this viewer acts on them (§6.2). */\n deletion_requests: number | null;\n invitations_pending: number | null;\n users_total: number | null;\n /** Accounts made in the last seven days. */\n users_new_7d: number | null;\n extra: Record<string, number | null>;\n}\n\n/** The shared counts that are a tile of their own (`users_new_7d` is the users tile's line). */\nexport type AdminAttentionTile = \"feedback_waiting\" | \"deletion_requests\" | \"invitations_pending\" | \"users_total\";\n\n/** Where each shared tile links when the app names nothing else (§2.4 decision 13). */\nexport const DEFAULT_ADMIN_ATTENTION_HREFS: Readonly<Record<AdminAttentionTile, string>> = Object.freeze({\n feedback_waiting: \"/feedback\",\n deletion_requests: \"/admin/users?state=deletion_requested\",\n invitations_pending: \"/admin/invitations\",\n users_total: \"/admin/users\",\n});\n\n/**\n * The account menu's badge (§2.4 decision 15, §6.3): the sum of the counts that are work\n * waiting on THIS admin — each app names its own (keksdose `[\"feedback_waiting\",\n * \"support_waiting\", \"awaiting_verdict\"]`, kastlan `[\"feedback_waiting\"]`, Kurvenschmiede\n * `[\"feedback_waiting\", \"deletion_requests\"]`). A name is a shared count or an `extra`\n * key; a `null` or missing count adds nothing. Invitations and users never belong in it.\n * `null` while there is no answer yet, so the badge shows nothing rather than a 0.\n */\nexport function adminWaitingCount(\n attention: AdminAttention | null | undefined,\n counts: readonly (AdminAttentionTile | (string & {}))[],\n): number | null {\n if (!attention) return null;\n let sum = 0;\n for (const key of counts) {\n const shared = (attention as unknown as Record<string, unknown>)[key];\n const value = typeof shared === \"number\" ? shared : attention.extra?.[key];\n if (typeof value === \"number\" && value > 0) sum += value;\n }\n return sum;\n}\n\nexport interface AttentionTileProps extends Omit<StatTileProps, \"href\" | \"onClick\" | \"value\"> {\n /** The count. `null` shows the tile's dash; {@link AdminOverview} leaves such a tile out. */\n count: number | null | undefined;\n /** Where the work is — the tile is a link to it. Since 0.43 it may be left out: a\n * quiet count, no link (Kurvenschmiede). */\n href?: string;\n}\n\n/**\n * One tile of the overview: a {@link StatTile} that is a LINK to where the work is, its\n * count the headline. The whole tile is the link, named by its label; route it through\n * `renderLink` or the provider's link component, as any StatTile. Without `href` (0.43) it\n * is a quiet count, no link.\n */\nexport function AttentionTile({ count, href, ...tile }: AttentionTileProps) {\n return <StatTile data-slot=\"attention-tile\" {...tile} value={count ?? null} href={href} />;\n}\n\n/**\n * 0.46 (Kurvenschmiede 1, admin §9.5): the `extra` keys server-kit's\n * `feedback_attention` fills, whose tiles have the kit's words\n * (`adminArea.tiles.awaitingVerdict`, `releasedForWork`, with a line each).\n */\nexport type AdminFeedbackTileKey = \"awaiting_verdict\" | \"released_for_work\";\n\n/** One of the app's own tiles (§2.4 decision 13: keksdose's \"Support waiting\"). */\nexport type AdminExtraTile = AdminOwnTile | AdminFeedbackTile;\n\n/** A tile of the app's own: it brings its words. */\nexport interface AdminOwnTile {\n /** Unique among the tiles; usually the `extra` key it shows. */\n key: string;\n label: ReactNode;\n /** `null` or `undefined` leaves the tile out, as for a shared one. */\n count: number | null | undefined;\n /** Where the work is. Left out (0.43, Kurvenschmiede): a quiet count with no link —\n * a number worth seeing that has no page of its own. */\n href?: string;\n /** A line under the count. */\n description?: ReactNode;\n}\n\n/** 0.46: a tile of server-kit's feedback counts — `label` and `description` default to\n * the kit's words; an app's own still win. The kit's `description` fills in only when\n * `label` is left out too: an app that names the tile gets no hint line it did not ask for. */\nexport interface AdminFeedbackTile extends Omit<AdminOwnTile, \"key\" | \"label\"> {\n key: AdminFeedbackTileKey;\n label?: ReactNode;\n}\n\nexport interface AdminOverviewProps {\n /** The server's answer; `undefined` while it loads (the grid shows its skeletons). */\n attention: AdminAttention | null | undefined;\n /**\n * Where the shared tiles link, over {@link DEFAULT_ADMIN_ATTENTION_HREFS} — the\n * inbox's address filtered to OPEN (§6.1) is the app's own:\n * `{ feedback_waiting: \"/feedback?status=OPEN\" }`.\n */\n hrefs?: Partial<Record<AdminAttentionTile, string>>;\n /** The app's own tiles, after the shared ones, in this order. */\n extraTiles?: readonly AdminExtraTile[];\n /** Passed to every tile — `renderLink` for the router, `size`, `variant`. */\n tileProps?: Pick<StatTileProps, \"renderLink\" | \"size\" | \"variant\" | \"locale\">;\n /**\n * 0.43 (keksdose): the answer failed — the query's `error`, or `true`. Anything truthy\n * shows `adminArea.overviewError` in a danger box, with \"Try again\" when\n * {@link onRetry} is given. A failed poll keeps the last good tiles: with `attention`\n * still there (a query keeps its last data), the box shows ALONGSIDE them, above, not\n * instead (build review 0.43, keksdose N7) — pass `attention.data` as it is. Without\n * an answer yet, the box alone. Without `error`: `undefined` is the skeletons and\n * `null` nothing, as before.\n */\n error?: unknown;\n /** \"Try again\" in the error box — the query's `refetch`. */\n onRetry?: () => void;\n /** Prop > `<UiKitProvider labels={{ adminArea }}>` > English. */\n labels?: LabelOverride<AdminAreaLabels>;\n className?: string;\n}\n\n/**\n * The overview section (§2.4): the shared tiles in their order — To triage, Deletion\n * requests, Pending invitations, Users (with the new accounts of the last 7 days under\n * the total) — then the app's `extraTiles`. A tile whose count is `null` is left out,\n * so each app shows only what it has; a `0` is a quiet tile, \"nothing waiting\".\n *\n * The overview is the admin area's landing page, standalone: it is NOT wrapped in a\n * `SettingsSection` (`adminSections` gives it no entry; render it as the page's body, as\n * Kurvenschmiede's `OverviewPanel` does). keksdose links its metrics from here with at\n * most two tiles (§6.5).\n */\nexport function AdminOverview({\n attention,\n hrefs,\n extraTiles = [],\n tileProps,\n error,\n onRetry,\n labels: labelsProp,\n className,\n}: AdminOverviewProps) {\n const labels = useAdminAreaLabels(labelsProp);\n /** The error box: on its own (`alone`) it is the overview's root. */\n const errorBox = (alone: boolean) => (\n <AlertBanner\n data-slot={alone ? \"admin-overview\" : undefined}\n data-state={alone ? \"error\" : undefined}\n variant=\"box\"\n tone=\"danger\"\n className={alone ? className : undefined}\n action={\n onRetry ? (\n <Button type=\"button\" variant=\"secondary\" size=\"sm\" onClick={() => onRetry()}>\n {labels.retry}\n </Button>\n ) : undefined\n }\n >\n {labels.overviewError}\n </AlertBanner>\n );\n // Nothing good to keep: the box alone.\n if (error && !attention) return errorBox(true);\n const href = { ...DEFAULT_ADMIN_ATTENTION_HREFS, ...hrefs };\n const loading = attention === undefined;\n const shared: { key: AdminAttentionTile; label: string; description?: ReactNode }[] = [\n { key: \"feedback_waiting\", label: labels.tiles.feedbackWaiting },\n { key: \"deletion_requests\", label: labels.tiles.deletionRequests },\n { key: \"invitations_pending\", label: labels.tiles.invitationsPending },\n {\n key: \"users_total\",\n label: labels.tiles.users,\n description:\n attention && typeof attention.users_new_7d === \"number\" ? labels.tiles.usersNew(attention.users_new_7d) : undefined,\n },\n ];\n const feedbackWords: Record<AdminFeedbackTileKey, { label: string; description: string }> = {\n awaiting_verdict: { label: labels.tiles.awaitingVerdict, description: labels.tiles.awaitingVerdictHint },\n released_for_work: { label: labels.tiles.releasedForWork, description: labels.tiles.releasedForWorkHint },\n };\n const tiles = [\n ...shared.map((t) => ({ ...t, count: attention ? attention[t.key] : undefined, href: href[t.key] })),\n ...extraTiles.map((t) => {\n const words = Object.prototype.hasOwnProperty.call(feedbackWords, t.key)\n ? feedbackWords[t.key as AdminFeedbackTileKey]\n : undefined;\n // The kit's hint comes with the kit's label only: an app that names the tile\n // itself gets no line it did not ask for (keksdose S5, round 0.46).\n return words\n ? {\n ...t,\n label: t.label ?? words.label,\n description: t.description ?? (t.label === undefined ? words.description : undefined),\n }\n : t;\n }),\n ].filter((t) => loading || (t.count !== null && t.count !== undefined));\n if (!loading && tiles.length === 0) return error ? errorBox(true) : null;\n const grid = (\n <StatTileGrid data-slot={error ? undefined : \"admin-overview\"} loading={loading} className={error ? undefined : className}>\n {tiles.map((t) => (\n <AttentionTile\n key={t.key}\n {...tileProps}\n data-attention={t.key}\n label={t.label}\n count={t.count}\n href={t.href}\n description={t.description}\n />\n ))}\n </StatTileGrid>\n );\n if (!error) return grid;\n // A failed poll: the error above the last good tiles.\n return (\n <div data-slot=\"admin-overview\" data-state=\"error\" className={cn(\"space-y-4\", className)}>\n {errorBox(false)}\n {grid}\n </div>\n );\n}\n"],"mappings":";AAqFS,cAiKL,YAjKK;AApFT,SAAS,mBAAmB;AAC5B,SAAS,cAAc;AACvB,SAAS,U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Q,SAAY,WAC7G,gBAAM,IAAI,CAAC,MACV;AAAA,IAAC;AAAA;AAAA,MAEE,GAAG;AAAA,MACJ,kBAAgB,EAAE;AAAA,MAClB,OAAO,EAAE;AAAA,MACT,OAAO,EAAE;AAAA,MACT,MAAM,EAAE;AAAA,MACR,aAAa,EAAE;AAAA;AAAA,IANV,EAAE;AAAA,EAOT,CACD,GACH;AAEF,MAAI,CAAC,MAAO,QAAO;AAEnB,SACE,qBAAC,SAAI,aAAU,kBAAiB,cAAW,SAAQ,WAAW,GAAG,aAAa,SAAS,GACpF;AAAA,aAAS,KAAK;AAAA,IACd;AAAA,KACH;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/admin/admin-overview.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { AlertBanner } from \"../components/alert-banner\";\nimport { Button } from \"../components/button\";\nimport { StatTile, StatTileGrid } from \"../components/stat-tile\";\nimport type { StatTileProps } from \"../components/stat-tile\";\nimport type { LabelOverride } from \"../i18n/kit-labels\";\nimport { cn } from \"../lib/cn\";\nimport { useAdminAreaLabels } from \"./admin-area-labels\";\nimport type { AdminAreaLabels } from \"./admin-area-labels\";\n\n/**\n * The admin's start page (0.42.0, docs/admin-harmonization.md §2.4, §6.1–§6.5): a grid\n * of tiles, each a count of what is waiting and a link to where the work is, fed by one\n * server answer.\n */\n\n/**\n * `GET /admin/attention` (§2.4 decision 14, §6.4) — server-kit's `AdminAttention`\n * (`eifi1_server_kit.user_admin.attention`), as the API sends it.\n *\n * Each count is `null` where the app has no such thing or this viewer cannot act on it,\n * and every count is `null` in a demo session. Demo accounts never count. `extra` holds\n * the app's own counts, keyed as its overview names them (keksdose `support_waiting`,\n * Kurvenschmiede `released_for_work`).\n */\nexport interface AdminAttention {\n /** \"To triage\": OPEN reports, crash reports included (§6.1). */\n feedback_waiting: number | null;\n /** Accounts that asked to be deleted — only where this viewer acts on them (§6.2). */\n deletion_requests: number | null;\n invitations_pending: number | null;\n users_total: number | null;\n /** Accounts made in the last seven days. */\n users_new_7d: number | null;\n extra: Record<string, number | null>;\n}\n\n/** The shared counts that are a tile of their own (`users_new_7d` is the users tile's line). */\nexport type AdminAttentionTile = \"feedback_waiting\" | \"deletion_requests\" | \"invitations_pending\" | \"users_total\";\n\n/** Where each shared tile links when the app names nothing else (§2.4 decision 13). */\nexport const DEFAULT_ADMIN_ATTENTION_HREFS: Readonly<Record<AdminAttentionTile, string>> = Object.freeze({\n feedback_waiting: \"/feedback\",\n deletion_requests: \"/admin/users?state=deletion_requested\",\n invitations_pending: \"/admin/invitations\",\n users_total: \"/admin/users\",\n});\n\n/**\n * The account menu's badge (§2.4 decision 15, §6.3): the sum of the counts that are work\n * waiting on THIS admin — each app names its own (keksdose `[\"feedback_waiting\",\n * \"support_waiting\", \"awaiting_verdict\"]`, kastlan `[\"feedback_waiting\"]`, Kurvenschmiede\n * `[\"feedback_waiting\", \"deletion_requests\"]`). A name is a shared count or an `extra`\n * key; a `null` or missing count adds nothing. Invitations and users never belong in it.\n * `null` while there is no answer yet, so the badge shows nothing rather than a 0.\n */\nexport function adminWaitingCount(\n attention: AdminAttention | null | undefined,\n counts: readonly (AdminAttentionTile | (string & {}))[],\n): number | null {\n if (!attention) return null;\n let sum = 0;\n for (const key of counts) {\n const shared = (attention as unknown as Record<string, unknown>)[key];\n const value = typeof shared === \"number\" ? shared : attention.extra?.[key];\n if (typeof value === \"number\" && value > 0) sum += value;\n }\n return sum;\n}\n\nexport interface AttentionTileProps extends Omit<StatTileProps, \"href\" | \"onClick\" | \"value\"> {\n /** The count. `null` shows the tile's dash; {@link AdminOverview} leaves such a tile out. */\n count: number | null | undefined;\n /** Where the work is — the tile is a link to it. Since 0.43 it may be left out: a\n * quiet count, no link (Kurvenschmiede). */\n href?: string;\n}\n\n/**\n * One tile of the overview: a {@link StatTile} that is a LINK to where the work is, its\n * count the headline. The whole tile is the link, named by its label; route it through\n * `renderLink` or the provider's link component, as any StatTile. Without `href` (0.43) it\n * is a quiet count, no link.\n */\nexport function AttentionTile({ count, href, ...tile }: AttentionTileProps) {\n return <StatTile data-slot=\"attention-tile\" {...tile} value={count ?? null} href={href} />;\n}\n\n/**\n * 0.46 (Kurvenschmiede 1, admin §9.5): the `extra` keys server-kit's\n * `feedback_attention` fills, whose tiles have the kit's words\n * (`adminArea.tiles.awaitingVerdict`, `releasedForWork`, with a line each).\n */\nexport type AdminFeedbackTileKey = \"awaiting_verdict\" | \"released_for_work\";\n\n/** One of the app's own tiles (§2.4 decision 13: keksdose's \"Support waiting\"). */\nexport type AdminExtraTile = AdminOwnTile | AdminFeedbackTile;\n\n/** A tile of the app's own: it brings its words. */\nexport interface AdminOwnTile {\n /** Unique among the tiles; usually the `extra` key it shows. */\n key: string;\n label: ReactNode;\n /** `null` or `undefined` leaves the tile out, as for a shared one. */\n count: number | null | undefined;\n /** Where the work is. Left out (0.43, Kurvenschmiede): a quiet count with no link —\n * a number worth seeing that has no page of its own. */\n href?: string;\n /** A line under the count. */\n description?: ReactNode;\n}\n\n/** 0.46: a tile of server-kit's feedback counts — `label` and `description` default to\n * the kit's words; an app's own still win. The kit's `description` fills in only when\n * `label` is left out too: an app that names the tile gets no hint line it did not ask for. */\nexport interface AdminFeedbackTile extends Omit<AdminOwnTile, \"key\" | \"label\"> {\n key: AdminFeedbackTileKey;\n label?: ReactNode;\n}\n\nexport interface AdminOverviewProps {\n /** The server's answer; `undefined` while it loads (the grid shows its skeletons). */\n attention: AdminAttention | null | undefined;\n /**\n * Where the shared tiles link, over {@link DEFAULT_ADMIN_ATTENTION_HREFS} — the\n * inbox's address filtered to OPEN (§6.1) is the app's own:\n * `{ feedback_waiting: \"/feedback?status=OPEN\" }`.\n */\n hrefs?: Partial<Record<AdminAttentionTile, string>>;\n /** The app's own tiles, after the shared ones, in this order. */\n extraTiles?: readonly AdminExtraTile[];\n /** Passed to every tile — `renderLink` for the router, `size`, `variant`. */\n tileProps?: Pick<StatTileProps, \"renderLink\" | \"size\" | \"variant\" | \"locale\">;\n /**\n * 0.43 (keksdose): the answer failed — the query's `error`, or `true`. Anything truthy\n * shows `adminArea.overviewError` in a danger box, with \"Try again\" when\n * {@link onRetry} is given. A failed poll keeps the last good tiles: with `attention`\n * still there (a query keeps its last data), the box shows ALONGSIDE them, above, not\n * instead (build review 0.43, keksdose N7) — pass `attention.data` as it is. Without\n * an answer yet, the box alone. Without `error`: `undefined` is the skeletons and\n * `null` nothing, as before.\n */\n error?: unknown;\n /** \"Try again\" in the error box — the query's `refetch`. */\n onRetry?: () => void;\n /** Prop > `<UiKitProvider labels={{ adminArea }}>` > English. */\n labels?: LabelOverride<AdminAreaLabels>;\n className?: string;\n}\n\n/**\n * The overview section (§2.4): the shared tiles in their order — To triage, Deletion\n * requests, Pending invitations, Users (with the new accounts of the last 7 days under\n * the total) — then the app's `extraTiles`. A tile whose count is `null` is left out,\n * so each app shows only what it has; a `0` is a quiet tile, \"nothing waiting\".\n *\n * The overview is the admin area's landing page, standalone: it is NOT wrapped in a\n * `SettingsSection` (`adminSections` gives it no entry; render it as the page's body, as\n * Kurvenschmiede's `OverviewPanel` does). keksdose links its metrics from here with at\n * most two tiles (§6.5).\n */\nexport function AdminOverview({\n attention,\n hrefs,\n extraTiles = [],\n tileProps,\n error,\n onRetry,\n labels: labelsProp,\n className,\n}: AdminOverviewProps) {\n const labels = useAdminAreaLabels(labelsProp);\n /** The error box: on its own (`alone`) it is the overview's root. */\n const errorBox = (alone: boolean) => (\n <AlertBanner\n data-slot={alone ? \"admin-overview\" : undefined}\n data-state={alone ? \"error\" : undefined}\n variant=\"box\"\n tone=\"danger\"\n className={alone ? className : undefined}\n action={\n onRetry ? (\n <Button type=\"button\" variant=\"secondary\" size=\"sm\" onClick={() => onRetry()}>\n {labels.retry}\n </Button>\n ) : undefined\n }\n >\n {labels.overviewError}\n </AlertBanner>\n );\n // Nothing good to keep: the box alone.\n if (error && !attention) return errorBox(true);\n const href = { ...DEFAULT_ADMIN_ATTENTION_HREFS, ...hrefs };\n const loading = attention === undefined;\n const shared: { key: AdminAttentionTile; label: string; description?: ReactNode }[] = [\n { key: \"feedback_waiting\", label: labels.tiles.feedbackWaiting },\n { key: \"deletion_requests\", label: labels.tiles.deletionRequests },\n { key: \"invitations_pending\", label: labels.tiles.invitationsPending },\n {\n key: \"users_total\",\n label: labels.tiles.users,\n description:\n attention && typeof attention.users_new_7d === \"number\"\n ? labels.tiles.usersNew(attention.users_new_7d)\n : undefined,\n },\n ];\n const feedbackWords: Record<AdminFeedbackTileKey, { label: string; description: string }> = {\n awaiting_verdict: { label: labels.tiles.awaitingVerdict, description: labels.tiles.awaitingVerdictHint },\n released_for_work: { label: labels.tiles.releasedForWork, description: labels.tiles.releasedForWorkHint },\n };\n const tiles = [\n ...shared.map((t) => ({ ...t, count: attention ? attention[t.key] : undefined, href: href[t.key] })),\n ...extraTiles.map((t) => {\n const words = Object.prototype.hasOwnProperty.call(feedbackWords, t.key)\n ? feedbackWords[t.key as AdminFeedbackTileKey]\n : undefined;\n // The kit's hint comes with the kit's label only: an app that names the tile\n // itself gets no line it did not ask for (keksdose S5, round 0.46).\n return words\n ? {\n ...t,\n label: t.label ?? words.label,\n description: t.description ?? (t.label === undefined ? words.description : undefined),\n }\n : t;\n }),\n ].filter((t) => loading || (t.count !== null && t.count !== undefined));\n if (!loading && tiles.length === 0) return error ? errorBox(true) : null;\n const grid = (\n <StatTileGrid\n data-slot={error ? undefined : \"admin-overview\"}\n loading={loading}\n className={error ? undefined : className}\n >\n {tiles.map((t) => (\n <AttentionTile\n key={t.key}\n {...tileProps}\n data-attention={t.key}\n label={t.label}\n count={t.count}\n href={t.href}\n description={t.description}\n />\n ))}\n </StatTileGrid>\n );\n if (!error) return grid;\n // A failed poll: the error above the last good tiles.\n return (\n <div data-slot=\"admin-overview\" data-state=\"error\" className={cn(\"space-y-4\", className)}>\n {errorBox(false)}\n {grid}\n </div>\n );\n}\n"],"mappings":";AAqFS,cAuKL,YAvKK;AApFT,SAAS,mBAAmB;AAC5B,SAAS,cAAc;A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;AAAA,MAC/B;AAAA,MACA,WAAW,QAAQ,SAAY;AAAA,MAE9B,gBAAM,IAAI,CAAC,MACV;AAAA,QAAC;AAAA;AAAA,UAEE,GAAG;AAAA,UACJ,kBAAgB,EAAE;AAAA,UAClB,OAAO,EAAE;AAAA,UACT,OAAO,EAAE;AAAA,UACT,MAAM,EAAE;AAAA,UACR,aAAa,EAAE;AAAA;AAAA,QANV,EAAE;AAAA,MAOT,CACD;AAAA;AAAA,EACH;AAEF,MAAI,CAAC,MAAO,QAAO;AAEnB,SACE,qBAAC,SAAI,aAAU,kBAAiB,cAAW,SAAQ,WAAW,GAAG,aAAa,SAAS,GACpF;AAAA,aAAS,KAAK;AAAA,IACd;AAAA,KACH;AAEJ;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/admin/admin-sections.tsx"],"sourcesContent":["import { createElement } from \"react\";\nimport type { ReactNode } from \"react\";\nimport { History, LayoutDashboard, Mail, Receipt, Users } from \"lucide-react\";\nimport type { LucideIcon } from \"lucide-react\";\nimport type { SettingsGroup } from \"../settings/settings-catalogue\";\nimport { DEFAULT_ADMIN_AREA_LABELS } from \"./admin-area-labels\";\nimport type { AdminAreaLabels, AdminSharedSection } from \"./admin-area-labels\";\n\n/**\n * The admin area's sections (0.42.0, docs/admin-harmonization.md §2.3, §6.8): the five\n * every app shares, in the template's order, and the helper that builds an app's\n * `SettingsLayout` catalogue groups from them and the app's own.\n */\n\n/** One shared section: its path segment and its icon. The words are `adminArea.sections`. */\nexport interface AdminSectionDefinition {\n id: AdminSharedSection;\n icon: LucideIcon;\n}\n\n/**\n * The shared sections in the template's order (§2.3 decision 10, §6.13): Overview, Users,\n * Invitations, Billing, Activity. An app's own sections go between them\n * ({@link adminSections}).\n */\nexport const ADMIN_SECTIONS: readonly AdminSectionDefinition[] = Object.freeze([\n { id: \"overview\", icon: LayoutDashboard },\n { id: \"users\", icon: Users },\n { id: \"invitations\", icon: Mail },\n { id: \"billing\", icon: Receipt },\n { id: \"activity\", icon: History },\n]);\n\n/**\n * One of the app's own sections: a catalogue group with its words, plus where it goes.\n * `after` names the section it follows — a shared one or another of the app's own. Left\n * out, it goes where the template puts an app's sections, after Invitations and before\n * Billing, in the order given.\n */\nexport interface AdminOwnSection<G extends string = string> extends SettingsGroup<G> {\n after?: AdminSharedSection | G;\n}\n\n/** Where one section goes, without its words — what {@link adminSectionOrder} takes. An\n * {@link AdminOwnSection} is one. */\nexport interface AdminSectionPlace<G extends string = string> {\n id: G;\n after?: AdminSharedSection | G;\n}\n\n/** The order's options: the shared sections an app does not have. */\nexport interface AdminSectionOrderOptions<L extends AdminSharedSection = AdminSharedSection> {\n /**\n * Shared sections this app does not have — keksdose and Kurvenschmiede have no billing\n * view (`[\"billing\"]`). Left out, every shared section is in the catalogue. Since 0.43\n * the result's type leaves them out too, so no cast is needed to drop `\"billing\"` —\n * when TypeScript infers the type arguments. With them written out, name the left-out\n * ones as the second (`adminSections<Own, \"billing\">(…)`); `adminSections<Own>(…)`\n * keeps every shared id in the type, as before.\n */\n leaveOut?: readonly L[];\n}\n\nexport interface AdminSectionsOptions<L extends AdminSharedSection = AdminSharedSection> extends AdminSectionOrderOptions<L> {\n /**\n * A shared section that is in the catalogue but hidden for now, as\n * {@link SettingsGroup.visible}: kastlan's `{ billing: billingEnabled }` (settings §5),\n * whose path then acts as an unknown one.\n */\n visible?: Partial<Record<AdminSharedSection, boolean>>;\n /**\n * 0.48 (keksdose live #450): a shared section's {@link SettingsGroup.badge} — the\n * waiting work the account menu's badge counts, on the row of the section that holds\n * it: `{ overview: <AdminWaitingBadge count={waiting} /> }`. An app's own section\n * carries its `badge` itself.\n */\n badges?: Partial<Record<AdminSharedSection, ReactNode>>;\n}\n\n/** The shared sections an app keeps when it leaves out `L`. A `leaveOut` typed as the\n * whole union (a variable of `AdminSharedSection[]`) says nothing about which, so it\n * narrows nothing. */\nexport type AdminKeptSection<L extends AdminSharedSection = AdminSharedSection> = [AdminSharedSection] extends [L]\n ? AdminSharedSection\n : Exclude<AdminSharedSection, L>;\n\n/** The shared section after which the app's sections go when they name no place. */\nconst OWN_DEFAULT_AFTER: AdminSharedSection = \"invitations\";\n\n/** The shared and own sections in their order — a shared one as its definition, an own\n * one as given. Throws as {@link adminSections} documents. */\nfunction orderSections<S extends AdminSectionPlace<string>>(\n own: readonly S[],\n leaveOutIds: readonly AdminSharedSection[] | undefined,\n): ({ shared: AdminSectionDefinition } | { own: S })[] {\n const leaveOut = new Set<string>(leaveOutIds ?? []);\n const shared = new Set<string>(ADMIN_SECTIONS.map((s) => s.id));\n const ownIds = new Set<string>();\n for (const section of own) {\n if (shared.has(section.id)) throw new Error(`adminSections: \"${section.id}\" is a shared section's id`);\n if (ownIds.has(section.id)) throw new Error(`adminSections: \"${section.id}\" is given twice`);\n ownIds.add(section.id);\n }\n for (const section of own) {\n const after = section.after;\n if (after !== undefined && !shared.has(after) && !ownIds.has(after)) {\n throw new Error(`adminSections: \"${section.id}\" goes after \"${after}\", which is no section`);\n }\n }\n\n // Each section's followers, in the order given: the shared ones, then the own ones\n // under their `after`, recursively, so an own section may follow another own one.\n const followers = new Map<string, S[]>();\n for (const section of own) {\n const after = section.after ?? OWN_DEFAULT_AFTER;\n followers.set(after, [...(followers.get(after) ?? []), section]);\n }\n\n const out: ({ shared: AdminSectionDefinition } | { own: S })[] = [];\n const placed = new Set<string>();\n const placeAfter = (id: string) => {\n for (const section of followers.get(id) ?? []) {\n out.push({ own: section });\n placed.add(section.id);\n placeAfter(section.id);\n }\n };\n for (const definition of ADMIN_SECTIONS) {\n if (!leaveOut.has(definition.id)) out.push({ shared: definition });\n // A left-out section's followers keep its place.\n placeAfter(definition.id);\n }\n const stuck = own.filter((s) => !placed.has(s.id)).map((s) => s.id);\n if (stuck.length) throw new Error(`adminSections: ${stuck.join(\", \")} follow each other in a circle`);\n return out;\n}\n\n/**\n * The admin area's section ids in the template's order (0.43, keksdose) — what\n * {@link adminSections} builds its groups in, without the words: for an app that needs the\n * ORDER only (a router's list of paths, a test), outside a component, with no labels.\n *\n * adminSectionOrder([{ id: \"metrics\", after: \"overview\" }], { leaveOut: [\"billing\"] })\n * // [\"overview\", \"metrics\", \"users\", \"invitations\", \"activity\"]\n *\n * Throws as {@link adminSections} does.\n */\nexport function adminSectionOrder<G extends string = never, L extends AdminSharedSection = AdminSharedSection>(\n own: readonly AdminSectionPlace<G>[] = [],\n options: AdminSectionOrderOptions<L> = {},\n): (AdminKeptSection<L> | G)[] {\n return orderSections(own, options.leaveOut).map((s) =>\n \"shared\" in s ? (s.shared.id as AdminKeptSection<L>) : s.own.id,\n );\n}\n\n/**\n * An app's admin catalogue groups, in the template's order (§2.3 decision 10, §6.8): the\n * shared sections with the kit's icons and words, and the app's own at the places they\n * name. The result is `SettingsLayout`'s `groups`; the entries stay the app's (a group\n * with no visible entry is hidden, as on any settings page — except, since 0.43, the\n * Overview, a page of tiles that needs no entry: it is `standalone`). Since 0.43 the\n * result's type leaves out the `leaveOut` sections, and {@link adminSectionOrder} gives\n * the same order as ids, without words.\n *\n * const groups = adminSections(useAdminAreaLabels(), [\n * { id: \"metrics\", icon: <BarChart3 />, title: t(\"…\"), help: t(\"…\"), after: \"overview\" },\n * { id: \"messaging\", icon: <MessageSquare />, title: t(\"…\"), help: t(\"…\") },\n * { id: \"health\", icon: <HeartPulse />, title: t(\"…\"), help: t(\"…\"), after: \"billing\" },\n * ], { leaveOut: [\"billing\"] });\n *\n * gives keksdose's overview, metrics, users, invitations, messaging, health, activity.\n * An `after` that names a left-out section takes that section's place. Kurvenschmiede's\n * Teams needs no `after`: between Invitations and Activity is the default.\n *\n * `labels` is the `adminArea` namespace, resolved — {@link useAdminAreaLabels} inside a\n * component, or the app's catalogue for the language; `undefined` is English. Throws for\n * an own section whose id is a shared one, an id given twice, or an `after` that names no\n * section: the catalogue is built once, and a section quietly missing from it is worse.\n */\nexport function adminSections<G extends string = never, L extends AdminSharedSection = AdminSharedSection>(\n labels: AdminAreaLabels | undefined,\n own: readonly AdminOwnSection<G>[] = [],\n options: AdminSectionsOptions<L> = {},\n): SettingsGroup<AdminKeptSection<L> | G>[] {\n const words = labels ?? DEFAULT_ADMIN_AREA_LABELS;\n return orderSections(own, options.leaveOut).map((s): SettingsGroup<AdminKeptSection<L> | G> => {\n if (\"own\" in s) {\n const { after: _after, ...group } = s.own;\n return group;\n }\n const { id, icon } = s.shared;\n const visible = options.visible?.[id];\n return {\n id: id as AdminKeptSection<L>,\n icon: createElement(icon, { \"aria-hidden\": true }) as ReactNode,\n title: words.sections[id].title,\n help: words.sections[id].help,\n // 0.43 (kastlan): the overview is a page of tiles, not of setting cards — it shows\n // with no entry of its own.\n ...(id === \"overview\" ? { standalone: true } : null),\n ...(visible === undefined ? null : { visible }),\n ...(options.badges?.[id] == null ? null : { badge: options.badges[id] }),\n };\n });\n}\n"],"mappings":";AAAA,SAAS,qBAAqB;AAE9B,SAAS,SAAS,iBAAiB,MAAM,SAAS,aAAa;AAG/D,SAAS,iCAAiC;AAoBnC,MAAM,iBAAoD,OAAO,OAAO;AAAA,EAC7E,EAAE,IAAI,YAAY,MAAM,gBAAgB;AAAA,EACxC,EAAE,IAAI,SAAS,MAAM,MAAM;AAAA,EAC3B,EAAE,IAAI,eAAe,MAAM,KAAK;AAAA,EAChC,EAAE,IAAI,WAAW,MAAM,QAAQ;AAAA,EAC/B,EAAE,IAAI,YAAY,MAAM,QAAQ;AAClC,CAAC;AAwDD,MAAM,oBAAwC;AAI9C,SAAS,cACP,KACA,aACqD;AACrD,QAAM,WAAW,IAAI,IAAY,eAAe,CAAC,CAAC;AAClD,QAAM,SAAS,IAAI,IAAY,eAAe,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC;AAC9D,QAAM,SAAS,oBAAI,IAAY;AAC/B,aAAW,WAAW,KAAK;AACzB,QAAI,OAAO,IAAI,QAAQ,EAAE,EAAG,OAAM,IAAI,MAAM,mBAAmB,QAAQ,EAAE,4BAA4B;AACrG,QAAI,OAAO,IAAI,QAAQ,EAAE,EAAG,OAAM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;AAAA,IAAI,CAAC,MAC/C,YAAY,IAAK,EAAE,OAAO,KAA6B,EAAE,IAAI;AAAA,EAC/D;AACF;AA0BO,SAAS,cACd,QACA,MAAqC,CAAC,GACtC,UAAmC,CAAC,GACM;AAC1C,QAAM,QAAQ,UAAU;AACxB,SAAO,cAAc,KAAK,QAAQ,QAAQ,EAAE,IAAI,CAAC,MAA8C;AAC7F,QAAI,SAAS,GAAG;AACd,YAAM,EAAE,OAAO,QAAQ,GAAG,MAAM,IAAI,EAAE;AACtC,aAAO;AAAA,IACT;AACA,UAAM,EAAE,IAAI,KAAK,IAAI,EAAE;AACvB,UAAM,UAAU,QAAQ,UAAU,EAAE;AACpC,WAAO;AAAA,MACL;AAAA,MACA,MAAM,cAAc,MAAM,EAAE,eAAe,KAAK,CAAC;AAAA,MACjD,OAAO,MAAM,SAAS,EAAE,EAAE;AAAA,MAC1B,MAAM,MAAM,SAAS,EAAE,EAAE;AAAA;AAAA;AAAA,MAGzB,GAAI,OAAO,aAAa,EAAE,YAAY,KAAK,IAAI;AAAA,MAC/C,GAAI,YAAY,SAAY,OAAO,EAAE,QAAQ;AAAA,MAC7C,GAAI,QAAQ,SAAS,EAAE,KAAK,OAAO,OAAO,EAAE,OAAO,QAAQ,OAAO,EAAE,EAAE;AAAA,IACxE;AAAA,EACF,CAAC;AACH;","names":[]}
1
+ {"version":3,"sources":["../../src/admin/admin-sections.tsx"],"sourcesContent":["import { createElement } from \"react\";\nimport type { ReactNode } from \"react\";\nimport { History, LayoutDashboard, Mail, Receipt, Users } from \"lucide-react\";\nimport type { LucideIcon } from \"lucide-react\";\nimport type { SettingsGroup } from \"../settings/settings-catalogue\";\nimport { DEFAULT_ADMIN_AREA_LABELS } from \"./admin-area-labels\";\nimport type { AdminAreaLabels, AdminSharedSection } from \"./admin-area-labels\";\n\n/**\n * The admin area's sections (0.42.0, docs/admin-harmonization.md §2.3, §6.8): the five\n * every app shares, in the template's order, and the helper that builds an app's\n * `SettingsLayout` catalogue groups from them and the app's own.\n */\n\n/** One shared section: its path segment and its icon. The words are `adminArea.sections`. */\nexport interface AdminSectionDefinition {\n id: AdminSharedSection;\n icon: LucideIcon;\n}\n\n/**\n * The shared sections in the template's order (§2.3 decision 10, §6.13): Overview, Users,\n * Invitations, Billing, Activity. An app's own sections go between them\n * ({@link adminSections}).\n */\nexport const ADMIN_SECTIONS: readonly AdminSectionDefinition[] = Object.freeze([\n { id: \"overview\", icon: LayoutDashboard },\n { id: \"users\", icon: Users },\n { id: \"invitations\", icon: Mail },\n { id: \"billing\", icon: Receipt },\n { id: \"activity\", icon: History },\n]);\n\n/**\n * One of the app's own sections: a catalogue group with its words, plus where it goes.\n * `after` names the section it follows — a shared one or another of the app's own. Left\n * out, it goes where the template puts an app's sections, after Invitations and before\n * Billing, in the order given.\n */\nexport interface AdminOwnSection<G extends string = string> extends SettingsGroup<G> {\n after?: AdminSharedSection | G;\n}\n\n/** Where one section goes, without its words — what {@link adminSectionOrder} takes. An\n * {@link AdminOwnSection} is one. */\nexport interface AdminSectionPlace<G extends string = string> {\n id: G;\n after?: AdminSharedSection | G;\n}\n\n/** The order's options: the shared sections an app does not have. */\nexport interface AdminSectionOrderOptions<L extends AdminSharedSection = AdminSharedSection> {\n /**\n * Shared sections this app does not have — keksdose and Kurvenschmiede have no billing\n * view (`[\"billing\"]`). Left out, every shared section is in the catalogue. Since 0.43\n * the result's type leaves them out too, so no cast is needed to drop `\"billing\"` —\n * when TypeScript infers the type arguments. With them written out, name the left-out\n * ones as the second (`adminSections<Own, \"billing\">(…)`); `adminSections<Own>(…)`\n * keeps every shared id in the type, as before.\n */\n leaveOut?: readonly L[];\n}\n\nexport interface AdminSectionsOptions<\n L extends AdminSharedSection = AdminSharedSection,\n> extends AdminSectionOrderOptions<L> {\n /**\n * A shared section that is in the catalogue but hidden for now, as\n * {@link SettingsGroup.visible}: kastlan's `{ billing: billingEnabled }` (settings §5),\n * whose path then acts as an unknown one.\n */\n visible?: Partial<Record<AdminSharedSection, boolean>>;\n /**\n * 0.48 (keksdose live #450): a shared section's {@link SettingsGroup.badge} — the\n * waiting work the account menu's badge counts, on the row of the section that holds\n * it: `{ overview: <AdminWaitingBadge count={waiting} /> }`. An app's own section\n * carries its `badge` itself.\n */\n badges?: Partial<Record<AdminSharedSection, ReactNode>>;\n}\n\n/** The shared sections an app keeps when it leaves out `L`. A `leaveOut` typed as the\n * whole union (a variable of `AdminSharedSection[]`) says nothing about which, so it\n * narrows nothing. */\nexport type AdminKeptSection<L extends AdminSharedSection = AdminSharedSection> = [AdminSharedSection] extends [L]\n ? AdminSharedSection\n : Exclude<AdminSharedSection, L>;\n\n/** The shared section after which the app's sections go when they name no place. */\nconst OWN_DEFAULT_AFTER: AdminSharedSection = \"invitations\";\n\n/** The shared and own sections in their order — a shared one as its definition, an own\n * one as given. Throws as {@link adminSections} documents. */\nfunction orderSections<S extends AdminSectionPlace<string>>(\n own: readonly S[],\n leaveOutIds: readonly AdminSharedSection[] | undefined,\n): ({ shared: AdminSectionDefinition } | { own: S })[] {\n const leaveOut = new Set<string>(leaveOutIds ?? []);\n const shared = new Set<string>(ADMIN_SECTIONS.map((s) => s.id));\n const ownIds = new Set<string>();\n for (const section of own) {\n if (shared.has(section.id)) throw new Error(`adminSections: \"${section.id}\" is a shared section's id`);\n if (ownIds.has(section.id)) throw new Error(`adminSections: \"${section.id}\" is given twice`);\n ownIds.add(section.id);\n }\n for (const section of own) {\n const after = section.after;\n if (after !== undefined && !shared.has(after) && !ownIds.has(after)) {\n throw new Error(`adminSections: \"${section.id}\" goes after \"${after}\", which is no section`);\n }\n }\n\n // Each section's followers, in the order given: the shared ones, then the own ones\n // under their `after`, recursively, so an own section may follow another own one.\n const followers = new Map<string, S[]>();\n for (const section of own) {\n const after = section.after ?? OWN_DEFAULT_AFTER;\n followers.set(after, [...(followers.get(after) ?? []), section]);\n }\n\n const out: ({ shared: AdminSectionDefinition } | { own: S })[] = [];\n const placed = new Set<string>();\n const placeAfter = (id: string) => {\n for (const section of followers.get(id) ?? []) {\n out.push({ own: section });\n placed.add(section.id);\n placeAfter(section.id);\n }\n };\n for (const definition of ADMIN_SECTIONS) {\n if (!leaveOut.has(definition.id)) out.push({ shared: definition });\n // A left-out section's followers keep its place.\n placeAfter(definition.id);\n }\n const stuck = own.filter((s) => !placed.has(s.id)).map((s) => s.id);\n if (stuck.length) throw new Error(`adminSections: ${stuck.join(\", \")} follow each other in a circle`);\n return out;\n}\n\n/**\n * The admin area's section ids in the template's order (0.43, keksdose) — what\n * {@link adminSections} builds its groups in, without the words: for an app that needs the\n * ORDER only (a router's list of paths, a test), outside a component, with no labels.\n *\n * adminSectionOrder([{ id: \"metrics\", after: \"overview\" }], { leaveOut: [\"billing\"] })\n * // [\"overview\", \"metrics\", \"users\", \"invitations\", \"activity\"]\n *\n * Throws as {@link adminSections} does.\n */\nexport function adminSectionOrder<G extends string = never, L extends AdminSharedSection = AdminSharedSection>(\n own: readonly AdminSectionPlace<G>[] = [],\n options: AdminSectionOrderOptions<L> = {},\n): (AdminKeptSection<L> | G)[] {\n return orderSections(own, options.leaveOut).map((s) =>\n \"shared\" in s ? (s.shared.id as AdminKeptSection<L>) : s.own.id,\n );\n}\n\n/**\n * An app's admin catalogue groups, in the template's order (§2.3 decision 10, §6.8): the\n * shared sections with the kit's icons and words, and the app's own at the places they\n * name. The result is `SettingsLayout`'s `groups`; the entries stay the app's (a group\n * with no visible entry is hidden, as on any settings page — except, since 0.43, the\n * Overview, a page of tiles that needs no entry: it is `standalone`). Since 0.43 the\n * result's type leaves out the `leaveOut` sections, and {@link adminSectionOrder} gives\n * the same order as ids, without words.\n *\n * const groups = adminSections(useAdminAreaLabels(), [\n * { id: \"metrics\", icon: <BarChart3 />, title: t(\"…\"), help: t(\"…\"), after: \"overview\" },\n * { id: \"messaging\", icon: <MessageSquare />, title: t(\"…\"), help: t(\"…\") },\n * { id: \"health\", icon: <HeartPulse />, title: t(\"…\"), help: t(\"…\"), after: \"billing\" },\n * ], { leaveOut: [\"billing\"] });\n *\n * gives keksdose's overview, metrics, users, invitations, messaging, health, activity.\n * An `after` that names a left-out section takes that section's place. Kurvenschmiede's\n * Teams needs no `after`: between Invitations and Activity is the default.\n *\n * `labels` is the `adminArea` namespace, resolved — {@link useAdminAreaLabels} inside a\n * component, or the app's catalogue for the language; `undefined` is English. Throws for\n * an own section whose id is a shared one, an id given twice, or an `after` that names no\n * section: the catalogue is built once, and a section quietly missing from it is worse.\n */\nexport function adminSections<G extends string = never, L extends AdminSharedSection = AdminSharedSection>(\n labels: AdminAreaLabels | undefined,\n own: readonly AdminOwnSection<G>[] = [],\n options: AdminSectionsOptions<L> = {},\n): SettingsGroup<AdminKeptSection<L> | G>[] {\n const words = labels ?? DEFAULT_ADMIN_AREA_LABELS;\n return orderSections(own, options.leaveOut).map((s): SettingsGroup<AdminKeptSection<L> | G> => {\n if (\"own\" in s) {\n const { after: _after, ...group } = s.own;\n return group;\n }\n const { id, icon } = s.shared;\n const visible = options.visible?.[id];\n return {\n id: id as AdminKeptSection<L>,\n icon: createElement(icon, { \"aria-hidden\": true }) as ReactNode,\n title: words.sections[id].title,\n help: words.sections[id].help,\n // 0.43 (kastlan): the overview is a page of tiles, not of setting cards — it shows\n // with no entry of its own.\n ...(id === \"overview\" ? { standalone: true } : null),\n ...(visible === undefined ? null : { visible }),\n ...(options.badges?.[id] == null ? null : { badge: options.badges[id] }),\n };\n });\n}\n"],"mappings":";AAAA,SAAS,qBAAqB;AAE9B,SAAS,SAAS,iBAAiB,MAAM,SAAS,aAAa;AAG/D,SAAS,iCAAiC;AAoBnC,MAAM,iBAAoD,OAAO,OAAO;AAAA,EAC7E,EAAE,IAAI,YAAY,MAAM,gBAAgB;AAAA,EACxC,EAAE,IAAI,SAAS,MAAM,MAAM;AAAA,EAC3B,EAAE,IAAI,eAAe,MAAM,KAAK;AAAA,EAChC,EAAE,IAAI,WAAW,MAAM,QAAQ;AAAA,EAC/B,EAAE,IAAI,YAAY,MAAM,QAAQ;AAClC,CAAC;AA0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ps {
45
45
  *
46
46
  * With no visible link it renders nothing.
47
47
  */
48
- export declare function AdminToolLinks({ links, variant, renderLink, labels: labelsProp, className }: AdminToolLinksProps): import("react").JSX.Element | null;
48
+ export declare function AdminToolLinks({ links, variant, renderLink, labels: labelsProp, className, }: AdminToolLinksProps): import("react").JSX.Element | null;
@@ -4,7 +4,13 @@ import { useId } from "react";
4
4
  import { cn } from "../lib/cn.js";
5
5
  import { List, ListItem } from "../components/list.js";
6
6
  import { useAdminAreaLabels } from "./admin-area-labels.js";
7
- function AdminToolLinks({ links, variant = "sidebar", renderLink, labels: labelsProp, className }) {
7
+ function AdminToolLinks({
8
+ links,
9
+ variant = "sidebar",
10
+ renderLink,
11
+ labels: labelsProp,
12
+ className
13
+ }) {
8
14
  const labels = useAdminAreaLabels(labelsProp);
9
15
  const headingId = useId();
10
16
  const shown = links.filter((l) => l.visible !== false);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/admin/admin-tool-links.tsx"],"sourcesContent":["import { useId } from \"react\";\nimport type { ReactElement, ReactNode } from \"react\";\nimport { cn } from \"../lib/cn\";\nimport { List, ListItem } from \"../components/list\";\nimport type { ListItemLinkProps } from \"../components/list\";\nimport type { LabelOverride } from \"../i18n/kit-labels\";\nimport { useAdminAreaLabels } from \"./admin-area-labels\";\nimport type { AdminAreaLabels } from \"./admin-area-labels\";\n\n/** One link of the Tools list. */\nexport interface AdminToolLink {\n /** Unique in the list. */\n key: string;\n label: string;\n href: string;\n /** A lucide element, sized by the row. */\n icon?: ReactNode;\n /** `false` leaves the link out — Translations for an admin who doesn't review\n * (§6.11, ka F7). Default: shown. */\n visible?: boolean;\n}\n\nexport interface AdminToolLinksProps {\n links: readonly AdminToolLink[];\n /**\n * `sidebar` (default): a `<nav>` named and headed \"Tools\", for `SettingsLayout`'s\n * `sidebarFooter` under the section list on a desktop. `list`: the bare rows, for\n * `SettingsLayout`'s `phoneFooter`, which puts them in a list of their own.\n */\n variant?: \"sidebar\" | \"list\";\n /** Your router's link. Default: the `<UiKitProvider linkComponent>`, then `<a>`. */\n renderLink?: (props: ListItemLinkProps) => ReactElement;\n /** Prop > `<UiKitProvider labels={{ adminArea }}>` > English. */\n labels?: LabelOverride<AdminAreaLabels>;\n className?: string;\n}\n\n/**\n * The admin area's links to the admin tools that are pages of their own (0.42.0,\n * docs/admin-harmonization.md §2.5 decision 16, §6.11): Translations, and the app's task\n * pages (kastlan's Data import). The feedback inbox is not one of them: the top bar's\n * feedback menu reaches it, and the overview's tiles link to it.\n *\n * Draw it twice from one list — at the foot of the section sidebar and in the phone\n * footer:\n *\n * <SettingsLayout\n * sidebarFooter={<AdminToolLinks links={TOOLS} />}\n * phoneFooter={<AdminToolLinks links={TOOLS} variant=\"list\" />}\n * …\n * />\n *\n * With no visible link it renders nothing.\n */\nexport function AdminToolLinks({ links, variant = \"sidebar\", renderLink, labels: labelsProp, className }: AdminToolLinksProps) {\n const labels = useAdminAreaLabels(labelsProp);\n const headingId = useId();\n const shown = links.filter((l) => l.visible !== false);\n if (shown.length === 0) return null;\n const rows = shown.map((l) => (\n <ListItem\n key={l.key}\n href={l.href}\n renderLink={renderLink}\n title={l.label}\n leading={\n l.icon === undefined ? undefined : (\n <span aria-hidden className=\"flex shrink-0 text-muted [&_svg]:size-4\">\n {l.icon}\n </span>\n )\n }\n />\n ));\n if (variant === \"list\") return <>{rows}</>;\n return (\n <nav data-slot=\"admin-tool-links\" aria-labelledby={headingId} className={cn(\"space-y-1\", className)}>\n <div id={headingId} className=\"px-3 text-caption font-semibold uppercase tracking-wide text-muted\">\n {labels.tools}\n </div>\n <List density=\"compact\">{rows}</List>\n </nav>\n );\n}\n"],"mappings":";AAmEU,SAOuB,UAPvB,KASN,YATM;AAnEV,SAAS,aAAa;AAEtB,SAAS,UAAU;AACnB,SAAS,MAAM,gBAAgB;AAG/B,SAAS,0BAA0B;AAgD5B,SAAS,eAAe,EAAE,OAAO,UAAU,WAAW,YAAY,QAAQ,YAAY,UAAU,GAAwB;AAC7H,QAAM,SAAS,mBAAmB,UAAU;AAC5C,QAAM,YAAY,MAAM;AACxB,QAAM,QAAQ,MAAM,OAAO,CAAC,MAAM,EAAE,YAAY,KAAK;AACrD,MAAI,MAAM,WAAW,EAAG,QAAO;AAC/B,QAAM,OAAO,MAAM,IAAI,CAAC,MACtB;AAAA,IAAC;AAAA;AAAA,MAEC,MAAM,EAAE;AAAA,MACR;AAAA,MACA,OAAO,EAAE;AAAA,MACT,SACE,EAAE,SAAS,SAAY,SACrB,oBAAC,UAAK,eAAW,MAAC,WAAU,2CACzB,YAAE,MACL;AAAA;AAAA,IARC,EAAE;AAAA,EAWT,CACD;AACD,MAAI,YAAY,OAAQ,QAAO,gCAAG,gBAAK;AACvC,SACE,qBAAC,SAAI,aAAU,oBAAmB,mBAAiB,WAAW,WAAW,GAAG,aAAa,SAAS,GAChG;AAAA,wBAAC,SAAI,IAAI,WAAW,WAAU,sEAC3B,iBAAO,OACV;AAAA,IACA,oBAAC,QAAK,SAAQ,WAAW,gBAAK;AAAA,KAChC;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/admin/admin-tool-links.tsx"],"sourcesContent":["import { useId } from \"react\";\nimport type { ReactElement, ReactNode } from \"react\";\nimport { cn } from \"../lib/cn\";\nimport { List, ListItem } from \"../components/list\";\nimport type { ListItemLinkProps } from \"../components/list\";\nimport type { LabelOverride } from \"../i18n/kit-labels\";\nimport { useAdminAreaLabels } from \"./admin-area-labels\";\nimport type { AdminAreaLabels } from \"./admin-area-labels\";\n\n/** One link of the Tools list. */\nexport interface AdminToolLink {\n /** Unique in the list. */\n key: string;\n label: string;\n href: string;\n /** A lucide element, sized by the row. */\n icon?: ReactNode;\n /** `false` leaves the link out — Translations for an admin who doesn't review\n * (§6.11, ka F7). Default: shown. */\n visible?: boolean;\n}\n\nexport interface AdminToolLinksProps {\n links: readonly AdminToolLink[];\n /**\n * `sidebar` (default): a `<nav>` named and headed \"Tools\", for `SettingsLayout`'s\n * `sidebarFooter` under the section list on a desktop. `list`: the bare rows, for\n * `SettingsLayout`'s `phoneFooter`, which puts them in a list of their own.\n */\n variant?: \"sidebar\" | \"list\";\n /** Your router's link. Default: the `<UiKitProvider linkComponent>`, then `<a>`. */\n renderLink?: (props: ListItemLinkProps) => ReactElement;\n /** Prop > `<UiKitProvider labels={{ adminArea }}>` > English. */\n labels?: LabelOverride<AdminAreaLabels>;\n className?: string;\n}\n\n/**\n * The admin area's links to the admin tools that are pages of their own (0.42.0,\n * docs/admin-harmonization.md §2.5 decision 16, §6.11): Translations, and the app's task\n * pages (kastlan's Data import). The feedback inbox is not one of them: the top bar's\n * feedback menu reaches it, and the overview's tiles link to it.\n *\n * Draw it twice from one list — at the foot of the section sidebar and in the phone\n * footer:\n *\n * <SettingsLayout\n * sidebarFooter={<AdminToolLinks links={TOOLS} />}\n * phoneFooter={<AdminToolLinks links={TOOLS} variant=\"list\" />}\n * …\n * />\n *\n * With no visible link it renders nothing.\n */\nexport function AdminToolLinks({\n links,\n variant = \"sidebar\",\n renderLink,\n labels: labelsProp,\n className,\n}: AdminToolLinksProps) {\n const labels = useAdminAreaLabels(labelsProp);\n const headingId = useId();\n const shown = links.filter((l) => l.visible !== false);\n if (shown.length === 0) return null;\n const rows = shown.map((l) => (\n <ListItem\n key={l.key}\n href={l.href}\n renderLink={renderLink}\n title={l.label}\n leading={\n l.icon === undefined ? undefined : (\n <span aria-hidden className=\"flex shrink-0 text-muted [&_svg]:size-4\">\n {l.icon}\n </span>\n )\n }\n />\n ));\n if (variant === \"list\") return <>{rows}</>;\n return (\n <nav data-slot=\"admin-tool-links\" aria-labelledby={headingId} className={cn(\"space-y-1\", className)}>\n <div id={headingId} className=\"px-3 text-caption font-semibold uppercase tracking-wide text-muted\">\n {labels.tools}\n </div>\n <List density=\"compact\">{rows}</List>\n </nav>\n );\n}\n"],"mappings":";AAyEU,SAOuB,UAPvB,KASN,YATM;AAzEV,SAAS,aAAa;AAEtB,SAAS,UAAU;AACnB,SAAS,MAAM,gBAAgB;AAG/B,SAAS,0BAA0B;AAgD5B,SAAS,eAAe;AAAA,EAC7B;AAAA,EACA,UAAU;AAAA,EACV;AAAA,EACA,QAAQ;AAAA,EACR;AACF,GAAwB;AACtB,QAAM,SAAS,mBAAmB,UAAU;AAC5C,QAAM,YAAY,MAAM;AACxB,QAAM,QAAQ,MAAM,OAAO,CAAC,MAAM,EAAE,YAAY,KAAK;AACrD,MAAI,MAAM,WAAW,EAAG,QAAO;AAC/B,QAAM,OAAO,MAAM,IAAI,CAAC,MACtB;AAAA,IAAC;AAAA;AAAA,MAEC,MAAM,EAAE;AAAA,MACR;AAAA,MACA,OAAO,EAAE;AAAA,MACT,SACE,EAAE,SAAS,SAAY,SACrB,oBAAC,UAAK,eAAW,MAAC,WAAU,2CACzB,YAAE,MACL;AAAA;AAAA,IARC,EAAE;AAAA,EAWT,CACD;AACD,MAAI,YAAY,OAAQ,QAAO,gCAAG,gBAAK;AACvC,SACE,qBAAC,SAAI,aAAU,oBAAmB,mBAAiB,WAAW,WAAW,GAAG,aAAa,SAAS,GAChG;AAAA,wBAAC,SAAI,IAAI,WAAW,WAAU,sEAC3B,iBAAO,OACV;AAAA,IACA,oBAAC,QAAK,SAAQ,WAAW,gBAAK;AAAA,KAChC;AAEJ;","names":[]}
@@ -60,9 +60,7 @@ function InvitationsPanel({
60
60
  const [invalid, setInvalid] = useState(false);
61
61
  const [role, setRole] = useState(defaultRole ?? offered[0]);
62
62
  const [scope, setScope] = useState("");
63
- const [locale, setLocale] = useState(
64
- () => resolveLanguage([defaultLocale, kitLocale], languages)
65
- );
63
+ const [locale, setLocale] = useState(() => resolveLanguage([defaultLocale, kitLocale], languages));
66
64
  const [note, setNote] = useState("");
67
65
  const [busy, setBusy] = useState(null);
68
66
  const [failure, setFailure] = useState(null);
@@ -141,16 +139,7 @@ function InvitationsPanel({
141
139
  }
142
140
  }
143
141
  ),
144
- choosesRole && /* @__PURE__ */ jsx(
145
- RoleSelect,
146
- {
147
- label: labels.role,
148
- value: role,
149
- roles,
150
- offered,
151
- onChange: setRole
152
- }
153
- ),
142
+ choosesRole && /* @__PURE__ */ jsx(RoleSelect, { label: labels.role, value: role, roles, offered, onChange: setRole }),
154
143
  scopes && scopes.length > 0 && /* @__PURE__ */ jsxs(
155
144
  Select,
156
145
  {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/admin/invitations-panel.tsx"],"sourcesContent":["import { useState } from \"react\";\nimport type { FormEvent, ReactNode } from \"react\";\nimport { RefreshCw, Trash2, UserPlus } from \"lucide-react\";\nimport { cn } from \"../lib/cn\";\nimport type { DateInput } from \"../lib/format\";\nimport { useKitLabels, useKitLocale, type LabelOverride } from \"../i18n/kit-labels\";\nimport { KIT_LANGUAGES, resolveLanguage } from \"../i18n/languages\";\nimport type { KitLanguageCode } from \"../i18n/languages\";\nimport { RoleChip } from \"../components/account-chips\";\nimport type { RoleVocabulary } from \"../components/account-chips\";\nimport { AlertBanner } from \"../components/alert-banner\";\nimport { Chip } from \"../components/chip\";\nimport type { ChipTone } from \"../components/chip\";\nimport { CopyButton } from \"../components/copy-button\";\nimport { LanguageSelect } from \"../components/language-select\";\nimport { SectionLabel, Caption } from \"../components/text\";\nimport { RowActions } from \"../components/row-actions\";\nimport { Button } from \"../components/button\";\nimport { Input } from \"../components/input\";\nimport { Select } from \"../components/select\";\nimport { Spinner } from \"../components/spinner\";\nimport { COMMIT_EXCEPT_BILLING, useWriteLock } from \"../components/write-lock\";\nimport { settle, useDayText, usePersonLabel } from \"./admin-parts\";\nimport { hasContent } from \"../lib/presence\";\nimport type { AdminPerson, MaybePromise } from \"./admin-parts\";\nimport { RoleSelect } from \"./role-select\";\nimport { DEFAULT_INVITATIONS_LABELS } from \"./invitations-panel-labels\";\n\n/**\n * Who is invited, and the form that invites (docs/user-admin-harmonization.md §5; auth\n * §4.4: a hashed one-time token, 14 days, an address with a role and a scope).\n *\n * Kurvenschmiede's `invitations-panel.tsx` with its parts made props: a form (the address,\n * a role from the app's vocabulary, an optional scope — a team, a company — the language\n * the invitation is written in, a note), then one row per invitation with its status, when\n * it was sent and until when it works, and resend / copy link / revoke.\n *\n * - **It assumes nothing about who invites.** Admins do, team managers into their team,\n * kastlan's company admins into their company — and in keksdose ANY budget owner, from\n * the budget's sharing (Marcel, 2026-10-07). So no word here says \"admin\"; the roles,\n * the scopes and the callbacks are the app's, and so is the frame around it.\n * - **The address is someone else's.** No `+app` tag is offered (auth §4.5): a tag is\n * the owner's own choice, made when they sign up.\n * - **The link is shown once.** The token is stored hashed, so the server can show a link\n * only in the answer that minted it — on creation and on resend, and only while mail\n * goes to the console (dev, a deploy without mail). The panel keeps such a link for as\n * long as it is mounted and offers to copy it on its row; reloading the page loses it,\n * and \"resend\" mints a new one. With the console backend the panel says so up front.\n * - **Revoked is optional.** An app that deletes the row instead (kastlan) never sends\n * `revoked`; the status chip simply never says it (§5).\n *\n * It never sends a request: `onInvite`, `onResend` and `onRevoke` do.\n *\n * Under a write lock, inviting and resending are refused; a lapsed plan's lock (`kind:\n * \"billing\"`) still lets an invitation be revoked, since removing access is what a\n * lapsed plan allows (docs/billing-harmonization.md §12.13, §12.36). A demo lock refuses\n * all three.\n */\n\nexport type InvitationStatus = \"open\" | \"accepted\" | \"expired\" | \"revoked\";\n\n/** One row of `GET /admin/invitations` (§5), in the wire's own field names. */\nexport interface InvitationRow<R extends string = string> {\n id: string | number;\n email: string;\n role?: R | null;\n /** The scope's value — a team's or a company's id, matched against `scopes`. */\n scope?: string | number | null;\n note?: string | null;\n /** The language it was written in. */\n locale?: string | null;\n /** Who sent it: a name, or the person. */\n invited_by?: string | AdminPerson | null;\n created_at: DateInput;\n expires_at?: DateInput;\n status: InvitationStatus;\n /** The one-time link, while mail goes to the console — in the answer that minted it. */\n link?: string | null;\n}\n\n/** What the form sends — `POST /admin/invitations {email, role, scope?, note?, locale}`. */\nexport interface InvitationDraft<R extends string = string> {\n email: string;\n /** Absent when the app offers no role choice (`roles` left out). */\n role?: R;\n scope?: string;\n note?: string;\n locale: KitLanguageCode;\n}\n\n/** What `onInvite` / `onResend` may answer, so the panel can keep a shown-once link. */\nexport interface InvitationSentAnswer {\n /** The invitation the answer is about — `onInvite` needs it for the link to find its\n * row; `onResend` knows it already. */\n id?: string | number;\n /** The one-time link, while mail goes to the console. */\n link?: string | null;\n /** `false`: the invitation exists but the mail failed — say so, resend it. */\n sent?: boolean;\n}\n\n/** A scope an invitation can carry. */\nexport interface InvitationScope {\n value: string;\n label: string;\n}\n\n/** The `invitations` namespace. */\nexport interface InvitationsLabels {\n /** The form's address field. */\n email: string;\n /** Under it while what was typed is not an address. */\n invalidEmail: string;\n role: string;\n /** The scope select's label — the app's word (\"Team\", \"Company\") goes over it. */\n scope: string;\n /** The scope select's empty choice. */\n scopeNone: string;\n /** The language select's label. */\n language: string;\n note: string;\n /** The form's button. */\n invite: string;\n /** Heading over the rows. */\n listTitle: string;\n empty: string;\n loading: string;\n /** The status chip, per status. */\n status: Record<InvitationStatus, string>;\n /** \"Sent 6 Oct 2026\". */\n sent: (date: string) => string;\n /** \"Expires 20 Oct 2026\" — on an open invitation. */\n expires: (date: string) => string;\n /** \"by Ada Example\". */\n invitedBy: (name: string) => string;\n /** The resend button — \"Send ben@example.com a new link\". */\n resend: (email: string) => string;\n /** The copy button. */\n copyLink: string;\n /** The revoke button — \"Revoke the invitation for ben@example.com\". */\n revoke: (email: string) => string;\n /** Over everything while mail goes to the console. */\n consoleHint: string;\n /** Beside a link the answer carried with no row to put it on. */\n linkReady: (email: string) => string;\n /** The answer said the mail was not sent. */\n notSent: (email: string) => string;\n /** A rejected callback, unless `describeError` says better. */\n failed: string;\n}\n\n// Defined in ./invitations-panel-labels, which holds no component code (0.34, KS U8).\nexport { DEFAULT_INVITATIONS_LABELS };\n\n/** The tone of each status. */\nconst STATUS_TONES: Readonly<Record<InvitationStatus, ChipTone>> = {\n open: \"info\",\n accepted: \"success\",\n expired: \"warning\",\n revoked: \"neutral\",\n};\n\nexport interface InvitationsPanelProps<R extends string = string> {\n invitations: readonly InvitationRow<R>[];\n /** The app's roles. Left out: no role choice, and no role chip on a row. */\n roles?: RoleVocabulary<R>;\n /** The roles an invitation may carry — Kurvenschmiede's member or customer. Default:\n * the whole vocabulary. One role: no choice is drawn, and it is sent. */\n invitableRoles?: readonly R[];\n /** The role the form starts with. Default: the first invitable one. */\n defaultRole?: R;\n /** The scopes an invitation may carry — teams, companies. Left out: no scope field. */\n scopes?: readonly InvitationScope[];\n /** A scope must be chosen (no \"None\"). */\n scopeRequired?: boolean;\n /** The languages offered. Default: all seven of the kit's. */\n languages?: readonly KitLanguageCode[];\n /** The language the form starts with. Default: the page's, resolved to `languages`. */\n defaultLocale?: string;\n /** The server's `mail_backend`. `\"console\"` draws the hint. */\n mailBackend?: string | null;\n /** Creates one (resolve to clear the form; reject to keep it and say why). Left out:\n * no form — a list someone may look at but not add to. */\n onInvite?: (draft: InvitationDraft<R>) => MaybePromise<InvitationSentAnswer | void>;\n /** Mints a new link and mails it. Left out: no resend button. */\n onResend?: (invitation: InvitationRow<R>) => MaybePromise<InvitationSentAnswer | void>;\n /** Revokes an open or an expired invitation (level `none`, §4.2: re-inviting undoes\n * it). An expired row can be resent, and since 0.31 also removed: in an app that\n * keeps the rows it would otherwise stay listed for good (Kurvenschmiede's 0.30\n * adoption). Left out: no revoke button. */\n onRevoke?: (invitation: InvitationRow<R>) => MaybePromise;\n /** The list is being fetched. */\n loading?: boolean;\n /** The app's words for a rejected callback. */\n describeError?: (error: unknown) => ReactNode | undefined;\n /** Over the form: who can be invited and what happens, in the app's words. */\n intro?: ReactNode;\n /** The list's visible heading. Default: the `listTitle` label. `null` leaves it out,\n * for a page whose card is already headed \"Invitations\" (Kurvenschmiede's 0.30\n * adoption); the list keeps the label as its accessible name either way. */\n listTitle?: ReactNode | null;\n className?: string;\n labels?: LabelOverride<InvitationsLabels>;\n}\n\n// Shape only — whether the address may be invited is the server's question.\nconst EMAIL_SHAPE = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n\nconst ALL_CODES: readonly KitLanguageCode[] = KIT_LANGUAGES.map((language) => language.code);\n\n/** A failed run, told apart from an answer of `undefined`. */\nconst FAILED = Symbol(\"failed\");\n\nexport function InvitationsPanel<R extends string = string>({\n invitations,\n roles,\n invitableRoles,\n defaultRole,\n scopes,\n scopeRequired = false,\n languages = ALL_CODES,\n defaultLocale,\n mailBackend,\n onInvite,\n onResend,\n onRevoke,\n loading = false,\n describeError,\n intro,\n listTitle,\n className,\n labels: labelsProp,\n}: InvitationsPanelProps<R>) {\n const labels = useKitLabels(\"invitations\", DEFAULT_INVITATIONS_LABELS, labelsProp);\n const kitLocale = useKitLocale();\n const dayText = useDayText();\n const nameOf = usePersonLabel();\n const lock = useWriteLock();\n const offered: readonly R[] = invitableRoles ?? (roles ? (Object.keys(roles) as R[]) : []);\n const [email, setEmail] = useState(\"\");\n const [invalid, setInvalid] = useState(false);\n const [role, setRole] = useState<R | undefined>(defaultRole ?? offered[0]);\n const [scope, setScope] = useState(\"\");\n const [locale, setLocale] = useState<KitLanguageCode>(() =>\n resolveLanguage([defaultLocale, kitLocale], languages),\n );\n const [note, setNote] = useState(\"\");\n // One request at a time, for the whole panel; the key says which control spins.\n const [busy, setBusy] = useState<string | null>(null);\n const [failure, setFailure] = useState<ReactNode>(null);\n const [notice, setNotice] = useState<ReactNode>(null);\n // Links the answers carried, by invitation — shown once, kept while mounted.\n const [links, setLinks] = useState<Record<string, string>>({});\n // A link whose answer named no invitation: shown above the list instead.\n const [looseLink, setLooseLink] = useState<{ email: string; link: string } | null>(null);\n\n const run = async <T,>(key: string, call: () => MaybePromise<T>): Promise<T | void | typeof FAILED> => {\n setBusy(key);\n setFailure(null);\n setNotice(null);\n try {\n return await settle(call);\n } catch (error) {\n const own = describeError?.(error);\n setFailure(hasContent(own) ? own : labels.failed);\n return FAILED;\n } finally {\n setBusy(null);\n }\n };\n\n /** Keep what an answer carried: its link, and whether the mail went. */\n const took = (answer: InvitationSentAnswer | void, address: string, id?: string | number) => {\n if (!answer) return;\n const key = answer.id ?? id;\n if (answer.link) {\n if (key !== undefined) setLinks((known) => ({ ...known, [String(key)]: answer.link as string }));\n else setLooseLink({ email: address, link: answer.link });\n }\n if (answer.sent === false) setNotice(labels.notSent(address));\n };\n\n const address = email.trim();\n const choosesRole = roles !== undefined && offered.length > 1;\n const canInvite = onInvite !== undefined;\n\n const submit = async (event: FormEvent) => {\n event.preventDefault();\n // Enter in a field is a commit too — the button's lock does not see it.\n if (!onInvite || busy || lock.locked || address === \"\") return;\n if (!EMAIL_SHAPE.test(address)) {\n setInvalid(true);\n return;\n }\n if (scopes && scopeRequired && scope === \"\") return;\n const draft: InvitationDraft<R> = {\n email: address,\n locale,\n ...(role !== undefined && roles !== undefined ? { role } : {}),\n ...(scope !== \"\" ? { scope } : {}),\n ...(note.trim() !== \"\" ? { note: note.trim() } : {}),\n };\n const answer = await run(\"invite\", () => onInvite(draft));\n if (answer === FAILED) return;\n took(answer, address);\n setEmail(\"\");\n setNote(\"\");\n };\n\n const scopeLabel = (value: InvitationRow[\"scope\"]) =>\n value === null || value === undefined || value === \"\"\n ? null\n : (scopes?.find((s) => s.value === String(value))?.label ?? String(value));\n\n return (\n <div className={cn(\"space-y-3\", className)}>\n {intro && <div className=\"text-sm text-secondary\">{intro}</div>}\n {mailBackend === \"console\" && (\n <AlertBanner tone=\"info\" size=\"sm\">\n {labels.consoleHint}\n </AlertBanner>\n )}\n\n {canInvite && (\n <form noValidate onSubmit={submit} className=\"@container space-y-2\">\n <div className=\"grid grid-cols-1 gap-2 @md:grid-cols-2\">\n <Input\n label={labels.email}\n type=\"email\"\n inputMode=\"email\"\n autoComplete=\"off\"\n autoCapitalize=\"none\"\n spellCheck={false}\n required\n value={email}\n error={invalid ? labels.invalidEmail : undefined}\n data-private\n onChange={(event) => {\n setInvalid(false);\n setEmail(event.target.value);\n }}\n />\n {choosesRole && (\n <RoleSelect<R>\n label={labels.role}\n value={role}\n roles={roles}\n offered={offered}\n onChange={setRole}\n />\n )}\n {scopes && scopes.length > 0 && (\n <Select\n label={labels.scope}\n value={scope}\n required={scopeRequired}\n onChange={(event) => setScope(event.target.value)}\n >\n <option value=\"\" disabled={scopeRequired}>\n {labels.scopeNone}\n </option>\n {scopes.map((s) => (\n <option key={s.value} value={s.value}>\n {s.label}\n </option>\n ))}\n </Select>\n )}\n {languages.length > 1 && (\n <LanguageSelect label={labels.language} codes={languages} value={locale} onChange={setLocale} />\n )}\n <Input\n label={labels.note}\n value={note}\n maxLength={255}\n onChange={(event) => setNote(event.target.value)}\n className=\"@md:col-span-2\"\n />\n </div>\n <div className=\"flex justify-end\">\n <Button\n type=\"submit\"\n variant=\"accent\"\n commit\n pending={busy === \"invite\"}\n disabled={busy !== null || address === \"\" || (scopeRequired && scopes !== undefined && scope === \"\")}\n >\n <UserPlus className=\"size-4\" aria-hidden />\n {labels.invite}\n </Button>\n </div>\n </form>\n )}\n\n {failure && (\n <AlertBanner tone=\"danger\" size=\"sm\">\n {failure}\n </AlertBanner>\n )}\n {notice && (\n <AlertBanner tone=\"warning\" size=\"sm\" onDismiss={() => setNotice(null)}>\n {notice}\n </AlertBanner>\n )}\n {looseLink && (\n <AlertBanner tone=\"info\" size=\"sm\" onDismiss={() => setLooseLink(null)}>\n <div className=\"flex min-w-0 flex-wrap items-center gap-2\">\n <span data-private>{labels.linkReady(looseLink.email)}</span>\n <code className=\"min-w-0 break-all text-xs\">{looseLink.link}</code>\n <CopyButton size=\"xs\" text={looseLink.link} label={labels.copyLink} />\n </div>\n </AlertBanner>\n )}\n\n <div className=\"space-y-2\">\n {listTitle !== null && <SectionLabel as=\"h4\">{listTitle ?? labels.listTitle}</SectionLabel>}\n {loading && invitations.length === 0 ? (\n <div className=\"flex justify-center py-3\">\n <Spinner label={labels.loading} />\n </div>\n ) : invitations.length === 0 ? (\n <Caption>{labels.empty}</Caption>\n ) : (\n <ul aria-label={labels.listTitle} className=\"divide-y divide-subtle\">\n {invitations.map((invitation) => {\n const key = String(invitation.id);\n const link = invitation.link ?? links[key];\n const open = invitation.status === \"open\";\n const resendable = onResend && (open || invitation.status === \"expired\");\n const revocable = onRevoke && (open || invitation.status === \"expired\");\n const scopeText = scopeLabel(invitation.scope);\n const by =\n typeof invitation.invited_by === \"string\" ? invitation.invited_by : nameOf(invitation.invited_by);\n const facts = [\n dayText(invitation.created_at) && labels.sent(dayText(invitation.created_at)),\n open && dayText(invitation.expires_at ?? null) && labels.expires(dayText(invitation.expires_at ?? null)),\n by && labels.invitedBy(by),\n ].filter(Boolean);\n return (\n <li key={key} data-status={invitation.status} className=\"py-2 first:pt-0 last:pb-0\">\n <div className=\"flex flex-wrap items-center justify-between gap-x-3 gap-y-1.5\">\n <div className=\"min-w-0 flex-1 basis-48 space-y-1\">\n <div data-private className=\"truncate-until-large text-sm font-medium text-primary\">\n {invitation.email}\n </div>\n <div className=\"flex flex-wrap items-center gap-1\">\n <Chip size=\"xs\" shape=\"square\" caps tone={STATUS_TONES[invitation.status]}>\n {labels.status[invitation.status]}\n </Chip>\n {roles && invitation.role && <RoleChip<R> value={invitation.role} roles={roles} size=\"xs\" />}\n {scopeText && (\n <Chip size=\"xs\" shape=\"square\">\n {scopeText}\n </Chip>\n )}\n </div>\n {(facts.length > 0 || invitation.note) && (\n <div className=\"text-xs text-muted\">\n {facts.join(\" · \")}\n {invitation.note && (\n <>\n {facts.length > 0 && \" · \"}\n <span data-private>{invitation.note}</span>\n </>\n )}\n </div>\n )}\n </div>\n {(link || resendable || revocable) && (\n <div className=\"ms-auto flex shrink-0 items-center gap-1\">\n {/* The copy stays its own icon: it says \"Copied\" where it was\n pressed, which a menu entry that closes cannot. */}\n {link && open && <CopyButton size=\"xs\" tone=\"muted\" text={link} label={labels.copyLink} />}\n {/* Resend and revoke are the row's actions (docs/text-size-\n harmonization.md §10.8): resend an icon at Normal, revoke in\n the \"⋯\" menu (0.49 KIT-12); both in the menu at Large, where both names as text (\"Send … a new link\") would\n not fit a phone's row beside the copy icon. */}\n <RowActions\n name={invitation.email}\n actions={[\n resendable && {\n key: \"resend\",\n label: labels.resend(invitation.email),\n icon: RefreshCw,\n commit: true,\n pending: busy === `resend:${key}`,\n disabled: busy !== null,\n onSelect: () =>\n void (async () => {\n const answer = await run(`resend:${key}`, () => onResend(invitation));\n if (answer !== FAILED) took(answer, invitation.email, invitation.id);\n })(),\n },\n revocable && {\n key: \"revoke\",\n label: labels.revoke(invitation.email),\n icon: Trash2,\n tone: \"danger\",\n // Level `none` (user admin §4.2): re-inviting undoes it, so\n // the kit's KIT-12 question stays out; an app may ask in\n // `onRevoke` (keksdose does).\n confirm: false,\n // Removing access stays open under a lapsed plan (§12.36).\n commit: COMMIT_EXCEPT_BILLING,\n pending: busy === `revoke:${key}`,\n disabled: busy !== null,\n onSelect: () => void run(`revoke:${key}`, () => onRevoke(invitation)),\n },\n ]}\n />\n </div>\n )}\n </div>\n </li>\n );\n })}\n </ul>\n )}\n </div>\n </div>\n );\n}\n"],"mappings":";AA4TgB,SAgJY,UAhJZ,KAoCF,YApCE;AA5ThB,SAAS,gBAAgB;AAEzB,SAAS,WAAW,QAAQ,gBAAgB;AAC5C,SAAS,UAAU;AAEnB,SAAS,cAAc,oBAAwC;AAC/D,SAAS,eAAe,uBAAuB;AAE/C,SAAS,gBAAgB;AAEzB,SAAS,mBAAmB;AAC5B,SAAS,YAAY;AAErB,SAAS,kBAAkB;AAC3B,SAAS,sBAAsB;AAC/B,SAAS,cAAc,eAAe;AACtC,SAAS,kBAAkB;AAC3B,SAAS,cAAc;AACvB,SAAS,aAAa;AACtB,SAAS,cAAc;AACvB,SAAS,eAAe;AACxB,SAAS,uBAAuB,oBAAoB;AACpD,SAAS,QAAQ,YAAY,sBAAsB;AACnD,SAAS,kBAAkB;AAE3B,SAAS,kBAAkB;AAC3B,SAAS,kCAAkC;AAiI3C,MAAM,eAA6D;AAAA,EACjE,MAAM;AAAA,EACN,UAAU;AAAA,EACV,SAAS;AAAA,EACT,SAAS;AACX;AA8CA,MAAM,cAAc;AAEpB,MAAM,YAAw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B,UAAU,MAAM,KAAK,IAAI,UAAU,GAAG,IAAI,MAAM,SAAS,UAAU,CAAC;AAAA,kBACtE;AAAA,gBACF;AAAA;AAAA,YACF;AAAA,aACF;AAAA,WAEJ,KAzEO,GA0ET;AAAA,MAEJ,CAAC,GACH;AAAA,OAEJ;AAAA,KACF;AAEJ;","names":["address"]}
1
+ {"version":3,"sources":["../../src/admin/invitations-panel.tsx"],"sourcesContent":["import { useState } from \"react\";\nimport type { FormEvent, ReactNode } from \"react\";\nimport { RefreshCw, Trash2, UserPlus } from \"lucide-react\";\nimport { cn } from \"../lib/cn\";\nimport type { DateInput } from \"../lib/format\";\nimport { useKitLabels, useKitLocale, type LabelOverride } from \"../i18n/kit-labels\";\nimport { KIT_LANGUAGES, resolveLanguage } from \"../i18n/languages\";\nimport type { KitLanguageCode } from \"../i18n/languages\";\nimport { RoleChip } from \"../components/account-chips\";\nimport type { RoleVocabulary } from \"../components/account-chips\";\nimport { AlertBanner } from \"../components/alert-banner\";\nimport { Chip } from \"../components/chip\";\nimport type { ChipTone } from \"../components/chip\";\nimport { CopyButton } from \"../components/copy-button\";\nimport { LanguageSelect } from \"../components/language-select\";\nimport { SectionLabel, Caption } from \"../components/text\";\nimport { RowActions } from \"../components/row-actions\";\nimport { Button } from \"../components/button\";\nimport { Input } from \"../components/input\";\nimport { Select } from \"../components/select\";\nimport { Spinner } from \"../components/spinner\";\nimport { COMMIT_EXCEPT_BILLING, useWriteLock } from \"../components/write-lock\";\nimport { settle, useDayText, usePersonLabel } from \"./admin-parts\";\nimport { hasContent } from \"../lib/presence\";\nimport type { AdminPerson, MaybePromise } from \"./admin-parts\";\nimport { RoleSelect } from \"./role-select\";\nimport { DEFAULT_INVITATIONS_LABELS } from \"./invitations-panel-labels\";\n\n/**\n * Who is invited, and the form that invites (docs/user-admin-harmonization.md §5; auth\n * §4.4: a hashed one-time token, 14 days, an address with a role and a scope).\n *\n * Kurvenschmiede's `invitations-panel.tsx` with its parts made props: a form (the address,\n * a role from the app's vocabulary, an optional scope — a team, a company — the language\n * the invitation is written in, a note), then one row per invitation with its status, when\n * it was sent and until when it works, and resend / copy link / revoke.\n *\n * - **It assumes nothing about who invites.** Admins do, team managers into their team,\n * kastlan's company admins into their company — and in keksdose ANY budget owner, from\n * the budget's sharing (Marcel, 2026-10-07). So no word here says \"admin\"; the roles,\n * the scopes and the callbacks are the app's, and so is the frame around it.\n * - **The address is someone else's.** No `+app` tag is offered (auth §4.5): a tag is\n * the owner's own choice, made when they sign up.\n * - **The link is shown once.** The token is stored hashed, so the server can show a link\n * only in the answer that minted it — on creation and on resend, and only while mail\n * goes to the console (dev, a deploy without mail). The panel keeps such a link for as\n * long as it is mounted and offers to copy it on its row; reloading the page loses it,\n * and \"resend\" mints a new one. With the console backend the panel says so up front.\n * - **Revoked is optional.** An app that deletes the row instead (kastlan) never sends\n * `revoked`; the status chip simply never says it (§5).\n *\n * It never sends a request: `onInvite`, `onResend` and `onRevoke` do.\n *\n * Under a write lock, inviting and resending are refused; a lapsed plan's lock (`kind:\n * \"billing\"`) still lets an invitation be revoked, since removing access is what a\n * lapsed plan allows (docs/billing-harmonization.md §12.13, §12.36). A demo lock refuses\n * all three.\n */\n\nexport type InvitationStatus = \"open\" | \"accepted\" | \"expired\" | \"revoked\";\n\n/** One row of `GET /admin/invitations` (§5), in the wire's own field names. */\nexport interface InvitationRow<R extends string = string> {\n id: string | number;\n email: string;\n role?: R | null;\n /** The scope's value — a team's or a company's id, matched against `scopes`. */\n scope?: string | number | null;\n note?: string | null;\n /** The language it was written in. */\n locale?: string | null;\n /** Who sent it: a name, or the person. */\n invited_by?: string | AdminPerson | null;\n created_at: DateInput;\n expires_at?: DateInput;\n status: InvitationStatus;\n /** The one-time link, while mail goes to the console — in the answer that minted it. */\n link?: string | null;\n}\n\n/** What the form sends — `POST /admin/invitations {email, role, scope?, note?, locale}`. */\nexport interface InvitationDraft<R extends string = string> {\n email: string;\n /** Absent when the app offers no role choice (`roles` left out). */\n role?: R;\n scope?: string;\n note?: string;\n locale: KitLanguageCode;\n}\n\n/** What `onInvite` / `onResend` may answer, so the panel can keep a shown-once link. */\nexport interface InvitationSentAnswer {\n /** The invitation the answer is about — `onInvite` needs it for the link to find its\n * row; `onResend` knows it already. */\n id?: string | number;\n /** The one-time link, while mail goes to the console. */\n link?: string | null;\n /** `false`: the invitation exists but the mail failed — say so, resend it. */\n sent?: boolean;\n}\n\n/** A scope an invitation can carry. */\nexport interface InvitationScope {\n value: string;\n label: string;\n}\n\n/** The `invitations` namespace. */\nexport interface InvitationsLabels {\n /** The form's address field. */\n email: string;\n /** Under it while what was typed is not an address. */\n invalidEmail: string;\n role: string;\n /** The scope select's label — the app's word (\"Team\", \"Company\") goes over it. */\n scope: string;\n /** The scope select's empty choice. */\n scopeNone: string;\n /** The language select's label. */\n language: string;\n note: string;\n /** The form's button. */\n invite: string;\n /** Heading over the rows. */\n listTitle: string;\n empty: string;\n loading: string;\n /** The status chip, per status. */\n status: Record<InvitationStatus, string>;\n /** \"Sent 6 Oct 2026\". */\n sent: (date: string) => string;\n /** \"Expires 20 Oct 2026\" — on an open invitation. */\n expires: (date: string) => string;\n /** \"by Ada Example\". */\n invitedBy: (name: string) => string;\n /** The resend button — \"Send ben@example.com a new link\". */\n resend: (email: string) => string;\n /** The copy button. */\n copyLink: string;\n /** The revoke button — \"Revoke the invitation for ben@example.com\". */\n revoke: (email: string) => string;\n /** Over everything while mail goes to the console. */\n consoleHint: string;\n /** Beside a link the answer carried with no row to put it on. */\n linkReady: (email: string) => string;\n /** The answer said the mail was not sent. */\n notSent: (email: string) => string;\n /** A rejected callback, unless `describeError` says better. */\n failed: string;\n}\n\n// Defined in ./invitations-panel-labels, which holds no component code (0.34, KS U8).\nexport { DEFAULT_INVITATIONS_LABELS };\n\n/** The tone of each status. */\nconst STATUS_TONES: Readonly<Record<InvitationStatus, ChipTone>> = {\n open: \"info\",\n accepted: \"success\",\n expired: \"warning\",\n revoked: \"neutral\",\n};\n\nexport interface InvitationsPanelProps<R extends string = string> {\n invitations: readonly InvitationRow<R>[];\n /** The app's roles. Left out: no role choice, and no role chip on a row. */\n roles?: RoleVocabulary<R>;\n /** The roles an invitation may carry — Kurvenschmiede's member or customer. Default:\n * the whole vocabulary. One role: no choice is drawn, and it is sent. */\n invitableRoles?: readonly R[];\n /** The role the form starts with. Default: the first invitable one. */\n defaultRole?: R;\n /** The scopes an invitation may carry — teams, companies. Left out: no scope field. */\n scopes?: readonly InvitationScope[];\n /** A scope must be chosen (no \"None\"). */\n scopeRequired?: boolean;\n /** The languages offered. Default: all seven of the kit's. */\n languages?: readonly KitLanguageCode[];\n /** The language the form starts with. Default: the page's, resolved to `languages`. */\n defaultLocale?: string;\n /** The server's `mail_backend`. `\"console\"` draws the hint. */\n mailBackend?: string | null;\n /** Creates one (resolve to clear the form; reject to keep it and say why). Left out:\n * no form — a list someone may look at but not add to. */\n onInvite?: (draft: InvitationDraft<R>) => MaybePromise<InvitationSentAnswer | void>;\n /** Mints a new link and mails it. Left out: no resend button. */\n onResend?: (invitation: InvitationRow<R>) => MaybePromise<InvitationSentAnswer | void>;\n /** Revokes an open or an expired invitation (level `none`, §4.2: re-inviting undoes\n * it). An expired row can be resent, and since 0.31 also removed: in an app that\n * keeps the rows it would otherwise stay listed for good (Kurvenschmiede's 0.30\n * adoption). Left out: no revoke button. */\n onRevoke?: (invitation: InvitationRow<R>) => MaybePromise;\n /** The list is being fetched. */\n loading?: boolean;\n /** The app's words for a rejected callback. */\n describeError?: (error: unknown) => ReactNode | undefined;\n /** Over the form: who can be invited and what happens, in the app's words. */\n intro?: ReactNode;\n /** The list's visible heading. Default: the `listTitle` label. `null` leaves it out,\n * for a page whose card is already headed \"Invitations\" (Kurvenschmiede's 0.30\n * adoption); the list keeps the label as its accessible name either way. */\n listTitle?: ReactNode | null;\n className?: string;\n labels?: LabelOverride<InvitationsLabels>;\n}\n\n// Shape only — whether the address may be invited is the server's question.\nconst EMAIL_SHAPE = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n\nconst ALL_CODES: readonly KitLanguageCode[] = KIT_LANGUAGES.map((language) => language.code);\n\n/** A failed run, told apart from an answer of `undefined`. */\nconst FAILED = Symbol(\"failed\");\n\nexport function InvitationsPanel<R extends string = string>({\n invitations,\n roles,\n invitableRoles,\n defaultRole,\n scopes,\n scopeRequired = false,\n languages = ALL_CODES,\n defaultLocale,\n mailBackend,\n onInvite,\n onResend,\n onRevoke,\n loading = false,\n describeError,\n intro,\n listTitle,\n className,\n labels: labelsProp,\n}: InvitationsPanelProps<R>) {\n const labels = useKitLabels(\"invitations\", DEFAULT_INVITATIONS_LABELS, labelsProp);\n const kitLocale = useKitLocale();\n const dayText = useDayText();\n const nameOf = usePersonLabel();\n const lock = useWriteLock();\n const offered: readonly R[] = invitableRoles ?? (roles ? (Object.keys(roles) as R[]) : []);\n const [email, setEmail] = useState(\"\");\n const [invalid, setInvalid] = useState(false);\n const [role, setRole] = useState<R | undefined>(defaultRole ?? offered[0]);\n const [scope, setScope] = useState(\"\");\n const [locale, setLocale] = useState<KitLanguageCode>(() => resolveLanguage([defaultLocale, kitLocale], languages));\n const [note, setNote] = useState(\"\");\n // One request at a time, for the whole panel; the key says which control spins.\n const [busy, setBusy] = useState<string | null>(null);\n const [failure, setFailure] = useState<ReactNode>(null);\n const [notice, setNotice] = useState<ReactNode>(null);\n // Links the answers carried, by invitation — shown once, kept while mounted.\n const [links, setLinks] = useState<Record<string, string>>({});\n // A link whose answer named no invitation: shown above the list instead.\n const [looseLink, setLooseLink] = useState<{ email: string; link: string } | null>(null);\n\n const run = async <T,>(key: string, call: () => MaybePromise<T>): Promise<T | void | typeof FAILED> => {\n setBusy(key);\n setFailure(null);\n setNotice(null);\n try {\n return await settle(call);\n } catch (error) {\n const own = describeError?.(error);\n setFailure(hasContent(own) ? own : labels.failed);\n return FAILED;\n } finally {\n setBusy(null);\n }\n };\n\n /** Keep what an answer carried: its link, and whether the mail went. */\n const took = (answer: InvitationSentAnswer | void, address: string, id?: string | number) => {\n if (!answer) return;\n const key = answer.id ?? id;\n if (answer.link) {\n if (key !== undefined) setLinks((known) => ({ ...known, [String(key)]: answer.link as string }));\n else setLooseLink({ email: address, link: answer.link });\n }\n if (answer.sent === false) setNotice(labels.notSent(address));\n };\n\n const address = email.trim();\n const choosesRole = roles !== undefined && offered.length > 1;\n const canInvite = onInvite !== undefined;\n\n const submit = async (event: FormEvent) => {\n event.preventDefault();\n // Enter in a field is a commit too — the button's lock does not see it.\n if (!onInvite || busy || lock.locked || address === \"\") return;\n if (!EMAIL_SHAPE.test(address)) {\n setInvalid(true);\n return;\n }\n if (scopes && scopeRequired && scope === \"\") return;\n const draft: InvitationDraft<R> = {\n email: address,\n locale,\n ...(role !== undefined && roles !== undefined ? { role } : {}),\n ...(scope !== \"\" ? { scope } : {}),\n ...(note.trim() !== \"\" ? { note: note.trim() } : {}),\n };\n const answer = await run(\"invite\", () => onInvite(draft));\n if (answer === FAILED) return;\n took(answer, address);\n setEmail(\"\");\n setNote(\"\");\n };\n\n const scopeLabel = (value: InvitationRow[\"scope\"]) =>\n value === null || value === undefined || value === \"\"\n ? null\n : (scopes?.find((s) => s.value === String(value))?.label ?? String(value));\n\n return (\n <div className={cn(\"space-y-3\", className)}>\n {intro && <div className=\"text-sm text-secondary\">{intro}</div>}\n {mailBackend === \"console\" && (\n <AlertBanner tone=\"info\" size=\"sm\">\n {labels.consoleHint}\n </AlertBanner>\n )}\n\n {canInvite && (\n <form noValidate onSubmit={submit} className=\"@container space-y-2\">\n <div className=\"grid grid-cols-1 gap-2 @md:grid-cols-2\">\n <Input\n label={labels.email}\n type=\"email\"\n inputMode=\"email\"\n autoComplete=\"off\"\n autoCapitalize=\"none\"\n spellCheck={false}\n required\n value={email}\n error={invalid ? labels.invalidEmail : undefined}\n data-private\n onChange={(event) => {\n setInvalid(false);\n setEmail(event.target.value);\n }}\n />\n {choosesRole && (\n <RoleSelect<R> label={labels.role} value={role} roles={roles} offered={offered} onChange={setRole} />\n )}\n {scopes && scopes.length > 0 && (\n <Select\n label={labels.scope}\n value={scope}\n required={scopeRequired}\n onChange={(event) => setScope(event.target.value)}\n >\n <option value=\"\" disabled={scopeRequired}>\n {labels.scopeNone}\n </option>\n {scopes.map((s) => (\n <option key={s.value} value={s.value}>\n {s.label}\n </option>\n ))}\n </Select>\n )}\n {languages.length > 1 && (\n <LanguageSelect label={labels.language} codes={languages} value={locale} onChange={setLocale} />\n )}\n <Input\n label={labels.note}\n value={note}\n maxLength={255}\n onChange={(event) => setNote(event.target.value)}\n className=\"@md:col-span-2\"\n />\n </div>\n <div className=\"flex justify-end\">\n <Button\n type=\"submit\"\n variant=\"accent\"\n commit\n pending={busy === \"invite\"}\n disabled={busy !== null || address === \"\" || (scopeRequired && scopes !== undefined && scope === \"\")}\n >\n <UserPlus className=\"size-4\" aria-hidden />\n {labels.invite}\n </Button>\n </div>\n </form>\n )}\n\n {failure && (\n <AlertBanner tone=\"danger\" size=\"sm\">\n {failure}\n </AlertBanner>\n )}\n {notice && (\n <AlertBanner tone=\"warning\" size=\"sm\" onDismiss={() => setNotice(null)}>\n {notice}\n </AlertBanner>\n )}\n {looseLink && (\n <AlertBanner tone=\"info\" size=\"sm\" onDismiss={() => setLooseLink(null)}>\n <div className=\"flex min-w-0 flex-wrap items-center gap-2\">\n <span data-private>{labels.linkReady(looseLink.email)}</span>\n <code className=\"min-w-0 break-all text-xs\">{looseLink.link}</code>\n <CopyButton size=\"xs\" text={looseLink.link} label={labels.copyLink} />\n </div>\n </AlertBanner>\n )}\n\n <div className=\"space-y-2\">\n {listTitle !== null && <SectionLabel as=\"h4\">{listTitle ?? labels.listTitle}</SectionLabel>}\n {loading && invitations.length === 0 ? (\n <div className=\"flex justify-center py-3\">\n <Spinner label={labels.loading} />\n </div>\n ) : invitations.length === 0 ? (\n <Caption>{labels.empty}</Caption>\n ) : (\n <ul aria-label={labels.listTitle} className=\"divide-y divide-subtle\">\n {invitations.map((invitation) => {\n const key = String(invitation.id);\n const link = invitation.link ?? links[key];\n const open = invitation.status === \"open\";\n const resendable = onResend && (open || invitation.status === \"expired\");\n const revocable = onRevoke && (open || invitation.status === \"expired\");\n const scopeText = scopeLabel(invitation.scope);\n const by =\n typeof invitation.invited_by === \"string\" ? invitation.invited_by : nameOf(invitation.invited_by);\n const facts = [\n dayText(invitation.created_at) && labels.sent(dayText(invitation.created_at)),\n open &&\n dayText(invitation.expires_at ?? null) &&\n labels.expires(dayText(invitation.expires_at ?? null)),\n by && labels.invitedBy(by),\n ].filter(Boolean);\n return (\n <li key={key} data-status={invitation.status} className=\"py-2 first:pt-0 last:pb-0\">\n <div className=\"flex flex-wrap items-center justify-between gap-x-3 gap-y-1.5\">\n <div className=\"min-w-0 flex-1 basis-48 space-y-1\">\n <div data-private className=\"truncate-until-large text-sm font-medium text-primary\">\n {invitation.email}\n </div>\n <div className=\"flex flex-wrap items-center gap-1\">\n <Chip size=\"xs\" shape=\"square\" caps tone={STATUS_TONES[invitation.status]}>\n {labels.status[invitation.status]}\n </Chip>\n {roles && invitation.role && <RoleChip<R> value={invitation.role} roles={roles} size=\"xs\" />}\n {scopeText && (\n <Chip size=\"xs\" shape=\"square\">\n {scopeText}\n </Chip>\n )}\n </div>\n {(facts.length > 0 || invitation.note) && (\n <div className=\"text-xs text-muted\">\n {facts.join(\" · \")}\n {invitation.note && (\n <>\n {facts.length > 0 && \" · \"}\n <span data-private>{invitation.note}</span>\n </>\n )}\n </div>\n )}\n </div>\n {(link || resendable || revocable) && (\n <div className=\"ms-auto flex shrink-0 items-center gap-1\">\n {/* The copy stays its own icon: it says \"Copied\" where it was\n pressed, which a menu entry that closes cannot. */}\n {link && open && <CopyButton size=\"xs\" tone=\"muted\" text={link} label={labels.copyLink} />}\n {/* Resend and revoke are the row's actions (docs/text-size-\n harmonization.md §10.8): resend an icon at Normal, revoke in\n the \"⋯\" menu (0.49 KIT-12); both in the menu at Large, where both names as text (\"Send … a new link\") would\n not fit a phone's row beside the copy icon. */}\n <RowActions\n name={invitation.email}\n actions={[\n resendable && {\n key: \"resend\",\n label: labels.resend(invitation.email),\n icon: RefreshCw,\n commit: true,\n pending: busy === `resend:${key}`,\n disabled: busy !== null,\n onSelect: () =>\n void (async () => {\n const answer = await run(`resend:${key}`, () => onResend(invitation));\n if (answer !== FAILED) took(answer, invitation.email, invitation.id);\n })(),\n },\n revocable && {\n key: \"revoke\",\n label: labels.revoke(invitation.email),\n icon: Trash2,\n tone: \"danger\",\n // Level `none` (user admin §4.2): re-inviting undoes it, so\n // the kit's KIT-12 question stays out; an app may ask in\n // `onRevoke` (keksdose does).\n confirm: false,\n // Removing access stays open under a lapsed plan (§12.36).\n commit: COMMIT_EXCEPT_BILLING,\n pending: busy === `revoke:${key}`,\n disabled: busy !== null,\n onSelect: () => void run(`revoke:${key}`, () => onRevoke(invitation)),\n },\n ]}\n />\n </div>\n )}\n </div>\n </li>\n );\n })}\n </ul>\n )}\n </div>\n </div>\n );\n}\n"],"mappings":";AA0TgB,SA4IY,UA5IZ,KA8BF,YA9BE;AA1ThB,SAAS,gBAAgB;AAEzB,SAAS,WAAW,QAAQ,gBAAgB;AAC5C,SAAS,UAAU;AAEnB,SAAS,cAAc,oBAAwC;AAC/D,SAAS,eAAe,uBAAuB;AAE/C,SAAS,gBAAgB;AAEzB,SAAS,mBAAmB;AAC5B,SAAS,YAAY;AAErB,SAAS,kBAAkB;AAC3B,SAAS,sBAAsB;AAC/B,SAAS,cAAc,eAAe;AACtC,SAAS,kBAAkB;AAC3B,SAAS,cAAc;AACvB,SAAS,aAAa;AACtB,SAAS,cAAc;AACvB,SAAS,eAAe;AACxB,SAAS,uBAAuB,oBAAoB;AACpD,SAAS,QAAQ,YAAY,sBAAsB;AACnD,SAAS,kBAAkB;AAE3B,SAAS,kBAAkB;AAC3B,SAAS,kCAAkC;AAiI3C,MAAM,eAA6D;AAAA,EACjE,MAAM;AAAA,EACN,UAAU;AAAA,EACV,SAAS;AAAA,EACT,SAAS;AACX;AA8CA,MAAM,cAAc;AAEpB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