@africanies/angular-web-sdk 0.1.12 → 0.1.13

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 (181) hide show
  1. package/.nx/cache/13293303228070520113/dist/libs/africanies-core/README.md +85 -0
  2. package/.nx/cache/13293303228070520113/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs +4699 -0
  3. package/.nx/cache/13293303228070520113/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs.map +1 -0
  4. package/.nx/cache/13293303228070520113/dist/libs/africanies-core/package.json +31 -0
  5. package/.nx/cache/13293303228070520113/dist/libs/africanies-core/types/africanies-africanies-core.d.ts +2748 -0
  6. package/.nx/cache/13387631073062967069/dist/libs/africanies-theme/README.md +46 -0
  7. package/.nx/cache/13387631073062967069/dist/libs/africanies-theme/fesm2022/africanies-africanies-theme.mjs +249 -0
  8. package/.nx/cache/13387631073062967069/dist/libs/africanies-theme/fesm2022/africanies-africanies-theme.mjs.map +1 -0
  9. package/.nx/cache/13387631073062967069/dist/libs/africanies-theme/package.json +35 -0
  10. package/.nx/cache/13387631073062967069/dist/libs/africanies-theme/tailwind-preset.cjs +330 -0
  11. package/.nx/cache/13387631073062967069/dist/libs/africanies-theme/types/africanies-africanies-theme.d.ts +178 -0
  12. package/.nx/cache/16704640000606796352/dist/libs/africanies-storage/README.md +31 -0
  13. package/.nx/cache/16704640000606796352/dist/libs/africanies-storage/fesm2022/africanies-africanies-storage.mjs +249 -0
  14. package/.nx/cache/16704640000606796352/dist/libs/africanies-storage/fesm2022/africanies-africanies-storage.mjs.map +1 -0
  15. package/.nx/cache/16704640000606796352/dist/libs/africanies-storage/package.json +26 -0
  16. package/.nx/cache/16704640000606796352/dist/libs/africanies-storage/types/africanies-africanies-storage.d.ts +210 -0
  17. package/.nx/cache/2427575433215940812/dist/libs/africanies-ui/README.md +68 -0
  18. package/.nx/cache/2427575433215940812/dist/libs/africanies-ui/assets/brand/africanies-logo-mini.png +0 -0
  19. package/.nx/cache/2427575433215940812/dist/libs/africanies-ui/assets/brand/africanies-logo.png +0 -0
  20. package/.nx/cache/2427575433215940812/dist/libs/africanies-ui/assets/brand/africanies-logo.svg +5 -0
  21. package/.nx/cache/2427575433215940812/dist/libs/africanies-ui/assets/carriers/dhl.svg +7 -0
  22. package/.nx/cache/2427575433215940812/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs +21251 -0
  23. package/.nx/cache/2427575433215940812/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs.map +1 -0
  24. package/.nx/cache/2427575433215940812/dist/libs/africanies-ui/package.json +35 -0
  25. package/.nx/cache/2427575433215940812/dist/libs/africanies-ui/types/africanies-africanies-ui.d.ts +5803 -0
  26. package/.nx/cache/7730350229628359718/dist/libs/africanies-icons/README.md +69 -0
  27. package/.nx/cache/7730350229628359718/dist/libs/africanies-icons/assets/icons.sprite.svg +1851 -0
  28. package/.nx/cache/7730350229628359718/dist/libs/africanies-icons/fesm2022/africanies-africanies-icons.mjs +839 -0
  29. package/.nx/cache/7730350229628359718/dist/libs/africanies-icons/fesm2022/africanies-africanies-icons.mjs.map +1 -0
  30. package/.nx/cache/7730350229628359718/dist/libs/africanies-icons/package.json +30 -0
  31. package/.nx/cache/7730350229628359718/dist/libs/africanies-icons/types/africanies-africanies-icons.d.ts +108 -0
  32. package/.nx/cache/run.json +35 -35
  33. package/.nx/cache/terminalOutputs/10603154579345867998 +397 -0
  34. package/.nx/cache/terminalOutputs/12354163057083828162 +80 -0
  35. package/.nx/cache/terminalOutputs/13293303228070520113 +21 -0
  36. package/.nx/cache/terminalOutputs/13387631073062967069 +21 -0
  37. package/.nx/cache/terminalOutputs/14876351543379349919 +176 -0
  38. package/.nx/cache/terminalOutputs/15336883221450327589 +21 -0
  39. package/.nx/cache/terminalOutputs/16208231681037145050 +86 -84
  40. package/.nx/cache/terminalOutputs/16704640000606796352 +21 -0
  41. package/.nx/cache/terminalOutputs/1811006905937373707 +74 -0
  42. package/.nx/cache/terminalOutputs/2005781115771702035 +8 -0
  43. package/.nx/cache/terminalOutputs/2360743690449633551 +21 -0
  44. package/.nx/cache/terminalOutputs/2427575433215940812 +21 -0
  45. package/.nx/cache/terminalOutputs/2981230413857865352 +8 -0
  46. package/.nx/cache/terminalOutputs/3243550283886864639 +8 -0
  47. package/.nx/cache/terminalOutputs/3380188914363501109 +231 -0
  48. package/.nx/cache/terminalOutputs/3699068646900552690 +8 -0
  49. package/.nx/cache/terminalOutputs/5175669339257931410 +8 -0
  50. package/.nx/cache/terminalOutputs/6040230831125637867 +8 -0
  51. package/.nx/cache/terminalOutputs/7730350229628359718 +21 -0
  52. package/.nx/cache/terminalOutputs/8098730470212963224 +87 -0
  53. package/.nx/cache/terminalOutputs/8928690901537686687 +21 -0
  54. package/.nx/workspace-data/0091ABA9-5C90-580D-953C-8C94E763ADB5-v3.db +0 -0
  55. package/.nx/workspace-data/0091ABA9-5C90-580D-953C-8C94E763ADB5-v3.db-shm +0 -0
  56. package/.nx/workspace-data/0091ABA9-5C90-580D-953C-8C94E763ADB5-v3.db-wal +0 -0
  57. package/.nx/workspace-data/d/daemon.log +2859 -0
  58. package/.nx/workspace-data/d/server-process.json +2 -2
  59. package/.nx/workspace-data/file-map.json +2155 -2183
  60. package/.nx/workspace-data/nx_files.nxt +0 -0
  61. package/.nx/workspace-data/project-graph.json +2 -2
  62. package/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs +60 -0
  63. package/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs.map +1 -1
  64. package/dist/libs/africanies-icons/fesm2022/africanies-africanies-icons.mjs +6 -0
  65. package/dist/libs/africanies-icons/fesm2022/africanies-africanies-icons.mjs.map +1 -1
  66. package/dist/libs/africanies-storage/fesm2022/africanies-africanies-storage.mjs +6 -0
  67. package/dist/libs/africanies-storage/fesm2022/africanies-africanies-storage.mjs.map +1 -1
  68. package/dist/libs/africanies-theme/fesm2022/africanies-africanies-theme.mjs +6 -0
  69. package/dist/libs/africanies-theme/fesm2022/africanies-africanies-theme.mjs.map +1 -1
  70. package/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs +297 -51
  71. package/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs.map +1 -1
  72. package/dist/libs/africanies-ui/types/africanies-africanies-ui.d.ts +12 -12
  73. package/libs/africanies-core/src/lib/auth/auth-token.service.ts +3 -0
  74. package/libs/africanies-core/src/lib/auth/auth.service.ts +3 -0
  75. package/libs/africanies-core/src/lib/country/country.service.ts +3 -0
  76. package/libs/africanies-core/src/lib/currency/currency.service.ts +3 -0
  77. package/libs/africanies-core/src/lib/document/document.service.ts +3 -0
  78. package/libs/africanies-core/src/lib/file/file.service.ts +3 -0
  79. package/libs/africanies-core/src/lib/filters/filter-options.resolver.ts +3 -0
  80. package/libs/africanies-core/src/lib/http/api-client.ts +3 -0
  81. package/libs/africanies-core/src/lib/mode/mode-config.service.ts +3 -0
  82. package/libs/africanies-core/src/lib/notification/notification.service.ts +3 -0
  83. package/libs/africanies-core/src/lib/overlay/route-overlay.service.ts +3 -0
  84. package/libs/africanies-core/src/lib/payment-method/payment-method.service.ts +3 -0
  85. package/libs/africanies-core/src/lib/plan/plan.service.ts +3 -0
  86. package/libs/africanies-core/src/lib/product/product.service.ts +3 -0
  87. package/libs/africanies-core/src/lib/service/service.service.ts +3 -0
  88. package/libs/africanies-core/src/lib/shipment-method/shipment-method.service.ts +3 -0
  89. package/libs/africanies-core/src/lib/shipping/shipping-mode.service.ts +3 -0
  90. package/libs/africanies-core/src/lib/user/user.service.ts +3 -0
  91. package/libs/africanies-core/src/lib/warehouse/warehouse.service.ts +3 -0
  92. package/libs/africanies-core/src/lib/zone/zone.service.ts +3 -0
  93. package/libs/africanies-icons/src/lib/africanies-icon.component.ts +3 -0
  94. package/libs/africanies-icons/src/lib/icon-registry.service.ts +3 -0
  95. package/libs/africanies-storage/src/lib/local-storage.service.ts +3 -0
  96. package/libs/africanies-storage/src/lib/session-storage.service.ts +3 -0
  97. package/libs/africanies-theme/src/lib/mode-color.service.ts +3 -0
  98. package/libs/africanies-theme/src/lib/theme.service.ts +3 -0
  99. package/libs/africanies-ui/src/index.ts +11 -11
  100. package/libs/africanies-ui/src/lib/accordion/accordion.component.ts +3 -0
  101. package/libs/africanies-ui/src/lib/action-menu/action-menu-trigger.directive.ts +3 -0
  102. package/libs/africanies-ui/src/lib/action-menu/action-menu.component.ts +3 -0
  103. package/libs/africanies-ui/src/lib/alert/alert.component.ts +3 -0
  104. package/libs/africanies-ui/src/lib/avatar/avatar-menu.component.ts +3 -0
  105. package/libs/africanies-ui/src/lib/avatar/avatar.component.ts +3 -0
  106. package/libs/africanies-ui/src/lib/brand/brand-logo.component.ts +3 -0
  107. package/libs/africanies-ui/src/lib/button/button.component.ts +3 -0
  108. package/libs/africanies-ui/src/lib/carrier/carrier-logo.component.ts +3 -0
  109. package/libs/africanies-ui/src/lib/chip/chip.component.ts +3 -0
  110. package/libs/africanies-ui/src/lib/content-stack/content-stack.component.ts +3 -0
  111. package/libs/africanies-ui/src/lib/copy-button/copy-button.component.ts +3 -0
  112. package/libs/africanies-ui/src/lib/feedback/async-state.component.ts +3 -0
  113. package/libs/africanies-ui/src/lib/feedback/empty-state.component.ts +3 -0
  114. package/libs/africanies-ui/src/lib/feedback/error-indicator.component.ts +3 -0
  115. package/libs/africanies-ui/src/lib/feedback/error-state.component.ts +3 -0
  116. package/libs/africanies-ui/src/lib/feedback/loading-state.component.ts +3 -0
  117. package/libs/africanies-ui/src/lib/filters/filter-drawer.panel.ts +3 -0
  118. package/libs/africanies-ui/src/lib/filters/filter-drawer.service.ts +3 -0
  119. package/libs/africanies-ui/src/lib/filters/filter-query.service.ts +3 -0
  120. package/libs/africanies-ui/src/lib/forms/address-input/address-input.component.ts +3 -0
  121. package/libs/africanies-ui/src/lib/forms/address-input/google-places.service.ts +3 -0
  122. package/libs/africanies-ui/src/lib/forms/checkbox/checkbox.component.ts +3 -0
  123. package/libs/africanies-ui/src/lib/forms/date-picker/date-picker.component.ts +3 -0
  124. package/libs/africanies-ui/src/lib/forms/file-upload/camera-capture.dialog.ts +3 -0
  125. package/libs/africanies-ui/src/lib/forms/file-upload/file-preview.dialog.ts +3 -0
  126. package/libs/africanies-ui/src/lib/forms/file-upload/file-upload.component.ts +3 -0
  127. package/libs/africanies-ui/src/lib/forms/index.ts +3 -3
  128. package/libs/africanies-ui/src/lib/forms/number-input/number-input.component.ts +3 -0
  129. package/libs/africanies-ui/src/lib/forms/otp-input/otp-input.component.ts +3 -0
  130. package/libs/africanies-ui/src/lib/forms/phone-input/phone-input.component.ts +9 -6
  131. package/libs/africanies-ui/src/lib/forms/radio/radio.component.ts +3 -0
  132. package/libs/africanies-ui/src/lib/forms/search-combobox/search-combobox.component.ts +3 -0
  133. package/libs/africanies-ui/src/lib/forms/select/select.component.ts +3 -0
  134. package/libs/africanies-ui/src/lib/forms/text-input/text-input.component.ts +3 -0
  135. package/libs/africanies-ui/src/lib/forms/textarea/textarea.component.ts +3 -0
  136. package/libs/africanies-ui/src/lib/forms/toggle/toggle.component.ts +3 -0
  137. package/libs/africanies-ui/src/lib/image/image.component.ts +3 -0
  138. package/libs/africanies-ui/src/lib/info-popover/info-popover-content.directive.ts +3 -0
  139. package/libs/africanies-ui/src/lib/info-popover/info-popover-trigger.directive.ts +3 -0
  140. package/libs/africanies-ui/src/lib/info-popover/info-popover.component.ts +3 -0
  141. package/libs/africanies-ui/src/lib/layout/app-shell-content-header.component.ts +3 -0
  142. package/libs/africanies-ui/src/lib/layout/app-shell-header-slot.directive.ts +3 -0
  143. package/libs/africanies-ui/src/lib/layout/app-shell-header.component.ts +9 -0
  144. package/libs/africanies-ui/src/lib/layout/app-shell.component.ts +3 -0
  145. package/libs/africanies-ui/src/lib/layout/header-weather.spec.ts +62 -94
  146. package/libs/africanies-ui/src/lib/layout/header-weather.ts +54 -61
  147. package/libs/africanies-ui/src/lib/layout/page-header.component.ts +3 -0
  148. package/libs/africanies-ui/src/lib/modules/africanies-actions.module.ts +3 -0
  149. package/libs/africanies-ui/src/lib/modules/africanies-feedback.module.ts +3 -0
  150. package/libs/africanies-ui/src/lib/modules/africanies-forms.module.ts +3 -0
  151. package/libs/africanies-ui/src/lib/modules/africanies-info-popover.module.ts +3 -0
  152. package/libs/africanies-ui/src/lib/modules/africanies-navigation.module.ts +3 -0
  153. package/libs/africanies-ui/src/lib/modules/africanies-stepper.module.ts +3 -0
  154. package/libs/africanies-ui/src/lib/modules/africanies-table.module.ts +3 -0
  155. package/libs/africanies-ui/src/lib/modules/africanies-tooltip.module.ts +3 -0
  156. package/libs/africanies-ui/src/lib/navigation/breadcrumb/breadcrumb.component.ts +3 -0
  157. package/libs/africanies-ui/src/lib/navigation/segment/segment.component.ts +3 -0
  158. package/libs/africanies-ui/src/lib/navigation/shipping-mode-switch/shipping-mode-switch.component.ts +3 -0
  159. package/libs/africanies-ui/src/lib/navigation/side-nav/africanies-side-nav.component.ts +3 -0
  160. package/libs/africanies-ui/src/lib/navigation/tabs/tab-def.directive.ts +3 -0
  161. package/libs/africanies-ui/src/lib/navigation/tabs/tabs.component.ts +3 -0
  162. package/libs/africanies-ui/src/lib/notifications/notification-drawer.panel.ts +3 -0
  163. package/libs/africanies-ui/src/lib/notifications/notification-drawer.service.ts +3 -0
  164. package/libs/africanies-ui/src/lib/overlay/confirm-dialog.component.ts +3 -0
  165. package/libs/africanies-ui/src/lib/overlay/confirm.service.ts +3 -0
  166. package/libs/africanies-ui/src/lib/overlay/drawer.service.ts +3 -0
  167. package/libs/africanies-ui/src/lib/overlay/modal.service.ts +3 -0
  168. package/libs/africanies-ui/src/lib/overlay/overlay-frame.component.ts +9 -0
  169. package/libs/africanies-ui/src/lib/pagination/pagination.component.ts +3 -0
  170. package/libs/africanies-ui/src/lib/stepper/step-def.directive.ts +3 -0
  171. package/libs/africanies-ui/src/lib/stepper/stepper.component.ts +3 -0
  172. package/libs/africanies-ui/src/lib/table/cell-def.directive.ts +3 -0
  173. package/libs/africanies-ui/src/lib/table/header-cell-def.directive.ts +3 -0
  174. package/libs/africanies-ui/src/lib/table/row-detail-def.directive.ts +3 -0
  175. package/libs/africanies-ui/src/lib/table/table.component.ts +3 -0
  176. package/libs/africanies-ui/src/lib/toast/toast-host.component.ts +4 -1
  177. package/libs/africanies-ui/src/lib/toast/toast-item.component.ts +3 -0
  178. package/libs/africanies-ui/src/lib/toast/toast.service.ts +3 -0
  179. package/libs/africanies-ui/src/lib/tooltip/tooltip-trigger.directive.ts +3 -0
  180. package/libs/africanies-ui/src/lib/tooltip/tooltip.component.ts +3 -0
  181. package/package.json +1 -1
@@ -0,0 +1,330 @@
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: '#172033',
96
+ caretColor: '#172033',
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
+ * Shared elevated card shell so list/detail pages keep one light-theme recipe.
148
+ *
149
+ * @param {import('tailwindcss/types/config').PluginAPI} api
150
+ */
151
+ function africaniesSurfacePlugin({ addComponents }) {
152
+ addComponents({
153
+ '.africanies-card': {
154
+ borderRadius: '0.75rem',
155
+ borderWidth: '1px',
156
+ borderStyle: 'solid',
157
+ borderColor: '#dde3ea',
158
+ backgroundColor: '#ffffff',
159
+ padding: '1.25rem',
160
+ color: '#172033',
161
+ boxShadow:
162
+ '0 1px 2px rgb(23 32 51 / 0.04), 0 1px 3px rgb(23 32 51 / 0.06)',
163
+ '@media (min-width: 640px)': {
164
+ padding: '1.5rem',
165
+ },
166
+ },
167
+ '.dark .africanies-card': {
168
+ borderColor: 'rgba(255, 255, 255, 0.1)',
169
+ backgroundColor: '#272729',
170
+ color: '#ffffff',
171
+ boxShadow: 'none',
172
+ },
173
+ });
174
+ }
175
+
176
+ /**
177
+ * Keep overlay scrollbars off close buttons and other end-aligned chrome.
178
+ *
179
+ * WHY: modal/drawer panes used to scroll themselves. Overlay (and some
180
+ * classic) scrollbars paint in the padding box and cover a top-right close
181
+ * control. The pane stays `overflow: hidden`; the hosted component scrolls
182
+ * with `scrollbar-gutter: stable` so the track is reserved even before
183
+ * content overflows. Dialogs that split header/body can set `overflow-hidden`
184
+ * on the host (a utility, so it wins this base rule) and put
185
+ * `.africanies-overlay-scroll` on the body.
186
+ *
187
+ * @param {import('tailwindcss/types/config').PluginAPI} api
188
+ */
189
+ function africaniesOverlayScrollPlugin({ addBase }) {
190
+ addBase({
191
+ '.africanies-modal-panel, .africanies-drawer-panel': {
192
+ overflow: 'hidden',
193
+ overscrollBehavior: 'contain',
194
+ },
195
+ '.africanies-modal-panel > *, .africanies-drawer-panel > *': {
196
+ minHeight: 0,
197
+ overflowX: 'hidden',
198
+ overflowY: 'auto',
199
+ overscrollBehavior: 'contain',
200
+ scrollbarGutter: 'stable',
201
+ },
202
+ '.africanies-drawer-panel > *': {
203
+ height: '100%',
204
+ },
205
+ '.africanies-overlay-scroll': {
206
+ overscrollBehavior: 'contain',
207
+ scrollbarGutter: 'stable',
208
+ },
209
+ });
210
+ }
211
+
212
+ module.exports = {
213
+ darkMode: 'class',
214
+ plugins: [
215
+ africaniesInteractiveCursorPlugin,
216
+ africaniesSpinPlugin,
217
+ africaniesOverlayStackPlugin,
218
+ africaniesOverlayScrollPlugin,
219
+ africaniesSurfacePlugin,
220
+ africaniesAutofillPlugin,
221
+ ],
222
+ theme: {
223
+ extend: {
224
+ colors: {
225
+ black: '#000000',
226
+ white: '#ffffff',
227
+ surface: {
228
+ DEFAULT: '#ffffff',
229
+ subtle: '#f8fafc',
230
+ hover: '#e9eef5',
231
+ sunken: '#eef2f6',
232
+ },
233
+ ink: {
234
+ // High-contrast cool navy for light-theme body and heading text.
235
+ DEFAULT: '#172033',
236
+ blue: '#192a3e',
237
+ brand: '#172033',
238
+ // Previous ink DEFAULT — dark elevated cards / panels (`dark:bg-ink-surface`).
239
+ surface: '#212529',
240
+ 950: '#272729',
241
+ },
242
+ neutral: {
243
+ 50: '#f8fafc',
244
+ 100: '#eef2f6',
245
+ 200: '#dde3ea',
246
+ 300: '#c9d5e1',
247
+ // Keep 300/400 stable: they are the established dark-theme foregrounds.
248
+ 400: '#a9b5cb',
249
+ 500: '#667185',
250
+ 600: '#526071',
251
+ 700: '#3e4a59',
252
+ 800: '#2c3644',
253
+ 900: '#172033',
254
+ },
255
+ border: {
256
+ // Quiet card/divider chrome. Controls use the stronger `control` token.
257
+ DEFAULT: '#dde3ea',
258
+ strong: '#c4cdd8',
259
+ },
260
+ // 3.1:1 against white: visible enough for meaningful control boundaries.
261
+ control: '#8793a3',
262
+ focus: '#175cd3',
263
+ background: {
264
+ // Cooler canvas and a clearer inset level beneath white surfaces.
265
+ chrome: '#f4f6f8',
266
+ // Nested wells inside white cards.
267
+ well: '#eef2f6',
268
+ // Auth / welcome / soft hover.
269
+ welcome: '#f8fafc',
270
+ hover: '#e9eef5',
271
+ },
272
+ export: {
273
+ DEFAULT: '#26bd5d',
274
+ light: '#24dc6d',
275
+ subtle: '#e4fff3',
276
+ tint: '#f2fff8',
277
+ // Accessible normal-text / white-text-control foreground (5.43:1).
278
+ strong: '#0b7a3e',
279
+ hover: '#096833',
280
+ },
281
+ import: {
282
+ DEFAULT: '#f08829',
283
+ light: '#ffa95b',
284
+ subtle: '#fffcef',
285
+ // Brand orange (same as DEFAULT) — portal STN primary.
286
+ strong: '#f08829',
287
+ hover: '#7f3e09',
288
+ },
289
+ danger: {
290
+ DEFAULT: '#ff001c',
291
+ dark: '#b4233c',
292
+ strong: '#C00B19',
293
+ subtle: '#FFF2F2',
294
+ },
295
+ warning: {
296
+ DEFAULT: '#DBB316',
297
+ dark: '#8a5a00',
298
+ subtle: '#FFF6E6',
299
+ },
300
+ info: {
301
+ DEFAULT: '#175cd3',
302
+ subtle: '#eff6ff',
303
+ },
304
+ },
305
+ fontFamily: {
306
+ sans: ['Inter', 'system-ui', 'sans-serif'],
307
+ },
308
+ fontSize: {
309
+ // PROVISIONAL — see THEME.md; sizes may tighten after design QA.
310
+ 'heading-1': ['2.5rem', { lineHeight: 1.2, fontWeight: 700 }],
311
+ 'heading-2': ['2rem', { lineHeight: 1.25, fontWeight: 700 }],
312
+ 'heading-3': ['1.5rem', { lineHeight: 1.3, fontWeight: 600 }],
313
+ 'body-lg': ['1.125rem', { lineHeight: 1.5, fontWeight: 400 }],
314
+ body: ['1rem', { lineHeight: 1.5, fontWeight: 400 }],
315
+ 'body-sm': ['0.875rem', { lineHeight: 1.4, fontWeight: 400 }],
316
+ caption: ['0.75rem', { lineHeight: 1.3, fontWeight: 400 }],
317
+ },
318
+ borderRadius: {
319
+ control: '0.5rem',
320
+ panel: '0.75rem',
321
+ },
322
+ boxShadow: {
323
+ card:
324
+ '0 1px 2px rgb(23 32 51 / 0.04), 0 1px 3px rgb(23 32 51 / 0.06)',
325
+ floating:
326
+ '0 12px 32px rgb(23 32 51 / 0.12), 0 2px 8px rgb(23 32 51 / 0.06)',
327
+ },
328
+ },
329
+ },
330
+ };
@@ -0,0 +1,178 @@
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-strong bg-export-strong hover:bg-export-hover border-export-strong
15
+ * text-export bg-export bg-export-subtle bg-export-light border-export
16
+ * hover:bg-export-light hover:bg-export-subtle dark:bg-export/15 dark:hover:bg-export/15
17
+ * dark:bg-[color-mix(in_srgb,#26bd5d_15%,#212529)] dark:bg-export dark:text-export dark:border-export
18
+ *
19
+ * STN (import / orange):
20
+ * text-import-strong bg-import-strong hover:bg-import-hover border-import-strong
21
+ * text-import bg-import bg-import-subtle bg-import-light border-import
22
+ * hover:bg-import-light hover:bg-import-subtle dark:bg-import/15 dark:hover:bg-import/15
23
+ * dark:bg-[color-mix(in_srgb,#f08829_15%,#212529)] dark:bg-import dark:text-import dark:border-import
24
+ */
25
+ declare const MODE_COLOR_SAFELIST: readonly ["text-export", "text-export-strong", "bg-export", "bg-export-strong", "bg-export-subtle", "bg-export-light", "border-export", "border-export-strong", "hover:bg-export-hover", "hover:bg-export-light", "hover:bg-export-subtle", "dark:bg-export/15", "dark:hover:bg-export/15", "dark:hover:bg-export-light", "dark:bg-[color-mix(in_srgb,#26bd5d_15%,#212529)]", "dark:bg-export", "dark:text-export", "dark:border-export", "text-import", "text-import-strong", "bg-import", "bg-import-strong", "bg-import-subtle", "bg-import-light", "border-import", "border-import-strong", "hover:bg-import-hover", "hover:bg-import-light", "hover:bg-import-subtle", "dark:bg-import/15", "dark:hover:bg-import/15", "dark:hover:bg-import-light", "dark:bg-[color-mix(in_srgb,#f08829_15%,#212529)]", "dark:bg-import", "dark:text-import", "dark:border-import"];
26
+
27
+ /**
28
+ * Tailwind class bundle for the active shipping mode (SFN export / STN import).
29
+ *
30
+ * Use these for **primary** product chrome: CTAs, selected controls, progress,
31
+ * and accent text. Semantic colors (danger / warning) stay mode-independent.
32
+ */
33
+ interface ModeColorClasses {
34
+ /**
35
+ * Accessible accent text — mode brand color in light and dark.
36
+ */
37
+ text: string;
38
+ /** Solid background utility, e.g. `bg-export`. */
39
+ bg: string;
40
+ /** Soft background utility, e.g. `bg-export-subtle`. */
41
+ bgSubtle: string;
42
+ /** Border matching the mode accent, e.g. `border-export`. */
43
+ border: string;
44
+ /**
45
+ * Filled primary CTA — `variant="primary"` on buttons.
46
+ * Includes hover utility as a literal so Tailwind keeps it.
47
+ */
48
+ primary: string;
49
+ /**
50
+ * Transparent / text-only CTA — `variant="ghost-primary"` on buttons.
51
+ * Mode accent text + soft hover fill.
52
+ */
53
+ ghostPrimary: string;
54
+ /**
55
+ * Soft highlight for selected / active rows (works in dark mode).
56
+ * Dark uses a translucent tint — fine over solid surfaces, not for
57
+ * sticky overlays (see {@link softSolid}).
58
+ */
59
+ soft: string;
60
+ /**
61
+ * Opaque soft fill — same tint as {@link soft}, but dark mode mixes into
62
+ * ink so scrolled content cannot show through (sticky table headers/cells).
63
+ */
64
+ softSolid: string;
65
+ /**
66
+ * Soft hover highlight for menus and lists.
67
+ */
68
+ softHover: string;
69
+ /**
70
+ * Active nav leaf / collapsed rail — solid mode fill + white text.
71
+ */
72
+ activeFill: string;
73
+ /**
74
+ * Stroked secondary CTA — white fill, mode border + text (portal `.btn-stroked`).
75
+ */
76
+ stroked: string;
77
+ }
78
+ /**
79
+ * Maps {@link ShippingModeService} to mode-accent Tailwind classes.
80
+ *
81
+ * - **SFN** → export green is primary
82
+ * - **STN** → import orange is primary
83
+ *
84
+ * WHY literal class strings: Tailwind's scanner cannot see dynamically built
85
+ * names like `` `text-${token}` ``. Returning full literals (`text-export`, …)
86
+ * keeps utilities in the compiled CSS. See {@link MODE_COLOR_SAFELIST}.
87
+ *
88
+ * @example
89
+ * ```html
90
+ * @let colors = modeColor.classes();
91
+ * <button type="button" [class]="colors.primary">Save</button>
92
+ * <span [class]="colors.text">Mode accent</span>
93
+ * ```
94
+ */
95
+ declare class ModeColorService {
96
+ private readonly shippingMode;
97
+ /**
98
+ * Mode-dependent utility classes. Recomputes when shipping mode changes.
99
+ */
100
+ readonly classes: i0.Signal<ModeColorClasses>;
101
+ static ɵfac: i0.ɵɵFactoryDeclaration<ModeColorService, never>;
102
+ static ɵprov: i0.ɵɵInjectableDeclaration<ModeColorService>;
103
+ }
104
+
105
+ /**
106
+ * Supported UI color schemes for {@link ThemeService}.
107
+ *
108
+ * Kept as a closed string union so storage values and DOM class toggles stay
109
+ * aligned — unknown persisted strings are ignored and fall back to system
110
+ * preference / light.
111
+ */
112
+ type Theme = 'light' | 'dark';
113
+
114
+ /**
115
+ * Application light/dark theme preference.
116
+ *
117
+ * WHY signals (not BehaviorSubject): theme is synchronous UI state read from
118
+ * templates and other services; a signal avoids RxJS subscription boilerplate
119
+ * and matches Angular 22 change detection. Persistence goes through
120
+ * {@link STORAGE_TOKEN} so tests can swap storage without touching `localStorage`.
121
+ *
122
+ * Applies the Tailwind `darkMode: 'class'` contract by toggling `dark` on
123
+ * `document.documentElement`, and sets `color-scheme` so native UI (date
124
+ * pickers, scrollbars, form controls) matches the app theme — class-based
125
+ * dark mode alone does not restyle browser chrome.
126
+ *
127
+ * @example
128
+ * ```ts
129
+ * // app.config.ts
130
+ * import { inject, provideAppInitializer } from '@angular/core';
131
+ * import { ThemeService } from '@africanies/africanies-theme';
132
+ *
133
+ * export const appConfig = {
134
+ * providers: [
135
+ * provideAppInitializer(() => {
136
+ * inject(ThemeService); // applies stored / system theme once
137
+ * }),
138
+ * ],
139
+ * };
140
+ *
141
+ * // In a component
142
+ * const theme = inject(ThemeService);
143
+ * theme.toggle();
144
+ * theme.setTheme('dark');
145
+ * const current = theme.theme(); // 'light' | 'dark'
146
+ * ```
147
+ */
148
+ declare class ThemeService {
149
+ private readonly storage;
150
+ private readonly document;
151
+ /**
152
+ * Current theme. Prefer reading via `theme()` in templates / computed values
153
+ * rather than caching the string, so dark-class consumers stay in sync.
154
+ */
155
+ readonly theme: i0.WritableSignal<Theme>;
156
+ constructor();
157
+ /**
158
+ * Sets and persists the theme, updating the `dark` class and `color-scheme`
159
+ * on `<html>`.
160
+ *
161
+ * @param theme - Absolute preference to store.
162
+ */
163
+ setTheme(theme: Theme): void;
164
+ /**
165
+ * Flips between light and dark.
166
+ *
167
+ * @returns The theme after the toggle.
168
+ */
169
+ toggle(): Theme;
170
+ private resolveInitialTheme;
171
+ private prefersDark;
172
+ private applyToDocument;
173
+ static ɵfac: i0.ɵɵFactoryDeclaration<ThemeService, never>;
174
+ static ɵprov: i0.ɵɵInjectableDeclaration<ThemeService>;
175
+ }
176
+
177
+ export { MODE_COLOR_SAFELIST, ModeColorService, ThemeService };
178
+ export type { ModeColorClasses, Theme };
@@ -0,0 +1,31 @@
1
+ # @africanies/africanies-storage
2
+
3
+ Injectable browser storage for the AFRICANIES Web SDK. Provides a swappable
4
+ `StorageService` behind `STORAGE_TOKEN`, with `localStorage` (default) and
5
+ `sessionStorage` implementations plus `provideLocalStorage()` /
6
+ `provideSessionStorage()` helpers.
7
+
8
+ Shipping mode (`ShippingModeService` in `@africanies/africanies-core`) always persists
9
+ via `SessionStorageService` directly so each browser tab can use a different
10
+ STN/SFN mode. Theme and auth token use `STORAGE_TOKEN` (localStorage by default).
11
+
12
+ ## Usage
13
+
14
+ ```ts
15
+ import {
16
+ STORAGE_TOKEN,
17
+ provideLocalStorage,
18
+ AFRICANIES_THEME_KEY,
19
+ } from '@africanies/africanies-storage';
20
+
21
+ // app.config.ts
22
+ providers: [provideLocalStorage()];
23
+
24
+ // elsewhere
25
+ const storage = inject(STORAGE_TOKEN);
26
+ storage.set(AFRICANIES_THEME_KEY, 'dark');
27
+ ```
28
+
29
+ ## Tests
30
+
31
+ Run `nx test africanies-storage`.