@micha.bigler/ui-core-micha 3.14.4 → 4.0.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 (341) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +7 -0
  3. package/dist/chat/kitSxRegistry.js +9 -0
  4. package/dist/components/charts/kitSxRegistry.js +6 -0
  5. package/dist/entries/charts.js +6 -0
  6. package/dist/entries/chat.js +8 -0
  7. package/dist/entries/markdown.js +1 -0
  8. package/dist/index.js +0 -14
  9. package/dist/pages/AccountPage.js +1 -2
  10. package/dist/pages/LoginPage.js +1 -2
  11. package/dist/pages/PasswordChangePage.js +1 -2
  12. package/dist/pages/PasswordInvitePage.js +1 -2
  13. package/dist/pages/PasswordResetRequestPage.js +1 -2
  14. package/dist/pages/SignUpPage.js +1 -2
  15. package/dist/pages/SignupConfirmPage.js +1 -2
  16. package/dist/theme/kitSxEntry.js +11 -0
  17. package/dist/theme/kitSxRegistry.js +2 -15
  18. package/package.json +32 -7
  19. package/.github/workflows/ci.yml +0 -35
  20. package/.github/workflows/publish.yml +0 -126
  21. package/DESIGN.md +0 -60
  22. package/WORK_ORDERS.md +0 -150
  23. package/dev/entries.jsx +0 -721
  24. package/dev/fixtures.js +0 -26
  25. package/dev/main.jsx +0 -75
  26. package/dev/mockTransport.jsx +0 -128
  27. package/docs/CHART-LAYOUT.md +0 -157
  28. package/docs/DARK-TOKENS.md +0 -140
  29. package/docs/TYPE-SCALE.md +0 -111
  30. package/docs/messaging-deviations.md +0 -118
  31. package/index.html +0 -12
  32. package/renovate.json +0 -10
  33. package/scripts/chart-api-census.mjs +0 -415
  34. package/src/auth/AuthContext.jsx +0 -158
  35. package/src/auth/ReauthModal.jsx +0 -82
  36. package/src/auth/UserMenu.jsx +0 -121
  37. package/src/auth/apiClient.jsx +0 -232
  38. package/src/auth/authApi.jsx +0 -539
  39. package/src/auth/authConfig.jsx +0 -34
  40. package/src/auth/reauth.js +0 -47
  41. package/src/chat/ChatComposer.jsx +0 -36
  42. package/src/chat/ChatList.jsx +0 -87
  43. package/src/chat/ChatThread.jsx +0 -128
  44. package/src/chat/ChatWorkspace.jsx +0 -244
  45. package/src/chat/MarkdownReply.jsx +0 -22
  46. package/src/chat/ModelPicker.jsx +0 -85
  47. package/src/chat/api.js +0 -18
  48. package/src/chat/useChatSocket.js +0 -32
  49. package/src/chat/wire.js +0 -7
  50. package/src/components/AccessCodeManager.jsx +0 -288
  51. package/src/components/AccessCodeSingleUseToggle.jsx +0 -92
  52. package/src/components/AllowedEmailDomainsManager.jsx +0 -92
  53. package/src/components/AuthFactorRequirementCard.jsx +0 -95
  54. package/src/components/BulkInviteCsvTab.jsx +0 -198
  55. package/src/components/EmptyState.jsx +0 -38
  56. package/src/components/LoginForm.jsx +0 -159
  57. package/src/components/MFAComponent.jsx +0 -350
  58. package/src/components/MfaLoginComponent.jsx +0 -252
  59. package/src/components/MobileBottomNav.jsx +0 -82
  60. package/src/components/PasskeysComponent.jsx +0 -252
  61. package/src/components/PasswordChangeForm.jsx +0 -87
  62. package/src/components/PasswordResetRequestForm.jsx +0 -43
  63. package/src/components/PasswordSetForm.jsx +0 -97
  64. package/src/components/ProfileComponent.jsx +0 -348
  65. package/src/components/QrSignupManager.jsx +0 -404
  66. package/src/components/QrSignupValidityManager.jsx +0 -106
  67. package/src/components/RegistrationMethodsManager.jsx +0 -150
  68. package/src/components/SecurityComponent.jsx +0 -141
  69. package/src/components/SocialLoginButtons.jsx +0 -83
  70. package/src/components/SoftChip.jsx +0 -93
  71. package/src/components/StatTile.jsx +0 -39
  72. package/src/components/SupportRecoveryRequestsTab.jsx +0 -482
  73. package/src/components/TurnstileWidget.jsx +0 -99
  74. package/src/components/UserInviteComponent.jsx +0 -76
  75. package/src/components/UserListComponent.jsx +0 -618
  76. package/src/components/charts/BarChart.jsx +0 -102
  77. package/src/components/charts/ChartFrame.jsx +0 -214
  78. package/src/components/charts/LineChart.jsx +0 -126
  79. package/src/components/charts/ScatterChart.jsx +0 -299
  80. package/src/components/charts/TimeSeriesChart.jsx +0 -300
  81. package/src/components/charts/chartDefaults.js +0 -644
  82. package/src/components/charts/chartLabels.js +0 -36
  83. package/src/components/charts/exportChart.js +0 -258
  84. package/src/components/charts/formatters.js +0 -39
  85. package/src/components/charts/palette.js +0 -33
  86. package/src/components/charts/yearTickInterval.js +0 -7
  87. package/src/i18n/authTranslations.ts +0 -2651
  88. package/src/i18n/chartsTranslations.ts +0 -91
  89. package/src/i18n/chatTranslations.ts +0 -55
  90. package/src/i18n/messagingTranslations.ts +0 -120
  91. package/src/i18n/notificationsTranslations.ts +0 -32
  92. package/src/i18n/onboardingTranslations.ts +0 -29
  93. package/src/i18n/sectionNavTranslations.ts +0 -20
  94. package/src/i18n/uiCoreTranslations.js +0 -29
  95. package/src/i18n/userMenuTranslations.ts +0 -5
  96. package/src/index.js +0 -158
  97. package/src/layout/PageLayout.jsx +0 -36
  98. package/src/layout/SectionNav.jsx +0 -320
  99. package/src/messaging/AttachmentList.jsx +0 -145
  100. package/src/messaging/Composer.jsx +0 -197
  101. package/src/messaging/ConversationLaunchers.jsx +0 -51
  102. package/src/messaging/ConversationList.jsx +0 -109
  103. package/src/messaging/DirectMessageLauncher.jsx +0 -112
  104. package/src/messaging/MessageBubble.jsx +0 -183
  105. package/src/messaging/MessagingProvider.jsx +0 -0
  106. package/src/messaging/MessagingScopeConfig.jsx +0 -24
  107. package/src/messaging/PollCard.jsx +0 -163
  108. package/src/messaging/ReactionBar.jsx +0 -43
  109. package/src/messaging/ReadTicks.jsx +0 -82
  110. package/src/messaging/Thread.jsx +0 -195
  111. package/src/messaging/api.js +0 -48
  112. package/src/messaging/composerImageCompression.js +0 -35
  113. package/src/messaging/linkifyText.jsx +0 -37
  114. package/src/notifications/NotificationBell.jsx +0 -84
  115. package/src/notifications/NotificationSettings.jsx +0 -330
  116. package/src/notifications/NotificationsProvider.jsx +0 -224
  117. package/src/notifications/PopupSurface.jsx +0 -105
  118. package/src/notifications/api.js +0 -55
  119. package/src/notifications/feedApi.js +0 -18
  120. package/src/notifications/realtime.jsx +0 -138
  121. package/src/notifications/serviceWorker/sw.js +0 -50
  122. package/src/onboarding/OnboardingProvider.jsx +0 -326
  123. package/src/onboarding/OnboardingWizard.jsx +0 -61
  124. package/src/onboarding/WizardDialogShell.jsx +0 -51
  125. package/src/onboarding/api.js +0 -13
  126. package/src/onboarding/stepSelection.js +0 -16
  127. package/src/onboarding/steps/BrowserPushStep.jsx +0 -121
  128. package/src/onboarding/steps/CompleteNameStep.jsx +0 -46
  129. package/src/onboarding/steps/CookieConsentStep.jsx +0 -133
  130. package/src/onboarding/steps/PwaInstallStep.jsx +0 -47
  131. package/src/pages/AccountPage.jsx +0 -394
  132. package/src/pages/LoginPage.jsx +0 -343
  133. package/src/pages/PasswordChangePage.jsx +0 -62
  134. package/src/pages/PasswordInvitePage.jsx +0 -177
  135. package/src/pages/PasswordResetRequestPage.jsx +0 -68
  136. package/src/pages/SignUpPage.jsx +0 -268
  137. package/src/pages/SignupConfirmPage.jsx +0 -155
  138. package/src/testing/checkKitIntegration.js +0 -233
  139. package/src/theme/createAppTheme.js +0 -423
  140. package/src/theme/fonts.js +0 -3
  141. package/src/theme/index.js +0 -21
  142. package/src/theme/kitSxRegistry.js +0 -285
  143. package/src/theme/themeCompleteness.js +0 -1045
  144. package/src/theme/tokens.js +0 -478
  145. package/src/utils/auth-errors.js +0 -76
  146. package/src/utils/authService.js +0 -223
  147. package/src/utils/resolveErrorText.js +0 -28
  148. package/src/utils/webauthn.js +0 -51
  149. package/tests/AccountPage.profileStatements.test.jsx +0 -162
  150. package/tests/AccountPage.test.jsx +0 -200
  151. package/tests/AuthContext.test.jsx +0 -129
  152. package/tests/BarChart.test.jsx +0 -112
  153. package/tests/BrowserPushStep.test.jsx +0 -110
  154. package/tests/ChartFrame.test.jsx +0 -336
  155. package/tests/ConversationList.test.jsx +0 -144
  156. package/tests/CookieConsentStep.test.jsx +0 -69
  157. package/tests/EmptyState.test.jsx +0 -62
  158. package/tests/LineChart.test.jsx +0 -80
  159. package/tests/MessagingProvider.test.jsx +0 -50
  160. package/tests/MobileBottomNav.test.jsx +0 -319
  161. package/tests/NotificationBell.test.jsx +0 -60
  162. package/tests/NotificationSettings.test.jsx +0 -276
  163. package/tests/NotificationsProvider.test.jsx +0 -240
  164. package/tests/OnboardingProvider.test.jsx +0 -294
  165. package/tests/OnboardingWizard.test.jsx +0 -143
  166. package/tests/PasswordChangeForm.test.jsx +0 -70
  167. package/tests/PasswordInvitePage.test.jsx +0 -142
  168. package/tests/PasswordSetForm.test.jsx +0 -70
  169. package/tests/PopupSurface.test.jsx +0 -142
  170. package/tests/ProfileComponent.refresh.test.jsx +0 -194
  171. package/tests/QrSignupManager.registrationContext.test.jsx +0 -106
  172. package/tests/QrSignupManagerInfoBox.test.jsx +0 -49
  173. package/tests/ScatterChart.test.jsx +0 -270
  174. package/tests/SectionNav.test.jsx +0 -363
  175. package/tests/SignUpPage.test.jsx +0 -208
  176. package/tests/SoftChip.test.jsx +0 -105
  177. package/tests/StatTile.test.jsx +0 -57
  178. package/tests/Thread.test.jsx +0 -151
  179. package/tests/TimeSeriesChart.test.jsx +0 -367
  180. package/tests/UserListComponent.test.jsx +0 -192
  181. package/tests/UserMenu.test.jsx +0 -171
  182. package/tests/apiClientLanguage.test.js +0 -33
  183. package/tests/apiClientPublicPaths.test.js +0 -178
  184. package/tests/authApiLogin.test.js +0 -42
  185. package/tests/authApiRegistration.test.js +0 -31
  186. package/tests/authErrorCodeRendering.test.jsx +0 -77
  187. package/tests/authErrors.test.js +0 -74
  188. package/tests/authTranslations.test.js +0 -74
  189. package/tests/chart-api-census.test.js +0 -366
  190. package/tests/chartAxisTickBand.test.jsx +0 -95
  191. package/tests/chartDefaults.test.js +0 -902
  192. package/tests/chartLabels.test.js +0 -50
  193. package/tests/chartsPalette.test.js +0 -99
  194. package/tests/chatApi.test.js +0 -48
  195. package/tests/chatDriverNames.test.jsx +0 -71
  196. package/tests/chatExports.test.js +0 -3
  197. package/tests/chatList.test.jsx +0 -84
  198. package/tests/chatPicker.test.jsx +0 -82
  199. package/tests/chatSocket.test.jsx +0 -26
  200. package/tests/chatThread.test.jsx +0 -116
  201. package/tests/chatTranslations.test.js +0 -47
  202. package/tests/chatWorkspace.test.jsx +0 -234
  203. package/tests/checkKitIntegration.test.jsx +0 -219
  204. package/tests/createAppTheme.test.js +0 -132
  205. package/tests/createAppThemeDark.test.js +0 -127
  206. package/tests/createAppThemeLightGuard.test.js +0 -40
  207. package/tests/createAppThemePageContrast.test.js +0 -108
  208. package/tests/createAppThemeTypography.test.js +0 -53
  209. package/tests/errorCallSiteGuard.test.js +0 -32
  210. package/tests/exportChart.test.js +0 -313
  211. package/tests/feedApi.test.js +0 -46
  212. package/tests/fixtures/light-theme-baseline.json +0 -2234
  213. package/tests/i18nAggregate.test.js +0 -120
  214. package/tests/i18nGermanVariant.test.js +0 -65
  215. package/tests/loginPageErrorResolution.test.jsx +0 -102
  216. package/tests/messagingApi.test.js +0 -32
  217. package/tests/messagingChunk6.test.jsx +0 -116
  218. package/tests/messagingCompactBubble.test.jsx +0 -64
  219. package/tests/messagingComposer.test.jsx +0 -136
  220. package/tests/messagingComposerChunk5.test.jsx +0 -113
  221. package/tests/messagingContractConformance.test.js +0 -69
  222. package/tests/messagingDirectMessageLauncher.test.jsx +0 -151
  223. package/tests/messagingExports.test.js +0 -21
  224. package/tests/messagingInteractions.test.jsx +0 -136
  225. package/tests/messagingLastMessagePreview.test.jsx +0 -93
  226. package/tests/messagingLinkify.test.jsx +0 -51
  227. package/tests/messagingMessageActions.test.jsx +0 -163
  228. package/tests/messagingMsg6.test.jsx +0 -105
  229. package/tests/messagingMsg6f.test.jsx +0 -155
  230. package/tests/messagingMsg6g.test.jsx +0 -166
  231. package/tests/messagingMsg6h.test.jsx +0 -136
  232. package/tests/messagingMsg6i.test.jsx +0 -129
  233. package/tests/messagingPollRendering.test.jsx +0 -142
  234. package/tests/messagingReactionMerge.test.jsx +0 -77
  235. package/tests/messagingReadTicksTooltip.test.jsx +0 -36
  236. package/tests/messagingThreadReceipts.test.jsx +0 -178
  237. package/tests/messagingThreadingQuoting.test.jsx +0 -87
  238. package/tests/messagingUnreadLifecycle.test.jsx +0 -78
  239. package/tests/notificationsApi.test.js +0 -41
  240. package/tests/notificationsExports.test.js +0 -34
  241. package/tests/onboardingDescriptors.test.js +0 -132
  242. package/tests/packageTreeShaking.test.js +0 -126
  243. package/tests/realtime.test.jsx +0 -219
  244. package/tests/resolveErrorText.test.js +0 -72
  245. package/tests/stepSelection.test.js +0 -53
  246. package/tests/themeCompleteness.test.js +0 -626
  247. package/tests/timeSeriesLegend.test.js +0 -99
  248. package/tests/userScreenTranslations.test.jsx +0 -218
  249. package/tsconfig.build.json +0 -18
  250. package/vite.config.mjs +0 -6
  251. package/work-orders/AUTH-1.md +0 -74
  252. package/work-orders/AUTH-2.md +0 -74
  253. package/work-orders/AUTH-4.md +0 -183
  254. package/work-orders/AUTH-5.md +0 -154
  255. package/work-orders/AUTH-7.md +0 -181
  256. package/work-orders/AUTH-8.md +0 -184
  257. package/work-orders/CHART-1.md +0 -285
  258. package/work-orders/CHART-2.md +0 -222
  259. package/work-orders/CHART-3.md +0 -163
  260. package/work-orders/CHART-4.md +0 -203
  261. package/work-orders/CHART-5.md +0 -226
  262. package/work-orders/CHART-6.md +0 -428
  263. package/work-orders/CHART-7.md +0 -175
  264. package/work-orders/DX-1.md +0 -169
  265. package/work-orders/DX-2.md +0 -188
  266. package/work-orders/DX-3.md +0 -195
  267. package/work-orders/I18N-1.md +0 -254
  268. package/work-orders/I18N-3.md +0 -207
  269. package/work-orders/MSG-3.md +0 -375
  270. package/work-orders/MSG-3b.md +0 -1002
  271. package/work-orders/MSG-3c.md +0 -378
  272. package/work-orders/MSG-3d.md +0 -268
  273. package/work-orders/MSG-3e.md +0 -164
  274. package/work-orders/MSG-3f.md +0 -391
  275. package/work-orders/MSG-6e.md +0 -308
  276. package/work-orders/MSG-6f.md +0 -214
  277. package/work-orders/MSG-6g.md +0 -244
  278. package/work-orders/MSG-6h.md +0 -238
  279. package/work-orders/MSG-6i.md +0 -271
  280. package/work-orders/MSG-6j.md +0 -117
  281. package/work-orders/NOTIF-12.md +0 -214
  282. package/work-orders/NOTIF-13.md +0 -142
  283. package/work-orders/NOTIF-14.md +0 -151
  284. package/work-orders/PRIM-1.md +0 -177
  285. package/work-orders/SHELL-1.md +0 -255
  286. package/work-orders/SHELL-2.md +0 -197
  287. package/work-orders/SHELL-3.md +0 -359
  288. package/work-orders/SHELL-4.md +0 -351
  289. package/work-orders/SHELL-5.md +0 -345
  290. package/work-orders/SHELL-6.md +0 -210
  291. package/work-orders/THEME-1.md +0 -587
  292. package/work-orders/THEME-10.md +0 -303
  293. package/work-orders/THEME-11.md +0 -208
  294. package/work-orders/THEME-2.md +0 -339
  295. package/work-orders/THEME-3.md +0 -210
  296. package/work-orders/THEME-4.md +0 -271
  297. package/work-orders/THEME-5.md +0 -341
  298. package/work-orders/THEME-6.md +0 -247
  299. package/work-orders/THEME-7.md +0 -82
  300. package/work-orders/THEME-8.md +0 -211
  301. package/work-orders/THEME-9.md +0 -194
  302. package/work-orders/UCM-AUTH-10.md +0 -490
  303. package/work-orders/UCM-AUTH-11.md +0 -185
  304. package/work-orders/UCM-AUTH-12.md +0 -98
  305. package/work-orders/UCM-AUTH-13.md +0 -47
  306. package/work-orders/UCM-AUTH-9.md +0 -207
  307. package/work-orders/UCM-CHART-10.md +0 -150
  308. package/work-orders/UCM-CHART-11.md +0 -132
  309. package/work-orders/UCM-CHART-12.md +0 -348
  310. package/work-orders/UCM-CHART-13.md +0 -122
  311. package/work-orders/UCM-CHART-14.md +0 -198
  312. package/work-orders/UCM-CHART-15.md +0 -187
  313. package/work-orders/UCM-CHART-16.md +0 -169
  314. package/work-orders/UCM-CHART-17.md +0 -195
  315. package/work-orders/UCM-CHART-18.md +0 -200
  316. package/work-orders/UCM-CHART-8.md +0 -147
  317. package/work-orders/UCM-CHART-9.md +0 -265
  318. package/work-orders/UCM-CHAT-1.md +0 -190
  319. package/work-orders/UCM-CHAT-2.md +0 -75
  320. package/work-orders/UCM-CI-1.md +0 -65
  321. package/work-orders/UCM-DEP-1.md +0 -63
  322. package/work-orders/UCM-I18N-4.md +0 -226
  323. package/work-orders/UCM-I18N-5.md +0 -211
  324. package/work-orders/UCM-MSG-20.md +0 -192
  325. package/work-orders/UCM-PRIM-2.md +0 -114
  326. package/work-orders/UCM-SHELL-7.md +0 -134
  327. package/work-orders/UCM-SHELL-8.md +0 -125
  328. package/work-orders/UCM-TEST-1.md +0 -304
  329. package/work-orders/UCM-THEME-13.md +0 -69
  330. package/work-orders/UCM-THEME-14.md +0 -312
  331. package/work-orders/UCM-THEME-15.md +0 -356
  332. package/work-orders/UCM-THEME-16.md +0 -80
  333. package/work-orders/UCM-THEME-17.md +0 -111
  334. package/work-orders/UCM-THEME-18.md +0 -184
  335. package/work-orders/assets/AUTH-4-user-list-card.html +0 -407
  336. package/work-orders/assets/PRIM-1-dashboard-primitives.html +0 -624
  337. package/work-orders/assets/SHELL-2-account-navigation.html +0 -1159
  338. package/work-orders/assets/THEME-1-baseline-reference-sheet.html +0 -1352
  339. package/work-orders/assets/UCM-CHAT-1-ai-chat.html +0 -447
  340. package/work-orders/assets/UCM-THEME-13-dark-prototype.html +0 -390
  341. package/work-orders/assets/UCM-THEME-17-type-scale.html +0 -391
@@ -1,304 +0,0 @@
1
- # UCM-TEST-1: A kit integration check every app runs in its own suite
2
-
3
- # A. Envelope, authored by the Expertenchat
4
-
5
- ## Goal & expected outcome
6
-
7
- The kit's auth screens are the same code in every app, so their behaviour is accepted once, in the kit.
8
- What differs per app is **how the app wires the kit in**: its i18n setup, its providers around the kit's
9
- pages, the `i18next` instance the kit reads. Today each bump order writes its own tests for that, app by
10
- app, and the operator walked the same auth flows by hand in every app.
11
-
12
- After this order the kit ships **one exported check**, `checkKitIntegration`, that an app calls from a
13
- single test in its own suite. It returns findings in the style of `assertThemeComplete`: an empty list
14
- means the app's wiring is sound. Every later bump in every app then re-checks the wiring automatically.
15
-
16
- **Operator decisions (2026-10-01):** the check lives centrally in the kit, not as copies per app; a
17
- separate, automated staging smoke covers the runtime (`workflow-templates` `WFT-CI-31`); bumps already
18
- in flight are not held up, and apps adopt the check with their next bump.
19
-
20
- ## Context the operator established
21
-
22
- - **Precedent for the shape:** `assertThemeComplete(theme)` returns `{ findings }`, is exported from the
23
- package root (`src/index.js:12`), and apps assert `findings` equals `[]`.
24
- - **What apps load from the kit for i18n:** `uiCoreTranslations` (`src/i18n/uiCoreTranslations.js`),
25
- which spreads the auth, charts, messaging, notifications, onboarding, section-nav and user-menu
26
- catalogues. Apps spread it into their own i18next resources at start-up, **kit keys last** (e.g.
27
- `survey_app/frontend/i18n/index.js`).
28
- - **Which `i18next` the kit reads:** `apiClient` imports the **default** `i18next` instance
29
- (`src/auth/apiClient.jsx:2,13`) to send `Accept-Language`. Kit components read `t` and `i18n` from
30
- `useTranslation()` (e.g. `src/pages/LoginPage.jsx:30`). `i18next`/`react-i18next` are peer
31
- dependencies.
32
- - **What the per-app bump orders tested by hand** (`survey_app` `SVA-DEP-1`/`SVA-DEP-2`): the kit's
33
- `SignUpPage` and `PasswordInvitePage` render inside the app's providers
34
- (`survey_app/frontend/src/AuthRoutesIntegration.test.jsx`), and `i18n.exists('Auth.field.email.invalid')`
35
- holds in the app's own i18n.
36
- - **The defect this guards against end to end:** a login with a malformed e-mail showed the raw code
37
- `invalid` (`UCM-AUTH-10`). The kit's resolver fixes it, but only if the app's i18n carries the kit's
38
- keys and the kit's pages run on the app's instance.
39
- - **Consumers measured 2026-09-30:** every consumer runs `vitest` with jsdom. Some mount `LoginPage`
40
- twice (`webshop-guenter` also in `src/pages/pwa/StaffLoginPage.jsx`). Several mock `react-i18next`
41
- globally in some test files.
42
-
43
- ## The check (decided)
44
-
45
- `checkKitIntegration({ i18n, wrapper, pages })` -> `Promise<{ findings }>`, exported from the package
46
- root. `i18n` is the app's own instance, `wrapper` the app's own provider component (whatever the app
47
- puts around its routes), `pages` the kit pages the app mounts (default: the kit's auth pages that the
48
- app imports). Each finding names its check and a reason. Four checks:
49
-
50
- 1. **Catalogue.** Every key in `uiCoreTranslations` resolves through the app's `i18n` in every language
51
- that both the kit ships (`de`/`en`/`fr`/`sw`) and the app supports. A missing key is one finding,
52
- with key and language.
53
- 2. **Instance.** The default `i18next` instance is initialised and is the instance the app passed in.
54
- Otherwise the finding says what will break: `Accept-Language` is missing or wrong.
55
- 3. **Render.** Each page in `pages` renders inside `wrapper` without throwing, and no rendered text
56
- node is a raw kit key (`Auth.*` or another key of the kit's catalogues) or a bare backend code. The
57
- check stubs the kit's `apiClient` transport for its own duration, so no request leaves the test, and
58
- restores it afterwards.
59
- 4. **Error text.** `LoginPage` inside `wrapper` receives, through that stub, exactly the allauth response
60
- from the original defect (`400`, `errors[0] = {code: "invalid", param: "email", message: ...}`). The
61
- shown text equals the app-language text of `Auth.field.email.invalid`.
62
-
63
- ## Scope + non-goals
64
-
65
- In scope: the function and its four checks; its export from the package root; a `README.md` section
66
- "Consumer integration check" with the one-line test an app writes; `CHANGELOG.md`; a **minor** release.
67
-
68
- Non-goals:
69
- - No change in any app. Adoption happens per app with its next bump, as its own row.
70
- - No runtime dependency added for consumers. Rendering uses the existing peers (`react`, `react-dom`).
71
- - No check of the app's test mocks. A suite whose mocks lack `i18n` still fails in that suite, as today.
72
- - No replacement for the kit's own tests. They keep owning the kit's behaviour.
73
- - No staging or browser check (`WFT-CI-31`).
74
-
75
- ## Tier · precondition / gate
76
-
77
- - **Tier 3 · tests: each of the four checks with a passing and a failing case; the kit's existing auth
78
- and i18n tests.** A change inside shared-core, on the auth surface.
79
- - Precondition: none.
80
- - Downstream: every app adopts it with its next kit bump. `WFT-CI-31` is independent of this order.
81
-
82
- ## Risks
83
-
84
- - **A check that cannot fail is decoration.** Each check needs a test showing it reports the specific
85
- defect: a missing key, a second `i18next` instance, a wrapper that throws, a raw code on screen.
86
- - **The transport stub must not leak.** If it is not restored, it silently swallows the requests of the
87
- tests that run after it. Restore it even when a check throws.
88
- - **Kit keys that the app intentionally leaves untranslated** for a language it does not offer must not
89
- become findings. Hence "languages both support" in check 1.
90
- - **Locally, importing the kit's root module crashes vitest's worker pool on this workstation**
91
- (`fitness-monitor` `FM-15`). That is an environment issue: CI is the evidence. The check itself must not
92
- add to the import weight of tests that do not call it.
93
-
94
- ## Required tests to WRITE (you write them and run YOUR OWN new ones; the Orchestrator's run is the gate)
95
-
96
- Kit test suite, one new file:
97
-
98
- 1. A correctly wired fixture app (own `i18n` with `uiCoreTranslations`, a provider wrapper) -> `findings`
99
- equals `[]`.
100
- 2. One key removed from the fixture's resources -> exactly one catalogue finding naming that key and
101
- language.
102
- 3. The fixture passes a separate `i18next` instance -> an instance finding.
103
- 4. A wrapper that throws -> a render finding naming the page.
104
- 5. The resolver bypassed (a fixture that shows `err.code`) -> an error-text finding.
105
- 6. After the check, a request through `apiClient` is no longer stubbed.
106
-
107
- Run, do not write: the kit's existing auth and i18n tests.
108
-
109
- ## Parity guardrail
110
-
111
- No change to any existing export, component or behaviour. The function is new and test-only in purpose.
112
-
113
- ---
114
-
115
- # B. Implementation map, filled by the Orchestrator and ADDRESSED TO THE IMPLEMENTER
116
-
117
- ## Context package
118
-
119
- ### Where this lives, and what it may depend on
120
-
121
- - New file `src/testing/checkKitIntegration.js` (new subdirectory, mirroring how `src/theme/` groups
122
- `assertThemeComplete`). Export `checkKitIntegration` from `src/index.js` at the root, next to the
123
- existing theme-completeness exports (line ~10-21) — same section-style comment, same pattern.
124
- - **Hard constraint from the Non-goals: "Rendering uses the existing peers (react, react-dom)" —
125
- this explicitly does NOT include `@testing-library/react`.** Every existing kit test uses RTL, but
126
- RTL is a devDependency of THIS repo, not a declared peer dependency — if the shipped function
127
- imported it, every consuming app would need RTL in its own `node_modules` at the exact version
128
- this kit expects, silently, which is exactly the "no runtime dependency added for consumers" this
129
- WO forbids. Render with plain `react-dom/client` (`createRoot`) and `act` from `react` — verified
130
- now: `import { act } from 'react'` resolves and is a function on this repo's installed React
131
- `19.2.6` (`node -e "console.log(typeof require('react').act)"` → `function`), so use that import,
132
- not the legacy `react-dom/test-utils` path. Read rendered output via plain
133
- DOM (`container.textContent`, `document.createTreeWalker`), not `screen`/`within`.
134
- - `react-router-dom` (`^7.15.1`) and `axios` (`^1.16.1`) ARE existing peers — safe to import
135
- `MemoryRouter` and to manipulate the shared `apiClient` axios instance directly.
136
-
137
- ### The four checks, in the order the Envelope lists them
138
-
139
- 1. **Catalogue.** Import `{ uiCoreTranslations }` from `'../i18n/uiCoreTranslations'`. For each key,
140
- for each language in the INTERSECTION of the kit's shipped languages
141
- (`['de','en','fr','sw']`) and the app's own supported languages, assert
142
- `i18n.exists(key, { lng: lang })` — **not** `i18n.exists(key)` alone, which only checks the
143
- CURRENT active language; i18next's `exists`/`t` both accept an `lng` option to check a specific
144
- language without switching the instance's active one (verify this against the installed
145
- `i18next` version's own typings/source before relying on it — do not assume from memory).
146
- Derive "the app's own supported languages" with this priority (first one that yields a
147
- non-empty array): `i18n.options?.supportedLngs` (filter out falsy entries and the literal
148
- string `'cimode'`, which i18next auto-adds) → `Object.keys(i18n.options?.resources || {})` →
149
- `i18n.languages` (least reliable, only the currently-resolved fallback chain — last resort).
150
- One finding per missing `(key, lang)` pair, naming both.
151
- 2. **Instance.** Import the kit's OWN default `i18next` singleton (`import i18next from 'i18next'`
152
- — the exact same import `src/auth/apiClient.jsx` already uses). Finding if `!i18next.isInitialized`
153
- OR `i18n !== i18next` (reference inequality — the whole point is catching an app that created a
154
- SEPARATE instance via `i18next.createInstance()` and wrapped its tree in its own
155
- `I18nextProvider`, which is exactly the Risk `UCM-AUTH-10` named: the kit's `apiClient` would then
156
- send `Accept-Language` from an uninitialized, different instance). Name what breaks in the
157
- reason text (`Accept-Language` will be missing or wrong) — do not just say "mismatch".
158
- 3. **Render.** For each page component in `pages` (default: `[LoginPage, SignUpPage,
159
- PasswordInvitePage]` — the three pages `UCM-AUTH-9`/`UCM-AUTH-10` actually touched, and the same
160
- set `survey_app`'s own `AuthRoutesIntegration.test.jsx` already covers by hand), render
161
- `<MemoryRouter><Wrapper><Page /></Wrapper></MemoryRouter>` into a fresh detached `div` (own
162
- `createRoot` per page, `root.unmount()` after each, even on failure — use try/finally per page,
163
- not one try around the whole loop, so one page's render failure doesn't skip scanning the rest).
164
- Wrap the render in `act(async () => { ... })` so effects/microtasks settle before you scan.
165
- Catch a throw during render → one finding naming the page's display name (`Page.displayName ||
166
- Page.name || 'page'`) and the error message; do NOT let it abort the whole check (catch per-page,
167
- continue the loop). If it didn't throw, walk every text node
168
- (`document.createTreeWalker(container, NodeFilter.SHOW_TEXT)`) and flag any whose TRIMMED content
169
- either (a) exactly equals a key in `uiCoreTranslations` (a literal untranslated key leaking to
170
- screen — the i18next missing-key echo), or (b) matches a bare lowercase/snake_case single-token
171
- shape with no spaces, e.g. `/^[a-z][a-z0-9_]*$/` and length > 2 (the exact shape of the original
172
- defect, a raw backend code like `invalid` — tune this pattern against Required Test #5's fixture
173
- until it fires on that fixture and not on ordinary rendered prose; do not accept the first regex
174
- that merely compiles). One finding per offending text node, naming the page and the text found.
175
- 4. **Error text.** This check is not driven by the `pages` array — it ALWAYS specifically exercises
176
- `LoginPage` (imported directly by this module), because it is testing the kit's resolver wiring
177
- through a real submit flow, not generic rendering. Render `LoginPage` the same way as check 3.
178
- Stub the credentials-login POST specifically — exact path, verified now:
179
- `/api/auth/browser/v1/auth/login` (`src/auth/authConfig.jsx`'s `HEADLESS_BASE` +
180
- `src/auth/authApi.jsx:99`'s `loginWithPassword`) — to reject with EXACTLY
181
- the operator's original defect shape:
182
- `{ response: { status: 400, data: { errors: [{ code: 'invalid', param: 'email', message: '<some
183
- backend text>' }] } } }` (a plain object is sufficient — `resolveErrorText`/`extractErrorInfo`
184
- only ever read `.response?.status`/`.response?.data` off the rejected value, nothing
185
- AxiosError-specific). Fill the email/password inputs via plain DOM (`input.value = '...'` +
186
- dispatching a real `input`/`change` `Event` so React's controlled-input `onChange` fires —
187
- `Object.getOwnPropertyDescriptor` trick may be needed to set a native input value in a way React
188
- notices; this is a well-known React-testing gotcha independent of any test-utility library, look
189
- it up if the naive `input.value = x; input.dispatchEvent(new Event('input'))` doesn't trigger the
190
- controlled state update) and submit (dispatch a `submit` Event on the form, or `.click()` the
191
- submit button). `await act(async () => { ...await flush... })` until the error text renders.
192
- Assert the rendered text equals `i18n.t('Auth.field.email.invalid')` evaluated in the APP's
193
- current active language (`i18n.language`), read via the SAME walk-and-scan helper check 3 uses
194
- (do not duplicate the scanning logic — factor it into one shared helper both checks call).
195
-
196
- ### Stubbing `apiClient` — must never leak, must restore even on throw
197
-
198
- `apiClient` (`src/auth/apiClient.jsx`, default export, an axios instance) is shared, module-singleton
199
- state — the SAME instance every kit page uses. Capture `const originalAdapter =
200
- apiClient.defaults.adapter;` BEFORE check 3 starts, install a replacement
201
- (`apiClient.defaults.adapter = async (config) => { ... }`) that, by default, REJECTS every request
202
- (so check 3's page renders — which must not make real network calls at all — fail loudly if they
203
- accidentally do, rather than hanging on a real fetch), and for check 4 specifically, additionally
204
- matches on `config.url` to return the fixture rejection ONLY for the login endpoint
205
- (`HEADLESS_BASE`-relative, check `src/auth/authApi.jsx`'s `loginWithPassword` for the exact path) and
206
- the default reject-everything behaviour for anything else. **Wrap the ENTIRE checks 3+4 body in a
207
- `try { ... } finally { apiClient.defaults.adapter = originalAdapter; }`** — the restore must run even
208
- if a render throws an error this code doesn't catch, even if an `expect`-shaped helper you write
209
- itself throws. This is Required Test #6's whole point and the Risk note's explicit warning.
210
-
211
- ### `README.md` — "Consumer integration check" section
212
-
213
- One short section with the one-line test an app writes, e.g.:
214
- ```js
215
- import { checkKitIntegration } from '@micha.bigler/ui-core-micha';
216
- import i18n from '../i18n'; // the app's own initialised default i18next instance
217
- import { AppProviders } from '../AppProviders'; // whatever the app wraps its routes in
218
-
219
- it('kit integration is sound', async () => {
220
- const { findings } = await checkKitIntegration({ i18n, wrapper: AppProviders });
221
- expect(findings).toEqual([]);
222
- });
223
- ```
224
- Name the default `pages` set explicitly (`LoginPage`, `SignUpPage`, `PasswordInvitePage`) and that an
225
- app can pass its own `pages` array to cover more/fewer pages.
226
-
227
- ### Test file — new, next to the existing kit tests (e.g. `tests/checkKitIntegration.test.js`)
228
-
229
- Build ONE minimal fixture i18next instance + a trivial `Wrapper` (e.g. just renders `children`, or a
230
- thin `AuthContext.Provider` with a fake user so `LoginPage`'s own context read doesn't throw) reused
231
- across the 6 Required Tests, each test mutating ONE thing away from "correctly wired":
232
- 1. Correctly wired fixture (own real `i18next.createInstance()` seeded with `uiCoreTranslations` in
233
- all 4 kit languages, THIS instance also assigned as the global default — i.e. do not create a
234
- second competing instance for the "passing" case, since check 2 would then always fail; for a
235
- realistic "app's own instance IS the default" fixture either call `i18next.init(...)` on the
236
- real default singleton directly, matching how an app actually does it, or structure the fixture
237
- so the "instance" check specifically is satisfiable) → `findings` is `[]`.
238
- 2. Remove one key's resources for one language from the fixture → exactly one catalogue finding
239
- naming that key and language.
240
- 3. Pass a SEPARATE `i18next.createInstance()` as `i18n` instead of the default singleton → an
241
- instance finding.
242
- 4. A `wrapper` that throws during render → a render finding naming the page.
243
- 5. **The actual regression proof:** stub the login POST to reject with the operator's exact shape
244
- but WITHOUT going through the kit's resolver (simulate "the resolver bypassed" by using a fixture
245
- `LoginPage`-equivalent harness only if you must — more directly: this is best proven by reverting
246
- `resolveErrorText`'s field-key step locally, confirming check 4 then reports an error-text
247
- finding instead of passing, then restoring — narrate this in `PROGRESS` as the transient
248
- mutation proof, same pattern as `UCM-AUTH-11`/`UCM-THEME-15` in this repo, rather than leaving a
249
- permanently reverted copy in the committed suite).
250
- 6. After calling `checkKitIntegration(...)` once, assert `apiClient.defaults.adapter` is back to
251
- whatever it was before the call (capture the reference beforehand) — proves restoration even on
252
- the success path; also add a case that makes an internal step throw (e.g. a page whose render
253
- throws) and still assert the adapter was restored afterwards (the `try/finally` must cover the
254
- failure path too, not just the happy path).
255
-
256
- Run, do not write: the kit's existing auth and i18n tests (grep `tests/` for
257
- `i18nAggregate`/`authErrors`/`resolveErrorText`/`loginPageErrorResolution` — these are the
258
- directly-dependent set the Orchestrator re-runs as the gate).
259
-
260
- ## Do-not-touch / invariants
261
-
262
- - No change to any existing export, component, or behaviour (Parity guardrail) — this is a new,
263
- additive, test-only function.
264
- - Do not add `@testing-library/react` (or any other new package) to `dependencies`,
265
- `peerDependencies`, or `devDependencies` for this function's own sake.
266
- - Do not touch `apiClient.jsx`'s actual interceptors/exports — only reach into
267
- `apiClient.defaults.adapter` from the NEW module, temporarily, with a guaranteed restore.
268
-
269
- ---
270
-
271
- # C. Orchestrator only, NOT ADDRESSED TO THE IMPLEMENTER
272
-
273
- > **If you are the implementer reading this work order as your own specification: STOP at this line.**
274
- > Everything below describes what the Orchestrator does AFTER you finish. You do none of it: no
275
- > reviewers, no verification run, no register edit, no `git add`/`commit`/`push`.
276
-
277
- ### Execution directive
278
-
279
- Check `.claude/codex-status.md` first (newest-first; read it with `head`). No line for today means use
280
- Codex. Before `git push`, run `git log origin/main..HEAD` and push only if every listed commit is this
281
- order's (parallel sessions share this checkout).
282
-
283
- ### Review routing
284
-
285
- Tier 3: independent `reviewer` (all configured lenses) and `ui_reviewer`, concurrent, one batch, before
286
- the commit. No `sec_reviewer`: the function adds no runtime path, it only reads what is already there.
287
-
288
- ### Verification
289
-
290
- Run the check once against a real consumer before release. `survey_app` is on `3.9.x` and has the closest
291
- existing test (`frontend/src/AuthRoutesIntegration.test.jsx`). Do it from a scratch copy or a local pack,
292
- never by committing to that repo. Name the result in the register Notiz.
293
-
294
- ### Register + commit + release
295
-
296
- Row -> `done` with the review Notiz in the `AGENTS.md` shape and the published version. The publish
297
- runs on push to `main` when `package.json`/`src/**` change; verify it through the job log
298
- (`npm view` lags for provenance publishes). Adoption rows per app are added by the Expertenchat when
299
- each app's next bump is scoped.
300
-
301
- ### Mini-handover
302
-
303
- `Orchestrator: implement work-orders/UCM-TEST-1.md in ui-core-micha (main). git pull first, read the WO,
304
- then follow orchestrate-codex.`
@@ -1,69 +0,0 @@
1
- # UCM-THEME-13: Freeze a dark-mode baseline token set
2
-
3
- # A. Envelope, authored by the Expertenchat
4
-
5
- ## Goal & expected outcome
6
-
7
- The central token file `src/theme/tokens.js` has one light baseline palette and no dark one. This order
8
- produces the **decided** dark token set as a committed reference sheet, `docs/DARK-TOKENS.md`. The
9
- operator freezes it before `UCM-THEME-14` puts those values into code. The output is a document. No
10
- source file changes here.
11
-
12
- Operator decision (2026-09-29): dark mode gets its own work order in the kit, rather than one app keeping
13
- a raw `createTheme` for it.
14
-
15
- ## Context the operator established
16
-
17
- - **One consumer today: `webshop-guenter`.** It has a light/dark switch (`frontend/src/App.jsx:96`)
18
- and a hand-built `darkTheme` from its operator design handoff (background `#0E0B08`, paper
19
- `#171209`, primary `#D49040`, secondary `#A88868`). Its adoption, `WSG-THEME-1`, is blocked on this
20
- order and on `UCM-THEME-14`. No other app in the estate renders a dark theme (measured 2026-09-29).
21
- - The light baseline covers: the palette (primary is app identity; secondary, the status family
22
- `success/warning/error/info/stale` with `main/light/dark/contrastText` plus `text/fill/bg`,
23
- `background.default/subtle/paper`, the text inks, `divider`, `controlBorder`), `dataSeries` (six
24
- categorical colours) and `shadow.rest/overlay`. Typography, radii, spacing, density and motion do not
25
- depend on the mode.
26
-
27
- ## Scope + non-goals
28
-
29
- In scope: `docs/DARK-TOKENS.md` with a value for every **mode-dependent** light token class listed
30
- above, each with a one-line reason, and a contrast table: every text/fill pair and every
31
- `main`-on-surface pair at 3:1 or better against the dark `background.default` and `background.paper`.
32
- Follow the `design-language` skill's process: inventory first, then a structural round, then values
33
- decided in an instrument, then the freeze.
34
-
35
- Non-goals:
36
- - No change to any light value.
37
- - No code, no tests. `UCM-THEME-14` implements.
38
- - No per-app dark identity. An app's dark primary stays that app's own, just as its light one does.
39
- - No automatic switching (`prefers-color-scheme`) and no toggle component. Apps own their switch.
40
-
41
- ## Tier · precondition / gate
42
-
43
- - **Tier 2 · tests: none (document only).** It decides the future content of shared-core, but it does
44
- not change shared-core. The code change is `UCM-THEME-14`, which is Tier 3.
45
- - Precondition: none.
46
- - Gate: **the operator freezes the sheet**, and the sheet itself says so with a dated section. Until
47
- then `UCM-THEME-14` does not start.
48
-
49
- ## Risks
50
-
51
- - **A dark palette drawn from a single app's handoff becomes that app's palette for everyone.**
52
- webshop-guenter's values are one input to the inventory, not the answer. It keeps its own values as
53
- identity in any case (`WSG-THEME-1`).
54
- - **Status tints (`bg`) are the class that breaks first on dark.** A light tint over a dark page fails
55
- contrast in the other direction.
56
-
57
- ---
58
-
59
- # B. Implementation map
60
-
61
- *Not applicable. This is an Expertenchat document order, authored in-session with the operator.*
62
-
63
- ---
64
-
65
- # C. Orchestrator only, NOT ADDRESSED TO THE IMPLEMENTER
66
-
67
- > **If you are the implementer reading this: STOP.** There is no implementer for this order.
68
-
69
- Register: row -> `done` with the commit of the frozen sheet. Downstream: `UCM-THEME-14` unblocks.