@micha.bigler/ui-core-micha 3.14.4 → 4.0.1

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 +29 -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 +31 -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,312 +0,0 @@
1
- # UCM-THEME-14: Dark mode in `createAppTheme`, from the central token file
2
-
3
- # A. Envelope, authored by the Expertenchat
4
-
5
- ## Goal & expected outcome
6
-
7
- `createAppTheme({ palette: { mode: 'dark', primary }, ... })` builds a complete dark theme whose
8
- mode-dependent values come from a dark baseline palette in `src/theme/tokens.js`, next to the light
9
- one. `assertThemeComplete` judges a dark theme against its own surfaces. **The light output does not
10
- change by a single value.**
11
-
12
- Afterwards an app with a light/dark switch (today only `webshop-guenter`, `WSG-THEME-1`) can compose
13
- both of its themes through the factory.
14
-
15
- ## Value source
16
-
17
- **`docs/DARK-TOKENS.md`, frozen by the operator in `UCM-THEME-13` (2026-10-02, `7330f91`).** Every dark
18
- value in code comes from that sheet. A value the implementation needs that the sheet does not carry is a
19
- stop-and-report. Do not improvise it.
20
-
21
- ## Decided rules (operator, 2026-10-01 and 2026-10-02; amended into this order 2026-10-02)
22
-
23
- 1. **Complete baseline.** Every mode-dependent token class has its dark value from the sheet, including
24
- `ink.*`, `text.*`, `background.default/paper/subtle`, `divider`, `controlBorder.*`, all five status keys
25
- (`main/light/dark/contrastText` via `withMainShades`, plus `text/fill/fillText/bg`), `dataSeries` and
26
- `shadow.*`.
27
- 2. **Outlined first, as in light.** Resting surfaces keep `shadow.rest: none`. **Overlays get their own,
28
- lighter surface in dark**: the sheet's overlay surface (`#232A31`) is the paper of `MuiDialog`,
29
- `MuiMenu`, `MuiPopover` and `MuiDrawer` in dark, with the sheet's overlay shadow; the modal backdrop
30
- (`MuiBackdrop`) uses the sheet's scrim. Light has no such surface and does not change.
31
- 3. **Primary in dark: derived only when it fails.** An app always passes `palette.primary` (the factory
32
- requires it). In dark, that value is kept if it clears 4.5:1 on the dark page, and otherwise lightened in
33
- 0.05 steps until it does. Its `contrastText` is whichever of `#FFFFFF` and the dark page colour
34
- contrasts more. This is how "derived unless the app sets its own" is expressed in an API where every
35
- app sets one: an app that wants a particular dark primary passes one that already clears the floor
36
- (webshop-guenter `#D49040`, 7.35:1, stays). Worked examples are in the sheet.
37
- 4. **Status safety net, the dark counterpart of `UCM-THEME-15`.** On a dark page other than the baseline
38
- page, a **baseline-supplied** status `main` (and `controlBorder.error`) that would fail against the page or
39
- its own `bg` is lightened until it passes. App-supplied values are never altered (`UCM-THEME-15` rule 3,
40
- read per key off `appConfig.palette`). Never throws; capped like the darkening.
41
- 5. **Data series follow a rule, not only a list.** In dark, each light series colour is lightened until it
42
- clears 3:1 on the theme's own `background.paper`. On the baseline paper that yields exactly the sheet's
43
- list; on an app's own paper (webshop-guenter `#171209`) it adapts.
44
- 6. **Contrast surfaces are the theme's own.** In dark, every derivation and `contrastFindings` judge against
45
- the theme's page and paper, never a fixed `#FFFFFF`. Light keeps today's pair.
46
- 7. **Autofill needs no new code path.** The palette-aware block (`src/theme/createAppTheme.js:97-108`)
47
- already resolves from `background.paper` and `ink.primary` and wins over the static light block in
48
- `tokens.js`. It is correct in dark once the dark palette is in place; confirm it in a test.
49
-
50
- ## Context the operator established
51
-
52
- - `createAppTheme` (`src/theme/createAppTheme.js`) resolves the palette in three layers: the app's
53
- palette, then `BASELINE_PALETTE`, then the app's palette again. It then derives
54
- `controlBorder.focus`, builds the palette-aware component slots, and merges `BASELINE_STATIC`, those
55
- components and the app config. `palette.mode` is not read anywhere today.
56
- - **Two places assume a white page:**
57
- - `deriveFocusColour` checks 3:1 against `'#FFFFFF'` and `background.default`, and only ever
58
- **darkens** the primary. On a dark page it would have to lighten.
59
- - `contrastFindings` in `src/theme/themeCompleteness.js` checks against a fixed
60
- `white: '#FFFFFF'` (line 298) plus `page: background.default`.
61
- - `BASELINE_INTENTIONAL_DEFAULT_EXEMPTIONS` includes `palette.background.paper` with the reason "The
62
- canonical surface is deliberately MUI white". That reason is false for a dark theme.
63
- - The palette-aware slots use palette values (for example the autofill inset uses `background.paper`),
64
- so they follow the resolved palette once it is right. `tokens.js` also carries a static light `autofill`
65
- block (`#FFFFFF`, `#212529`); it is shadowed by the palette-aware one (measured 2026-10-02).
66
- - `UCM-THEME-15` (3.8.0) added `deriveDarkenedPageColour`/`deriveAlphaPageColour` next to
67
- `deriveFocusColour`; the dark branch extends those, it does not add a parallel set.
68
- - The kit has components registered against the baseline (`src/theme/kitSxRegistry.js`, `THEME-4`/
69
- `THEME-5`). A kit component that hard-codes a light value would show that value only in dark mode.
70
-
71
- ## Scope + non-goals
72
-
73
- In scope:
74
- 1. `tokens.js`: a dark baseline palette with the sheet's values, and whatever exemption entries a
75
- dark theme needs, each with a true reason.
76
- 2. `createAppTheme`: select the baseline palette by `palette.mode`. Make the focus derivation work in
77
- both directions against the mode's surfaces. Rules 2 to 6 above: the overlay surface, scrim and overlay
78
- shadow on the four overlay components in dark; the primary derivation; the status safety net; the
79
- series rule.
80
- 3. `themeCompleteness.js`: contrast checks against the theme's own surfaces, not a fixed white. Mode-
81
- specific exemptions.
82
- 4. Kit components that resolve a hard-coded light value instead of a token: **list** every one.
83
- Switching one to an existing token is in scope. Anything that needs a new token is a finding.
84
- 5. `DESIGN.md` (a dark-mode section), `CHANGELOG.md`, and a **minor** version bump. The change is
85
- additive: light output is unchanged, and dark is new.
86
-
87
- Non-goals:
88
- - No change to any light value or light behaviour.
89
- - No automatic `prefers-color-scheme` switching and no toggle component.
90
- - No consumer adoption. `WSG-THEME-1` does that in its own repo, after its own pin bump.
91
- - No change to chart components beyond reading palette tokens they already read.
92
-
93
- ## Tier · precondition / gate
94
-
95
- - **Tier 3 · tests: light-output regression guard, dark completeness, focus contrast in both modes,
96
- and the kit's existing theme tests.** A change inside shared-core (`AGENTS.md` -> Tiering).
97
- - Precondition: **`UCM-THEME-13` frozen**, and **`UCM-THEME-15` landed**. 15 generalises the focus
98
- derivation into page-derived status and border colours on the same surface pair; build the dark
99
- branch on top of it, not beside it.
100
- - Downstream: `webshop-guenter`/`WSG-THEME-1` waits for this release and for its own pin bump.
101
-
102
- ## Risks
103
-
104
- - **Ten adopted apps consume the light path.** A light regression reaches all of them on their next
105
- bump. That is why the regression guard is a required test, not a nice-to-have.
106
- - **The three-layer palette merge interacts with augmentation** (the comment at the top of `tokens.js`:
107
- only the first `createTheme` argument is augmented). A dark status entry missing
108
- `main`/`contrastText` would silently keep MUI's light hue.
109
- - **Contrast in the other direction.** Light status tints (`bg`) over a dark page, and a focus colour
110
- derived by darkening, both fail on dark.
111
- - **The `background.paper` exemption reason is currently mode-blind.** Leaving it would record a false
112
- statement as the reason in every dark theme.
113
- - **Rule 3 cannot keep a dark primary that fails the floor.** An app that deliberately wants one gets it
114
- lightened. That is intended (an accessibility floor), not a defect.
115
- - **Two sheet values sit close to their threshold** (`controlBorder.main` 3.14:1 on paper, series slot 1
116
- 3.07:1). Build them from the rules, not as literals, so a later paper change re-derives instead of
117
- silently failing.
118
-
119
- ## Required tests to WRITE (you write them and run YOUR OWN new ones; the Orchestrator's run is the gate)
120
-
121
- Kit test suite, narrow, next to the existing theme tests:
122
-
123
- 1. **Light regression guard.** For a fixed light app config, the fully resolved theme (palette,
124
- typography, shape, components, exemptions) equals the output from before this change. Show that the
125
- test fails when one light value is altered by hand. A structural test that cannot fail is
126
- decoration.
127
- 2. **Dark completeness.** `assertThemeComplete(createAppTheme({ palette: { mode: 'dark', primary } }))`
128
- has zero findings, or only exemptions with a true reason. The same check with a primary that has to be
129
- **lightened** to clear contrast.
130
- 3. **Focus contrast.** `controlBorder.focus` clears 3:1 against both page surfaces in each mode.
131
- 4. **Status family on dark.** Each status key resolves `main/light/dark/contrastText` from the dark
132
- baseline, not MUI's defaults.
133
- 5. **Primary in dark (rule 3).** On the baseline dark page: `#468AB2` stays, `#2F4F96` resolves to
134
- `#6D84B6`, `#432CA1` to `#8576C2`, each with `#14181B` as `contrastText`; `#D49040` stays.
135
- 6. **Status net (rule 4).** On webshop-guenter's page `#0E0B08` no baseline status colour moves; on a
136
- page chosen so that one fails, that one is lightened and passes; an app-supplied status `main` that
137
- fails stays exactly as supplied.
138
- 7. **Overlay surface (rule 2).** In dark, the paper of `MuiDialog`, `MuiMenu`, `MuiPopover` and `MuiDrawer`
139
- resolves to the sheet's overlay surface and `MuiBackdrop` to its scrim; the light theme's values for
140
- the same slots are unchanged (covered by test 1).
141
- 8. **Series rule (rule 5).** On the baseline paper the dark series equal the sheet's list; on
142
- `#171209` every slot clears 3:1.
143
- 9. **Autofill (rule 7).** In dark, the resolved autofill inset is the dark paper and the text is
144
- `ink.primary`.
145
-
146
- Run, do not write: the kit's existing theme and `kitSxRegistry` tests.
147
-
148
- ## Parity guardrail
149
-
150
- No light-mode change of any kind. No behaviour, API or data-contract change beyond the new `mode`
151
- branch.
152
-
153
- ---
154
-
155
- # B. Implementation map, filled by the Orchestrator and ADDRESSED TO THE IMPLEMENTER
156
-
157
- Work from this package; do not explore broadly from scratch; open only the named files to verify. If
158
- you must dig deeper, delegate to a read-only Explore sub-agent.
159
-
160
- ## Target working directory (absolute)
161
-
162
- `C:\Users\biglmi\Documents\webapps\ui-core-micha` (branch `main`). Never the workspace root.
163
-
164
- ## Context package
165
-
166
- Value source for every dark value: `docs/DARK-TOKENS.md` (read it fully first). Do not invent a value;
167
- one the sheet lacks is `RESULT: BLOCKED <value>`.
168
-
169
- **`src/theme/tokens.js`**
170
- - `BASELINE_PALETTE` (l.~52-123) is the light baseline. Add `BASELINE_PALETTE_DARK` next to it with the
171
- same shape, every key from the sheet: `ink`, `text`, `background`, `divider`, `controlBorder`
172
- (`main`/`hover`/`error`), the five status keys (use `withMainShades(main, '#14181B')` for
173
- success/warning/error/info, plus `text`/`fill`/`fillText`/`bg`; `stale` has no `main`, as in light),
174
- `dataSeries.categorical`. Do NOT hardcode series slots 1 and 5, `controlBorder.main/hover`, or the
175
- primary as literals: those are rule-derived (see below); the sheet's numbers are the expected OUTPUT.
176
- The dark `dataSeries` base is the light `SERIES_COLOURS`, lightened by the factory.
177
- - Export a dark overlay surface (`#232A31`), a dark overlay shadow (`0 8px 28px rgba(0,0,0,.45)`) and the
178
- scrim (`rgba(0,0,0,.55)`) as named constants.
179
- - `BASELINE_STATIC.shadow` (~l.200) carries `rest`/`overlay`; the dark theme needs the dark overlay value
180
- there. `BASELINE_STATIC.components` has static `MuiDialog.paper`/`MuiDrawer.paper`/`MuiMenu.paper`
181
- boxShadow `OVERLAY_SHADOW` (~l.340-355): in dark these are overridden, never edited for light.
182
- - The static light `autofill` block (~l.147) is shadowed by the palette-aware one; leave it, confirm by test.
183
- - `BASELINE_INTENTIONAL_DEFAULT_EXEMPTIONS` (end of file): the `palette.background.paper` entry says "MUI
184
- white". Provide the list by mode: in dark, drop that entry (the dark paper differs from MUI's default, so
185
- no exemption is needed), keep the others. The light list stays byte-identical.
186
-
187
- **`src/theme/createAppTheme.js`**
188
- - `createAppTheme` (l.~176): the three-layer `createTheme(app, BASELINE_PALETTE, app)` resolution. Read
189
- `appConfig.palette.mode`; `'dark'` selects `BASELINE_PALETTE_DARK` and passes `mode: 'dark'` through to the
190
- theme; anything else is the unchanged light path. Do not read `prefers-color-scheme`.
191
- - `contrastSurfaces = ['#FFFFFF', background.default]` (l.~186): in dark this must be the theme's own
192
- `[background.default, background.paper]`; light stays exactly `['#FFFFFF', default]`.
193
- - `deriveFocusColour`/`clearsContrast` (l.~48-60) only darken and use MUI `getContrastRatio`. In dark add a
194
- lightening counterpart (lighten in 0.05 steps, same 0.9 cap) alongside, not a rewrite. Same for
195
- `deriveDarkenedPageColour`: add a lightened sibling next to it. For dark `controlBorder.main/hover`:
196
- `rgba(230, 235, 239, a)` from `ink.primary`, `a` = the smallest alpha (0.01 steps) that clears 3:1 on
197
- page and paper, hover = main + 0.15; the sheet's 0.38 / 0.53 are the expected result.
198
- - Rule 3 (primary), rule 4 (status net: baseline-supplied status `main` and `controlBorder.error`, judged
199
- against page AND its own `bg`, lightened; per-key check off `appConfig.palette` exactly as the existing
200
- light loops do), rule 5 (series: each baseline light series colour lightened in 0.05 steps until it clears
201
- 3:1 on the theme's own `background.paper`; app-supplied series untouched, the final merge argument already
202
- lets them win), rule 6 (own surfaces) are all computed here, dark branch only. Primary `contrastText` =
203
- whichever of `#FFFFFF` / `background.default` contrasts more. The app may pass `primary` as `{ main }`.
204
- - `createPaletteAwareComponents(palette)` (l.~84): add dark-only overlay slots: `MuiDialog`, `MuiMenu`,
205
- `MuiPopover`, `MuiDrawer` `paper` -> background colour = overlay surface `#232A31`, `boxShadow` = dark
206
- overlay shadow; `MuiBackdrop.root` -> scrim. Keep the overlay surface a local constant unless a palette
207
- key is clearly cleaner and trips no completeness check. Emitted only when mode is dark, so the light
208
- component tree is untouched.
209
- - Preserve the final merge order (BASELINE_STATIC, palette-aware components, `appConfig`, the dataSeries
210
- re-merge). The dark theme's `shadow.overlay` = the dark value.
211
-
212
- **`src/theme/themeCompleteness.js`**
213
- - `contrastFindings` (l.~268-345): `backgrounds = { white: '#FFFFFF', page: default }` (~l.298). In dark use
214
- the theme's own page and paper instead of a fixed white. Light keeps the exact same keys
215
- (`...-on-white`, `...-on-page`) and values; existing tests assert those surface names. For dark name them
216
- `...-on-paper` / `...-on-page`.
217
- - `assertThemeComplete` (~l.620): `MUI_DEFAULT_THEME` is the light MUI default. Verify a dark theme neither
218
- produces a false "still MUI default" finding nor a false pass; fix only what is wrong.
219
-
220
- **Kit components with hard-coded light values:** `src/components/QrSignupManager.jsx` has an inline CSS
221
- block (l.~225-274: `#f5f7fb`, `#122033`, `#d9e2f2`, `#ffffff`, `#e8f0ff`, `#23408e`, `#f8faff`) and
222
- `bgcolor: '#ffffff'` at l.361. **The l.361 white is a QR quiet zone and stays.** List every hard-coded
223
- light colour under `src/` outside `src/theme/` and tests in your final report. Switching one to an existing
224
- palette token is in scope (check its consumers and `tests/QrSignupManager.registrationContext.test.jsx`
225
- first); a spot that would need a new token is reported, not built. `src/auth/UserMenu.jsx:44` and
226
- `src/components/charts/chartLabels.js` only mention colours in comments.
227
-
228
- **Docs / release:** `DESIGN.md` gets a concise dark-mode section (how to opt in, primary rule, status net,
229
- overlay surface, series rule, what an app owns in dark). `CHANGELOG.md` entry. `package.json` version
230
- `3.10.0` -> `3.11.0` (and `package-lock.json` where the version appears for this package).
231
-
232
- **Existing tests to follow** (style, imports): `tests/createAppTheme.test.js`,
233
- `tests/createAppThemePageContrast.test.js` (imports `assertThemeComplete`, `createAppTheme` from
234
- `../src/theme`), `tests/themeCompleteness.test.js`. New dark tests go in `tests/createAppThemeDark.test.js`,
235
- the light guard in `tests/createAppThemeLightGuard.test.js`.
236
-
237
- **Light regression guard (required test 1):** BEFORE editing any source, capture the output of
238
- `createAppTheme({ palette: { primary: { main: '#0F62FE' } } })` and of one overriding app config (fontFamily,
239
- a custom page background, an app-supplied status main) as a JSON fixture
240
- (`tests/fixtures/light-theme-baseline.json`, stable serialization, functions as strings), from the
241
- unmodified code, and assert equality afterwards. Prove it can fail: one test mutates a light value in a
242
- clone of the snapshot and asserts the comparison reports a difference.
243
-
244
- **Invariants / pitfalls**
245
- - Light output byte-identical: no key-order change that alters serialization, no new keys on the light theme.
246
- - Only the first `createTheme` argument is augmented (comment at the top of `tokens.js`): every status
247
- entry needs explicit `main/light/dark/contrastText`.
248
- - MUI `getContrastRatio` vs the kit's alpha-aware `calculateContrastRatio`: use the kit's for anything with
249
- alpha, as THEME-15 did.
250
- - Build `controlBorder.main/hover`, the series and the primary from the rules, not literals; the tests
251
- assert the rules reproduce the sheet's values.
252
- - Do not touch auth, CI, dependencies, `WORK_ORDERS.md`, or `docs/DARK-TOKENS.md` (read-only here).
253
-
254
- ## Required tests, restated
255
-
256
- The nine tests of Part A, in the new files named above. Run only the tests you wrote.
257
-
258
- ## Preamble
259
-
260
- The text above is the COMPLETE spec: the committed WO file's content, not a plan to refine; there is no
261
- separate plan file. Read the nearest `AGENTS.md`, the relevant `.codex/skills/<role>/SKILL.md`, and the app
262
- `MEMORY.md` ONLY for conventions. Stay in scope; do not touch auth/permissions/deps/schema/CI unless the
263
- spec says so; do not update `MEMORY.md`. **Do NOT edit `WORK_ORDERS.md`: the register row and the review
264
- verdicts are the orchestrator's alone.** **Your tools are for editing source and test files and for running
265
- the tests you wrote, nothing else.** Do NOT install dependencies, touch a lockfile (the version line in
266
- `package-lock.json` is the one exception, a plain text edit), run a package manager, or tidy up stray
267
- files; if something in the repo state blocks you, stop and report it as `RESULT: BLOCKED <reason>` instead
268
- of fixing it. Do NOT `git add`/`commit`/`push`: leave every change uncommitted in the working tree for the
269
- orchestrator's independent review. WRITE the tests the `Required tests` section calls for AND **RUN the
270
- tests you just wrote** to confirm they execute and pass: that is the ONLY test run you do (NOT the
271
- affected/full suite, NOT any review). Run them with `npx vitest run <your test files>`. The orchestrator
272
- re-runs the authoritative set and does the independent review after you finish; those are the gate.
273
-
274
- Narrate continuously: a `PLAN: <step1> | <step2> | ...` line up front, then a single-line
275
- `PROGRESS: [<n>/<total>] <present-tense action>` before every relevant action (and `... done` on
276
- completion), spaced so no gap exceeds ~2 min, stdout unbuffered, plus exactly one final
277
- `RESULT: DONE|BLOCKED <reason>`. Your final report must also list every hard-coded light colour found under
278
- `src/` outside the theme folder.
279
-
280
- ---
281
-
282
- # C. Orchestrator only, NOT ADDRESSED TO THE IMPLEMENTER
283
-
284
- > **If you are the implementer reading this work order as your own specification: STOP at this line.**
285
- > Everything below describes what the Orchestrator does AFTER you finish. You do none of it: no
286
- > reviewers, no verification run, no register edit, no `git add`/`commit`/`push`.
287
-
288
- ### Execution directive
289
-
290
- Check `.claude/codex-status.md` first (newest-first; read it with `head`). No line for today means use
291
- Codex.
292
-
293
- ### Review routing
294
-
295
- Tier 3: independent `reviewer` (all configured lenses) and `ui_reviewer`, concurrent, one batch,
296
- before the commit. No `sec_reviewer`.
297
-
298
- ### Verification
299
-
300
- Render a kit demo surface in both modes at 375 px and 1280 px (`dev/`), and name the screenshots in
301
- the register Notiz. No prototype is in scope.
302
-
303
- ### Register + commit + release
304
-
305
- Row -> `done` with the review Notiz in the `AGENTS.md` shape. The publish runs on push to `main` when
306
- `package.json`/`src/**` change (`.github/workflows/publish.yml`). Then add a planned row in
307
- `webshop-guenter/WORK_ORDERS.md` for the pin bump to this version, and unblock `WSG-THEME-1`.
308
-
309
- ### Mini-handover
310
-
311
- `Orchestrator: implement work-orders/UCM-THEME-14.md in ui-core-micha (main). git pull first, confirm
312
- UCM-THEME-13 is frozen, read the WO, then follow orchestrate-codex.`