@africanies/angular-web-sdk 0.1.6 → 0.1.7

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 (87) hide show
  1. package/.nx/cache/13466509747676776487/dist/libs/africanies-core/README.md +85 -0
  2. package/.nx/cache/13466509747676776487/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs +4634 -0
  3. package/.nx/cache/13466509747676776487/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs.map +1 -0
  4. package/.nx/cache/13466509747676776487/dist/libs/africanies-core/package.json +31 -0
  5. package/.nx/cache/13466509747676776487/dist/libs/africanies-core/types/africanies-africanies-core.d.ts +2743 -0
  6. package/.nx/cache/14995846848874973576/dist/libs/africanies-ui/README.md +68 -0
  7. package/.nx/cache/14995846848874973576/dist/libs/africanies-ui/assets/brand/africanies-logo-mini.png +0 -0
  8. package/.nx/cache/14995846848874973576/dist/libs/africanies-ui/assets/brand/africanies-logo.png +0 -0
  9. package/.nx/cache/14995846848874973576/dist/libs/africanies-ui/assets/brand/africanies-logo.svg +5 -0
  10. package/.nx/cache/14995846848874973576/dist/libs/africanies-ui/assets/carriers/dhl.svg +7 -0
  11. package/.nx/cache/14995846848874973576/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs +19395 -0
  12. package/.nx/cache/14995846848874973576/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs.map +1 -0
  13. package/.nx/cache/14995846848874973576/dist/libs/africanies-ui/package.json +35 -0
  14. package/.nx/cache/14995846848874973576/dist/libs/africanies-ui/types/africanies-africanies-ui.d.ts +5493 -0
  15. package/.nx/cache/6673686859704879504/dist/libs/africanies-theme/README.md +46 -0
  16. package/.nx/cache/6673686859704879504/dist/libs/africanies-theme/fesm2022/africanies-africanies-theme.mjs +231 -0
  17. package/.nx/cache/6673686859704879504/dist/libs/africanies-theme/fesm2022/africanies-africanies-theme.mjs.map +1 -0
  18. package/.nx/cache/6673686859704879504/dist/libs/africanies-theme/package.json +35 -0
  19. package/.nx/cache/6673686859704879504/dist/libs/africanies-theme/tailwind-preset.cjs +262 -0
  20. package/.nx/cache/6673686859704879504/dist/libs/africanies-theme/types/africanies-africanies-theme.d.ts +174 -0
  21. package/.nx/cache/run.json +27 -27
  22. package/.nx/cache/terminalOutputs/13466509747676776487 +21 -0
  23. package/.nx/cache/terminalOutputs/1446890025183346611 +32 -0
  24. package/.nx/cache/terminalOutputs/14995846848874973576 +21 -0
  25. package/.nx/cache/terminalOutputs/6337357866566791975 +6 -0
  26. package/.nx/cache/terminalOutputs/6673686859704879504 +21 -0
  27. package/.nx/cache/terminalOutputs/8032148447904822353 +183 -0
  28. package/.nx/workspace-data/0091ABA9-5C90-580D-953C-8C94E763ADB5-v3.db +0 -0
  29. package/.nx/workspace-data/0091ABA9-5C90-580D-953C-8C94E763ADB5-v3.db-shm +0 -0
  30. package/.nx/workspace-data/0091ABA9-5C90-580D-953C-8C94E763ADB5-v3.db-wal +0 -0
  31. package/.nx/workspace-data/d/daemon.log +1609 -0
  32. package/.nx/workspace-data/d/server-process.json +2 -2
  33. package/.nx/workspace-data/file-map.json +3428 -3428
  34. package/.nx/workspace-data/nx_files.nxt +0 -0
  35. package/.nx/workspace-data/project-graph.json +2 -2
  36. package/apps/playground/src/app/pages/button-page.ts +5 -3
  37. package/apps/playground/src/app/pages/feedback-page.ts +1 -1
  38. package/apps/playground/src/app/pages/home-page.ts +1 -1
  39. package/apps/playground/src/app/pages/icons-page.ts +3 -3
  40. package/apps/playground/src/app/pages/lecture-page.ts +3 -3
  41. package/apps/playground/src/app/pages/models-page.ts +1 -1
  42. package/apps/playground/src/app/pages/overlay-demos.ts +1 -1
  43. package/apps/playground/src/app/pages/tokens-page.ts +17 -3
  44. package/apps/playground/src/app/pages/usecases/onboarding-login.page.ts +1 -1
  45. package/apps/playground/src/app/pages/usecases/onboarding-reset-password.page.ts +1 -1
  46. package/apps/playground/src/app/pages/usecases/shipment-detail.page.ts +1 -1
  47. package/apps/playground/src/app/pages/viewport-preview.component.ts +1 -1
  48. package/apps/playground/src/app/snippets/button.snippets.ts +4 -3
  49. package/apps/playground/src/index.html +6 -0
  50. package/apps/playground/src/styles.css +4 -5
  51. package/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs +131 -8
  52. package/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs.map +1 -1
  53. package/dist/libs/africanies-core/types/africanies-africanies-core.d.ts +8 -6
  54. package/dist/libs/africanies-theme/fesm2022/africanies-africanies-theme.mjs +12 -2
  55. package/dist/libs/africanies-theme/fesm2022/africanies-africanies-theme.mjs.map +1 -1
  56. package/dist/libs/africanies-theme/tailwind-preset.cjs +16 -7
  57. package/dist/libs/africanies-theme/types/africanies-africanies-theme.d.ts +11 -3
  58. package/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs +83 -63
  59. package/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs.map +1 -1
  60. package/dist/libs/africanies-ui/types/africanies-africanies-ui.d.ts +11 -8
  61. package/libs/africanies-core/src/index.ts +1 -0
  62. package/libs/africanies-core/src/lib/notification/index.ts +1 -1
  63. package/libs/africanies-core/src/lib/notification/notification-link.spec.ts +40 -7
  64. package/libs/africanies-core/src/lib/notification/notification-link.ts +143 -7
  65. package/libs/africanies-theme/src/lib/mode-color.safelist.ts +8 -2
  66. package/libs/africanies-theme/src/lib/mode-color.service.ts +16 -0
  67. package/libs/africanies-theme/tailwind-preset.cjs +16 -7
  68. package/libs/africanies-ui/src/lib/button/button.component.ts +5 -1
  69. package/libs/africanies-ui/src/lib/feedback/empty-state.component.ts +1 -1
  70. package/libs/africanies-ui/src/lib/feedback/error-state.component.ts +1 -1
  71. package/libs/africanies-ui/src/lib/forms/file-upload/file-preview.dialog.ts +1 -1
  72. package/libs/africanies-ui/src/lib/forms/file-upload/file-upload.component.ts +4 -4
  73. package/libs/africanies-ui/src/lib/forms/form-field.classes.ts +2 -2
  74. package/libs/africanies-ui/src/lib/forms/select/select.component.ts +1 -1
  75. package/libs/africanies-ui/src/lib/layout/app-shell-header.component.ts +1 -1
  76. package/libs/africanies-ui/src/lib/layout/app-shell.component.ts +2 -2
  77. package/libs/africanies-ui/src/lib/navigation/shipping-mode-switch/shipping-mode-switch.component.ts +2 -2
  78. package/libs/africanies-ui/src/lib/navigation/side-nav/africanies-side-nav.component.html +2 -2
  79. package/libs/africanies-ui/src/lib/navigation/side-nav/africanies-side-nav.component.ts +10 -6
  80. package/libs/africanies-ui/src/lib/notifications/notification-drawer.panel.ts +21 -8
  81. package/libs/africanies-ui/src/lib/overlay/drawer.service.ts +1 -1
  82. package/libs/africanies-ui/src/lib/overlay/modal.service.ts +1 -1
  83. package/libs/africanies-ui/src/lib/pagination/pagination.component.ts +3 -3
  84. package/libs/africanies-ui/src/lib/table/table.component.ts +5 -5
  85. package/libs/africanies-ui/src/lib/toast/toast-host.component.ts +4 -4
  86. package/libs/africanies-ui/src/lib/toast/toast-item.component.ts +1 -1
  87. package/package.json +1 -1
@@ -0,0 +1,46 @@
1
+ # @africanies/africanies-theme
2
+
3
+ AFRICANIES design tokens (Tailwind preset), light/dark {@link ThemeService}, and shipping-mode accent helpers ({@link ModeColorService}).
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install @africanies/africanies-theme @africanies/africanies-storage @africanies/africanies-core
9
+ ```
10
+
11
+ ## Tailwind
12
+
13
+ ```js
14
+ // tailwind.config.js
15
+ module.exports = {
16
+ presets: [require('@africanies/africanies-theme/tailwind-preset')],
17
+ content: [
18
+ './src/**/*.{html,ts}',
19
+ './node_modules/@africanies/africanies-ui/**/*.{js,mjs}',
20
+ ],
21
+ };
22
+ ```
23
+
24
+ > The preset file is published as `tailwind-preset.cjs` (package is ESM) but resolved via the `./tailwind-preset` export above.
25
+
26
+ See [THEME.md](./THEME.md) for the full palette, provisional typography scale, and legacy `$border-gray` mapping notes.
27
+
28
+ ## ThemeService
29
+
30
+ ```ts
31
+ import { inject, provideAppInitializer } from '@angular/core';
32
+ import { ThemeService } from '@africanies/africanies-theme';
33
+
34
+ provideAppInitializer(() => {
35
+ inject(ThemeService);
36
+ });
37
+ ```
38
+
39
+ ## ModeColorService
40
+
41
+ ```ts
42
+ const modeColor = inject(ModeColorService);
43
+ const { text, bg, bgSubtle } = modeColor.classes();
44
+ ```
45
+
46
+ Class strings are literals so Tailwind does not purge them.
@@ -0,0 +1,231 @@
1
+ import * as i0 from '@angular/core';
2
+ import { inject, computed, Injectable, signal } from '@angular/core';
3
+ import { ShippingModeService } from '@africanies/africanies-core';
4
+ import { DOCUMENT } from '@angular/common';
5
+ import { STORAGE_TOKEN, AFRICANIES_THEME_KEY } from '@africanies/africanies-storage';
6
+
7
+ /**
8
+ * Tailwind safelist side-effect for shipping-mode color utilities.
9
+ *
10
+ * WHY this file exists: JIT/content scanning only keeps class names that appear
11
+ * as *literal strings* in scanned sources. {@link ModeColorService} already
12
+ * returns these literals, but keeping a dedicated comment list makes the
13
+ * contract obvious for consumers who configure `safelist` or purge plugins.
14
+ *
15
+ * Do not rename these strings without updating ModeColorService and THEME.md.
16
+ *
17
+ * SFN (export / green):
18
+ * text-export bg-export bg-export-subtle bg-export-light border-export
19
+ * hover:bg-export-light hover:bg-export-subtle dark:bg-export/15 dark:hover:bg-export/15
20
+ * dark:bg-[color-mix(in_srgb,#1cbd5d_15%,#212529)] dark:bg-export dark:text-export dark:border-export
21
+ *
22
+ * STN (import / orange):
23
+ * text-import bg-import bg-import-subtle bg-import-light border-import
24
+ * hover:bg-import-light hover:bg-import-subtle dark:bg-import/15 dark:hover:bg-import/15
25
+ * dark:bg-[color-mix(in_srgb,#f08829_15%,#212529)] dark:bg-import dark:text-import dark:border-import
26
+ */
27
+ const MODE_COLOR_SAFELIST = [
28
+ 'text-export',
29
+ 'bg-export',
30
+ 'bg-export-subtle',
31
+ 'bg-export-light',
32
+ 'border-export',
33
+ 'hover:bg-export-light',
34
+ 'hover:bg-export-subtle',
35
+ 'dark:bg-export/15',
36
+ 'dark:hover:bg-export/15',
37
+ 'dark:bg-[color-mix(in_srgb,#1cbd5d_15%,#212529)]',
38
+ 'dark:bg-export',
39
+ 'dark:text-export',
40
+ 'dark:border-export',
41
+ 'text-import',
42
+ 'bg-import',
43
+ 'bg-import-subtle',
44
+ 'bg-import-light',
45
+ 'border-import',
46
+ 'hover:bg-import-light',
47
+ 'hover:bg-import-subtle',
48
+ 'dark:bg-import/15',
49
+ 'dark:hover:bg-import/15',
50
+ 'dark:bg-[color-mix(in_srgb,#f08829_15%,#212529)]',
51
+ 'dark:bg-import',
52
+ 'dark:text-import',
53
+ 'dark:border-import',
54
+ ];
55
+
56
+ /**
57
+ * Maps {@link ShippingModeService} to mode-accent Tailwind classes.
58
+ *
59
+ * - **SFN** → export green is primary
60
+ * - **STN** → import orange is primary
61
+ *
62
+ * WHY literal class strings: Tailwind's scanner cannot see dynamically built
63
+ * names like `` `text-${token}` ``. Returning full literals (`text-export`, …)
64
+ * keeps utilities in the compiled CSS. See {@link MODE_COLOR_SAFELIST}.
65
+ *
66
+ * @example
67
+ * ```html
68
+ * @let colors = modeColor.classes();
69
+ * <button type="button" [class]="colors.primary">Save</button>
70
+ * <span [class]="colors.text">Mode accent</span>
71
+ * ```
72
+ */
73
+ class ModeColorService {
74
+ shippingMode = inject(ShippingModeService);
75
+ /**
76
+ * Mode-dependent utility classes. Recomputes when shipping mode changes.
77
+ */
78
+ classes = computed(() => {
79
+ // Literal strings required for Tailwind content detection — do not interpolate.
80
+ if (this.shippingMode.mode() === 'sfn') {
81
+ return {
82
+ text: 'text-export',
83
+ bg: 'bg-export',
84
+ bgSubtle: 'bg-export-subtle',
85
+ border: 'border-export',
86
+ primary: 'bg-export text-white border-transparent hover:bg-export-light',
87
+ ghostPrimary: 'bg-transparent text-export border-transparent hover:bg-export-subtle dark:hover:bg-export/15',
88
+ soft: 'bg-export-subtle dark:bg-export/15',
89
+ softSolid: 'bg-export-subtle dark:bg-[color-mix(in_srgb,#1cbd5d_15%,#212529)]',
90
+ softHover: 'hover:bg-export-subtle dark:hover:bg-export/15',
91
+ activeFill: 'bg-export text-white border-transparent dark:bg-export dark:text-white',
92
+ stroked: 'bg-white text-export border-export hover:bg-export-subtle dark:bg-ink-950 dark:text-export dark:border-export dark:hover:bg-export/15',
93
+ };
94
+ }
95
+ return {
96
+ text: 'text-import',
97
+ bg: 'bg-import',
98
+ bgSubtle: 'bg-import-subtle',
99
+ border: 'border-import',
100
+ primary: 'bg-import text-white border-transparent hover:bg-import-light',
101
+ ghostPrimary: 'bg-transparent text-import border-transparent hover:bg-import-subtle dark:hover:bg-import/15',
102
+ soft: 'bg-import-subtle dark:bg-import/15',
103
+ softSolid: 'bg-import-subtle dark:bg-[color-mix(in_srgb,#f08829_15%,#212529)]',
104
+ softHover: 'hover:bg-import-subtle dark:hover:bg-import/15',
105
+ activeFill: 'bg-import text-white border-transparent dark:bg-import dark:text-white',
106
+ stroked: 'bg-white text-import border-import hover:bg-import-subtle dark:bg-ink-950 dark:text-import dark:border-import dark:hover:bg-import/15',
107
+ };
108
+ }, /* @ts-ignore */
109
+ ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
110
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: ModeColorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
111
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: ModeColorService, providedIn: 'root' });
112
+ }
113
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: ModeColorService, decorators: [{
114
+ type: Injectable,
115
+ args: [{ providedIn: 'root' }]
116
+ }] });
117
+
118
+ /**
119
+ * Application light/dark theme preference.
120
+ *
121
+ * WHY signals (not BehaviorSubject): theme is synchronous UI state read from
122
+ * templates and other services; a signal avoids RxJS subscription boilerplate
123
+ * and matches Angular 22 change detection. Persistence goes through
124
+ * {@link STORAGE_TOKEN} so tests can swap storage without touching `localStorage`.
125
+ *
126
+ * Applies the Tailwind `darkMode: 'class'` contract by toggling `dark` on
127
+ * `document.documentElement`, and sets `color-scheme` so native UI (date
128
+ * pickers, scrollbars, form controls) matches the app theme — class-based
129
+ * dark mode alone does not restyle browser chrome.
130
+ *
131
+ * @example
132
+ * ```ts
133
+ * // app.config.ts
134
+ * import { inject, provideAppInitializer } from '@angular/core';
135
+ * import { ThemeService } from '@africanies/africanies-theme';
136
+ *
137
+ * export const appConfig = {
138
+ * providers: [
139
+ * provideAppInitializer(() => {
140
+ * inject(ThemeService); // applies stored / system theme once
141
+ * }),
142
+ * ],
143
+ * };
144
+ *
145
+ * // In a component
146
+ * const theme = inject(ThemeService);
147
+ * theme.toggle();
148
+ * theme.setTheme('dark');
149
+ * const current = theme.theme(); // 'light' | 'dark'
150
+ * ```
151
+ */
152
+ class ThemeService {
153
+ storage = inject(STORAGE_TOKEN);
154
+ document = inject(DOCUMENT);
155
+ /**
156
+ * Current theme. Prefer reading via `theme()` in templates / computed values
157
+ * rather than caching the string, so dark-class consumers stay in sync.
158
+ */
159
+ theme = signal(this.resolveInitialTheme(), /* @ts-ignore */
160
+ ...(ngDevMode ? [{ debugName: "theme" }] : /* istanbul ignore next */ []));
161
+ constructor() {
162
+ this.applyToDocument(this.theme());
163
+ }
164
+ /**
165
+ * Sets and persists the theme, updating the `dark` class and `color-scheme`
166
+ * on `<html>`.
167
+ *
168
+ * @param theme - Absolute preference to store.
169
+ */
170
+ setTheme(theme) {
171
+ this.theme.set(theme);
172
+ this.applyToDocument(theme);
173
+ try {
174
+ this.storage.set(AFRICANIES_THEME_KEY, theme);
175
+ }
176
+ catch {
177
+ // Persistence failure must not block the in-session visual toggle —
178
+ // private browsing / quota issues are transient for theme preference.
179
+ }
180
+ }
181
+ /**
182
+ * Flips between light and dark.
183
+ *
184
+ * @returns The theme after the toggle.
185
+ */
186
+ toggle() {
187
+ const next = this.theme() === 'light' ? 'dark' : 'light';
188
+ this.setTheme(next);
189
+ return next;
190
+ }
191
+ resolveInitialTheme() {
192
+ try {
193
+ const stored = this.storage.get(AFRICANIES_THEME_KEY);
194
+ if (stored === 'light' || stored === 'dark') {
195
+ return stored;
196
+ }
197
+ }
198
+ catch {
199
+ // Fall through to system preference when storage is unavailable.
200
+ }
201
+ return this.prefersDark() ? 'dark' : 'light';
202
+ }
203
+ prefersDark() {
204
+ const win = this.document.defaultView;
205
+ return !!win?.matchMedia?.('(prefers-color-scheme: dark)').matches;
206
+ }
207
+ applyToDocument(theme) {
208
+ const root = this.document.documentElement;
209
+ if (theme === 'dark') {
210
+ root.classList.add('dark');
211
+ }
212
+ else {
213
+ root.classList.remove('dark');
214
+ }
215
+ // Native date/time pickers follow `color-scheme`, not Tailwind's `dark` class.
216
+ root.style.colorScheme = theme;
217
+ }
218
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: ThemeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
219
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: ThemeService, providedIn: 'root' });
220
+ }
221
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: ThemeService, decorators: [{
222
+ type: Injectable,
223
+ args: [{ providedIn: 'root' }]
224
+ }], ctorParameters: () => [] });
225
+
226
+ /**
227
+ * Generated bundle index. Do not edit.
228
+ */
229
+
230
+ export { MODE_COLOR_SAFELIST, ModeColorService, ThemeService };
231
+ //# sourceMappingURL=africanies-africanies-theme.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"africanies-africanies-theme.mjs","sources":["../../../../libs/africanies-theme/src/lib/mode-color.safelist.ts","../../../../libs/africanies-theme/src/lib/mode-color.service.ts","../../../../libs/africanies-theme/src/lib/theme.service.ts","../../../../libs/africanies-theme/src/africanies-africanies-theme.ts"],"sourcesContent":["/**\n * Tailwind safelist side-effect for shipping-mode color utilities.\n *\n * WHY this file exists: JIT/content scanning only keeps class names that appear\n * as *literal strings* in scanned sources. {@link ModeColorService} already\n * returns these literals, but keeping a dedicated comment list makes the\n * contract obvious for consumers who configure `safelist` or purge plugins.\n *\n * Do not rename these strings without updating ModeColorService and THEME.md.\n *\n * SFN (export / green):\n * text-export bg-export bg-export-subtle bg-export-light border-export\n * hover:bg-export-light hover:bg-export-subtle dark:bg-export/15 dark:hover:bg-export/15\n * dark:bg-[color-mix(in_srgb,#1cbd5d_15%,#212529)] dark:bg-export dark:text-export dark:border-export\n *\n * STN (import / orange):\n * text-import bg-import bg-import-subtle bg-import-light border-import\n * hover:bg-import-light hover:bg-import-subtle dark:bg-import/15 dark:hover:bg-import/15\n * dark:bg-[color-mix(in_srgb,#f08829_15%,#212529)] dark:bg-import dark:text-import dark:border-import\n */\nexport const MODE_COLOR_SAFELIST = [\n 'text-export',\n 'bg-export',\n 'bg-export-subtle',\n 'bg-export-light',\n 'border-export',\n 'hover:bg-export-light',\n 'hover:bg-export-subtle',\n 'dark:bg-export/15',\n 'dark:hover:bg-export/15',\n 'dark:bg-[color-mix(in_srgb,#1cbd5d_15%,#212529)]',\n 'dark:bg-export',\n 'dark:text-export',\n 'dark:border-export',\n 'text-import',\n 'bg-import',\n 'bg-import-subtle',\n 'bg-import-light',\n 'border-import',\n 'hover:bg-import-light',\n 'hover:bg-import-subtle',\n 'dark:bg-import/15',\n 'dark:hover:bg-import/15',\n 'dark:bg-[color-mix(in_srgb,#f08829_15%,#212529)]',\n 'dark:bg-import',\n 'dark:text-import',\n 'dark:border-import',\n] as const;\n","import { computed, inject, Injectable } from '@angular/core';\n\nimport { ShippingModeService } from '@africanies/africanies-core';\n\n/**\n * Tailwind class bundle for the active shipping mode (SFN export / STN import).\n *\n * Use these for **primary** product chrome: CTAs, selected controls, progress,\n * and accent text. Semantic colors (danger / warning) stay mode-independent.\n */\nexport interface ModeColorClasses {\n /** Text color utility, e.g. `text-export`. */\n text: string;\n /** Solid background utility, e.g. `bg-export`. */\n bg: string;\n /** Soft background utility, e.g. `bg-export-subtle`. */\n bgSubtle: string;\n /** Border matching the mode accent, e.g. `border-export`. */\n border: string;\n /**\n * Filled primary CTA — `variant=\"primary\"` on buttons.\n * Includes hover utility as a literal so Tailwind keeps it.\n */\n primary: string;\n /**\n * Transparent / text-only CTA — `variant=\"ghost-primary\"` on buttons.\n * Mode accent text + soft hover fill.\n */\n ghostPrimary: string;\n /**\n * Soft highlight for selected / active rows (works in dark mode).\n * Dark uses a translucent tint — fine over solid surfaces, not for\n * sticky overlays (see {@link softSolid}).\n */\n soft: string;\n /**\n * Opaque soft fill — same tint as {@link soft}, but dark mode mixes into\n * ink so scrolled content cannot show through (sticky table headers/cells).\n */\n softSolid: string;\n /**\n * Soft hover highlight for menus and lists.\n */\n softHover: string;\n /**\n * Active nav leaf / collapsed rail — solid mode fill + white text.\n */\n activeFill: string;\n /**\n * Stroked secondary CTA — white fill, mode border + text (portal `.btn-stroked`).\n */\n stroked: string;\n}\n\n/**\n * Maps {@link ShippingModeService} to mode-accent Tailwind classes.\n *\n * - **SFN** → export green is primary\n * - **STN** → import orange is primary\n *\n * WHY literal class strings: Tailwind's scanner cannot see dynamically built\n * names like `` `text-${token}` ``. Returning full literals (`text-export`, …)\n * keeps utilities in the compiled CSS. See {@link MODE_COLOR_SAFELIST}.\n *\n * @example\n * ```html\n * @let colors = modeColor.classes();\n * <button type=\"button\" [class]=\"colors.primary\">Save</button>\n * <span [class]=\"colors.text\">Mode accent</span>\n * ```\n */\n@Injectable({ providedIn: 'root' })\nexport class ModeColorService {\n private readonly shippingMode = inject(ShippingModeService);\n\n /**\n * Mode-dependent utility classes. Recomputes when shipping mode changes.\n */\n readonly classes = computed<ModeColorClasses>(() => {\n // Literal strings required for Tailwind content detection — do not interpolate.\n if (this.shippingMode.mode() === 'sfn') {\n return {\n text: 'text-export',\n bg: 'bg-export',\n bgSubtle: 'bg-export-subtle',\n border: 'border-export',\n primary:\n 'bg-export text-white border-transparent hover:bg-export-light',\n ghostPrimary:\n 'bg-transparent text-export border-transparent hover:bg-export-subtle dark:hover:bg-export/15',\n soft: 'bg-export-subtle dark:bg-export/15',\n softSolid:\n 'bg-export-subtle dark:bg-[color-mix(in_srgb,#1cbd5d_15%,#212529)]',\n softHover: 'hover:bg-export-subtle dark:hover:bg-export/15',\n activeFill:\n 'bg-export text-white border-transparent dark:bg-export dark:text-white',\n stroked:\n 'bg-white text-export border-export hover:bg-export-subtle dark:bg-ink-950 dark:text-export dark:border-export dark:hover:bg-export/15',\n };\n }\n return {\n text: 'text-import',\n bg: 'bg-import',\n bgSubtle: 'bg-import-subtle',\n border: 'border-import',\n primary:\n 'bg-import text-white border-transparent hover:bg-import-light',\n ghostPrimary:\n 'bg-transparent text-import border-transparent hover:bg-import-subtle dark:hover:bg-import/15',\n soft: 'bg-import-subtle dark:bg-import/15',\n softSolid:\n 'bg-import-subtle dark:bg-[color-mix(in_srgb,#f08829_15%,#212529)]',\n softHover: 'hover:bg-import-subtle dark:hover:bg-import/15',\n activeFill:\n 'bg-import text-white border-transparent dark:bg-import dark:text-white',\n stroked:\n 'bg-white text-import border-import hover:bg-import-subtle dark:bg-ink-950 dark:text-import dark:border-import dark:hover:bg-import/15',\n };\n });\n}\n","import { DOCUMENT } from '@angular/common';\nimport { inject, Injectable, signal } from '@angular/core';\n\nimport { AFRICANIES_THEME_KEY, STORAGE_TOKEN } from '@africanies/africanies-storage';\n\nimport type { Theme } from './theme.types';\n\n/**\n * Application light/dark theme preference.\n *\n * WHY signals (not BehaviorSubject): theme is synchronous UI state read from\n * templates and other services; a signal avoids RxJS subscription boilerplate\n * and matches Angular 22 change detection. Persistence goes through\n * {@link STORAGE_TOKEN} so tests can swap storage without touching `localStorage`.\n *\n * Applies the Tailwind `darkMode: 'class'` contract by toggling `dark` on\n * `document.documentElement`, and sets `color-scheme` so native UI (date\n * pickers, scrollbars, form controls) matches the app theme — class-based\n * dark mode alone does not restyle browser chrome.\n *\n * @example\n * ```ts\n * // app.config.ts\n * import { inject, provideAppInitializer } from '@angular/core';\n * import { ThemeService } from '@africanies/africanies-theme';\n *\n * export const appConfig = {\n * providers: [\n * provideAppInitializer(() => {\n * inject(ThemeService); // applies stored / system theme once\n * }),\n * ],\n * };\n *\n * // In a component\n * const theme = inject(ThemeService);\n * theme.toggle();\n * theme.setTheme('dark');\n * const current = theme.theme(); // 'light' | 'dark'\n * ```\n */\n@Injectable({ providedIn: 'root' })\nexport class ThemeService {\n private readonly storage = inject(STORAGE_TOKEN);\n private readonly document = inject(DOCUMENT);\n\n /**\n * Current theme. Prefer reading via `theme()` in templates / computed values\n * rather than caching the string, so dark-class consumers stay in sync.\n */\n readonly theme = signal<Theme>(this.resolveInitialTheme());\n\n constructor() {\n this.applyToDocument(this.theme());\n }\n\n /**\n * Sets and persists the theme, updating the `dark` class and `color-scheme`\n * on `<html>`.\n *\n * @param theme - Absolute preference to store.\n */\n setTheme(theme: Theme): void {\n this.theme.set(theme);\n this.applyToDocument(theme);\n try {\n this.storage.set(AFRICANIES_THEME_KEY, theme);\n } catch {\n // Persistence failure must not block the in-session visual toggle —\n // private browsing / quota issues are transient for theme preference.\n }\n }\n\n /**\n * Flips between light and dark.\n *\n * @returns The theme after the toggle.\n */\n toggle(): Theme {\n const next: Theme = this.theme() === 'light' ? 'dark' : 'light';\n this.setTheme(next);\n return next;\n }\n\n private resolveInitialTheme(): Theme {\n try {\n const stored = this.storage.get<Theme>(AFRICANIES_THEME_KEY);\n if (stored === 'light' || stored === 'dark') {\n return stored;\n }\n } catch {\n // Fall through to system preference when storage is unavailable.\n }\n return this.prefersDark() ? 'dark' : 'light';\n }\n\n private prefersDark(): boolean {\n const win = this.document.defaultView;\n return !!win?.matchMedia?.('(prefers-color-scheme: dark)').matches;\n }\n\n private applyToDocument(theme: Theme): void {\n const root = this.document.documentElement;\n if (theme === 'dark') {\n root.classList.add('dark');\n } else {\n root.classList.remove('dark');\n }\n // Native date/time pickers follow `color-scheme`, not Tailwind's `dark` class.\n root.style.colorScheme = theme;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"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"}
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@africanies/africanies-theme",
3
+ "version": "0.0.2",
4
+ "peerDependencies": {
5
+ "@angular/common": "^22.0.0",
6
+ "@angular/core": "^22.0.0",
7
+ "@africanies/africanies-core": ">=0.0.2 <0.1.0",
8
+ "@africanies/africanies-storage": ">=0.0.1 <0.1.0"
9
+ },
10
+ "sideEffects": false,
11
+ "publishConfig": {
12
+ "access": "public"
13
+ },
14
+ "exports": {
15
+ "./tailwind-preset": "./tailwind-preset.cjs",
16
+ "./package.json": {
17
+ "default": "./package.json"
18
+ },
19
+ ".": {
20
+ "types": "./types/africanies-africanies-theme.d.ts",
21
+ "default": "./fesm2022/africanies-africanies-theme.mjs"
22
+ }
23
+ },
24
+ "files": [
25
+ "**/*",
26
+ "tailwind-preset.cjs",
27
+ "THEME.md"
28
+ ],
29
+ "module": "fesm2022/africanies-africanies-theme.mjs",
30
+ "typings": "types/africanies-africanies-theme.d.ts",
31
+ "type": "module",
32
+ "dependencies": {
33
+ "tslib": "^2.3.0"
34
+ }
35
+ }
@@ -0,0 +1,262 @@
1
+ /**
2
+ * Shared Tailwind preset for AFRICANIES product UIs.
3
+ *
4
+ * WHY a preset (not only CSS variables): consuming apps and `@africanies/africanies-ui`
5
+ * already use Tailwind utility classes. Shipping the palette as a preset keeps
6
+ * class names (`text-export`, `bg-import-subtle`, …) consistent and scannable
7
+ * by Tailwind's content detection across packages.
8
+ *
9
+ * Shipped as `.cjs` because ng-packagr publishes this package with
10
+ * `"type": "module"` — a `.js` CommonJS file would break
11
+ * `require('@africanies/africanies-theme/tailwind-preset')`.
12
+ *
13
+ * Consumer setup (see THEME.md):
14
+ * presets: [require('@africanies/africanies-theme/tailwind-preset')]
15
+ * content: app sources + ./node_modules/@africanies/africanies-ui (js/mjs)
16
+ *
17
+ * Also injects base autofill overrides so Chrome/Safari do not paint a
18
+ * yellow/blue fill over AFRICANIES form shells (`bg-white` / `dark:bg-ink-950`),
19
+ * and a pointer cursor on interactive controls.
20
+ *
21
+ * @type {import('tailwindcss').Config}
22
+ */
23
+
24
+ /**
25
+ * Pointer cursor on clickable controls.
26
+ *
27
+ * WHY base CSS (not only `cursor-pointer` utilities): browsers use
28
+ * `cursor: default` on `button`, and Tailwind v4 content detection often
29
+ * skips pnpm-linked `@africanies/africanies-ui` bundles so the utility is never emitted.
30
+ *
31
+ * @param {import('tailwindcss/types/config').PluginAPI} api
32
+ */
33
+ function africaniesInteractiveCursorPlugin({ addBase }) {
34
+ addBase({
35
+ [[
36
+ 'a[href]',
37
+ 'button:not(:disabled):not([aria-disabled="true"])',
38
+ 'summary',
39
+ 'label[for]',
40
+ 'select:not(:disabled)',
41
+ 'input[type="button"]:not(:disabled)',
42
+ 'input[type="submit"]:not(:disabled)',
43
+ 'input[type="reset"]:not(:disabled)',
44
+ 'input[type="checkbox"]:not(:disabled)',
45
+ 'input[type="radio"]:not(:disabled)',
46
+ 'input[type="file"]:not(:disabled)',
47
+ '[role="button"]:not([aria-disabled="true"])',
48
+ '[role="link"]:not([aria-disabled="true"])',
49
+ '[role="menuitem"]:not([aria-disabled="true"])',
50
+ '[role="option"]:not([aria-disabled="true"])',
51
+ '[role="tab"]:not([aria-disabled="true"])',
52
+ '[role="checkbox"]:not([aria-disabled="true"])',
53
+ '[role="radio"]:not([aria-disabled="true"])',
54
+ '[role="switch"]:not([aria-disabled="true"])',
55
+ ].join(', ')]: {
56
+ cursor: 'pointer',
57
+ },
58
+ ':disabled, [aria-disabled="true"]': {
59
+ cursor: 'not-allowed',
60
+ },
61
+ });
62
+ }
63
+
64
+ /**
65
+ * Neutralize browser autofill chrome so fields keep AFRICANIES tokens.
66
+ *
67
+ * WHY inset box-shadow (not `background-color`): WebKit ignores background
68
+ * on `:-webkit-autofill`. A large inset shadow matches the field shell
69
+ * (`white` / `ink-950`) and `-webkit-text-fill-color` keeps body text on
70
+ * `ink` / white. `.dark` matches `ThemeService` (`class` on `<html>`).
71
+ *
72
+ * WHY one selector per `addBase` key: joining autofill selectors with commas
73
+ * under a single `.dark ${list}` key only scopes the first selector — the rest
74
+ * leak into light mode. WHY no `color` in the long transition: delaying color
75
+ * freezes text when the user toggles light/dark.
76
+ *
77
+ * @param {import('tailwindcss/types/config').PluginAPI} api
78
+ */
79
+ function africaniesAutofillPlugin({ addBase }) {
80
+ const autofillSelectors = [
81
+ 'input:-webkit-autofill',
82
+ 'input:-webkit-autofill:hover',
83
+ 'input:-webkit-autofill:focus',
84
+ 'input:-webkit-autofill:active',
85
+ 'textarea:-webkit-autofill',
86
+ 'textarea:-webkit-autofill:hover',
87
+ 'textarea:-webkit-autofill:focus',
88
+ 'textarea:-webkit-autofill:active',
89
+ ];
90
+
91
+ /** @type {Record<string, Record<string, string>>} */
92
+ const rules = {};
93
+ for (const selector of autofillSelectors) {
94
+ rules[selector] = {
95
+ WebkitTextFillColor: '#1c2b3f',
96
+ caretColor: '#1c2b3f',
97
+ boxShadow: '0 0 0 1000px #ffffff inset',
98
+ transition: 'background-color 99999s ease-in-out 0s',
99
+ };
100
+ rules[`.dark ${selector}`] = {
101
+ WebkitTextFillColor: '#ffffff',
102
+ caretColor: '#ffffff',
103
+ boxShadow: '0 0 0 1000px #272729 inset',
104
+ };
105
+ }
106
+ addBase(rules);
107
+ }
108
+
109
+ /**
110
+ * Always emit spinner motion.
111
+ *
112
+ * WHY: Tailwind v4 content detection often skips pnpm-linked `@africanies/africanies-ui`
113
+ * bundles, so `animate-spin` on button loading never lands in consumer CSS.
114
+ *
115
+ * @param {import('tailwindcss/types/config').PluginAPI} api
116
+ */
117
+ function africaniesSpinPlugin({ addBase }) {
118
+ addBase({
119
+ '@keyframes africanies-spin': {
120
+ to: { transform: 'rotate(360deg)' },
121
+ },
122
+ '.animate-spin': {
123
+ animation: 'africanies-spin 1s linear infinite',
124
+ },
125
+ });
126
+ }
127
+
128
+ /**
129
+ * Keep toasts above dialogs, drawers, and other CDK overlays.
130
+ *
131
+ * WHY: CDK sets `z-index: 1000` on overlay wrappers, panes, and backdrops.
132
+ * This covers overlays outside the popover top layer; inside it, ToastService
133
+ * re-shows the toast popover to stay in front.
134
+ *
135
+ * @param {import('tailwindcss/types/config').PluginAPI} api
136
+ */
137
+ function africaniesOverlayStackPlugin({ addBase }) {
138
+ addBase({
139
+ '.cdk-global-overlay-wrapper.africanies-toast-overlay, .cdk-overlay-pane.africanies-toast-panel':
140
+ {
141
+ zIndex: '1100',
142
+ },
143
+ });
144
+ }
145
+
146
+ /**
147
+ * Keep overlay scrollbars off close buttons and other end-aligned chrome.
148
+ *
149
+ * WHY: modal/drawer panes used to scroll themselves. Overlay (and some
150
+ * classic) scrollbars paint in the padding box and cover a top-right close
151
+ * control. The pane stays `overflow: hidden`; the hosted component scrolls
152
+ * with `scrollbar-gutter: stable` so the track is reserved even before
153
+ * content overflows. Dialogs that split header/body can set `overflow-hidden`
154
+ * on the host (a utility, so it wins this base rule) and put
155
+ * `.africanies-overlay-scroll` on the body.
156
+ *
157
+ * @param {import('tailwindcss/types/config').PluginAPI} api
158
+ */
159
+ function africaniesOverlayScrollPlugin({ addBase }) {
160
+ addBase({
161
+ '.africanies-modal-panel, .africanies-drawer-panel': {
162
+ overflow: 'hidden',
163
+ overscrollBehavior: 'contain',
164
+ },
165
+ '.africanies-modal-panel > *, .africanies-drawer-panel > *': {
166
+ minHeight: 0,
167
+ overflowX: 'hidden',
168
+ overflowY: 'auto',
169
+ overscrollBehavior: 'contain',
170
+ scrollbarGutter: 'stable',
171
+ },
172
+ '.africanies-drawer-panel > *': {
173
+ height: '100%',
174
+ },
175
+ '.africanies-overlay-scroll': {
176
+ overscrollBehavior: 'contain',
177
+ scrollbarGutter: 'stable',
178
+ },
179
+ });
180
+ }
181
+
182
+ module.exports = {
183
+ darkMode: 'class',
184
+ plugins: [
185
+ africaniesInteractiveCursorPlugin,
186
+ africaniesSpinPlugin,
187
+ africaniesOverlayStackPlugin,
188
+ africaniesOverlayScrollPlugin,
189
+ africaniesAutofillPlugin,
190
+ ],
191
+ theme: {
192
+ extend: {
193
+ colors: {
194
+ black: '#000000',
195
+ white: '#ffffff',
196
+ ink: {
197
+ // Portal `.txt-primary` navy — primary body / heading text (light).
198
+ DEFAULT: '#1c2b3f',
199
+ blue: '#192a3e',
200
+ brand: '#1c2b3f',
201
+ // Previous ink DEFAULT — dark elevated cards / panels (`dark:bg-ink-surface`).
202
+ surface: '#212529',
203
+ 950: '#272729',
204
+ },
205
+ neutral: {
206
+ 300: '#c9d5e1',
207
+ 400: '#a9b5cb',
208
+ 600: '#667185',
209
+ },
210
+ border: {
211
+ // Soft hairline on white (portal `$border-bottom-gray`).
212
+ DEFAULT: '#f0f2f5',
213
+ // Nav pins / stronger chrome dividers.
214
+ strong: '#e0e6f0',
215
+ },
216
+ background: {
217
+ // Portal page shell (`container-wrap`).
218
+ chrome: '#f6f7f9',
219
+ // Nested wells inside white cards.
220
+ well: '#f3f3f3',
221
+ // Auth / welcome / soft hover.
222
+ welcome: '#f9fafb',
223
+ },
224
+ export: {
225
+ DEFAULT: '#1cbd5d',
226
+ light: '#24dc6d',
227
+ subtle: '#e4fff3',
228
+ tint: '#f2fff8',
229
+ },
230
+ import: {
231
+ DEFAULT: '#f08829',
232
+ light: '#ffa95b',
233
+ subtle: '#fffcef',
234
+ },
235
+ danger: {
236
+ DEFAULT: '#ff001c',
237
+ dark: '#b41433',
238
+ strong: '#C00B19',
239
+ subtle: '#FFF2F2',
240
+ },
241
+ warning: {
242
+ DEFAULT: '#DBB316',
243
+ dark: '#EF8833',
244
+ subtle: '#FFF6E6',
245
+ },
246
+ },
247
+ fontFamily: {
248
+ sans: ['Inter', 'system-ui', 'sans-serif'],
249
+ },
250
+ fontSize: {
251
+ // PROVISIONAL — see THEME.md; sizes may tighten after design QA.
252
+ 'heading-1': ['2.5rem', { lineHeight: 1.2, fontWeight: 700 }],
253
+ 'heading-2': ['2rem', { lineHeight: 1.25, fontWeight: 700 }],
254
+ 'heading-3': ['1.5rem', { lineHeight: 1.3, fontWeight: 600 }],
255
+ 'body-lg': ['1.125rem', { lineHeight: 1.5, fontWeight: 400 }],
256
+ body: ['1rem', { lineHeight: 1.5, fontWeight: 400 }],
257
+ 'body-sm': ['0.875rem', { lineHeight: 1.4, fontWeight: 400 }],
258
+ caption: ['0.75rem', { lineHeight: 1.3, fontWeight: 400 }],
259
+ },
260
+ },
261
+ },
262
+ };