@eifi1/ui-kit 0.48.2 → 0.50.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 (377) hide show
  1. package/README.md +34 -16
  2. package/dist/admin/admin-action-confirm.js +1 -1
  3. package/dist/admin/admin-action-confirm.js.map +1 -1
  4. package/dist/admin/invitations-panel.js +5 -1
  5. package/dist/admin/invitations-panel.js.map +1 -1
  6. package/dist/admin/user-roster.d.ts +24 -12
  7. package/dist/admin/user-roster.js +21 -6
  8. package/dist/admin/user-roster.js.map +1 -1
  9. package/dist/auth/accept-invitation.js +2 -2
  10. package/dist/auth/accept-invitation.js.map +1 -1
  11. package/dist/auth/not-found-page.js +1 -1
  12. package/dist/auth/not-found-page.js.map +1 -1
  13. package/dist/auth/reset-password-form.js +2 -2
  14. package/dist/auth/reset-password-form.js.map +1 -1
  15. package/dist/auth/verify-email.d.ts +9 -1
  16. package/dist/auth/verify-email.js +5 -3
  17. package/dist/auth/verify-email.js.map +1 -1
  18. package/dist/billing/plan-card.js +2 -2
  19. package/dist/billing/plan-card.js.map +1 -1
  20. package/dist/components/amount-input.d.ts +2 -1
  21. package/dist/components/amount-input.js +3 -2
  22. package/dist/components/amount-input.js.map +1 -1
  23. package/dist/components/autocomplete.js +1 -0
  24. package/dist/components/autocomplete.js.map +1 -1
  25. package/dist/components/breadcrumbs.d.ts +19 -1
  26. package/dist/components/breadcrumbs.js +11 -4
  27. package/dist/components/breadcrumbs.js.map +1 -1
  28. package/dist/components/button-look.d.ts +37 -7
  29. package/dist/components/button-look.js +33 -6
  30. package/dist/components/button-look.js.map +1 -1
  31. package/dist/components/button.d.ts +4 -1
  32. package/dist/components/button.js +2 -2
  33. package/dist/components/button.js.map +1 -1
  34. package/dist/components/calendar-heatmap.js +2 -1
  35. package/dist/components/calendar-heatmap.js.map +1 -1
  36. package/dist/components/chart-edge.d.ts +10 -0
  37. package/dist/components/chart-edge.js +57 -0
  38. package/dist/components/chart-edge.js.map +1 -0
  39. package/dist/components/chart.js +2 -1
  40. package/dist/components/chart.js.map +1 -1
  41. package/dist/components/chip.d.ts +8 -1
  42. package/dist/components/chip.js +4 -1
  43. package/dist/components/chip.js.map +1 -1
  44. package/dist/components/combobox-core.js +1 -0
  45. package/dist/components/combobox-core.js.map +1 -1
  46. package/dist/components/combobox-suggestions.js +1 -0
  47. package/dist/components/combobox-suggestions.js.map +1 -1
  48. package/dist/components/confirm-context.d.ts +5 -0
  49. package/dist/components/confirm-context.js +7 -0
  50. package/dist/components/confirm-context.js.map +1 -0
  51. package/dist/components/confirm-dialog.js +3 -3
  52. package/dist/components/confirm-dialog.js.map +1 -1
  53. package/dist/components/currency-select.d.ts +28 -2
  54. package/dist/components/currency-select.js +56 -10
  55. package/dist/components/currency-select.js.map +1 -1
  56. package/dist/components/danger-confirm.d.ts +2 -2
  57. package/dist/components/danger-confirm.js +1 -1
  58. package/dist/components/danger-confirm.js.map +1 -1
  59. package/dist/components/data-table-fit.js +21 -3
  60. package/dist/components/data-table-fit.js.map +1 -1
  61. package/dist/components/data-table-mobile.d.ts +58 -3
  62. package/dist/components/data-table-mobile.js +147 -16
  63. package/dist/components/data-table-mobile.js.map +1 -1
  64. package/dist/components/data-table-row-actions.d.ts +2 -1
  65. package/dist/components/data-table-row-actions.js +7 -0
  66. package/dist/components/data-table-row-actions.js.map +1 -1
  67. package/dist/components/data-table-row.d.ts +1 -1
  68. package/dist/components/data-table-row.js.map +1 -1
  69. package/dist/components/data-table.d.ts +34 -1
  70. package/dist/components/data-table.js +37 -10
  71. package/dist/components/data-table.js.map +1 -1
  72. package/dist/components/dropdown.js +1 -0
  73. package/dist/components/dropdown.js.map +1 -1
  74. package/dist/components/error-boundary.js +2 -2
  75. package/dist/components/error-boundary.js.map +1 -1
  76. package/dist/components/floating-panel.d.ts +36 -13
  77. package/dist/components/floating-panel.js +27 -7
  78. package/dist/components/floating-panel.js.map +1 -1
  79. package/dist/components/form-actions.d.ts +1 -1
  80. package/dist/components/form-actions.js +1 -1
  81. package/dist/components/form-actions.js.map +1 -1
  82. package/dist/components/full-bleed-dialog.js +1 -0
  83. package/dist/components/full-bleed-dialog.js.map +1 -1
  84. package/dist/components/icon-button.d.ts +11 -0
  85. package/dist/components/icon-button.js +7 -5
  86. package/dist/components/icon-button.js.map +1 -1
  87. package/dist/components/modal.js +1 -0
  88. package/dist/components/modal.js.map +1 -1
  89. package/dist/components/nav-pills.d.ts +8 -1
  90. package/dist/components/nav-pills.js +61 -38
  91. package/dist/components/nav-pills.js.map +1 -1
  92. package/dist/components/number-input.d.ts +2 -1
  93. package/dist/components/number-input.js +6 -2
  94. package/dist/components/number-input.js.map +1 -1
  95. package/dist/components/numpad-sheet.js +2 -0
  96. package/dist/components/numpad-sheet.js.map +1 -1
  97. package/dist/components/page-header-context.d.ts +8 -0
  98. package/dist/components/page-header-context.js +7 -0
  99. package/dist/components/page-header-context.js.map +1 -0
  100. package/dist/components/page-header.d.ts +14 -2
  101. package/dist/components/page-header.js +10 -1
  102. package/dist/components/page-header.js.map +1 -1
  103. package/dist/components/picker-sheet.js +2 -0
  104. package/dist/components/picker-sheet.js.map +1 -1
  105. package/dist/components/pie-chart.js +2 -1
  106. package/dist/components/pie-chart.js.map +1 -1
  107. package/dist/components/popover.js +1 -0
  108. package/dist/components/popover.js.map +1 -1
  109. package/dist/components/progress-bar.js +5 -4
  110. package/dist/components/progress-bar.js.map +1 -1
  111. package/dist/components/reauth-dialog.js +1 -1
  112. package/dist/components/reauth-dialog.js.map +1 -1
  113. package/dist/components/row-actions-labels.js +3 -1
  114. package/dist/components/row-actions-labels.js.map +1 -1
  115. package/dist/components/row-actions.d.ts +43 -9
  116. package/dist/components/row-actions.js +78 -15
  117. package/dist/components/row-actions.js.map +1 -1
  118. package/dist/components/section-nav.d.ts +37 -0
  119. package/dist/components/section-nav.js +33 -0
  120. package/dist/components/section-nav.js.map +1 -0
  121. package/dist/components/series-chart.js +8 -3
  122. package/dist/components/series-chart.js.map +1 -1
  123. package/dist/components/share-card.js +1 -1
  124. package/dist/components/share-card.js.map +1 -1
  125. package/dist/components/signature-pad.js +1 -1
  126. package/dist/components/signature-pad.js.map +1 -1
  127. package/dist/components/sparkline.js +2 -1
  128. package/dist/components/sparkline.js.map +1 -1
  129. package/dist/components/stat-tile.js +14 -7
  130. package/dist/components/stat-tile.js.map +1 -1
  131. package/dist/components/status-dot.d.ts +5 -1
  132. package/dist/components/status-dot.js +4 -1
  133. package/dist/components/status-dot.js.map +1 -1
  134. package/dist/components/tooltip.js +1 -1
  135. package/dist/components/tooltip.js.map +1 -1
  136. package/dist/components/translation-review-editor.js +2 -2
  137. package/dist/components/translation-review-editor.js.map +1 -1
  138. package/dist/components/translation-review.js +2 -2
  139. package/dist/components/translation-review.js.map +1 -1
  140. package/dist/components/treemap.d.ts +5 -2
  141. package/dist/components/treemap.js +26 -6
  142. package/dist/components/treemap.js.map +1 -1
  143. package/dist/components/use-table-state.js +37 -6
  144. package/dist/components/use-table-state.js.map +1 -1
  145. package/dist/data-table.js.map +1 -1
  146. package/dist/demo/demo-banner.js +1 -1
  147. package/dist/demo/demo-banner.js.map +1 -1
  148. package/dist/demo/demo-ended.js +1 -1
  149. package/dist/demo/demo-ended.js.map +1 -1
  150. package/dist/demo/demo-start.js +1 -1
  151. package/dist/demo/demo-start.js.map +1 -1
  152. package/dist/eslint/index.js +1 -1
  153. package/dist/feedback/feedback-inbox.js +1 -1
  154. package/dist/feedback/feedback-inbox.js.map +1 -1
  155. package/dist/hooks/use-dismiss.d.ts +9 -1
  156. package/dist/hooks/use-dismiss.js +25 -5
  157. package/dist/hooks/use-dismiss.js.map +1 -1
  158. package/dist/hooks/use-document-title.d.ts +14 -0
  159. package/dist/hooks/use-document-title.js +22 -0
  160. package/dist/hooks/use-document-title.js.map +1 -0
  161. package/dist/i18n/defaults.js +2 -0
  162. package/dist/i18n/defaults.js.map +1 -1
  163. package/dist/i18n/german.js +20 -3
  164. package/dist/i18n/german.js.map +1 -1
  165. package/dist/i18n/kit-labels.d.ts +34 -1
  166. package/dist/i18n/kit-labels.js +43 -2
  167. package/dist/i18n/kit-labels.js.map +1 -1
  168. package/dist/i18n/locales/en.js +22 -3
  169. package/dist/i18n/locales/en.js.map +3 -3
  170. package/dist/i18n/locales/es.js +20 -3
  171. package/dist/i18n/locales/es.js.map +1 -1
  172. package/dist/i18n/locales/fr.js +20 -3
  173. package/dist/i18n/locales/fr.js.map +1 -1
  174. package/dist/i18n/locales/hu.js +20 -3
  175. package/dist/i18n/locales/hu.js.map +1 -1
  176. package/dist/i18n/locales/it.js +20 -3
  177. package/dist/i18n/locales/it.js.map +1 -1
  178. package/dist/i18n/locales/zh.js +20 -3
  179. package/dist/i18n/locales/zh.js.map +1 -1
  180. package/dist/i18n/review.js +3 -0
  181. package/dist/i18n/review.js.map +1 -1
  182. package/dist/i18n/shared-labels.js +1 -0
  183. package/dist/i18n/shared-labels.js.map +1 -1
  184. package/dist/index.d.ts +8 -1
  185. package/dist/index.js +11 -0
  186. package/dist/index.js.map +1 -1
  187. package/dist/landing/landing-actions.js +2 -2
  188. package/dist/landing/landing-actions.js.map +1 -1
  189. package/dist/landing/public-header.js +2 -2
  190. package/dist/landing/public-header.js.map +1 -1
  191. package/dist/lib/clipboard-minus.d.ts +27 -0
  192. package/dist/lib/clipboard-minus.js +63 -0
  193. package/dist/lib/clipboard-minus.js.map +1 -0
  194. package/dist/lib/data-attributes.d.ts +11 -0
  195. package/dist/lib/data-attributes.js +10 -0
  196. package/dist/lib/data-attributes.js.map +1 -0
  197. package/dist/lib/document-title.d.ts +17 -0
  198. package/dist/lib/document-title.js +29 -0
  199. package/dist/lib/document-title.js.map +1 -0
  200. package/dist/lib/float-clearance.js +8 -2
  201. package/dist/lib/float-clearance.js.map +1 -1
  202. package/dist/lib/format.d.ts +36 -10
  203. package/dist/lib/format.js +57 -11
  204. package/dist/lib/format.js.map +1 -1
  205. package/dist/lib/minus.d.ts +32 -0
  206. package/dist/lib/minus.js +14 -0
  207. package/dist/lib/minus.js.map +1 -0
  208. package/dist/lib/status-tone.d.ts +30 -0
  209. package/dist/lib/status-tone.js +17 -0
  210. package/dist/lib/status-tone.js.map +1 -0
  211. package/dist/settings/settings-layout.js +3 -2
  212. package/dist/settings/settings-layout.js.map +1 -1
  213. package/dist/shell/account-menu-language.d.ts +1 -1
  214. package/dist/shell/account-menu-language.js +9 -1
  215. package/dist/shell/account-menu-language.js.map +1 -1
  216. package/dist/shell/app-shell-labels.js +2 -1
  217. package/dist/shell/app-shell-labels.js.map +1 -1
  218. package/dist/shell/app-shell.d.ts +58 -16
  219. package/dist/shell/app-shell.js +151 -43
  220. package/dist/shell/app-shell.js.map +1 -1
  221. package/dist/shell/language-code.d.ts +3 -0
  222. package/dist/shell/language-code.js +8 -0
  223. package/dist/shell/language-code.js.map +1 -0
  224. package/dist/shell/topbar-controls.d.ts +14 -6
  225. package/dist/shell/topbar-controls.js +14 -17
  226. package/dist/shell/topbar-controls.js.map +1 -1
  227. package/dist/testing/css-variables.generated.d.ts +1 -1
  228. package/dist/testing/css-variables.generated.js +1 -1
  229. package/dist/testing/css-variables.generated.js.map +1 -1
  230. package/dist/testing/react.d.ts +25 -0
  231. package/dist/testing/react.js +19 -0
  232. package/dist/testing/react.js.map +1 -0
  233. package/dist/theme/chart-palette.d.ts +82 -15
  234. package/dist/theme/chart-palette.js +51 -24
  235. package/dist/theme/chart-palette.js.map +1 -1
  236. package/dist/theme/palette-presets.d.ts +9 -0
  237. package/dist/theme/palette-presets.js +77 -62
  238. package/dist/theme/palette-presets.js.map +1 -1
  239. package/dist/tour/tour-dock.d.ts +42 -0
  240. package/dist/tour/tour-dock.js +80 -0
  241. package/dist/tour/tour-dock.js.map +1 -0
  242. package/dist/tour/tour-gates.d.ts +71 -0
  243. package/dist/tour/tour-gates.js +114 -0
  244. package/dist/tour/tour-gates.js.map +1 -0
  245. package/dist/tour/tour-guide-button.d.ts +27 -0
  246. package/dist/tour/tour-guide-button.js +45 -0
  247. package/dist/tour/tour-guide-button.js.map +1 -0
  248. package/dist/tour/tour-guide-labels.d.ts +8 -0
  249. package/dist/tour/tour-guide-labels.js +9 -0
  250. package/dist/tour/tour-guide-labels.js.map +1 -0
  251. package/dist/tour/tour-labels.js +9 -1
  252. package/dist/tour/tour-labels.js.map +1 -1
  253. package/dist/tour/tour.d.ts +133 -9
  254. package/dist/tour/tour.js +594 -70
  255. package/dist/tour/tour.js.map +1 -1
  256. package/dist/tour/use-tour-url-sync.d.ts +5 -2
  257. package/dist/tour/use-tour-url-sync.js +7 -1
  258. package/dist/tour/use-tour-url-sync.js.map +1 -1
  259. package/dist/tour.d.ts +2 -0
  260. package/dist/tour.js +3 -0
  261. package/dist/tour.js.map +1 -1
  262. package/dist/wizard/stepper-nav.d.ts +1 -1
  263. package/dist/wizard/stepper-nav.js +18 -5
  264. package/dist/wizard/stepper-nav.js.map +1 -1
  265. package/dist/wizard/types.d.ts +11 -0
  266. package/dist/wizard/types.js.map +1 -1
  267. package/dist/wizard/use-wizard.js +11 -5
  268. package/dist/wizard/use-wizard.js.map +1 -1
  269. package/package.json +9 -1
  270. package/src/admin/admin-action-confirm.tsx +1 -1
  271. package/src/admin/invitations-panel.tsx +7 -3
  272. package/src/admin/user-roster.tsx +41 -14
  273. package/src/auth/accept-invitation.tsx +3 -3
  274. package/src/auth/not-found-page.tsx +1 -1
  275. package/src/auth/reset-password-form.tsx +3 -3
  276. package/src/auth/verify-email.tsx +13 -3
  277. package/src/billing/plan-card.tsx +2 -2
  278. package/src/components/amount-input.tsx +5 -4
  279. package/src/components/autocomplete.tsx +2 -0
  280. package/src/components/breadcrumbs.tsx +32 -4
  281. package/src/components/button-look.ts +86 -15
  282. package/src/components/button.tsx +6 -3
  283. package/src/components/calendar-heatmap.tsx +2 -1
  284. package/src/components/chart-edge.ts +73 -0
  285. package/src/components/chart.tsx +3 -1
  286. package/src/components/chip.tsx +10 -1
  287. package/src/components/combobox-core.tsx +2 -0
  288. package/src/components/combobox-suggestions.tsx +2 -0
  289. package/src/components/confirm-context.ts +7 -0
  290. package/src/components/confirm-dialog.tsx +3 -3
  291. package/src/components/currency-select.tsx +95 -6
  292. package/src/components/danger-confirm.tsx +3 -3
  293. package/src/components/data-table-fit.ts +41 -6
  294. package/src/components/data-table-mobile.tsx +259 -17
  295. package/src/components/data-table-row-actions.tsx +9 -1
  296. package/src/components/data-table-row.tsx +3 -0
  297. package/src/components/data-table.tsx +91 -19
  298. package/src/components/dropdown.tsx +2 -0
  299. package/src/components/error-boundary.tsx +2 -2
  300. package/src/components/floating-panel.tsx +67 -16
  301. package/src/components/form-actions.tsx +2 -2
  302. package/src/components/full-bleed-dialog.tsx +3 -0
  303. package/src/components/icon-button.tsx +21 -8
  304. package/src/components/modal.tsx +3 -0
  305. package/src/components/nav-pills.tsx +29 -2
  306. package/src/components/number-input.tsx +8 -3
  307. package/src/components/numpad-sheet.tsx +4 -0
  308. package/src/components/page-header-context.ts +8 -0
  309. package/src/components/page-header.tsx +34 -2
  310. package/src/components/picker-sheet.tsx +4 -0
  311. package/src/components/pie-chart.tsx +2 -1
  312. package/src/components/popover.tsx +2 -0
  313. package/src/components/progress-bar.tsx +6 -3
  314. package/src/components/reauth-dialog.tsx +1 -1
  315. package/src/components/row-actions-labels.ts +2 -0
  316. package/src/components/row-actions.tsx +154 -33
  317. package/src/components/section-nav.tsx +65 -0
  318. package/src/components/series-chart.tsx +12 -3
  319. package/src/components/share-card.tsx +1 -1
  320. package/src/components/signature-pad.tsx +1 -1
  321. package/src/components/sparkline.tsx +2 -1
  322. package/src/components/stat-tile.tsx +19 -7
  323. package/src/components/status-dot.tsx +7 -1
  324. package/src/components/tooltip.tsx +3 -1
  325. package/src/components/translation-review-editor.tsx +2 -2
  326. package/src/components/translation-review.tsx +2 -2
  327. package/src/components/treemap.tsx +34 -8
  328. package/src/components/use-table-state.ts +63 -8
  329. package/src/data-table.ts +3 -3
  330. package/src/demo/demo-banner.tsx +1 -1
  331. package/src/demo/demo-ended.tsx +1 -1
  332. package/src/demo/demo-start.tsx +1 -1
  333. package/src/feedback/feedback-inbox.tsx +1 -1
  334. package/src/hooks/use-dismiss.ts +43 -4
  335. package/src/hooks/use-document-title.ts +31 -0
  336. package/src/i18n/defaults.ts +2 -0
  337. package/src/i18n/german.ts +17 -0
  338. package/src/i18n/kit-labels.tsx +79 -1
  339. package/src/i18n/locales/es.ts +17 -0
  340. package/src/i18n/locales/fr.ts +17 -0
  341. package/src/i18n/locales/hu.ts +17 -0
  342. package/src/i18n/locales/it.ts +17 -0
  343. package/src/i18n/locales/zh.ts +17 -0
  344. package/src/i18n/review.ts +3 -0
  345. package/src/i18n/shared-labels.ts +1 -0
  346. package/src/index.ts +13 -0
  347. package/src/landing/landing-actions.tsx +2 -2
  348. package/src/landing/public-header.tsx +2 -2
  349. package/src/lib/clipboard-minus.ts +94 -0
  350. package/src/lib/data-attributes.ts +14 -0
  351. package/src/lib/document-title.ts +41 -0
  352. package/src/lib/float-clearance.ts +19 -3
  353. package/src/lib/format.ts +117 -30
  354. package/src/lib/minus.ts +50 -0
  355. package/src/lib/status-tone.ts +43 -0
  356. package/src/settings/settings-layout.tsx +3 -2
  357. package/src/shell/account-menu-language.tsx +14 -2
  358. package/src/shell/app-shell-labels.ts +1 -0
  359. package/src/shell/app-shell.tsx +291 -68
  360. package/src/shell/language-code.ts +5 -0
  361. package/src/shell/topbar-controls.tsx +35 -15
  362. package/src/testing/css-variables.generated.ts +6 -6
  363. package/src/testing/react.ts +59 -0
  364. package/src/theme/chart-palette.ts +102 -20
  365. package/src/theme/palette-presets.ts +121 -84
  366. package/src/tour/tour-dock.ts +132 -0
  367. package/src/tour/tour-gates.ts +195 -0
  368. package/src/tour/tour-guide-button.tsx +64 -0
  369. package/src/tour/tour-guide-labels.ts +15 -0
  370. package/src/tour/tour-labels.ts +8 -0
  371. package/src/tour/tour.tsx +949 -86
  372. package/src/tour/use-tour-url-sync.ts +14 -4
  373. package/src/tour.ts +3 -0
  374. package/src/wizard/stepper-nav.tsx +27 -7
  375. package/src/wizard/types.ts +12 -0
  376. package/src/wizard/use-wizard.ts +16 -9
  377. package/tokens.css +28 -18
@@ -2,7 +2,8 @@ import { createContext, useContext, useEffect, useLayoutEffect, useRef, useState
2
2
  import * as ReactRouter from "react-router";
3
3
  import { useLocation, useNavigate, type Navigator } from "react-router";
4
4
  import { useSearchParamsState } from "../hooks/use-search-param-state";
5
- import { useTourOptional } from "./tour";
5
+ import { useTourOptional, type TourStart } from "./tour";
6
+ import { devWarnings } from "./tour-gates";
6
7
 
7
8
  /* ── useTourUrlSync ─────────────────────────────────────────────────────────── */
8
9
 
@@ -11,9 +12,11 @@ export interface UseTourUrlSyncOptions {
11
12
  * Start the tour `id` at `startIndex` (0-based) — the app's launcher, which builds the
12
13
  * steps, awaits its own `prepare()` and passes `onFinish` (the completion, the points
13
14
  * toast) to `useTour().start`. An unknown id should do nothing. May return a promise:
14
- * the parameters are kept until it settles.
15
+ * the parameters are kept until it settles. Under a `TourProvider` the third argument is
16
+ * that provider's `start` (0.50, as `TourProvider launch` gets it), so one launcher serves
17
+ * both. Without a provider it is a `start` that does nothing (a development build warns).
15
18
  */
16
- launch: (id: string, options: { startIndex: number }) => void | Promise<unknown>;
19
+ launch: (id: string, options: { startIndex: number }, start: TourStart) => void | Promise<unknown>;
17
20
  /**
18
21
  * Are the facts a tour's steps are built from loaded yet (keksdose's `ready`: the
19
22
  * caches a branching tour reads)? A deep link waits for it, keeping its parameters, so
@@ -120,9 +123,11 @@ export function useTourUrlSync({ launch, ready = true, stepAliases = [] }: UseTo
120
123
  const aliases = stepAliases.join("\n");
121
124
 
122
125
  const launchRef = useRef(launch);
126
+ const startRef = useRef<TourStart>(engine?.start ?? noProviderStart);
123
127
  const activeIdRef = useRef(activeId);
124
128
  useLayoutEffect(() => {
125
129
  launchRef.current = launch;
130
+ startRef.current = engine?.start ?? noProviderStart;
126
131
  activeIdRef.current = active ? activeId : null;
127
132
  });
128
133
  /** The `tour` value last seen in the URL: a tour starts when it CHANGES to an id. */
@@ -148,7 +153,7 @@ export function useTourUrlSync({ launch, ready = true, stepAliases = [] }: UseTo
148
153
  pendingRef.current = null;
149
154
  launchingRef.current = true;
150
155
  void Promise.resolve()
151
- .then(() => launchRef.current(pending.id, { startIndex: pending.startIndex }))
156
+ .then(() => launchRef.current(pending.id, { startIndex: pending.startIndex }, startRef.current))
152
157
  .catch(() => undefined)
153
158
  .finally(() => {
154
159
  launchingRef.current = false;
@@ -183,6 +188,11 @@ export function useTourUrlSync({ launch, ready = true, stepAliases = [] }: UseTo
183
188
  }, [active, activeId, index, pathname, search, hash, settled, aliases]);
184
189
  }
185
190
 
191
+ /** `start` for a launcher run with no `TourProvider` above `useTourUrlSync`. */
192
+ const noProviderStart: TourStart = () => {
193
+ if (devWarnings()) console.warn("[ui-kit] useTourUrlSync: the launcher's start needs a TourProvider above it.");
194
+ };
195
+
186
196
  /* ── useTourCatalogueUrlState ───────────────────────────────────────────────── */
187
197
 
188
198
  /** The catalogue's state filter. */
package/src/tour.ts CHANGED
@@ -16,3 +16,6 @@ export { signOutTourProgress } from "./tour/use-tour-progress";
16
16
  export type { TourProgressAccount, TourProgressAdopt, TourProgressBody } from "./tour/use-tour-progress";
17
17
  export { useTourUrlSync, useTourCatalogueUrlState } from "./tour/use-tour-url-sync";
18
18
  export type { UseTourUrlSyncOptions, TourCatalogueFilter, TourStateFilter } from "./tour/use-tour-url-sync";
19
+ // 0.50.0: guided form tours (docs/tours-harmonization.md §11) — "Guide me" inside a form.
20
+ export { TourGuideButton, DEFAULT_TOUR_GUIDE_LABELS } from "./tour/tour-guide-button";
21
+ export type { TourGuideButtonProps, TourGuideLabels } from "./tour/tour-guide-button";
@@ -10,8 +10,9 @@ import { alertFrameClass } from "../components/alert-banner";
10
10
  import { WizardContextProvider } from "./wizard-context";
11
11
  import { DEFAULT_WIZARD_LABELS } from "./types";
12
12
  import { useKitLabels, type LabelOverride } from "../i18n/kit-labels";
13
- import type { UseWizardReturn, WizardLabels } from "./types";
13
+ import type { UseWizardReturn, WizardFinishResult, WizardLabels } from "./types";
14
14
  import type { CommitScope } from "../components/write-lock";
15
+ import { useTourGateRelease } from "../tour/tour-gates";
15
16
 
16
17
  /**
17
18
  * The chrome around a wizard: the step indicator, the step content, and the
@@ -42,7 +43,7 @@ export function StepperNav<TData extends Record<string, unknown>>({
42
43
  description,
43
44
  className,
44
45
  labels,
45
- finishVariant = "brand",
46
+ finishVariant = "accent",
46
47
  finishDisabled = false,
47
48
  finishCommit,
48
49
  finishDisabledReason,
@@ -56,7 +57,7 @@ export function StepperNav<TData extends Record<string, unknown>>({
56
57
  className?: string;
57
58
  labels?: LabelOverride<WizardLabels>;
58
59
  /** The Finish button's variant — `"danger"` for a destructive commit (an import
59
- * that replaces what is there). Default `"brand"`. Next keeps `"brand"`. */
60
+ * that replaces what is there). Default `"accent"`. Next keeps `"accent"`. */
60
61
  finishVariant?: ButtonVariant;
61
62
  /** Disable Finish for a reason of the app's own, on top of the kit's gates
62
63
  * (`canFinish`, submitting, validating). */
@@ -152,6 +153,25 @@ export function StepperNav<TData extends Record<string, unknown>>({
152
153
  // (empty data after a reload) from firing an empty submit.
153
154
  const canFinish = wizard.canFinish;
154
155
 
156
+ // A running tour's `awaitGate` steps (0.50, docs/tours-harmonization.md §11.9): Next
157
+ // releases "wizard-next" when the wizard moved and refuses it when a validator kept it
158
+ // in place; Finish releases "wizard-finish" once `onComplete` resolved and refuses it,
159
+ // with the error's message, when it threw. No-ops without a TourProvider or a tour.
160
+ const tourGates = useTourGateRelease();
161
+ // `useWizard`'s goNext/finish resolve their outcome at run time (see their types); a
162
+ // wizard object built some other way resolves nothing, and nothing is signalled.
163
+ const goNext = async () => {
164
+ const moved = (await wizard.goNext()) as unknown as boolean | undefined;
165
+ if (moved === true) tourGates.release("wizard-next");
166
+ else if (moved === false) tourGates.refuse("wizard-next");
167
+ };
168
+ const finish = async () => {
169
+ const result = (await wizard.finish()) as unknown as WizardFinishResult | undefined;
170
+ if (!result) return;
171
+ if (result.ok) tourGates.release("wizard-finish");
172
+ else tourGates.refuse("wizard-finish", result.error);
173
+ };
174
+
155
175
  // Pending while the step's validators run (an async server check): a spinner and
156
176
  // `aria-busy`, and disabled — the hook's own re-entry guard still refuses a second
157
177
  // press, this just stops it looking like the first one did nothing.
@@ -165,7 +185,7 @@ export function StepperNav<TData extends Record<string, unknown>>({
165
185
  <Button
166
186
  variant={finishVariant}
167
187
  data-tour="wizard-finish"
168
- onClick={wizard.finish}
188
+ onClick={() => void finish()}
169
189
  // The kit Button's lock: a reason (its own or, with `commit`, the provider's)
170
190
  // wins over `disabled` and keeps the button reachable, saying why.
171
191
  commit={finishCommit}
@@ -183,16 +203,16 @@ export function StepperNav<TData extends Record<string, unknown>>({
183
203
  // The last step after a commit. Nothing to finish; Done only when the app gave
184
204
  // an `onDone` — otherwise the step carries its own way out.
185
205
  forwardButton = wizard.canDone ? (
186
- <Button variant="brand" data-tour="wizard-done" onClick={wizard.done} disabled={doneDisabled}>
206
+ <Button variant="accent" data-tour="wizard-done" onClick={wizard.done} disabled={doneDisabled}>
187
207
  {stepNextLabel ?? l.done ?? DEFAULT_WIZARD_LABELS.done}
188
208
  </Button>
189
209
  ) : null;
190
210
  } else {
191
211
  forwardButton = (
192
212
  <Button
193
- variant="brand"
213
+ variant="accent"
194
214
  data-tour="wizard-next"
195
- onClick={wizard.goNext}
215
+ onClick={() => void goNext()}
196
216
  disabled={wizard.nextBlocked || pending}
197
217
  aria-busy={pending || undefined}
198
218
  >
@@ -119,6 +119,13 @@ export interface UseWizardOptions<TData extends Record<string, unknown>> {
119
119
 
120
120
  export type StepStatus = "upcoming" | "active" | "completed" | "skipped";
121
121
 
122
+
123
+ /** What `finish` resolves to at run time (0.50): whether the commit went through, and the
124
+ * error's message when `onComplete` threw. `undefined` when there was nothing to run. */
125
+ export interface WizardFinishResult {
126
+ ok: boolean;
127
+ error?: string;
128
+ }
122
129
  export interface UseWizardReturn<TData extends Record<string, unknown>> {
123
130
  // Navigation
124
131
  currentStepIndex: number;
@@ -146,12 +153,17 @@ export interface UseWizardReturn<TData extends Record<string, unknown>> {
146
153
  /** Whether the indicator may jump to `index` — a completed/skipped/active step on
147
154
  * the right side of any commit. `goToStep` refuses anything this rejects. */
148
155
  canGoToStep: (index: number) => boolean;
156
+ /** Validates the step and moves on. (0.50: at run time it resolves `true` when it
157
+ * moved, `false` when a validator kept it in place — what StepperNav tells a running
158
+ * tour, docs/tours-harmonization.md §11.9. The declared type stays `Promise<void>`.) */
149
159
  goNext: () => Promise<void>;
150
160
  /** One step back — or, on the first step, `onExit`. Refused while submitting. */
151
161
  goBack: () => void;
152
162
  goToStep: (index: number) => void;
153
163
  skip: () => void;
154
164
  cancel: () => void;
165
+ /** Validates and commits (`onComplete`). (0.50: at run time it resolves `{ ok, error? }`
166
+ * — see {@link WizardFinishResult}; the declared type stays `Promise<void>`.) */
155
167
  finish: () => Promise<void>;
156
168
  /** Leave after the post-commit steps: drops the URL param, then calls `onDone`. */
157
169
  done: () => void;
@@ -20,6 +20,7 @@ import { useKitLabels } from "../i18n/kit-labels";
20
20
  import { DEFAULT_WIZARD_LABELS } from "./types";
21
21
  import { toast } from "../components/toast";
22
22
  import type {
23
+ WizardFinishResult,
23
24
  FieldErrors,
24
25
  StepStatus,
25
26
  UseWizardOptions,
@@ -341,8 +342,8 @@ export function useWizard<TData extends Record<string, unknown>>(
341
342
  */
342
343
  const advancingRef = useRef(false);
343
344
 
344
- const goNext = useCallback(async () => {
345
- if (advancingRef.current) return;
345
+ const goNext = useCallback(async (): Promise<boolean | undefined> => {
346
+ if (advancingRef.current) return undefined;
346
347
  advancingRef.current = true;
347
348
  const from = state.currentStepIndex;
348
349
  // Pending state for the chrome (spinner, aria-busy). The ref above is still what
@@ -351,7 +352,9 @@ export function useWizard<TData extends Record<string, unknown>>(
351
352
  try {
352
353
  if (await runStepValidators()) {
353
354
  dispatch({ type: "GO_NEXT", from });
355
+ return true;
354
356
  }
357
+ return false;
355
358
  } finally {
356
359
  dispatch({ type: "SET_VALIDATING", value: false });
357
360
  advancingRef.current = false;
@@ -431,16 +434,16 @@ export function useWizard<TData extends Record<string, unknown>>(
431
434
  dispatch({ type: "SET_FIELD_ERRORS", errors: {} });
432
435
  }, []);
433
436
 
434
- const finish = useCallback(async () => {
435
- if (!onComplete || !canFinish) return;
437
+ const finish = useCallback(async (): Promise<WizardFinishResult | undefined> => {
438
+ if (!onComplete || !canFinish) return undefined;
436
439
  // A commit with steps after it happens once: those steps exist because the
437
440
  // data has been written. (A last-step commit keeps its old behaviour — the app
438
441
  // may retry Finish after `onComplete` resolved, as it always could.)
439
- if (commitStepIndex < steps.length - 1 && state.committedStepIndex !== null) return;
442
+ if (commitStepIndex < steps.length - 1 && state.committedStepIndex !== null) return undefined;
440
443
  // The same re-entry guard as `goNext`: a double-click on Finish would otherwise
441
444
  // validate twice and call `onComplete` twice — `isSubmitting` is only set once
442
445
  // validation has passed, too late to stop the second click.
443
- if (advancingRef.current) return;
446
+ if (advancingRef.current) return undefined;
444
447
  advancingRef.current = true;
445
448
  const from = state.currentStepIndex;
446
449
  try {
@@ -454,16 +457,18 @@ export function useWizard<TData extends Record<string, unknown>>(
454
457
  } finally {
455
458
  dispatch({ type: "SET_VALIDATING", value: false });
456
459
  }
457
- if (!valid) return;
460
+ if (!valid) return { ok: false };
458
461
  submittingRef.current = true;
459
462
  dispatch({ type: "SET_SUBMITTING", value: true });
460
463
  dispatch({ type: "SET_ERROR", error: null });
461
464
  try {
462
465
  await onComplete(state.data);
463
466
  dispatch({ type: "COMMITTED", from });
467
+ return { ok: true };
464
468
  } catch (err) {
465
469
  const message = err instanceof Error && err.message ? err.message : genericError;
466
470
  dispatch({ type: "SET_ERROR", error: message });
471
+ return { ok: false, error: err instanceof Error && err.message ? err.message : undefined };
467
472
  } finally {
468
473
  submittingRef.current = false;
469
474
  dispatch({ type: "SET_SUBMITTING", value: false });
@@ -507,12 +512,14 @@ export function useWizard<TData extends Record<string, unknown>>(
507
512
  canCancel,
508
513
  canDone,
509
514
  canGoToStep,
510
- goNext,
515
+ // Their outcomes are what StepperNav tells a running tour (0.50); the declared types stay
516
+ // `Promise<void>`, so an app's `let p: Promise<void> = wizard.goNext()` still compiles.
517
+ goNext: goNext as () => Promise<void>,
511
518
  goBack,
512
519
  goToStep,
513
520
  skip,
514
521
  cancel,
515
- finish,
522
+ finish: finish as () => Promise<void>,
516
523
  done,
517
524
  registerStepValidate,
518
525
  nextBlocked,
package/tokens.css CHANGED
@@ -264,15 +264,23 @@ html[data-text-size="xlarge"] {
264
264
  --status-pending: #1d4ed8; /* blue-700 — in flight */
265
265
  --status-edited: #bf6800; /* solved — dirty, not yet saved */
266
266
  --status-error: #b91c1c; /* red-700 — the save failed */
267
- --chart-1: #332288;
268
- --chart-2: #88ccee;
269
- --chart-3: #44aa99;
270
- --chart-4: #117733;
271
- --chart-5: #999933;
272
- --chart-6: #ddcc77;
273
- --chart-7: #cc6677;
274
- --chart-8: #882255;
275
- --chart-9: #aa4499;
267
+ /* Chart ramp: anyplot's eight "Imprint" hues (0.49, https://anyplot.ai/palette), the
268
+ SAME in both themes — a hue under 3:1 on the ground gets a 1px ink edge
269
+ (`chartEdge`) rather than a different colour. `--chart-9` repeats slot 1, where
270
+ `paletteFor(8)` lands. Only the two inks below change with the theme:
271
+ `--chart-ink` for totals, baselines and edges; `--chart-muted` for an "other" /
272
+ rest / disabled slice and confidence bands (`CHART_ROLES`). */
273
+ --chart-1: #009e73;
274
+ --chart-2: #c475fd;
275
+ --chart-3: #4467a3;
276
+ --chart-4: #bd8233;
277
+ --chart-5: #ae3030;
278
+ --chart-6: #2abccd;
279
+ --chart-7: #954477;
280
+ --chart-8: #99b314;
281
+ --chart-9: #009e73;
282
+ --chart-ink: #1a1a17;
283
+ --chart-muted: #6b6a63;
276
284
  }
277
285
 
278
286
  .dark {
@@ -306,15 +314,17 @@ html[data-text-size="xlarge"] {
306
314
  --status-pending: #7dd3fc; /* sky-300 */
307
315
  --status-edited: #fbbf24; /* amber-400 */
308
316
  --status-error: #fca5a5; /* red-300 */
309
- --chart-1: #7e72d6;
310
- --chart-2: #9fd8f2;
311
- --chart-3: #5fc4b0;
312
- --chart-4: #3fa45f;
313
- --chart-5: #bfbf5e;
314
- --chart-6: #e8dda0;
315
- --chart-7: #e08c9a;
316
- --chart-8: #c25a78;
317
- --chart-9: #cc78be;
317
+ --chart-1: #009e73;
318
+ --chart-2: #c475fd;
319
+ --chart-3: #4467a3;
320
+ --chart-4: #bd8233;
321
+ --chart-5: #ae3030;
322
+ --chart-6: #2abccd;
323
+ --chart-7: #954477;
324
+ --chart-8: #99b314;
325
+ --chart-9: #009e73;
326
+ --chart-ink: #f0efe8;
327
+ --chart-muted: #a8a79f;
318
328
  }
319
329
 
320
330
  /* ── Derived surface / text roles ───────────────────────────────────────────