@eifi1/ui-kit 0.54.0 → 0.56.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (847) hide show
  1. package/README.md +90 -76
  2. package/dist/admin/plan-change.js +2 -2
  3. package/dist/admin/plan-change.js.map +1 -1
  4. package/dist/admin/user-roster.d.ts +6 -0
  5. package/dist/admin/user-roster.js +4 -0
  6. package/dist/admin/user-roster.js.map +1 -1
  7. package/dist/billing/billing-labels.d.ts +26 -0
  8. package/dist/billing/billing-labels.js +9 -0
  9. package/dist/billing/billing-labels.js.map +1 -1
  10. package/dist/billing/subscription-standing.d.ts +61 -0
  11. package/dist/billing/subscription-standing.js +51 -0
  12. package/dist/billing/subscription-standing.js.map +1 -0
  13. package/dist/billing/usage-meter.d.ts +52 -0
  14. package/dist/billing/usage-meter.js +52 -0
  15. package/dist/billing/usage-meter.js.map +1 -0
  16. package/dist/chart.d.ts +1 -0
  17. package/dist/chart.js +4 -0
  18. package/dist/chart.js.map +1 -1
  19. package/dist/components/alert-banner.js +2 -3
  20. package/dist/components/alert-banner.js.map +1 -1
  21. package/dist/components/amount-input.js +3 -15
  22. package/dist/components/amount-input.js.map +1 -1
  23. package/dist/components/autocomplete.js +2 -2
  24. package/dist/components/autocomplete.js.map +1 -1
  25. package/dist/components/bulk-action-bar.js +2 -1
  26. package/dist/components/bulk-action-bar.js.map +1 -1
  27. package/dist/components/button.d.ts +35 -1
  28. package/dist/components/button.js +6 -9
  29. package/dist/components/button.js.map +1 -1
  30. package/dist/components/calendar-heatmap.js +2 -2
  31. package/dist/components/calendar-heatmap.js.map +1 -1
  32. package/dist/components/camera-button.d.ts +89 -0
  33. package/dist/components/camera-button.js +122 -0
  34. package/dist/components/camera-button.js.map +1 -0
  35. package/dist/components/camera-capture.d.ts +66 -0
  36. package/dist/components/camera-capture.js +190 -0
  37. package/dist/components/camera-capture.js.map +1 -0
  38. package/dist/components/camera-labels.d.ts +20 -0
  39. package/dist/components/camera-labels.js +15 -0
  40. package/dist/components/camera-labels.js.map +1 -0
  41. package/dist/components/chart-edge.d.ts +9 -0
  42. package/dist/components/chart-edge.js +14 -3
  43. package/dist/components/chart-edge.js.map +1 -1
  44. package/dist/components/chart-zoom-core.js +34 -29
  45. package/dist/components/chart-zoom-core.js.map +1 -1
  46. package/dist/components/checkbox-group.js +1 -1
  47. package/dist/components/checkbox-group.js.map +1 -1
  48. package/dist/components/combobox-core.js +3 -2
  49. package/dist/components/combobox-core.js.map +1 -1
  50. package/dist/components/combobox.js +2 -2
  51. package/dist/components/combobox.js.map +1 -1
  52. package/dist/components/consent-again-notice-labels.d.ts +25 -0
  53. package/dist/components/consent-again-notice-labels.js +15 -0
  54. package/dist/components/consent-again-notice-labels.js.map +1 -0
  55. package/dist/components/consent-again-notice.d.ts +85 -0
  56. package/dist/components/consent-again-notice.js +94 -0
  57. package/dist/components/consent-again-notice.js.map +1 -0
  58. package/dist/components/country-select.js +2 -7
  59. package/dist/components/country-select.js.map +1 -1
  60. package/dist/components/currency-select.js +2 -2
  61. package/dist/components/currency-select.js.map +1 -1
  62. package/dist/components/danger-confirm.js +2 -2
  63. package/dist/components/danger-confirm.js.map +1 -1
  64. package/dist/components/data-table-column-settings.js +2 -2
  65. package/dist/components/data-table-column-settings.js.map +1 -1
  66. package/dist/components/data-table-fit.js.map +1 -1
  67. package/dist/components/data-table-virtual.js +13 -3
  68. package/dist/components/data-table-virtual.js.map +1 -1
  69. package/dist/components/date-field.js +2 -2
  70. package/dist/components/date-field.js.map +1 -1
  71. package/dist/components/date-picker.js +2 -2
  72. package/dist/components/date-picker.js.map +1 -1
  73. package/dist/components/date-range-picker.js +2 -6
  74. package/dist/components/date-range-picker.js.map +1 -1
  75. package/dist/components/dialog-frame.d.ts +3 -1
  76. package/dist/components/dialog-frame.js.map +1 -1
  77. package/dist/components/dropdown.js +7 -3
  78. package/dist/components/dropdown.js.map +1 -1
  79. package/dist/components/entity-combobox.js +2 -2
  80. package/dist/components/entity-combobox.js.map +1 -1
  81. package/dist/components/field-parts.d.ts +108 -6
  82. package/dist/components/field-parts.js +59 -6
  83. package/dist/components/field-parts.js.map +1 -1
  84. package/dist/components/field-suggestion-labels.d.ts +2 -0
  85. package/dist/components/field-suggestion-labels.js +10 -0
  86. package/dist/components/field-suggestion-labels.js.map +1 -0
  87. package/dist/components/field.js +1 -1
  88. package/dist/components/field.js.map +1 -1
  89. package/dist/components/file-button.d.ts +1 -1
  90. package/dist/components/file-button.js.map +1 -1
  91. package/dist/components/floating-panel.d.ts +7 -6
  92. package/dist/components/floating-panel.js +3 -17
  93. package/dist/components/floating-panel.js.map +1 -1
  94. package/dist/components/form-actions.d.ts +3 -2
  95. package/dist/components/form-actions.js.map +1 -1
  96. package/dist/components/hover-menu.js +3 -2
  97. package/dist/components/hover-menu.js.map +1 -1
  98. package/dist/components/icon-button.d.ts +23 -5
  99. package/dist/components/icon-button.js +7 -8
  100. package/dist/components/icon-button.js.map +1 -1
  101. package/dist/components/inline-confirm.js +2 -1
  102. package/dist/components/inline-confirm.js.map +1 -1
  103. package/dist/components/inline-entity-combobox.js +2 -2
  104. package/dist/components/inline-entity-combobox.js.map +1 -1
  105. package/dist/components/input.js +2 -2
  106. package/dist/components/input.js.map +1 -1
  107. package/dist/components/jump-calendar.js +3 -3
  108. package/dist/components/jump-calendar.js.map +1 -1
  109. package/dist/components/legal.d.ts +13 -1
  110. package/dist/components/legal.js +12 -0
  111. package/dist/components/legal.js.map +1 -1
  112. package/dist/components/legended-series-chart.d.ts +83 -0
  113. package/dist/components/legended-series-chart.js +77 -0
  114. package/dist/components/legended-series-chart.js.map +1 -0
  115. package/dist/components/lightbox.js +2 -1
  116. package/dist/components/lightbox.js.map +1 -1
  117. package/dist/components/mini-calendar.js +13 -5
  118. package/dist/components/mini-calendar.js.map +1 -1
  119. package/dist/components/modal.d.ts +23 -2
  120. package/dist/components/modal.js +24 -6
  121. package/dist/components/modal.js.map +1 -1
  122. package/dist/components/month-picker.d.ts +1 -1
  123. package/dist/components/month-picker.js +6 -6
  124. package/dist/components/month-picker.js.map +1 -1
  125. package/dist/components/multi-entity-combobox.js +2 -2
  126. package/dist/components/multi-entity-combobox.js.map +1 -1
  127. package/dist/components/multi-select.js +2 -6
  128. package/dist/components/multi-select.js.map +1 -1
  129. package/dist/components/number-input.js +2 -2
  130. package/dist/components/number-input.js.map +1 -1
  131. package/dist/components/page-header-layout.d.ts +18 -0
  132. package/dist/components/page-header-layout.js +23 -0
  133. package/dist/components/page-header-layout.js.map +1 -0
  134. package/dist/components/page-header-skeleton.d.ts +41 -0
  135. package/dist/components/page-header-skeleton.js +52 -0
  136. package/dist/components/page-header-skeleton.js.map +1 -0
  137. package/dist/components/page-header.js +4 -17
  138. package/dist/components/page-header.js.map +1 -1
  139. package/dist/components/popover.js +7 -2
  140. package/dist/components/popover.js.map +1 -1
  141. package/dist/components/release-notes-labels.d.ts +16 -0
  142. package/dist/components/release-notes-labels.js +18 -0
  143. package/dist/components/release-notes-labels.js.map +1 -0
  144. package/dist/components/release-notes.d.ts +65 -0
  145. package/dist/components/release-notes.js +65 -0
  146. package/dist/components/release-notes.js.map +1 -0
  147. package/dist/components/select.js +2 -2
  148. package/dist/components/select.js.map +1 -1
  149. package/dist/components/series-chart-labels.d.ts +9 -0
  150. package/dist/components/series-chart-labels.js +3 -1
  151. package/dist/components/series-chart-labels.js.map +1 -1
  152. package/dist/components/series-chart.d.ts +5 -0
  153. package/dist/components/series-chart.js +89 -36
  154. package/dist/components/series-chart.js.map +1 -1
  155. package/dist/components/toggle-group.js +3 -2
  156. package/dist/components/toggle-group.js.map +1 -1
  157. package/dist/components/treemap-layout.js.map +1 -1
  158. package/dist/components/treemap.d.ts +17 -15
  159. package/dist/components/treemap.js +167 -85
  160. package/dist/components/treemap.js.map +1 -1
  161. package/dist/eslint/index.js +1 -1
  162. package/dist/eslint/role-utilities.d.ts +2 -2
  163. package/dist/eslint/role-utilities.js.map +1 -1
  164. package/dist/feedback/feedback-inbox-page.d.ts +260 -0
  165. package/dist/feedback/feedback-inbox-page.js +207 -0
  166. package/dist/feedback/feedback-inbox-page.js.map +1 -0
  167. package/dist/feedback/feedback-vocabulary.js +2 -2
  168. package/dist/feedback/feedback-vocabulary.js.map +1 -1
  169. package/dist/feedback.d.ts +1 -0
  170. package/dist/feedback.js +6 -0
  171. package/dist/feedback.js.map +1 -1
  172. package/dist/hooks/use-debounce.d.ts +32 -5
  173. package/dist/hooks/use-debounce.js +6 -5
  174. package/dist/hooks/use-debounce.js.map +1 -1
  175. package/dist/hooks/use-file-picker.d.ts +3 -1
  176. package/dist/hooks/use-file-picker.js.map +1 -1
  177. package/dist/hooks/use-focus-trap.d.ts +19 -3
  178. package/dist/hooks/use-focus-trap.js +15 -5
  179. package/dist/hooks/use-focus-trap.js.map +1 -1
  180. package/dist/hooks/use-has-camera.d.ts +36 -0
  181. package/dist/hooks/use-has-camera.js +53 -0
  182. package/dist/hooks/use-has-camera.js.map +1 -0
  183. package/dist/hooks/use-hotkey.js +1 -10
  184. package/dist/hooks/use-hotkey.js.map +1 -1
  185. package/dist/hooks/use-overlay-history.d.ts +6 -1
  186. package/dist/hooks/use-overlay-history.js +10 -2
  187. package/dist/hooks/use-overlay-history.js.map +1 -1
  188. package/dist/i18n/defaults.js +11 -1
  189. package/dist/i18n/defaults.js.map +1 -1
  190. package/dist/i18n/german.js +75 -3
  191. package/dist/i18n/german.js.map +1 -1
  192. package/dist/i18n/kit-labels.d.ts +20 -0
  193. package/dist/i18n/kit-labels.js.map +1 -1
  194. package/dist/i18n/locales/en.js +92 -4
  195. package/dist/i18n/locales/en.js.map +3 -3
  196. package/dist/i18n/locales/es.js +71 -3
  197. package/dist/i18n/locales/es.js.map +1 -1
  198. package/dist/i18n/locales/fr.js +72 -2
  199. package/dist/i18n/locales/fr.js.map +1 -1
  200. package/dist/i18n/locales/hu.js +74 -3
  201. package/dist/i18n/locales/hu.js.map +1 -1
  202. package/dist/i18n/locales/it.js +74 -3
  203. package/dist/i18n/locales/it.js.map +1 -1
  204. package/dist/i18n/locales/zh.js +71 -3
  205. package/dist/i18n/locales/zh.js.map +1 -1
  206. package/dist/i18n/review.js +22 -1
  207. package/dist/i18n/review.js.map +1 -1
  208. package/dist/index.d.ts +24 -5
  209. package/dist/index.js +35 -1
  210. package/dist/index.js.map +1 -1
  211. package/dist/landing/landing-labels.d.ts +8 -0
  212. package/dist/landing/landing-labels.js +2 -1
  213. package/dist/landing/landing-labels.js.map +1 -1
  214. package/dist/lib/changelog.d.ts +130 -0
  215. package/dist/lib/changelog.js +137 -0
  216. package/dist/lib/changelog.js.map +1 -0
  217. package/dist/lib/clipboard-minus.js +2 -2
  218. package/dist/lib/clipboard-minus.js.map +1 -1
  219. package/dist/lib/dates.d.ts +29 -3
  220. package/dist/lib/dates.js +41 -12
  221. package/dist/lib/dates.js.map +1 -1
  222. package/dist/lib/editable-content.d.ts +33 -0
  223. package/dist/lib/editable-content.js +15 -0
  224. package/dist/lib/editable-content.js.map +1 -0
  225. package/dist/lib/focus-left.d.ts +47 -1
  226. package/dist/lib/focus-left.js +11 -2
  227. package/dist/lib/focus-left.js.map +1 -1
  228. package/dist/lib/server-wake.d.ts +49 -9
  229. package/dist/lib/server-wake.js +25 -14
  230. package/dist/lib/server-wake.js.map +1 -1
  231. package/dist/lib/session-refresh.d.ts +53 -0
  232. package/dist/lib/session-refresh.js +27 -1
  233. package/dist/lib/session-refresh.js.map +1 -1
  234. package/dist/rhf/fields.js +3 -3
  235. package/dist/rhf/fields.js.map +1 -1
  236. package/dist/shell/app-shell.d.ts +25 -1
  237. package/dist/shell/app-shell.js +3 -1
  238. package/dist/shell/app-shell.js.map +1 -1
  239. package/dist/shell/dev-menu.d.ts +3 -0
  240. package/dist/shell/dev-menu.js +4 -2
  241. package/dist/shell/dev-menu.js.map +1 -1
  242. package/dist/shell/held-changes-banner-labels.d.ts +23 -0
  243. package/dist/shell/held-changes-banner-labels.js +14 -0
  244. package/dist/shell/held-changes-banner-labels.js.map +1 -0
  245. package/dist/shell/held-changes-banner.d.ts +75 -0
  246. package/dist/shell/held-changes-banner.js +106 -0
  247. package/dist/shell/held-changes-banner.js.map +1 -0
  248. package/dist/shell/sync-status-indicator.d.ts +27 -12
  249. package/dist/shell/sync-status-indicator.js +13 -4
  250. package/dist/shell/sync-status-indicator.js.map +1 -1
  251. package/dist/shell/top-bar-parts-labels.d.ts +5 -0
  252. package/dist/shell/top-bar-parts-labels.js +3 -1
  253. package/dist/shell/top-bar-parts-labels.js.map +1 -1
  254. package/dist/shell.d.ts +2 -0
  255. package/dist/shell.js +3 -0
  256. package/dist/shell.js.map +1 -1
  257. package/dist/sync/engine.d.ts +11 -2
  258. package/dist/sync/engine.js +13 -5
  259. package/dist/sync/engine.js.map +1 -1
  260. package/dist/sync/hooks.d.ts +3 -2
  261. package/dist/sync/hooks.js +4 -2
  262. package/dist/sync/hooks.js.map +1 -1
  263. package/dist/testing/css-variables.generated.d.ts +2 -2
  264. package/dist/testing/css-variables.generated.js +1 -1
  265. package/dist/testing/css-variables.generated.js.map +1 -1
  266. package/dist/theme/chart-palette.d.ts +18 -0
  267. package/dist/theme/chart-palette.js +17 -1
  268. package/dist/theme/chart-palette.js.map +1 -1
  269. package/dist/theme/contrast-tokens.d.ts +3 -3
  270. package/dist/theme/contrast-tokens.js.map +1 -1
  271. package/dist/theme/contrast.d.ts +4 -4
  272. package/dist/theme/contrast.js.map +1 -1
  273. package/dist/tour/tour-overlay.js +2 -1
  274. package/dist/tour/tour-overlay.js.map +1 -1
  275. package/package.json +9 -12
  276. package/tokens.css +19 -54
  277. package/src/account/account-parts.ts +0 -47
  278. package/src/account/account-settings-labels.ts +0 -240
  279. package/src/account/account-settings.tsx +0 -698
  280. package/src/account/data-export-setting-labels.ts +0 -20
  281. package/src/account/data-export-setting.tsx +0 -200
  282. package/src/account/delete-account-setting-labels.ts +0 -33
  283. package/src/account/delete-account-setting.tsx +0 -342
  284. package/src/account/email-change-setting-labels.ts +0 -31
  285. package/src/account/email-change-setting.tsx +0 -443
  286. package/src/account/passkeys-setting.tsx +0 -445
  287. package/src/account/sessions-setting-labels.ts +0 -24
  288. package/src/account/sessions-setting.tsx +0 -283
  289. package/src/admin/admin-action-confirm-labels.ts +0 -19
  290. package/src/admin/admin-action-confirm.tsx +0 -509
  291. package/src/admin/admin-action-log-labels.ts +0 -83
  292. package/src/admin/admin-action-log.tsx +0 -464
  293. package/src/admin/admin-area-labels.ts +0 -114
  294. package/src/admin/admin-forbidden.tsx +0 -75
  295. package/src/admin/admin-overview.tsx +0 -258
  296. package/src/admin/admin-parts.ts +0 -68
  297. package/src/admin/admin-sections.tsx +0 -208
  298. package/src/admin/admin-tool-links.tsx +0 -90
  299. package/src/admin/invitations-panel-labels.ts +0 -31
  300. package/src/admin/invitations-panel.tsx +0 -516
  301. package/src/admin/mail-test-card-labels.ts +0 -19
  302. package/src/admin/mail-test-card.tsx +0 -189
  303. package/src/admin/plan-change-labels.ts +0 -5
  304. package/src/admin/plan-change.tsx +0 -474
  305. package/src/admin/reviewer-scope-editor-labels.ts +0 -16
  306. package/src/admin/reviewer-scope-editor.tsx +0 -224
  307. package/src/admin/role-select-labels.ts +0 -16
  308. package/src/admin/role-select.tsx +0 -282
  309. package/src/admin/transfer-ownership-dialog-labels.ts +0 -20
  310. package/src/admin/transfer-ownership-dialog.tsx +0 -162
  311. package/src/admin/user-roster-labels.ts +0 -17
  312. package/src/admin/user-roster.tsx +0 -559
  313. package/src/auth/accept-invitation-labels.ts +0 -21
  314. package/src/auth/accept-invitation.tsx +0 -210
  315. package/src/auth/auth-errors-labels.ts +0 -23
  316. package/src/auth/auth-errors.ts +0 -439
  317. package/src/auth/complete-name-dialog-labels.ts +0 -16
  318. package/src/auth/complete-name-dialog.tsx +0 -253
  319. package/src/auth/email-tag.ts +0 -75
  320. package/src/auth/forgot-password-form-labels.ts +0 -20
  321. package/src/auth/forgot-password-form.tsx +0 -221
  322. package/src/auth/form-rules.ts +0 -40
  323. package/src/auth/new-password-fields.tsx +0 -85
  324. package/src/auth/not-found-page-labels.ts +0 -12
  325. package/src/auth/not-found-page.tsx +0 -95
  326. package/src/auth/register-form-labels.ts +0 -31
  327. package/src/auth/register-form.tsx +0 -456
  328. package/src/auth/reset-password-form-labels.ts +0 -27
  329. package/src/auth/reset-password-form.tsx +0 -341
  330. package/src/auth/sign-in-form-labels.ts +0 -44
  331. package/src/auth/sign-in-form.tsx +0 -858
  332. package/src/auth/status-parts.tsx +0 -132
  333. package/src/auth/verify-email-labels.ts +0 -26
  334. package/src/auth/verify-email.tsx +0 -445
  335. package/src/billing/billing-banner.tsx +0 -258
  336. package/src/billing/billing-labels.ts +0 -381
  337. package/src/billing/billing-lock.ts +0 -108
  338. package/src/billing/billing-overview.ts +0 -157
  339. package/src/billing/billing-standing.ts +0 -80
  340. package/src/billing/cancel-request.ts +0 -97
  341. package/src/billing/cancel-subscription.tsx +0 -98
  342. package/src/billing/checkout-processing.ts +0 -394
  343. package/src/billing/checkout-return.ts +0 -90
  344. package/src/billing/pay-page.ts +0 -330
  345. package/src/billing/plan-card.tsx +0 -562
  346. package/src/billing/plan-change-labels.ts +0 -66
  347. package/src/billing/plan-limit-notice.tsx +0 -148
  348. package/src/billing/plan-limit-toast.tsx +0 -90
  349. package/src/billing/plan-limit.ts +0 -52
  350. package/src/billing/plan-price.ts +0 -98
  351. package/src/billing/plan-switch.tsx +0 -216
  352. package/src/billing/provider-page.ts +0 -84
  353. package/src/billing/subscription-actions.tsx +0 -247
  354. package/src/billing/subscription-status-chip.tsx +0 -95
  355. package/src/chart.ts +0 -103
  356. package/src/components/account-chips-labels.ts +0 -16
  357. package/src/components/account-chips.tsx +0 -474
  358. package/src/components/alert-banner.tsx +0 -670
  359. package/src/components/amount-input.tsx +0 -816
  360. package/src/components/appearance-labels.ts +0 -63
  361. package/src/components/authed-image-labels.ts +0 -11
  362. package/src/components/authed-image.tsx +0 -209
  363. package/src/components/autocomplete.tsx +0 -645
  364. package/src/components/breadcrumbs-labels.ts +0 -10
  365. package/src/components/breadcrumbs.tsx +0 -205
  366. package/src/components/bulk-action-bar-labels.ts +0 -11
  367. package/src/components/bulk-action-bar.tsx +0 -443
  368. package/src/components/button-group.tsx +0 -223
  369. package/src/components/button-look.ts +0 -256
  370. package/src/components/button.tsx +0 -339
  371. package/src/components/calculator.tsx +0 -341
  372. package/src/components/calendar-heatmap-labels.ts +0 -15
  373. package/src/components/calendar-heatmap.tsx +0 -600
  374. package/src/components/card.tsx +0 -377
  375. package/src/components/chart-edge.ts +0 -106
  376. package/src/components/chart-figure.tsx +0 -35
  377. package/src/components/chart-height.ts +0 -30
  378. package/src/components/chart-zoom-core.tsx +0 -627
  379. package/src/components/chart-zoom.tsx +0 -22
  380. package/src/components/chart.tsx +0 -554
  381. package/src/components/checkbox-group.tsx +0 -247
  382. package/src/components/checkbox.tsx +0 -346
  383. package/src/components/chip-input.tsx +0 -370
  384. package/src/components/chip-labels.ts +0 -13
  385. package/src/components/chip.tsx +0 -843
  386. package/src/components/choice-card.tsx +0 -544
  387. package/src/components/column-mapper-labels.ts +0 -38
  388. package/src/components/column-mapper.tsx +0 -655
  389. package/src/components/combobox-core.tsx +0 -1321
  390. package/src/components/combobox-suggestions.tsx +0 -131
  391. package/src/components/combobox.tsx +0 -716
  392. package/src/components/confirm-context.ts +0 -7
  393. package/src/components/confirm-dialog-labels.ts +0 -13
  394. package/src/components/confirm-dialog.tsx +0 -341
  395. package/src/components/copy-button-labels.ts +0 -13
  396. package/src/components/copy-button.tsx +0 -192
  397. package/src/components/country-select-labels.ts +0 -11
  398. package/src/components/country-select.tsx +0 -539
  399. package/src/components/currency-option-list.tsx +0 -188
  400. package/src/components/currency-select.tsx +0 -343
  401. package/src/components/danger-confirm-labels.ts +0 -20
  402. package/src/components/danger-confirm.tsx +0 -987
  403. package/src/components/data-table-cells.tsx +0 -118
  404. package/src/components/data-table-column-settings.tsx +0 -198
  405. package/src/components/data-table-filter-popover.tsx +0 -289
  406. package/src/components/data-table-filters.ts +0 -315
  407. package/src/components/data-table-fit.ts +0 -301
  408. package/src/components/data-table-groups.tsx +0 -288
  409. package/src/components/data-table-head.tsx +0 -280
  410. package/src/components/data-table-labels.ts +0 -198
  411. package/src/components/data-table-leading-row.tsx +0 -58
  412. package/src/components/data-table-mobile.tsx +0 -1117
  413. package/src/components/data-table-pagination.tsx +0 -202
  414. package/src/components/data-table-resize.ts +0 -188
  415. package/src/components/data-table-row-actions.tsx +0 -302
  416. package/src/components/data-table-row.tsx +0 -496
  417. package/src/components/data-table-selection.ts +0 -71
  418. package/src/components/data-table-shared.tsx +0 -287
  419. package/src/components/data-table-sort.ts +0 -163
  420. package/src/components/data-table-virtual.ts +0 -576
  421. package/src/components/data-table.tsx +0 -2598
  422. package/src/components/date-field.tsx +0 -684
  423. package/src/components/date-format-setting.tsx +0 -64
  424. package/src/components/date-picker.tsx +0 -404
  425. package/src/components/date-range-picker.tsx +0 -518
  426. package/src/components/description-list-labels.ts +0 -9
  427. package/src/components/description-list.tsx +0 -386
  428. package/src/components/dialog-frame-labels.ts +0 -7
  429. package/src/components/dialog-frame.tsx +0 -284
  430. package/src/components/disclosure.tsx +0 -476
  431. package/src/components/dropdown.tsx +0 -461
  432. package/src/components/empty-state.tsx +0 -136
  433. package/src/components/entity-combobox.tsx +0 -422
  434. package/src/components/error-boundary-labels.ts +0 -20
  435. package/src/components/error-boundary.tsx +0 -675
  436. package/src/components/facing-pair.ts +0 -93
  437. package/src/components/field-base-labels.ts +0 -20
  438. package/src/components/field-base.tsx +0 -656
  439. package/src/components/field-parts.tsx +0 -825
  440. package/src/components/field-strip.tsx +0 -129
  441. package/src/components/field.tsx +0 -206
  442. package/src/components/file-button.tsx +0 -295
  443. package/src/components/file-dropzone.tsx +0 -559
  444. package/src/components/floating-panel-labels.ts +0 -10
  445. package/src/components/floating-panel.tsx +0 -828
  446. package/src/components/focus-ring.ts +0 -16
  447. package/src/components/form-actions-labels.ts +0 -11
  448. package/src/components/form-actions.tsx +0 -578
  449. package/src/components/full-bleed-dialog.tsx +0 -294
  450. package/src/components/grouped-picker.tsx +0 -184
  451. package/src/components/help-popover.tsx +0 -117
  452. package/src/components/hover-menu.tsx +0 -343
  453. package/src/components/iban-input-labels.ts +0 -14
  454. package/src/components/iban-input.tsx +0 -236
  455. package/src/components/icon-button.tsx +0 -959
  456. package/src/components/icon-picker-labels.ts +0 -13
  457. package/src/components/icon-picker.tsx +0 -232
  458. package/src/components/image-grid-labels.ts +0 -11
  459. package/src/components/image-grid.tsx +0 -202
  460. package/src/components/inline-confirm.tsx +0 -116
  461. package/src/components/inline-edit-field-labels.ts +0 -11
  462. package/src/components/inline-edit-field.tsx +0 -552
  463. package/src/components/inline-entity-combobox.tsx +0 -849
  464. package/src/components/input.tsx +0 -394
  465. package/src/components/jump-calendar.tsx +0 -265
  466. package/src/components/language-select.tsx +0 -93
  467. package/src/components/legal-labels.ts +0 -105
  468. package/src/components/legal-page.tsx +0 -711
  469. package/src/components/legal.tsx +0 -668
  470. package/src/components/lightbox-labels.ts +0 -18
  471. package/src/components/lightbox.tsx +0 -399
  472. package/src/components/line-items-labels.ts +0 -14
  473. package/src/components/line-items.tsx +0 -602
  474. package/src/components/list-labels.ts +0 -12
  475. package/src/components/list.tsx +0 -870
  476. package/src/components/loading-state.tsx +0 -78
  477. package/src/components/measured-grid-labels.ts +0 -25
  478. package/src/components/measured-grid.tsx +0 -837
  479. package/src/components/menu-item.tsx +0 -241
  480. package/src/components/mini-calendar-labels.ts +0 -17
  481. package/src/components/mini-calendar.tsx +0 -792
  482. package/src/components/modal.tsx +0 -534
  483. package/src/components/money-draft.ts +0 -83
  484. package/src/components/money-field.tsx +0 -76
  485. package/src/components/month-grid.tsx +0 -229
  486. package/src/components/month-picker-labels.ts +0 -22
  487. package/src/components/month-picker.tsx +0 -1087
  488. package/src/components/multi-entity-combobox.tsx +0 -369
  489. package/src/components/multi-select.tsx +0 -376
  490. package/src/components/nav-pills.tsx +0 -198
  491. package/src/components/number-field.tsx +0 -327
  492. package/src/components/number-input.tsx +0 -559
  493. package/src/components/numeric-field.ts +0 -169
  494. package/src/components/numpad-sheet.tsx +0 -285
  495. package/src/components/one-time-code-input.tsx +0 -270
  496. package/src/components/page-contents-labels.ts +0 -9
  497. package/src/components/page-contents.tsx +0 -282
  498. package/src/components/page-header-context.ts +0 -8
  499. package/src/components/page-header.tsx +0 -298
  500. package/src/components/password-strength-labels.ts +0 -22
  501. package/src/components/password-strength.tsx +0 -241
  502. package/src/components/phone-input-labels.ts +0 -10
  503. package/src/components/phone-input.tsx +0 -282
  504. package/src/components/picker-sheet.tsx +0 -330
  505. package/src/components/pie-chart-labels.ts +0 -40
  506. package/src/components/pie-chart.tsx +0 -480
  507. package/src/components/popover-labels.ts +0 -14
  508. package/src/components/popover.tsx +0 -268
  509. package/src/components/progress-bar-labels.ts +0 -10
  510. package/src/components/progress-bar.tsx +0 -479
  511. package/src/components/qr-code.tsx +0 -76
  512. package/src/components/reauth-dialog-labels.ts +0 -13
  513. package/src/components/reauth-dialog.tsx +0 -265
  514. package/src/components/row-actions-labels.ts +0 -12
  515. package/src/components/row-actions.tsx +0 -795
  516. package/src/components/scroll-area.tsx +0 -123
  517. package/src/components/search-field.tsx +0 -192
  518. package/src/components/select.tsx +0 -294
  519. package/src/components/separator.tsx +0 -33
  520. package/src/components/series-chart-axes.ts +0 -342
  521. package/src/components/series-chart-budget.ts +0 -150
  522. package/src/components/series-chart-labels.ts +0 -33
  523. package/src/components/series-chart-thin.ts +0 -180
  524. package/src/components/series-chart-ticks.ts +0 -194
  525. package/src/components/series-chart.tsx +0 -1906
  526. package/src/components/server-wake-labels.ts +0 -11
  527. package/src/components/server-wake.tsx +0 -129
  528. package/src/components/settings-fields.tsx +0 -237
  529. package/src/components/share-card-labels.ts +0 -30
  530. package/src/components/share-card.tsx +0 -675
  531. package/src/components/signature-pad-labels.ts +0 -24
  532. package/src/components/signature-pad.tsx +0 -747
  533. package/src/components/signed-amount-labels.ts +0 -10
  534. package/src/components/signed-amount.tsx +0 -336
  535. package/src/components/skeleton.tsx +0 -80
  536. package/src/components/slider.tsx +0 -338
  537. package/src/components/sparkline-labels.ts +0 -14
  538. package/src/components/sparkline.tsx +0 -322
  539. package/src/components/spinner.tsx +0 -81
  540. package/src/components/stat-tile-labels.ts +0 -15
  541. package/src/components/stat-tile.tsx +0 -754
  542. package/src/components/status-dot.tsx +0 -170
  543. package/src/components/swatch-picker-labels.ts +0 -10
  544. package/src/components/swatch-picker.tsx +0 -283
  545. package/src/components/swipeable-row.tsx +0 -386
  546. package/src/components/switch.tsx +0 -273
  547. package/src/components/table-skeleton.tsx +0 -136
  548. package/src/components/table.tsx +0 -647
  549. package/src/components/tabs-labels.ts +0 -13
  550. package/src/components/tabs.tsx +0 -693
  551. package/src/components/text-link.tsx +0 -359
  552. package/src/components/text.tsx +0 -150
  553. package/src/components/textarea.tsx +0 -330
  554. package/src/components/tile-radio.tsx +0 -332
  555. package/src/components/time-input.tsx +0 -121
  556. package/src/components/toast-labels.ts +0 -12
  557. package/src/components/toast.tsx +0 -519
  558. package/src/components/toggle-group.tsx +0 -752
  559. package/src/components/toggle-legend.tsx +0 -394
  560. package/src/components/tooltip.tsx +0 -1149
  561. package/src/components/translation-review-editor.tsx +0 -290
  562. package/src/components/translation-review-labels.ts +0 -181
  563. package/src/components/translation-review-parts.tsx +0 -272
  564. package/src/components/translation-review.tsx +0 -1240
  565. package/src/components/tree-view.tsx +0 -589
  566. package/src/components/treemap-labels.ts +0 -47
  567. package/src/components/treemap-layout.ts +0 -210
  568. package/src/components/treemap.tsx +0 -1184
  569. package/src/components/trigger-aria.ts +0 -44
  570. package/src/components/use-anchor-dir.ts +0 -20
  571. package/src/components/use-mobile-reveal.ts +0 -62
  572. package/src/components/use-table-state.ts +0 -753
  573. package/src/components/user-avatar.tsx +0 -116
  574. package/src/components/wizard-stepper.tsx +0 -42
  575. package/src/components/write-lock-labels.ts +0 -10
  576. package/src/components/write-lock.tsx +0 -253
  577. package/src/currencies.ts +0 -90
  578. package/src/data-table.ts +0 -42
  579. package/src/demo/demo-banner.tsx +0 -153
  580. package/src/demo/demo-countdown.ts +0 -136
  581. package/src/demo/demo-ended.tsx +0 -90
  582. package/src/demo/demo-labels.ts +0 -78
  583. package/src/demo/demo-session.ts +0 -32
  584. package/src/demo/demo-start.tsx +0 -156
  585. package/src/eslint/index.ts +0 -161
  586. package/src/eslint/role-utilities.generated.ts +0 -146
  587. package/src/eslint/role-utilities.ts +0 -233
  588. package/src/feedback/feedback-attachment-download.tsx +0 -77
  589. package/src/feedback/feedback-attachment-labels.ts +0 -37
  590. package/src/feedback/feedback-attachment.tsx +0 -1239
  591. package/src/feedback/feedback-capture.ts +0 -287
  592. package/src/feedback/feedback-comment-thread.tsx +0 -353
  593. package/src/feedback/feedback-context-labels.ts +0 -11
  594. package/src/feedback/feedback-context.tsx +0 -245
  595. package/src/feedback/feedback-crash.ts +0 -547
  596. package/src/feedback/feedback-diagnostics.tsx +0 -41
  597. package/src/feedback/feedback-dialog-labels.ts +0 -29
  598. package/src/feedback/feedback-dialog.tsx +0 -452
  599. package/src/feedback/feedback-entry-file.tsx +0 -150
  600. package/src/feedback/feedback-inbox.tsx +0 -552
  601. package/src/feedback/feedback-labels.ts +0 -144
  602. package/src/feedback/feedback-menu-labels.ts +0 -12
  603. package/src/feedback/feedback-menu.tsx +0 -177
  604. package/src/feedback/feedback-mutation.ts +0 -20
  605. package/src/feedback/feedback-page-link.ts +0 -90
  606. package/src/feedback/feedback-public-labels.ts +0 -81
  607. package/src/feedback/feedback-public-list.tsx +0 -524
  608. package/src/feedback/feedback-public-switch.tsx +0 -102
  609. package/src/feedback/feedback-public-types.ts +0 -101
  610. package/src/feedback/feedback-record.ts +0 -428
  611. package/src/feedback/feedback-replies-context.ts +0 -9
  612. package/src/feedback/feedback-replies.tsx +0 -343
  613. package/src/feedback/feedback-rework-entry-chip.tsx +0 -18
  614. package/src/feedback/feedback-row-detail-labels.ts +0 -31
  615. package/src/feedback/feedback-row-detail.tsx +0 -871
  616. package/src/feedback/feedback-status-undo.ts +0 -109
  617. package/src/feedback/feedback-submit-dialog.tsx +0 -131
  618. package/src/feedback/feedback-submit.tsx +0 -270
  619. package/src/feedback/feedback-swipe.tsx +0 -192
  620. package/src/feedback/feedback-table-labels.ts +0 -27
  621. package/src/feedback/feedback-table.tsx +0 -912
  622. package/src/feedback/feedback-thread-labels.ts +0 -22
  623. package/src/feedback/feedback-thread-parts-labels.ts +0 -41
  624. package/src/feedback/feedback-thread.tsx +0 -905
  625. package/src/feedback/feedback-vocabulary.ts +0 -263
  626. package/src/feedback/feedback-vote-button.tsx +0 -124
  627. package/src/feedback.ts +0 -116
  628. package/src/hooks/use-anchored-panel.ts +0 -396
  629. package/src/hooks/use-anchored-rect.ts +0 -77
  630. package/src/hooks/use-announce.ts +0 -85
  631. package/src/hooks/use-authed-src.ts +0 -167
  632. package/src/hooks/use-body-scroll-lock.ts +0 -119
  633. package/src/hooks/use-breakpoint.ts +0 -133
  634. package/src/hooks/use-close-transition.ts +0 -107
  635. package/src/hooks/use-copy-to-clipboard.ts +0 -122
  636. package/src/hooks/use-debounce.ts +0 -114
  637. package/src/hooks/use-dismiss.ts +0 -371
  638. package/src/hooks/use-document-title.ts +0 -33
  639. package/src/hooks/use-file-drop.ts +0 -121
  640. package/src/hooks/use-file-picker-labels.ts +0 -28
  641. package/src/hooks/use-file-picker.tsx +0 -359
  642. package/src/hooks/use-focus-trap.ts +0 -199
  643. package/src/hooks/use-hotkey.ts +0 -212
  644. package/src/hooks/use-large-text.ts +0 -41
  645. package/src/hooks/use-long-press.ts +0 -140
  646. package/src/hooks/use-media-query.ts +0 -39
  647. package/src/hooks/use-mounted.ts +0 -39
  648. package/src/hooks/use-noindex.ts +0 -37
  649. package/src/hooks/use-overlay-history.ts +0 -714
  650. package/src/hooks/use-row-swipe.ts +0 -207
  651. package/src/hooks/use-search-param-state.ts +0 -434
  652. package/src/hooks/use-windowed-rows.ts +0 -225
  653. package/src/i18n/defaults.ts +0 -267
  654. package/src/i18n/german.ts +0 -2059
  655. package/src/i18n/kit-labels.tsx +0 -1003
  656. package/src/i18n/languages.ts +0 -349
  657. package/src/i18n/locales/de-CH.ts +0 -24
  658. package/src/i18n/locales/en.ts +0 -267
  659. package/src/i18n/locales/es.ts +0 -1999
  660. package/src/i18n/locales/fr.ts +0 -2037
  661. package/src/i18n/locales/hu.ts +0 -2004
  662. package/src/i18n/locales/it.ts +0 -2014
  663. package/src/i18n/locales/zh.ts +0 -1912
  664. package/src/i18n/plurals.ts +0 -86
  665. package/src/i18n/review.ts +0 -475
  666. package/src/i18n/shared-labels.ts +0 -138
  667. package/src/i18n/swiss.ts +0 -29
  668. package/src/index.ts +0 -1191
  669. package/src/landing/access.ts +0 -93
  670. package/src/landing/landing-actions.tsx +0 -97
  671. package/src/landing/landing-labels.ts +0 -59
  672. package/src/landing/landing-sections.tsx +0 -341
  673. package/src/landing/page-seo.ts +0 -261
  674. package/src/landing/public-header.tsx +0 -121
  675. package/src/landing/public-page.tsx +0 -106
  676. package/src/landing/routing.tsx +0 -225
  677. package/src/lib/broadcast.ts +0 -52
  678. package/src/lib/calc.ts +0 -323
  679. package/src/lib/chip-edge-snap.ts +0 -212
  680. package/src/lib/clipboard-minus.ts +0 -107
  681. package/src/lib/clipping.ts +0 -34
  682. package/src/lib/cn.ts +0 -28
  683. package/src/lib/column-mapping.ts +0 -234
  684. package/src/lib/countries.ts +0 -91
  685. package/src/lib/data-attributes.ts +0 -14
  686. package/src/lib/date-format.ts +0 -227
  687. package/src/lib/dates.ts +0 -288
  688. package/src/lib/day-format.ts +0 -96
  689. package/src/lib/decimal-marks.ts +0 -108
  690. package/src/lib/describe-failure.ts +0 -18
  691. package/src/lib/device-settings.ts +0 -147
  692. package/src/lib/direction.ts +0 -74
  693. package/src/lib/document-navigation.ts +0 -17
  694. package/src/lib/document-title.ts +0 -41
  695. package/src/lib/download.ts +0 -172
  696. package/src/lib/float-clearance.ts +0 -70
  697. package/src/lib/floating-stack.ts +0 -70
  698. package/src/lib/focus-left.ts +0 -156
  699. package/src/lib/format.ts +0 -585
  700. package/src/lib/http-status.ts +0 -38
  701. package/src/lib/iban.ts +0 -251
  702. package/src/lib/ime.ts +0 -24
  703. package/src/lib/intl-cache.ts +0 -27
  704. package/src/lib/iso-day.ts +0 -13
  705. package/src/lib/lazy-with-fallback.ts +0 -82
  706. package/src/lib/logger.ts +0 -69
  707. package/src/lib/minus.ts +0 -50
  708. package/src/lib/path-pattern.ts +0 -55
  709. package/src/lib/person-name.ts +0 -155
  710. package/src/lib/phone.ts +0 -208
  711. package/src/lib/plain-text.ts +0 -22
  712. package/src/lib/presence.ts +0 -18
  713. package/src/lib/qr-encode.ts +0 -444
  714. package/src/lib/quiet-focus.ts +0 -32
  715. package/src/lib/reduced-motion.ts +0 -22
  716. package/src/lib/refs.ts +0 -22
  717. package/src/lib/round.ts +0 -43
  718. package/src/lib/safe-storage.ts +0 -119
  719. package/src/lib/server-wake.ts +0 -315
  720. package/src/lib/session-refresh.ts +0 -472
  721. package/src/lib/share-format.ts +0 -18
  722. package/src/lib/status-tone.ts +0 -43
  723. package/src/lib/strip-fade.ts +0 -287
  724. package/src/lib/table-text.ts +0 -554
  725. package/src/lib/text-case.ts +0 -19
  726. package/src/lib/text-match.ts +0 -169
  727. package/src/lib/thenable.ts +0 -19
  728. package/src/lib/translation-review.ts +0 -769
  729. package/src/notifications/device-zone-report.ts +0 -67
  730. package/src/notifications/feedback-notification-types-labels.ts +0 -33
  731. package/src/notifications/feedback-notification-types.ts +0 -71
  732. package/src/notifications/notification-bell.tsx +0 -119
  733. package/src/notifications/notification-inbox.tsx +0 -309
  734. package/src/notifications/notification-parts.tsx +0 -81
  735. package/src/notifications/notification-types-setting.tsx +0 -406
  736. package/src/notifications/notification-types.ts +0 -89
  737. package/src/notifications/notifications-labels.ts +0 -287
  738. package/src/notifications/push-device-setting.tsx +0 -230
  739. package/src/notifications/push-devices-setting.tsx +0 -374
  740. package/src/notifications/push-worker.ts +0 -168
  741. package/src/notifications/quiet-hours-setting.tsx +0 -238
  742. package/src/notifications/unsubscribe-panel.tsx +0 -200
  743. package/src/notifications/use-push-device.ts +0 -448
  744. package/src/offline/local-first.ts +0 -100
  745. package/src/offline/pwa-update-prompt-labels.ts +0 -9
  746. package/src/offline/pwa-update-prompt.tsx +0 -78
  747. package/src/offline/query-persistence.ts +0 -391
  748. package/src/offline/service-worker-updates.ts +0 -81
  749. package/src/offline/shared-computer-labels.ts +0 -8
  750. package/src/offline/shared-computer.tsx +0 -87
  751. package/src/offline/sign-out-pending-dialog-labels.ts +0 -21
  752. package/src/offline/sign-out-pending-dialog.tsx +0 -135
  753. package/src/offline.ts +0 -37
  754. package/src/push-worker.ts +0 -25
  755. package/src/rhf/fields.tsx +0 -2187
  756. package/src/rhf/form-core.tsx +0 -324
  757. package/src/rhf/form.tsx +0 -12
  758. package/src/rhf/line-items.tsx +0 -135
  759. package/src/rhf/use-rhf-wizard-step.ts +0 -104
  760. package/src/rhf.ts +0 -21
  761. package/src/search/command-palette-labels.ts +0 -16
  762. package/src/search/command-palette.tsx +0 -624
  763. package/src/search/global-search-labels.ts +0 -13
  764. package/src/search/global-search.tsx +0 -660
  765. package/src/search/search-index.ts +0 -283
  766. package/src/search/use-command-key.ts +0 -23
  767. package/src/search.ts +0 -14
  768. package/src/settings/device-reset-setting-labels.ts +0 -20
  769. package/src/settings/device-reset-setting.tsx +0 -116
  770. package/src/settings/settings-card-classes.ts +0 -11
  771. package/src/settings/settings-catalogue.ts +0 -150
  772. package/src/settings/settings-context.ts +0 -33
  773. package/src/settings/settings-heading.tsx +0 -67
  774. package/src/settings/settings-labels.ts +0 -87
  775. package/src/settings/settings-layout.tsx +0 -471
  776. package/src/settings/settings-section.tsx +0 -108
  777. package/src/settings/use-account-appearance.ts +0 -148
  778. package/src/settings/use-account-language.ts +0 -146
  779. package/src/settings/use-settings-focus.ts +0 -128
  780. package/src/settings/use-settings-route.ts +0 -258
  781. package/src/shell/account-menu-language.tsx +0 -130
  782. package/src/shell/account-menu-text-size.tsx +0 -80
  783. package/src/shell/admin-menu.tsx +0 -183
  784. package/src/shell/app-shell-labels.ts +0 -11
  785. package/src/shell/app-shell.tsx +0 -1560
  786. package/src/shell/auth-layout.tsx +0 -186
  787. package/src/shell/company-switcher-labels.ts +0 -13
  788. package/src/shell/company-switcher.tsx +0 -136
  789. package/src/shell/dev-menu.tsx +0 -257
  790. package/src/shell/fill-height.tsx +0 -45
  791. package/src/shell/language-code.ts +0 -5
  792. package/src/shell/option-switcher-menu.tsx +0 -84
  793. package/src/shell/sync-status-indicator.tsx +0 -303
  794. package/src/shell/top-bar-actions.tsx +0 -87
  795. package/src/shell/top-bar-brand.tsx +0 -78
  796. package/src/shell/top-bar-parts-labels.ts +0 -148
  797. package/src/shell/top-bar.tsx +0 -40
  798. package/src/shell/topbar-action-menu.tsx +0 -567
  799. package/src/shell/topbar-controls.tsx +0 -269
  800. package/src/shell/tour-menu.tsx +0 -187
  801. package/src/shell.ts +0 -108
  802. package/src/sync/db.ts +0 -129
  803. package/src/sync/engine.ts +0 -1011
  804. package/src/sync/hooks.ts +0 -98
  805. package/src/sync/testing.ts +0 -73
  806. package/src/sync/wire.ts +0 -61
  807. package/src/sync.ts +0 -37
  808. package/src/table-text.ts +0 -8
  809. package/src/testing/css-variables.generated.ts +0 -112
  810. package/src/testing/css-variables.ts +0 -189
  811. package/src/testing/index.ts +0 -29
  812. package/src/testing/react.ts +0 -58
  813. package/src/testing/tour.ts +0 -41
  814. package/src/testing/viewport.ts +0 -357
  815. package/src/theme/chart-palette.ts +0 -232
  816. package/src/theme/color.ts +0 -272
  817. package/src/theme/contrast-tokens.ts +0 -268
  818. package/src/theme/contrast.ts +0 -250
  819. package/src/theme/palette-derive.ts +0 -825
  820. package/src/theme/palette-presets.ts +0 -544
  821. package/src/theme/palette-store.ts +0 -108
  822. package/src/theme/text-size.ts +0 -289
  823. package/src/theme/theme-store.ts +0 -157
  824. package/src/tour/tour-catalogue-labels.ts +0 -75
  825. package/src/tour/tour-catalogue.tsx +0 -335
  826. package/src/tour/tour-dock.ts +0 -134
  827. package/src/tour/tour-engine.ts +0 -37
  828. package/src/tour/tour-gates.ts +0 -218
  829. package/src/tour/tour-guide-button.tsx +0 -64
  830. package/src/tour/tour-guide-labels.ts +0 -15
  831. package/src/tour/tour-info.ts +0 -144
  832. package/src/tour/tour-labels.ts +0 -23
  833. package/src/tour/tour-overlay.tsx +0 -1170
  834. package/src/tour/tour.tsx +0 -750
  835. package/src/tour/use-tour-progress.ts +0 -671
  836. package/src/tour/use-tour-url-sync.ts +0 -266
  837. package/src/tour.ts +0 -21
  838. package/src/vite-env.d.ts +0 -23
  839. package/src/wizard/stepper-nav.tsx +0 -360
  840. package/src/wizard/types.ts +0 -275
  841. package/src/wizard/use-wizard.ts +0 -560
  842. package/src/wizard/validation.ts +0 -39
  843. package/src/wizard/wizard-context.tsx +0 -74
  844. package/src/wizard/wizard-labels.ts +0 -29
  845. package/src/wizard/wizard-step.tsx +0 -76
  846. package/src/wizard/wizard-summary.tsx +0 -84
  847. package/src/wizard.ts +0 -15
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/shell/app-shell.tsx"],"sourcesContent":["import {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useId,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode, Ref } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { Link, NavLink, matchPath, useHref, useLocation } from \"react-router\";\nimport { ChevronRight, MoreHorizontal, PanelLeftClose, PanelLeftOpen } from \"lucide-react\";\nimport type { LucideIcon } from \"lucide-react\";\nimport { cn } from \"../lib/cn\";\nimport { scrollIntoStrip, useStripFade } from \"../lib/strip-fade\";\nimport { dirOf, type Direction } from \"../lib/direction\";\nimport { readStored, writeStored } from \"../lib/safe-storage\";\nimport { registerDeviceSetting } from \"../lib/device-settings\";\nimport { Tooltip } from \"../components/tooltip\";\nimport { pickLinkRenderer } from \"../components/text-link\";\nimport { DialogFrame } from \"../components/dialog-frame\";\nimport { CompactControls } from \"../components/field-parts\";\nimport { mergeRefs } from \"../components/field-parts\";\nimport { useAnchoredRect } from \"../hooks/use-anchored-rect\";\nimport { anchoredInline } from \"../hooks/use-anchored-panel\";\nimport { useDismissLayer } from \"../hooks/use-dismiss\";\nimport { useBreakpoint } from \"../hooks/use-breakpoint\";\nimport { TEXT_SIZES, useTextSize } from \"../theme/text-size\";\nimport type { TextSize } from \"../theme/text-size\";\nimport { DEFAULT_APP_SHELL_LABELS, useKitLabels, useKitLink, type LabelOverride } from \"../i18n/kit-labels\";\nimport type { KitLinkComponent, KitLinkProps } from \"../i18n/kit-labels\";\nimport { DEFAULT_APP_SHELL_MORE_LABELS } from \"./app-shell-labels\";\n\nexport interface AppShellSubItem {\n to: string;\n label: string;\n icon: LucideIcon;\n /** Passed to NavLink's `end` (exact match). Defaults to true. */\n end?: boolean;\n}\n\nexport interface AppShellNavItem {\n to: string;\n label: string;\n /** Optional shorter label for the MOBILE BOTTOM BAR only (the sidebar, its\n * tooltips and any palette built on this list keep `label`).\n *\n * The bar divides the viewport into `nav.length` equal cells, so a label's room\n * shrinks with every entry added — at six entries on a 406 px phone that is ~67 px,\n * and \"Import & Export\" wrapped to two lines and pushed the row taller than its\n * neighbours (keksdose feedback live #210). A per-item override is better than\n * shortening the real label, which the sidebar has ample room for and which is the\n * name the rest of the product uses. */\n shortLabel?: string;\n /** 0.48: the text size from which the bar uses {@link shortLabel} — `\"large\"` keeps the\n * full label at Normal, where five cells hold \"Transactions\" whole, and shortens it\n * from Large up (keksdose dev#613, which read `useTextSize()` in its layout to decide).\n * Default `\"normal\"`: the short label at every size, as before. */\n shortLabelFrom?: TextSize;\n /** 0.49: `shortLabel` is another word for the page, not a shortening of `label` —\n * keksdose's \"Activity\" for \"Transactions\". Without it a development build warns once\n * when `shortLabel` does not start with `label`'s first word (an abbreviation of that\n * word, \"Trans.\" for \"Transactions\", counts), because a bar cell that names a page\n * differently from the sidebar, the title and the palette is a page the reader\n * looks for twice. */\n shortLabelIsAlias?: boolean;\n /** 0.49: which entries sit in the phone bar when they do not all fit\n * ({@link AppShellProps.mobileMaxItems}). Lower first: the entries with a priority take\n * the bar's cells in its order, then the rest in the list's order; the bar still shows\n * its entries in the list's order, and the others go under \"More\". Unset: the list's\n * order decides (as before). */\n mobilePriority?: number;\n /** 0.31.0: leave this entry out of the MOBILE BOTTOM BAR; the sidebar keeps it.\n * For an entry a phone reaches another way — the brand link to the start page —\n * when one cell fewer is what keeps the others' labels whole (the bar divides its\n * width evenly, see `shortLabel`). Its group's sub-row still shows while one of its\n * pages is open. Named like `DataTable`'s column `mobileHidden`. */\n mobileHidden?: boolean;\n icon: LucideIcon;\n /** Passed to NavLink's `end` (exact match). Defaults to true. */\n end?: boolean;\n /** Optional `data-tour` value rendered on this item's link (both the desktop\n * sidebar and the mobile bottom bar), so a guided tour can spotlight ONE nav\n * entry precisely instead of matching by href (feedback #338). */\n dataTour?: string;\n /** Optional sub-items. When present, hovering (or focusing) the item opens a\n * flyout to the right of the sidebar with a header (this item's label) and the\n * sub-items as icon + title links. Works collapsed or expanded. On the phone (0.49)\n * the bar's cell opens a sheet of them instead of linking to `to` — the sheet lists\n * `to` first as \"Overview\" when no sub-item is that page — and the pages of the group\n * the reader is in show as the row above the bar (`mobileSubNav`). */\n items?: AppShellSubItem[];\n}\n\n/**\n * One entry of the sidebar's bottom area ({@link AppShellProps.sidebarFooterItems}) —\n * the version link and the legal links kastlan hand-built in `sidebarFooter`.\n *\n * - `link` (default): one link. Expanded it shows `icon` + `text` (default `label`),\n * with `hint` as a tooltip if given; collapsed it is the icon alone, named and\n * tooltipped by `label`.\n * - `links`: a small group — the legal links. Expanded, a `<nav>` named `label` holding\n * the links as a wrapping row of small text; collapsed, ONE icon link to `to` (default\n * the first link's), named and tooltipped by `label`, since a column of icons for\n * \"Imprint\", \"Privacy\" and \"Terms\" would say nothing an icon can.\n */\nexport type AppShellSidebarFooterItem =\n | {\n kind?: \"link\";\n key: string;\n to: string;\n icon: LucideIcon;\n /** The link's name, and the tooltip when collapsed (\"What's new · v1.4.0\"). */\n label: string;\n /** Visible text when expanded (\"Kastlan v1.4.0\"). Default `label`. */\n text?: ReactNode;\n /** A tooltip on the expanded link (\"What's new\"). */\n hint?: string;\n /** Leaves the app: a plain `<a target=\"_blank\" rel=\"noopener noreferrer\">`. */\n external?: boolean;\n /**\n * 0.42.0 (docs/admin-harmonization.md §6.9): a count of what waits behind the link —\n * kastlan's \"Administration\" with its To-triage count. A pill at the end of the\n * expanded link, a corner dot on the collapsed icon; `0`, `null` or none shows\n * nothing, and above 99 it reads \"99+\". The count joins the link's name, in\n * `badgeLabel`'s words when given (\"Administration, 3 waiting\").\n */\n badge?: number | null;\n /** The badge's words for a reader — `adminArea.waiting(count)`. Default: the number. */\n badgeLabel?: string;\n }\n | {\n kind: \"links\";\n key: string;\n icon: LucideIcon;\n /** The group's name — its `<nav>` label, and the collapsed icon's name (\"Legal\"). */\n label: string;\n /** The collapsed icon's target. Default the first link's `to`. */\n to?: string;\n links: { to: string; label: string; external?: boolean }[];\n };\n\n/**\n * The words of the phone bar's \"More\" cell and its sheet (0.32,\n * docs/text-size-harmonization.md §4 Navigation, §10.7) — the `appShellMore` namespace of\n * `<UiKitProvider labels>`, overridable per shell through `moreLabels`.\n */\nexport interface AppShellMoreLabels {\n /** The cell's visible label, under its icon — one short word. */\n more: string;\n /** The sheet's heading, and so its accessible name. */\n moreTitle: string;\n /** 0.49: a parent entry's own page in the sheet its bar cell opens, above its pages,\n * when no page is that one — \"Overview\". */\n overview: string;\n}\n\n// Defined in ./app-shell-labels, which holds no component code (0.34, KS U8).\nexport { DEFAULT_APP_SHELL_MORE_LABELS };\n\n/**\n * The most cells the phone bar holds, \"More\" included, per text size (0.49 KIT-6; 0.32\n * §10.7): five at Normal and Large, four at Extra large. Eight entries are four and\n * \"More\" at Normal; a fifth of a 390 px phone holds one word of the bar's type, and a\n * sixth no longer does once the type grows. A fifth of a 360 px phone at 150 % is 48 px\n * of Normal-sized room.\n */\nexport const DEFAULT_MOBILE_MAX_ITEMS: Readonly<Record<TextSize, number>> = {\n normal: 5,\n large: 5,\n xlarge: 4,\n};\n\n/**\n * The phone bar's cells (0.49 KIT-6): every entry when there are at most `maxItems`,\n * else `maxItems − 1` entries and a \"More\" cell for the rest. Which entries stay is\n * `priority`'s call — lower first, entries without one after them in the list's order —\n * and both halves keep the list's order. Never fewer than one entry beside More.\n */\nexport function pickMobileBar<T>(\n entries: readonly T[],\n maxItems: number,\n priority?: (entry: T) => number | undefined,\n): { shown: T[]; hidden: T[] } {\n const cells = Math.max(1, Math.floor(maxItems));\n if (entries.length <= cells) return { shown: [...entries], hidden: [] };\n const keep = Math.max(1, cells - 1);\n const rank = (i: number) => priority?.(entries[i]!) ?? Number.POSITIVE_INFINITY;\n const chosen = new Set(\n entries\n .map((_, i) => i)\n .sort((a, b) => rank(a) - rank(b) || a - b)\n .slice(0, keep),\n );\n return {\n shown: entries.filter((_, i) => chosen.has(i)),\n hidden: entries.filter((_, i) => !chosen.has(i)),\n };\n}\n\n/** The bar's cell count at `size`: `mobileMaxItems`, else the default. */\nfunction mobileCells(maxItems: AppShellProps[\"mobileMaxItems\"], size: TextSize): number {\n if (maxItems === undefined) return DEFAULT_MOBILE_MAX_ITEMS[size];\n return typeof maxItems === \"number\" ? maxItems : (maxItems[size] ?? DEFAULT_MOBILE_MAX_ITEMS[size]);\n}\n\n/** The kit's dev switch, as `lib/logger.ts` reads it: a development build, never a\n * production one, never under vitest. Read per call so a test can switch it on. */\nfunction devWarnings(): boolean {\n return Boolean(import.meta.env?.DEV) && !import.meta.env?.VITEST;\n}\n\nconst warnedNav = new Set<string>();\n\nfunction warnNavOnce(key: string, message: string): void {\n if (warnedNav.has(key)) return;\n warnedNav.add(key);\n console.warn(message);\n}\n\n/** The first word of a label, lower-cased: letters and digits up to the first other\n * character (\"Import & Export\" → \"import\", \"Trans.\" → \"trans\"). */\nfunction firstWord(text: string): string {\n return (text.trim().match(/^[\\p{L}\\p{N}]+/u)?.[0] ?? \"\").toLocaleLowerCase();\n}\n\n/** Whether `short` names `label`: its first word is `label`'s first word or an\n * abbreviation of it (\"Trans.\" for \"Transactions\"), or the other way round. */\nfunction shortLabelNamesLabel(short: string, label: string): boolean {\n const s = firstWord(short);\n const l = firstWord(label);\n return s === \"\" || l === \"\" || l.startsWith(s) || s.startsWith(l);\n}\n\nconst TEXT_SIZE_WORDS: Record<TextSize, string> = { normal: \"Normal\", large: \"Large\", xlarge: \"Extra large\" };\n\n/** A development build's notes on `nav` (0.49 KIT-6): a `shortLabel` that is another word\n * than its `label` without `shortLabelIsAlias`. */\nfunction useNavDevWarnings(nav: AppShellNavItem[]): void {\n useEffect(() => {\n if (!devWarnings()) return;\n for (const item of nav) {\n if (item.shortLabel === undefined || item.shortLabelIsAlias) continue;\n if (shortLabelNamesLabel(item.shortLabel, item.label)) continue;\n const from = item.shortLabelFrom ?? \"normal\";\n const where = from === \"normal\" ? \"at every text size\" : `from ${TEXT_SIZE_WORDS[from]} text up`;\n warnNavOnce(\n `shortLabel|${item.to}|${item.shortLabel}|${item.label}`,\n `[ui-kit] AppShell nav \"${item.to}\": shortLabel \"${item.shortLabel}\" does not start with ` +\n `\"${item.label.trim().split(/\\s+/)[0]}\", the first word of its label \"${item.label}\". The phone bar ` +\n `shows it ${where}, so the page has another name there than in the sidebar and its title. ` +\n \"Shorten the label instead, or pass shortLabelIsAlias: true if the other word is meant.\",\n );\n }\n }, [nav]);\n}\n\n/**\n * Exported and `<div>`-shaped. This is the outermost element of every consuming app, so\n * there is nothing above it to hang an id, a landmark label or a `data-tour` anchor on —\n * and nothing a consumer can wrap it in either, since the root owns the `h-dvh` and\n * `overflow-hidden` the whole layout is built on (audit §api-design).\n */\nexport interface AppShellProps extends ComponentPropsWithoutRef<\"div\"> {\n /** Navigation entries — shared by the desktop sidebar and mobile bottom bar. */\n nav: AppShellNavItem[];\n /** The composed top bar (e.g. the shared TopBar with app-owned actions). */\n topBar: ReactNode;\n /** Main content — typically the router `<Outlet />`. */\n children: ReactNode;\n /** Desktop-only footer rendered below the content (hidden on mobile). */\n footer?: ReactNode;\n /** Extra sidebar content above the collapse toggle (e.g. a version link).\n * Receives the collapsed state so it can render compact vs. full. */\n sidebarFooter?: (collapsed: boolean) => ReactNode;\n /** The sidebar's bottom area as data — a version link, the legal links — drawn full\n * when expanded and as icon + tooltip when collapsed. Rendered above\n * `sidebarFooter`, which stays for anything the data cannot describe. */\n sidebarFooterItems?: AppShellSidebarFooterItem[];\n /** The router link for `sidebarFooterItems`. Default: the provider's\n * `linkComponent`, else react-router's `Link`. */\n renderLink?: KitLinkComponent;\n /** localStorage key for the persisted collapse state. */\n collapseStorageKey?: string;\n /** Default: `appShell.collapse` from the {@link UiKitProvider}, else English. */\n collapseLabel?: string;\n /** Default: `appShell.expand` from the {@link UiKitProvider}, else English. */\n expandLabel?: string;\n /** How an entry's `items` are revealed in the EXPANDED desktop sidebar.\n *\n * - `\"flyout\"` (default) — a panel beside the sidebar on hover/focus. Compact: the\n * sidebar stays one row per group however many pages a group holds.\n * - `\"inline\"` — a disclosure under the entry, the pattern of MUI's nested List and\n * most documentation sites. Every page is visible at once, and the group holding\n * the current page opens on its own, so the reader can see where they are without\n * hovering anything.\n *\n * The icon-only (collapsed) sidebar always uses the flyout: an indented list has no\n * room there. The mobile bottom bar ignores `items` in both modes. */\n subNav?: \"flyout\" | \"inline\";\n /** Accessible name of the inline disclosure button, given the group's label.\n * Only used with `subNav=\"inline\"`. Its expanded state is carried by\n * `aria-expanded`, so one wording serves both directions. Default:\n * `appShell.toggleGroup` from the {@link UiKitProvider}, else English. */\n toggleGroupLabel?: (groupLabel: string) => string;\n /** Below `md`: show the current group's `items` as a scrollable row above the\n * bottom bar — the phone's counterpart of the sidebar's second level. Default true;\n * `false` keeps the single bar, where a group entry only links to its own `to`. */\n mobileSubNav?: boolean;\n /**\n * How the phone sub-nav lays out a group with more pages than fit on one row.\n * `\"wrap\"`: every page in view, on as many rows as it takes — the bar grows.\n * `\"scroll\"`: one row that scrolls sideways, faded at a cut edge, with the current\n * page scrolled into view. A long group took four rows (~130px) of a 390px screen\n * above the bottom bar (showcase audit); scrolling gives that back at the price of\n * pages hidden past the edge, so it is the app's call, per shell.\n *\n * Unset (0.32.2, kastlan's 0.32.1 report): `\"wrap\"` at Normal and `\"scroll\"` at Large\n * and Extra large, where a wrapped group of eight pages took six or seven rows and\n * covered the page — the other half of what `mobileMaxItems` does for the bar.\n */\n mobileSubNavLayout?: \"wrap\" | \"scroll\";\n /**\n * The most cells the phone bar holds, \"More\" included (0.49 KIT-6). When `nav` (after\n * `mobileHidden`) has more entries, the bar keeps `mobileMaxItems − 1` of them and a\n * last \"More\" cell opens a sheet with the rest, each group with its pages. Which\n * entries stay is the items' `mobilePriority`, else the list's order (so the app puts\n * its most used entries first, or orders by role: kastlan's manager and accountant see\n * different firsts).\n *\n * Default {@link DEFAULT_MOBILE_MAX_ITEMS}: 5 at Normal and Large, 4 at Extra large —\n * eight entries are four and \"More\". A number replaces the default at every size;\n * `{ xlarge: 5 }` replaces it at one size only. Never fewer than one entry beside More.\n */\n mobileMaxItems?: number | Partial<Record<TextSize, number>>;\n /** The More cell's words over the provider's `appShellMore`. */\n moreLabels?: Partial<AppShellMoreLabels>;\n /**\n * Lay the shell out inside its PARENT'S box instead of the viewport: `h-full` rather\n * than `h-dvh`, its own scroll container at every width, a bottom bar pinned to the\n * shell rather than the window, `--app-nav-h` published on the shell alone, and no\n * persisted collapse state unless `collapseStorageKey` is passed. For an app preview,\n * a device frame, a docs example.\n *\n * Implied for a shell rendered inside another AppShell, which is the case this\n * exists for: the inner one used to publish its own nav height on `<html>`, fight\n * the outer one over it, and remove it on unmount from under the outer app.\n */\n embedded?: boolean;\n /** The shell's root, where the rest of the props go (0.34, API-2, refactor audit\n * 2026-10) — merged with its own ref, which `--app-nav-h` is published on. */\n ref?: Ref<HTMLDivElement>;\n}\n\n/** True below an AppShell — how a nested shell knows it is one. */\nconst AppShellNesting = createContext(false);\n\n/**\n * The bottom nav's own height, published as `--app-nav-h` so anything that has to sit\n * ON it can stop guessing.\n *\n * Keksdose live #314 is what this is for. Its rework — *\"Stick it to the bottom\n * touching the bottom icon bar with budget, accounts, … Currently there is a small gap\n * which confuses\"* — was a receipt footer pinned at `bottom-20`, because `<main>`\n * reserves `pb-20` for this nav and 20 looked like the nav's height. It is not: the\n * padding is generous CLEARANCE, and the nav is content-sized (icon + label + `py-2`,\n * about 56px), so the footer floated ~24px above the bar.\n *\n * Measured rather than named, because the height is not a constant anyone owns: it is\n * an icon, a translated label that can wrap or truncate, and whatever the platform does\n * with the safe-area inset. A hard-coded `bottom-14` would be the same guess one number\n * lower, and it would be wrong again the first time a label needed two lines.\n *\n * `0px` when the nav is not rendered — above `md` it is `display:none`, which observes\n * as a zero box — so a consumer can write `bottom-[var(--app-nav-h,0px)]` once and get\n * the right answer at both widths without a breakpoint of its own.\n */\nfunction useNavHeightVar(\n ref: React.RefObject<HTMLElement | null>,\n shellRef: React.RefObject<HTMLElement | null>,\n embedded: boolean,\n): void {\n // Re-run when the breakpoint flips. A ResizeObserver SKIPS an element that is not\n // being rendered, so the nav going `display:none` above `md` fires no callback and\n // would leave the last phone height published — a desktop footer would then sit 56px\n // off the bottom after a live resize. `useBreakpoint(\"md\")` is the nav's own `md:hidden`\n // at the text size in force (0.32), so the two cannot disagree about where the\n // boundary is — at Extra large both move to 72rem.\n const isMdUp = useBreakpoint(\"md\", false);\n useEffect(() => {\n const node = ref.current;\n const shell = shellRef.current;\n // Always on the shell's own root, so everything inside it — a nested shell's\n // content included — reads the nearest bar's height. On <html> as well only for\n // the OUTERMOST shell, for what it portals to <body> (a sheet docking on the bar).\n // The DOM check backs up the context for a shell mounted in a separate React root.\n const global = !embedded && !shell?.parentElement?.closest(\"[data-app-shell]\");\n const targets = [shell, global ? document.documentElement : null].filter((el): el is HTMLElement => el !== null);\n // `getBoundingClientRect().height`, rounded DOWN — not `offsetHeight`, and not\n // ceil. Measured on the running app at 406x816: the bar is **55.5px** tall, and\n // both `offsetHeight` and `Math.ceil` answer 56. That is why live #314 round four\n // was *\"No change. Still a pixel inbetween\"* — the previous fix was arithmetically\n // a no-op on the very value it was meant to correct.\n //\n // 56 is the wrong side. A sticky element with `bottom: X` puts its bottom edge X\n // above the viewport bottom, and the bar's TOP edge is at its own height: so\n // X = 56 lands the footer at y=760.0 against a bar starting at y=760.5, i.e. half\n // a CSS pixel of page showing through — about 1.4 device pixels on his phone,\n // which is exactly the hairline in the screenshot.\n //\n // The two errors are not symmetric, and I had them backwards the first time.\n // Too SMALL tucks the sticky element under a bar that is opaque and painted above\n // it (`z-30` against `z-10`): invisible. Too LARGE opens the seam. So floor, and\n // consumers subtract a further pixel (see `invoice-line-totals.tsx`) for the case\n // where the height lands on a whole pixel and floor leaves no overlap at all.\n const publish = () => {\n const value = `${node ? Math.floor(node.getBoundingClientRect().height) : 0}px`;\n for (const el of targets) el.style.setProperty(\"--app-nav-h\", value);\n };\n publish();\n // The observer is the refinement, not the mechanism: `publish()` above is already\n // right for a static nav, and jsdom has no ResizeObserver unless a test stubs one.\n // ONE cleanup for every branch, though — an early `return` on the no-observer path\n // left the variable behind on unmount, which a stale `bottom:` offset on whatever\n // rendered next would have inherited.\n const ro = node && typeof ResizeObserver !== \"undefined\" ? new ResizeObserver(publish) : null;\n if (ro && node) ro.observe(node);\n return () => {\n ro?.disconnect();\n for (const el of targets) el.style.removeProperty(\"--app-nav-h\");\n };\n }, [ref, shellRef, embedded, isMdUp]);\n}\n\n/**\n * The responsive application shell: a top bar, a collapsible desktop sidebar\n * (icon-only when collapsed, with tooltips), a mobile bottom nav bar, the main\n * content area, and an optional desktop footer. Router-aware via react-router\n * `NavLink`; domain-free — nav items, brand, footer and the top bar's actions\n * are all supplied by the app.\n */\nexport function AppShell({\n nav,\n topBar,\n children,\n footer,\n sidebarFooter,\n sidebarFooterItems,\n renderLink,\n collapseStorageKey: collapseStorageKeyProp,\n collapseLabel,\n expandLabel,\n subNav = \"flyout\",\n mobileSubNav = true,\n mobileSubNavLayout: mobileSubNavLayoutProp,\n mobileMaxItems,\n moreLabels,\n toggleGroupLabel,\n embedded: embeddedProp,\n className,\n ref,\n ...rest\n}: AppShellProps) {\n const embedded = useContext(AppShellNesting) || !!embeddedProp;\n const { size: textSize } = useTextSize();\n const large = textSize !== \"normal\";\n const mobileSubNavLayout = mobileSubNavLayoutProp ?? (large ? \"scroll\" : \"wrap\");\n // The bottom bar's cells: every entry the phone does not reach another way, up to the\n // text size's limit, More included; the rest go under More (§10.7, KIT-6).\n const maxItems = mobileCells(mobileMaxItems, textSize);\n const { shown: barNav, hidden: moreNav } = pickMobileBar(\n nav.filter((item) => !item.mobileHidden),\n maxItems,\n (item) => item.mobilePriority,\n );\n useNavDevWarnings(nav);\n // An embedded shell sharing the default key would overwrite the outer app's sidebar\n // preference with its own — so it persists only when given a key of its own.\n const collapseStorageKey = collapseStorageKeyProp ?? (embedded ? null : \"appLayout.sidebarCollapsed\");\n // The three props are per-shell overrides of the provider's `appShell`; one left\n // undefined falls through to the provider rather than to English.\n const labels = useKitLabels(\"appShell\", DEFAULT_APP_SHELL_LABELS, {\n collapse: collapseLabel,\n expand: expandLabel,\n toggleGroup: toggleGroupLabel,\n });\n // Through the guarded helpers, not `window.localStorage` directly. The read runs\n // inside a `useState` initialiser — i.e. during render of the top-level shell — and\n // `localStorage` THROWS where site data is blocked (Safari private browsing, a\n // partitioned webview). Unguarded, that was not a lost sidebar preference: nothing\n // in the application mounted at all.\n const [collapsed, setCollapsed] = useState(\n () => collapseStorageKey !== null && readStored(collapseStorageKey) === \"1\",\n );\n // The inline sidebar is an ACCORDION: one group open at a time, keyed by its `to`.\n // Held here rather than per group so opening one can close the other — two lists\n // open at once pushed every entry below them off a laptop screen.\n const [openGroup, setOpenGroup] = useState<string | null>(null);\n // Publishes `--app-nav-h` for anything that has to sit on the bottom bar.\n const navRef = useRef<HTMLDivElement>(null);\n const rootRef = useRef<HTMLDivElement>(null);\n const setRoot = useMemo(() => mergeRefs(rootRef, ref), [ref]);\n useNavHeightVar(navRef, rootRef, embedded);\n useEffect(() => {\n if (collapseStorageKey !== null) writeStored(collapseStorageKey, collapsed ? \"1\" : \"0\");\n }, [collapsed, collapseStorageKey]);\n // Reset this device's settings (docs/settings-harmonization.md §11.4): the sidebar\n // unfolds, live, and the effect above writes \"0\". An embedded shell without a key of\n // its own stores nothing and joins nothing.\n useEffect(() => {\n if (collapseStorageKey === null) return;\n return registerDeviceSetting({ key: collapseStorageKey, kind: \"view\", reset: () => setCollapsed(false) });\n }, [collapseStorageKey]);\n // §4: at Large and Extra large the sidebar never collapses to icons only — a glyph\n // with its name in a tooltip is the very thing a reader who asked for bigger type\n // cannot use. The persisted preference is left alone, so Normal gets it back, and the\n // toggle goes while it could not do anything.\n const iconOnly = collapsed && !large;\n\n return (\n // The caller's attributes go on the shell's own root, never on the `data-tour=\"nav\"`\n // wrappers below — those are the kit's anchors for its own guided tour (#313/#322),\n // and a second element answering to the same selector is a tour that highlights the\n // wrong thing or nothing at all.\n <AppShellNesting.Provider value={true}>\n <div\n {...rest}\n ref={setRoot}\n data-app-shell=\"\"\n className={cn(\n \"relative flex flex-col\",\n embedded\n ? // `contain: layout` makes this box the containing block for the `fixed`\n // bottom bar below, so it pins to the shell rather than to the window.\n \"h-full min-h-0 overflow-hidden [contain:layout]\"\n : \"min-h-screen md:h-dvh md:overflow-hidden\",\n className,\n )}\n >\n {/* §4: \"the top bar keeps its essential icons\" — its IconButtons stay icons at\n Large (their labels the names and tooltips) and a locked one keeps its reason\n in the tooltip: a bar 3rem tall has no room for words under every glyph. */}\n <CompactControls>{topBar}</CompactControls>\n <div className=\"flex flex-1 min-h-0\">\n <aside\n className={cn(\n // `border-e`: the sidebar sits at the START, which is the right in RTL.\n \"hidden md:flex md:flex-col border-e border-subtle bg-surface transition-[width] duration-200 ease-out overflow-hidden\",\n // Embedded, the row it sits in is already the shell's height; the sticky\n // offsets below are measured against the window's top bar.\n embedded ? \"md:self-stretch\" : \"md:sticky md:top-12 md:self-start md:h-[calc(100vh-3rem)]\",\n iconOnly ? \"md:w-14\" : \"md:w-60\",\n )}\n >\n {/* The `<nav>` is flex-1 so it fills the sidebar's height (with empty\n space below the items); the data-tour marker goes on the INNER,\n fit-content wrapper so the guided-tour spotlight hugs the actual nav\n items instead of the whole tall column (feedback #322). The marker\n also tags the mobile bottom bar below; the tour targets\n `[data-tour=\"nav\"]` and resolves to whichever is visible (#313). */}\n <nav className=\"flex-1 px-2 py-3 overflow-y-auto overflow-x-hidden\">\n <div data-tour=\"nav\" className=\"space-y-1\">\n {nav.map((item) => (\n <SidebarNavItem\n key={item.to}\n item={item}\n collapsed={iconOnly}\n inline={subNav === \"inline\"}\n toggleGroupLabel={labels.toggleGroup}\n openGroup={openGroup}\n setOpenGroup={setOpenGroup}\n />\n ))}\n </div>\n </nav>\n {!!sidebarFooterItems?.length && (\n <SidebarFooterItems items={sidebarFooterItems} collapsed={iconOnly} renderLink={renderLink} />\n )}\n {sidebarFooter?.(iconOnly)}\n {/* No toggle at Large: the sidebar cannot collapse there (see `iconOnly`). */}\n {!large && (\n <div className=\"border-t border-subtle p-2\">\n {collapsed ? (\n <Tooltip label={labels.expand} side=\"end\" portal className=\"block\">\n <button\n type=\"button\"\n onClick={() => setCollapsed(false)}\n aria-label={labels.expand}\n className=\"flex w-full items-center justify-center min-h-9 rounded-md text-muted hover:bg-hover hover:text-secondary\"\n >\n <PanelLeftOpen className=\"size-4 shrink-0 rtl:-scale-x-100\" />\n </button>\n </Tooltip>\n ) : (\n <button\n type=\"button\"\n onClick={() => setCollapsed(true)}\n aria-label={labels.collapse}\n className=\"flex w-full items-center gap-3 min-h-9 px-3 py-2 rounded-md text-sm text-muted hover:bg-hover hover:text-secondary\"\n >\n <PanelLeftClose className=\"size-4 shrink-0 rtl:-scale-x-100\" />\n {/* Never drawn at Large (the toggle is not), so the class matters at\n Normal only — the kit's one name for it all the same (round 0.34 T1). */}\n <span className=\"truncate-until-large\">{labels.collapse}</span>\n </button>\n )}\n </div>\n )}\n </aside>\n\n {/* Content column beside the sidebar. main grows to fill so the footer\n sits at the bottom — at the viewport edge when content is short,\n beside the sidebar rather than under it. */}\n <div className=\"flex flex-1 flex-col min-w-0 md:min-h-0\">\n {/* `scrollbar-gutter: stable` reserves the scrollbar's track whether or\n not it is currently needed. Without it this element — the app's only\n scroll container from md up — narrows its own client box by the\n scrollbar width the moment a page's content outgrows it, and widens\n it again when the next page fits. Every centred `mx-auto` container\n inside then jumps sideways by half a scrollbar, and any fluid-width\n content changes width outright. Keksdose feedback #403 caught it as\n \"slight width increase/decrease\" when switching to the notifications\n settings section and back: that section is the only one tall enough\n to scroll. Platform-dependent, which is why it is easy to miss —\n overlay scrollbars (macOS, most Linux builds) take no layout space,\n classic ones (Windows) take ~15px.\n\n `both-edges`, not the bare `stable`: a one-sided reservation keeps the\n width stable but moves the middle. On a page short enough not to\n scroll, nothing is painted into the reserved track, so every centred\n `mx-auto` container sits half a scrollbar left of the optical centre\n and every full-bleed child stops ~15px short on the right. Keksdose\n feedback #491 (/settings#data) and #498 (/budgets) both reported it as\n \"the left boundary looks smaller / cut off compared to the right\" on\n the one element per page whose frame is a saturated colour — the rose\n destructive-action cards. Reserving the track on both edges keeps the\n content centred whether or not the scrollbar is showing. */}\n {/* `relative` makes <main> the containing block for everything absolutely\n positioned inside it. Tailwind's `sr-only` is `position:absolute`; with no\n positioned ancestor it resolves against the INITIAL containing block, is\n laid out at its offset from the top of the DOCUMENT, and grows\n `<html>`'s scroll height past the viewport — a second scrollbar beside this\n one that scrolls into empty space. Guarding it per component (see\n sr-only-containment.test) could never be complete: any page's own\n `sr-only` span re-opened it. Here it is closed for every child at once. */}\n {/* Below `md` the bottom room is the nav plus the larger of 1.5rem and what the\n floating launchers take above it (`--app-float-clearance`, published by\n every kit FAB, FloatingPanel and FloatingActionGroup while mounted — keksdose\n dev#612: the last row ended under the help launcher). From `md` up, where\n there is no nav, the launchers' room alone (0.49 KIT-11): the last row\n scrolls clear of a corner button there too. */}\n <main\n className={cn(\n \"relative flex-1 max-w-full overflow-x-clip pb-[calc(var(--app-nav-h,4rem)+max(1.5rem,var(--app-float-clearance,0px)))] md:pb-[var(--app-float-clearance,0px)] md:min-h-0 md:overflow-y-auto md:[scrollbar-gutter:stable_both-edges]\",\n // The list page's fill (0.40, docs/page-layout-harmonization.md §1.3): while\n // a `fillHeight` DataTable is inside, a flex column — a banner above the\n // page keeps its own height and the page (a `FillHeight`) takes the rest,\n // so `<main>` no longer overflows by the banner. Its children do not shrink\n // (a banner of a fixed height or `overflow-hidden` would): the page grows\n // into the rest from a zero basis, and a window too short for the page's\n // floor scrolls `<main>`. Every other page lays out as before. Below `md`\n // the document scrolls and nothing fills.\n // The children's `shrink-0` carries no `:has`: `flex-shrink` does nothing\n // outside a flex container, and a `:has(…) > *` rule cost a style recalc of\n // the whole page on every DOM insertion under it (17–45 ms per scrolled step\n // of a `virtualize` table, 0.48.2). `[&&>*]` doubles the class, so it stays\n // as specific as FillHeight's `has-[…]:flex-1` (whose `flex: 1` would set\n // shrink 1) and, emitted after it, still wins.\n \"md:has-[[data-fill-height]]:flex md:has-[[data-fill-height]]:flex-col md:[&&>*]:shrink-0\",\n // Embedded there is no document scroll to lean on below `md` either.\n embedded && \"min-h-0 overflow-y-auto\",\n )}\n >\n {children}\n </main>\n {footer}\n </div>\n </div>\n\n {/* The phone navigation: the group bar, and above it — when the current page\n belongs to a group with pages of its own — the row of those pages. The pair\n is the phone's version of the sidebar's two levels; without the upper row a\n group's `items` were simply unreachable below `md`. ONE measured box, so\n `--app-nav-h` covers both rows and whatever docks on the bar sits on the\n whole of it. */}\n <div ref={navRef} className=\"md:hidden fixed bottom-0 inset-x-0 z-30 border-t border-subtle bg-surface\">\n {mobileSubNav && <MobileSubNav nav={nav} layout={mobileSubNavLayout} />}\n <nav\n data-tour=\"nav\"\n className=\"grid\"\n style={{ gridTemplateColumns: `repeat(${barNav.length + (moreNav.length ? 1 : 0)}, minmax(0, 1fr))` }}\n >\n {barNav.map((item) =>\n item.items?.length ? (\n <MobileGroupCell key={item.to} item={item} labels={moreLabels} />\n ) : (\n <MobileNavItem key={item.to} item={item} />\n ),\n )}\n {moreNav.length > 0 && <MobileMoreCell hidden={moreNav} labels={moreLabels} />}\n </nav>\n </div>\n </div>\n </AppShellNesting.Provider>\n );\n}\n\nconst routerLink: KitLinkComponent = ({ href, ...p }) => <Link to={href} {...p} />;\nconst plainLink: KitLinkComponent = ({ children, ...p }) => <a {...p}>{children}</a>;\n\nconst FOOTER_ICON_LINK =\n \"flex min-h-8 items-center justify-center rounded-md text-muted hover:bg-hover hover:text-secondary\";\n\n/** A footer link's count as drawn: nothing for none, \"99+\" past 99. */\nfunction footerBadgeText(badge: number | null | undefined): string | null {\n if (typeof badge !== \"number\" || !(badge > 0)) return null;\n return badge > 99 ? \"99+\" : String(Math.floor(badge));\n}\n\n/** The count's pill — the solid \"count\" look of `Chip` (warning, the pending count's\n * tone, as `FloatingActionGroup`'s badge), sized for the footer's small text. */\nconst FOOTER_BADGE =\n \"inline-flex h-4 min-w-4 shrink-0 items-center justify-center rounded-full bg-warning px-1 text-micro font-semibold leading-4 tabular-nums text-warning-contrast\";\n\n/** Calls the link renderer as a component, so a router link's hooks are its own. */\nfunction RenderedLink({ render, ...props }: KitLinkProps & { render: KitLinkComponent }) {\n return render(props);\n}\n\n/** The sidebar's bottom area, from {@link AppShellSidebarFooterItem}s. */\nfunction SidebarFooterItems({\n items,\n collapsed,\n renderLink,\n}: {\n items: AppShellSidebarFooterItem[];\n collapsed: boolean;\n renderLink?: KitLinkComponent;\n}) {\n const kitLink = useKitLink();\n const linkTo = (to: string, external: boolean | undefined, { children, ...props }: Omit<KitLinkProps, \"href\">) => {\n // The kit's one link rule (`pickLinkRenderer`): an external `to` or an in-page\n // `#anchor` is a plain `<a>` even without `external`; only `external` opens a tab.\n const InApp = pickLinkRenderer(renderLink, kitLink ?? routerLink, to) ?? plainLink;\n return external ? (\n <a href={to} target=\"_blank\" rel=\"noopener noreferrer\" {...props}>\n {children}\n </a>\n ) : (\n <RenderedLink render={InApp} href={to} {...props}>\n {children}\n </RenderedLink>\n );\n };\n\n return (\n <div data-slot=\"sidebar-footer-items\" className={cn(\"px-2 py-1\", collapsed ? \"space-y-1\" : \"space-y-1.5\")}>\n {items.map((item) => {\n if (collapsed) {\n const to = item.kind === \"links\" ? (item.to ?? item.links[0]?.to) : item.to;\n if (!to) return null;\n const external = item.kind === \"links\" ? item.links.find((l) => l.to === to)?.external : item.external;\n const count = item.kind === \"links\" ? null : footerBadgeText(item.badge);\n const spoken = count === null || item.kind === \"links\" ? null : (item.badgeLabel ?? count);\n return (\n <Tooltip key={item.key} label={item.label} side=\"end\" portal className=\"block\">\n {linkTo(to, external, {\n \"aria-label\": spoken === null ? item.label : `${item.label}, ${spoken}`,\n className: cn(FOOTER_ICON_LINK, count !== null && \"relative\"),\n children: (\n <>\n <item.icon className=\"size-4\" aria-hidden />\n {count !== null && (\n <span aria-hidden data-badge=\"\" className={cn(FOOTER_BADGE, \"absolute -top-0.5 end-0.5\")}>\n {count}\n </span>\n )}\n </>\n ),\n })}\n </Tooltip>\n );\n }\n if (item.kind === \"links\") {\n return (\n <nav\n key={item.key}\n aria-label={item.label}\n className=\"flex flex-wrap justify-center gap-x-3 gap-y-0.5 text-caption text-muted\"\n >\n {item.links.map((l) => (\n <span key={l.to}>\n {linkTo(l.to, l.external, {\n className: \"rounded-sm hover:text-secondary hover:underline\",\n children: l.label,\n })}\n </span>\n ))}\n </nav>\n );\n }\n const count = footerBadgeText(item.badge);\n const link = linkTo(item.to, item.external, {\n className: cn(FOOTER_ICON_LINK, \"gap-1.5 text-xs font-medium\"),\n children: (\n <>\n <item.icon className=\"size-3.5 shrink-0\" aria-hidden />\n {/* Wraps from Large up (text size §10.17, round 0.34 T1): the link is\n `min-h-8`, so it grows a line rather than cut \"Feedb…\". */}\n <span className=\"min-w-0 truncate-until-large\">{item.text ?? item.label}</span>\n {count !== null && (\n <>\n <span aria-hidden data-badge=\"\" className={FOOTER_BADGE}>\n {count}\n </span>\n <span className=\"sr-only\">, {item.badgeLabel ?? count}</span>\n </>\n )}\n </>\n ),\n });\n return item.hint ? (\n <Tooltip key={item.key} label={item.hint} side=\"top\" portal className=\"block\">\n {link}\n </Tooltip>\n ) : (\n <div key={item.key}>{link}</div>\n );\n })}\n </div>\n );\n}\n\n/**\n * A bar cell's look, shared by the entries and the More cell. The active page needs a\n * clear marker, not just a subtle text shade (feedback #327): brand-accent icon + label,\n * bolder weight, and a top accent bar spanning the cell so it reads at a glance.\n */\nconst mobileCellClass = (active: boolean) =>\n cn(\n // `h-full`: the grid row stretches every cell to the tallest one's height, so a\n // label on two lines never leaves its neighbours a different shape.\n \"relative flex h-full w-full flex-col items-center justify-start py-2 text-caption gap-0.5 transition-colors\",\n \"before:absolute before:content-[''] before:inset-x-4 before:top-0 before:h-0.5 before:rounded-full before:transition-colors\",\n active ? \"font-semibold text-brand before:bg-brand\" : \"text-muted before:bg-transparent\",\n );\n\n/**\n * A bar cell's label (0.32, §10.7): up to TWO lines, never an ellipsis on one. At Large\n * a cell is a fifth of a phone holding type a quarter bigger, and one line truncated\n * \"Transactions\" to \"Trans…\" in every app (Kurvenschmiede). Two lines and then a clamp,\n * centred, a long word broken (and hyphenated where the page's `lang` allows) rather\n * than overflowing into the next cell. `shortLabel` still wins where the app has one.\n *\n * `data-truncate-ok` (text size §10.17, round 0.34 T1): the clamp is that decision, not\n * an accident — the size sweep finds \"Sowing calen…\" in a 65 px cell at 360 px / Extra\n * large, and a third line would make every cell of the bar taller for one long word.\n * The whole label stays the link's accessible name; an app with a long one gives the bar\n * a `shortLabel`.\n */\nfunction MobileCellLabel({ children }: { children: ReactNode }) {\n return (\n <span\n data-truncate-ok=\"\"\n className=\"line-clamp-2 max-w-full break-words px-0.5 text-center leading-tight hyphens-auto\"\n >\n {children}\n </span>\n );\n}\n\n/** One cell of the phone's group bar. Marked while the group's own page OR any of its\n * pages is current — NavLink alone only knows its own `to`, which left the bar with\n * nothing marked on every sub-page (the same defect the sidebar had). */\nfunction MobileNavItem({ item }: { item: AppShellNavItem }) {\n const subActive = useSubItemActive(item);\n const label = useCellLabel(item);\n return (\n <NavLink\n to={item.to}\n end={item.end ?? true}\n data-tour={item.dataTour}\n className={({ isActive }) => mobileCellClass(isActive || subActive)}\n >\n <span className=\"relative\">\n <item.icon className=\"size-5\" />\n </span>\n <MobileCellLabel>{label}</MobileCellLabel>\n </NavLink>\n );\n}\n\n/** The bar cell's label: `shortLabel` from its text size up (0.48), else `label`. */\nfunction useCellLabel(item: AppShellNavItem): string {\n const { size } = useTextSize();\n return item.shortLabel !== undefined &&\n TEXT_SIZES.indexOf(size) >= TEXT_SIZES.indexOf(item.shortLabelFrom ?? \"normal\")\n ? item.shortLabel\n : item.label;\n}\n\n/** A link in one of the phone's sheets — an entry (`level=\"entry\"`) or a page under one. */\nfunction SheetLink({\n to,\n end,\n icon: Icon,\n label,\n onClick,\n level,\n}: {\n to: string;\n end?: boolean;\n icon: LucideIcon;\n label: string;\n onClick: () => void;\n level: \"entry\" | \"page\";\n}) {\n return (\n <NavLink\n to={to}\n end={end ?? true}\n onClick={onClick}\n className={({ isActive }) =>\n cn(\n level === \"entry\"\n ? \"flex min-h-11 items-center gap-3 rounded-md px-3 py-2 text-sm transition-colors\"\n : \"flex min-h-11 items-center gap-2.5 rounded-md px-2.5 py-1.5 text-sm transition-colors\",\n isActive\n ? \"bg-inverse text-inverse\"\n : level === \"entry\"\n ? \"text-primary hover:bg-hover\"\n : \"text-secondary hover:bg-hover\",\n )\n }\n >\n <Icon aria-hidden className={level === \"entry\" ? \"size-5 shrink-0\" : \"size-4 shrink-0 opacity-70\"} />\n <span className=\"min-w-0 break-words leading-snug\">{label}</span>\n </NavLink>\n );\n}\n\n/**\n * A bar cell for an entry with pages (0.49 KIT-6): on a phone the entry opens a sheet of\n * its pages instead of linking to its own `to` — a tap on \"Reports\" used to land on the\n * overview with the pages one more step away, in the row above the bar, which only\n * appears once you are in the group. The sheet lists the entry's own page first, as\n * \"Overview\", when none of the pages is that page. Marked while the entry's page or one\n * of its pages is current, as the link was.\n *\n * Tours find the entry by `a[href]` or its `dataTour`, as on the More cell: an inert,\n * pointer-transparent anchor over the button carries them (see {@link MobileMoreCell}).\n */\nfunction MobileGroupCell({\n item,\n labels: labelsProp,\n}: {\n item: AppShellNavItem;\n labels?: LabelOverride<AppShellMoreLabels>;\n}) {\n const labels: AppShellMoreLabels = useKitLabels(\"appShellMore\", DEFAULT_APP_SHELL_MORE_LABELS, labelsProp);\n const { pathname } = useLocation();\n const [open, setOpen] = useState(false);\n const label = useCellLabel(item);\n const active = entryIsCurrent(item, pathname);\n const close = () => setOpen(false);\n const pages = item.items ?? [];\n const ownPageListed = pages.some((sub) => sub.to === item.to);\n return (\n <div data-slot=\"app-shell-group\" className=\"relative min-w-0\">\n <button\n type=\"button\"\n aria-haspopup=\"dialog\"\n aria-expanded={open}\n // The cell may show a shortLabel; the button's name is the entry's.\n aria-label={label === item.label ? undefined : item.label}\n onClick={() => setOpen(true)}\n className={mobileCellClass(active)}\n >\n <span className=\"relative\">\n <item.icon aria-hidden className=\"size-5\" />\n </span>\n <MobileCellLabel>{label}</MobileCellLabel>\n </button>\n <TourAnchor to={item.to} dataTour={item.dataTour} />\n {pages\n .filter((sub) => sub.to !== item.to)\n .map((sub) => (\n <TourAnchor key={sub.to} to={sub.to} />\n ))}\n <DialogFrame open={open} onClose={close} title={item.label} closeButton bodyClassName=\"space-y-1\">\n <ul className=\"space-y-1\">\n {!ownPageListed && (\n <li>\n <SheetLink\n to={item.to}\n end={item.end}\n icon={item.icon}\n label={labels.overview}\n onClick={close}\n level=\"entry\"\n />\n </li>\n )}\n {pages.map((sub) => (\n <li key={sub.to}>\n <SheetLink to={sub.to} end={sub.end} icon={sub.icon} label={sub.label} onClick={close} level=\"entry\" />\n </li>\n ))}\n </ul>\n </DialogFrame>\n </div>\n );\n}\n\n/** Whether the current route is `item`'s page or one of its pages. */\nfunction entryIsCurrent(item: AppShellNavItem, pathname: string): boolean {\n return (\n !!matchPath({ path: item.to, end: item.end ?? true }, pathname) ||\n !!item.items?.some((sub) => matchPath({ path: sub.to, end: sub.end ?? true }, pathname))\n );\n}\n\n/** A hidden entry's link, resolved as the router would write it (basename included). */\nfunction TourAnchor({ to, dataTour }: { to: string; dataTour?: string }) {\n const href = useHref(to);\n return (\n // eslint-disable-next-line jsx-a11y/anchor-has-content -- a tour anchor, aria-hidden and inert; the More button under it is the control (see MobileMoreCell)\n <a\n href={href}\n data-tour={dataTour}\n // Not a control: no name, no tab stop, no pointer — the More button under it\n // takes the tap. It exists only to be FOUND (see MobileMoreCell).\n aria-hidden\n tabIndex={-1}\n className=\"pointer-events-none absolute inset-0\"\n />\n );\n}\n\n/**\n * The bar's \"More\" cell (0.32, docs/text-size-harmonization.md §4, §10.7): the entries\n * past `mobileMaxItems`, in a sheet — each entry as a link, and under a group its pages,\n * since a group the bar no longer shows has no sub-row to reach them by either. Marked\n * active while the current page is one of them, as the cell it replaced would be.\n *\n * **Tour anchors.** A guided tour finds a nav entry by `[data-tour=\"nav\"] a[href=\"/x\"]`\n * (keksdose's tours) or by the entry's own `dataTour`. An entry under More has no link\n * in the bar, and the sidebar's copy is `display:none` on a phone, so such a step would\n * spotlight nothing. So the More cell carries the hidden entries' links — one `<a>` per\n * entry and per page of a hidden group, with the entry's `href` and `dataTour` — laid\n * over the cell (`absolute inset-0`): both selectors resolve to a visible box, and that\n * box is the More cell, which is where the reader has to go next. They are\n * `aria-hidden`, out of the tab order and pointer-transparent, so neither a screen\n * reader nor a tap ever meets them; the button under them is the one control.\n */\nfunction MobileMoreCell({\n hidden,\n labels: labelsProp,\n}: {\n hidden: AppShellNavItem[];\n labels?: LabelOverride<AppShellMoreLabels>;\n}) {\n const labels: AppShellMoreLabels = useKitLabels(\"appShellMore\", DEFAULT_APP_SHELL_MORE_LABELS, labelsProp);\n const { pathname } = useLocation();\n const [open, setOpen] = useState(false);\n const active = hidden.some((item) => entryIsCurrent(item, pathname));\n const close = () => setOpen(false);\n return (\n <div data-slot=\"app-shell-more\" className=\"relative min-w-0\">\n <button\n type=\"button\"\n aria-haspopup=\"dialog\"\n aria-expanded={open}\n onClick={() => setOpen(true)}\n className={mobileCellClass(active)}\n >\n <span className=\"relative\">\n <MoreHorizontal aria-hidden className=\"size-5\" />\n </span>\n <MobileCellLabel>{labels.more}</MobileCellLabel>\n </button>\n {hidden.flatMap((item) => [\n <TourAnchor key={item.to} to={item.to} dataTour={item.dataTour} />,\n ...(item.items ?? []).map((sub) => <TourAnchor key={`${item.to} ${sub.to}`} to={sub.to} />),\n ])}\n <DialogFrame open={open} onClose={close} title={labels.moreTitle} closeButton bodyClassName=\"space-y-1\">\n <ul className=\"space-y-1\">\n {hidden.map((item) => (\n <li key={item.to}>\n <SheetLink\n to={item.to}\n end={item.end}\n icon={item.icon}\n label={item.label}\n onClick={close}\n level=\"entry\"\n />\n {!!item.items?.length && (\n <ul aria-label={item.label} className=\"ms-[1.3rem] mt-0.5 space-y-0.5 border-s border-subtle ps-2\">\n {item.items.map((sub) => (\n <li key={sub.to}>\n <SheetLink\n to={sub.to}\n end={sub.end}\n icon={sub.icon}\n label={sub.label}\n onClick={close}\n level=\"page\"\n />\n </li>\n ))}\n </ul>\n )}\n </li>\n ))}\n </ul>\n </DialogFrame>\n </div>\n );\n}\n\n/**\n * The upper row of the phone navigation: the pages of the group the reader is in, as\n * a sideways-scrolling row of pills. Rendered only while such a group is current —\n * on a page outside every group the bar stays one row, rather than showing an empty\n * shelf or guessing a group.\n *\n * It slides in over 200ms (fade only under reduced motion) and wraps onto more rows\n * rather than scrolling, so every page of the group is in view at once.\n */\nfunction MobileSubNav({ nav, layout }: { nav: AppShellNavItem[]; layout: \"wrap\" | \"scroll\" }) {\n const { pathname } = useLocation();\n const scroll = layout === \"scroll\";\n const listRef = useRef<HTMLUListElement>(null);\n const fade = useStripFade(listRef);\n // The current page into view — the row only, never the page.\n useLayoutEffect(() => {\n const list = listRef.current;\n const current = list?.querySelector<HTMLElement>('[aria-current=\"page\"]');\n if (scroll && list && current) scrollIntoStrip(list, current);\n }, [scroll, pathname]);\n const group = nav.find(\n (item) =>\n !!item.items?.length &&\n (matchPath({ path: item.to, end: item.end ?? true }, pathname) ||\n item.items.some((sub) => matchPath({ path: sub.to, end: sub.end ?? true }, pathname))),\n );\n\n if (!group) return null;\n return (\n <nav\n aria-label={group.label}\n // Keyed by group so switching groups replays the entrance.\n key={group.to}\n className=\"animate-subnav border-b border-subtle\"\n >\n <ul\n ref={listRef}\n // `wrap` (default) takes as many rows as the group needs: a sideways row hides\n // pages past the edge, and every page of the group in view is the point of the\n // row. The bar grows with it — `--app-nav-h` measures it. `scroll` is the app's\n // opt-in trade: one row, the cut edge faded (see mobileSubNavLayout).\n className={cn(\n \"flex gap-1.5 px-3 py-2\",\n scroll ? \"overflow-x-auto overscroll-x-contain [scrollbar-width:none]\" : \"flex-wrap\",\n )}\n data-overflow={scroll ? fade.overflow : undefined}\n style={scroll && fade.mask ? { maskImage: fade.mask, WebkitMaskImage: fade.mask } : undefined}\n >\n {group.items!.map((sub) => (\n <li key={sub.to} className=\"shrink-0\">\n <NavLink\n to={sub.to}\n end={sub.end ?? true}\n className={({ isActive }) =>\n cn(\n \"flex items-center gap-1.5 rounded-full border px-3 py-1 text-xs transition-colors\",\n isActive\n ? \"border-brand bg-brand font-medium text-brand-contrast\"\n : \"border-subtle text-secondary hover:bg-hover\",\n )\n }\n >\n <sub.icon className=\"size-3.5 shrink-0\" aria-hidden />\n {sub.label}\n </NavLink>\n </li>\n ))}\n </ul>\n </nav>\n );\n}\n\n/** `strong` is the current page; `trail` is the group that CONTAINS the current page\n * while the page itself is shown elsewhere (the inline list below it). */\nconst navLinkClass =\n (collapsed: boolean, forceActive: boolean, trail = false) =>\n ({ isActive }: { isActive: boolean }) =>\n `flex items-center gap-3 min-h-9 ${collapsed ? \"justify-center px-2\" : \"px-3\"} py-2 rounded-md text-sm transition-colors duration-150 ${\n isActive || (forceActive && !trail)\n ? \"bg-inverse text-inverse\"\n : forceActive\n ? \"font-medium text-primary hover:bg-hover\"\n : \"text-secondary hover:bg-hover\"\n }`;\n\n/** Whether any of an entry's sub-items is the current route. NavLink only knows about\n * its OWN `to`, so without this a group whose pages live at sibling paths\n * (`/fields`, `/numbers`, …) lost its highlight the moment the reader left the one\n * page the group linked to — the sidebar then marked nothing at all, and the only\n * \"you are here\" left was inside a flyout that is closed unless hovered. */\nfunction useSubItemActive(item: AppShellNavItem): boolean {\n const { pathname } = useLocation();\n return !!item.items?.some((sub) => matchPath({ path: sub.to, end: sub.end ?? true }, pathname));\n}\n\n/** A single desktop sidebar entry. Plain link (with a tooltip when collapsed) —\n * unless it has sub-items, in which case hovering/focusing opens a flyout, or (with\n * `inline`) a disclosure lists them underneath. */\nfunction SidebarNavItem({\n item,\n collapsed,\n inline,\n toggleGroupLabel,\n openGroup,\n setOpenGroup,\n}: {\n item: AppShellNavItem;\n collapsed: boolean;\n inline: boolean;\n toggleGroupLabel: (groupLabel: string) => string;\n openGroup: string | null;\n setOpenGroup: (to: string | null) => void;\n}) {\n const hasSub = !!item.items?.length;\n const subActive = useSubItemActive(item);\n\n // In the EXPANDED sidebar a group is one component in both styles, so switching\n // between them is a transition of the same element (the page list folding away or\n // unfolding) rather than one tree replaced by another. The icon-only sidebar keeps\n // the plain flyout below: an indented list has no room there.\n if (hasSub && !collapsed) {\n return (\n <SidebarGroup\n item={item}\n subActive={subActive}\n inline={inline}\n toggleGroupLabel={toggleGroupLabel}\n open={openGroup === item.to}\n setOpenGroup={setOpenGroup}\n />\n );\n }\n\n const link = (\n <NavLink\n to={item.to}\n end={item.end ?? true}\n data-tour={item.dataTour}\n className={navLinkClass(collapsed, subActive)}\n aria-haspopup={hasSub ? \"menu\" : undefined}\n >\n <span className=\"relative shrink-0\">\n <item.icon className=\"size-4\" />\n </span>\n {/* Wraps rather than truncates: in the sidebar a label cut to \"Checkbox, switch\n & sl…\" hides the one word that tells two pages apart, and there is height\n to spare. (The phone bar clamps at two lines instead, since 0.32 §10.7.) */}\n {!collapsed && <span className=\"min-w-0 flex-1 break-words leading-snug\">{item.label}</span>}\n {!collapsed && hasSub && <ChevronRight className=\"size-3.5 shrink-0 opacity-60 rtl:-scale-x-100\" />}\n </NavLink>\n );\n\n if (hasSub) return <SidebarFlyout item={item}>{link}</SidebarFlyout>;\n return collapsed ? (\n <Tooltip label={item.label} side=\"end\" portal className=\"block\">\n {link}\n </Tooltip>\n ) : (\n link\n );\n}\n\n/**\n * An entry with sub-items in the expanded sidebar.\n *\n * - `inline`: the entry's own link (its overview page) plus a chevron button that\n * shows or hides the sub-items indented beneath it. Two controls rather than one\n * because they do two different things — a row that both navigated AND toggled\n * would make \"open the overview\" and \"peek at the pages\" the same click.\n * - flyout: the link alone, with the sub-items in a panel beside the sidebar on\n * hover/focus. The inline list is still rendered, folded shut, so that switching\n * styles animates it rather than swapping it.\n *\n * THE FOLD is a `grid-template-rows` transition from `0fr` to `1fr` — the one way to\n * animate to a content-sized height without measuring it, so a translated label that\n * wraps to two lines unfolds exactly as far as it needs. `visibility` rides the same\n * transition so a shut list drops out of the accessibility tree only once it has\n * finished closing, and `inert` takes its links out of the tab order immediately.\n */\nfunction SidebarGroup({\n item,\n subActive,\n inline,\n toggleGroupLabel,\n open,\n setOpenGroup,\n}: {\n item: AppShellNavItem;\n subActive: boolean;\n inline: boolean;\n toggleGroupLabel: (groupLabel: string) => string;\n /** Whether this is the sidebar's one open group (see AppShell's `openGroup`). */\n open: boolean;\n setOpenGroup: (to: string | null) => void;\n}) {\n const listId = useId();\n const { pathname } = useLocation();\n const onOwnPage = !!matchPath({ path: item.to, end: item.end ?? true }, pathname);\n // Opening follows the reader: arriving on this group's overview or one of its pages\n // (by link, by the pager, by Back) opens it — and, the sidebar holding ONE open\n // group, closes whichever was open before. Both folds run at once, so the eye sees\n // one list hand over to the other. Run in an effect after mount, so the current\n // group UNFOLDS into view on load rather than appearing already open.\n const here = subActive || onOwnPage;\n useEffect(() => {\n if (here) setOpenGroup(item.to);\n }, [here, item.to, setOpenGroup]);\n const expanded = inline && open;\n\n const link = (\n <NavLink\n to={item.to}\n end={item.end ?? true}\n data-tour={item.dataTour}\n aria-haspopup={inline ? undefined : \"menu\"}\n // `trail` (inline only): while a page of the group is current, the group row is\n // the breadcrumb, not the destination — the page's own row below carries the\n // strong marker, and two inverse rows would say \"you are here\" twice. In the\n // flyout style the pages are out of sight, so the group row IS the marker.\n className={(state) => cn(navLinkClass(false, subActive, inline)(state), \"min-w-0 flex-1\")}\n >\n <span className=\"relative shrink-0\">\n <item.icon className=\"size-4\" />\n </span>\n <span className=\"min-w-0 flex-1 break-words leading-snug\">{item.label}</span>\n {!inline && <ChevronRight className=\"size-3.5 shrink-0 opacity-60 rtl:-scale-x-100\" />}\n </NavLink>\n );\n\n return (\n <div>\n {inline ? (\n <div className=\"flex items-center gap-0.5\">\n {link}\n <button\n type=\"button\"\n aria-expanded={open}\n aria-controls={listId}\n aria-label={toggleGroupLabel(item.label)}\n onClick={() => setOpenGroup(open ? null : item.to)}\n className=\"flex size-9 shrink-0 items-center justify-center rounded-md text-muted hover:bg-hover hover:text-secondary\"\n >\n <ChevronRight\n aria-hidden\n className={cn(\n \"size-3.5 transition-transform duration-200 ease-out motion-reduce:transition-none rtl:-scale-x-100\",\n // Under dir=\"rtl\" the chevron is MIRRORED first (scale applies before rotate), so\n // it starts pointing left and a +90° turn would point it UP — hence −90° there.\n open && \"rotate-90 rtl:-rotate-90\",\n )}\n />\n </button>\n </div>\n ) : (\n <SidebarFlyout item={item}>{link}</SidebarFlyout>\n )}\n <div\n id={listId}\n inert={!expanded}\n className=\"grid transition-[grid-template-rows,visibility] duration-200 ease-out motion-reduce:transition-none\"\n style={{\n gridTemplateRows: expanded ? \"1fr\" : \"0fr\",\n visibility: expanded ? \"visible\" : \"hidden\",\n }}\n >\n <div\n className={cn(\n \"min-h-0 overflow-hidden transition-opacity duration-200 ease-out motion-reduce:transition-none\",\n expanded ? \"opacity-100\" : \"opacity-0\",\n )}\n >\n {/* The rule and indent live on the list INSIDE the clipping box: margin or\n padding on the element whose row is collapsing to 0fr would hold it open\n by that much. */}\n <ul className=\"ms-[1.3rem] mt-0.5 space-y-0.5 border-s border-subtle ps-2\">\n {item.items!.map((sub) => (\n <li key={sub.to}>\n <NavLink\n to={sub.to}\n end={sub.end ?? true}\n className={({ isActive }) =>\n cn(\n \"flex min-h-8 items-center gap-2.5 rounded-md px-2.5 py-1.5 text-sm transition-colors\",\n isActive ? \"bg-inverse text-inverse\" : \"text-secondary hover:bg-hover\",\n )\n }\n >\n <sub.icon className=\"size-4 shrink-0 opacity-70\" aria-hidden />\n <span className=\"min-w-0 break-words leading-snug\">{sub.label}</span>\n </NavLink>\n </li>\n ))}\n </ul>\n </div>\n </div>\n </div>\n );\n}\n\n// Only ONE sidebar flyout should be on screen at a time. Each open flyout parks its\n// \"close now\" here so the next item to open can dismiss it immediately, instead of\n// leaving the previous panel up for the 140ms travel delay while the cursor moves\n// down the nav list — which showed two panels at once.\nlet activeFlyoutClose: (() => void) | null = null;\n\n/**\n * Wraps a nav item that has sub-items: on hover or keyboard focus it opens a\n * portalled flyout to the right of the sidebar (portalled so the sidebar's\n * `overflow-hidden` can't clip it) with the item's label as a header and each\n * sub-item as an icon + title link. A short close delay lets the cursor travel\n * from the item onto the panel; Escape / outside-move close it.\n */\nfunction SidebarFlyout({ item, children }: { item: AppShellNavItem; children: ReactNode }) {\n const wrapperRef = useRef<HTMLDivElement>(null);\n const closeTimer = useRef<ReturnType<typeof setTimeout> | null>(null);\n const [open, setOpen] = useState(false);\n // The flyout is portalled out of the subtree whose `dir` it inherited; read on open.\n const [dir, setDir] = useState<Direction>(\"ltr\");\n\n // Anchor the flyout to the item's END edge — its right, or its left in RTL, where\n // the sidebar sits on the right of the window — and keep it on the glass (Wave 2,\n // DUP-7). Right to left it hangs by its `right`, which a fixed box measures from\n // inside the scrollbar: `innerWidth` counted the bar and put the flyout a bar's width\n // off its item. The hook re-measures on scroll/resize (the nav list can scroll); the\n // panel's own width is measured once it is up, before paint.\n const rect = useAnchoredRect(wrapperRef, open);\n const panelRef = useRef<HTMLDivElement>(null);\n const [panelWidth, setPanelWidth] = useState(0);\n const placed = rect !== null;\n useLayoutEffect(() => {\n if (open && placed) setPanelWidth(panelRef.current?.offsetWidth ?? 0);\n }, [open, placed]);\n const at = rect ? anchoredInline(rect, panelWidth, { dir, align: \"after\" }) : null;\n const pos = rect && at ? { top: rect.top, ...(dir === \"rtl\" ? { right: at.right } : { left: at.left }) } : null;\n\n const cancelClose = useCallback(() => {\n if (closeTimer.current) {\n clearTimeout(closeTimer.current);\n closeTimer.current = null;\n }\n }, []);\n // Stable identity: the coordinator above holds this so a sibling item can close\n // THIS flyout without waiting out its travel delay.\n const closeNow = useCallback(() => {\n cancelClose();\n setOpen(false);\n }, [cancelClose]);\n const openMenu = useCallback(() => {\n cancelClose();\n if (activeFlyoutClose && activeFlyoutClose !== closeNow) activeFlyoutClose();\n activeFlyoutClose = closeNow;\n setDir(dirOf(wrapperRef.current));\n setOpen(true);\n }, [cancelClose, closeNow]);\n const scheduleClose = useCallback(() => {\n cancelClose();\n closeTimer.current = setTimeout(() => {\n setOpen(false);\n if (activeFlyoutClose === closeNow) activeFlyoutClose = null;\n }, 140);\n }, [cancelClose, closeNow]);\n\n // Close on Escape while open — a layer on the kit's Escape stack (Wave 2, DUP-1).\n useDismissLayer(open, () => setOpen(false));\n\n useEffect(\n () => () => {\n cancelClose();\n if (activeFlyoutClose === closeNow) activeFlyoutClose = null;\n },\n [cancelClose, closeNow],\n );\n\n return (\n // Not a control: hover and focus-within on the nav link inside. Focus (the\n // keyboard path) opens it exactly as hover does, Escape closes it.\n // eslint-disable-next-line jsx-a11y/no-static-element-interactions -- hover/focus-within wrapper around a real link\n <div\n ref={wrapperRef}\n className=\"relative\"\n onMouseEnter={openMenu}\n onMouseLeave={scheduleClose}\n onFocus={openMenu}\n onBlur={scheduleClose}\n >\n {children}\n {open &&\n pos &&\n createPortal(\n // Keeps the flyout open while the pointer crosses into it; keyboard users\n // reach it by focus, which the wrapper above already handles.\n // eslint-disable-next-line jsx-a11y/no-static-element-interactions -- pointer-only hover bridge\n <div\n ref={panelRef}\n dir={dir}\n style={{ position: \"fixed\", ...pos }}\n className=\"z-40 ps-1\"\n onMouseEnter={cancelClose}\n onMouseLeave={scheduleClose}\n >\n <div\n role=\"menu\"\n aria-label={item.label}\n className=\"animate-flyout min-w-52 overflow-hidden rounded-md border border-subtle bg-surface shadow-lg\"\n >\n <div className=\"border-b border-subtle px-3 py-2 text-caption font-semibold uppercase tracking-wide text-muted\">\n {item.label}\n </div>\n <ul className=\"py-1\">\n {item.items!.map((sub) => (\n <li key={sub.to}>\n <NavLink\n to={sub.to}\n end={sub.end ?? true}\n role=\"menuitem\"\n onClick={() => setOpen(false)}\n className={({ isActive }) =>\n cn(\n \"flex items-center gap-2.5 px-3 py-2 text-sm\",\n isActive ? \"bg-active font-medium text-primary\" : \"text-secondary hover:bg-hover\",\n )\n }\n >\n <sub.icon className=\"size-4 shrink-0 text-placeholder\" />\n <span className=\"min-w-0 break-words leading-snug\">{sub.label}</span>\n </NavLink>\n </li>\n ))}\n </ul>\n </div>\n </div>,\n document.body,\n )}\n </div>\n );\n}\n"],"mappings":";AAiiBQ,SAoOU,UApOV,KAoDU,YApDV;AAjiBR;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,oBAAoB;AAC7B,SAAS,MAAM,SAAS,WAAW,SAAS,mBAAmB;AAC/D,SAAS,cAAc,gBAAgB,gBAAgB,qBAAqB;AAE5E,SAAS,UAAU;AACnB,SAAS,iBAAiB,oBAAoB;AAC9C,SAAS,aAA6B;AACtC,SAAS,YAAY,mBAAmB;AACxC,SAA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IE;AAAA,MAAC;AAAA;AAAA,QACC,KAAK;AAAA,QACL,WAAU;AAAA,QACV,cAAc;AAAA,QACd,cAAc;AAAA,QACd,SAAS;AAAA,QACT,QAAQ;AAAA,QAEP;AAAA;AAAA,UACA,QACC,OACA;AAAA;AAAA;AAAA;AAAA,YAIE;AAAA,cAAC;AAAA;AAAA,gBACC,KAAK;AAAA,gBACL;AAAA,gBACA,OAAO,EAAE,UAAU,SAAS,GAAG,IAAI;AAAA,gBACnC,WAAU;AAAA,gBACV,cAAc;AAAA,gBACd,cAAc;AAAA,gBAEd;AAAA,kBAAC;AAAA;AAAA,oBACC,MAAK;AAAA,oBACL,cAAY,KAAK;AAAA,oBACjB,WAAU;AAAA,oBAEV;AAAA,0CAAC,SAAI,WAAU,kGACZ,eAAK,OACR;AAAA,sBACA,oBAAC,QAAG,WAAU,QACX,eAAK,MAAO,IAAI,CAAC,QAChB,oBAAC,QACC;AAAA,wBAAC;AAAA;AAAA,0BACC,IAAI,IAAI;AAAA,0BACR,KAAK,IAAI,OAAO;AAAA,0BAChB,MAAK;AAAA,0BACL,SAAS,MAAM,QAAQ,KAAK;AAAA,0BAC5B,WAAW,CAAC,EAAE,SAAS,MACrB;AAAA,4BACE;AAAA,4BACA,WAAW,uCAAuC;AAAA,0BACpD;AAAA,0BAGF;AAAA,gDAAC,IAAI,MAAJ,EAAS,WAAU,oCAAmC;AAAA,4BACvD,oBAAC,UAAK,WAAU,oCAAoC,cAAI,OAAM;AAAA;AAAA;AAAA,sBAChE,KAfO,IAAI,EAgBb,CACD,GACH;AAAA;AAAA;AAAA,gBACF;AAAA;AAAA,YACF;AAAA,YACA,SAAS;AAAA,UACX;AAAA;AAAA;AAAA,IACJ;AAAA;AAEJ;","names":["count"]}
1
+ {"version":3,"sources":["../../src/shell/app-shell.tsx"],"sourcesContent":["import {\n Suspense,\n createContext,\n useCallback,\n useContext,\n useEffect,\n useId,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode, Ref } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { Link, NavLink, matchPath, useHref, useLocation } from \"react-router\";\nimport { ChevronRight, MoreHorizontal, PanelLeftClose, PanelLeftOpen } from \"lucide-react\";\nimport type { LucideIcon } from \"lucide-react\";\nimport { cn } from \"../lib/cn\";\nimport { scrollIntoStrip, useStripFade } from \"../lib/strip-fade\";\nimport { dirOf, type Direction } from \"../lib/direction\";\nimport { readStored, writeStored } from \"../lib/safe-storage\";\nimport { registerDeviceSetting } from \"../lib/device-settings\";\nimport { Tooltip } from \"../components/tooltip\";\nimport { pickLinkRenderer } from \"../components/text-link\";\nimport { DialogFrame } from \"../components/dialog-frame\";\nimport { CompactControls } from \"../components/field-parts\";\nimport { mergeRefs } from \"../components/field-parts\";\nimport { useAnchoredRect } from \"../hooks/use-anchored-rect\";\nimport { anchoredInline } from \"../hooks/use-anchored-panel\";\nimport { useDismissLayer } from \"../hooks/use-dismiss\";\nimport { useBreakpoint } from \"../hooks/use-breakpoint\";\nimport { TEXT_SIZES, useTextSize } from \"../theme/text-size\";\nimport type { TextSize } from \"../theme/text-size\";\nimport { DEFAULT_APP_SHELL_LABELS, useKitLabels, useKitLink, type LabelOverride } from \"../i18n/kit-labels\";\nimport type { KitLinkComponent, KitLinkProps } from \"../i18n/kit-labels\";\nimport { DEFAULT_APP_SHELL_MORE_LABELS } from \"./app-shell-labels\";\n\nexport interface AppShellSubItem {\n to: string;\n label: string;\n icon: LucideIcon;\n /** Passed to NavLink's `end` (exact match). Defaults to true. */\n end?: boolean;\n}\n\nexport interface AppShellNavItem {\n to: string;\n label: string;\n /** Optional shorter label for the MOBILE BOTTOM BAR only (the sidebar, its\n * tooltips and any palette built on this list keep `label`).\n *\n * The bar divides the viewport into `nav.length` equal cells, so a label's room\n * shrinks with every entry added — at six entries on a 406 px phone that is ~67 px,\n * and \"Import & Export\" wrapped to two lines and pushed the row taller than its\n * neighbours (keksdose feedback live #210). A per-item override is better than\n * shortening the real label, which the sidebar has ample room for and which is the\n * name the rest of the product uses. */\n shortLabel?: string;\n /** 0.48: the text size from which the bar uses {@link shortLabel} — `\"large\"` keeps the\n * full label at Normal, where five cells hold \"Transactions\" whole, and shortens it\n * from Large up (keksdose dev#613, which read `useTextSize()` in its layout to decide).\n * Default `\"normal\"`: the short label at every size, as before. */\n shortLabelFrom?: TextSize;\n /** 0.49: `shortLabel` is another word for the page, not a shortening of `label` —\n * keksdose's \"Activity\" for \"Transactions\". Without it a development build warns once\n * when `shortLabel` does not start with `label`'s first word (an abbreviation of that\n * word, \"Trans.\" for \"Transactions\", counts), because a bar cell that names a page\n * differently from the sidebar, the title and the palette is a page the reader\n * looks for twice. */\n shortLabelIsAlias?: boolean;\n /** 0.49: which entries sit in the phone bar when they do not all fit\n * ({@link AppShellProps.mobileMaxItems}). Lower first: the entries with a priority take\n * the bar's cells in its order, then the rest in the list's order; the bar still shows\n * its entries in the list's order, and the others go under \"More\". Unset: the list's\n * order decides (as before). */\n mobilePriority?: number;\n /** 0.31.0: leave this entry out of the MOBILE BOTTOM BAR; the sidebar keeps it.\n * For an entry a phone reaches another way — the brand link to the start page —\n * when one cell fewer is what keeps the others' labels whole (the bar divides its\n * width evenly, see `shortLabel`). Its group's sub-row still shows while one of its\n * pages is open. Named like `DataTable`'s column `mobileHidden`. */\n mobileHidden?: boolean;\n icon: LucideIcon;\n /** Passed to NavLink's `end` (exact match). Defaults to true. */\n end?: boolean;\n /** Optional `data-tour` value rendered on this item's link (both the desktop\n * sidebar and the mobile bottom bar), so a guided tour can spotlight ONE nav\n * entry precisely instead of matching by href (feedback #338). */\n dataTour?: string;\n /** Optional sub-items. When present, hovering (or focusing) the item opens a\n * flyout to the right of the sidebar with a header (this item's label) and the\n * sub-items as icon + title links. Works collapsed or expanded. On the phone (0.49)\n * the bar's cell opens a sheet of them instead of linking to `to` — the sheet lists\n * `to` first as \"Overview\" when no sub-item is that page — and the pages of the group\n * the reader is in show as the row above the bar (`mobileSubNav`). */\n items?: AppShellSubItem[];\n}\n\n/**\n * One entry of the sidebar's bottom area ({@link AppShellProps.sidebarFooterItems}) —\n * the version link and the legal links kastlan hand-built in `sidebarFooter`.\n *\n * - `link` (default): one link. Expanded it shows `icon` + `text` (default `label`),\n * with `hint` as a tooltip if given; collapsed it is the icon alone, named and\n * tooltipped by `label`.\n * - `links`: a small group — the legal links. Expanded, a `<nav>` named `label` holding\n * the links as a wrapping row of small text; collapsed, ONE icon link to `to` (default\n * the first link's), named and tooltipped by `label`, since a column of icons for\n * \"Imprint\", \"Privacy\" and \"Terms\" would say nothing an icon can.\n */\nexport type AppShellSidebarFooterItem =\n | {\n kind?: \"link\";\n key: string;\n to: string;\n icon: LucideIcon;\n /** The link's name, and the tooltip when collapsed (\"What's new · v1.4.0\"). */\n label: string;\n /** Visible text when expanded (\"Kastlan v1.4.0\"). Default `label`. */\n text?: ReactNode;\n /** A tooltip on the expanded link (\"What's new\"). */\n hint?: string;\n /** Leaves the app: a plain `<a target=\"_blank\" rel=\"noopener noreferrer\">`. */\n external?: boolean;\n /**\n * 0.42.0 (docs/admin-harmonization.md §6.9): a count of what waits behind the link —\n * kastlan's \"Administration\" with its To-triage count. A pill at the end of the\n * expanded link, a corner dot on the collapsed icon; `0`, `null` or none shows\n * nothing, and above 99 it reads \"99+\". The count joins the link's name, in\n * `badgeLabel`'s words when given (\"Administration, 3 waiting\").\n */\n badge?: number | null;\n /** The badge's words for a reader — `adminArea.waiting(count)`. Default: the number. */\n badgeLabel?: string;\n }\n | {\n kind: \"links\";\n key: string;\n icon: LucideIcon;\n /** The group's name — its `<nav>` label, and the collapsed icon's name (\"Legal\"). */\n label: string;\n /** The collapsed icon's target. Default the first link's `to`. */\n to?: string;\n links: { to: string; label: string; external?: boolean }[];\n };\n\n/**\n * The words of the phone bar's \"More\" cell and its sheet (0.32,\n * docs/text-size-harmonization.md §4 Navigation, §10.7) — the `appShellMore` namespace of\n * `<UiKitProvider labels>`, overridable per shell through `moreLabels`.\n */\nexport interface AppShellMoreLabels {\n /** The cell's visible label, under its icon — one short word. */\n more: string;\n /** The sheet's heading, and so its accessible name. */\n moreTitle: string;\n /** 0.49: a parent entry's own page in the sheet its bar cell opens, above its pages,\n * when no page is that one — \"Overview\". */\n overview: string;\n}\n\n// Defined in ./app-shell-labels, which holds no component code (0.34, KS U8).\nexport { DEFAULT_APP_SHELL_MORE_LABELS };\n\n/**\n * The most cells the phone bar holds, \"More\" included, per text size (0.49 KIT-6; 0.32\n * §10.7): five at Normal and Large, four at Extra large. Eight entries are four and\n * \"More\" at Normal; a fifth of a 390 px phone holds one word of the bar's type, and a\n * sixth no longer does once the type grows. A fifth of a 360 px phone at 150 % is 48 px\n * of Normal-sized room.\n */\nexport const DEFAULT_MOBILE_MAX_ITEMS: Readonly<Record<TextSize, number>> = {\n normal: 5,\n large: 5,\n xlarge: 4,\n};\n\n/**\n * The phone bar's cells (0.49 KIT-6): every entry when there are at most `maxItems`,\n * else `maxItems − 1` entries and a \"More\" cell for the rest. Which entries stay is\n * `priority`'s call — lower first, entries without one after them in the list's order —\n * and both halves keep the list's order. Never fewer than one entry beside More.\n */\nexport function pickMobileBar<T>(\n entries: readonly T[],\n maxItems: number,\n priority?: (entry: T) => number | undefined,\n): { shown: T[]; hidden: T[] } {\n const cells = Math.max(1, Math.floor(maxItems));\n if (entries.length <= cells) return { shown: [...entries], hidden: [] };\n const keep = Math.max(1, cells - 1);\n const rank = (i: number) => priority?.(entries[i]!) ?? Number.POSITIVE_INFINITY;\n const chosen = new Set(\n entries\n .map((_, i) => i)\n .sort((a, b) => rank(a) - rank(b) || a - b)\n .slice(0, keep),\n );\n return {\n shown: entries.filter((_, i) => chosen.has(i)),\n hidden: entries.filter((_, i) => !chosen.has(i)),\n };\n}\n\n/** The bar's cell count at `size`: `mobileMaxItems`, else the default. */\nfunction mobileCells(maxItems: AppShellProps[\"mobileMaxItems\"], size: TextSize): number {\n if (maxItems === undefined) return DEFAULT_MOBILE_MAX_ITEMS[size];\n return typeof maxItems === \"number\" ? maxItems : (maxItems[size] ?? DEFAULT_MOBILE_MAX_ITEMS[size]);\n}\n\n/** The kit's dev switch, as `lib/logger.ts` reads it: a development build, never a\n * production one, never under vitest. Read per call so a test can switch it on. */\nfunction devWarnings(): boolean {\n return Boolean(import.meta.env?.DEV) && !import.meta.env?.VITEST;\n}\n\nconst warnedNav = new Set<string>();\n\nfunction warnNavOnce(key: string, message: string): void {\n if (warnedNav.has(key)) return;\n warnedNav.add(key);\n console.warn(message);\n}\n\n/** The first word of a label, lower-cased: letters and digits up to the first other\n * character (\"Import & Export\" → \"import\", \"Trans.\" → \"trans\"). */\nfunction firstWord(text: string): string {\n return (text.trim().match(/^[\\p{L}\\p{N}]+/u)?.[0] ?? \"\").toLocaleLowerCase();\n}\n\n/** Whether `short` names `label`: its first word is `label`'s first word or an\n * abbreviation of it (\"Trans.\" for \"Transactions\"), or the other way round. */\nfunction shortLabelNamesLabel(short: string, label: string): boolean {\n const s = firstWord(short);\n const l = firstWord(label);\n return s === \"\" || l === \"\" || l.startsWith(s) || s.startsWith(l);\n}\n\nconst TEXT_SIZE_WORDS: Record<TextSize, string> = { normal: \"Normal\", large: \"Large\", xlarge: \"Extra large\" };\n\n/** A development build's notes on `nav` (0.49 KIT-6): a `shortLabel` that is another word\n * than its `label` without `shortLabelIsAlias`. */\nfunction useNavDevWarnings(nav: AppShellNavItem[]): void {\n useEffect(() => {\n if (!devWarnings()) return;\n for (const item of nav) {\n if (item.shortLabel === undefined || item.shortLabelIsAlias) continue;\n if (shortLabelNamesLabel(item.shortLabel, item.label)) continue;\n const from = item.shortLabelFrom ?? \"normal\";\n const where = from === \"normal\" ? \"at every text size\" : `from ${TEXT_SIZE_WORDS[from]} text up`;\n warnNavOnce(\n `shortLabel|${item.to}|${item.shortLabel}|${item.label}`,\n `[ui-kit] AppShell nav \"${item.to}\": shortLabel \"${item.shortLabel}\" does not start with ` +\n `\"${item.label.trim().split(/\\s+/)[0]}\", the first word of its label \"${item.label}\". The phone bar ` +\n `shows it ${where}, so the page has another name there than in the sidebar and its title. ` +\n \"Shorten the label instead, or pass shortLabelIsAlias: true if the other word is meant.\",\n );\n }\n }, [nav]);\n}\n\n/**\n * Exported and `<div>`-shaped. This is the outermost element of every consuming app, so\n * there is nothing above it to hang an id, a landmark label or a `data-tour` anchor on —\n * and nothing a consumer can wrap it in either, since the root owns the `h-dvh` and\n * `overflow-hidden` the whole layout is built on (audit §api-design).\n */\nexport interface AppShellProps extends ComponentPropsWithoutRef<\"div\"> {\n /** Navigation entries — shared by the desktop sidebar and mobile bottom bar. */\n nav: AppShellNavItem[];\n /** The composed top bar (e.g. the shared TopBar with app-owned actions). */\n topBar: ReactNode;\n /** Main content — typically the router `<Outlet />`. */\n children: ReactNode;\n /**\n * What the content area shows while a page in `children` suspends — a lazy route's\n * chunk on its way (0.55). Given, the shell wraps `children` in `<Suspense\n * fallback={pageFallback}>` INSIDE `<main>`, so the top bar, the sidebar and the bottom\n * bar are there at once and only the content area waits. keksdose's boundary sat ABOVE\n * the shell until 2026-10-27, and every app load was one centred spinner where the whole\n * app would be (its `PageSuspense`); kastlan (`lazyPage`) and Kurvenschmiede (routes'\n * `Page`) each put one per route inside the `Outlet`. This is the one boundary, in one\n * place, for all three.\n *\n * Which outline fits which route stays the app's: the fallback renders under the\n * router, so it can read the path (keksdose's `PageSkeleton` draws the budget's tables\n * for `/budget`), and it is the app's to hold back for a frame or two (keksdose waits\n * 150 ms, so a chunk from the service worker's cache does not flash an outline).\n * `PageHeaderSkeleton` over a `TableSkeleton` is the kit's pieces for one,\n * `<LoadingState />` the plain one.\n *\n * Everything in `children` waits together, a banner above the `<Outlet />` included;\n * a boundary of the app's own inside it still catches first, so a per-route one keeps\n * working beside this. Left out, there is no boundary here and a suspending page goes on\n * to the app's own, as before. `null` is a boundary that shows nothing. Set it for the\n * shell's life: turning it on or off later mounts the page afresh.\n */\n pageFallback?: ReactNode;\n /** Desktop-only footer rendered below the content (hidden on mobile). */\n footer?: ReactNode;\n /** Extra sidebar content above the collapse toggle (e.g. a version link).\n * Receives the collapsed state so it can render compact vs. full. */\n sidebarFooter?: (collapsed: boolean) => ReactNode;\n /** The sidebar's bottom area as data — a version link, the legal links — drawn full\n * when expanded and as icon + tooltip when collapsed. Rendered above\n * `sidebarFooter`, which stays for anything the data cannot describe. */\n sidebarFooterItems?: AppShellSidebarFooterItem[];\n /** The router link for `sidebarFooterItems`. Default: the provider's\n * `linkComponent`, else react-router's `Link`. */\n renderLink?: KitLinkComponent;\n /** localStorage key for the persisted collapse state. */\n collapseStorageKey?: string;\n /** Default: `appShell.collapse` from the {@link UiKitProvider}, else English. */\n collapseLabel?: string;\n /** Default: `appShell.expand` from the {@link UiKitProvider}, else English. */\n expandLabel?: string;\n /** How an entry's `items` are revealed in the EXPANDED desktop sidebar.\n *\n * - `\"flyout\"` (default) — a panel beside the sidebar on hover/focus. Compact: the\n * sidebar stays one row per group however many pages a group holds.\n * - `\"inline\"` — a disclosure under the entry, the pattern of MUI's nested List and\n * most documentation sites. Every page is visible at once, and the group holding\n * the current page opens on its own, so the reader can see where they are without\n * hovering anything.\n *\n * The icon-only (collapsed) sidebar always uses the flyout: an indented list has no\n * room there. The mobile bottom bar ignores `items` in both modes. */\n subNav?: \"flyout\" | \"inline\";\n /** Accessible name of the inline disclosure button, given the group's label.\n * Only used with `subNav=\"inline\"`. Its expanded state is carried by\n * `aria-expanded`, so one wording serves both directions. Default:\n * `appShell.toggleGroup` from the {@link UiKitProvider}, else English. */\n toggleGroupLabel?: (groupLabel: string) => string;\n /** Below `md`: show the current group's `items` as a scrollable row above the\n * bottom bar — the phone's counterpart of the sidebar's second level. Default true;\n * `false` keeps the single bar, where a group entry only links to its own `to`. */\n mobileSubNav?: boolean;\n /**\n * How the phone sub-nav lays out a group with more pages than fit on one row.\n * `\"wrap\"`: every page in view, on as many rows as it takes — the bar grows.\n * `\"scroll\"`: one row that scrolls sideways, faded at a cut edge, with the current\n * page scrolled into view. A long group took four rows (~130px) of a 390px screen\n * above the bottom bar (showcase audit); scrolling gives that back at the price of\n * pages hidden past the edge, so it is the app's call, per shell.\n *\n * Unset (0.32.2, kastlan's 0.32.1 report): `\"wrap\"` at Normal and `\"scroll\"` at Large\n * and Extra large, where a wrapped group of eight pages took six or seven rows and\n * covered the page — the other half of what `mobileMaxItems` does for the bar.\n */\n mobileSubNavLayout?: \"wrap\" | \"scroll\";\n /**\n * The most cells the phone bar holds, \"More\" included (0.49 KIT-6). When `nav` (after\n * `mobileHidden`) has more entries, the bar keeps `mobileMaxItems − 1` of them and a\n * last \"More\" cell opens a sheet with the rest, each group with its pages. Which\n * entries stay is the items' `mobilePriority`, else the list's order (so the app puts\n * its most used entries first, or orders by role: kastlan's manager and accountant see\n * different firsts).\n *\n * Default {@link DEFAULT_MOBILE_MAX_ITEMS}: 5 at Normal and Large, 4 at Extra large —\n * eight entries are four and \"More\". A number replaces the default at every size;\n * `{ xlarge: 5 }` replaces it at one size only. Never fewer than one entry beside More.\n */\n mobileMaxItems?: number | Partial<Record<TextSize, number>>;\n /** The More cell's words over the provider's `appShellMore`. */\n moreLabels?: Partial<AppShellMoreLabels>;\n /**\n * Lay the shell out inside its PARENT'S box instead of the viewport: `h-full` rather\n * than `h-dvh`, its own scroll container at every width, a bottom bar pinned to the\n * shell rather than the window, `--app-nav-h` published on the shell alone, and no\n * persisted collapse state unless `collapseStorageKey` is passed. For an app preview,\n * a device frame, a docs example.\n *\n * Implied for a shell rendered inside another AppShell, which is the case this\n * exists for: the inner one used to publish its own nav height on `<html>`, fight\n * the outer one over it, and remove it on unmount from under the outer app.\n */\n embedded?: boolean;\n /** The shell's root, where the rest of the props go (0.34, API-2, refactor audit\n * 2026-10) — merged with its own ref, which `--app-nav-h` is published on. */\n ref?: Ref<HTMLDivElement>;\n}\n\n/** True below an AppShell — how a nested shell knows it is one. */\nconst AppShellNesting = createContext(false);\n\n/**\n * The bottom nav's own height, published as `--app-nav-h` so anything that has to sit\n * ON it can stop guessing.\n *\n * Keksdose live #314 is what this is for. Its rework — *\"Stick it to the bottom\n * touching the bottom icon bar with budget, accounts, … Currently there is a small gap\n * which confuses\"* — was a receipt footer pinned at `bottom-20`, because `<main>`\n * reserves `pb-20` for this nav and 20 looked like the nav's height. It is not: the\n * padding is generous CLEARANCE, and the nav is content-sized (icon + label + `py-2`,\n * about 56px), so the footer floated ~24px above the bar.\n *\n * Measured rather than named, because the height is not a constant anyone owns: it is\n * an icon, a translated label that can wrap or truncate, and whatever the platform does\n * with the safe-area inset. A hard-coded `bottom-14` would be the same guess one number\n * lower, and it would be wrong again the first time a label needed two lines.\n *\n * `0px` when the nav is not rendered — above `md` it is `display:none`, which observes\n * as a zero box — so a consumer can write `bottom-[var(--app-nav-h,0px)]` once and get\n * the right answer at both widths without a breakpoint of its own.\n */\nfunction useNavHeightVar(\n ref: React.RefObject<HTMLElement | null>,\n shellRef: React.RefObject<HTMLElement | null>,\n embedded: boolean,\n): void {\n // Re-run when the breakpoint flips. A ResizeObserver SKIPS an element that is not\n // being rendered, so the nav going `display:none` above `md` fires no callback and\n // would leave the last phone height published — a desktop footer would then sit 56px\n // off the bottom after a live resize. `useBreakpoint(\"md\")` is the nav's own `md:hidden`\n // at the text size in force (0.32), so the two cannot disagree about where the\n // boundary is — at Extra large both move to 72rem.\n const isMdUp = useBreakpoint(\"md\", false);\n useEffect(() => {\n const node = ref.current;\n const shell = shellRef.current;\n // Always on the shell's own root, so everything inside it — a nested shell's\n // content included — reads the nearest bar's height. On <html> as well only for\n // the OUTERMOST shell, for what it portals to <body> (a sheet docking on the bar).\n // The DOM check backs up the context for a shell mounted in a separate React root.\n const global = !embedded && !shell?.parentElement?.closest(\"[data-app-shell]\");\n const targets = [shell, global ? document.documentElement : null].filter((el): el is HTMLElement => el !== null);\n // `getBoundingClientRect().height`, rounded DOWN — not `offsetHeight`, and not\n // ceil. Measured on the running app at 406x816: the bar is **55.5px** tall, and\n // both `offsetHeight` and `Math.ceil` answer 56. That is why live #314 round four\n // was *\"No change. Still a pixel inbetween\"* — the previous fix was arithmetically\n // a no-op on the very value it was meant to correct.\n //\n // 56 is the wrong side. A sticky element with `bottom: X` puts its bottom edge X\n // above the viewport bottom, and the bar's TOP edge is at its own height: so\n // X = 56 lands the footer at y=760.0 against a bar starting at y=760.5, i.e. half\n // a CSS pixel of page showing through — about 1.4 device pixels on his phone,\n // which is exactly the hairline in the screenshot.\n //\n // The two errors are not symmetric, and I had them backwards the first time.\n // Too SMALL tucks the sticky element under a bar that is opaque and painted above\n // it (`z-30` against `z-10`): invisible. Too LARGE opens the seam. So floor, and\n // consumers subtract a further pixel (see `invoice-line-totals.tsx`) for the case\n // where the height lands on a whole pixel and floor leaves no overlap at all.\n const publish = () => {\n const value = `${node ? Math.floor(node.getBoundingClientRect().height) : 0}px`;\n for (const el of targets) el.style.setProperty(\"--app-nav-h\", value);\n };\n publish();\n // The observer is the refinement, not the mechanism: `publish()` above is already\n // right for a static nav, and jsdom has no ResizeObserver unless a test stubs one.\n // ONE cleanup for every branch, though — an early `return` on the no-observer path\n // left the variable behind on unmount, which a stale `bottom:` offset on whatever\n // rendered next would have inherited.\n const ro = node && typeof ResizeObserver !== \"undefined\" ? new ResizeObserver(publish) : null;\n if (ro && node) ro.observe(node);\n return () => {\n ro?.disconnect();\n for (const el of targets) el.style.removeProperty(\"--app-nav-h\");\n };\n }, [ref, shellRef, embedded, isMdUp]);\n}\n\n/**\n * The responsive application shell: a top bar, a collapsible desktop sidebar\n * (icon-only when collapsed, with tooltips), a mobile bottom nav bar, the main\n * content area, and an optional desktop footer. Router-aware via react-router\n * `NavLink`; domain-free — nav items, brand, footer and the top bar's actions\n * are all supplied by the app.\n */\nexport function AppShell({\n nav,\n topBar,\n children,\n pageFallback,\n footer,\n sidebarFooter,\n sidebarFooterItems,\n renderLink,\n collapseStorageKey: collapseStorageKeyProp,\n collapseLabel,\n expandLabel,\n subNav = \"flyout\",\n mobileSubNav = true,\n mobileSubNavLayout: mobileSubNavLayoutProp,\n mobileMaxItems,\n moreLabels,\n toggleGroupLabel,\n embedded: embeddedProp,\n className,\n ref,\n ...rest\n}: AppShellProps) {\n const embedded = useContext(AppShellNesting) || !!embeddedProp;\n const { size: textSize } = useTextSize();\n const large = textSize !== \"normal\";\n const mobileSubNavLayout = mobileSubNavLayoutProp ?? (large ? \"scroll\" : \"wrap\");\n // The bottom bar's cells: every entry the phone does not reach another way, up to the\n // text size's limit, More included; the rest go under More (§10.7, KIT-6).\n const maxItems = mobileCells(mobileMaxItems, textSize);\n const { shown: barNav, hidden: moreNav } = pickMobileBar(\n nav.filter((item) => !item.mobileHidden),\n maxItems,\n (item) => item.mobilePriority,\n );\n useNavDevWarnings(nav);\n // An embedded shell sharing the default key would overwrite the outer app's sidebar\n // preference with its own — so it persists only when given a key of its own.\n const collapseStorageKey = collapseStorageKeyProp ?? (embedded ? null : \"appLayout.sidebarCollapsed\");\n // The three props are per-shell overrides of the provider's `appShell`; one left\n // undefined falls through to the provider rather than to English.\n const labels = useKitLabels(\"appShell\", DEFAULT_APP_SHELL_LABELS, {\n collapse: collapseLabel,\n expand: expandLabel,\n toggleGroup: toggleGroupLabel,\n });\n // Through the guarded helpers, not `window.localStorage` directly. The read runs\n // inside a `useState` initialiser — i.e. during render of the top-level shell — and\n // `localStorage` THROWS where site data is blocked (Safari private browsing, a\n // partitioned webview). Unguarded, that was not a lost sidebar preference: nothing\n // in the application mounted at all.\n const [collapsed, setCollapsed] = useState(\n () => collapseStorageKey !== null && readStored(collapseStorageKey) === \"1\",\n );\n // The inline sidebar is an ACCORDION: one group open at a time, keyed by its `to`.\n // Held here rather than per group so opening one can close the other — two lists\n // open at once pushed every entry below them off a laptop screen.\n const [openGroup, setOpenGroup] = useState<string | null>(null);\n // Publishes `--app-nav-h` for anything that has to sit on the bottom bar.\n const navRef = useRef<HTMLDivElement>(null);\n const rootRef = useRef<HTMLDivElement>(null);\n const setRoot = useMemo(() => mergeRefs(rootRef, ref), [ref]);\n useNavHeightVar(navRef, rootRef, embedded);\n useEffect(() => {\n if (collapseStorageKey !== null) writeStored(collapseStorageKey, collapsed ? \"1\" : \"0\");\n }, [collapsed, collapseStorageKey]);\n // Reset this device's settings (docs/settings-harmonization.md §11.4): the sidebar\n // unfolds, live, and the effect above writes \"0\". An embedded shell without a key of\n // its own stores nothing and joins nothing.\n useEffect(() => {\n if (collapseStorageKey === null) return;\n return registerDeviceSetting({ key: collapseStorageKey, kind: \"view\", reset: () => setCollapsed(false) });\n }, [collapseStorageKey]);\n // §4: at Large and Extra large the sidebar never collapses to icons only — a glyph\n // with its name in a tooltip is the very thing a reader who asked for bigger type\n // cannot use. The persisted preference is left alone, so Normal gets it back, and the\n // toggle goes while it could not do anything.\n const iconOnly = collapsed && !large;\n\n return (\n // The caller's attributes go on the shell's own root, never on the `data-tour=\"nav\"`\n // wrappers below — those are the kit's anchors for its own guided tour (#313/#322),\n // and a second element answering to the same selector is a tour that highlights the\n // wrong thing or nothing at all.\n <AppShellNesting.Provider value={true}>\n <div\n {...rest}\n ref={setRoot}\n data-app-shell=\"\"\n className={cn(\n \"relative flex flex-col\",\n embedded\n ? // `contain: layout` makes this box the containing block for the `fixed`\n // bottom bar below, so it pins to the shell rather than to the window.\n \"h-full min-h-0 overflow-hidden [contain:layout]\"\n : \"min-h-screen md:h-dvh md:overflow-hidden\",\n className,\n )}\n >\n {/* §4: \"the top bar keeps its essential icons\" — its IconButtons stay icons at\n Large (their labels the names and tooltips) and a locked one keeps its reason\n in the tooltip: a bar 3rem tall has no room for words under every glyph. */}\n <CompactControls>{topBar}</CompactControls>\n <div className=\"flex flex-1 min-h-0\">\n <aside\n className={cn(\n // `border-e`: the sidebar sits at the START, which is the right in RTL.\n \"hidden md:flex md:flex-col border-e border-subtle bg-surface transition-[width] duration-200 ease-out overflow-hidden\",\n // Embedded, the row it sits in is already the shell's height; the sticky\n // offsets below are measured against the window's top bar.\n embedded ? \"md:self-stretch\" : \"md:sticky md:top-12 md:self-start md:h-[calc(100vh-3rem)]\",\n iconOnly ? \"md:w-14\" : \"md:w-60\",\n )}\n >\n {/* The `<nav>` is flex-1 so it fills the sidebar's height (with empty\n space below the items); the data-tour marker goes on the INNER,\n fit-content wrapper so the guided-tour spotlight hugs the actual nav\n items instead of the whole tall column (feedback #322). The marker\n also tags the mobile bottom bar below; the tour targets\n `[data-tour=\"nav\"]` and resolves to whichever is visible (#313). */}\n <nav className=\"flex-1 px-2 py-3 overflow-y-auto overflow-x-hidden\">\n <div data-tour=\"nav\" className=\"space-y-1\">\n {nav.map((item) => (\n <SidebarNavItem\n key={item.to}\n item={item}\n collapsed={iconOnly}\n inline={subNav === \"inline\"}\n toggleGroupLabel={labels.toggleGroup}\n openGroup={openGroup}\n setOpenGroup={setOpenGroup}\n />\n ))}\n </div>\n </nav>\n {!!sidebarFooterItems?.length && (\n <SidebarFooterItems items={sidebarFooterItems} collapsed={iconOnly} renderLink={renderLink} />\n )}\n {sidebarFooter?.(iconOnly)}\n {/* No toggle at Large: the sidebar cannot collapse there (see `iconOnly`). */}\n {!large && (\n <div className=\"border-t border-subtle p-2\">\n {collapsed ? (\n <Tooltip label={labels.expand} side=\"end\" portal className=\"block\">\n <button\n type=\"button\"\n onClick={() => setCollapsed(false)}\n aria-label={labels.expand}\n className=\"flex w-full items-center justify-center min-h-9 rounded-md text-muted hover:bg-hover hover:text-secondary\"\n >\n <PanelLeftOpen className=\"size-4 shrink-0 rtl:-scale-x-100\" />\n </button>\n </Tooltip>\n ) : (\n <button\n type=\"button\"\n onClick={() => setCollapsed(true)}\n aria-label={labels.collapse}\n className=\"flex w-full items-center gap-3 min-h-9 px-3 py-2 rounded-md text-sm text-muted hover:bg-hover hover:text-secondary\"\n >\n <PanelLeftClose className=\"size-4 shrink-0 rtl:-scale-x-100\" />\n {/* Never drawn at Large (the toggle is not), so the class matters at\n Normal only — the kit's one name for it all the same (round 0.34 T1). */}\n <span className=\"truncate-until-large\">{labels.collapse}</span>\n </button>\n )}\n </div>\n )}\n </aside>\n\n {/* Content column beside the sidebar. main grows to fill so the footer\n sits at the bottom — at the viewport edge when content is short,\n beside the sidebar rather than under it. */}\n <div className=\"flex flex-1 flex-col min-w-0 md:min-h-0\">\n {/* `scrollbar-gutter: stable` reserves the scrollbar's track whether or\n not it is currently needed. Without it this element — the app's only\n scroll container from md up — narrows its own client box by the\n scrollbar width the moment a page's content outgrows it, and widens\n it again when the next page fits. Every centred `mx-auto` container\n inside then jumps sideways by half a scrollbar, and any fluid-width\n content changes width outright. Keksdose feedback #403 caught it as\n \"slight width increase/decrease\" when switching to the notifications\n settings section and back: that section is the only one tall enough\n to scroll. Platform-dependent, which is why it is easy to miss —\n overlay scrollbars (macOS, most Linux builds) take no layout space,\n classic ones (Windows) take ~15px.\n\n `both-edges`, not the bare `stable`: a one-sided reservation keeps the\n width stable but moves the middle. On a page short enough not to\n scroll, nothing is painted into the reserved track, so every centred\n `mx-auto` container sits half a scrollbar left of the optical centre\n and every full-bleed child stops ~15px short on the right. Keksdose\n feedback #491 (/settings#data) and #498 (/budgets) both reported it as\n \"the left boundary looks smaller / cut off compared to the right\" on\n the one element per page whose frame is a saturated colour — the rose\n destructive-action cards. Reserving the track on both edges keeps the\n content centred whether or not the scrollbar is showing. */}\n {/* `relative` makes <main> the containing block for everything absolutely\n positioned inside it. Tailwind's `sr-only` is `position:absolute`; with no\n positioned ancestor it resolves against the INITIAL containing block, is\n laid out at its offset from the top of the DOCUMENT, and grows\n `<html>`'s scroll height past the viewport — a second scrollbar beside this\n one that scrolls into empty space. Guarding it per component (see\n sr-only-containment.test) could never be complete: any page's own\n `sr-only` span re-opened it. Here it is closed for every child at once. */}\n {/* Below `md` the bottom room is the nav plus the larger of 1.5rem and what the\n floating launchers take above it (`--app-float-clearance`, published by\n every kit FAB, FloatingPanel and FloatingActionGroup while mounted — keksdose\n dev#612: the last row ended under the help launcher). From `md` up, where\n there is no nav, the launchers' room alone (0.49 KIT-11): the last row\n scrolls clear of a corner button there too. */}\n <main\n className={cn(\n \"relative flex-1 max-w-full overflow-x-clip pb-[calc(var(--app-nav-h,4rem)+max(1.5rem,var(--app-float-clearance,0px)))] md:pb-[var(--app-float-clearance,0px)] md:min-h-0 md:overflow-y-auto md:[scrollbar-gutter:stable_both-edges]\",\n // The list page's fill (0.40, docs/page-layout-harmonization.md §1.3): while\n // a `fillHeight` DataTable is inside, a flex column — a banner above the\n // page keeps its own height and the page (a `FillHeight`) takes the rest,\n // so `<main>` no longer overflows by the banner. Its children do not shrink\n // (a banner of a fixed height or `overflow-hidden` would): the page grows\n // into the rest from a zero basis, and a window too short for the page's\n // floor scrolls `<main>`. Every other page lays out as before. Below `md`\n // the document scrolls and nothing fills.\n // The children's `shrink-0` carries no `:has`: `flex-shrink` does nothing\n // outside a flex container, and a `:has(…) > *` rule cost a style recalc of\n // the whole page on every DOM insertion under it (17–45 ms per scrolled step\n // of a `virtualize` table, 0.48.2). `[&&>*]` doubles the class, so it stays\n // as specific as FillHeight's `has-[…]:flex-1` (whose `flex: 1` would set\n // shrink 1) and, emitted after it, still wins.\n \"md:has-[[data-fill-height]]:flex md:has-[[data-fill-height]]:flex-col md:[&&>*]:shrink-0\",\n // Embedded there is no document scroll to lean on below `md` either.\n embedded && \"min-h-0 overflow-y-auto\",\n )}\n >\n {/* `undefined` and not `null` decides it: `null` is a boundary with an empty\n fallback, and \"no prop\" must stay what it was before 0.55 — no boundary,\n the suspension going on to the app's own. The boundary adds no element,\n so `<main>`'s rules above still see the page as its child. */}\n {pageFallback === undefined ? children : <Suspense fallback={pageFallback}>{children}</Suspense>}\n </main>\n {footer}\n </div>\n </div>\n\n {/* The phone navigation: the group bar, and above it — when the current page\n belongs to a group with pages of its own — the row of those pages. The pair\n is the phone's version of the sidebar's two levels; without the upper row a\n group's `items` were simply unreachable below `md`. ONE measured box, so\n `--app-nav-h` covers both rows and whatever docks on the bar sits on the\n whole of it. */}\n <div ref={navRef} className=\"md:hidden fixed bottom-0 inset-x-0 z-30 border-t border-subtle bg-surface\">\n {mobileSubNav && <MobileSubNav nav={nav} layout={mobileSubNavLayout} />}\n <nav\n data-tour=\"nav\"\n className=\"grid\"\n style={{ gridTemplateColumns: `repeat(${barNav.length + (moreNav.length ? 1 : 0)}, minmax(0, 1fr))` }}\n >\n {barNav.map((item) =>\n item.items?.length ? (\n <MobileGroupCell key={item.to} item={item} labels={moreLabels} />\n ) : (\n <MobileNavItem key={item.to} item={item} />\n ),\n )}\n {moreNav.length > 0 && <MobileMoreCell hidden={moreNav} labels={moreLabels} />}\n </nav>\n </div>\n </div>\n </AppShellNesting.Provider>\n );\n}\n\nconst routerLink: KitLinkComponent = ({ href, ...p }) => <Link to={href} {...p} />;\nconst plainLink: KitLinkComponent = ({ children, ...p }) => <a {...p}>{children}</a>;\n\nconst FOOTER_ICON_LINK =\n \"flex min-h-8 items-center justify-center rounded-md text-muted hover:bg-hover hover:text-secondary\";\n\n/** A footer link's count as drawn: nothing for none, \"99+\" past 99. */\nfunction footerBadgeText(badge: number | null | undefined): string | null {\n if (typeof badge !== \"number\" || !(badge > 0)) return null;\n return badge > 99 ? \"99+\" : String(Math.floor(badge));\n}\n\n/** The count's pill — the solid \"count\" look of `Chip` (warning, the pending count's\n * tone, as `FloatingActionGroup`'s badge), sized for the footer's small text. */\nconst FOOTER_BADGE =\n \"inline-flex h-4 min-w-4 shrink-0 items-center justify-center rounded-full bg-warning px-1 text-micro font-semibold leading-4 tabular-nums text-warning-contrast\";\n\n/** Calls the link renderer as a component, so a router link's hooks are its own. */\nfunction RenderedLink({ render, ...props }: KitLinkProps & { render: KitLinkComponent }) {\n return render(props);\n}\n\n/** The sidebar's bottom area, from {@link AppShellSidebarFooterItem}s. */\nfunction SidebarFooterItems({\n items,\n collapsed,\n renderLink,\n}: {\n items: AppShellSidebarFooterItem[];\n collapsed: boolean;\n renderLink?: KitLinkComponent;\n}) {\n const kitLink = useKitLink();\n const linkTo = (to: string, external: boolean | undefined, { children, ...props }: Omit<KitLinkProps, \"href\">) => {\n // The kit's one link rule (`pickLinkRenderer`): an external `to` or an in-page\n // `#anchor` is a plain `<a>` even without `external`; only `external` opens a tab.\n const InApp = pickLinkRenderer(renderLink, kitLink ?? routerLink, to) ?? plainLink;\n return external ? (\n <a href={to} target=\"_blank\" rel=\"noopener noreferrer\" {...props}>\n {children}\n </a>\n ) : (\n <RenderedLink render={InApp} href={to} {...props}>\n {children}\n </RenderedLink>\n );\n };\n\n return (\n <div data-slot=\"sidebar-footer-items\" className={cn(\"px-2 py-1\", collapsed ? \"space-y-1\" : \"space-y-1.5\")}>\n {items.map((item) => {\n if (collapsed) {\n const to = item.kind === \"links\" ? (item.to ?? item.links[0]?.to) : item.to;\n if (!to) return null;\n const external = item.kind === \"links\" ? item.links.find((l) => l.to === to)?.external : item.external;\n const count = item.kind === \"links\" ? null : footerBadgeText(item.badge);\n const spoken = count === null || item.kind === \"links\" ? null : (item.badgeLabel ?? count);\n return (\n <Tooltip key={item.key} label={item.label} side=\"end\" portal className=\"block\">\n {linkTo(to, external, {\n \"aria-label\": spoken === null ? item.label : `${item.label}, ${spoken}`,\n className: cn(FOOTER_ICON_LINK, count !== null && \"relative\"),\n children: (\n <>\n <item.icon className=\"size-4\" aria-hidden />\n {count !== null && (\n <span aria-hidden data-badge=\"\" className={cn(FOOTER_BADGE, \"absolute -top-0.5 end-0.5\")}>\n {count}\n </span>\n )}\n </>\n ),\n })}\n </Tooltip>\n );\n }\n if (item.kind === \"links\") {\n return (\n <nav\n key={item.key}\n aria-label={item.label}\n className=\"flex flex-wrap justify-center gap-x-3 gap-y-0.5 text-caption text-muted\"\n >\n {item.links.map((l) => (\n <span key={l.to}>\n {linkTo(l.to, l.external, {\n className: \"rounded-sm hover:text-secondary hover:underline\",\n children: l.label,\n })}\n </span>\n ))}\n </nav>\n );\n }\n const count = footerBadgeText(item.badge);\n const link = linkTo(item.to, item.external, {\n className: cn(FOOTER_ICON_LINK, \"gap-1.5 text-xs font-medium\"),\n children: (\n <>\n <item.icon className=\"size-3.5 shrink-0\" aria-hidden />\n {/* Wraps from Large up (text size §10.17, round 0.34 T1): the link is\n `min-h-8`, so it grows a line rather than cut \"Feedb…\". */}\n <span className=\"min-w-0 truncate-until-large\">{item.text ?? item.label}</span>\n {count !== null && (\n <>\n <span aria-hidden data-badge=\"\" className={FOOTER_BADGE}>\n {count}\n </span>\n <span className=\"sr-only\">, {item.badgeLabel ?? count}</span>\n </>\n )}\n </>\n ),\n });\n return item.hint ? (\n <Tooltip key={item.key} label={item.hint} side=\"top\" portal className=\"block\">\n {link}\n </Tooltip>\n ) : (\n <div key={item.key}>{link}</div>\n );\n })}\n </div>\n );\n}\n\n/**\n * A bar cell's look, shared by the entries and the More cell. The active page needs a\n * clear marker, not just a subtle text shade (feedback #327): brand-accent icon + label,\n * bolder weight, and a top accent bar spanning the cell so it reads at a glance.\n */\nconst mobileCellClass = (active: boolean) =>\n cn(\n // `h-full`: the grid row stretches every cell to the tallest one's height, so a\n // label on two lines never leaves its neighbours a different shape.\n \"relative flex h-full w-full flex-col items-center justify-start py-2 text-caption gap-0.5 transition-colors\",\n \"before:absolute before:content-[''] before:inset-x-4 before:top-0 before:h-0.5 before:rounded-full before:transition-colors\",\n active ? \"font-semibold text-brand before:bg-brand\" : \"text-muted before:bg-transparent\",\n );\n\n/**\n * A bar cell's label (0.32, §10.7): up to TWO lines, never an ellipsis on one. At Large\n * a cell is a fifth of a phone holding type a quarter bigger, and one line truncated\n * \"Transactions\" to \"Trans…\" in every app (Kurvenschmiede). Two lines and then a clamp,\n * centred, a long word broken (and hyphenated where the page's `lang` allows) rather\n * than overflowing into the next cell. `shortLabel` still wins where the app has one.\n *\n * `data-truncate-ok` (text size §10.17, round 0.34 T1): the clamp is that decision, not\n * an accident — the size sweep finds \"Sowing calen…\" in a 65 px cell at 360 px / Extra\n * large, and a third line would make every cell of the bar taller for one long word.\n * The whole label stays the link's accessible name; an app with a long one gives the bar\n * a `shortLabel`.\n */\nfunction MobileCellLabel({ children }: { children: ReactNode }) {\n return (\n <span\n data-truncate-ok=\"\"\n className=\"line-clamp-2 max-w-full break-words px-0.5 text-center leading-tight hyphens-auto\"\n >\n {children}\n </span>\n );\n}\n\n/** One cell of the phone's group bar. Marked while the group's own page OR any of its\n * pages is current — NavLink alone only knows its own `to`, which left the bar with\n * nothing marked on every sub-page (the same defect the sidebar had). */\nfunction MobileNavItem({ item }: { item: AppShellNavItem }) {\n const subActive = useSubItemActive(item);\n const label = useCellLabel(item);\n return (\n <NavLink\n to={item.to}\n end={item.end ?? true}\n data-tour={item.dataTour}\n className={({ isActive }) => mobileCellClass(isActive || subActive)}\n >\n <span className=\"relative\">\n <item.icon className=\"size-5\" />\n </span>\n <MobileCellLabel>{label}</MobileCellLabel>\n </NavLink>\n );\n}\n\n/** The bar cell's label: `shortLabel` from its text size up (0.48), else `label`. */\nfunction useCellLabel(item: AppShellNavItem): string {\n const { size } = useTextSize();\n return item.shortLabel !== undefined &&\n TEXT_SIZES.indexOf(size) >= TEXT_SIZES.indexOf(item.shortLabelFrom ?? \"normal\")\n ? item.shortLabel\n : item.label;\n}\n\n/** A link in one of the phone's sheets — an entry (`level=\"entry\"`) or a page under one. */\nfunction SheetLink({\n to,\n end,\n icon: Icon,\n label,\n onClick,\n level,\n}: {\n to: string;\n end?: boolean;\n icon: LucideIcon;\n label: string;\n onClick: () => void;\n level: \"entry\" | \"page\";\n}) {\n return (\n <NavLink\n to={to}\n end={end ?? true}\n onClick={onClick}\n className={({ isActive }) =>\n cn(\n level === \"entry\"\n ? \"flex min-h-11 items-center gap-3 rounded-md px-3 py-2 text-sm transition-colors\"\n : \"flex min-h-11 items-center gap-2.5 rounded-md px-2.5 py-1.5 text-sm transition-colors\",\n isActive\n ? \"bg-inverse text-inverse\"\n : level === \"entry\"\n ? \"text-primary hover:bg-hover\"\n : \"text-secondary hover:bg-hover\",\n )\n }\n >\n <Icon aria-hidden className={level === \"entry\" ? \"size-5 shrink-0\" : \"size-4 shrink-0 opacity-70\"} />\n <span className=\"min-w-0 break-words leading-snug\">{label}</span>\n </NavLink>\n );\n}\n\n/**\n * A bar cell for an entry with pages (0.49 KIT-6): on a phone the entry opens a sheet of\n * its pages instead of linking to its own `to` — a tap on \"Reports\" used to land on the\n * overview with the pages one more step away, in the row above the bar, which only\n * appears once you are in the group. The sheet lists the entry's own page first, as\n * \"Overview\", when none of the pages is that page. Marked while the entry's page or one\n * of its pages is current, as the link was.\n *\n * Tours find the entry by `a[href]` or its `dataTour`, as on the More cell: an inert,\n * pointer-transparent anchor over the button carries them (see {@link MobileMoreCell}).\n */\nfunction MobileGroupCell({\n item,\n labels: labelsProp,\n}: {\n item: AppShellNavItem;\n labels?: LabelOverride<AppShellMoreLabels>;\n}) {\n const labels: AppShellMoreLabels = useKitLabels(\"appShellMore\", DEFAULT_APP_SHELL_MORE_LABELS, labelsProp);\n const { pathname } = useLocation();\n const [open, setOpen] = useState(false);\n const label = useCellLabel(item);\n const active = entryIsCurrent(item, pathname);\n const close = () => setOpen(false);\n const pages = item.items ?? [];\n const ownPageListed = pages.some((sub) => sub.to === item.to);\n return (\n <div data-slot=\"app-shell-group\" className=\"relative min-w-0\">\n <button\n type=\"button\"\n aria-haspopup=\"dialog\"\n aria-expanded={open}\n // The cell may show a shortLabel; the button's name is the entry's.\n aria-label={label === item.label ? undefined : item.label}\n onClick={() => setOpen(true)}\n className={mobileCellClass(active)}\n >\n <span className=\"relative\">\n <item.icon aria-hidden className=\"size-5\" />\n </span>\n <MobileCellLabel>{label}</MobileCellLabel>\n </button>\n <TourAnchor to={item.to} dataTour={item.dataTour} />\n {pages\n .filter((sub) => sub.to !== item.to)\n .map((sub) => (\n <TourAnchor key={sub.to} to={sub.to} />\n ))}\n <DialogFrame open={open} onClose={close} title={item.label} closeButton bodyClassName=\"space-y-1\">\n <ul className=\"space-y-1\">\n {!ownPageListed && (\n <li>\n <SheetLink\n to={item.to}\n end={item.end}\n icon={item.icon}\n label={labels.overview}\n onClick={close}\n level=\"entry\"\n />\n </li>\n )}\n {pages.map((sub) => (\n <li key={sub.to}>\n <SheetLink to={sub.to} end={sub.end} icon={sub.icon} label={sub.label} onClick={close} level=\"entry\" />\n </li>\n ))}\n </ul>\n </DialogFrame>\n </div>\n );\n}\n\n/** Whether the current route is `item`'s page or one of its pages. */\nfunction entryIsCurrent(item: AppShellNavItem, pathname: string): boolean {\n return (\n !!matchPath({ path: item.to, end: item.end ?? true }, pathname) ||\n !!item.items?.some((sub) => matchPath({ path: sub.to, end: sub.end ?? true }, pathname))\n );\n}\n\n/** A hidden entry's link, resolved as the router would write it (basename included). */\nfunction TourAnchor({ to, dataTour }: { to: string; dataTour?: string }) {\n const href = useHref(to);\n return (\n // eslint-disable-next-line jsx-a11y/anchor-has-content -- a tour anchor, aria-hidden and inert; the More button under it is the control (see MobileMoreCell)\n <a\n href={href}\n data-tour={dataTour}\n // Not a control: no name, no tab stop, no pointer — the More button under it\n // takes the tap. It exists only to be FOUND (see MobileMoreCell).\n aria-hidden\n tabIndex={-1}\n className=\"pointer-events-none absolute inset-0\"\n />\n );\n}\n\n/**\n * The bar's \"More\" cell (0.32, docs/text-size-harmonization.md §4, §10.7): the entries\n * past `mobileMaxItems`, in a sheet — each entry as a link, and under a group its pages,\n * since a group the bar no longer shows has no sub-row to reach them by either. Marked\n * active while the current page is one of them, as the cell it replaced would be.\n *\n * **Tour anchors.** A guided tour finds a nav entry by `[data-tour=\"nav\"] a[href=\"/x\"]`\n * (keksdose's tours) or by the entry's own `dataTour`. An entry under More has no link\n * in the bar, and the sidebar's copy is `display:none` on a phone, so such a step would\n * spotlight nothing. So the More cell carries the hidden entries' links — one `<a>` per\n * entry and per page of a hidden group, with the entry's `href` and `dataTour` — laid\n * over the cell (`absolute inset-0`): both selectors resolve to a visible box, and that\n * box is the More cell, which is where the reader has to go next. They are\n * `aria-hidden`, out of the tab order and pointer-transparent, so neither a screen\n * reader nor a tap ever meets them; the button under them is the one control.\n */\nfunction MobileMoreCell({\n hidden,\n labels: labelsProp,\n}: {\n hidden: AppShellNavItem[];\n labels?: LabelOverride<AppShellMoreLabels>;\n}) {\n const labels: AppShellMoreLabels = useKitLabels(\"appShellMore\", DEFAULT_APP_SHELL_MORE_LABELS, labelsProp);\n const { pathname } = useLocation();\n const [open, setOpen] = useState(false);\n const active = hidden.some((item) => entryIsCurrent(item, pathname));\n const close = () => setOpen(false);\n return (\n <div data-slot=\"app-shell-more\" className=\"relative min-w-0\">\n <button\n type=\"button\"\n aria-haspopup=\"dialog\"\n aria-expanded={open}\n onClick={() => setOpen(true)}\n className={mobileCellClass(active)}\n >\n <span className=\"relative\">\n <MoreHorizontal aria-hidden className=\"size-5\" />\n </span>\n <MobileCellLabel>{labels.more}</MobileCellLabel>\n </button>\n {hidden.flatMap((item) => [\n <TourAnchor key={item.to} to={item.to} dataTour={item.dataTour} />,\n ...(item.items ?? []).map((sub) => <TourAnchor key={`${item.to} ${sub.to}`} to={sub.to} />),\n ])}\n <DialogFrame open={open} onClose={close} title={labels.moreTitle} closeButton bodyClassName=\"space-y-1\">\n <ul className=\"space-y-1\">\n {hidden.map((item) => (\n <li key={item.to}>\n <SheetLink\n to={item.to}\n end={item.end}\n icon={item.icon}\n label={item.label}\n onClick={close}\n level=\"entry\"\n />\n {!!item.items?.length && (\n <ul aria-label={item.label} className=\"ms-[1.3rem] mt-0.5 space-y-0.5 border-s border-subtle ps-2\">\n {item.items.map((sub) => (\n <li key={sub.to}>\n <SheetLink\n to={sub.to}\n end={sub.end}\n icon={sub.icon}\n label={sub.label}\n onClick={close}\n level=\"page\"\n />\n </li>\n ))}\n </ul>\n )}\n </li>\n ))}\n </ul>\n </DialogFrame>\n </div>\n );\n}\n\n/**\n * The upper row of the phone navigation: the pages of the group the reader is in, as\n * a sideways-scrolling row of pills. Rendered only while such a group is current —\n * on a page outside every group the bar stays one row, rather than showing an empty\n * shelf or guessing a group.\n *\n * It slides in over 200ms (fade only under reduced motion) and wraps onto more rows\n * rather than scrolling, so every page of the group is in view at once.\n */\nfunction MobileSubNav({ nav, layout }: { nav: AppShellNavItem[]; layout: \"wrap\" | \"scroll\" }) {\n const { pathname } = useLocation();\n const scroll = layout === \"scroll\";\n const listRef = useRef<HTMLUListElement>(null);\n const fade = useStripFade(listRef);\n // The current page into view — the row only, never the page.\n useLayoutEffect(() => {\n const list = listRef.current;\n const current = list?.querySelector<HTMLElement>('[aria-current=\"page\"]');\n if (scroll && list && current) scrollIntoStrip(list, current);\n }, [scroll, pathname]);\n const group = nav.find(\n (item) =>\n !!item.items?.length &&\n (matchPath({ path: item.to, end: item.end ?? true }, pathname) ||\n item.items.some((sub) => matchPath({ path: sub.to, end: sub.end ?? true }, pathname))),\n );\n\n if (!group) return null;\n return (\n <nav\n aria-label={group.label}\n // Keyed by group so switching groups replays the entrance.\n key={group.to}\n className=\"animate-subnav border-b border-subtle\"\n >\n <ul\n ref={listRef}\n // `wrap` (default) takes as many rows as the group needs: a sideways row hides\n // pages past the edge, and every page of the group in view is the point of the\n // row. The bar grows with it — `--app-nav-h` measures it. `scroll` is the app's\n // opt-in trade: one row, the cut edge faded (see mobileSubNavLayout).\n className={cn(\n \"flex gap-1.5 px-3 py-2\",\n scroll ? \"overflow-x-auto overscroll-x-contain [scrollbar-width:none]\" : \"flex-wrap\",\n )}\n data-overflow={scroll ? fade.overflow : undefined}\n style={scroll && fade.mask ? { maskImage: fade.mask, WebkitMaskImage: fade.mask } : undefined}\n >\n {group.items!.map((sub) => (\n <li key={sub.to} className=\"shrink-0\">\n <NavLink\n to={sub.to}\n end={sub.end ?? true}\n className={({ isActive }) =>\n cn(\n \"flex items-center gap-1.5 rounded-full border px-3 py-1 text-xs transition-colors\",\n isActive\n ? \"border-brand bg-brand font-medium text-brand-contrast\"\n : \"border-subtle text-secondary hover:bg-hover\",\n )\n }\n >\n <sub.icon className=\"size-3.5 shrink-0\" aria-hidden />\n {sub.label}\n </NavLink>\n </li>\n ))}\n </ul>\n </nav>\n );\n}\n\n/** `strong` is the current page; `trail` is the group that CONTAINS the current page\n * while the page itself is shown elsewhere (the inline list below it). */\nconst navLinkClass =\n (collapsed: boolean, forceActive: boolean, trail = false) =>\n ({ isActive }: { isActive: boolean }) =>\n `flex items-center gap-3 min-h-9 ${collapsed ? \"justify-center px-2\" : \"px-3\"} py-2 rounded-md text-sm transition-colors duration-150 ${\n isActive || (forceActive && !trail)\n ? \"bg-inverse text-inverse\"\n : forceActive\n ? \"font-medium text-primary hover:bg-hover\"\n : \"text-secondary hover:bg-hover\"\n }`;\n\n/** Whether any of an entry's sub-items is the current route. NavLink only knows about\n * its OWN `to`, so without this a group whose pages live at sibling paths\n * (`/fields`, `/numbers`, …) lost its highlight the moment the reader left the one\n * page the group linked to — the sidebar then marked nothing at all, and the only\n * \"you are here\" left was inside a flyout that is closed unless hovered. */\nfunction useSubItemActive(item: AppShellNavItem): boolean {\n const { pathname } = useLocation();\n return !!item.items?.some((sub) => matchPath({ path: sub.to, end: sub.end ?? true }, pathname));\n}\n\n/** A single desktop sidebar entry. Plain link (with a tooltip when collapsed) —\n * unless it has sub-items, in which case hovering/focusing opens a flyout, or (with\n * `inline`) a disclosure lists them underneath. */\nfunction SidebarNavItem({\n item,\n collapsed,\n inline,\n toggleGroupLabel,\n openGroup,\n setOpenGroup,\n}: {\n item: AppShellNavItem;\n collapsed: boolean;\n inline: boolean;\n toggleGroupLabel: (groupLabel: string) => string;\n openGroup: string | null;\n setOpenGroup: (to: string | null) => void;\n}) {\n const hasSub = !!item.items?.length;\n const subActive = useSubItemActive(item);\n\n // In the EXPANDED sidebar a group is one component in both styles, so switching\n // between them is a transition of the same element (the page list folding away or\n // unfolding) rather than one tree replaced by another. The icon-only sidebar keeps\n // the plain flyout below: an indented list has no room there.\n if (hasSub && !collapsed) {\n return (\n <SidebarGroup\n item={item}\n subActive={subActive}\n inline={inline}\n toggleGroupLabel={toggleGroupLabel}\n open={openGroup === item.to}\n setOpenGroup={setOpenGroup}\n />\n );\n }\n\n const link = (\n <NavLink\n to={item.to}\n end={item.end ?? true}\n data-tour={item.dataTour}\n className={navLinkClass(collapsed, subActive)}\n aria-haspopup={hasSub ? \"menu\" : undefined}\n >\n <span className=\"relative shrink-0\">\n <item.icon className=\"size-4\" />\n </span>\n {/* Wraps rather than truncates: in the sidebar a label cut to \"Checkbox, switch\n & sl…\" hides the one word that tells two pages apart, and there is height\n to spare. (The phone bar clamps at two lines instead, since 0.32 §10.7.) */}\n {!collapsed && <span className=\"min-w-0 flex-1 break-words leading-snug\">{item.label}</span>}\n {!collapsed && hasSub && <ChevronRight className=\"size-3.5 shrink-0 opacity-60 rtl:-scale-x-100\" />}\n </NavLink>\n );\n\n if (hasSub) return <SidebarFlyout item={item}>{link}</SidebarFlyout>;\n return collapsed ? (\n <Tooltip label={item.label} side=\"end\" portal className=\"block\">\n {link}\n </Tooltip>\n ) : (\n link\n );\n}\n\n/**\n * An entry with sub-items in the expanded sidebar.\n *\n * - `inline`: the entry's own link (its overview page) plus a chevron button that\n * shows or hides the sub-items indented beneath it. Two controls rather than one\n * because they do two different things — a row that both navigated AND toggled\n * would make \"open the overview\" and \"peek at the pages\" the same click.\n * - flyout: the link alone, with the sub-items in a panel beside the sidebar on\n * hover/focus. The inline list is still rendered, folded shut, so that switching\n * styles animates it rather than swapping it.\n *\n * THE FOLD is a `grid-template-rows` transition from `0fr` to `1fr` — the one way to\n * animate to a content-sized height without measuring it, so a translated label that\n * wraps to two lines unfolds exactly as far as it needs. `visibility` rides the same\n * transition so a shut list drops out of the accessibility tree only once it has\n * finished closing, and `inert` takes its links out of the tab order immediately.\n */\nfunction SidebarGroup({\n item,\n subActive,\n inline,\n toggleGroupLabel,\n open,\n setOpenGroup,\n}: {\n item: AppShellNavItem;\n subActive: boolean;\n inline: boolean;\n toggleGroupLabel: (groupLabel: string) => string;\n /** Whether this is the sidebar's one open group (see AppShell's `openGroup`). */\n open: boolean;\n setOpenGroup: (to: string | null) => void;\n}) {\n const listId = useId();\n const { pathname } = useLocation();\n const onOwnPage = !!matchPath({ path: item.to, end: item.end ?? true }, pathname);\n // Opening follows the reader: arriving on this group's overview or one of its pages\n // (by link, by the pager, by Back) opens it — and, the sidebar holding ONE open\n // group, closes whichever was open before. Both folds run at once, so the eye sees\n // one list hand over to the other. Run in an effect after mount, so the current\n // group UNFOLDS into view on load rather than appearing already open.\n const here = subActive || onOwnPage;\n useEffect(() => {\n if (here) setOpenGroup(item.to);\n }, [here, item.to, setOpenGroup]);\n const expanded = inline && open;\n\n const link = (\n <NavLink\n to={item.to}\n end={item.end ?? true}\n data-tour={item.dataTour}\n aria-haspopup={inline ? undefined : \"menu\"}\n // `trail` (inline only): while a page of the group is current, the group row is\n // the breadcrumb, not the destination — the page's own row below carries the\n // strong marker, and two inverse rows would say \"you are here\" twice. In the\n // flyout style the pages are out of sight, so the group row IS the marker.\n className={(state) => cn(navLinkClass(false, subActive, inline)(state), \"min-w-0 flex-1\")}\n >\n <span className=\"relative shrink-0\">\n <item.icon className=\"size-4\" />\n </span>\n <span className=\"min-w-0 flex-1 break-words leading-snug\">{item.label}</span>\n {!inline && <ChevronRight className=\"size-3.5 shrink-0 opacity-60 rtl:-scale-x-100\" />}\n </NavLink>\n );\n\n return (\n <div>\n {inline ? (\n <div className=\"flex items-center gap-0.5\">\n {link}\n <button\n type=\"button\"\n aria-expanded={open}\n aria-controls={listId}\n aria-label={toggleGroupLabel(item.label)}\n onClick={() => setOpenGroup(open ? null : item.to)}\n className=\"flex size-9 shrink-0 items-center justify-center rounded-md text-muted hover:bg-hover hover:text-secondary\"\n >\n <ChevronRight\n aria-hidden\n className={cn(\n \"size-3.5 transition-transform duration-200 ease-out motion-reduce:transition-none rtl:-scale-x-100\",\n // Under dir=\"rtl\" the chevron is MIRRORED first (scale applies before rotate), so\n // it starts pointing left and a +90° turn would point it UP — hence −90° there.\n open && \"rotate-90 rtl:-rotate-90\",\n )}\n />\n </button>\n </div>\n ) : (\n <SidebarFlyout item={item}>{link}</SidebarFlyout>\n )}\n <div\n id={listId}\n inert={!expanded}\n className=\"grid transition-[grid-template-rows,visibility] duration-200 ease-out motion-reduce:transition-none\"\n style={{\n gridTemplateRows: expanded ? \"1fr\" : \"0fr\",\n visibility: expanded ? \"visible\" : \"hidden\",\n }}\n >\n <div\n className={cn(\n \"min-h-0 overflow-hidden transition-opacity duration-200 ease-out motion-reduce:transition-none\",\n expanded ? \"opacity-100\" : \"opacity-0\",\n )}\n >\n {/* The rule and indent live on the list INSIDE the clipping box: margin or\n padding on the element whose row is collapsing to 0fr would hold it open\n by that much. */}\n <ul className=\"ms-[1.3rem] mt-0.5 space-y-0.5 border-s border-subtle ps-2\">\n {item.items!.map((sub) => (\n <li key={sub.to}>\n <NavLink\n to={sub.to}\n end={sub.end ?? true}\n className={({ isActive }) =>\n cn(\n \"flex min-h-8 items-center gap-2.5 rounded-md px-2.5 py-1.5 text-sm transition-colors\",\n isActive ? \"bg-inverse text-inverse\" : \"text-secondary hover:bg-hover\",\n )\n }\n >\n <sub.icon className=\"size-4 shrink-0 opacity-70\" aria-hidden />\n <span className=\"min-w-0 break-words leading-snug\">{sub.label}</span>\n </NavLink>\n </li>\n ))}\n </ul>\n </div>\n </div>\n </div>\n );\n}\n\n// Only ONE sidebar flyout should be on screen at a time. Each open flyout parks its\n// \"close now\" here so the next item to open can dismiss it immediately, instead of\n// leaving the previous panel up for the 140ms travel delay while the cursor moves\n// down the nav list — which showed two panels at once.\nlet activeFlyoutClose: (() => void) | null = null;\n\n/**\n * Wraps a nav item that has sub-items: on hover or keyboard focus it opens a\n * portalled flyout to the right of the sidebar (portalled so the sidebar's\n * `overflow-hidden` can't clip it) with the item's label as a header and each\n * sub-item as an icon + title link. A short close delay lets the cursor travel\n * from the item onto the panel; Escape / outside-move close it.\n */\nfunction SidebarFlyout({ item, children }: { item: AppShellNavItem; children: ReactNode }) {\n const wrapperRef = useRef<HTMLDivElement>(null);\n const closeTimer = useRef<ReturnType<typeof setTimeout> | null>(null);\n const [open, setOpen] = useState(false);\n // The flyout is portalled out of the subtree whose `dir` it inherited; read on open.\n const [dir, setDir] = useState<Direction>(\"ltr\");\n\n // Anchor the flyout to the item's END edge — its right, or its left in RTL, where\n // the sidebar sits on the right of the window — and keep it on the glass (Wave 2,\n // DUP-7). Right to left it hangs by its `right`, which a fixed box measures from\n // inside the scrollbar: `innerWidth` counted the bar and put the flyout a bar's width\n // off its item. The hook re-measures on scroll/resize (the nav list can scroll); the\n // panel's own width is measured once it is up, before paint.\n const rect = useAnchoredRect(wrapperRef, open);\n const panelRef = useRef<HTMLDivElement>(null);\n const [panelWidth, setPanelWidth] = useState(0);\n const placed = rect !== null;\n useLayoutEffect(() => {\n if (open && placed) setPanelWidth(panelRef.current?.offsetWidth ?? 0);\n }, [open, placed]);\n const at = rect ? anchoredInline(rect, panelWidth, { dir, align: \"after\" }) : null;\n const pos = rect && at ? { top: rect.top, ...(dir === \"rtl\" ? { right: at.right } : { left: at.left }) } : null;\n\n const cancelClose = useCallback(() => {\n if (closeTimer.current) {\n clearTimeout(closeTimer.current);\n closeTimer.current = null;\n }\n }, []);\n // Stable identity: the coordinator above holds this so a sibling item can close\n // THIS flyout without waiting out its travel delay.\n const closeNow = useCallback(() => {\n cancelClose();\n setOpen(false);\n }, [cancelClose]);\n const openMenu = useCallback(() => {\n cancelClose();\n if (activeFlyoutClose && activeFlyoutClose !== closeNow) activeFlyoutClose();\n activeFlyoutClose = closeNow;\n setDir(dirOf(wrapperRef.current));\n setOpen(true);\n }, [cancelClose, closeNow]);\n const scheduleClose = useCallback(() => {\n cancelClose();\n closeTimer.current = setTimeout(() => {\n setOpen(false);\n if (activeFlyoutClose === closeNow) activeFlyoutClose = null;\n }, 140);\n }, [cancelClose, closeNow]);\n\n // Close on Escape while open — a layer on the kit's Escape stack (Wave 2, DUP-1).\n useDismissLayer(open, () => setOpen(false));\n\n useEffect(\n () => () => {\n cancelClose();\n if (activeFlyoutClose === closeNow) activeFlyoutClose = null;\n },\n [cancelClose, closeNow],\n );\n\n return (\n // Not a control: hover and focus-within on the nav link inside. Focus (the\n // keyboard path) opens it exactly as hover does, Escape closes it.\n // eslint-disable-next-line jsx-a11y/no-static-element-interactions -- hover/focus-within wrapper around a real link\n <div\n ref={wrapperRef}\n className=\"relative\"\n onMouseEnter={openMenu}\n onMouseLeave={scheduleClose}\n onFocus={openMenu}\n onBlur={scheduleClose}\n >\n {children}\n {open &&\n pos &&\n createPortal(\n // Keeps the flyout open while the pointer crosses into it; keyboard users\n // reach it by focus, which the wrapper above already handles.\n // eslint-disable-next-line jsx-a11y/no-static-element-interactions -- pointer-only hover bridge\n <div\n ref={panelRef}\n dir={dir}\n style={{ position: \"fixed\", ...pos }}\n className=\"z-40 ps-1\"\n onMouseEnter={cancelClose}\n onMouseLeave={scheduleClose}\n >\n <div\n role=\"menu\"\n aria-label={item.label}\n className=\"animate-flyout min-w-52 overflow-hidden rounded-md border border-subtle bg-surface shadow-lg\"\n >\n <div className=\"border-b border-subtle px-3 py-2 text-caption font-semibold uppercase tracking-wide text-muted\">\n {item.label}\n </div>\n <ul className=\"py-1\">\n {item.items!.map((sub) => (\n <li key={sub.to}>\n <NavLink\n to={sub.to}\n end={sub.end ?? true}\n role=\"menuitem\"\n onClick={() => setOpen(false)}\n className={({ isActive }) =>\n cn(\n \"flex items-center gap-2.5 px-3 py-2 text-sm\",\n isActive ? \"bg-active font-medium text-primary\" : \"text-secondary hover:bg-hover\",\n )\n }\n >\n <sub.icon className=\"size-4 shrink-0 text-placeholder\" />\n <span className=\"min-w-0 break-words leading-snug\">{sub.label}</span>\n </NavLink>\n </li>\n ))}\n </ul>\n </div>\n </div>,\n document.body,\n )}\n </div>\n );\n}\n"],"mappings":";AA2jBQ,SAwOU,UAxOV,KAoDU,YApDV;AA3jBR;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,oBAAoB;AAC7B,SAAS,MAAM,SAAS,WAAW,SAAS,mBAAmB;AAC/D,SAAS,cAAc,gBAAgB,gBAAgB,qBAAqB;AAE5E,SAAS,UAAU;A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@ -72,6 +72,9 @@ export interface DevMenuProps<R extends string, P extends string> {
72
72
  * today, a simulated slow server. The flask wears a dot, and its name says so ("Dev
73
73
  * tools · Role: ADMIN · Plan: free Overrides on"), since a dot alone tells a screen
74
74
  * reader nothing. The app decides what counts; the kit cannot see into its sections.
75
+ *
76
+ * 0.55: a "today" the app moved with `setToday` (`@eifi1/ui-kit/dates`, the dev clock's
77
+ * day) counts by itself — the dot is on while one is set, `active` or not.
75
78
  */
76
79
  active?: boolean;
77
80
  }
@@ -1,11 +1,12 @@
1
1
  "use client";
2
2
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
- import { useState } from "react";
3
+ import { useState, useSyncExternalStore } from "react";
4
4
  import { FlaskConical, Undo2 } from "lucide-react";
5
5
  import { DEFAULT_TOP_BAR_LABELS, useKitLabels } from "../i18n/kit-labels.js";
6
6
  import { TopBarActionMenu } from "./topbar-action-menu.js";
7
7
  import { useTopBarPartsLabels } from "./top-bar-parts-labels.js";
8
8
  import { readSessionStored, writeSessionStored } from "../lib/safe-storage.js";
9
+ import { subscribeToday, todayOverride } from "../lib/dates.js";
9
10
  const DEV_ORIGINAL_ROLE_KEY = "ui-kit:dev-original-role";
10
11
  const flask = /* @__PURE__ */ jsx(FlaskConical, { className: "size-5 text-warning" });
11
12
  const textOf = (label, value) => typeof label === "string" || typeof label === "number" ? String(label) : value;
@@ -28,6 +29,7 @@ function DevMenu({
28
29
  active = false
29
30
  }) {
30
31
  const bar = useKitLabels("topBar", DEFAULT_TOP_BAR_LABELS);
32
+ const movedToday = useSyncExternalStore(subscribeToday, todayOverride, () => null);
31
33
  const words = useTopBarPartsLabels(labelsProp ? { dev: labelsProp } : void 0).dev;
32
34
  const [kept, setKept] = useState(() => enabled ? readSessionStored(storageKey) : null);
33
35
  const [wasEnabled, setWasEnabled] = useState(enabled);
@@ -112,7 +114,7 @@ function DevMenu({
112
114
  TopBarActionMenu,
113
115
  {
114
116
  icon: flask,
115
- iconBadge: active ? { label: words.overridesOn } : null,
117
+ iconBadge: active || movedToday !== null ? { label: words.overridesOn } : null,
116
118
  "aria-label": name,
117
119
  entries,
118
120
  scrollable: true,