@africanies/angular-web-sdk 0.1.11 → 0.1.12

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 (93) hide show
  1. package/.nx/cache/{14995846848874973576 → 7821397806208783174}/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs +2572 -962
  2. package/.nx/cache/7821397806208783174/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs.map +1 -0
  3. package/.nx/cache/{14995846848874973576 → 7821397806208783174}/dist/libs/africanies-ui/types/africanies-africanies-ui.d.ts +450 -140
  4. package/.nx/cache/run.json +15 -15
  5. package/.nx/cache/terminalOutputs/16208231681037145050 +85 -0
  6. package/.nx/cache/terminalOutputs/{14995846848874973576 → 7821397806208783174} +2 -2
  7. package/.nx/workspace-data/0091ABA9-5C90-580D-953C-8C94E763ADB5-v3.db +0 -0
  8. package/.nx/workspace-data/0091ABA9-5C90-580D-953C-8C94E763ADB5-v3.db-shm +0 -0
  9. package/.nx/workspace-data/0091ABA9-5C90-580D-953C-8C94E763ADB5-v3.db-wal +0 -0
  10. package/.nx/workspace-data/d/daemon.log +1317 -0
  11. package/.nx/workspace-data/d/server-process.json +2 -2
  12. package/.nx/workspace-data/file-map.json +3458 -3424
  13. package/.nx/workspace-data/nx_files.nxt +0 -0
  14. package/.nx/workspace-data/project-graph.json +2 -2
  15. package/apps/playground/src/app/pages/forms-page.ts +70 -14
  16. package/apps/playground/src/app/snippets/forms.snippets.ts +41 -6
  17. package/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs +1000 -8
  18. package/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs.map +1 -1
  19. package/dist/libs/africanies-ui/types/africanies-africanies-ui.d.ts +201 -15
  20. package/libs/africanies-ui/src/index.ts +18 -0
  21. package/libs/africanies-ui/src/lib/forms/index.ts +20 -0
  22. package/libs/africanies-ui/src/lib/forms/phone-input/index.ts +21 -0
  23. package/libs/africanies-ui/src/lib/forms/phone-input/phone-codes.ts +264 -0
  24. package/libs/africanies-ui/src/lib/forms/phone-input/phone-input.component.ts +477 -0
  25. package/libs/africanies-ui/src/lib/forms/phone-input/phone-input.types.ts +35 -0
  26. package/libs/africanies-ui/src/lib/forms/phone-input/phone-input.utils.spec.ts +81 -0
  27. package/libs/africanies-ui/src/lib/forms/phone-input/phone-input.utils.ts +275 -0
  28. package/libs/africanies-ui/src/lib/modules/africanies-forms.module.ts +2 -0
  29. package/libs/africanies-ui/src/lib/navigation/segment/segment.component.ts +2 -1
  30. package/package.json +1 -1
  31. package/.nx/cache/13466509747676776487/dist/libs/africanies-core/README.md +0 -85
  32. package/.nx/cache/13466509747676776487/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs +0 -4634
  33. package/.nx/cache/13466509747676776487/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs.map +0 -1
  34. package/.nx/cache/13466509747676776487/dist/libs/africanies-core/package.json +0 -31
  35. package/.nx/cache/13466509747676776487/dist/libs/africanies-core/types/africanies-africanies-core.d.ts +0 -2743
  36. package/.nx/cache/14416694322692463866/dist/libs/africanies-models/README.md +0 -60
  37. package/.nx/cache/14416694322692463866/dist/libs/africanies-models/fesm2022/africanies-africanies-models.mjs +0 -599
  38. package/.nx/cache/14416694322692463866/dist/libs/africanies-models/fesm2022/africanies-africanies-models.mjs.map +0 -1
  39. package/.nx/cache/14416694322692463866/dist/libs/africanies-models/package.json +0 -23
  40. package/.nx/cache/14416694322692463866/dist/libs/africanies-models/types/africanies-africanies-models.d.ts +0 -1452
  41. package/.nx/cache/14876618240301288353/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs +0 -19375
  42. package/.nx/cache/14876618240301288353/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs.map +0 -1
  43. package/.nx/cache/14876618240301288353/dist/libs/africanies-ui/types/africanies-africanies-ui.d.ts +0 -5490
  44. package/.nx/cache/14995846848874973576/dist/libs/africanies-ui/README.md +0 -68
  45. package/.nx/cache/14995846848874973576/dist/libs/africanies-ui/assets/brand/africanies-logo-mini.png +0 -0
  46. package/.nx/cache/14995846848874973576/dist/libs/africanies-ui/assets/brand/africanies-logo.png +0 -0
  47. package/.nx/cache/14995846848874973576/dist/libs/africanies-ui/assets/brand/africanies-logo.svg +0 -5
  48. package/.nx/cache/14995846848874973576/dist/libs/africanies-ui/assets/carriers/dhl.svg +0 -7
  49. package/.nx/cache/14995846848874973576/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs.map +0 -1
  50. package/.nx/cache/14995846848874973576/dist/libs/africanies-ui/package.json +0 -35
  51. package/.nx/cache/17626862048742598274/dist/libs/africanies-theme/README.md +0 -46
  52. package/.nx/cache/17626862048742598274/dist/libs/africanies-theme/fesm2022/africanies-africanies-theme.mjs +0 -221
  53. package/.nx/cache/17626862048742598274/dist/libs/africanies-theme/fesm2022/africanies-africanies-theme.mjs.map +0 -1
  54. package/.nx/cache/17626862048742598274/dist/libs/africanies-theme/package.json +0 -35
  55. package/.nx/cache/17626862048742598274/dist/libs/africanies-theme/tailwind-preset.cjs +0 -253
  56. package/.nx/cache/17626862048742598274/dist/libs/africanies-theme/types/africanies-africanies-theme.d.ts +0 -166
  57. package/.nx/cache/6664915487114632770/dist/libs/africanies-icons/README.md +0 -69
  58. package/.nx/cache/6664915487114632770/dist/libs/africanies-icons/assets/icons.sprite.svg +0 -1844
  59. package/.nx/cache/6664915487114632770/dist/libs/africanies-icons/fesm2022/africanies-africanies-icons.mjs +0 -832
  60. package/.nx/cache/6664915487114632770/dist/libs/africanies-icons/fesm2022/africanies-africanies-icons.mjs.map +0 -1
  61. package/.nx/cache/6664915487114632770/dist/libs/africanies-icons/package.json +0 -30
  62. package/.nx/cache/6664915487114632770/dist/libs/africanies-icons/types/africanies-africanies-icons.d.ts +0 -108
  63. package/.nx/cache/6673686859704879504/dist/libs/africanies-theme/README.md +0 -46
  64. package/.nx/cache/6673686859704879504/dist/libs/africanies-theme/fesm2022/africanies-africanies-theme.mjs +0 -231
  65. package/.nx/cache/6673686859704879504/dist/libs/africanies-theme/fesm2022/africanies-africanies-theme.mjs.map +0 -1
  66. package/.nx/cache/6673686859704879504/dist/libs/africanies-theme/package.json +0 -35
  67. package/.nx/cache/6673686859704879504/dist/libs/africanies-theme/tailwind-preset.cjs +0 -262
  68. package/.nx/cache/6673686859704879504/dist/libs/africanies-theme/types/africanies-africanies-theme.d.ts +0 -174
  69. package/.nx/cache/9040451482998546630/dist/libs/africanies-core/README.md +0 -85
  70. package/.nx/cache/9040451482998546630/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs +0 -4511
  71. package/.nx/cache/9040451482998546630/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs.map +0 -1
  72. package/.nx/cache/9040451482998546630/dist/libs/africanies-core/package.json +0 -31
  73. package/.nx/cache/9040451482998546630/dist/libs/africanies-core/types/africanies-africanies-core.d.ts +0 -2741
  74. package/.nx/cache/terminalOutputs/13466509747676776487 +0 -21
  75. package/.nx/cache/terminalOutputs/13555699813138069787 +0 -6
  76. package/.nx/cache/terminalOutputs/14061940909886036014 +0 -173
  77. package/.nx/cache/terminalOutputs/14416694322692463866 +0 -108
  78. package/.nx/cache/terminalOutputs/1446890025183346611 +0 -32
  79. package/.nx/cache/terminalOutputs/14876618240301288353 +0 -21
  80. package/.nx/cache/terminalOutputs/17394769338046050914 +0 -8
  81. package/.nx/cache/terminalOutputs/17626862048742598274 +0 -21
  82. package/.nx/cache/terminalOutputs/6337357866566791975 +0 -6
  83. package/.nx/cache/terminalOutputs/6664915487114632770 +0 -44
  84. package/.nx/cache/terminalOutputs/6673686859704879504 +0 -21
  85. package/.nx/cache/terminalOutputs/783228502946611950 +0 -19
  86. package/.nx/cache/terminalOutputs/7978448102466861029 +0 -32
  87. package/.nx/cache/terminalOutputs/9040451482998546630 +0 -21
  88. /package/.nx/cache/{14876618240301288353 → 7821397806208783174}/dist/libs/africanies-ui/README.md +0 -0
  89. /package/.nx/cache/{14876618240301288353 → 7821397806208783174}/dist/libs/africanies-ui/assets/brand/africanies-logo-mini.png +0 -0
  90. /package/.nx/cache/{14876618240301288353 → 7821397806208783174}/dist/libs/africanies-ui/assets/brand/africanies-logo.png +0 -0
  91. /package/.nx/cache/{14876618240301288353 → 7821397806208783174}/dist/libs/africanies-ui/assets/brand/africanies-logo.svg +0 -0
  92. /package/.nx/cache/{14876618240301288353 → 7821397806208783174}/dist/libs/africanies-ui/assets/carriers/dhl.svg +0 -0
  93. /package/.nx/cache/{14876618240301288353 → 7821397806208783174}/dist/libs/africanies-ui/package.json +0 -0
@@ -1,262 +0,0 @@
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
- };
@@ -1,174 +0,0 @@
1
- import * as i0 from '@angular/core';
2
-
3
- /**
4
- * Tailwind safelist side-effect for shipping-mode color utilities.
5
- *
6
- * WHY this file exists: JIT/content scanning only keeps class names that appear
7
- * as *literal strings* in scanned sources. {@link ModeColorService} already
8
- * returns these literals, but keeping a dedicated comment list makes the
9
- * contract obvious for consumers who configure `safelist` or purge plugins.
10
- *
11
- * Do not rename these strings without updating ModeColorService and THEME.md.
12
- *
13
- * SFN (export / green):
14
- * text-export bg-export bg-export-subtle bg-export-light border-export
15
- * hover:bg-export-light hover:bg-export-subtle dark:bg-export/15 dark:hover:bg-export/15
16
- * dark:bg-[color-mix(in_srgb,#1cbd5d_15%,#212529)] dark:bg-export dark:text-export dark:border-export
17
- *
18
- * STN (import / orange):
19
- * text-import bg-import bg-import-subtle bg-import-light border-import
20
- * hover:bg-import-light hover:bg-import-subtle dark:bg-import/15 dark:hover:bg-import/15
21
- * dark:bg-[color-mix(in_srgb,#f08829_15%,#212529)] dark:bg-import dark:text-import dark:border-import
22
- */
23
- declare const MODE_COLOR_SAFELIST: readonly ["text-export", "bg-export", "bg-export-subtle", "bg-export-light", "border-export", "hover:bg-export-light", "hover:bg-export-subtle", "dark:bg-export/15", "dark:hover:bg-export/15", "dark:bg-[color-mix(in_srgb,#1cbd5d_15%,#212529)]", "dark:bg-export", "dark:text-export", "dark:border-export", "text-import", "bg-import", "bg-import-subtle", "bg-import-light", "border-import", "hover:bg-import-light", "hover:bg-import-subtle", "dark:bg-import/15", "dark:hover:bg-import/15", "dark:bg-[color-mix(in_srgb,#f08829_15%,#212529)]", "dark:bg-import", "dark:text-import", "dark:border-import"];
24
-
25
- /**
26
- * Tailwind class bundle for the active shipping mode (SFN export / STN import).
27
- *
28
- * Use these for **primary** product chrome: CTAs, selected controls, progress,
29
- * and accent text. Semantic colors (danger / warning) stay mode-independent.
30
- */
31
- interface ModeColorClasses {
32
- /** Text color utility, e.g. `text-export`. */
33
- text: string;
34
- /** Solid background utility, e.g. `bg-export`. */
35
- bg: string;
36
- /** Soft background utility, e.g. `bg-export-subtle`. */
37
- bgSubtle: string;
38
- /** Border matching the mode accent, e.g. `border-export`. */
39
- border: string;
40
- /**
41
- * Filled primary CTA — `variant="primary"` on buttons.
42
- * Includes hover utility as a literal so Tailwind keeps it.
43
- */
44
- primary: string;
45
- /**
46
- * Transparent / text-only CTA — `variant="ghost-primary"` on buttons.
47
- * Mode accent text + soft hover fill.
48
- */
49
- ghostPrimary: string;
50
- /**
51
- * Soft highlight for selected / active rows (works in dark mode).
52
- * Dark uses a translucent tint — fine over solid surfaces, not for
53
- * sticky overlays (see {@link softSolid}).
54
- */
55
- soft: string;
56
- /**
57
- * Opaque soft fill — same tint as {@link soft}, but dark mode mixes into
58
- * ink so scrolled content cannot show through (sticky table headers/cells).
59
- */
60
- softSolid: string;
61
- /**
62
- * Soft hover highlight for menus and lists.
63
- */
64
- softHover: string;
65
- /**
66
- * Active nav leaf / collapsed rail — solid mode fill + white text.
67
- */
68
- activeFill: string;
69
- /**
70
- * Stroked secondary CTA — white fill, mode border + text (portal `.btn-stroked`).
71
- */
72
- stroked: string;
73
- }
74
- /**
75
- * Maps {@link ShippingModeService} to mode-accent Tailwind classes.
76
- *
77
- * - **SFN** → export green is primary
78
- * - **STN** → import orange is primary
79
- *
80
- * WHY literal class strings: Tailwind's scanner cannot see dynamically built
81
- * names like `` `text-${token}` ``. Returning full literals (`text-export`, …)
82
- * keeps utilities in the compiled CSS. See {@link MODE_COLOR_SAFELIST}.
83
- *
84
- * @example
85
- * ```html
86
- * @let colors = modeColor.classes();
87
- * <button type="button" [class]="colors.primary">Save</button>
88
- * <span [class]="colors.text">Mode accent</span>
89
- * ```
90
- */
91
- declare class ModeColorService {
92
- private readonly shippingMode;
93
- /**
94
- * Mode-dependent utility classes. Recomputes when shipping mode changes.
95
- */
96
- readonly classes: i0.Signal<ModeColorClasses>;
97
- static ɵfac: i0.ɵɵFactoryDeclaration<ModeColorService, never>;
98
- static ɵprov: i0.ɵɵInjectableDeclaration<ModeColorService>;
99
- }
100
-
101
- /**
102
- * Supported UI color schemes for {@link ThemeService}.
103
- *
104
- * Kept as a closed string union so storage values and DOM class toggles stay
105
- * aligned — unknown persisted strings are ignored and fall back to system
106
- * preference / light.
107
- */
108
- type Theme = 'light' | 'dark';
109
-
110
- /**
111
- * Application light/dark theme preference.
112
- *
113
- * WHY signals (not BehaviorSubject): theme is synchronous UI state read from
114
- * templates and other services; a signal avoids RxJS subscription boilerplate
115
- * and matches Angular 22 change detection. Persistence goes through
116
- * {@link STORAGE_TOKEN} so tests can swap storage without touching `localStorage`.
117
- *
118
- * Applies the Tailwind `darkMode: 'class'` contract by toggling `dark` on
119
- * `document.documentElement`, and sets `color-scheme` so native UI (date
120
- * pickers, scrollbars, form controls) matches the app theme — class-based
121
- * dark mode alone does not restyle browser chrome.
122
- *
123
- * @example
124
- * ```ts
125
- * // app.config.ts
126
- * import { inject, provideAppInitializer } from '@angular/core';
127
- * import { ThemeService } from '@africanies/africanies-theme';
128
- *
129
- * export const appConfig = {
130
- * providers: [
131
- * provideAppInitializer(() => {
132
- * inject(ThemeService); // applies stored / system theme once
133
- * }),
134
- * ],
135
- * };
136
- *
137
- * // In a component
138
- * const theme = inject(ThemeService);
139
- * theme.toggle();
140
- * theme.setTheme('dark');
141
- * const current = theme.theme(); // 'light' | 'dark'
142
- * ```
143
- */
144
- declare class ThemeService {
145
- private readonly storage;
146
- private readonly document;
147
- /**
148
- * Current theme. Prefer reading via `theme()` in templates / computed values
149
- * rather than caching the string, so dark-class consumers stay in sync.
150
- */
151
- readonly theme: i0.WritableSignal<Theme>;
152
- constructor();
153
- /**
154
- * Sets and persists the theme, updating the `dark` class and `color-scheme`
155
- * on `<html>`.
156
- *
157
- * @param theme - Absolute preference to store.
158
- */
159
- setTheme(theme: Theme): void;
160
- /**
161
- * Flips between light and dark.
162
- *
163
- * @returns The theme after the toggle.
164
- */
165
- toggle(): Theme;
166
- private resolveInitialTheme;
167
- private prefersDark;
168
- private applyToDocument;
169
- static ɵfac: i0.ɵɵFactoryDeclaration<ThemeService, never>;
170
- static ɵprov: i0.ɵɵInjectableDeclaration<ThemeService>;
171
- }
172
-
173
- export { MODE_COLOR_SAFELIST, ModeColorService, ThemeService };
174
- export type { ModeColorClasses, Theme };
@@ -1,85 +0,0 @@
1
- # @africanies/africanies-core
2
-
3
- API and app-wiring layer for the AFRICANIES Web SDK: SDK config, HTTP client,
4
- shipping mode, mode-region metadata, TanStack Query default helpers, and
5
- route-driven overlay registration.
6
-
7
- ## Install peers
8
-
9
- ```bash
10
- # Published on npm (@africanies scope)
11
- npm install @africanies/africanies-core @africanies/africanies-models @africanies/africanies-storage
12
- ```
13
-
14
- Peer dependencies: `@angular/common`, `@angular/core`, `@angular/router`,
15
- `rxjs`, `@africanies/africanies-models`, `@africanies/africanies-storage`.
16
-
17
- ## Quick start
18
-
19
- ```ts
20
- import { ApplicationConfig } from '@angular/core';
21
- import {
22
- provideAfricaniesSdk,
23
- provideAfricaniesHttpClient,
24
- provideOverlayRoutes,
25
- createAfricaniesQueryClientDefaults,
26
- } from '@africanies/africanies-core';
27
-
28
- export const appConfig: ApplicationConfig = {
29
- providers: [
30
- provideAfricaniesSdk({ baseUrl: 'https://api.example.com', timeout: 30_000 }),
31
- provideAfricaniesHttpClient(),
32
- // optional extras:
33
- // provideAfricaniesHttpClient({ interceptors: [correlationInterceptor] }),
34
- // optional: provideOverlayRoutes([{ paramKey: 'modal', routes: { ... } }]),
35
- ],
36
- };
37
-
38
- // TanStack Query (app dependency — pin exact experimental version):
39
- // new QueryClient({ defaultOptions: createAfricaniesQueryClientDefaults() })
40
- ```
41
-
42
- ## Modules
43
-
44
- | Area | Exports |
45
- |------|---------|
46
- | Config | `provideAfricaniesSdk`, `AFRICANIES_SDK_CONFIG`, `httpToasts` (`'off'` \| `'errors'` \| `'all'`) |
47
- | Auth | `AuthService` (`forgot`), `isValidEmail`, `AuthTokenService` (`set` / `clear` / `get`) |
48
- | Shipping | `ShippingModeService` (tab-scoped via `sessionStorage`), `shipmentModeInterceptor`, per-request `ApiRequestOptions.shippingMode` / `withShippingMode` |
49
- | HTTP | `provideAfricaniesHttpClient`, `ApiClient` (auto-tags `withToast` from config / `ApiRequestOptions.toast`; optional `shippingMode` per call; HTTP failures → `Error` with formatted `.message`), `withToast`, `withShippingMode`, `httpToastInterceptor`, `normalize` (lifts Laravel validation bags into `errors` + joined `message`), `formatApiErrorMessage` (used internally; rare for hosts), `fieldErrorsMap`, `authInterceptor` |
50
- | Query | `createAfricaniesQueryClientDefaults`, `provideAfricaniesQueryDefaults`, `listFetchKind` (body loader on first load / STN↔SFN; keep rows on focus / Refresh / pager) |
51
- | Mode | `ModeConfigService`, `provideModeConfig`, `MODE_CONFIG_PATH` |
52
- | Country | `CountryService`, `countryFlagUrl` / `mapCountrySelectOptions` (flagcdn.com), `COUNTRY_READ_PATH`, mappers |
53
- | Service | `ServiceService` (`readPage` / `readAll` / `readById`), `SERVICE_READ_PATH` (`/public/service/read`), mappers |
54
- | Document | `DocumentService` (`readPage` / `readAll` / `readById`), `DOCUMENT_READ_PATH` (`/public/document/read`) — preview via `file_ref` on by-id |
55
- | Plan | `PlanService` (`readPage` / `readAll` / `readById`), `PLAN_READ_PATH` (`/public/plan/read`), mappers |
56
- | Currency | `CurrencyService` (`readPage` / `readAll` / `readById`, `create` / `update` / `remove`), `CURRENCY_*_PATH`, mappers |
57
- | Payment method | `PaymentMethodService` (`readPage` / `readAll` / `readById`, `update`), `PAYMENT_METHOD_READ_PATH` / `PAYMENT_METHOD_UPDATE_PATH`, mappers |
58
- | Shipment method | `ShipmentMethodService` (`readPage` / `readAll` / `readById`), `SHIPMENT_METHOD_READ_PATH`, mappers |
59
- | Warehouse | `WarehouseService` (`readPage` / `readAll` / `readById`), `WAREHOUSE_READ_PATH`, mappers |
60
- | Zone | `ZoneService` (`readPage` / `readAll` / `readById`), `ZONE_READ_PATH`, mappers |
61
- | Product | `ProductService` (`readPage` / `readAll` / `readById`), `PRODUCT_READ_PATH`, mappers |
62
- | User | `UserService` (`me`, `changePassword`, `logoutFromAllSessions`), `USER_PATH`, `mapUser` (bare `/user` body; needs `AuthTokenService.set`) |
63
- | Notification | `NotificationService` (`readPage` / `readAll` / `readOne`), `NOTIFICATION_READ_PATH`, `mapNotification` / `mapNotificationInboxItem` |
64
- | File | `FileService` (`read` / `readMultiple` → `POST /file/read`), `FILE_READ_PATH`, `mapFileRead` / `mapFileReadList` |
65
- | Overlay | `provideOverlayRoutes`, `RouteOverlayService`, `MODAL_SERVICE`, `DRAWER_SERVICE` |
66
- | Filters | `FilterOptionsResolver` (`resolveField` lazy in drawer), `mergeFilterOptionLists`, warehouse/method mappers |
67
- | Browser | `copyToClipboard`, `downloadCsv` / `csvCell` (UTF-8 CSV download) |
68
-
69
- List-style GETs follow `ResourceId`: `null` (paginated), `'all'` (full dump), `number` (single).
70
-
71
- | Filter `optionsSource` | SDK resolver |
72
- |------------------------|--------------|
73
- | `warehouses` | Lazy `FilterOptionsResolver.resolveField` → `WarehouseService.readAll()` |
74
- | `shipmentMethods` | Lazy `FilterOptionsResolver.resolveField` → `ShipmentMethodService.readAll()` |
75
- | `shipmentManifests` | Host `optionLists` (no built-in service yet) |
76
-
77
- `MODAL_SERVICE` / `DRAWER_SERVICE` are tokens only — implementations ship in
78
- `@africanies/africanies-ui` to avoid circular dependencies.
79
-
80
- ## Build / test
81
-
82
- ```bash
83
- npx nx build africanies-core
84
- npx nx test africanies-core
85
- ```