@eifi1/ui-kit 0.54.0 → 0.56.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (847) hide show
  1. package/README.md +90 -76
  2. package/dist/admin/plan-change.js +2 -2
  3. package/dist/admin/plan-change.js.map +1 -1
  4. package/dist/admin/user-roster.d.ts +6 -0
  5. package/dist/admin/user-roster.js +4 -0
  6. package/dist/admin/user-roster.js.map +1 -1
  7. package/dist/billing/billing-labels.d.ts +26 -0
  8. package/dist/billing/billing-labels.js +9 -0
  9. package/dist/billing/billing-labels.js.map +1 -1
  10. package/dist/billing/subscription-standing.d.ts +61 -0
  11. package/dist/billing/subscription-standing.js +51 -0
  12. package/dist/billing/subscription-standing.js.map +1 -0
  13. package/dist/billing/usage-meter.d.ts +52 -0
  14. package/dist/billing/usage-meter.js +52 -0
  15. package/dist/billing/usage-meter.js.map +1 -0
  16. package/dist/chart.d.ts +1 -0
  17. package/dist/chart.js +4 -0
  18. package/dist/chart.js.map +1 -1
  19. package/dist/components/alert-banner.js +2 -3
  20. package/dist/components/alert-banner.js.map +1 -1
  21. package/dist/components/amount-input.js +3 -15
  22. package/dist/components/amount-input.js.map +1 -1
  23. package/dist/components/autocomplete.js +2 -2
  24. package/dist/components/autocomplete.js.map +1 -1
  25. package/dist/components/bulk-action-bar.js +2 -1
  26. package/dist/components/bulk-action-bar.js.map +1 -1
  27. package/dist/components/button.d.ts +35 -1
  28. package/dist/components/button.js +6 -9
  29. package/dist/components/button.js.map +1 -1
  30. package/dist/components/calendar-heatmap.js +2 -2
  31. package/dist/components/calendar-heatmap.js.map +1 -1
  32. package/dist/components/camera-button.d.ts +89 -0
  33. package/dist/components/camera-button.js +122 -0
  34. package/dist/components/camera-button.js.map +1 -0
  35. package/dist/components/camera-capture.d.ts +66 -0
  36. package/dist/components/camera-capture.js +190 -0
  37. package/dist/components/camera-capture.js.map +1 -0
  38. package/dist/components/camera-labels.d.ts +20 -0
  39. package/dist/components/camera-labels.js +15 -0
  40. package/dist/components/camera-labels.js.map +1 -0
  41. package/dist/components/chart-edge.d.ts +9 -0
  42. package/dist/components/chart-edge.js +14 -3
  43. package/dist/components/chart-edge.js.map +1 -1
  44. package/dist/components/chart-zoom-core.js +34 -29
  45. package/dist/components/chart-zoom-core.js.map +1 -1
  46. package/dist/components/checkbox-group.js +1 -1
  47. package/dist/components/checkbox-group.js.map +1 -1
  48. package/dist/components/combobox-core.js +3 -2
  49. package/dist/components/combobox-core.js.map +1 -1
  50. package/dist/components/combobox.js +2 -2
  51. package/dist/components/combobox.js.map +1 -1
  52. package/dist/components/consent-again-notice-labels.d.ts +25 -0
  53. package/dist/components/consent-again-notice-labels.js +15 -0
  54. package/dist/components/consent-again-notice-labels.js.map +1 -0
  55. package/dist/components/consent-again-notice.d.ts +85 -0
  56. package/dist/components/consent-again-notice.js +94 -0
  57. package/dist/components/consent-again-notice.js.map +1 -0
  58. package/dist/components/country-select.js +2 -7
  59. package/dist/components/country-select.js.map +1 -1
  60. package/dist/components/currency-select.js +2 -2
  61. package/dist/components/currency-select.js.map +1 -1
  62. package/dist/components/danger-confirm.js +2 -2
  63. package/dist/components/danger-confirm.js.map +1 -1
  64. package/dist/components/data-table-column-settings.js +2 -2
  65. package/dist/components/data-table-column-settings.js.map +1 -1
  66. package/dist/components/data-table-fit.js.map +1 -1
  67. package/dist/components/data-table-virtual.js +13 -3
  68. package/dist/components/data-table-virtual.js.map +1 -1
  69. package/dist/components/date-field.js +2 -2
  70. package/dist/components/date-field.js.map +1 -1
  71. package/dist/components/date-picker.js +2 -2
  72. package/dist/components/date-picker.js.map +1 -1
  73. package/dist/components/date-range-picker.js +2 -6
  74. package/dist/components/date-range-picker.js.map +1 -1
  75. package/dist/components/dialog-frame.d.ts +3 -1
  76. package/dist/components/dialog-frame.js.map +1 -1
  77. package/dist/components/dropdown.js +7 -3
  78. package/dist/components/dropdown.js.map +1 -1
  79. package/dist/components/entity-combobox.js +2 -2
  80. package/dist/components/entity-combobox.js.map +1 -1
  81. package/dist/components/field-parts.d.ts +108 -6
  82. package/dist/components/field-parts.js +59 -6
  83. package/dist/components/field-parts.js.map +1 -1
  84. package/dist/components/field-suggestion-labels.d.ts +2 -0
  85. package/dist/components/field-suggestion-labels.js +10 -0
  86. package/dist/components/field-suggestion-labels.js.map +1 -0
  87. package/dist/components/field.js +1 -1
  88. package/dist/components/field.js.map +1 -1
  89. package/dist/components/file-button.d.ts +1 -1
  90. package/dist/components/file-button.js.map +1 -1
  91. package/dist/components/floating-panel.d.ts +7 -6
  92. package/dist/components/floating-panel.js +3 -17
  93. package/dist/components/floating-panel.js.map +1 -1
  94. package/dist/components/form-actions.d.ts +3 -2
  95. package/dist/components/form-actions.js.map +1 -1
  96. package/dist/components/hover-menu.js +3 -2
  97. package/dist/components/hover-menu.js.map +1 -1
  98. package/dist/components/icon-button.d.ts +23 -5
  99. package/dist/components/icon-button.js +7 -8
  100. package/dist/components/icon-button.js.map +1 -1
  101. package/dist/components/inline-confirm.js +2 -1
  102. package/dist/components/inline-confirm.js.map +1 -1
  103. package/dist/components/inline-entity-combobox.js +2 -2
  104. package/dist/components/inline-entity-combobox.js.map +1 -1
  105. package/dist/components/input.js +2 -2
  106. package/dist/components/input.js.map +1 -1
  107. package/dist/components/jump-calendar.js +3 -3
  108. package/dist/components/jump-calendar.js.map +1 -1
  109. package/dist/components/legal.d.ts +13 -1
  110. package/dist/components/legal.js +12 -0
  111. package/dist/components/legal.js.map +1 -1
  112. package/dist/components/legended-series-chart.d.ts +83 -0
  113. package/dist/components/legended-series-chart.js +77 -0
  114. package/dist/components/legended-series-chart.js.map +1 -0
  115. package/dist/components/lightbox.js +2 -1
  116. package/dist/components/lightbox.js.map +1 -1
  117. package/dist/components/mini-calendar.js +13 -5
  118. package/dist/components/mini-calendar.js.map +1 -1
  119. package/dist/components/modal.d.ts +23 -2
  120. package/dist/components/modal.js +24 -6
  121. package/dist/components/modal.js.map +1 -1
  122. package/dist/components/month-picker.d.ts +1 -1
  123. package/dist/components/month-picker.js +6 -6
  124. package/dist/components/month-picker.js.map +1 -1
  125. package/dist/components/multi-entity-combobox.js +2 -2
  126. package/dist/components/multi-entity-combobox.js.map +1 -1
  127. package/dist/components/multi-select.js +2 -6
  128. package/dist/components/multi-select.js.map +1 -1
  129. package/dist/components/number-input.js +2 -2
  130. package/dist/components/number-input.js.map +1 -1
  131. package/dist/components/page-header-layout.d.ts +18 -0
  132. package/dist/components/page-header-layout.js +23 -0
  133. package/dist/components/page-header-layout.js.map +1 -0
  134. package/dist/components/page-header-skeleton.d.ts +41 -0
  135. package/dist/components/page-header-skeleton.js +52 -0
  136. package/dist/components/page-header-skeleton.js.map +1 -0
  137. package/dist/components/page-header.js +4 -17
  138. package/dist/components/page-header.js.map +1 -1
  139. package/dist/components/popover.js +7 -2
  140. package/dist/components/popover.js.map +1 -1
  141. package/dist/components/release-notes-labels.d.ts +16 -0
  142. package/dist/components/release-notes-labels.js +18 -0
  143. package/dist/components/release-notes-labels.js.map +1 -0
  144. package/dist/components/release-notes.d.ts +65 -0
  145. package/dist/components/release-notes.js +65 -0
  146. package/dist/components/release-notes.js.map +1 -0
  147. package/dist/components/select.js +2 -2
  148. package/dist/components/select.js.map +1 -1
  149. package/dist/components/series-chart-labels.d.ts +9 -0
  150. package/dist/components/series-chart-labels.js +3 -1
  151. package/dist/components/series-chart-labels.js.map +1 -1
  152. package/dist/components/series-chart.d.ts +5 -0
  153. package/dist/components/series-chart.js +89 -36
  154. package/dist/components/series-chart.js.map +1 -1
  155. package/dist/components/toggle-group.js +3 -2
  156. package/dist/components/toggle-group.js.map +1 -1
  157. package/dist/components/treemap-layout.js.map +1 -1
  158. package/dist/components/treemap.d.ts +17 -15
  159. package/dist/components/treemap.js +167 -85
  160. package/dist/components/treemap.js.map +1 -1
  161. package/dist/eslint/index.js +1 -1
  162. package/dist/eslint/role-utilities.d.ts +2 -2
  163. package/dist/eslint/role-utilities.js.map +1 -1
  164. package/dist/feedback/feedback-inbox-page.d.ts +260 -0
  165. package/dist/feedback/feedback-inbox-page.js +207 -0
  166. package/dist/feedback/feedback-inbox-page.js.map +1 -0
  167. package/dist/feedback/feedback-vocabulary.js +2 -2
  168. package/dist/feedback/feedback-vocabulary.js.map +1 -1
  169. package/dist/feedback.d.ts +1 -0
  170. package/dist/feedback.js +6 -0
  171. package/dist/feedback.js.map +1 -1
  172. package/dist/hooks/use-debounce.d.ts +32 -5
  173. package/dist/hooks/use-debounce.js +6 -5
  174. package/dist/hooks/use-debounce.js.map +1 -1
  175. package/dist/hooks/use-file-picker.d.ts +3 -1
  176. package/dist/hooks/use-file-picker.js.map +1 -1
  177. package/dist/hooks/use-focus-trap.d.ts +19 -3
  178. package/dist/hooks/use-focus-trap.js +15 -5
  179. package/dist/hooks/use-focus-trap.js.map +1 -1
  180. package/dist/hooks/use-has-camera.d.ts +36 -0
  181. package/dist/hooks/use-has-camera.js +53 -0
  182. package/dist/hooks/use-has-camera.js.map +1 -0
  183. package/dist/hooks/use-hotkey.js +1 -10
  184. package/dist/hooks/use-hotkey.js.map +1 -1
  185. package/dist/hooks/use-overlay-history.d.ts +6 -1
  186. package/dist/hooks/use-overlay-history.js +10 -2
  187. package/dist/hooks/use-overlay-history.js.map +1 -1
  188. package/dist/i18n/defaults.js +11 -1
  189. package/dist/i18n/defaults.js.map +1 -1
  190. package/dist/i18n/german.js +75 -3
  191. package/dist/i18n/german.js.map +1 -1
  192. package/dist/i18n/kit-labels.d.ts +20 -0
  193. package/dist/i18n/kit-labels.js.map +1 -1
  194. package/dist/i18n/locales/en.js +92 -4
  195. package/dist/i18n/locales/en.js.map +3 -3
  196. package/dist/i18n/locales/es.js +71 -3
  197. package/dist/i18n/locales/es.js.map +1 -1
  198. package/dist/i18n/locales/fr.js +72 -2
  199. package/dist/i18n/locales/fr.js.map +1 -1
  200. package/dist/i18n/locales/hu.js +74 -3
  201. package/dist/i18n/locales/hu.js.map +1 -1
  202. package/dist/i18n/locales/it.js +74 -3
  203. package/dist/i18n/locales/it.js.map +1 -1
  204. package/dist/i18n/locales/zh.js +71 -3
  205. package/dist/i18n/locales/zh.js.map +1 -1
  206. package/dist/i18n/review.js +22 -1
  207. package/dist/i18n/review.js.map +1 -1
  208. package/dist/index.d.ts +24 -5
  209. package/dist/index.js +35 -1
  210. package/dist/index.js.map +1 -1
  211. package/dist/landing/landing-labels.d.ts +8 -0
  212. package/dist/landing/landing-labels.js +2 -1
  213. package/dist/landing/landing-labels.js.map +1 -1
  214. package/dist/lib/changelog.d.ts +130 -0
  215. package/dist/lib/changelog.js +137 -0
  216. package/dist/lib/changelog.js.map +1 -0
  217. package/dist/lib/clipboard-minus.js +2 -2
  218. package/dist/lib/clipboard-minus.js.map +1 -1
  219. package/dist/lib/dates.d.ts +29 -3
  220. package/dist/lib/dates.js +41 -12
  221. package/dist/lib/dates.js.map +1 -1
  222. package/dist/lib/editable-content.d.ts +33 -0
  223. package/dist/lib/editable-content.js +15 -0
  224. package/dist/lib/editable-content.js.map +1 -0
  225. package/dist/lib/focus-left.d.ts +47 -1
  226. package/dist/lib/focus-left.js +11 -2
  227. package/dist/lib/focus-left.js.map +1 -1
  228. package/dist/lib/server-wake.d.ts +49 -9
  229. package/dist/lib/server-wake.js +25 -14
  230. package/dist/lib/server-wake.js.map +1 -1
  231. package/dist/lib/session-refresh.d.ts +53 -0
  232. package/dist/lib/session-refresh.js +27 -1
  233. package/dist/lib/session-refresh.js.map +1 -1
  234. package/dist/rhf/fields.js +3 -3
  235. package/dist/rhf/fields.js.map +1 -1
  236. package/dist/shell/app-shell.d.ts +25 -1
  237. package/dist/shell/app-shell.js +3 -1
  238. package/dist/shell/app-shell.js.map +1 -1
  239. package/dist/shell/dev-menu.d.ts +3 -0
  240. package/dist/shell/dev-menu.js +4 -2
  241. package/dist/shell/dev-menu.js.map +1 -1
  242. package/dist/shell/held-changes-banner-labels.d.ts +23 -0
  243. package/dist/shell/held-changes-banner-labels.js +14 -0
  244. package/dist/shell/held-changes-banner-labels.js.map +1 -0
  245. package/dist/shell/held-changes-banner.d.ts +75 -0
  246. package/dist/shell/held-changes-banner.js +106 -0
  247. package/dist/shell/held-changes-banner.js.map +1 -0
  248. package/dist/shell/sync-status-indicator.d.ts +27 -12
  249. package/dist/shell/sync-status-indicator.js +13 -4
  250. package/dist/shell/sync-status-indicator.js.map +1 -1
  251. package/dist/shell/top-bar-parts-labels.d.ts +5 -0
  252. package/dist/shell/top-bar-parts-labels.js +3 -1
  253. package/dist/shell/top-bar-parts-labels.js.map +1 -1
  254. package/dist/shell.d.ts +2 -0
  255. package/dist/shell.js +3 -0
  256. package/dist/shell.js.map +1 -1
  257. package/dist/sync/engine.d.ts +11 -2
  258. package/dist/sync/engine.js +13 -5
  259. package/dist/sync/engine.js.map +1 -1
  260. package/dist/sync/hooks.d.ts +3 -2
  261. package/dist/sync/hooks.js +4 -2
  262. package/dist/sync/hooks.js.map +1 -1
  263. package/dist/testing/css-variables.generated.d.ts +2 -2
  264. package/dist/testing/css-variables.generated.js +1 -1
  265. package/dist/testing/css-variables.generated.js.map +1 -1
  266. package/dist/theme/chart-palette.d.ts +18 -0
  267. package/dist/theme/chart-palette.js +17 -1
  268. package/dist/theme/chart-palette.js.map +1 -1
  269. package/dist/theme/contrast-tokens.d.ts +3 -3
  270. package/dist/theme/contrast-tokens.js.map +1 -1
  271. package/dist/theme/contrast.d.ts +4 -4
  272. package/dist/theme/contrast.js.map +1 -1
  273. package/dist/tour/tour-overlay.js +2 -1
  274. package/dist/tour/tour-overlay.js.map +1 -1
  275. package/package.json +9 -12
  276. package/tokens.css +19 -54
  277. package/src/account/account-parts.ts +0 -47
  278. package/src/account/account-settings-labels.ts +0 -240
  279. package/src/account/account-settings.tsx +0 -698
  280. package/src/account/data-export-setting-labels.ts +0 -20
  281. package/src/account/data-export-setting.tsx +0 -200
  282. package/src/account/delete-account-setting-labels.ts +0 -33
  283. package/src/account/delete-account-setting.tsx +0 -342
  284. package/src/account/email-change-setting-labels.ts +0 -31
  285. package/src/account/email-change-setting.tsx +0 -443
  286. package/src/account/passkeys-setting.tsx +0 -445
  287. package/src/account/sessions-setting-labels.ts +0 -24
  288. package/src/account/sessions-setting.tsx +0 -283
  289. package/src/admin/admin-action-confirm-labels.ts +0 -19
  290. package/src/admin/admin-action-confirm.tsx +0 -509
  291. package/src/admin/admin-action-log-labels.ts +0 -83
  292. package/src/admin/admin-action-log.tsx +0 -464
  293. package/src/admin/admin-area-labels.ts +0 -114
  294. package/src/admin/admin-forbidden.tsx +0 -75
  295. package/src/admin/admin-overview.tsx +0 -258
  296. package/src/admin/admin-parts.ts +0 -68
  297. package/src/admin/admin-sections.tsx +0 -208
  298. package/src/admin/admin-tool-links.tsx +0 -90
  299. package/src/admin/invitations-panel-labels.ts +0 -31
  300. package/src/admin/invitations-panel.tsx +0 -516
  301. package/src/admin/mail-test-card-labels.ts +0 -19
  302. package/src/admin/mail-test-card.tsx +0 -189
  303. package/src/admin/plan-change-labels.ts +0 -5
  304. package/src/admin/plan-change.tsx +0 -474
  305. package/src/admin/reviewer-scope-editor-labels.ts +0 -16
  306. package/src/admin/reviewer-scope-editor.tsx +0 -224
  307. package/src/admin/role-select-labels.ts +0 -16
  308. package/src/admin/role-select.tsx +0 -282
  309. package/src/admin/transfer-ownership-dialog-labels.ts +0 -20
  310. package/src/admin/transfer-ownership-dialog.tsx +0 -162
  311. package/src/admin/user-roster-labels.ts +0 -17
  312. package/src/admin/user-roster.tsx +0 -559
  313. package/src/auth/accept-invitation-labels.ts +0 -21
  314. package/src/auth/accept-invitation.tsx +0 -210
  315. package/src/auth/auth-errors-labels.ts +0 -23
  316. package/src/auth/auth-errors.ts +0 -439
  317. package/src/auth/complete-name-dialog-labels.ts +0 -16
  318. package/src/auth/complete-name-dialog.tsx +0 -253
  319. package/src/auth/email-tag.ts +0 -75
  320. package/src/auth/forgot-password-form-labels.ts +0 -20
  321. package/src/auth/forgot-password-form.tsx +0 -221
  322. package/src/auth/form-rules.ts +0 -40
  323. package/src/auth/new-password-fields.tsx +0 -85
  324. package/src/auth/not-found-page-labels.ts +0 -12
  325. package/src/auth/not-found-page.tsx +0 -95
  326. package/src/auth/register-form-labels.ts +0 -31
  327. package/src/auth/register-form.tsx +0 -456
  328. package/src/auth/reset-password-form-labels.ts +0 -27
  329. package/src/auth/reset-password-form.tsx +0 -341
  330. package/src/auth/sign-in-form-labels.ts +0 -44
  331. package/src/auth/sign-in-form.tsx +0 -858
  332. package/src/auth/status-parts.tsx +0 -132
  333. package/src/auth/verify-email-labels.ts +0 -26
  334. package/src/auth/verify-email.tsx +0 -445
  335. package/src/billing/billing-banner.tsx +0 -258
  336. package/src/billing/billing-labels.ts +0 -381
  337. package/src/billing/billing-lock.ts +0 -108
  338. package/src/billing/billing-overview.ts +0 -157
  339. package/src/billing/billing-standing.ts +0 -80
  340. package/src/billing/cancel-request.ts +0 -97
  341. package/src/billing/cancel-subscription.tsx +0 -98
  342. package/src/billing/checkout-processing.ts +0 -394
  343. package/src/billing/checkout-return.ts +0 -90
  344. package/src/billing/pay-page.ts +0 -330
  345. package/src/billing/plan-card.tsx +0 -562
  346. package/src/billing/plan-change-labels.ts +0 -66
  347. package/src/billing/plan-limit-notice.tsx +0 -148
  348. package/src/billing/plan-limit-toast.tsx +0 -90
  349. package/src/billing/plan-limit.ts +0 -52
  350. package/src/billing/plan-price.ts +0 -98
  351. package/src/billing/plan-switch.tsx +0 -216
  352. package/src/billing/provider-page.ts +0 -84
  353. package/src/billing/subscription-actions.tsx +0 -247
  354. package/src/billing/subscription-status-chip.tsx +0 -95
  355. package/src/chart.ts +0 -103
  356. package/src/components/account-chips-labels.ts +0 -16
  357. package/src/components/account-chips.tsx +0 -474
  358. package/src/components/alert-banner.tsx +0 -670
  359. package/src/components/amount-input.tsx +0 -816
  360. package/src/components/appearance-labels.ts +0 -63
  361. package/src/components/authed-image-labels.ts +0 -11
  362. package/src/components/authed-image.tsx +0 -209
  363. package/src/components/autocomplete.tsx +0 -645
  364. package/src/components/breadcrumbs-labels.ts +0 -10
  365. package/src/components/breadcrumbs.tsx +0 -205
  366. package/src/components/bulk-action-bar-labels.ts +0 -11
  367. package/src/components/bulk-action-bar.tsx +0 -443
  368. package/src/components/button-group.tsx +0 -223
  369. package/src/components/button-look.ts +0 -256
  370. package/src/components/button.tsx +0 -339
  371. package/src/components/calculator.tsx +0 -341
  372. package/src/components/calendar-heatmap-labels.ts +0 -15
  373. package/src/components/calendar-heatmap.tsx +0 -600
  374. package/src/components/card.tsx +0 -377
  375. package/src/components/chart-edge.ts +0 -106
  376. package/src/components/chart-figure.tsx +0 -35
  377. package/src/components/chart-height.ts +0 -30
  378. package/src/components/chart-zoom-core.tsx +0 -627
  379. package/src/components/chart-zoom.tsx +0 -22
  380. package/src/components/chart.tsx +0 -554
  381. package/src/components/checkbox-group.tsx +0 -247
  382. package/src/components/checkbox.tsx +0 -346
  383. package/src/components/chip-input.tsx +0 -370
  384. package/src/components/chip-labels.ts +0 -13
  385. package/src/components/chip.tsx +0 -843
  386. package/src/components/choice-card.tsx +0 -544
  387. package/src/components/column-mapper-labels.ts +0 -38
  388. package/src/components/column-mapper.tsx +0 -655
  389. package/src/components/combobox-core.tsx +0 -1321
  390. package/src/components/combobox-suggestions.tsx +0 -131
  391. package/src/components/combobox.tsx +0 -716
  392. package/src/components/confirm-context.ts +0 -7
  393. package/src/components/confirm-dialog-labels.ts +0 -13
  394. package/src/components/confirm-dialog.tsx +0 -341
  395. package/src/components/copy-button-labels.ts +0 -13
  396. package/src/components/copy-button.tsx +0 -192
  397. package/src/components/country-select-labels.ts +0 -11
  398. package/src/components/country-select.tsx +0 -539
  399. package/src/components/currency-option-list.tsx +0 -188
  400. package/src/components/currency-select.tsx +0 -343
  401. package/src/components/danger-confirm-labels.ts +0 -20
  402. package/src/components/danger-confirm.tsx +0 -987
  403. package/src/components/data-table-cells.tsx +0 -118
  404. package/src/components/data-table-column-settings.tsx +0 -198
  405. package/src/components/data-table-filter-popover.tsx +0 -289
  406. package/src/components/data-table-filters.ts +0 -315
  407. package/src/components/data-table-fit.ts +0 -301
  408. package/src/components/data-table-groups.tsx +0 -288
  409. package/src/components/data-table-head.tsx +0 -280
  410. package/src/components/data-table-labels.ts +0 -198
  411. package/src/components/data-table-leading-row.tsx +0 -58
  412. package/src/components/data-table-mobile.tsx +0 -1117
  413. package/src/components/data-table-pagination.tsx +0 -202
  414. package/src/components/data-table-resize.ts +0 -188
  415. package/src/components/data-table-row-actions.tsx +0 -302
  416. package/src/components/data-table-row.tsx +0 -496
  417. package/src/components/data-table-selection.ts +0 -71
  418. package/src/components/data-table-shared.tsx +0 -287
  419. package/src/components/data-table-sort.ts +0 -163
  420. package/src/components/data-table-virtual.ts +0 -576
  421. package/src/components/data-table.tsx +0 -2598
  422. package/src/components/date-field.tsx +0 -684
  423. package/src/components/date-format-setting.tsx +0 -64
  424. package/src/components/date-picker.tsx +0 -404
  425. package/src/components/date-range-picker.tsx +0 -518
  426. package/src/components/description-list-labels.ts +0 -9
  427. package/src/components/description-list.tsx +0 -386
  428. package/src/components/dialog-frame-labels.ts +0 -7
  429. package/src/components/dialog-frame.tsx +0 -284
  430. package/src/components/disclosure.tsx +0 -476
  431. package/src/components/dropdown.tsx +0 -461
  432. package/src/components/empty-state.tsx +0 -136
  433. package/src/components/entity-combobox.tsx +0 -422
  434. package/src/components/error-boundary-labels.ts +0 -20
  435. package/src/components/error-boundary.tsx +0 -675
  436. package/src/components/facing-pair.ts +0 -93
  437. package/src/components/field-base-labels.ts +0 -20
  438. package/src/components/field-base.tsx +0 -656
  439. package/src/components/field-parts.tsx +0 -825
  440. package/src/components/field-strip.tsx +0 -129
  441. package/src/components/field.tsx +0 -206
  442. package/src/components/file-button.tsx +0 -295
  443. package/src/components/file-dropzone.tsx +0 -559
  444. package/src/components/floating-panel-labels.ts +0 -10
  445. package/src/components/floating-panel.tsx +0 -828
  446. package/src/components/focus-ring.ts +0 -16
  447. package/src/components/form-actions-labels.ts +0 -11
  448. package/src/components/form-actions.tsx +0 -578
  449. package/src/components/full-bleed-dialog.tsx +0 -294
  450. package/src/components/grouped-picker.tsx +0 -184
  451. package/src/components/help-popover.tsx +0 -117
  452. package/src/components/hover-menu.tsx +0 -343
  453. package/src/components/iban-input-labels.ts +0 -14
  454. package/src/components/iban-input.tsx +0 -236
  455. package/src/components/icon-button.tsx +0 -959
  456. package/src/components/icon-picker-labels.ts +0 -13
  457. package/src/components/icon-picker.tsx +0 -232
  458. package/src/components/image-grid-labels.ts +0 -11
  459. package/src/components/image-grid.tsx +0 -202
  460. package/src/components/inline-confirm.tsx +0 -116
  461. package/src/components/inline-edit-field-labels.ts +0 -11
  462. package/src/components/inline-edit-field.tsx +0 -552
  463. package/src/components/inline-entity-combobox.tsx +0 -849
  464. package/src/components/input.tsx +0 -394
  465. package/src/components/jump-calendar.tsx +0 -265
  466. package/src/components/language-select.tsx +0 -93
  467. package/src/components/legal-labels.ts +0 -105
  468. package/src/components/legal-page.tsx +0 -711
  469. package/src/components/legal.tsx +0 -668
  470. package/src/components/lightbox-labels.ts +0 -18
  471. package/src/components/lightbox.tsx +0 -399
  472. package/src/components/line-items-labels.ts +0 -14
  473. package/src/components/line-items.tsx +0 -602
  474. package/src/components/list-labels.ts +0 -12
  475. package/src/components/list.tsx +0 -870
  476. package/src/components/loading-state.tsx +0 -78
  477. package/src/components/measured-grid-labels.ts +0 -25
  478. package/src/components/measured-grid.tsx +0 -837
  479. package/src/components/menu-item.tsx +0 -241
  480. package/src/components/mini-calendar-labels.ts +0 -17
  481. package/src/components/mini-calendar.tsx +0 -792
  482. package/src/components/modal.tsx +0 -534
  483. package/src/components/money-draft.ts +0 -83
  484. package/src/components/money-field.tsx +0 -76
  485. package/src/components/month-grid.tsx +0 -229
  486. package/src/components/month-picker-labels.ts +0 -22
  487. package/src/components/month-picker.tsx +0 -1087
  488. package/src/components/multi-entity-combobox.tsx +0 -369
  489. package/src/components/multi-select.tsx +0 -376
  490. package/src/components/nav-pills.tsx +0 -198
  491. package/src/components/number-field.tsx +0 -327
  492. package/src/components/number-input.tsx +0 -559
  493. package/src/components/numeric-field.ts +0 -169
  494. package/src/components/numpad-sheet.tsx +0 -285
  495. package/src/components/one-time-code-input.tsx +0 -270
  496. package/src/components/page-contents-labels.ts +0 -9
  497. package/src/components/page-contents.tsx +0 -282
  498. package/src/components/page-header-context.ts +0 -8
  499. package/src/components/page-header.tsx +0 -298
  500. package/src/components/password-strength-labels.ts +0 -22
  501. package/src/components/password-strength.tsx +0 -241
  502. package/src/components/phone-input-labels.ts +0 -10
  503. package/src/components/phone-input.tsx +0 -282
  504. package/src/components/picker-sheet.tsx +0 -330
  505. package/src/components/pie-chart-labels.ts +0 -40
  506. package/src/components/pie-chart.tsx +0 -480
  507. package/src/components/popover-labels.ts +0 -14
  508. package/src/components/popover.tsx +0 -268
  509. package/src/components/progress-bar-labels.ts +0 -10
  510. package/src/components/progress-bar.tsx +0 -479
  511. package/src/components/qr-code.tsx +0 -76
  512. package/src/components/reauth-dialog-labels.ts +0 -13
  513. package/src/components/reauth-dialog.tsx +0 -265
  514. package/src/components/row-actions-labels.ts +0 -12
  515. package/src/components/row-actions.tsx +0 -795
  516. package/src/components/scroll-area.tsx +0 -123
  517. package/src/components/search-field.tsx +0 -192
  518. package/src/components/select.tsx +0 -294
  519. package/src/components/separator.tsx +0 -33
  520. package/src/components/series-chart-axes.ts +0 -342
  521. package/src/components/series-chart-budget.ts +0 -150
  522. package/src/components/series-chart-labels.ts +0 -33
  523. package/src/components/series-chart-thin.ts +0 -180
  524. package/src/components/series-chart-ticks.ts +0 -194
  525. package/src/components/series-chart.tsx +0 -1906
  526. package/src/components/server-wake-labels.ts +0 -11
  527. package/src/components/server-wake.tsx +0 -129
  528. package/src/components/settings-fields.tsx +0 -237
  529. package/src/components/share-card-labels.ts +0 -30
  530. package/src/components/share-card.tsx +0 -675
  531. package/src/components/signature-pad-labels.ts +0 -24
  532. package/src/components/signature-pad.tsx +0 -747
  533. package/src/components/signed-amount-labels.ts +0 -10
  534. package/src/components/signed-amount.tsx +0 -336
  535. package/src/components/skeleton.tsx +0 -80
  536. package/src/components/slider.tsx +0 -338
  537. package/src/components/sparkline-labels.ts +0 -14
  538. package/src/components/sparkline.tsx +0 -322
  539. package/src/components/spinner.tsx +0 -81
  540. package/src/components/stat-tile-labels.ts +0 -15
  541. package/src/components/stat-tile.tsx +0 -754
  542. package/src/components/status-dot.tsx +0 -170
  543. package/src/components/swatch-picker-labels.ts +0 -10
  544. package/src/components/swatch-picker.tsx +0 -283
  545. package/src/components/swipeable-row.tsx +0 -386
  546. package/src/components/switch.tsx +0 -273
  547. package/src/components/table-skeleton.tsx +0 -136
  548. package/src/components/table.tsx +0 -647
  549. package/src/components/tabs-labels.ts +0 -13
  550. package/src/components/tabs.tsx +0 -693
  551. package/src/components/text-link.tsx +0 -359
  552. package/src/components/text.tsx +0 -150
  553. package/src/components/textarea.tsx +0 -330
  554. package/src/components/tile-radio.tsx +0 -332
  555. package/src/components/time-input.tsx +0 -121
  556. package/src/components/toast-labels.ts +0 -12
  557. package/src/components/toast.tsx +0 -519
  558. package/src/components/toggle-group.tsx +0 -752
  559. package/src/components/toggle-legend.tsx +0 -394
  560. package/src/components/tooltip.tsx +0 -1149
  561. package/src/components/translation-review-editor.tsx +0 -290
  562. package/src/components/translation-review-labels.ts +0 -181
  563. package/src/components/translation-review-parts.tsx +0 -272
  564. package/src/components/translation-review.tsx +0 -1240
  565. package/src/components/tree-view.tsx +0 -589
  566. package/src/components/treemap-labels.ts +0 -47
  567. package/src/components/treemap-layout.ts +0 -210
  568. package/src/components/treemap.tsx +0 -1184
  569. package/src/components/trigger-aria.ts +0 -44
  570. package/src/components/use-anchor-dir.ts +0 -20
  571. package/src/components/use-mobile-reveal.ts +0 -62
  572. package/src/components/use-table-state.ts +0 -753
  573. package/src/components/user-avatar.tsx +0 -116
  574. package/src/components/wizard-stepper.tsx +0 -42
  575. package/src/components/write-lock-labels.ts +0 -10
  576. package/src/components/write-lock.tsx +0 -253
  577. package/src/currencies.ts +0 -90
  578. package/src/data-table.ts +0 -42
  579. package/src/demo/demo-banner.tsx +0 -153
  580. package/src/demo/demo-countdown.ts +0 -136
  581. package/src/demo/demo-ended.tsx +0 -90
  582. package/src/demo/demo-labels.ts +0 -78
  583. package/src/demo/demo-session.ts +0 -32
  584. package/src/demo/demo-start.tsx +0 -156
  585. package/src/eslint/index.ts +0 -161
  586. package/src/eslint/role-utilities.generated.ts +0 -146
  587. package/src/eslint/role-utilities.ts +0 -233
  588. package/src/feedback/feedback-attachment-download.tsx +0 -77
  589. package/src/feedback/feedback-attachment-labels.ts +0 -37
  590. package/src/feedback/feedback-attachment.tsx +0 -1239
  591. package/src/feedback/feedback-capture.ts +0 -287
  592. package/src/feedback/feedback-comment-thread.tsx +0 -353
  593. package/src/feedback/feedback-context-labels.ts +0 -11
  594. package/src/feedback/feedback-context.tsx +0 -245
  595. package/src/feedback/feedback-crash.ts +0 -547
  596. package/src/feedback/feedback-diagnostics.tsx +0 -41
  597. package/src/feedback/feedback-dialog-labels.ts +0 -29
  598. package/src/feedback/feedback-dialog.tsx +0 -452
  599. package/src/feedback/feedback-entry-file.tsx +0 -150
  600. package/src/feedback/feedback-inbox.tsx +0 -552
  601. package/src/feedback/feedback-labels.ts +0 -144
  602. package/src/feedback/feedback-menu-labels.ts +0 -12
  603. package/src/feedback/feedback-menu.tsx +0 -177
  604. package/src/feedback/feedback-mutation.ts +0 -20
  605. package/src/feedback/feedback-page-link.ts +0 -90
  606. package/src/feedback/feedback-public-labels.ts +0 -81
  607. package/src/feedback/feedback-public-list.tsx +0 -524
  608. package/src/feedback/feedback-public-switch.tsx +0 -102
  609. package/src/feedback/feedback-public-types.ts +0 -101
  610. package/src/feedback/feedback-record.ts +0 -428
  611. package/src/feedback/feedback-replies-context.ts +0 -9
  612. package/src/feedback/feedback-replies.tsx +0 -343
  613. package/src/feedback/feedback-rework-entry-chip.tsx +0 -18
  614. package/src/feedback/feedback-row-detail-labels.ts +0 -31
  615. package/src/feedback/feedback-row-detail.tsx +0 -871
  616. package/src/feedback/feedback-status-undo.ts +0 -109
  617. package/src/feedback/feedback-submit-dialog.tsx +0 -131
  618. package/src/feedback/feedback-submit.tsx +0 -270
  619. package/src/feedback/feedback-swipe.tsx +0 -192
  620. package/src/feedback/feedback-table-labels.ts +0 -27
  621. package/src/feedback/feedback-table.tsx +0 -912
  622. package/src/feedback/feedback-thread-labels.ts +0 -22
  623. package/src/feedback/feedback-thread-parts-labels.ts +0 -41
  624. package/src/feedback/feedback-thread.tsx +0 -905
  625. package/src/feedback/feedback-vocabulary.ts +0 -263
  626. package/src/feedback/feedback-vote-button.tsx +0 -124
  627. package/src/feedback.ts +0 -116
  628. package/src/hooks/use-anchored-panel.ts +0 -396
  629. package/src/hooks/use-anchored-rect.ts +0 -77
  630. package/src/hooks/use-announce.ts +0 -85
  631. package/src/hooks/use-authed-src.ts +0 -167
  632. package/src/hooks/use-body-scroll-lock.ts +0 -119
  633. package/src/hooks/use-breakpoint.ts +0 -133
  634. package/src/hooks/use-close-transition.ts +0 -107
  635. package/src/hooks/use-copy-to-clipboard.ts +0 -122
  636. package/src/hooks/use-debounce.ts +0 -114
  637. package/src/hooks/use-dismiss.ts +0 -371
  638. package/src/hooks/use-document-title.ts +0 -33
  639. package/src/hooks/use-file-drop.ts +0 -121
  640. package/src/hooks/use-file-picker-labels.ts +0 -28
  641. package/src/hooks/use-file-picker.tsx +0 -359
  642. package/src/hooks/use-focus-trap.ts +0 -199
  643. package/src/hooks/use-hotkey.ts +0 -212
  644. package/src/hooks/use-large-text.ts +0 -41
  645. package/src/hooks/use-long-press.ts +0 -140
  646. package/src/hooks/use-media-query.ts +0 -39
  647. package/src/hooks/use-mounted.ts +0 -39
  648. package/src/hooks/use-noindex.ts +0 -37
  649. package/src/hooks/use-overlay-history.ts +0 -714
  650. package/src/hooks/use-row-swipe.ts +0 -207
  651. package/src/hooks/use-search-param-state.ts +0 -434
  652. package/src/hooks/use-windowed-rows.ts +0 -225
  653. package/src/i18n/defaults.ts +0 -267
  654. package/src/i18n/german.ts +0 -2059
  655. package/src/i18n/kit-labels.tsx +0 -1003
  656. package/src/i18n/languages.ts +0 -349
  657. package/src/i18n/locales/de-CH.ts +0 -24
  658. package/src/i18n/locales/en.ts +0 -267
  659. package/src/i18n/locales/es.ts +0 -1999
  660. package/src/i18n/locales/fr.ts +0 -2037
  661. package/src/i18n/locales/hu.ts +0 -2004
  662. package/src/i18n/locales/it.ts +0 -2014
  663. package/src/i18n/locales/zh.ts +0 -1912
  664. package/src/i18n/plurals.ts +0 -86
  665. package/src/i18n/review.ts +0 -475
  666. package/src/i18n/shared-labels.ts +0 -138
  667. package/src/i18n/swiss.ts +0 -29
  668. package/src/index.ts +0 -1191
  669. package/src/landing/access.ts +0 -93
  670. package/src/landing/landing-actions.tsx +0 -97
  671. package/src/landing/landing-labels.ts +0 -59
  672. package/src/landing/landing-sections.tsx +0 -341
  673. package/src/landing/page-seo.ts +0 -261
  674. package/src/landing/public-header.tsx +0 -121
  675. package/src/landing/public-page.tsx +0 -106
  676. package/src/landing/routing.tsx +0 -225
  677. package/src/lib/broadcast.ts +0 -52
  678. package/src/lib/calc.ts +0 -323
  679. package/src/lib/chip-edge-snap.ts +0 -212
  680. package/src/lib/clipboard-minus.ts +0 -107
  681. package/src/lib/clipping.ts +0 -34
  682. package/src/lib/cn.ts +0 -28
  683. package/src/lib/column-mapping.ts +0 -234
  684. package/src/lib/countries.ts +0 -91
  685. package/src/lib/data-attributes.ts +0 -14
  686. package/src/lib/date-format.ts +0 -227
  687. package/src/lib/dates.ts +0 -288
  688. package/src/lib/day-format.ts +0 -96
  689. package/src/lib/decimal-marks.ts +0 -108
  690. package/src/lib/describe-failure.ts +0 -18
  691. package/src/lib/device-settings.ts +0 -147
  692. package/src/lib/direction.ts +0 -74
  693. package/src/lib/document-navigation.ts +0 -17
  694. package/src/lib/document-title.ts +0 -41
  695. package/src/lib/download.ts +0 -172
  696. package/src/lib/float-clearance.ts +0 -70
  697. package/src/lib/floating-stack.ts +0 -70
  698. package/src/lib/focus-left.ts +0 -156
  699. package/src/lib/format.ts +0 -585
  700. package/src/lib/http-status.ts +0 -38
  701. package/src/lib/iban.ts +0 -251
  702. package/src/lib/ime.ts +0 -24
  703. package/src/lib/intl-cache.ts +0 -27
  704. package/src/lib/iso-day.ts +0 -13
  705. package/src/lib/lazy-with-fallback.ts +0 -82
  706. package/src/lib/logger.ts +0 -69
  707. package/src/lib/minus.ts +0 -50
  708. package/src/lib/path-pattern.ts +0 -55
  709. package/src/lib/person-name.ts +0 -155
  710. package/src/lib/phone.ts +0 -208
  711. package/src/lib/plain-text.ts +0 -22
  712. package/src/lib/presence.ts +0 -18
  713. package/src/lib/qr-encode.ts +0 -444
  714. package/src/lib/quiet-focus.ts +0 -32
  715. package/src/lib/reduced-motion.ts +0 -22
  716. package/src/lib/refs.ts +0 -22
  717. package/src/lib/round.ts +0 -43
  718. package/src/lib/safe-storage.ts +0 -119
  719. package/src/lib/server-wake.ts +0 -315
  720. package/src/lib/session-refresh.ts +0 -472
  721. package/src/lib/share-format.ts +0 -18
  722. package/src/lib/status-tone.ts +0 -43
  723. package/src/lib/strip-fade.ts +0 -287
  724. package/src/lib/table-text.ts +0 -554
  725. package/src/lib/text-case.ts +0 -19
  726. package/src/lib/text-match.ts +0 -169
  727. package/src/lib/thenable.ts +0 -19
  728. package/src/lib/translation-review.ts +0 -769
  729. package/src/notifications/device-zone-report.ts +0 -67
  730. package/src/notifications/feedback-notification-types-labels.ts +0 -33
  731. package/src/notifications/feedback-notification-types.ts +0 -71
  732. package/src/notifications/notification-bell.tsx +0 -119
  733. package/src/notifications/notification-inbox.tsx +0 -309
  734. package/src/notifications/notification-parts.tsx +0 -81
  735. package/src/notifications/notification-types-setting.tsx +0 -406
  736. package/src/notifications/notification-types.ts +0 -89
  737. package/src/notifications/notifications-labels.ts +0 -287
  738. package/src/notifications/push-device-setting.tsx +0 -230
  739. package/src/notifications/push-devices-setting.tsx +0 -374
  740. package/src/notifications/push-worker.ts +0 -168
  741. package/src/notifications/quiet-hours-setting.tsx +0 -238
  742. package/src/notifications/unsubscribe-panel.tsx +0 -200
  743. package/src/notifications/use-push-device.ts +0 -448
  744. package/src/offline/local-first.ts +0 -100
  745. package/src/offline/pwa-update-prompt-labels.ts +0 -9
  746. package/src/offline/pwa-update-prompt.tsx +0 -78
  747. package/src/offline/query-persistence.ts +0 -391
  748. package/src/offline/service-worker-updates.ts +0 -81
  749. package/src/offline/shared-computer-labels.ts +0 -8
  750. package/src/offline/shared-computer.tsx +0 -87
  751. package/src/offline/sign-out-pending-dialog-labels.ts +0 -21
  752. package/src/offline/sign-out-pending-dialog.tsx +0 -135
  753. package/src/offline.ts +0 -37
  754. package/src/push-worker.ts +0 -25
  755. package/src/rhf/fields.tsx +0 -2187
  756. package/src/rhf/form-core.tsx +0 -324
  757. package/src/rhf/form.tsx +0 -12
  758. package/src/rhf/line-items.tsx +0 -135
  759. package/src/rhf/use-rhf-wizard-step.ts +0 -104
  760. package/src/rhf.ts +0 -21
  761. package/src/search/command-palette-labels.ts +0 -16
  762. package/src/search/command-palette.tsx +0 -624
  763. package/src/search/global-search-labels.ts +0 -13
  764. package/src/search/global-search.tsx +0 -660
  765. package/src/search/search-index.ts +0 -283
  766. package/src/search/use-command-key.ts +0 -23
  767. package/src/search.ts +0 -14
  768. package/src/settings/device-reset-setting-labels.ts +0 -20
  769. package/src/settings/device-reset-setting.tsx +0 -116
  770. package/src/settings/settings-card-classes.ts +0 -11
  771. package/src/settings/settings-catalogue.ts +0 -150
  772. package/src/settings/settings-context.ts +0 -33
  773. package/src/settings/settings-heading.tsx +0 -67
  774. package/src/settings/settings-labels.ts +0 -87
  775. package/src/settings/settings-layout.tsx +0 -471
  776. package/src/settings/settings-section.tsx +0 -108
  777. package/src/settings/use-account-appearance.ts +0 -148
  778. package/src/settings/use-account-language.ts +0 -146
  779. package/src/settings/use-settings-focus.ts +0 -128
  780. package/src/settings/use-settings-route.ts +0 -258
  781. package/src/shell/account-menu-language.tsx +0 -130
  782. package/src/shell/account-menu-text-size.tsx +0 -80
  783. package/src/shell/admin-menu.tsx +0 -183
  784. package/src/shell/app-shell-labels.ts +0 -11
  785. package/src/shell/app-shell.tsx +0 -1560
  786. package/src/shell/auth-layout.tsx +0 -186
  787. package/src/shell/company-switcher-labels.ts +0 -13
  788. package/src/shell/company-switcher.tsx +0 -136
  789. package/src/shell/dev-menu.tsx +0 -257
  790. package/src/shell/fill-height.tsx +0 -45
  791. package/src/shell/language-code.ts +0 -5
  792. package/src/shell/option-switcher-menu.tsx +0 -84
  793. package/src/shell/sync-status-indicator.tsx +0 -303
  794. package/src/shell/top-bar-actions.tsx +0 -87
  795. package/src/shell/top-bar-brand.tsx +0 -78
  796. package/src/shell/top-bar-parts-labels.ts +0 -148
  797. package/src/shell/top-bar.tsx +0 -40
  798. package/src/shell/topbar-action-menu.tsx +0 -567
  799. package/src/shell/topbar-controls.tsx +0 -269
  800. package/src/shell/tour-menu.tsx +0 -187
  801. package/src/shell.ts +0 -108
  802. package/src/sync/db.ts +0 -129
  803. package/src/sync/engine.ts +0 -1011
  804. package/src/sync/hooks.ts +0 -98
  805. package/src/sync/testing.ts +0 -73
  806. package/src/sync/wire.ts +0 -61
  807. package/src/sync.ts +0 -37
  808. package/src/table-text.ts +0 -8
  809. package/src/testing/css-variables.generated.ts +0 -112
  810. package/src/testing/css-variables.ts +0 -189
  811. package/src/testing/index.ts +0 -29
  812. package/src/testing/react.ts +0 -58
  813. package/src/testing/tour.ts +0 -41
  814. package/src/testing/viewport.ts +0 -357
  815. package/src/theme/chart-palette.ts +0 -232
  816. package/src/theme/color.ts +0 -272
  817. package/src/theme/contrast-tokens.ts +0 -268
  818. package/src/theme/contrast.ts +0 -250
  819. package/src/theme/palette-derive.ts +0 -825
  820. package/src/theme/palette-presets.ts +0 -544
  821. package/src/theme/palette-store.ts +0 -108
  822. package/src/theme/text-size.ts +0 -289
  823. package/src/theme/theme-store.ts +0 -157
  824. package/src/tour/tour-catalogue-labels.ts +0 -75
  825. package/src/tour/tour-catalogue.tsx +0 -335
  826. package/src/tour/tour-dock.ts +0 -134
  827. package/src/tour/tour-engine.ts +0 -37
  828. package/src/tour/tour-gates.ts +0 -218
  829. package/src/tour/tour-guide-button.tsx +0 -64
  830. package/src/tour/tour-guide-labels.ts +0 -15
  831. package/src/tour/tour-info.ts +0 -144
  832. package/src/tour/tour-labels.ts +0 -23
  833. package/src/tour/tour-overlay.tsx +0 -1170
  834. package/src/tour/tour.tsx +0 -750
  835. package/src/tour/use-tour-progress.ts +0 -671
  836. package/src/tour/use-tour-url-sync.ts +0 -266
  837. package/src/tour.ts +0 -21
  838. package/src/vite-env.d.ts +0 -23
  839. package/src/wizard/stepper-nav.tsx +0 -360
  840. package/src/wizard/types.ts +0 -275
  841. package/src/wizard/use-wizard.ts +0 -560
  842. package/src/wizard/validation.ts +0 -39
  843. package/src/wizard/wizard-context.tsx +0 -74
  844. package/src/wizard/wizard-labels.ts +0 -29
  845. package/src/wizard/wizard-step.tsx +0 -76
  846. package/src/wizard/wizard-summary.tsx +0 -84
  847. package/src/wizard.ts +0 -15
@@ -1,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
- }