@africanies/angular-web-sdk 0.1.10 → 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 (98) hide show
  1. package/.nx/cache/{14995846848874973576 → 14892813664845064572}/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs +1634 -1016
  2. package/.nx/cache/14892813664845064572/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs.map +1 -0
  3. package/.nx/cache/{14995846848874973576 → 14892813664845064572}/dist/libs/africanies-ui/types/africanies-africanies-ui.d.ts +261 -137
  4. package/.nx/cache/{14876618240301288353 → 7821397806208783174}/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs +2641 -1011
  5. package/.nx/cache/7821397806208783174/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs.map +1 -0
  6. package/.nx/cache/{14876618240301288353 → 7821397806208783174}/dist/libs/africanies-ui/types/africanies-africanies-ui.d.ts +460 -147
  7. package/.nx/cache/run.json +16 -16
  8. package/.nx/cache/terminalOutputs/{14876618240301288353 → 14892813664845064572} +2 -2
  9. package/.nx/cache/terminalOutputs/16208231681037145050 +85 -0
  10. package/.nx/cache/terminalOutputs/{1446890025183346611 → 17909810599991457481} +15 -7
  11. package/.nx/cache/terminalOutputs/{7978448102466861029 → 2927637324428060203} +41 -31
  12. package/.nx/cache/terminalOutputs/{17394769338046050914 → 4787481949164239892} +2 -2
  13. package/.nx/cache/terminalOutputs/{14995846848874973576 → 7821397806208783174} +2 -2
  14. package/.nx/workspace-data/0091ABA9-5C90-580D-953C-8C94E763ADB5-v3.db +0 -0
  15. package/.nx/workspace-data/0091ABA9-5C90-580D-953C-8C94E763ADB5-v3.db-shm +0 -0
  16. package/.nx/workspace-data/0091ABA9-5C90-580D-953C-8C94E763ADB5-v3.db-wal +0 -0
  17. package/.nx/workspace-data/d/daemon.log +3694 -0
  18. package/.nx/workspace-data/d/server-process.json +2 -2
  19. package/.nx/workspace-data/file-map.json +1508 -1478
  20. package/.nx/workspace-data/nx_files.nxt +0 -0
  21. package/.nx/workspace-data/project-graph.json +2 -2
  22. package/README.md +0 -17
  23. package/apps/playground/src/app/pages/forms-page.ts +70 -14
  24. package/apps/playground/src/app/snippets/forms.snippets.ts +41 -6
  25. package/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs +1149 -142
  26. package/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs.map +1 -1
  27. package/dist/libs/africanies-ui/types/africanies-africanies-ui.d.ts +205 -18
  28. package/libs/africanies-ui/src/index.ts +18 -0
  29. package/libs/africanies-ui/src/lib/forms/index.ts +20 -0
  30. package/libs/africanies-ui/src/lib/forms/phone-input/index.ts +21 -0
  31. package/libs/africanies-ui/src/lib/forms/phone-input/phone-codes.ts +264 -0
  32. package/libs/africanies-ui/src/lib/forms/phone-input/phone-input.component.ts +477 -0
  33. package/libs/africanies-ui/src/lib/forms/phone-input/phone-input.types.ts +35 -0
  34. package/libs/africanies-ui/src/lib/forms/phone-input/phone-input.utils.spec.ts +81 -0
  35. package/libs/africanies-ui/src/lib/forms/phone-input/phone-input.utils.ts +275 -0
  36. package/libs/africanies-ui/src/lib/modules/africanies-forms.module.ts +2 -0
  37. package/libs/africanies-ui/src/lib/navigation/segment/segment.component.ts +2 -1
  38. package/libs/africanies-ui/src/lib/navigation/shipping-mode-switch/shipping-mode-switch.component.spec.ts +15 -0
  39. package/libs/africanies-ui/src/lib/navigation/shipping-mode-switch/shipping-mode-switch.component.ts +6 -3
  40. package/libs/africanies-ui/src/lib/table/table.component.ts +70 -65
  41. package/package.json +1 -1
  42. package/.nx/cache/13466509747676776487/dist/libs/africanies-core/README.md +0 -85
  43. package/.nx/cache/13466509747676776487/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs +0 -4634
  44. package/.nx/cache/13466509747676776487/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs.map +0 -1
  45. package/.nx/cache/13466509747676776487/dist/libs/africanies-core/package.json +0 -31
  46. package/.nx/cache/13466509747676776487/dist/libs/africanies-core/types/africanies-africanies-core.d.ts +0 -2743
  47. package/.nx/cache/14416694322692463866/dist/libs/africanies-models/README.md +0 -60
  48. package/.nx/cache/14416694322692463866/dist/libs/africanies-models/fesm2022/africanies-africanies-models.mjs +0 -599
  49. package/.nx/cache/14416694322692463866/dist/libs/africanies-models/fesm2022/africanies-africanies-models.mjs.map +0 -1
  50. package/.nx/cache/14416694322692463866/dist/libs/africanies-models/package.json +0 -23
  51. package/.nx/cache/14416694322692463866/dist/libs/africanies-models/types/africanies-africanies-models.d.ts +0 -1452
  52. package/.nx/cache/14876618240301288353/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs.map +0 -1
  53. package/.nx/cache/14995846848874973576/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs.map +0 -1
  54. package/.nx/cache/17626862048742598274/dist/libs/africanies-theme/README.md +0 -46
  55. package/.nx/cache/17626862048742598274/dist/libs/africanies-theme/fesm2022/africanies-africanies-theme.mjs +0 -221
  56. package/.nx/cache/17626862048742598274/dist/libs/africanies-theme/fesm2022/africanies-africanies-theme.mjs.map +0 -1
  57. package/.nx/cache/17626862048742598274/dist/libs/africanies-theme/package.json +0 -35
  58. package/.nx/cache/17626862048742598274/dist/libs/africanies-theme/tailwind-preset.cjs +0 -253
  59. package/.nx/cache/17626862048742598274/dist/libs/africanies-theme/types/africanies-africanies-theme.d.ts +0 -166
  60. package/.nx/cache/6664915487114632770/dist/libs/africanies-icons/README.md +0 -69
  61. package/.nx/cache/6664915487114632770/dist/libs/africanies-icons/assets/icons.sprite.svg +0 -1844
  62. package/.nx/cache/6664915487114632770/dist/libs/africanies-icons/fesm2022/africanies-africanies-icons.mjs +0 -832
  63. package/.nx/cache/6664915487114632770/dist/libs/africanies-icons/fesm2022/africanies-africanies-icons.mjs.map +0 -1
  64. package/.nx/cache/6664915487114632770/dist/libs/africanies-icons/package.json +0 -30
  65. package/.nx/cache/6664915487114632770/dist/libs/africanies-icons/types/africanies-africanies-icons.d.ts +0 -108
  66. package/.nx/cache/6673686859704879504/dist/libs/africanies-theme/README.md +0 -46
  67. package/.nx/cache/6673686859704879504/dist/libs/africanies-theme/fesm2022/africanies-africanies-theme.mjs +0 -231
  68. package/.nx/cache/6673686859704879504/dist/libs/africanies-theme/fesm2022/africanies-africanies-theme.mjs.map +0 -1
  69. package/.nx/cache/6673686859704879504/dist/libs/africanies-theme/package.json +0 -35
  70. package/.nx/cache/6673686859704879504/dist/libs/africanies-theme/tailwind-preset.cjs +0 -262
  71. package/.nx/cache/6673686859704879504/dist/libs/africanies-theme/types/africanies-africanies-theme.d.ts +0 -174
  72. package/.nx/cache/9040451482998546630/dist/libs/africanies-core/README.md +0 -85
  73. package/.nx/cache/9040451482998546630/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs +0 -4511
  74. package/.nx/cache/9040451482998546630/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs.map +0 -1
  75. package/.nx/cache/9040451482998546630/dist/libs/africanies-core/package.json +0 -31
  76. package/.nx/cache/9040451482998546630/dist/libs/africanies-core/types/africanies-africanies-core.d.ts +0 -2741
  77. package/.nx/cache/terminalOutputs/13466509747676776487 +0 -21
  78. package/.nx/cache/terminalOutputs/13555699813138069787 +0 -6
  79. package/.nx/cache/terminalOutputs/14061940909886036014 +0 -173
  80. package/.nx/cache/terminalOutputs/14416694322692463866 +0 -108
  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/9040451482998546630 +0 -21
  87. /package/.nx/cache/{14876618240301288353 → 14892813664845064572}/dist/libs/africanies-ui/README.md +0 -0
  88. /package/.nx/cache/{14876618240301288353 → 14892813664845064572}/dist/libs/africanies-ui/assets/brand/africanies-logo-mini.png +0 -0
  89. /package/.nx/cache/{14876618240301288353 → 14892813664845064572}/dist/libs/africanies-ui/assets/brand/africanies-logo.png +0 -0
  90. /package/.nx/cache/{14876618240301288353 → 14892813664845064572}/dist/libs/africanies-ui/assets/brand/africanies-logo.svg +0 -0
  91. /package/.nx/cache/{14876618240301288353 → 14892813664845064572}/dist/libs/africanies-ui/assets/carriers/dhl.svg +0 -0
  92. /package/.nx/cache/{14876618240301288353 → 14892813664845064572}/dist/libs/africanies-ui/package.json +0 -0
  93. /package/.nx/cache/{14995846848874973576 → 7821397806208783174}/dist/libs/africanies-ui/README.md +0 -0
  94. /package/.nx/cache/{14995846848874973576 → 7821397806208783174}/dist/libs/africanies-ui/assets/brand/africanies-logo-mini.png +0 -0
  95. /package/.nx/cache/{14995846848874973576 → 7821397806208783174}/dist/libs/africanies-ui/assets/brand/africanies-logo.png +0 -0
  96. /package/.nx/cache/{14995846848874973576 → 7821397806208783174}/dist/libs/africanies-ui/assets/brand/africanies-logo.svg +0 -0
  97. /package/.nx/cache/{14995846848874973576 → 7821397806208783174}/dist/libs/africanies-ui/assets/carriers/dhl.svg +0 -0
  98. /package/.nx/cache/{14995846848874973576 → 7821397806208783174}/dist/libs/africanies-ui/package.json +0 -0
Binary file
@@ -826,7 +826,7 @@
826
826
  "targetGroups": {},
827
827
  "js": {
828
828
  "packageName": "@africanies/angular-web-sdk",
829
- "packageVersion": "0.1.10",
829
+ "packageVersion": "0.1.12",
830
830
  "isInPackageManagerWorkspaces": true
831
831
  }
832
832
  },
@@ -42095,5 +42095,5 @@
42095
42095
  },
42096
42096
  "version": "6.0",
42097
42097
  "errors": [],
42098
- "computedAt": 1788897040140
42098
+ "computedAt": 1789121395872
42099
42099
  }
package/README.md CHANGED
@@ -26,23 +26,6 @@ npm install @africanies/africanies-core @africanies/africanies-models @africanie
26
26
  @africanies/africanies-theme @africanies/africanies-icons @africanies/africanies-ui
27
27
  ```
28
28
 
29
- ### Migrating from `@aies/*`
30
-
31
- If a consuming app still references the old scope, update in one pass:
32
-
33
- | Before | After |
34
- | --- | --- |
35
- | GitHub Packages `.npmrc` lines | Remove — packages install from npmjs.org |
36
- | `@aies/aies-core` (etc.) | `@africanies/africanies-core` (etc.) |
37
- | `provideAiesSdk` | `provideAfricaniesSdk` |
38
- | `provideAiesHttpClient` | `provideAfricaniesHttpClient` |
39
- | `provideAiesUiOverlays` | `provideAfricaniesUiOverlays` |
40
- | `provideAiesToasts` | `provideAfricaniesToasts` |
41
- | `<aies-button>` / `aiesCellDef` | `<africanies-button>` / `africaniesCellDef` |
42
- | Storage keys `aies.theme`, `aies.accessToken`, … | `africanies.theme`, `africanies.accessToken`, … |
43
-
44
- Publish current versions from this repo to npm (`nx release publish`; see [CONTRIBUTING](./CONTRIBUTING.md)) before pointing production apps at the new names.
45
-
46
29
  ## Quickstart
47
30
 
48
31
  Wire these in `app.config.ts`. Each provider turns on one slice of the SDK:
@@ -11,6 +11,7 @@ import {
11
11
  type FileUploadResult,
12
12
  NumberInputComponent,
13
13
  OtpInputComponent,
14
+ PhoneInputComponent,
14
15
  RadioComponent,
15
16
  type RadioOption,
16
17
  SelectComponent,
@@ -30,6 +31,7 @@ import {
30
31
  FORMS_LIVE_VALUES,
31
32
  FORMS_NUMBER,
32
33
  FORMS_OTP,
34
+ FORMS_PHONE,
33
35
  FORMS_SELECT,
34
36
  FORMS_TEXT,
35
37
  FORMS_TEXTAREA,
@@ -48,6 +50,7 @@ import {
48
50
  TextareaComponent,
49
51
  SelectComponent,
50
52
  AddressInputComponent,
53
+ PhoneInputComponent,
51
54
  NumberInputComponent,
52
55
  OtpInputComponent,
53
56
  FileUploadComponent,
@@ -134,6 +137,33 @@ import {
134
137
  </div>
135
138
  </app-demo-section>
136
139
 
140
+ <app-demo-section
141
+ title="Phone input"
142
+ hint="International number — flag + dial code + national digits. [(value)] is E.164 (e.g. +2348012345678) so edit screens can prepopulate from the API string."
143
+ [code]="phoneCode"
144
+ >
145
+ <div class="grid gap-5 md:grid-cols-2">
146
+ <africanies-phone-input
147
+ label="Consignee phone"
148
+ hint="Prefilled from a stored E.164 value"
149
+ countryIso2="NG"
150
+ [(value)]="phone"
151
+ />
152
+ <africanies-phone-input
153
+ label="Locked sender phone"
154
+ countryIso2="GH"
155
+ [lockCountry]="true"
156
+ [(value)]="lockedPhone"
157
+ />
158
+ <africanies-phone-input
159
+ label="Phone with error"
160
+ error="Enter a valid mobile number"
161
+ countryIso2="US"
162
+ [(value)]="phoneError"
163
+ />
164
+ </div>
165
+ </app-demo-section>
166
+
137
167
  <app-demo-section
138
168
  title="Select"
139
169
  hint="Choose from a list — searchable, creatable free text, and multi-select for tags and filters."
@@ -357,6 +387,12 @@ import {
357
387
  {{ tracking() || '—' }}
358
388
  </dd>
359
389
  </div>
390
+ <div>
391
+ <dt class="text-neutral-600">Phone</dt>
392
+ <dd class="m-0 font-medium text-ink dark:text-white">
393
+ {{ phone() || '—' }}
394
+ </dd>
395
+ </div>
360
396
  <div>
361
397
  <dt class="text-neutral-600">Amount</dt>
362
398
  <dd class="m-0 font-medium text-ink dark:text-white">
@@ -403,14 +439,17 @@ import {
403
439
  `,
404
440
  })
405
441
  export class FormsPage {
406
- protected readonly tracking = signal('');
407
- protected readonly reference = signal('');
442
+ protected readonly tracking = signal('AWB-10482');
443
+ protected readonly reference = signal('PO-7781');
408
444
  protected readonly email = signal('not-an-email');
409
445
  protected readonly locked = signal('WH-LOCKED-01');
410
- protected readonly instructions = signal('');
446
+ protected readonly instructions = signal('Fragile — keep upright');
411
447
  protected readonly notesError = signal('x'.repeat(12));
412
448
  protected readonly amount = signal<number | null>(12500);
413
449
  protected readonly weight = signal<number | null>(24.5);
450
+ protected readonly phone = signal('+2348012345678');
451
+ protected readonly lockedPhone = signal('+233244123456');
452
+ protected readonly phoneError = signal('+15551212');
414
453
  protected readonly warehouses = signal<SelectOption<string>[]>([
415
454
  { label: 'Lagos Hub', value: 'los', prefix: 'warehouse', suffix: 'globe' },
416
455
  { label: 'Accra Depot', value: 'acc', prefix: 'warehouse' },
@@ -422,24 +461,31 @@ export class FormsPage {
422
461
  },
423
462
  { label: 'Cairo Gateway', value: 'cai', prefix: 'warehouse' },
424
463
  ]);
425
- protected readonly selectedWarehouse = signal<SelectOption<string> | null>(
426
- null,
427
- );
464
+ protected readonly selectedWarehouse = signal<SelectOption<string> | null>({
465
+ label: 'Lagos Hub',
466
+ value: 'los',
467
+ prefix: 'warehouse',
468
+ suffix: 'globe',
469
+ });
428
470
  protected readonly tags = signal<SelectOption<string>[]>([
429
471
  { label: 'Fragile', value: 'fragile', prefix: 'warning' },
430
472
  { label: 'Priority', value: 'priority', prefix: 'alarm' },
431
473
  { label: 'Bonded', value: 'bonded', prefix: 'anchor' },
432
474
  ]);
433
- protected readonly selectedTags = signal<SelectOption<string>[]>([]);
475
+ protected readonly selectedTags = signal<SelectOption<string>[]>([
476
+ { label: 'Fragile', value: 'fragile', prefix: 'warning' },
477
+ { label: 'Priority', value: 'priority', prefix: 'alarm' },
478
+ ]);
434
479
  protected readonly incoterms: SelectOption<string>[] = [
435
480
  { label: 'DDP', value: 'ddp' },
436
481
  { label: 'DAP', value: 'dap' },
437
482
  { label: 'EXW', value: 'exw' },
438
483
  { label: 'FOB', value: 'fob' },
439
484
  ];
440
- protected readonly selectedIncoterm = signal<SelectOption<string> | null>(
441
- null,
442
- );
485
+ protected readonly selectedIncoterm = signal<SelectOption<string> | null>({
486
+ label: 'DDP',
487
+ value: 'ddp',
488
+ });
443
489
  protected readonly carriers: SelectOption<string>[] = [
444
490
  {
445
491
  label: 'DHL Express',
@@ -453,7 +499,16 @@ export class FormsPage {
453
499
  protected readonly selectedCarrier = signal<SelectOption<string> | null>(
454
500
  null,
455
501
  );
456
- protected readonly pickupAddress = signal<AddressPlace | null>(null);
502
+ protected readonly pickupAddress = signal<AddressPlace | null>({
503
+ placeId: 'place-lagos-1',
504
+ formattedAddress: '12 Broad Street, Lagos, Nigeria',
505
+ name: '12 Broad Street',
506
+ lat: 6.4541,
507
+ lng: 3.3947,
508
+ locality: 'Lagos',
509
+ country: 'Nigeria',
510
+ countryCode: 'NG',
511
+ });
457
512
  protected readonly lastPlaceSelected = signal<AddressPlace | null>(null);
458
513
  protected readonly signature = signal(true);
459
514
  protected readonly insured = signal(false);
@@ -469,12 +524,12 @@ export class FormsPage {
469
524
  ];
470
525
  protected readonly serviceLevel = signal<string | null>('standard');
471
526
  protected readonly readyDate = signal<string | null>('2026-08-15');
472
- protected readonly cutoffDate = signal<string | null>(null);
527
+ protected readonly cutoffDate = signal<string | null>('2026-08-14');
473
528
  protected readonly files = signal<FileUploadResult[]>([]);
474
529
  protected readonly buttonFiles = signal<FileUploadResult[]>([]);
475
530
  protected readonly compactFiles = signal<FileUploadResult[]>([]);
476
- protected readonly otpCodeValue = signal('');
477
- protected readonly otpPin = signal('');
531
+ protected readonly otpCodeValue = signal('482913');
532
+ protected readonly otpPin = signal('7391');
478
533
  protected readonly otpError = signal('0000');
479
534
  protected readonly lastOtpCompleted = signal('');
480
535
  protected readonly otpResendCount = signal(0);
@@ -482,6 +537,7 @@ export class FormsPage {
482
537
  protected readonly textCode = FORMS_TEXT;
483
538
  protected readonly textareaCode = FORMS_TEXTAREA;
484
539
  protected readonly numberCode = FORMS_NUMBER;
540
+ protected readonly phoneCode = FORMS_PHONE;
485
541
  protected readonly selectCode = FORMS_SELECT;
486
542
  protected readonly addressCode = FORMS_ADDRESS;
487
543
  protected readonly choiceCode = FORMS_CHOICE;
@@ -41,8 +41,8 @@ import { TextInputComponent } from '@africanies/africanies-ui';
41
41
  \`,
42
42
  })
43
43
  export class ShipmentReferenceFormComponent {
44
- protected readonly tracking = signal('');
45
- protected readonly reference = signal('');
44
+ protected readonly tracking = signal('AWB-10482');
45
+ protected readonly reference = signal('PO-7781');
46
46
  protected readonly email = signal('not-an-email');
47
47
  protected readonly locked = signal('WH-LOCKED-01');
48
48
  }
@@ -79,8 +79,8 @@ import { TextareaComponent } from '@africanies/africanies-ui';
79
79
  \`,
80
80
  })
81
81
  export class ShipmentInstructionsFormComponent {
82
- protected readonly instructions = signal('');
83
- protected readonly notesError = signal('');
82
+ protected readonly instructions = signal('Fragile — keep upright');
83
+ protected readonly notesError = signal('x'.repeat(12));
84
84
  }
85
85
  `;
86
86
 
@@ -122,6 +122,41 @@ export class ShipmentValueFormComponent {
122
122
  }
123
123
  `;
124
124
 
125
+ export /**
126
+ *
127
+ */
128
+ const FORMS_PHONE = `
129
+ // [(value)] is an E.164 string (+234…). Edit screens prepopulate from the API
130
+ // phone field; countryIso2 is a hint when dial codes are shared (e.g. +1).
131
+
132
+ import { Component, signal } from '@angular/core';
133
+ import { PhoneInputComponent } from '@africanies/africanies-ui';
134
+
135
+ @Component({
136
+ selector: 'app-consignee-phone-form',
137
+ standalone: true,
138
+ imports: [PhoneInputComponent],
139
+ template: \`
140
+ <africanies-phone-input
141
+ label="Consignee phone"
142
+ countryIso2="NG"
143
+ [(value)]="phone"
144
+ />
145
+
146
+ <africanies-phone-input
147
+ label="Locked sender phone"
148
+ countryIso2="GH"
149
+ [lockCountry]="true"
150
+ [(value)]="lockedPhone"
151
+ />
152
+ \`,
153
+ })
154
+ export class ConsigneePhoneFormComponent {
155
+ protected readonly phone = signal('+2348012345678');
156
+ protected readonly lockedPhone = signal('+233244123456');
157
+ }
158
+ `;
159
+
125
160
  export /**
126
161
  *
127
162
  */
@@ -476,8 +511,8 @@ import { OtpInputComponent } from '@africanies/africanies-ui';
476
511
  \`,
477
512
  })
478
513
  export class VerifyOtpFormComponent {
479
- protected readonly code = signal('');
480
- protected readonly pin = signal('');
514
+ protected readonly code = signal('482913');
515
+ protected readonly pin = signal('7391');
481
516
 
482
517
  protected verify(code: string): void {
483
518
  // POST /auth/verify { code }