@eifi1/ui-kit 0.53.0 → 0.55.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 (902) hide show
  1. package/README.md +96 -82
  2. package/dist/account/delete-account-setting.d.ts +3 -2
  3. package/dist/account/delete-account-setting.js.map +1 -1
  4. package/dist/admin/plan-change.js +2 -2
  5. package/dist/admin/plan-change.js.map +1 -1
  6. package/dist/admin/user-roster.d.ts +6 -0
  7. package/dist/admin/user-roster.js +4 -0
  8. package/dist/admin/user-roster.js.map +1 -1
  9. package/dist/auth/auth-errors.d.ts +36 -0
  10. package/dist/auth/auth-errors.js +20 -0
  11. package/dist/auth/auth-errors.js.map +1 -1
  12. package/dist/billing/billing-labels.d.ts +26 -0
  13. package/dist/billing/billing-labels.js +9 -0
  14. package/dist/billing/billing-labels.js.map +1 -1
  15. package/dist/billing/subscription-standing.d.ts +61 -0
  16. package/dist/billing/subscription-standing.js +51 -0
  17. package/dist/billing/subscription-standing.js.map +1 -0
  18. package/dist/billing/usage-meter.d.ts +52 -0
  19. package/dist/billing/usage-meter.js +52 -0
  20. package/dist/billing/usage-meter.js.map +1 -0
  21. package/dist/chart.d.ts +1 -0
  22. package/dist/chart.js +4 -0
  23. package/dist/chart.js.map +1 -1
  24. package/dist/components/alert-banner.js +2 -3
  25. package/dist/components/alert-banner.js.map +1 -1
  26. package/dist/components/amount-input.d.ts +2 -1
  27. package/dist/components/amount-input.js +3 -15
  28. package/dist/components/amount-input.js.map +1 -1
  29. package/dist/components/autocomplete.js +2 -2
  30. package/dist/components/autocomplete.js.map +1 -1
  31. package/dist/components/bulk-action-bar.js +2 -1
  32. package/dist/components/bulk-action-bar.js.map +1 -1
  33. package/dist/components/button.d.ts +35 -1
  34. package/dist/components/button.js +5 -9
  35. package/dist/components/button.js.map +1 -1
  36. package/dist/components/calendar-heatmap.js +6 -4
  37. package/dist/components/calendar-heatmap.js.map +1 -1
  38. package/dist/components/camera-button.d.ts +89 -0
  39. package/dist/components/camera-button.js +122 -0
  40. package/dist/components/camera-button.js.map +1 -0
  41. package/dist/components/camera-capture.d.ts +66 -0
  42. package/dist/components/camera-capture.js +190 -0
  43. package/dist/components/camera-capture.js.map +1 -0
  44. package/dist/components/camera-labels.d.ts +20 -0
  45. package/dist/components/camera-labels.js +15 -0
  46. package/dist/components/camera-labels.js.map +1 -0
  47. package/dist/components/chart-edge.d.ts +9 -0
  48. package/dist/components/chart-edge.js +14 -3
  49. package/dist/components/chart-edge.js.map +1 -1
  50. package/dist/components/chart-zoom-core.js +34 -29
  51. package/dist/components/chart-zoom-core.js.map +1 -1
  52. package/dist/components/checkbox-group.js +1 -1
  53. package/dist/components/checkbox-group.js.map +1 -1
  54. package/dist/components/combobox-core.js +3 -2
  55. package/dist/components/combobox-core.js.map +1 -1
  56. package/dist/components/combobox.js +2 -2
  57. package/dist/components/combobox.js.map +1 -1
  58. package/dist/components/consent-again-notice-labels.d.ts +25 -0
  59. package/dist/components/consent-again-notice-labels.js +15 -0
  60. package/dist/components/consent-again-notice-labels.js.map +1 -0
  61. package/dist/components/consent-again-notice.d.ts +85 -0
  62. package/dist/components/consent-again-notice.js +94 -0
  63. package/dist/components/consent-again-notice.js.map +1 -0
  64. package/dist/components/country-select.js +2 -7
  65. package/dist/components/country-select.js.map +1 -1
  66. package/dist/components/currency-option-list.d.ts +2 -1
  67. package/dist/components/currency-option-list.js +10 -3
  68. package/dist/components/currency-option-list.js.map +1 -1
  69. package/dist/components/currency-select.d.ts +3 -1
  70. package/dist/components/currency-select.js +2 -2
  71. package/dist/components/currency-select.js.map +1 -1
  72. package/dist/components/danger-confirm.d.ts +22 -1
  73. package/dist/components/danger-confirm.js +52 -30
  74. package/dist/components/danger-confirm.js.map +1 -1
  75. package/dist/components/data-table-column-settings.js +2 -2
  76. package/dist/components/data-table-column-settings.js.map +1 -1
  77. package/dist/components/data-table-filter-popover.d.ts +2 -1
  78. package/dist/components/data-table-filter-popover.js +3 -2
  79. package/dist/components/data-table-filter-popover.js.map +1 -1
  80. package/dist/components/data-table-filters.d.ts +33 -3
  81. package/dist/components/data-table-filters.js +6 -4
  82. package/dist/components/data-table-filters.js.map +1 -1
  83. package/dist/components/data-table-fit.js.map +1 -1
  84. package/dist/components/data-table-virtual.js +13 -3
  85. package/dist/components/data-table-virtual.js.map +1 -1
  86. package/dist/components/date-field.js +2 -2
  87. package/dist/components/date-field.js.map +1 -1
  88. package/dist/components/date-picker.js +2 -2
  89. package/dist/components/date-picker.js.map +1 -1
  90. package/dist/components/date-range-picker.js +2 -6
  91. package/dist/components/date-range-picker.js.map +1 -1
  92. package/dist/components/dialog-frame.d.ts +5 -1
  93. package/dist/components/dialog-frame.js +6 -2
  94. package/dist/components/dialog-frame.js.map +1 -1
  95. package/dist/components/dropdown.js +7 -3
  96. package/dist/components/dropdown.js.map +1 -1
  97. package/dist/components/entity-combobox.js +2 -2
  98. package/dist/components/entity-combobox.js.map +1 -1
  99. package/dist/components/field-parts.d.ts +108 -6
  100. package/dist/components/field-parts.js +59 -6
  101. package/dist/components/field-parts.js.map +1 -1
  102. package/dist/components/field-suggestion-labels.d.ts +2 -0
  103. package/dist/components/field-suggestion-labels.js +10 -0
  104. package/dist/components/field-suggestion-labels.js.map +1 -0
  105. package/dist/components/field.js +1 -1
  106. package/dist/components/field.js.map +1 -1
  107. package/dist/components/file-button.d.ts +1 -1
  108. package/dist/components/file-button.js.map +1 -1
  109. package/dist/components/floating-panel.d.ts +7 -6
  110. package/dist/components/floating-panel.js +3 -17
  111. package/dist/components/floating-panel.js.map +1 -1
  112. package/dist/components/form-actions.d.ts +3 -2
  113. package/dist/components/form-actions.js.map +1 -1
  114. package/dist/components/hover-menu.js +3 -2
  115. package/dist/components/hover-menu.js.map +1 -1
  116. package/dist/components/icon-button.d.ts +23 -5
  117. package/dist/components/icon-button.js +6 -8
  118. package/dist/components/icon-button.js.map +1 -1
  119. package/dist/components/inline-confirm.js +2 -1
  120. package/dist/components/inline-confirm.js.map +1 -1
  121. package/dist/components/inline-entity-combobox.js +2 -2
  122. package/dist/components/inline-entity-combobox.js.map +1 -1
  123. package/dist/components/input.js +2 -2
  124. package/dist/components/input.js.map +1 -1
  125. package/dist/components/jump-calendar.js +3 -3
  126. package/dist/components/jump-calendar.js.map +1 -1
  127. package/dist/components/legal.d.ts +13 -1
  128. package/dist/components/legal.js +12 -0
  129. package/dist/components/legal.js.map +1 -1
  130. package/dist/components/legended-series-chart.d.ts +80 -0
  131. package/dist/components/legended-series-chart.js +70 -0
  132. package/dist/components/legended-series-chart.js.map +1 -0
  133. package/dist/components/lightbox.js +2 -1
  134. package/dist/components/lightbox.js.map +1 -1
  135. package/dist/components/mini-calendar.js +16 -7
  136. package/dist/components/mini-calendar.js.map +1 -1
  137. package/dist/components/modal.d.ts +48 -0
  138. package/dist/components/modal.js +26 -6
  139. package/dist/components/modal.js.map +1 -1
  140. package/dist/components/month-picker.d.ts +1 -1
  141. package/dist/components/month-picker.js +6 -6
  142. package/dist/components/month-picker.js.map +1 -1
  143. package/dist/components/multi-entity-combobox.js +2 -2
  144. package/dist/components/multi-entity-combobox.js.map +1 -1
  145. package/dist/components/multi-select.js +2 -6
  146. package/dist/components/multi-select.js.map +1 -1
  147. package/dist/components/number-input.js +2 -2
  148. package/dist/components/number-input.js.map +1 -1
  149. package/dist/components/page-header-layout.d.ts +18 -0
  150. package/dist/components/page-header-layout.js +23 -0
  151. package/dist/components/page-header-layout.js.map +1 -0
  152. package/dist/components/page-header-skeleton.d.ts +41 -0
  153. package/dist/components/page-header-skeleton.js +52 -0
  154. package/dist/components/page-header-skeleton.js.map +1 -0
  155. package/dist/components/page-header.js +4 -17
  156. package/dist/components/page-header.js.map +1 -1
  157. package/dist/components/popover.js +7 -2
  158. package/dist/components/popover.js.map +1 -1
  159. package/dist/components/release-notes-labels.d.ts +16 -0
  160. package/dist/components/release-notes-labels.js +18 -0
  161. package/dist/components/release-notes-labels.js.map +1 -0
  162. package/dist/components/release-notes.d.ts +65 -0
  163. package/dist/components/release-notes.js +65 -0
  164. package/dist/components/release-notes.js.map +1 -0
  165. package/dist/components/select.js +2 -2
  166. package/dist/components/select.js.map +1 -1
  167. package/dist/components/series-chart-labels.d.ts +9 -0
  168. package/dist/components/series-chart-labels.js +3 -1
  169. package/dist/components/series-chart-labels.js.map +1 -1
  170. package/dist/components/series-chart.d.ts +5 -0
  171. package/dist/components/series-chart.js +89 -36
  172. package/dist/components/series-chart.js.map +1 -1
  173. package/dist/components/stat-tile.d.ts +21 -2
  174. package/dist/components/stat-tile.js +4 -2
  175. package/dist/components/stat-tile.js.map +1 -1
  176. package/dist/components/toggle-group.js +3 -2
  177. package/dist/components/toggle-group.js.map +1 -1
  178. package/dist/components/treemap-layout.js.map +1 -1
  179. package/dist/components/treemap.d.ts +17 -15
  180. package/dist/components/treemap.js +167 -85
  181. package/dist/components/treemap.js.map +1 -1
  182. package/dist/currencies.d.ts +16 -2
  183. package/dist/currencies.js +2 -1
  184. package/dist/currencies.js.map +1 -1
  185. package/dist/eslint/index.js +1 -1
  186. package/dist/eslint/role-utilities.d.ts +2 -2
  187. package/dist/eslint/role-utilities.js.map +1 -1
  188. package/dist/feedback/feedback-context-labels.js +2 -1
  189. package/dist/feedback/feedback-context-labels.js.map +1 -1
  190. package/dist/feedback/feedback-context.d.ts +19 -3
  191. package/dist/feedback/feedback-context.js +12 -1
  192. package/dist/feedback/feedback-context.js.map +1 -1
  193. package/dist/feedback/feedback-diagnostics.d.ts +17 -0
  194. package/dist/feedback/feedback-diagnostics.js +27 -0
  195. package/dist/feedback/feedback-diagnostics.js.map +1 -0
  196. package/dist/feedback/feedback-dialog.d.ts +10 -0
  197. package/dist/feedback/feedback-dialog.js +6 -4
  198. package/dist/feedback/feedback-dialog.js.map +1 -1
  199. package/dist/feedback/feedback-inbox-page.d.ts +260 -0
  200. package/dist/feedback/feedback-inbox-page.js +207 -0
  201. package/dist/feedback/feedback-inbox-page.js.map +1 -0
  202. package/dist/feedback/feedback-record.d.ts +5 -0
  203. package/dist/feedback/feedback-record.js.map +1 -1
  204. package/dist/feedback/feedback-row-detail-labels.js +1 -0
  205. package/dist/feedback/feedback-row-detail-labels.js.map +1 -1
  206. package/dist/feedback/feedback-row-detail.d.ts +3 -0
  207. package/dist/feedback/feedback-row-detail.js +3 -0
  208. package/dist/feedback/feedback-row-detail.js.map +1 -1
  209. package/dist/feedback/feedback-submit-dialog.d.ts +5 -1
  210. package/dist/feedback/feedback-submit-dialog.js +15 -3
  211. package/dist/feedback/feedback-submit-dialog.js.map +1 -1
  212. package/dist/feedback/feedback-submit.d.ts +30 -2
  213. package/dist/feedback/feedback-submit.js +5 -2
  214. package/dist/feedback/feedback-submit.js.map +1 -1
  215. package/dist/feedback/feedback-vocabulary.js +2 -2
  216. package/dist/feedback/feedback-vocabulary.js.map +1 -1
  217. package/dist/feedback.d.ts +1 -0
  218. package/dist/feedback.js +6 -0
  219. package/dist/feedback.js.map +1 -1
  220. package/dist/hooks/use-debounce.d.ts +32 -5
  221. package/dist/hooks/use-debounce.js +6 -5
  222. package/dist/hooks/use-debounce.js.map +1 -1
  223. package/dist/hooks/use-file-picker.d.ts +3 -1
  224. package/dist/hooks/use-file-picker.js.map +1 -1
  225. package/dist/hooks/use-focus-trap.d.ts +19 -3
  226. package/dist/hooks/use-focus-trap.js +15 -5
  227. package/dist/hooks/use-focus-trap.js.map +1 -1
  228. package/dist/hooks/use-has-camera.d.ts +36 -0
  229. package/dist/hooks/use-has-camera.js +53 -0
  230. package/dist/hooks/use-has-camera.js.map +1 -0
  231. package/dist/hooks/use-hotkey.js +2 -1
  232. package/dist/hooks/use-hotkey.js.map +1 -1
  233. package/dist/hooks/use-overlay-history.d.ts +6 -1
  234. package/dist/hooks/use-overlay-history.js +10 -2
  235. package/dist/hooks/use-overlay-history.js.map +1 -1
  236. package/dist/i18n/defaults.js +11 -1
  237. package/dist/i18n/defaults.js.map +1 -1
  238. package/dist/i18n/german.js +78 -4
  239. package/dist/i18n/german.js.map +1 -1
  240. package/dist/i18n/kit-labels.d.ts +20 -0
  241. package/dist/i18n/kit-labels.js.map +1 -1
  242. package/dist/i18n/locales/en.js +95 -5
  243. package/dist/i18n/locales/en.js.map +3 -3
  244. package/dist/i18n/locales/es.js +74 -4
  245. package/dist/i18n/locales/es.js.map +1 -1
  246. package/dist/i18n/locales/fr.js +75 -3
  247. package/dist/i18n/locales/fr.js.map +1 -1
  248. package/dist/i18n/locales/hu.js +77 -4
  249. package/dist/i18n/locales/hu.js.map +1 -1
  250. package/dist/i18n/locales/it.js +77 -4
  251. package/dist/i18n/locales/it.js.map +1 -1
  252. package/dist/i18n/locales/zh.js +74 -4
  253. package/dist/i18n/locales/zh.js.map +1 -1
  254. package/dist/i18n/review.js +22 -1
  255. package/dist/i18n/review.js.map +1 -1
  256. package/dist/index.d.ts +27 -8
  257. package/dist/index.js +41 -2
  258. package/dist/index.js.map +1 -1
  259. package/dist/landing/landing-labels.d.ts +8 -0
  260. package/dist/landing/landing-labels.js +2 -1
  261. package/dist/landing/landing-labels.js.map +1 -1
  262. package/dist/lib/changelog.d.ts +130 -0
  263. package/dist/lib/changelog.js +137 -0
  264. package/dist/lib/changelog.js.map +1 -0
  265. package/dist/lib/clipboard-minus.js +2 -2
  266. package/dist/lib/clipboard-minus.js.map +1 -1
  267. package/dist/lib/dates.d.ts +36 -4
  268. package/dist/lib/dates.js +49 -13
  269. package/dist/lib/dates.js.map +1 -1
  270. package/dist/lib/editable-content.d.ts +33 -0
  271. package/dist/lib/editable-content.js +15 -0
  272. package/dist/lib/editable-content.js.map +1 -0
  273. package/dist/lib/focus-left.d.ts +47 -1
  274. package/dist/lib/focus-left.js +11 -2
  275. package/dist/lib/focus-left.js.map +1 -1
  276. package/dist/lib/format.d.ts +37 -2
  277. package/dist/lib/format.js +25 -1
  278. package/dist/lib/format.js.map +1 -1
  279. package/dist/lib/intl-cache.d.ts +4 -2
  280. package/dist/lib/intl-cache.js.map +1 -1
  281. package/dist/lib/server-wake.d.ts +49 -9
  282. package/dist/lib/server-wake.js +25 -14
  283. package/dist/lib/server-wake.js.map +1 -1
  284. package/dist/lib/session-refresh.d.ts +53 -0
  285. package/dist/lib/session-refresh.js +27 -1
  286. package/dist/lib/session-refresh.js.map +1 -1
  287. package/dist/lib/translation-review.d.ts +26 -0
  288. package/dist/lib/translation-review.js +14 -0
  289. package/dist/lib/translation-review.js.map +1 -1
  290. package/dist/rhf/fields.js +3 -3
  291. package/dist/rhf/fields.js.map +1 -1
  292. package/dist/shell/app-shell.d.ts +25 -1
  293. package/dist/shell/app-shell.js +3 -1
  294. package/dist/shell/app-shell.js.map +1 -1
  295. package/dist/shell/dev-menu.d.ts +3 -0
  296. package/dist/shell/dev-menu.js +4 -2
  297. package/dist/shell/dev-menu.js.map +1 -1
  298. package/dist/shell/held-changes-banner-labels.d.ts +23 -0
  299. package/dist/shell/held-changes-banner-labels.js +14 -0
  300. package/dist/shell/held-changes-banner-labels.js.map +1 -0
  301. package/dist/shell/held-changes-banner.d.ts +75 -0
  302. package/dist/shell/held-changes-banner.js +106 -0
  303. package/dist/shell/held-changes-banner.js.map +1 -0
  304. package/dist/shell/sync-status-indicator.d.ts +27 -12
  305. package/dist/shell/sync-status-indicator.js +13 -4
  306. package/dist/shell/sync-status-indicator.js.map +1 -1
  307. package/dist/shell/top-bar-parts-labels.d.ts +5 -0
  308. package/dist/shell/top-bar-parts-labels.js +3 -1
  309. package/dist/shell/top-bar-parts-labels.js.map +1 -1
  310. package/dist/shell.d.ts +2 -0
  311. package/dist/shell.js +3 -0
  312. package/dist/shell.js.map +1 -1
  313. package/dist/sync/engine.d.ts +11 -2
  314. package/dist/sync/engine.js +13 -5
  315. package/dist/sync/engine.js.map +1 -1
  316. package/dist/sync/hooks.d.ts +3 -2
  317. package/dist/sync/hooks.js +4 -2
  318. package/dist/sync/hooks.js.map +1 -1
  319. package/dist/testing/css-variables.generated.d.ts +2 -2
  320. package/dist/testing/css-variables.generated.js +1 -1
  321. package/dist/testing/css-variables.generated.js.map +1 -1
  322. package/dist/theme/chart-palette.d.ts +18 -0
  323. package/dist/theme/chart-palette.js +17 -1
  324. package/dist/theme/chart-palette.js.map +1 -1
  325. package/dist/theme/contrast-tokens.d.ts +3 -3
  326. package/dist/theme/contrast-tokens.js.map +1 -1
  327. package/dist/theme/contrast.d.ts +4 -4
  328. package/dist/theme/contrast.js.map +1 -1
  329. package/dist/tour/tour-overlay.js +2 -1
  330. package/dist/tour/tour-overlay.js.map +1 -1
  331. package/package.json +5 -9
  332. package/tokens.css +19 -54
  333. package/src/account/account-parts.ts +0 -47
  334. package/src/account/account-settings-labels.ts +0 -240
  335. package/src/account/account-settings.tsx +0 -698
  336. package/src/account/data-export-setting-labels.ts +0 -20
  337. package/src/account/data-export-setting.tsx +0 -200
  338. package/src/account/delete-account-setting-labels.ts +0 -33
  339. package/src/account/delete-account-setting.tsx +0 -341
  340. package/src/account/email-change-setting-labels.ts +0 -31
  341. package/src/account/email-change-setting.tsx +0 -443
  342. package/src/account/passkeys-setting.tsx +0 -445
  343. package/src/account/sessions-setting-labels.ts +0 -24
  344. package/src/account/sessions-setting.tsx +0 -283
  345. package/src/admin/admin-action-confirm-labels.ts +0 -19
  346. package/src/admin/admin-action-confirm.tsx +0 -509
  347. package/src/admin/admin-action-log-labels.ts +0 -83
  348. package/src/admin/admin-action-log.tsx +0 -464
  349. package/src/admin/admin-area-labels.ts +0 -114
  350. package/src/admin/admin-forbidden.tsx +0 -75
  351. package/src/admin/admin-overview.tsx +0 -258
  352. package/src/admin/admin-parts.ts +0 -68
  353. package/src/admin/admin-sections.tsx +0 -208
  354. package/src/admin/admin-tool-links.tsx +0 -90
  355. package/src/admin/invitations-panel-labels.ts +0 -31
  356. package/src/admin/invitations-panel.tsx +0 -516
  357. package/src/admin/mail-test-card-labels.ts +0 -19
  358. package/src/admin/mail-test-card.tsx +0 -189
  359. package/src/admin/plan-change-labels.ts +0 -5
  360. package/src/admin/plan-change.tsx +0 -474
  361. package/src/admin/reviewer-scope-editor-labels.ts +0 -16
  362. package/src/admin/reviewer-scope-editor.tsx +0 -224
  363. package/src/admin/role-select-labels.ts +0 -16
  364. package/src/admin/role-select.tsx +0 -282
  365. package/src/admin/transfer-ownership-dialog-labels.ts +0 -20
  366. package/src/admin/transfer-ownership-dialog.tsx +0 -162
  367. package/src/admin/user-roster-labels.ts +0 -17
  368. package/src/admin/user-roster.tsx +0 -559
  369. package/src/auth/accept-invitation-labels.ts +0 -21
  370. package/src/auth/accept-invitation.tsx +0 -210
  371. package/src/auth/auth-errors-labels.ts +0 -23
  372. package/src/auth/auth-errors.ts +0 -370
  373. package/src/auth/complete-name-dialog-labels.ts +0 -16
  374. package/src/auth/complete-name-dialog.tsx +0 -253
  375. package/src/auth/email-tag.ts +0 -75
  376. package/src/auth/forgot-password-form-labels.ts +0 -20
  377. package/src/auth/forgot-password-form.tsx +0 -221
  378. package/src/auth/form-rules.ts +0 -40
  379. package/src/auth/new-password-fields.tsx +0 -85
  380. package/src/auth/not-found-page-labels.ts +0 -12
  381. package/src/auth/not-found-page.tsx +0 -95
  382. package/src/auth/register-form-labels.ts +0 -31
  383. package/src/auth/register-form.tsx +0 -456
  384. package/src/auth/reset-password-form-labels.ts +0 -27
  385. package/src/auth/reset-password-form.tsx +0 -341
  386. package/src/auth/sign-in-form-labels.ts +0 -44
  387. package/src/auth/sign-in-form.tsx +0 -858
  388. package/src/auth/status-parts.tsx +0 -132
  389. package/src/auth/verify-email-labels.ts +0 -26
  390. package/src/auth/verify-email.tsx +0 -445
  391. package/src/billing/billing-banner.tsx +0 -258
  392. package/src/billing/billing-labels.ts +0 -381
  393. package/src/billing/billing-lock.ts +0 -108
  394. package/src/billing/billing-overview.ts +0 -157
  395. package/src/billing/billing-standing.ts +0 -80
  396. package/src/billing/cancel-request.ts +0 -97
  397. package/src/billing/cancel-subscription.tsx +0 -98
  398. package/src/billing/checkout-processing.ts +0 -394
  399. package/src/billing/checkout-return.ts +0 -90
  400. package/src/billing/pay-page.ts +0 -330
  401. package/src/billing/plan-card.tsx +0 -562
  402. package/src/billing/plan-change-labels.ts +0 -66
  403. package/src/billing/plan-limit-notice.tsx +0 -148
  404. package/src/billing/plan-limit-toast.tsx +0 -90
  405. package/src/billing/plan-limit.ts +0 -52
  406. package/src/billing/plan-price.ts +0 -98
  407. package/src/billing/plan-switch.tsx +0 -216
  408. package/src/billing/provider-page.ts +0 -84
  409. package/src/billing/subscription-actions.tsx +0 -247
  410. package/src/billing/subscription-status-chip.tsx +0 -95
  411. package/src/chart.ts +0 -103
  412. package/src/components/account-chips-labels.ts +0 -16
  413. package/src/components/account-chips.tsx +0 -474
  414. package/src/components/alert-banner.tsx +0 -670
  415. package/src/components/amount-input.tsx +0 -815
  416. package/src/components/appearance-labels.ts +0 -63
  417. package/src/components/authed-image-labels.ts +0 -11
  418. package/src/components/authed-image.tsx +0 -209
  419. package/src/components/autocomplete.tsx +0 -645
  420. package/src/components/breadcrumbs-labels.ts +0 -10
  421. package/src/components/breadcrumbs.tsx +0 -205
  422. package/src/components/bulk-action-bar-labels.ts +0 -11
  423. package/src/components/bulk-action-bar.tsx +0 -443
  424. package/src/components/button-group.tsx +0 -223
  425. package/src/components/button-look.ts +0 -256
  426. package/src/components/button.tsx +0 -339
  427. package/src/components/calculator.tsx +0 -341
  428. package/src/components/calendar-heatmap-labels.ts +0 -15
  429. package/src/components/calendar-heatmap.tsx +0 -594
  430. package/src/components/card.tsx +0 -377
  431. package/src/components/chart-edge.ts +0 -106
  432. package/src/components/chart-figure.tsx +0 -35
  433. package/src/components/chart-height.ts +0 -30
  434. package/src/components/chart-zoom-core.tsx +0 -627
  435. package/src/components/chart-zoom.tsx +0 -22
  436. package/src/components/chart.tsx +0 -554
  437. package/src/components/checkbox-group.tsx +0 -247
  438. package/src/components/checkbox.tsx +0 -346
  439. package/src/components/chip-input.tsx +0 -370
  440. package/src/components/chip-labels.ts +0 -13
  441. package/src/components/chip.tsx +0 -843
  442. package/src/components/choice-card.tsx +0 -544
  443. package/src/components/column-mapper-labels.ts +0 -38
  444. package/src/components/column-mapper.tsx +0 -655
  445. package/src/components/combobox-core.tsx +0 -1321
  446. package/src/components/combobox-suggestions.tsx +0 -131
  447. package/src/components/combobox.tsx +0 -716
  448. package/src/components/confirm-context.ts +0 -7
  449. package/src/components/confirm-dialog-labels.ts +0 -13
  450. package/src/components/confirm-dialog.tsx +0 -341
  451. package/src/components/copy-button-labels.ts +0 -13
  452. package/src/components/copy-button.tsx +0 -192
  453. package/src/components/country-select-labels.ts +0 -11
  454. package/src/components/country-select.tsx +0 -539
  455. package/src/components/currency-option-list.tsx +0 -180
  456. package/src/components/currency-select.tsx +0 -341
  457. package/src/components/danger-confirm-labels.ts +0 -20
  458. package/src/components/danger-confirm.tsx +0 -934
  459. package/src/components/data-table-cells.tsx +0 -118
  460. package/src/components/data-table-column-settings.tsx +0 -198
  461. package/src/components/data-table-filter-popover.tsx +0 -281
  462. package/src/components/data-table-filters.ts +0 -287
  463. package/src/components/data-table-fit.ts +0 -301
  464. package/src/components/data-table-groups.tsx +0 -288
  465. package/src/components/data-table-head.tsx +0 -280
  466. package/src/components/data-table-labels.ts +0 -198
  467. package/src/components/data-table-leading-row.tsx +0 -58
  468. package/src/components/data-table-mobile.tsx +0 -1117
  469. package/src/components/data-table-pagination.tsx +0 -202
  470. package/src/components/data-table-resize.ts +0 -188
  471. package/src/components/data-table-row-actions.tsx +0 -302
  472. package/src/components/data-table-row.tsx +0 -496
  473. package/src/components/data-table-selection.ts +0 -71
  474. package/src/components/data-table-shared.tsx +0 -287
  475. package/src/components/data-table-sort.ts +0 -163
  476. package/src/components/data-table-virtual.ts +0 -576
  477. package/src/components/data-table.tsx +0 -2598
  478. package/src/components/date-field.tsx +0 -684
  479. package/src/components/date-format-setting.tsx +0 -64
  480. package/src/components/date-picker.tsx +0 -404
  481. package/src/components/date-range-picker.tsx +0 -518
  482. package/src/components/description-list-labels.ts +0 -9
  483. package/src/components/description-list.tsx +0 -386
  484. package/src/components/dialog-frame-labels.ts +0 -7
  485. package/src/components/dialog-frame.tsx +0 -276
  486. package/src/components/disclosure.tsx +0 -476
  487. package/src/components/dropdown.tsx +0 -461
  488. package/src/components/empty-state.tsx +0 -136
  489. package/src/components/entity-combobox.tsx +0 -422
  490. package/src/components/error-boundary-labels.ts +0 -20
  491. package/src/components/error-boundary.tsx +0 -675
  492. package/src/components/facing-pair.ts +0 -93
  493. package/src/components/field-base-labels.ts +0 -20
  494. package/src/components/field-base.tsx +0 -656
  495. package/src/components/field-parts.tsx +0 -825
  496. package/src/components/field-strip.tsx +0 -129
  497. package/src/components/field.tsx +0 -206
  498. package/src/components/file-button.tsx +0 -295
  499. package/src/components/file-dropzone.tsx +0 -559
  500. package/src/components/floating-panel-labels.ts +0 -10
  501. package/src/components/floating-panel.tsx +0 -828
  502. package/src/components/focus-ring.ts +0 -16
  503. package/src/components/form-actions-labels.ts +0 -11
  504. package/src/components/form-actions.tsx +0 -578
  505. package/src/components/full-bleed-dialog.tsx +0 -294
  506. package/src/components/grouped-picker.tsx +0 -184
  507. package/src/components/help-popover.tsx +0 -117
  508. package/src/components/hover-menu.tsx +0 -343
  509. package/src/components/iban-input-labels.ts +0 -14
  510. package/src/components/iban-input.tsx +0 -236
  511. package/src/components/icon-button.tsx +0 -959
  512. package/src/components/icon-picker-labels.ts +0 -13
  513. package/src/components/icon-picker.tsx +0 -232
  514. package/src/components/image-grid-labels.ts +0 -11
  515. package/src/components/image-grid.tsx +0 -202
  516. package/src/components/inline-confirm.tsx +0 -116
  517. package/src/components/inline-edit-field-labels.ts +0 -11
  518. package/src/components/inline-edit-field.tsx +0 -552
  519. package/src/components/inline-entity-combobox.tsx +0 -849
  520. package/src/components/input.tsx +0 -394
  521. package/src/components/jump-calendar.tsx +0 -265
  522. package/src/components/language-select.tsx +0 -93
  523. package/src/components/legal-labels.ts +0 -105
  524. package/src/components/legal-page.tsx +0 -711
  525. package/src/components/legal.tsx +0 -668
  526. package/src/components/lightbox-labels.ts +0 -18
  527. package/src/components/lightbox.tsx +0 -399
  528. package/src/components/line-items-labels.ts +0 -14
  529. package/src/components/line-items.tsx +0 -602
  530. package/src/components/list-labels.ts +0 -12
  531. package/src/components/list.tsx +0 -870
  532. package/src/components/loading-state.tsx +0 -78
  533. package/src/components/measured-grid-labels.ts +0 -25
  534. package/src/components/measured-grid.tsx +0 -837
  535. package/src/components/menu-item.tsx +0 -241
  536. package/src/components/mini-calendar-labels.ts +0 -17
  537. package/src/components/mini-calendar.tsx +0 -789
  538. package/src/components/modal.tsx +0 -505
  539. package/src/components/money-draft.ts +0 -83
  540. package/src/components/money-field.tsx +0 -76
  541. package/src/components/month-grid.tsx +0 -229
  542. package/src/components/month-picker-labels.ts +0 -22
  543. package/src/components/month-picker.tsx +0 -1087
  544. package/src/components/multi-entity-combobox.tsx +0 -369
  545. package/src/components/multi-select.tsx +0 -376
  546. package/src/components/nav-pills.tsx +0 -198
  547. package/src/components/number-field.tsx +0 -327
  548. package/src/components/number-input.tsx +0 -558
  549. package/src/components/numeric-field.ts +0 -169
  550. package/src/components/numpad-sheet.tsx +0 -285
  551. package/src/components/one-time-code-input.tsx +0 -270
  552. package/src/components/page-contents-labels.ts +0 -9
  553. package/src/components/page-contents.tsx +0 -282
  554. package/src/components/page-header-context.ts +0 -8
  555. package/src/components/page-header.tsx +0 -298
  556. package/src/components/password-strength-labels.ts +0 -22
  557. package/src/components/password-strength.tsx +0 -241
  558. package/src/components/phone-input-labels.ts +0 -10
  559. package/src/components/phone-input.tsx +0 -282
  560. package/src/components/picker-sheet.tsx +0 -330
  561. package/src/components/pie-chart-labels.ts +0 -40
  562. package/src/components/pie-chart.tsx +0 -480
  563. package/src/components/popover-labels.ts +0 -14
  564. package/src/components/popover.tsx +0 -268
  565. package/src/components/progress-bar-labels.ts +0 -10
  566. package/src/components/progress-bar.tsx +0 -479
  567. package/src/components/qr-code.tsx +0 -76
  568. package/src/components/reauth-dialog-labels.ts +0 -13
  569. package/src/components/reauth-dialog.tsx +0 -265
  570. package/src/components/row-actions-labels.ts +0 -12
  571. package/src/components/row-actions.tsx +0 -795
  572. package/src/components/scroll-area.tsx +0 -123
  573. package/src/components/search-field.tsx +0 -192
  574. package/src/components/select.tsx +0 -294
  575. package/src/components/separator.tsx +0 -33
  576. package/src/components/series-chart-axes.ts +0 -342
  577. package/src/components/series-chart-budget.ts +0 -150
  578. package/src/components/series-chart-labels.ts +0 -33
  579. package/src/components/series-chart-thin.ts +0 -180
  580. package/src/components/series-chart-ticks.ts +0 -194
  581. package/src/components/series-chart.tsx +0 -1906
  582. package/src/components/server-wake-labels.ts +0 -11
  583. package/src/components/server-wake.tsx +0 -129
  584. package/src/components/settings-fields.tsx +0 -237
  585. package/src/components/share-card-labels.ts +0 -30
  586. package/src/components/share-card.tsx +0 -675
  587. package/src/components/signature-pad-labels.ts +0 -24
  588. package/src/components/signature-pad.tsx +0 -747
  589. package/src/components/signed-amount-labels.ts +0 -10
  590. package/src/components/signed-amount.tsx +0 -336
  591. package/src/components/skeleton.tsx +0 -80
  592. package/src/components/slider.tsx +0 -338
  593. package/src/components/sparkline-labels.ts +0 -14
  594. package/src/components/sparkline.tsx +0 -322
  595. package/src/components/spinner.tsx +0 -81
  596. package/src/components/stat-tile-labels.ts +0 -15
  597. package/src/components/stat-tile.tsx +0 -725
  598. package/src/components/status-dot.tsx +0 -170
  599. package/src/components/swatch-picker-labels.ts +0 -10
  600. package/src/components/swatch-picker.tsx +0 -283
  601. package/src/components/swipeable-row.tsx +0 -386
  602. package/src/components/switch.tsx +0 -273
  603. package/src/components/table-skeleton.tsx +0 -136
  604. package/src/components/table.tsx +0 -647
  605. package/src/components/tabs-labels.ts +0 -13
  606. package/src/components/tabs.tsx +0 -693
  607. package/src/components/text-link.tsx +0 -359
  608. package/src/components/text.tsx +0 -150
  609. package/src/components/textarea.tsx +0 -330
  610. package/src/components/tile-radio.tsx +0 -332
  611. package/src/components/time-input.tsx +0 -121
  612. package/src/components/toast-labels.ts +0 -12
  613. package/src/components/toast.tsx +0 -519
  614. package/src/components/toggle-group.tsx +0 -752
  615. package/src/components/toggle-legend.tsx +0 -394
  616. package/src/components/tooltip.tsx +0 -1149
  617. package/src/components/translation-review-editor.tsx +0 -290
  618. package/src/components/translation-review-labels.ts +0 -181
  619. package/src/components/translation-review-parts.tsx +0 -272
  620. package/src/components/translation-review.tsx +0 -1240
  621. package/src/components/tree-view.tsx +0 -589
  622. package/src/components/treemap-labels.ts +0 -47
  623. package/src/components/treemap-layout.ts +0 -210
  624. package/src/components/treemap.tsx +0 -1184
  625. package/src/components/trigger-aria.ts +0 -44
  626. package/src/components/use-anchor-dir.ts +0 -20
  627. package/src/components/use-mobile-reveal.ts +0 -62
  628. package/src/components/use-table-state.ts +0 -753
  629. package/src/components/user-avatar.tsx +0 -116
  630. package/src/components/wizard-stepper.tsx +0 -42
  631. package/src/components/write-lock-labels.ts +0 -10
  632. package/src/components/write-lock.tsx +0 -253
  633. package/src/currencies.ts +0 -70
  634. package/src/data-table.ts +0 -42
  635. package/src/demo/demo-banner.tsx +0 -153
  636. package/src/demo/demo-countdown.ts +0 -136
  637. package/src/demo/demo-ended.tsx +0 -90
  638. package/src/demo/demo-labels.ts +0 -78
  639. package/src/demo/demo-session.ts +0 -32
  640. package/src/demo/demo-start.tsx +0 -156
  641. package/src/eslint/index.ts +0 -161
  642. package/src/eslint/role-utilities.generated.ts +0 -146
  643. package/src/eslint/role-utilities.ts +0 -233
  644. package/src/feedback/feedback-attachment-download.tsx +0 -77
  645. package/src/feedback/feedback-attachment-labels.ts +0 -37
  646. package/src/feedback/feedback-attachment.tsx +0 -1239
  647. package/src/feedback/feedback-capture.ts +0 -287
  648. package/src/feedback/feedback-comment-thread.tsx +0 -353
  649. package/src/feedback/feedback-context-labels.ts +0 -10
  650. package/src/feedback/feedback-context.tsx +0 -213
  651. package/src/feedback/feedback-crash.ts +0 -547
  652. package/src/feedback/feedback-dialog-labels.ts +0 -29
  653. package/src/feedback/feedback-dialog.tsx +0 -440
  654. package/src/feedback/feedback-entry-file.tsx +0 -150
  655. package/src/feedback/feedback-inbox.tsx +0 -552
  656. package/src/feedback/feedback-labels.ts +0 -144
  657. package/src/feedback/feedback-menu-labels.ts +0 -12
  658. package/src/feedback/feedback-menu.tsx +0 -177
  659. package/src/feedback/feedback-mutation.ts +0 -20
  660. package/src/feedback/feedback-page-link.ts +0 -90
  661. package/src/feedback/feedback-public-labels.ts +0 -81
  662. package/src/feedback/feedback-public-list.tsx +0 -524
  663. package/src/feedback/feedback-public-switch.tsx +0 -102
  664. package/src/feedback/feedback-public-types.ts +0 -101
  665. package/src/feedback/feedback-record.ts +0 -423
  666. package/src/feedback/feedback-replies-context.ts +0 -9
  667. package/src/feedback/feedback-replies.tsx +0 -343
  668. package/src/feedback/feedback-rework-entry-chip.tsx +0 -18
  669. package/src/feedback/feedback-row-detail-labels.ts +0 -30
  670. package/src/feedback/feedback-row-detail.tsx +0 -858
  671. package/src/feedback/feedback-status-undo.ts +0 -109
  672. package/src/feedback/feedback-submit-dialog.tsx +0 -118
  673. package/src/feedback/feedback-submit.tsx +0 -237
  674. package/src/feedback/feedback-swipe.tsx +0 -192
  675. package/src/feedback/feedback-table-labels.ts +0 -27
  676. package/src/feedback/feedback-table.tsx +0 -912
  677. package/src/feedback/feedback-thread-labels.ts +0 -22
  678. package/src/feedback/feedback-thread-parts-labels.ts +0 -41
  679. package/src/feedback/feedback-thread.tsx +0 -905
  680. package/src/feedback/feedback-vocabulary.ts +0 -263
  681. package/src/feedback/feedback-vote-button.tsx +0 -124
  682. package/src/feedback.ts +0 -116
  683. package/src/hooks/use-anchored-panel.ts +0 -396
  684. package/src/hooks/use-anchored-rect.ts +0 -77
  685. package/src/hooks/use-announce.ts +0 -85
  686. package/src/hooks/use-authed-src.ts +0 -167
  687. package/src/hooks/use-body-scroll-lock.ts +0 -119
  688. package/src/hooks/use-breakpoint.ts +0 -133
  689. package/src/hooks/use-close-transition.ts +0 -107
  690. package/src/hooks/use-copy-to-clipboard.ts +0 -122
  691. package/src/hooks/use-debounce.ts +0 -114
  692. package/src/hooks/use-dismiss.ts +0 -371
  693. package/src/hooks/use-document-title.ts +0 -33
  694. package/src/hooks/use-file-drop.ts +0 -121
  695. package/src/hooks/use-file-picker-labels.ts +0 -28
  696. package/src/hooks/use-file-picker.tsx +0 -359
  697. package/src/hooks/use-focus-trap.ts +0 -199
  698. package/src/hooks/use-hotkey.ts +0 -189
  699. package/src/hooks/use-large-text.ts +0 -41
  700. package/src/hooks/use-long-press.ts +0 -140
  701. package/src/hooks/use-media-query.ts +0 -39
  702. package/src/hooks/use-mounted.ts +0 -39
  703. package/src/hooks/use-noindex.ts +0 -37
  704. package/src/hooks/use-overlay-history.ts +0 -714
  705. package/src/hooks/use-row-swipe.ts +0 -207
  706. package/src/hooks/use-search-param-state.ts +0 -434
  707. package/src/hooks/use-windowed-rows.ts +0 -225
  708. package/src/i18n/defaults.ts +0 -267
  709. package/src/i18n/german.ts +0 -2057
  710. package/src/i18n/kit-labels.tsx +0 -1003
  711. package/src/i18n/languages.ts +0 -349
  712. package/src/i18n/locales/de-CH.ts +0 -24
  713. package/src/i18n/locales/en.ts +0 -267
  714. package/src/i18n/locales/es.ts +0 -1997
  715. package/src/i18n/locales/fr.ts +0 -2035
  716. package/src/i18n/locales/hu.ts +0 -2002
  717. package/src/i18n/locales/it.ts +0 -2012
  718. package/src/i18n/locales/zh.ts +0 -1910
  719. package/src/i18n/plurals.ts +0 -86
  720. package/src/i18n/review.ts +0 -475
  721. package/src/i18n/shared-labels.ts +0 -138
  722. package/src/i18n/swiss.ts +0 -29
  723. package/src/index.ts +0 -1179
  724. package/src/landing/access.ts +0 -93
  725. package/src/landing/landing-actions.tsx +0 -97
  726. package/src/landing/landing-labels.ts +0 -59
  727. package/src/landing/landing-sections.tsx +0 -341
  728. package/src/landing/page-seo.ts +0 -261
  729. package/src/landing/public-header.tsx +0 -121
  730. package/src/landing/public-page.tsx +0 -106
  731. package/src/landing/routing.tsx +0 -225
  732. package/src/lib/broadcast.ts +0 -52
  733. package/src/lib/calc.ts +0 -323
  734. package/src/lib/chip-edge-snap.ts +0 -212
  735. package/src/lib/clipboard-minus.ts +0 -107
  736. package/src/lib/clipping.ts +0 -34
  737. package/src/lib/cn.ts +0 -28
  738. package/src/lib/column-mapping.ts +0 -234
  739. package/src/lib/countries.ts +0 -91
  740. package/src/lib/data-attributes.ts +0 -14
  741. package/src/lib/date-format.ts +0 -227
  742. package/src/lib/dates.ts +0 -266
  743. package/src/lib/day-format.ts +0 -96
  744. package/src/lib/decimal-marks.ts +0 -108
  745. package/src/lib/describe-failure.ts +0 -18
  746. package/src/lib/device-settings.ts +0 -147
  747. package/src/lib/direction.ts +0 -74
  748. package/src/lib/document-navigation.ts +0 -17
  749. package/src/lib/document-title.ts +0 -41
  750. package/src/lib/download.ts +0 -172
  751. package/src/lib/float-clearance.ts +0 -70
  752. package/src/lib/floating-stack.ts +0 -70
  753. package/src/lib/focus-left.ts +0 -156
  754. package/src/lib/format.ts +0 -522
  755. package/src/lib/http-status.ts +0 -38
  756. package/src/lib/iban.ts +0 -251
  757. package/src/lib/ime.ts +0 -24
  758. package/src/lib/intl-cache.ts +0 -25
  759. package/src/lib/iso-day.ts +0 -13
  760. package/src/lib/lazy-with-fallback.ts +0 -82
  761. package/src/lib/logger.ts +0 -69
  762. package/src/lib/minus.ts +0 -50
  763. package/src/lib/path-pattern.ts +0 -55
  764. package/src/lib/person-name.ts +0 -155
  765. package/src/lib/phone.ts +0 -208
  766. package/src/lib/plain-text.ts +0 -22
  767. package/src/lib/presence.ts +0 -18
  768. package/src/lib/qr-encode.ts +0 -444
  769. package/src/lib/quiet-focus.ts +0 -32
  770. package/src/lib/reduced-motion.ts +0 -22
  771. package/src/lib/refs.ts +0 -22
  772. package/src/lib/round.ts +0 -43
  773. package/src/lib/safe-storage.ts +0 -119
  774. package/src/lib/server-wake.ts +0 -315
  775. package/src/lib/session-refresh.ts +0 -472
  776. package/src/lib/share-format.ts +0 -18
  777. package/src/lib/status-tone.ts +0 -43
  778. package/src/lib/strip-fade.ts +0 -287
  779. package/src/lib/table-text.ts +0 -554
  780. package/src/lib/text-case.ts +0 -19
  781. package/src/lib/text-match.ts +0 -169
  782. package/src/lib/thenable.ts +0 -19
  783. package/src/lib/translation-review.ts +0 -717
  784. package/src/notifications/device-zone-report.ts +0 -67
  785. package/src/notifications/feedback-notification-types-labels.ts +0 -33
  786. package/src/notifications/feedback-notification-types.ts +0 -71
  787. package/src/notifications/notification-bell.tsx +0 -119
  788. package/src/notifications/notification-inbox.tsx +0 -309
  789. package/src/notifications/notification-parts.tsx +0 -81
  790. package/src/notifications/notification-types-setting.tsx +0 -406
  791. package/src/notifications/notification-types.ts +0 -89
  792. package/src/notifications/notifications-labels.ts +0 -287
  793. package/src/notifications/push-device-setting.tsx +0 -230
  794. package/src/notifications/push-devices-setting.tsx +0 -374
  795. package/src/notifications/push-worker.ts +0 -168
  796. package/src/notifications/quiet-hours-setting.tsx +0 -238
  797. package/src/notifications/unsubscribe-panel.tsx +0 -200
  798. package/src/notifications/use-push-device.ts +0 -448
  799. package/src/offline/local-first.ts +0 -100
  800. package/src/offline/pwa-update-prompt-labels.ts +0 -9
  801. package/src/offline/pwa-update-prompt.tsx +0 -78
  802. package/src/offline/query-persistence.ts +0 -391
  803. package/src/offline/service-worker-updates.ts +0 -81
  804. package/src/offline/shared-computer-labels.ts +0 -8
  805. package/src/offline/shared-computer.tsx +0 -87
  806. package/src/offline/sign-out-pending-dialog-labels.ts +0 -21
  807. package/src/offline/sign-out-pending-dialog.tsx +0 -135
  808. package/src/offline.ts +0 -37
  809. package/src/push-worker.ts +0 -25
  810. package/src/rhf/fields.tsx +0 -2187
  811. package/src/rhf/form-core.tsx +0 -324
  812. package/src/rhf/form.tsx +0 -12
  813. package/src/rhf/line-items.tsx +0 -135
  814. package/src/rhf/use-rhf-wizard-step.ts +0 -104
  815. package/src/rhf.ts +0 -21
  816. package/src/search/command-palette-labels.ts +0 -16
  817. package/src/search/command-palette.tsx +0 -624
  818. package/src/search/global-search-labels.ts +0 -13
  819. package/src/search/global-search.tsx +0 -660
  820. package/src/search/search-index.ts +0 -283
  821. package/src/search/use-command-key.ts +0 -23
  822. package/src/search.ts +0 -14
  823. package/src/settings/device-reset-setting-labels.ts +0 -20
  824. package/src/settings/device-reset-setting.tsx +0 -116
  825. package/src/settings/settings-card-classes.ts +0 -11
  826. package/src/settings/settings-catalogue.ts +0 -150
  827. package/src/settings/settings-context.ts +0 -33
  828. package/src/settings/settings-heading.tsx +0 -67
  829. package/src/settings/settings-labels.ts +0 -87
  830. package/src/settings/settings-layout.tsx +0 -471
  831. package/src/settings/settings-section.tsx +0 -108
  832. package/src/settings/use-account-appearance.ts +0 -148
  833. package/src/settings/use-account-language.ts +0 -146
  834. package/src/settings/use-settings-focus.ts +0 -128
  835. package/src/settings/use-settings-route.ts +0 -258
  836. package/src/shell/account-menu-language.tsx +0 -130
  837. package/src/shell/account-menu-text-size.tsx +0 -80
  838. package/src/shell/admin-menu.tsx +0 -183
  839. package/src/shell/app-shell-labels.ts +0 -11
  840. package/src/shell/app-shell.tsx +0 -1560
  841. package/src/shell/auth-layout.tsx +0 -186
  842. package/src/shell/company-switcher-labels.ts +0 -13
  843. package/src/shell/company-switcher.tsx +0 -136
  844. package/src/shell/dev-menu.tsx +0 -257
  845. package/src/shell/fill-height.tsx +0 -45
  846. package/src/shell/language-code.ts +0 -5
  847. package/src/shell/option-switcher-menu.tsx +0 -84
  848. package/src/shell/sync-status-indicator.tsx +0 -303
  849. package/src/shell/top-bar-actions.tsx +0 -87
  850. package/src/shell/top-bar-brand.tsx +0 -78
  851. package/src/shell/top-bar-parts-labels.ts +0 -148
  852. package/src/shell/top-bar.tsx +0 -40
  853. package/src/shell/topbar-action-menu.tsx +0 -567
  854. package/src/shell/topbar-controls.tsx +0 -269
  855. package/src/shell/tour-menu.tsx +0 -187
  856. package/src/shell.ts +0 -108
  857. package/src/sync/db.ts +0 -129
  858. package/src/sync/engine.ts +0 -1011
  859. package/src/sync/hooks.ts +0 -98
  860. package/src/sync/testing.ts +0 -73
  861. package/src/sync/wire.ts +0 -61
  862. package/src/sync.ts +0 -37
  863. package/src/table-text.ts +0 -8
  864. package/src/testing/css-variables.generated.ts +0 -112
  865. package/src/testing/css-variables.ts +0 -189
  866. package/src/testing/index.ts +0 -29
  867. package/src/testing/react.ts +0 -58
  868. package/src/testing/tour.ts +0 -41
  869. package/src/testing/viewport.ts +0 -357
  870. package/src/theme/chart-palette.ts +0 -232
  871. package/src/theme/color.ts +0 -272
  872. package/src/theme/contrast-tokens.ts +0 -268
  873. package/src/theme/contrast.ts +0 -250
  874. package/src/theme/palette-derive.ts +0 -825
  875. package/src/theme/palette-presets.ts +0 -544
  876. package/src/theme/palette-store.ts +0 -108
  877. package/src/theme/text-size.ts +0 -289
  878. package/src/theme/theme-store.ts +0 -157
  879. package/src/tour/tour-catalogue-labels.ts +0 -75
  880. package/src/tour/tour-catalogue.tsx +0 -335
  881. package/src/tour/tour-dock.ts +0 -134
  882. package/src/tour/tour-engine.ts +0 -37
  883. package/src/tour/tour-gates.ts +0 -218
  884. package/src/tour/tour-guide-button.tsx +0 -64
  885. package/src/tour/tour-guide-labels.ts +0 -15
  886. package/src/tour/tour-info.ts +0 -144
  887. package/src/tour/tour-labels.ts +0 -23
  888. package/src/tour/tour-overlay.tsx +0 -1170
  889. package/src/tour/tour.tsx +0 -750
  890. package/src/tour/use-tour-progress.ts +0 -671
  891. package/src/tour/use-tour-url-sync.ts +0 -266
  892. package/src/tour.ts +0 -21
  893. package/src/vite-env.d.ts +0 -23
  894. package/src/wizard/stepper-nav.tsx +0 -360
  895. package/src/wizard/types.ts +0 -275
  896. package/src/wizard/use-wizard.ts +0 -560
  897. package/src/wizard/validation.ts +0 -39
  898. package/src/wizard/wizard-context.tsx +0 -74
  899. package/src/wizard/wizard-labels.ts +0 -29
  900. package/src/wizard/wizard-step.tsx +0 -76
  901. package/src/wizard/wizard-summary.tsx +0 -84
  902. package/src/wizard.ts +0 -15
@@ -1,1170 +0,0 @@
1
- import {
2
- useCallback,
3
- useEffect,
4
- useEffectEvent,
5
- useId,
6
- useLayoutEffect,
7
- useRef,
8
- useState,
9
- useSyncExternalStore,
10
- } from "react";
11
- import type { CSSProperties, RefObject } from "react";
12
- import { createPortal } from "react-dom";
13
- import { cn } from "../lib/cn";
14
- import { Button } from "../components/button";
15
- import { firstTabStop, tabStops, useFocusTrap } from "../hooks/use-focus-trap";
16
- import { useDismissLayer } from "../hooks/use-dismiss";
17
- import { sameRect } from "../hooks/use-anchored-rect";
18
- import { anchoredInline, viewportSize } from "../hooks/use-anchored-panel";
19
- import { useBreakpoint } from "../hooks/use-breakpoint";
20
- import { useCoarsePointer } from "../hooks/use-large-text";
21
- import { dirOf, horizontalStep } from "../lib/direction";
22
- import { isComposing } from "../lib/ime";
23
- import { focusQuietly } from "../lib/quiet-focus";
24
- import type { Direction } from "../lib/direction";
25
- import type { TourLabels, TourPlacement, TourStep, TourStepContext } from "./tour";
26
- import { devWarnings, isShown, stepContext, type GateRegistry } from "./tour-gates";
27
- import { dockEdge, dockStyle, readBand, scrollIntoFreeHalf, type DockEdge } from "./tour-dock";
28
-
29
- /*
30
- * # The tour's overlay: the card, the spotlight and its shields, the placement, the dock
31
- *
32
- * Its own module since 0.52 (refactor audit 2026-10-30, MOD-1): `TourProvider` is mounted
33
- * above every app's routes and renders this only while a tour runs, so it is loaded by a
34
- * literal `import()` when a tour first starts (tour.tsx), not with the provider — about
35
- * 28.5 kB minified, 10.3 kB gzip that sat in each app's first load (measured at 0.51.6). Nothing here is public; what
36
- * the provider shares with it (the step context, `when`, the gates) is in tour-gates.ts.
37
- */
38
-
39
- /** The app's `refuse` on the step that awaits its key (§11.4). */
40
- export interface Refusal {
41
- step: TourStep;
42
- reason?: string;
43
- /** Bumped per refusal, so the same words are announced again. */
44
- seq: number;
45
- }
46
-
47
- const NOOP = () => {};
48
-
49
- /** The first step in [floor, index) shown now whose gate is published and unsatisfied, or -1. */
50
- function firstEmptied(steps: TourStep[], floor: number, index: number, gates: GateRegistry): number {
51
- const ctx = stepContext(gates, "goto");
52
- for (let j = floor; j < index; j++) {
53
- const key = steps[j].gate;
54
- if (key && gates.get(key) === false && isShown(steps[j], ctx)) return j;
55
- }
56
- return -1;
57
- }
58
-
59
- interface Rect {
60
- top: number;
61
- left: number;
62
- width: number;
63
- height: number;
64
- }
65
-
66
- function isVisible(el: Element): boolean {
67
- // A non-zero box already rules out display:none on the element or any ancestor
68
- // (an unrendered element measures 0x0). We deliberately do NOT test
69
- // offsetParent: it is null for position:fixed elements even when fully visible,
70
- // which made the mobile bottom-nav bar (fixed) un-highlightable on mobile
71
- // (feedback #313). visibility:hidden keeps a box, so check it explicitly.
72
- const r = el.getBoundingClientRect();
73
- if (r.width <= 0 || r.height <= 0) return false;
74
- const style = getComputedStyle(el);
75
- return style.visibility !== "hidden" && style.display !== "none";
76
- }
77
-
78
- // The first VISIBLE element matching the selector, not merely the first in DOM
79
- // order. This lets a step target the same control across layouts with one
80
- // combined selector — e.g. the desktop sidebar link AND the mobile bottom-bar
81
- // link — where the off-layout copy is present but `display:none` (feedback
82
- // #313). Returns null while none is visible so the finder keeps retrying.
83
- function queryVisibleTarget(selector: string): Element | null {
84
- const els = document.querySelectorAll(selector);
85
- for (const el of els) {
86
- if (isVisible(el)) return el;
87
- }
88
- return null;
89
- }
90
-
91
- function rectOf(el: Element): Rect {
92
- const r = el.getBoundingClientRect();
93
- return { top: r.top, left: r.left, width: r.width, height: r.height };
94
- }
95
-
96
- /** The two-tone frame's width outside the spot (3px white, 2px keyline), plus a pixel. */
97
- const RING_BAND = 6;
98
-
99
- /**
100
- * What a step's ring frames (keksdose S1, §11.6): the target, and on a FIELD step also the
101
- * lines that describe the field from outside it — the elements its `aria-describedby`
102
- * (on the target or a control inside) names that lie within the ring's reach of it (a
103
- * caption, a hint or warning line, an error drawn under or above the field). Without
104
- * them the ring's frame ran through such a line; with them it frames field and line, and
105
- * the line is lit, not under the scrim. A kit field's own caption and error are inside
106
- * its root already. A line far away (a tooltip, another part of the page) is not taken.
107
- */
108
- function spotRectOf(el: Element, step: TourStep): Rect {
109
- const own = rectOf(el);
110
- if (!isFieldStep(step)) return own;
111
- const ids = new Set<string>();
112
- const holders = [el, ...Array.from(el.querySelectorAll("[aria-describedby]"))];
113
- for (const holder of holders) {
114
- for (const id of (holder.getAttribute("aria-describedby") ?? "").split(/\s+/)) if (id) ids.add(id);
115
- }
116
- if (ids.size === 0) return own;
117
- const lines: DOMRect[] = [];
118
- for (const id of ids) {
119
- const line = document.getElementById(id);
120
- if (!line || el.contains(line) || line.closest('[role="tooltip"]') || !isVisible(line)) continue;
121
- const r = line.getBoundingClientRect();
122
- // An `sr-only` description measures 1×1: nothing to frame.
123
- if (r.width > 1 && r.height > 1) lines.push(r);
124
- }
125
- let top = own.top;
126
- let left = own.left;
127
- let right = own.left + own.width;
128
- let bottom = own.top + own.height;
129
- const reach = (step.padding ?? 8) + RING_BAND;
130
- // Grow until nothing more is in reach: a hint under the field, then an error under it.
131
- for (let grew = true; grew;) {
132
- grew = false;
133
- for (let i = lines.length - 1; i >= 0; i--) {
134
- const r = lines[i];
135
- const across = r.left < right && r.right > left;
136
- const gap = Math.max(r.top - bottom, top - r.bottom);
137
- if (!across || gap > reach) continue;
138
- top = Math.min(top, r.top);
139
- left = Math.min(left, r.left);
140
- right = Math.max(right, r.right);
141
- bottom = Math.max(bottom, r.bottom);
142
- lines.splice(i, 1);
143
- grew = true;
144
- }
145
- }
146
- return { top, left, width: right - left, height: bottom - top };
147
- }
148
-
149
- /**
150
- * What the finder established for ONE step: where its target is (`null` = no target,
151
- * or not on the page), and the reading direction the card takes from it.
152
- *
153
- * It carries the step it was found for, and the overlay only believes it for that
154
- * step — which is the whole fix for keksdose's tours audit 2026-10-02, §1.0 A ("stale
155
- * spotlight on the step after a spotlighted one", 15 steps in 16 tours, desktop and
156
- * phone, mouse and keyboard). When step N spotlit a target and step N+1 had none (or
157
- * its anchor was missing), N+1 kept N's hole and parked its card beside it, so a
158
- * centred "You're all set" read as pointing at the Import & Export link; Back→Next kept
159
- * it for as long as anyone watched.
160
- *
161
- * The overlay used to hold `rect` and `ready` as separate states and reset them
162
- * DURING RENDER when the step changed. React 19 does not keep a render-phase update
163
- * while an earlier, lower-priority update to the same hook is still queued — it only
164
- * writes the result to the base state "unless the queue is empty" — and the follow
165
- * interval below queues exactly such an update every 250 ms (eagerly bailed out because
166
- * the rect had not moved, but left in the queue for rebasing). So the click's render
167
- * showed the reset, and the very next render (the finder saying "ready") re-based on
168
- * the old rect. A deep link was fine because nothing had queued anything yet.
169
- *
170
- * Keying the result to its step does not depend on any of that ordering: a rect found
171
- * for another step is not this step's rect, whatever the queue does with it, and a
172
- * missing anchor reads as "no target" instead of as the last thing that was lit.
173
- */
174
- interface Located {
175
- index: number;
176
- step: TourStep;
177
- rect: Rect | null;
178
- dir: Direction;
179
- /**
180
- * A field step's own container (§11.6): inserted right after the kit layer holding the
181
- * target (`host.after`), or at the end of <body> on the page. `null` on a plain step,
182
- * which is portalled to <body> at z-[60] as ever.
183
- */
184
- layer: HTMLElement | null;
185
- /** The host fills the visual viewport (a phone's FullBleedDialog): no scrim, no shields. */
186
- fullScreen: boolean;
187
- }
188
-
189
- /** The kit layer (`data-kit-layer`) holding `el`, if any. */
190
- function layerHost(el: Element): HTMLElement | null {
191
- return el.closest<HTMLElement>("[data-kit-layer]");
192
- }
193
-
194
- /**
195
- * Does the host fill the visual viewport? A backdrop host (`data-kit-layer="backdrop"`:
196
- * Modal, FullBleedDialog) is judged by its panel, the child holding the target.
197
- */
198
- function coversViewport(host: HTMLElement, el: Element): boolean {
199
- let surface: Element = host;
200
- if (host.getAttribute("data-kit-layer") === "backdrop") {
201
- for (const child of Array.from(host.children)) {
202
- if (child.contains(el)) {
203
- surface = child;
204
- break;
205
- }
206
- }
207
- }
208
- const r = surface.getBoundingClientRect();
209
- const vv = window.visualViewport;
210
- // Without a visual viewport, the glass (`viewportSize`), not `innerWidth`: an overflow
211
- // grows the layout viewport, and a sheet as wide as the screen read as narrower than it
212
- // (refactor audit 2026-10-30, DUP-9; live #381).
213
- const view = viewportSize();
214
- const top = vv?.offsetTop ?? 0;
215
- const bottom = top + (vv?.height ?? view.height);
216
- const width = vv?.width ?? view.width;
217
- return r.width > 0 && r.left <= 1 && r.top <= top + 1 && r.right >= width - 1 && r.bottom >= bottom - 1;
218
- }
219
-
220
- /** Does this step's card dock now (§11.7)? Below `sm` (`phone`), and `"dock"` or a field
221
- * step with no placement while the provider docks on phones. */
222
- function docks(step: TourStep, dockOnPhones: boolean, phone: boolean): boolean {
223
- if (!phone || !step.target) return false;
224
- return step.placement === "dock" || (step.placement === undefined && dockOnPhones && isFieldStep(step));
225
- }
226
-
227
- /** A step whose control is for using: its card joins the layer stack above the field (§11.6). */
228
- function isFieldStep(step: TourStep): boolean {
229
- return !!(step.interactive || step.awaitInput || step.gate || step.awaitGate);
230
- }
231
-
232
- export function TourOverlay({
233
- steps,
234
- index,
235
- via,
236
- floor,
237
- position,
238
- count,
239
- refusal,
240
- onGoTo,
241
- labels,
242
- gates,
243
- dockOnPhones,
244
- onNext,
245
- onPrev,
246
- onSkip,
247
- }: {
248
- steps: TourStep[];
249
- index: number;
250
- via: TourStepContext["via"];
251
- floor: number;
252
- /** The app refused this step's save (§11.4). */
253
- refusal: Refusal | null;
254
- onGoTo: (index: number) => void;
255
- /** 1-based among the steps shown; Back is hidden on the first, Done on the last. */
256
- position: number;
257
- count: number;
258
- labels: TourLabels;
259
- gates: GateRegistry;
260
- dockOnPhones: boolean;
261
- onNext: () => void;
262
- onPrev: () => void;
263
- onSkip: () => void;
264
- }) {
265
- const step = steps[index];
266
- const isFirst = position <= 1;
267
- const isLast = position >= count;
268
- // A new step starts unlocated: whatever was found for another step (see `Located`)
269
- // is ignored, so the overlay renders nothing until the effect below has located THIS
270
- // step, and never the previous step's spotlight.
271
- const [located, setLocated] = useState<Located | null>(null);
272
- const current = located !== null && located.index === index && located.step === step ? located : null;
273
- const ready = current !== null;
274
- const rect = current?.rect ?? null;
275
- // The overlay is portalled to <body>, out of whatever `dir` subtree the app set, so it
276
- // takes the direction of the element it spotlights (the document's for a centered
277
- // step). Arrow keys and start/end placement read it.
278
- const dir: Direction = current?.dir ?? "ltr";
279
- const rootRef = useRef<HTMLDivElement>(null);
280
- const cardRef = useRef<HTMLDivElement>(null);
281
- const bodyId = useId();
282
- const hintId = useId();
283
- // Below `sm` at the text size in force (§3.3: 640 px at Normal, 800 at Large), the
284
- // question CSS's `max-sm:` asks — a fixed 640 docked nothing in a 700 px window at
285
- // Large, which lays the page out as a phone (refactor audit 2026-10-30, DUP-9).
286
- const phone = useBreakpoint("max-sm");
287
- // A touch screen: the card takes focus, so no keyboard or pad opens before the step is
288
- // read (§11.8). Asked on arrival, not followed: a dependency of the arrival effect, a
289
- // 2-in-1's keyboard detached mid-step ran the arrival again and pulled the focus out of
290
- // the field being typed in (0.52 code review, tour-overlay.tsx).
291
- const coarse = useCoarsePointer();
292
- const coarseOnArrival = useEffectEvent(() => coarse);
293
-
294
- // The gate (§11.1). Re-rendered on every registry change while the tour runs.
295
- const gateVersion = useSyncExternalStore(gates.subscribe, gates.version, gates.version);
296
- const gateKey = step.gate;
297
- const enforced = !!gateKey && gates.has(gateKey);
298
- const locked = enforced && gates.get(gateKey) !== true;
299
-
300
- // The polite live region (§11.8): `gateReady` once a gate opens, the hint on a locked
301
- // Next. A repeat of the same words gets a trailing zero-width space so it is read again.
302
- const [polite, setPolite] = useState("");
303
- const announce = useCallback((text: string) => {
304
- setPolite((prev) => (prev === text ? `${text}\u200b` : text));
305
- }, []);
306
-
307
- // Run beforeStep, then locate the target (retrying across route/render lag).
308
- useEffect(() => {
309
- let cancelled = false;
310
- let raf = 0;
311
- // `null` = untargeted, or the finder gave up → the card centres, with no hole.
312
- const settle = (el: Element | null) => {
313
- let layer: HTMLElement | null = null;
314
- let fullScreen = false;
315
- if (el && isFieldStep(step)) {
316
- // §11.6: directly above the layer holding the field — DOM order decides between
317
- // the kit's z-50 body children, so this paints over the host and everything opened
318
- // before it, and under whatever the field opens next (a list, the number pad).
319
- const host = layerHost(el);
320
- layer = document.createElement("div");
321
- layer.setAttribute("data-tour-layer", "");
322
- if (host) host.after(layer);
323
- else document.body.appendChild(layer);
324
- fullScreen = !!host && coversViewport(host, el);
325
- }
326
- setLocated({ index, step, rect: el ? spotRectOf(el, step) : null, dir: dirOf(el), layer, fullScreen });
327
- };
328
- void (async () => {
329
- try {
330
- await step.beforeStep?.(stepContext(gates, via));
331
- } catch (error) {
332
- // The step is shown anyway (FLW-5): left unlocated, the tour stayed `active`
333
- // with no card, no scrim and no Escape layer, and everything keyed on "a tour
334
- // runs" (the `?tour=` mirror, the apps' PWA-update hold) stayed on with it. The
335
- // target may well be there regardless; if not, the finder gives up and centres.
336
- console.error(error);
337
- }
338
- if (cancelled) return;
339
- if (!step.target) {
340
- settle(null);
341
- return;
342
- }
343
- let tries = 0;
344
- const find = () => {
345
- if (cancelled) return;
346
- const el = queryVisibleTarget(step.target!);
347
- if (el) {
348
- // A docked step scrolls the field into the half the card leaves free, through
349
- // the field's own scroll container (§11.7); any other centres it, as ever.
350
- if (docks(step, dockOnPhones, phone)) scrollIntoFreeHalf(el, null, null);
351
- else el.scrollIntoView({ block: "center", behavior: "smooth" });
352
- settle(el);
353
- return;
354
- }
355
- if (tries++ < 45) raf = requestAnimationFrame(find);
356
- else settle(null); // give up → render centered
357
- };
358
- find();
359
- })();
360
- return () => {
361
- cancelled = true;
362
- cancelAnimationFrame(raf);
363
- };
364
- // `via` and the gates are read at arrival, not followed.
365
- // eslint-disable-next-line react-hooks/exhaustive-deps
366
- }, [index, step]);
367
-
368
- // Follow the target as the page scrolls / reflows — only once THIS step is located,
369
- // and only into this step's result.
370
- useEffect(() => {
371
- if (!step.target) return;
372
- const update = () => {
373
- const el = queryVisibleTarget(step.target!);
374
- if (el) {
375
- const next = spotRectOf(el, step);
376
- // A sheet that grows to full screen (or shrinks from it) takes or drops the scrim.
377
- const host = layerHost(el);
378
- const full = !!host && coversViewport(host, el);
379
- setLocated((prev) => {
380
- if (!prev || prev.index !== index || prev.step !== step) return prev;
381
- const fullScreen = prev.layer ? full : prev.fullScreen;
382
- if (sameRect(prev.rect, next) && fullScreen === prev.fullScreen) return prev;
383
- return { ...prev, rect: next, fullScreen };
384
- });
385
- }
386
- };
387
- window.addEventListener("scroll", update, true);
388
- window.addEventListener("resize", update);
389
- const id = window.setInterval(update, 250);
390
- return () => {
391
- window.removeEventListener("scroll", update, true);
392
- window.removeEventListener("resize", update);
393
- clearInterval(id);
394
- };
395
- }, [index, step]);
396
-
397
- // A field step's container goes with the step (and with the tour).
398
- const layer = located?.layer ?? null;
399
- useEffect(() => {
400
- if (!layer) return;
401
- return () => layer.remove();
402
- }, [layer]);
403
-
404
- // Escape (§11.6.4): the tour is a layer on the kit's Escape stack, pushed on each
405
- // arrival, so it sits above the sheet holding the form. Escape from the card skips the
406
- // tour and no longer also closes that sheet; a layer the field opens afterwards (a
407
- // list, the pad) is above the tour and takes Escape first. An Escape pressed in the
408
- // field itself belongs to the field: the tour lets it pass by doing nothing.
409
- useDismissLayer(
410
- ready,
411
- (e) => {
412
- if (interactive && step.target && e.target instanceof Node) {
413
- const el = queryVisibleTarget(step.target);
414
- if (el?.contains(e.target)) return;
415
- }
416
- onSkip();
417
- },
418
- // Not an overlay to `useOverlayOpen`: a floating launcher a tour spotlights stays.
419
- { overlay: false },
420
- );
421
-
422
- // awaitClick: advance when the *real* target is clicked. The spotlight hole is
423
- // click-through (see the shields in the render below) so the element's own
424
- // handler runs first; we step forward on the next macrotask.
425
- //
426
- // Re-armed when the target turns up after the finder gave up (the follow effect
427
- // lights it late): the card swaps Next for the "click the highlighted element" hint
428
- // as soon as there is a rect, so the click must work from that moment too.
429
- const spotted = rect !== null;
430
- useEffect(() => {
431
- if (!ready || !spotted || !step.awaitClick || !step.target) return;
432
- const el = queryVisibleTarget(step.target);
433
- if (!el) return;
434
- const onClick = () => window.setTimeout(() => onNext(), 0);
435
- el.addEventListener("click", onClick, { once: true });
436
- return () => el.removeEventListener("click", onClick);
437
- }, [ready, spotted, index, step, onNext]);
438
-
439
- // A field step (see `TourStep.interactive`): only while the target is lit — a step
440
- // whose target is missing centres its card over a full scrim, modal as ever. The one
441
- // `isFieldStep`, as the layer insertion in `settle` reads it: an inline copy of its
442
- // flags, and an alias of that, could drift from it (0.52 code review, tour-overlay.tsx).
443
- const interactive = spotted && !!step.target && isFieldStep(step);
444
- // A GUIDED field step (§11.8): focus goes to the field on a fine pointer, and Tab
445
- // cycles field + card. A plain `interactive` step keeps the card's own trap.
446
- const guided = interactive && !!(step.gate || step.awaitInput || step.awaitGate);
447
- // An awaitGate step whose target is lit: only `release` moves it (a missing Save
448
- // button would otherwise be a dead end, as for awaitClick).
449
- const awaitsRelease = spotted && !!step.target && !!step.awaitGate;
450
-
451
- // A gate nobody publishes is not enforced: Next opens, and a development build says why
452
- // (on arrival, or when its publisher unmounts under the step), once per step.
453
- const warnedGateRef = useRef<TourStep | null>(null);
454
- useEffect(() => {
455
- if (!ready || !gateKey || gates.has(gateKey) || !devWarnings() || warnedGateRef.current === step) return;
456
- warnedGateRef.current = step;
457
- console.warn(
458
- `[ui-kit] Tour step "${step.title}" waits for the gate "${gateKey}", which nothing publishes: its Next is open. ` +
459
- "Publish it with useTourGate beside the field, or the form has closed under the tour.",
460
- );
461
- }, [ready, gateKey, gates, step, gateVersion]);
462
-
463
- // `optional` means "may stay EMPTY": without a gate there is no value to compare.
464
- useEffect(() => {
465
- if (!ready || !step.optional || step.gate || !devWarnings()) return;
466
- console.warn(
467
- `[ui-kit] Tour step "${step.title}" is \`optional\` without a \`gate\`: it shows the Optional chip ` +
468
- 'and a plain Next. "Leave empty" needs a gate to compare.',
469
- );
470
- }, [ready, step]);
471
-
472
- // "Ready" once, when this step's gate turns satisfied (not when it arrives satisfied).
473
- const wasLockedRef = useRef<{ step: TourStep; locked: boolean } | null>(null);
474
- useEffect(() => {
475
- if (!ready || !gateKey) return;
476
- const before = wasLockedRef.current;
477
- if (before && before.step === step && before.locked && !locked && enforced) announce(labels.gateReady);
478
- wasLockedRef.current = { step, locked };
479
- }, [ready, gateKey, step, locked, enforced, announce, labels.gateReady]);
480
-
481
- // Arrival on a guided step: the field takes focus on a fine pointer, the card on a
482
- // coarse one; the field is described by the card's body while the step lasts.
483
- // Declared BEFORE the advance listeners below, so the focus it moves is not mistaken
484
- // for the person leaving the field.
485
- useEffect(() => {
486
- if (!ready || !guided || !step.target) return;
487
- const el = queryVisibleTarget(step.target);
488
- const control = el ? firstTabStop(el) : null;
489
- // Described BEFORE it is focused, so a screen reader reads the step with the field's
490
- // name. Focused quietly (0.50.1, keksdose B1): a picker that opens on focus stays
491
- // closed, or its list would cover the card; ArrowDown, typing or a click opens it.
492
- const previous = control ? control.getAttribute("aria-describedby") : null;
493
- if (control) control.setAttribute("aria-describedby", previous ? `${previous} ${bodyId}` : bodyId);
494
- if (coarseOnArrival() || !control) cardRef.current?.focus();
495
- else if (!el!.contains(document.activeElement)) focusQuietly(control);
496
- if (!control) return;
497
- return () => {
498
- if (previous === null) control.removeAttribute("aria-describedby");
499
- else control.setAttribute("aria-describedby", previous);
500
- };
501
- }, [ready, guided, index, step, bodyId]);
502
-
503
- // Tab on a guided step cycles field + card as one ring (§11.8): from the field's last
504
- // stop to the card's first, from the card's last back to the field. Captured on the
505
- // document, ahead of a sheet's own trap, which would wrap inside the sheet.
506
- useEffect(() => {
507
- if (!ready || !guided || !step.target) return;
508
- const onTab = (e: KeyboardEvent) => {
509
- if (e.key !== "Tab") return;
510
- const el = queryVisibleTarget(step.target!);
511
- const card = cardRef.current;
512
- if (!el || !card) return;
513
- const active = document.activeElement;
514
- const fieldStops = tabStops(el);
515
- const cardStops = tabStops(card);
516
- if (fieldStops.length === 0 || cardStops.length === 0) return;
517
- let to: HTMLElement | null = null;
518
- if (active instanceof Node && el.contains(active)) {
519
- if (!e.shiftKey && active === fieldStops[fieldStops.length - 1]) to = cardStops[0];
520
- else if (e.shiftKey && active === fieldStops[0]) to = cardStops[cardStops.length - 1];
521
- } else if (active instanceof Node && card.contains(active)) {
522
- if (!e.shiftKey && active === cardStops[cardStops.length - 1]) to = fieldStops[0];
523
- else if (e.shiftKey && (active === cardStops[0] || active === card)) to = fieldStops[fieldStops.length - 1];
524
- }
525
- if (!to) return;
526
- e.preventDefault();
527
- e.stopPropagation();
528
- to.focus();
529
- };
530
- document.addEventListener("keydown", onTab, true);
531
- return () => document.removeEventListener("keydown", onTab, true);
532
- }, [ready, guided, index, step]);
533
-
534
- // gate: once satisfied, advance on Enter in the field (unless the control took it, or
535
- // a textarea without Ctrl/Cmd) or on focus leaving the field to nowhere or to the card.
536
- // Checked on the next macrotask, after the field's own blur/Enter commit has rendered.
537
- useEffect(() => {
538
- if (!ready || !spotted || !gateKey || !step.target) return;
539
- const el = queryVisibleTarget(step.target) as HTMLElement | null;
540
- if (!el) return;
541
- const satisfied = () => !gates.has(gateKey) || gates.get(gateKey) === true;
542
- let timer = 0;
543
- // Focus that was in the field when the step settled, or went there since. A focus
544
- // move the tour made itself (the card taking it on a phone) is not a leave.
545
- let armed = el.contains(document.activeElement);
546
- const check = () => {
547
- window.clearTimeout(timer);
548
- timer = window.setTimeout(() => {
549
- if (satisfied()) onNext();
550
- }, 0);
551
- };
552
- const onFocusIn = () => {
553
- armed = true;
554
- };
555
- const onFocusOut = (e: FocusEvent) => {
556
- const to = e.relatedTarget;
557
- if (to instanceof Node && el.contains(to)) return;
558
- const wasArmed = armed;
559
- armed = false;
560
- if (!wasArmed) return;
561
- if (to === null || (to instanceof Node && rootRef.current?.contains(to))) check();
562
- };
563
- const onKeyDown = (e: KeyboardEvent) => {
564
- if (e.key !== "Enter" || !(e.target instanceof Node) || !el.contains(e.target)) return;
565
- // Heard at the document, after React's handlers: a combobox picking an option has
566
- // called preventDefault by now.
567
- if (e.defaultPrevented || isComposing(e)) return;
568
- if (e.target instanceof HTMLTextAreaElement && !(e.ctrlKey || e.metaKey)) return;
569
- check();
570
- };
571
- el.addEventListener("focusin", onFocusIn);
572
- el.addEventListener("focusout", onFocusOut);
573
- document.addEventListener("keydown", onKeyDown);
574
- return () => {
575
- window.clearTimeout(timer);
576
- el.removeEventListener("focusin", onFocusIn);
577
- el.removeEventListener("focusout", onFocusOut);
578
- document.removeEventListener("keydown", onKeyDown);
579
- };
580
- }, [ready, spotted, gateKey, gates, index, step, onNext]);
581
-
582
- // awaitInput: advance once the target's fields hold another value than when the step
583
- // was armed, checked when focus leaves the target or Enter is pressed in it — on the
584
- // next macrotask, after the field's own blur/Enter commit has rendered. A value the
585
- // number pad typed fires no native `change`, so comparing is what catches it.
586
- useEffect(() => {
587
- if (!ready || !spotted || !step.awaitInput || !step.target) return;
588
- const el = queryVisibleTarget(step.target) as HTMLElement | null;
589
- if (!el) return;
590
- const read = () => fieldValues(el);
591
- const before = read();
592
- let timer = 0;
593
- let done = false;
594
- const check = () => {
595
- window.clearTimeout(timer);
596
- timer = window.setTimeout(() => {
597
- if (done || read() === before) return;
598
- done = true;
599
- onNext();
600
- }, 0);
601
- };
602
- const onFocusOut = (e: FocusEvent) => {
603
- if (e.relatedTarget instanceof Node && el.contains(e.relatedTarget)) return;
604
- check();
605
- };
606
- const onKeyDown = (e: KeyboardEvent) => {
607
- if (e.key === "Enter") check();
608
- };
609
- el.addEventListener("focusout", onFocusOut);
610
- el.addEventListener("keydown", onKeyDown);
611
- el.addEventListener("change", check);
612
- return () => {
613
- window.clearTimeout(timer);
614
- el.removeEventListener("focusout", onFocusOut);
615
- el.removeEventListener("keydown", onKeyDown);
616
- el.removeEventListener("change", check);
617
- };
618
- }, [ready, spotted, index, step, onNext]);
619
-
620
- /** A press on the locked Next (or Enter / → from the card): no move; the field takes
621
- * focus and the hint is read again. */
622
- const gateHint = step.gateHint ?? labels.gateHint;
623
- const lockedNext = useCallback(() => {
624
- const el = step.target ? queryVisibleTarget(step.target) : null;
625
- const control = el ? firstTabStop(el) : null;
626
- // Quietly, as on arrival: the hint is read with the card in view, not under a list.
627
- if (control) focusQuietly(control);
628
- announce(gateHint);
629
- }, [step.target, announce, gateHint]);
630
- const tryNext = awaitsRelease ? NOOP : locked ? lockedNext : onNext;
631
-
632
- // After a refused save: the first earlier step shown whose field is now empty (§11.4).
633
- // Computed each render, which the gate subscription above triggers: a field filled
634
- // again drops the link.
635
- const backTo = refusal ? firstEmptied(steps, floor, index, gates) : -1;
636
-
637
- // Keyboard: Esc skips, Enter and the reading-direction arrow advance (→ in LTR,
638
- // ← in RTL), the other arrow goes back. On awaitClick steps Enter is ignored (it
639
- // would fire the target's click AND advance) — the forward arrow stays as an escape
640
- // hatch. On a locked gate step both are the locked Next.
641
- //
642
- // Enter on a focused control belongs to that control. This used to advance from
643
- // anywhere, so Enter on a focused Skip or Back ran the button's own click AND stepped
644
- // forward: Back moved nowhere, Skip skipped and then called `next` on a dead tour.
645
- // The same goes for arrows in a text field a step's `action` might contain.
646
- useEffect(() => {
647
- const onKey = (e: KeyboardEvent) => {
648
- // On an interactive step a key pressed in the target, or in a layer it opened (the
649
- // number pad's Escape, a menu's arrows), is the page's. The card's and the bare
650
- // page's (focus on <body>) stay the tour's.
651
- if (
652
- interactive &&
653
- e.target instanceof Node &&
654
- e.target !== document.body &&
655
- !rootRef.current?.contains(e.target)
656
- ) {
657
- return;
658
- }
659
- // Escape is the tour's Escape layer's (above) once the step is shown; while it is
660
- // still being located there is no layer yet, and the tour takes it here as in 0.49.
661
- if (e.key === "Escape") {
662
- if (!ready) onSkip();
663
- return;
664
- }
665
- // Nothing on screen to move on from: a step whose `beforeStep` is still running
666
- // (a route loading) is not passed over by an Enter or a → pressed on the bare
667
- // page (FLW-5). Escape, above, still leaves.
668
- if (!ready) return;
669
- if (e.key === "Enter") {
670
- if (step.awaitClick || step.awaitInput || ownsKey(e.target, "Enter")) return;
671
- e.preventDefault();
672
- tryNext();
673
- return;
674
- }
675
- if (ownsKey(e.target, e.key)) return;
676
- // The overlay root carries `dir`; before it paints, the document's answers.
677
- const delta = horizontalStep(e.key, rootRef.current);
678
- if (delta === 1) {
679
- e.preventDefault();
680
- tryNext();
681
- } else if (delta === -1) {
682
- if (!isFirst) onPrev();
683
- }
684
- };
685
- document.addEventListener("keydown", onKey);
686
- return () => document.removeEventListener("keydown", onKey);
687
- }, [isFirst, step, interactive, tryNext, onPrev, onSkip, ready]);
688
-
689
- if (!ready) return null;
690
-
691
- // No scrim, no shields: a field step inside a layer that fills the screen (§11.6.3).
692
- const bare = interactive && !!current?.fullScreen;
693
- const pad = step.padding ?? 8;
694
- const spot: Rect | null = rect
695
- ? { top: rect.top - pad, left: rect.left - pad, width: rect.width + pad * 2, height: rect.height + pad * 2 }
696
- : null;
697
-
698
- // `aria-modal` promises the page behind is out of reach, and the card's focus trap
699
- // keeps that promise for the keyboard. The pointer used to get no such treatment: the
700
- // root is `pointer-events-none` so that the spotlight hole can stay live for
701
- // `awaitClick`, and the scrim is a box-shadow, which takes no clicks — so every
702
- // control on the dimmed page stayed clickable. Four shields now tile the viewport
703
- // around the hole: the page is blocked, the card and the spotlighted target are not.
704
- // Keeping `aria-modal` (rather than dropping it) is the coherent half: the tour
705
- // really is modal — focus is trapped and Esc/Skip is the way out.
706
- return createPortal(
707
- <div
708
- ref={rootRef}
709
- // z-50 on a field step, in its own container right after the layer holding the field
710
- // (or at the end of <body>): over that layer and the page, under the z-50 layers the
711
- // field opens next (§11.6). z-[60] on a plain step, over everything.
712
- className={cn("pointer-events-none fixed inset-0", interactive ? "z-50" : "z-[60]")}
713
- role="dialog"
714
- aria-modal={interactive ? undefined : "true"}
715
- // A stable marker for the overlay, on every step (0.48, keksdose dev#611–613): an
716
- // app that hides its floating help launcher while a modal is open excepts the
717
- // tour, which may spotlight that launcher — `[aria-modal="true"]:not([data-tour-overlay])`.
718
- // keksdose matched the `pointer-events-none` class until now, which is the kit's to change.
719
- data-tour-overlay=""
720
- data-tour-interactive={interactive ? "" : undefined}
721
- data-tour-bare={bare ? "" : undefined}
722
- aria-label={step.title}
723
- dir={dir}
724
- >
725
- {/* In a full-screen layer (a phone's form sheet) no scrim and no shields: the rest of
726
- the form stays usable and scrollable, and the ring alone marks the field. */}
727
- {spot && !bare && <SpotlightShields spot={spot} />}
728
- {spot ? (
729
- <div
730
- className="pointer-events-none fixed rounded-lg transition-all duration-200 ease-out"
731
- style={{
732
- top: spot.top,
733
- left: spot.left,
734
- width: spot.width,
735
- height: spot.height,
736
- // A two-tone frame, not a single translucent ring.
737
- //
738
- // The old treatment was `ring-2 ring-white/80` over a 55% scrim, and it
739
- // "was barely visible" on the app's blue-tinted surfaces. Two reasons,
740
- // and a single ring can't fix either: at 55% the surround stays bright
741
- // enough that the un-dimmed hole barely reads AS a hole, and a 80%-white
742
- // ring sitting on the edge of a light card is white-on-near-white.
743
- //
744
- // So: an opaque white band immediately around the target, a dark keyline
745
- // outside it, then the scrim. Whatever the target's own colour is, one of
746
- // the two bands is always in contrast with it and the other is always in
747
- // contrast with the dimmed surround — there is no background that can
748
- // swallow both. The blurred layer between them softens the step so the
749
- // frame reads as lighting rather than as a pasted-on rectangle.
750
- boxShadow: [
751
- "0 0 0 3px rgba(255,255,255,0.98)",
752
- "0 0 0 5px rgba(15,23,42,0.92)",
753
- "0 0 18px 6px rgba(15,23,42,0.45)",
754
- ...(bare ? [] : ["0 0 0 9999px rgba(15,23,42,0.70)"]),
755
- ].join(", "),
756
- }}
757
- />
758
- ) : (
759
- <div className="pointer-events-auto fixed inset-0 bg-black/70" />
760
- )}
761
- <TourCard
762
- cardRef={cardRef}
763
- step={step}
764
- index={index}
765
- position={position}
766
- total={count}
767
- labels={labels}
768
- isFirst={isFirst}
769
- isLast={isLast}
770
- rect={spot}
771
- dir={dir}
772
- trap={!guided}
773
- bodyId={bodyId}
774
- hintId={hintId}
775
- locked={locked}
776
- gateHint={gateHint}
777
- onBack={onPrev}
778
- onNext={tryNext}
779
- onLeaveEmpty={onNext}
780
- onSkip={onSkip}
781
- awaitsRelease={awaitsRelease}
782
- docked={spot !== null && docks(step, dockOnPhones, phone)}
783
- refusal={refusal}
784
- backTo={backTo >= 0 ? { title: steps[backTo].title, go: () => onGoTo(backTo) } : null}
785
- />
786
- <div className="sr-only" aria-live="polite" aria-atomic="true">
787
- {polite}
788
- </div>
789
- </div>,
790
- (interactive && current?.layer) || document.body,
791
- );
792
- }
793
-
794
- /** The values of the fields at or inside `el`, as one string to compare (`awaitInput`). */
795
- function fieldValues(el: Element): string {
796
- const fields = el.matches("input,textarea,select") ? [el] : Array.from(el.querySelectorAll("input,textarea,select"));
797
- return fields
798
- .map((f) =>
799
- f instanceof HTMLInputElement && (f.type === "checkbox" || f.type === "radio")
800
- ? String(f.checked)
801
- : (f as HTMLInputElement).value,
802
- )
803
- .join("\u0000");
804
- }
805
-
806
- /** Does the focused element handle `key` itself? Enter on a button or link, and any
807
- * editing key in a text field or select, is the control's — not the tour's. */
808
- function ownsKey(target: EventTarget | null, key: string): boolean {
809
- if (!(target instanceof HTMLElement)) return false;
810
- if (target.isContentEditable) return true;
811
- const tag = target.tagName;
812
- if (tag === "TEXTAREA" || tag === "SELECT") return true;
813
- if (tag === "INPUT") {
814
- const type = (target as HTMLInputElement).type;
815
- // Enter on a checkbox does nothing natively, but ←/→ on a radio moves it.
816
- return key !== "Enter" || type !== "checkbox";
817
- }
818
- if (key !== "Enter") return false;
819
- return (
820
- tag === "BUTTON" ||
821
- (tag === "A" && target.hasAttribute("href")) ||
822
- target.getAttribute("role") === "button" ||
823
- target.getAttribute("role") === "link"
824
- );
825
- }
826
-
827
- /**
828
- * Transparent pointer blockers tiling the viewport around the spotlight hole: one
829
- * full-width band above and below, one on each side at the hole's own height. The hole
830
- * itself stays uncovered, so the target keeps its clicks.
831
- */
832
- function SpotlightShields({ spot }: { spot: Rect }) {
833
- const shield = "pointer-events-auto fixed";
834
- const bottom = spot.top + spot.height;
835
- return (
836
- <>
837
- <div
838
- data-tour-shield=""
839
- className={shield}
840
- style={{ top: 0, left: 0, right: 0, height: Math.max(0, spot.top) }}
841
- />
842
- <div data-tour-shield="" className={shield} style={{ top: bottom, left: 0, right: 0, bottom: 0 }} />
843
- <div
844
- data-tour-shield=""
845
- className={shield}
846
- style={{ top: spot.top, left: 0, width: Math.max(0, spot.left), height: spot.height }}
847
- />
848
- <div
849
- data-tour-shield=""
850
- className={shield}
851
- style={{ top: spot.top, left: spot.left + spot.width, right: 0, height: spot.height }}
852
- />
853
- </>
854
- );
855
- }
856
-
857
- /**
858
- * Card position (viewport px) for the given placement relative to the padded
859
- * spotlight `rect`. Omitted placement keeps the original auto behavior
860
- * (below → above → vertically centered); an explicit side flips to its opposite
861
- * if it would overflow, then clamps into the viewport. "center" (or no rect)
862
- * centers on screen.
863
- */
864
- function placeCard(
865
- rect: Rect | null,
866
- cw: number,
867
- ch: number,
868
- vw: number,
869
- vh: number,
870
- m: number,
871
- placement?: TourPlacement,
872
- dir: Direction = "ltr",
873
- ): { top: number; left: number } {
874
- // The logical sides resolve to a physical one here, and only here.
875
- if (placement === "start") placement = dir === "rtl" ? "right" : "left";
876
- else if (placement === "end") placement = dir === "rtl" ? "left" : "right";
877
- // Every anchored panel's inline clamp (`anchoredInline`; refactor audit 2026-10-30,
878
- // DUP-9): `m` inside the glass, and a card wider than the room keeps its START on it.
879
- const clampX = (x: number) =>
880
- anchoredInline({ left: x, right: x + cw }, cw, { dir, align: "left", edge: m, viewportWidth: vw }).left;
881
- if (!rect || placement === "center") {
882
- return { top: Math.max(m, (vh - ch) / 2), left: clampX((vw - cw) / 2) };
883
- }
884
- const clampY = (y: number) => Math.min(Math.max(m, y), Math.max(m, vh - ch - m));
885
- const centerX = clampX(rect.left + rect.width / 2 - cw / 2);
886
- const centerY = clampY(rect.top + rect.height / 2 - ch / 2);
887
- const belowTop = rect.top + rect.height + m;
888
- const aboveTop = rect.top - ch - m;
889
- const rightLeft = rect.left + rect.width + m;
890
- const leftLeft = rect.left - cw - m;
891
- const fitsBelow = belowTop + ch <= vh;
892
- const fitsAbove = aboveTop >= 0;
893
- const fitsRight = rightLeft + cw <= vw;
894
- const fitsLeft = leftLeft >= 0;
895
-
896
- switch (placement) {
897
- case "top":
898
- return { top: fitsAbove ? aboveTop : fitsBelow ? belowTop : clampY(aboveTop), left: centerX };
899
- case "bottom":
900
- return { top: fitsBelow ? belowTop : fitsAbove ? aboveTop : clampY(belowTop), left: centerX };
901
- case "right":
902
- return { top: centerY, left: fitsRight ? rightLeft : fitsLeft ? leftLeft : clampX(rightLeft) };
903
- case "left":
904
- return { top: centerY, left: fitsLeft ? leftLeft : fitsRight ? rightLeft : clampX(leftLeft) };
905
- default:
906
- if (fitsBelow) return { top: belowTop, left: centerX };
907
- if (fitsAbove) return { top: aboveTop, left: centerX };
908
- return { top: Math.max(m, (vh - ch) / 2), left: centerX };
909
- }
910
- }
911
-
912
- function TourCard({
913
- cardRef: ref,
914
- step,
915
- index,
916
- position,
917
- total,
918
- labels,
919
- isFirst,
920
- isLast,
921
- rect,
922
- dir,
923
- trap,
924
- bodyId,
925
- hintId,
926
- locked,
927
- gateHint,
928
- onBack,
929
- onNext,
930
- onLeaveEmpty,
931
- onSkip,
932
- awaitsRelease,
933
- docked,
934
- refusal,
935
- backTo,
936
- }: {
937
- cardRef: RefObject<HTMLDivElement | null>;
938
- step: TourStep;
939
- index: number;
940
- /** 1-based among the steps shown (§11.3). */
941
- position: number;
942
- /** How many steps the run shows. */
943
- total: number;
944
- labels: TourLabels;
945
- isFirst: boolean;
946
- isLast: boolean;
947
- rect: Rect | null;
948
- dir: Direction;
949
- /** The card's own focus trap; off on a guided step, where field + card are one ring. */
950
- trap: boolean;
951
- bodyId: string;
952
- hintId: string;
953
- /** A gate step whose field is not filled yet (§11.1). */
954
- locked: boolean;
955
- gateHint: string;
956
- onBack: () => void;
957
- onNext: () => void;
958
- /** Moves on past an `optional` field left empty. */
959
- onLeaveEmpty: () => void;
960
- onSkip: () => void;
961
- /** An awaitGate step with its target lit: the hint in place of Next. */
962
- awaitsRelease: boolean;
963
- /** Pinned to the band's edge away from the field (§11.7). */
964
- docked: boolean;
965
- refusal: Refusal | null;
966
- /** The "Back to …" link after a refused save. */
967
- backTo: { title: string; go: () => void } | null;
968
- }) {
969
- const [style, setStyle] = useState<CSSProperties>({ opacity: 0 });
970
-
971
- /**
972
- * The card holds the focus, because the card is what the tour IS.
973
- *
974
- * The overlay above declares `role="dialog" aria-modal="true"` — it always has — and
975
- * then left focus wherever the page had put it. For a tour that is the most pointed
976
- * version of the audit's *"Only Modal manages focus"*: the whole component exists to
977
- * say "look here", and for a keyboard user "here" is the focus ring. They were told
978
- * the page was hidden, given no way to reach the Next button without Tabbing through
979
- * it, and left on a control the screen reader would no longer describe.
980
- *
981
- * It re-engages on every step, without any bookkeeping here, because `TourOverlay`
982
- * returns null while it re-locates the next target: the card genuinely unmounts and
983
- * remounts between steps. That is what keeps focus honest when the BUTTONS change —
984
- * "Back" does not exist on the first step, so stepping back onto it destroys the
985
- * control the press came from, and focus would otherwise fall to `<body>`, outside
986
- * this trap's own listener, where Tab walks straight into the page the overlay claims
987
- * to have hidden.
988
- *
989
- * **The cost, written down:** on an `awaitClick` step the user is asked to click the
990
- * spotlighted element, and they can no longer Tab to it. ArrowRight still advances
991
- * (the key handler in `TourOverlay` is on the document and does not care where focus
992
- * is), which is the escape hatch that step already documents for the case where the
993
- * target cannot be found. Containment is worth that: an `awaitClick` step is a
994
- * minority of steps, while focus stranded behind `aria-modal` is every step.
995
- *
996
- * A guided field step (`gate`, `awaitInput`, 0.50) is the exception: the field is
997
- * what the step is about, so the overlay focuses it (or the card, on a touch screen)
998
- * and runs one Tab ring over field + card itself.
999
- */
1000
- useFocusTrap(ref, { active: trap });
1001
-
1002
- // Docked (§11.7): the edge it last took, for the hysteresis, and a tick bumped when the
1003
- // band moves under an unmoved field (a pad or keyboard opening).
1004
- const edgeRef = useRef<DockEdge | null>(null);
1005
- const [bandTick, setBandTick] = useState(0);
1006
- const [edge, setEdge] = useState<DockEdge | null>(null);
1007
- useEffect(() => {
1008
- if (!docked) return;
1009
- let last = "";
1010
- const look = () => {
1011
- const target = step.target ? queryVisibleTarget(step.target) : null;
1012
- const band = readBand(target, ref.current);
1013
- const key = `${band.top}:${band.bottom}`;
1014
- if (key === last) return;
1015
- last = key;
1016
- // A field the pad or keyboard now covers is brought back into the free half.
1017
- if (target) {
1018
- const r = target.getBoundingClientRect();
1019
- if (r.top < band.top || r.bottom > band.bottom) {
1020
- edgeRef.current = scrollIntoFreeHalf(target, ref.current, edgeRef.current);
1021
- }
1022
- }
1023
- setBandTick((t) => t + 1);
1024
- };
1025
- const vv = window.visualViewport;
1026
- vv?.addEventListener("resize", look);
1027
- vv?.addEventListener("scroll", look);
1028
- window.addEventListener("resize", look);
1029
- // The follow tick's cadence: it catches a pad opening, which moves nothing.
1030
- const id = window.setInterval(look, 250);
1031
- return () => {
1032
- vv?.removeEventListener("resize", look);
1033
- vv?.removeEventListener("scroll", look);
1034
- window.removeEventListener("resize", look);
1035
- clearInterval(id);
1036
- };
1037
- }, [docked, step.target, ref]);
1038
-
1039
- useLayoutEffect(() => {
1040
- const card = ref.current;
1041
- if (!card) return;
1042
- if (docked) {
1043
- const target = step.target ? queryVisibleTarget(step.target) : null;
1044
- const band = readBand(target, card);
1045
- const next = rect ? dockEdge(rect, band, edgeRef.current, card.offsetHeight) : "bottom";
1046
- edgeRef.current = next;
1047
- setEdge(next);
1048
- setStyle(dockStyle(next, rect, band));
1049
- return;
1050
- }
1051
- setEdge(null);
1052
- // The glass, not `innerWidth`: on a phone whose page overflows that is the grown
1053
- // layout viewport, and a centred card sat off-centre by half the overflow (DUP-9).
1054
- const view = viewportSize();
1055
- setStyle(placeCard(rect, card.offsetWidth, card.offsetHeight, view.width, view.height, 12, step.placement, dir));
1056
- }, [ref, rect, index, step.placement, step.target, dir, docked, bandTick]);
1057
-
1058
- const awaitsTarget = ((step.awaitClick || step.awaitInput) && step.target && rect) || awaitsRelease;
1059
-
1060
- return (
1061
- <div
1062
- ref={ref}
1063
- // Focusable but not tabbable: the trap above focuses the card itself rather than
1064
- // its first button, so a screen reader reads the step's title and body before it
1065
- // reads "Next" — and without this the container cannot take focus at all and the
1066
- // trap silently does nothing.
1067
- tabIndex={-1}
1068
- style={style}
1069
- data-tour-card=""
1070
- data-tour-docked={edge ?? undefined}
1071
- className={cn(
1072
- "pointer-events-auto fixed z-[61] w-80 max-w-[calc(100vw-1.5rem)] rounded-lg border border-subtle bg-surface p-4 shadow-xl outline-none transition-all duration-200 ease-out",
1073
- // Docked, the height is capped: the body scrolls, the title and buttons stay.
1074
- docked && "flex flex-col",
1075
- )}
1076
- >
1077
- <div className="flex flex-wrap items-center gap-x-2 gap-y-1 text-sm font-semibold text-primary">
1078
- <span>{step.title}</span>
1079
- {step.optional && (
1080
- <span className="rounded-full border border-subtle px-1.5 py-px text-xs font-normal text-muted">
1081
- {labels.optional}
1082
- </span>
1083
- )}
1084
- </div>
1085
- <div
1086
- id={bodyId}
1087
- className={cn("mt-1 text-sm leading-relaxed text-secondary", docked && "min-h-0 shrink overflow-y-auto")}
1088
- >
1089
- {step.body}
1090
- </div>
1091
- {step.action && <div className="mt-3">{step.action}</div>}
1092
- <div className="mt-4 space-y-2">
1093
- <div className="flex items-center justify-between gap-2">
1094
- <button type="button" onClick={onSkip} className="text-xs text-placeholder hover:text-secondary">
1095
- {labels.skip}
1096
- </button>
1097
- <div className="flex items-center gap-2">
1098
- <span className="whitespace-nowrap text-xs tabular-nums text-placeholder">
1099
- {labels.step(position, total)}
1100
- </span>
1101
- {!isFirst && (
1102
- <Button variant="secondary" onClick={onBack} className="px-2.5 py-1 text-xs">
1103
- {labels.back}
1104
- </Button>
1105
- )}
1106
- {/* On an awaitClick step the Next button is replaced by a hint on its
1107
- own row below, so it doesn't cram the counter + buttons and wrap.
1108
- Only when the target was actually FOUND, though — `rect` is null
1109
- when the finder gave up, and the click listener early-returns on
1110
- the same absence. Keyed on `step.target` alone this hid the only
1111
- way forward on any step whose anchor happens not to be rendered
1112
- for this user (a guest sees no "add account" button), leaving the
1113
- undocumented ArrowRight key as the sole escape. */}
1114
- {/* "Leave empty" (§11.2): an optional field may stay empty, so the step can
1115
- move on without it. Gone once the field is filled. */}
1116
- {step.optional && locked && !awaitsTarget && (
1117
- <Button variant="secondary" onClick={onLeaveEmpty} className="px-2.5 py-1 text-xs">
1118
- {labels.leaveEmpty}
1119
- </Button>
1120
- )}
1121
- {!awaitsTarget && (
1122
- <Button
1123
- variant="accent"
1124
- onClick={onNext}
1125
- // Locked, not disabled (§11.1): it stays focusable, and a press focuses the
1126
- // field and reads the hint again.
1127
- aria-disabled={locked || undefined}
1128
- aria-describedby={locked ? hintId : undefined}
1129
- className={cn("px-2.5 py-1 text-xs", locked && "opacity-60")}
1130
- >
1131
- {isLast ? labels.done : labels.next}
1132
- </Button>
1133
- )}
1134
- </div>
1135
- </div>
1136
- {awaitsTarget && (
1137
- <div className="text-center text-xs italic text-placeholder">
1138
- {awaitsRelease
1139
- ? (step.awaitGateHint ?? labels.awaitGateHint)
1140
- : step.awaitInput && !step.awaitClick
1141
- ? labels.awaitInputHint
1142
- : labels.awaitClickHint}
1143
- </div>
1144
- )}
1145
- {/* Always mounted on an awaitGate step, so a refusal is read out (assertively)
1146
- the moment it lands. */}
1147
- {awaitsRelease && (
1148
- <div aria-live="assertive" aria-atomic="true" className="space-y-1">
1149
- {refusal && (
1150
- <p data-tour-refused="" className="text-xs text-danger">
1151
- {refusal.reason ?? labels.awaitGateRefused}
1152
- {refusal.seq % 2 === 0 ? "\u200b" : ""}
1153
- </p>
1154
- )}
1155
- {refusal && backTo && (
1156
- <Button variant="link" onClick={backTo.go} className="text-xs">
1157
- {labels.backToStep(backTo.title)}
1158
- </Button>
1159
- )}
1160
- </div>
1161
- )}
1162
- {locked && !awaitsTarget && (
1163
- <div id={hintId} className="text-center text-xs italic text-placeholder">
1164
- {gateHint}
1165
- </div>
1166
- )}
1167
- </div>
1168
- </div>
1169
- );
1170
- }