@africanies/angular-web-sdk 0.1.1 → 0.1.3

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 (116) hide show
  1. package/.angular/cache/22.0.9/playground/.tsbuildinfo +1 -1
  2. package/.angular/cache/22.0.9/playground/angular-compiler.db +0 -0
  3. package/.angular/cache/22.0.9/playground/angular-compiler.db-lock +0 -0
  4. package/.github/workflows/deploy-demo.yml +63 -0
  5. package/.nx/cache/12276756491762927325/dist/libs/africanies-theme/README.md +46 -0
  6. package/.nx/cache/12276756491762927325/dist/libs/africanies-theme/fesm2022/africanies-africanies-theme.mjs +215 -0
  7. package/.nx/cache/12276756491762927325/dist/libs/africanies-theme/fesm2022/africanies-africanies-theme.mjs.map +1 -0
  8. package/.nx/cache/12276756491762927325/dist/libs/africanies-theme/package.json +35 -0
  9. package/.nx/cache/12276756491762927325/dist/libs/africanies-theme/tailwind-preset.cjs +245 -0
  10. package/.nx/cache/12276756491762927325/dist/libs/africanies-theme/types/africanies-africanies-theme.d.ts +157 -0
  11. package/.nx/cache/17491371155400585077/dist/libs/africanies-core/README.md +85 -0
  12. package/.nx/cache/17491371155400585077/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs +4546 -0
  13. package/.nx/cache/17491371155400585077/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs.map +1 -0
  14. package/.nx/cache/17491371155400585077/dist/libs/africanies-core/package.json +31 -0
  15. package/.nx/cache/17491371155400585077/dist/libs/africanies-core/types/africanies-africanies-core.d.ts +2740 -0
  16. package/.nx/cache/3314955264390318442/dist/libs/africanies-ui/README.md +68 -0
  17. package/.nx/cache/3314955264390318442/dist/libs/africanies-ui/assets/brand/africanies-logo-mini.png +0 -0
  18. package/.nx/cache/3314955264390318442/dist/libs/africanies-ui/assets/brand/africanies-logo.png +0 -0
  19. package/.nx/cache/3314955264390318442/dist/libs/africanies-ui/assets/brand/africanies-logo.svg +5 -0
  20. package/.nx/cache/3314955264390318442/dist/libs/africanies-ui/assets/carriers/dhl.svg +7 -0
  21. package/.nx/cache/3314955264390318442/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs +19291 -0
  22. package/.nx/cache/3314955264390318442/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs.map +1 -0
  23. package/.nx/cache/3314955264390318442/dist/libs/africanies-ui/package.json +35 -0
  24. package/.nx/cache/3314955264390318442/dist/libs/africanies-ui/types/africanies-africanies-ui.d.ts +5483 -0
  25. package/.nx/cache/run.json +38 -38
  26. package/.nx/cache/terminalOutputs/12276756491762927325 +21 -0
  27. package/.nx/cache/terminalOutputs/13524438527920092277 +196 -21
  28. package/.nx/cache/terminalOutputs/14153928176747262656 +45 -21
  29. package/.nx/cache/terminalOutputs/14416694322692463866 +108 -21
  30. package/.nx/cache/terminalOutputs/15255861479705594703 +51 -21
  31. package/.nx/cache/terminalOutputs/17491371155400585077 +21 -0
  32. package/.nx/cache/terminalOutputs/18132311043100376919 +315 -21
  33. package/.nx/cache/terminalOutputs/2436781291243085315 +8 -0
  34. package/.nx/cache/terminalOutputs/3017748574492080228 +28 -0
  35. package/.nx/cache/terminalOutputs/3314955264390318442 +21 -0
  36. package/.nx/cache/terminalOutputs/6664915487114632770 +44 -21
  37. package/.nx/cache/terminalOutputs/8648260256613557249 +173 -0
  38. package/.nx/cache/terminalOutputs/8767335728598176888 +37 -0
  39. package/.nx/cache/terminalOutputs/9408529484792607601 +6 -0
  40. package/.nx/cache/terminalOutputs/9739655320223921719 +47 -0
  41. package/.nx/workspace-data/0091ABA9-5C90-580D-953C-8C94E763ADB5-v3.db +0 -0
  42. package/.nx/workspace-data/0091ABA9-5C90-580D-953C-8C94E763ADB5-v3.db-shm +0 -0
  43. package/.nx/workspace-data/0091ABA9-5C90-580D-953C-8C94E763ADB5-v3.db-wal +0 -0
  44. package/.nx/workspace-data/d/daemon.log +3026 -0
  45. package/.nx/workspace-data/d/server-process.json +2 -2
  46. package/.nx/workspace-data/file-map.json +3268 -3262
  47. package/.nx/workspace-data/nx_files.nxt +0 -0
  48. package/.nx/workspace-data/project-graph.json +9 -9
  49. package/.nx/workspace-data/project-graph.lock +0 -0
  50. package/.pnpm-store/v11/index.db +0 -0
  51. package/README.md +13 -1
  52. package/apps/playground/src/app/app.config.ts +28 -3
  53. package/apps/playground/src/app/snippets/action-menu.snippets.ts +1 -0
  54. package/dist/apps/playground/3rdpartylicenses.txt +415 -0
  55. package/dist/apps/playground/browser/assets/africanies-icons/icons.sprite.svg +1844 -0
  56. package/dist/apps/playground/browser/assets/africanies-ui/brand/africanies-logo-mini.png +0 -0
  57. package/dist/apps/playground/browser/assets/africanies-ui/brand/africanies-logo.png +0 -0
  58. package/dist/apps/playground/browser/assets/africanies-ui/brand/africanies-logo.svg +5 -0
  59. package/dist/apps/playground/browser/assets/africanies-ui/carriers/dhl.svg +7 -0
  60. package/dist/apps/playground/browser/chunk--VJ6U9Ev.js +2 -0
  61. package/dist/apps/playground/browser/chunk-B1QVY0hA.js +1 -0
  62. package/dist/apps/playground/browser/chunk-BHI7MG2Y.js +1 -0
  63. package/dist/apps/playground/browser/chunk-BJ5IK8Re.js +1 -0
  64. package/dist/apps/playground/browser/chunk-BOSfyWK2.js +1 -0
  65. package/dist/apps/playground/browser/chunk-BYPboEAg.js +1 -0
  66. package/dist/apps/playground/browser/chunk-BZBRtbFJ.js +1 -0
  67. package/dist/apps/playground/browser/chunk-BdrGkq40.js +1 -0
  68. package/dist/apps/playground/browser/chunk-Bej5a2xR.js +1 -0
  69. package/dist/apps/playground/browser/chunk-Bg3QC1eL.js +1 -0
  70. package/dist/apps/playground/browser/chunk-BsnTz1m5.js +1 -0
  71. package/dist/apps/playground/browser/chunk-C5kLunTi.js +1 -0
  72. package/dist/apps/playground/browser/chunk-C6tu3y81.js +1 -0
  73. package/dist/apps/playground/browser/chunk-C96WSpFp.js +1 -0
  74. package/dist/apps/playground/browser/chunk-CCnOVzbz.js +2 -0
  75. package/dist/apps/playground/browser/chunk-CERmZ9We.js +1 -0
  76. package/dist/apps/playground/browser/chunk-CZBTrY_H.js +68 -0
  77. package/dist/apps/playground/browser/chunk-Cg7brw6x.js +4070 -0
  78. package/dist/apps/playground/browser/chunk-CjTyStrr.js +1 -0
  79. package/dist/apps/playground/browser/chunk-CjYlnYC7.js +1 -0
  80. package/dist/apps/playground/browser/chunk-ClSUoZp8.js +292 -0
  81. package/dist/apps/playground/browser/chunk-CsrxfMap.js +1 -0
  82. package/dist/apps/playground/browser/chunk-CtndMAe2.js +1 -0
  83. package/dist/apps/playground/browser/chunk-Cy-ZOZI8.js +1 -0
  84. package/dist/apps/playground/browser/chunk-D3-jrtyv.js +1 -0
  85. package/dist/apps/playground/browser/chunk-D3vgrlDF.js +1 -0
  86. package/dist/apps/playground/browser/chunk-D48aVVTv.js +1 -0
  87. package/dist/apps/playground/browser/chunk-D4V3eSCv.js +1 -0
  88. package/dist/apps/playground/browser/chunk-DK715t6D.js +1 -0
  89. package/dist/apps/playground/browser/chunk-DUkct7WP.js +1 -0
  90. package/dist/apps/playground/browser/chunk-Y9ccR-I6.js +1 -0
  91. package/dist/apps/playground/browser/chunk-lfUHaltX.js +1 -0
  92. package/dist/apps/playground/browser/favicon.ico +0 -0
  93. package/dist/apps/playground/browser/index.html +14 -0
  94. package/dist/apps/playground/browser/main-WEJC3BLT.js +148 -0
  95. package/dist/apps/playground/browser/styles-4FSELHYD.css +1 -0
  96. package/dist/apps/playground/prerendered-routes.json +3 -0
  97. package/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs +1 -1
  98. package/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs.map +1 -1
  99. package/dist/libs/africanies-core/package.json +3 -3
  100. package/dist/libs/africanies-theme/package.json +3 -3
  101. package/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs +318 -115
  102. package/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs.map +1 -1
  103. package/dist/libs/africanies-ui/package.json +5 -5
  104. package/dist/libs/africanies-ui/types/africanies-africanies-ui.d.ts +92 -19
  105. package/libs/africanies-core/package.json +3 -3
  106. package/libs/africanies-core/src/lib/payment-method/payment-method.mapper.spec.ts +15 -0
  107. package/libs/africanies-core/src/lib/payment-method/payment-method.mapper.ts +1 -2
  108. package/libs/africanies-theme/package.json +3 -3
  109. package/libs/africanies-ui/package.json +5 -5
  110. package/libs/africanies-ui/src/index.ts +6 -0
  111. package/libs/africanies-ui/src/lib/accordion/accordion.component.ts +135 -0
  112. package/libs/africanies-ui/src/lib/accordion/index.ts +7 -0
  113. package/libs/africanies-ui/src/lib/action-menu/action-menu.component.ts +84 -17
  114. package/libs/africanies-ui/src/lib/action-menu/menu-item.ts +19 -2
  115. package/libs/africanies-ui/src/lib/modules/africanies-feedback.module.ts +3 -1
  116. package/package.json +31 -8
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@africanies/africanies-core",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^22.0.0",
6
6
  "@angular/core": "^22.0.0",
7
7
  "@angular/router": "^22.0.0",
8
8
  "rxjs": "^7.8.0",
9
- "@africanies/africanies-models": "^0.0.2",
10
- "@africanies/africanies-storage": "^0.0.1"
9
+ "@africanies/africanies-models": ">=0.0.2 <0.1.0",
10
+ "@africanies/africanies-storage": ">=0.0.1 <0.1.0"
11
11
  },
12
12
  "sideEffects": false,
13
13
  "publishConfig": {
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@africanies/africanies-theme",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^22.0.0",
6
6
  "@angular/core": "^22.0.0",
7
- "@africanies/africanies-core": "^0.0.2",
8
- "@africanies/africanies-storage": "^0.0.1"
7
+ "@africanies/africanies-core": ">=0.0.2 <0.1.0",
8
+ "@africanies/africanies-storage": ">=0.0.1 <0.1.0"
9
9
  },
10
10
  "sideEffects": false,
11
11
  "publishConfig": {
@@ -1,17 +1,17 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, input, booleanAttribute, computed, ChangeDetectionStrategy, Component, output, signal, Injector, DestroyRef, Injectable, numberAttribute, Directive, viewChild, contentChild, makeEnvironmentProviders, provideAppInitializer, model, forwardRef, InjectionToken, effect, afterNextRender, viewChildren, TemplateRef, contentChildren, untracked, runInInjectionContext, afterRenderEffect, NgModule } from '@angular/core';
2
+ import { inject, input, booleanAttribute, computed, ChangeDetectionStrategy, Component, output, signal, Injector, DestroyRef, Injectable, numberAttribute, Directive, viewChild, contentChild, model, makeEnvironmentProviders, provideAppInitializer, forwardRef, InjectionToken, effect, afterNextRender, viewChildren, TemplateRef, contentChildren, untracked, runInInjectionContext, afterRenderEffect, NgModule } from '@angular/core';
3
3
  import { AfricaniesIconComponent } from '@africanies/africanies-icons';
4
4
  import { ModeColorService, ThemeService } from '@africanies/africanies-theme';
5
5
  import { copyToClipboard, AFRICANIES_HTTP_TOAST, FilterOptionsResolver, MODAL_SERVICE, DRAWER_SERVICE, ShippingModeService, resolveNotificationLinkForMode } from '@africanies/africanies-core';
6
6
  import { Overlay, CdkOverlayOrigin, CdkConnectedOverlay } from '@angular/cdk/overlay';
7
7
  import { ComponentPortal } from '@angular/cdk/portal';
8
+ import { Router, ActivatedRoute, RouterLink, NavigationEnd } from '@angular/router';
8
9
  import { EXPORT_DELIVERY_VENDORS, DELIVERY_VENDORS, normalizeDeliveryVendorForForm, isKnownDeliveryVendor, hasFilterParams, fromFilterParams, filterQueryKeys, toFilterParams, cloneFilterState, resetFilterState, PAGINATION_PAGE_SIZES, DEFAULT_PAGE_SIZE } from '@africanies/africanies-models';
9
10
  export { DEFAULT_FILTER_TRANSPORT, DEFAULT_PAGE_SIZE, FILTER_CONFIGS, FilterTransport, NOTIFICATION_PAGE_SIZE, PAGINATION_PAGE_SIZES, clearFilterField, cloneFilterState, emptyFilterState, filterQueryKeys, fromFilterParams, hasFilterParams, resetFilterState, resolveFilterTransport, shipmentTrackingItemFilterConfig, toFilterParams, trackShipmentsFilterConfig, updateShipmentsFilterConfig, usersFilterConfig } from '@africanies/africanies-models';
10
11
  import { HttpErrorResponse } from '@angular/common/http';
11
12
  import { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';
12
13
  import { Subject, take, isObservable, defer, throwError, of, from, map, timer, filter, startWith } from 'rxjs';
13
14
  import { NG_VALUE_ACCESSOR } from '@angular/forms';
14
- import { ActivatedRoute, Router, RouterLink, NavigationEnd } from '@angular/router';
15
15
  import { debounce, switchMap, distinctUntilChanged, tap, catchError } from 'rxjs/operators';
16
16
  import { NgTemplateOutlet, NgClass, DatePipe } from '@angular/common';
17
17
 
@@ -1303,6 +1303,84 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
1303
1303
  * Clipboard copy control (`africanies-copy`).
1304
1304
  */
1305
1305
 
1306
+ /**
1307
+ * Builds a {@link UrlTree} for an item’s `routerLink` / query / fragment.
1308
+ *
1309
+ * @param router - Consumer app router.
1310
+ * @param item - Nav item with a `routerLink`.
1311
+ * @returns UrlTree, or `null` when the item is not routed.
1312
+ */
1313
+ function navItemUrlTree(router, item) {
1314
+ if (item.routerLink == null) {
1315
+ return null;
1316
+ }
1317
+ const commands = Array.isArray(item.routerLink)
1318
+ ? [...item.routerLink]
1319
+ : [item.routerLink];
1320
+ return router.createUrlTree(commands, {
1321
+ queryParams: item.queryParams,
1322
+ fragment: item.fragment,
1323
+ });
1324
+ }
1325
+ /**
1326
+ * Whether the current router URL matches this item (cold load + navigations).
1327
+ *
1328
+ * @param router - Consumer app router.
1329
+ * @param item - Nav item with a `routerLink`.
1330
+ * @param options - Same shape as `RouterLinkActive` options.
1331
+ * @returns True when the current URL matches the item.
1332
+ */
1333
+ function isNavItemActive(router, item, options) {
1334
+ const tree = navItemUrlTree(router, item);
1335
+ if (!tree) {
1336
+ return false;
1337
+ }
1338
+ return router.isActive(tree, options);
1339
+ }
1340
+
1341
+ /**
1342
+ * Whether a click should leave navigation to the browser (new tab, etc.).
1343
+ * @param event - Mouse click from a routed nav control.
1344
+ * @returns True when the host should not call `preventDefault` / navigate.
1345
+ */
1346
+ function isModifiedClick(event) {
1347
+ return (event.button !== 0 ||
1348
+ event.metaKey ||
1349
+ event.ctrlKey ||
1350
+ event.shiftKey ||
1351
+ event.altKey);
1352
+ }
1353
+ /**
1354
+ * Serialized href for a routed nav item (for `<a href>` without RouterLink).
1355
+ * @param router - App router.
1356
+ * @param item - Nav item with `routerLink`.
1357
+ * @returns Path string, or `null` when the item is not routed.
1358
+ */
1359
+ function navItemHref(router, item) {
1360
+ const tree = navItemUrlTree(router, item);
1361
+ return tree ? router.serializeUrl(tree) : null;
1362
+ }
1363
+ /**
1364
+ * Navigate to a nav item without jumping the viewport to the top.
1365
+ *
1366
+ * Apps that enable `withInMemoryScrolling({ scrollPositionRestoration:
1367
+ * 'enabled' })` scroll to `[0, 0]` on every forward navigation. That is wrong
1368
+ * for in-page tabs/segments. Passing `{ scroll: 'manual' }` tells Angular's
1369
+ * RouterScroller to skip scrolling for this navigation.
1370
+ *
1371
+ * @param router - App router.
1372
+ * @param item - Nav item with `routerLink`.
1373
+ * @param keepScroll - When true (default for tabs/segments), skip router scroll.
1374
+ * @returns Navigation promise, or `null` when the item is not routed.
1375
+ */
1376
+ function navigateNavItem(router, item, keepScroll = true) {
1377
+ const tree = navItemUrlTree(router, item);
1378
+ if (!tree) {
1379
+ return null;
1380
+ }
1381
+ return router.navigateByUrl(tree, keepScroll ? { scroll: 'manual' } : undefined);
1382
+ }
1383
+
1306
1384
  /**
1307
1385
  * Marks projected content as the custom trigger for {@link ActionMenuComponent}.
1308
1386
  *
@@ -1358,6 +1436,9 @@ const MENU_PANEL_POSITIONS = [
1358
1436
  * clipped by table `overflow`. Default trigger is a ghost ellipsis button;
1359
1437
  * project a custom control with {@link ActionMenuTriggerDirective}.
1360
1438
  *
1439
+ * Items with {@link AfricaniesMenuItem.routerLink} render as anchors so users
1440
+ * can right-click / modified-click to open in a new tab.
1441
+ *
1361
1442
  * @example
1362
1443
  * ```html
1363
1444
  * <!-- Default icon trigger (table row) -->
@@ -1373,7 +1454,12 @@ const MENU_PANEL_POSITIONS = [
1373
1454
  * ```ts
1374
1455
  * rowActions(row: Shipment): AfricaniesMenuItem[] {
1375
1456
  * return [
1376
- * { label: 'Open', icon: 'eye', onClick: () => this.open(row) },
1457
+ * {
1458
+ * label: 'Open',
1459
+ * icon: 'eye',
1460
+ * routerLink: ['/shipments', row.id],
1461
+ * onClick: () => this.open(row),
1462
+ * },
1377
1463
  * { label: 'Edit', icon: 'edit', onClick: () => this.edit(row) },
1378
1464
  * {
1379
1465
  * label: 'Delete',
@@ -1387,6 +1473,7 @@ const MENU_PANEL_POSITIONS = [
1387
1473
  * ```
1388
1474
  */
1389
1475
  class ActionMenuComponent {
1476
+ router = inject(Router);
1390
1477
  panelPositions = MENU_PANEL_POSITIONS;
1391
1478
  panelRef = viewChild('panel', /* @ts-ignore */
1392
1479
  ...(ngDevMode ? [{ debugName: "panelRef" }] : /* istanbul ignore next */ []));
@@ -1412,7 +1499,7 @@ class ActionMenuComponent {
1412
1499
  }
1413
1500
  itemClass(item, index) {
1414
1501
  const active = this.activeIndex() === index;
1415
- const base = 'flex w-full cursor-pointer items-center gap-2 px-3 py-2 text-body-sm transition-colors ' +
1502
+ const base = 'flex w-full cursor-pointer items-center gap-2 px-3 py-2 text-body-sm no-underline transition-colors ' +
1416
1503
  'disabled:cursor-not-allowed disabled:opacity-50 ' +
1417
1504
  'focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-ink';
1418
1505
  if (item.danger) {
@@ -1426,6 +1513,9 @@ class ActionMenuComponent {
1426
1513
  ? 'bg-background-welcome dark:bg-white/10'
1427
1514
  : 'hover:bg-background-welcome dark:hover:bg-white/10'));
1428
1515
  }
1516
+ hrefFor(item) {
1517
+ return navItemHref(this.router, item);
1518
+ }
1429
1519
  onTriggerClick(event) {
1430
1520
  event.preventDefault();
1431
1521
  event.stopPropagation();
@@ -1500,11 +1590,35 @@ class ActionMenuComponent {
1500
1590
  onOverlayDetach() {
1501
1591
  this.open.set(false);
1502
1592
  }
1593
+ /**
1594
+ * Primary click on a routed item: in-app activate via {@link onClick} or
1595
+ * router. Modified clicks keep native link behaviour (new tab).
1596
+ */
1597
+ onRoutedItemClick(event, item) {
1598
+ if (item.disabled) {
1599
+ event.preventDefault();
1600
+ return;
1601
+ }
1602
+ if (isModifiedClick(event)) {
1603
+ this.close();
1604
+ return;
1605
+ }
1606
+ event.preventDefault();
1607
+ this.activateItem(item);
1608
+ }
1503
1609
  selectItem(item) {
1504
1610
  if (item.disabled) {
1505
1611
  return;
1506
1612
  }
1507
- item.onClick();
1613
+ this.activateItem(item);
1614
+ }
1615
+ activateItem(item) {
1616
+ if (item.onClick) {
1617
+ item.onClick();
1618
+ }
1619
+ else if (item.routerLink != null) {
1620
+ void navigateNavItem(this.router, item, false);
1621
+ }
1508
1622
  this.close();
1509
1623
  }
1510
1624
  toggle() {
@@ -1606,20 +1720,41 @@ class ActionMenuComponent {
1606
1720
  role="separator"
1607
1721
  ></div>
1608
1722
  }
1609
- <button
1610
- type="button"
1611
- role="menuitem"
1612
- [id]="itemDomId(i)"
1613
- [class]="itemClass(item, i)"
1614
- [disabled]="!!item.disabled"
1615
- (click)="selectItem(item)"
1616
- (mouseenter)="activeIndex.set(i)"
1617
- >
1618
- @if (item.icon; as icon) {
1619
- <africanies-icon [name]="icon" [size]="16" class="shrink-0" />
1620
- }
1621
- <span class="min-w-0 flex-1 truncate text-left">{{ item.label }}</span>
1622
- </button>
1723
+ @if (item.routerLink !== null && item.routerLink !== undefined) {
1724
+ <a
1725
+ role="menuitem"
1726
+ [id]="itemDomId(i)"
1727
+ [class]="itemClass(item, i)"
1728
+ [attr.href]="item.disabled ? null : hrefFor(item)"
1729
+ [attr.aria-disabled]="item.disabled ? true : null"
1730
+ (click)="onRoutedItemClick($event, item)"
1731
+ (mouseenter)="activeIndex.set(i)"
1732
+ >
1733
+ @if (item.icon; as icon) {
1734
+ <africanies-icon [name]="icon" [size]="16" class="shrink-0" />
1735
+ }
1736
+ <span class="min-w-0 flex-1 truncate text-left">{{
1737
+ item.label
1738
+ }}</span>
1739
+ </a>
1740
+ } @else {
1741
+ <button
1742
+ type="button"
1743
+ role="menuitem"
1744
+ [id]="itemDomId(i)"
1745
+ [class]="itemClass(item, i)"
1746
+ [disabled]="!!item.disabled"
1747
+ (click)="selectItem(item)"
1748
+ (mouseenter)="activeIndex.set(i)"
1749
+ >
1750
+ @if (item.icon; as icon) {
1751
+ <africanies-icon [name]="icon" [size]="16" class="shrink-0" />
1752
+ }
1753
+ <span class="min-w-0 flex-1 truncate text-left">{{
1754
+ item.label
1755
+ }}</span>
1756
+ </button>
1757
+ }
1623
1758
  }
1624
1759
  </div>
1625
1760
  </ng-template>
@@ -1702,20 +1837,41 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
1702
1837
  role="separator"
1703
1838
  ></div>
1704
1839
  }
1705
- <button
1706
- type="button"
1707
- role="menuitem"
1708
- [id]="itemDomId(i)"
1709
- [class]="itemClass(item, i)"
1710
- [disabled]="!!item.disabled"
1711
- (click)="selectItem(item)"
1712
- (mouseenter)="activeIndex.set(i)"
1713
- >
1714
- @if (item.icon; as icon) {
1715
- <africanies-icon [name]="icon" [size]="16" class="shrink-0" />
1716
- }
1717
- <span class="min-w-0 flex-1 truncate text-left">{{ item.label }}</span>
1718
- </button>
1840
+ @if (item.routerLink !== null && item.routerLink !== undefined) {
1841
+ <a
1842
+ role="menuitem"
1843
+ [id]="itemDomId(i)"
1844
+ [class]="itemClass(item, i)"
1845
+ [attr.href]="item.disabled ? null : hrefFor(item)"
1846
+ [attr.aria-disabled]="item.disabled ? true : null"
1847
+ (click)="onRoutedItemClick($event, item)"
1848
+ (mouseenter)="activeIndex.set(i)"
1849
+ >
1850
+ @if (item.icon; as icon) {
1851
+ <africanies-icon [name]="icon" [size]="16" class="shrink-0" />
1852
+ }
1853
+ <span class="min-w-0 flex-1 truncate text-left">{{
1854
+ item.label
1855
+ }}</span>
1856
+ </a>
1857
+ } @else {
1858
+ <button
1859
+ type="button"
1860
+ role="menuitem"
1861
+ [id]="itemDomId(i)"
1862
+ [class]="itemClass(item, i)"
1863
+ [disabled]="!!item.disabled"
1864
+ (click)="selectItem(item)"
1865
+ (mouseenter)="activeIndex.set(i)"
1866
+ >
1867
+ @if (item.icon; as icon) {
1868
+ <africanies-icon [name]="icon" [size]="16" class="shrink-0" />
1869
+ }
1870
+ <span class="min-w-0 flex-1 truncate text-left">{{
1871
+ item.label
1872
+ }}</span>
1873
+ </button>
1874
+ }
1719
1875
  }
1720
1876
  </div>
1721
1877
  </ng-template>
@@ -2384,6 +2540,128 @@ function isEmptyData(data) {
2384
2540
  * {@link AsyncStateComponent}) around tables and resource views.
2385
2541
  */
2386
2542
 
2543
+ /**
2544
+ * Bordered expandable panel with animated fold — the pattern used on
2545
+ * Manifest detail and Make Payment review.
2546
+ *
2547
+ * Parent owns open state via {@link open} (`model()` / `[(open)]`).
2548
+ *
2549
+ * @example
2550
+ * ```html
2551
+ * <africanies-accordion
2552
+ * title="Customer Information"
2553
+ * [open]="isOpen('customer')"
2554
+ * (openChange)="onOpenChange('customer', $event)"
2555
+ * >
2556
+ * <dl>…</dl>
2557
+ * </africanies-accordion>
2558
+ * ```
2559
+ */
2560
+ class AccordionComponent {
2561
+ /** Plain-text header. Prefer projected `[africaniesAccordionTitle]` for rich titles. */
2562
+ title = input('', /* @ts-ignore */
2563
+ ...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
2564
+ /** Whether the panel body is expanded. */
2565
+ open = model(false, /* @ts-ignore */
2566
+ ...(ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []));
2567
+ /** Padding / chevron density. */
2568
+ size = input('md', /* @ts-ignore */
2569
+ ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
2570
+ chevronSize = computed(() => this.size() === 'sm' ? 14 : 16, /* @ts-ignore */
2571
+ ...(ngDevMode ? [{ debugName: "chevronSize" }] : /* istanbul ignore next */ []));
2572
+ shellClass = computed(() => this.size() === 'sm'
2573
+ ? 'rounded-lg border border-border dark:border-white/10'
2574
+ : 'rounded-xl border border-border dark:border-white/10', /* @ts-ignore */
2575
+ ...(ngDevMode ? [{ debugName: "shellClass" }] : /* istanbul ignore next */ []));
2576
+ triggerClass = computed(() => this.size() === 'sm'
2577
+ ? 'flex w-full items-center justify-between gap-3 px-3 py-2 text-left text-ink dark:text-white'
2578
+ : 'flex w-full items-center justify-between gap-3 px-4 py-3 text-left text-ink dark:text-white', /* @ts-ignore */
2579
+ ...(ngDevMode ? [{ debugName: "triggerClass" }] : /* istanbul ignore next */ []));
2580
+ bodyClass = computed(() => this.size() === 'sm'
2581
+ ? 'border-t border-border px-3 py-2 dark:border-white/10'
2582
+ : 'border-t border-border px-4 py-3 dark:border-white/10', /* @ts-ignore */
2583
+ ...(ngDevMode ? [{ debugName: "bodyClass" }] : /* istanbul ignore next */ []));
2584
+ toggle() {
2585
+ this.open.update((value) => !value);
2586
+ }
2587
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AccordionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2588
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: AccordionComponent, isStandalone: true, selector: "africanies-accordion", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "openChange" }, host: { classAttribute: "block" }, ngImport: i0, template: `
2589
+ <div [class]="shellClass()">
2590
+ <button
2591
+ type="button"
2592
+ [class]="triggerClass()"
2593
+ [attr.aria-expanded]="open()"
2594
+ (click)="toggle()"
2595
+ >
2596
+ <span class="min-w-0 flex-1 font-medium">
2597
+ <ng-content select="[africaniesAccordionTitle]" />
2598
+ @if (title()) {
2599
+ {{ title() }}
2600
+ }
2601
+ </span>
2602
+ <africanies-icon
2603
+ name="chevron-down"
2604
+ class="shrink-0 transition-transform duration-200"
2605
+ [class.rotate-180]="open()"
2606
+ [size]="chevronSize()"
2607
+ />
2608
+ </button>
2609
+ <div
2610
+ class="africanies-accordion-fold"
2611
+ [class.africanies-accordion-fold-open]="open()"
2612
+ >
2613
+ <div class="africanies-accordion-fold-body">
2614
+ <div [class]="bodyClass()">
2615
+ <ng-content />
2616
+ </div>
2617
+ </div>
2618
+ </div>
2619
+ </div>
2620
+ `, isInline: true, styles: [".africanies-accordion-fold{display:grid;grid-template-rows:0fr;transition:grid-template-rows .2s ease}.africanies-accordion-fold-open{grid-template-rows:1fr}.africanies-accordion-fold-body{min-height:0;overflow:hidden}@media(prefers-reduced-motion:reduce){.africanies-accordion-fold{transition:none}}\n"], dependencies: [{ kind: "component", type: AfricaniesIconComponent, selector: "africanies-icon", inputs: ["name", "size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2621
+ }
2622
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AccordionComponent, decorators: [{
2623
+ type: Component,
2624
+ args: [{ selector: 'africanies-accordion', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [AfricaniesIconComponent], host: {
2625
+ class: 'block',
2626
+ }, template: `
2627
+ <div [class]="shellClass()">
2628
+ <button
2629
+ type="button"
2630
+ [class]="triggerClass()"
2631
+ [attr.aria-expanded]="open()"
2632
+ (click)="toggle()"
2633
+ >
2634
+ <span class="min-w-0 flex-1 font-medium">
2635
+ <ng-content select="[africaniesAccordionTitle]" />
2636
+ @if (title()) {
2637
+ {{ title() }}
2638
+ }
2639
+ </span>
2640
+ <africanies-icon
2641
+ name="chevron-down"
2642
+ class="shrink-0 transition-transform duration-200"
2643
+ [class.rotate-180]="open()"
2644
+ [size]="chevronSize()"
2645
+ />
2646
+ </button>
2647
+ <div
2648
+ class="africanies-accordion-fold"
2649
+ [class.africanies-accordion-fold-open]="open()"
2650
+ >
2651
+ <div class="africanies-accordion-fold-body">
2652
+ <div [class]="bodyClass()">
2653
+ <ng-content />
2654
+ </div>
2655
+ </div>
2656
+ </div>
2657
+ </div>
2658
+ `, styles: [".africanies-accordion-fold{display:grid;grid-template-rows:0fr;transition:grid-template-rows .2s ease}.africanies-accordion-fold-open{grid-template-rows:1fr}.africanies-accordion-fold-body{min-height:0;overflow:hidden}@media(prefers-reduced-motion:reduce){.africanies-accordion-fold{transition:none}}\n"] }]
2659
+ }], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }, { type: i0.Output, args: ["openChange"] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] } });
2660
+
2661
+ /**
2662
+ * Expandable bordered panels (`africanies-accordion`).
2663
+ */
2664
+
2387
2665
  const DEFAULT_ICONS = {
2388
2666
  info: 'info-circle',
2389
2667
  success: 'check-circle',
@@ -12925,84 +13203,6 @@ function finalizeLeaf(crumbs, path) {
12925
13203
  return crumbs;
12926
13204
  }
12927
13205
 
12928
- /**
12929
- * Builds a {@link UrlTree} for an item’s `routerLink` / query / fragment.
12930
- *
12931
- * @param router - Consumer app router.
12932
- * @param item - Nav item with a `routerLink`.
12933
- * @returns UrlTree, or `null` when the item is not routed.
12934
- */
12935
- function navItemUrlTree(router, item) {
12936
- if (item.routerLink == null) {
12937
- return null;
12938
- }
12939
- const commands = Array.isArray(item.routerLink)
12940
- ? [...item.routerLink]
12941
- : [item.routerLink];
12942
- return router.createUrlTree(commands, {
12943
- queryParams: item.queryParams,
12944
- fragment: item.fragment,
12945
- });
12946
- }
12947
- /**
12948
- * Whether the current router URL matches this item (cold load + navigations).
12949
- *
12950
- * @param router - Consumer app router.
12951
- * @param item - Nav item with a `routerLink`.
12952
- * @param options - Same shape as `RouterLinkActive` options.
12953
- * @returns True when the current URL matches the item.
12954
- */
12955
- function isNavItemActive(router, item, options) {
12956
- const tree = navItemUrlTree(router, item);
12957
- if (!tree) {
12958
- return false;
12959
- }
12960
- return router.isActive(tree, options);
12961
- }
12962
-
12963
- /**
12964
- * Whether a click should leave navigation to the browser (new tab, etc.).
12965
- * @param event - Mouse click from a routed nav control.
12966
- * @returns True when the host should not call `preventDefault` / navigate.
12967
- */
12968
- function isModifiedClick(event) {
12969
- return (event.button !== 0 ||
12970
- event.metaKey ||
12971
- event.ctrlKey ||
12972
- event.shiftKey ||
12973
- event.altKey);
12974
- }
12975
- /**
12976
- * Serialized href for a routed nav item (for `<a href>` without RouterLink).
12977
- * @param router - App router.
12978
- * @param item - Nav item with `routerLink`.
12979
- * @returns Path string, or `null` when the item is not routed.
12980
- */
12981
- function navItemHref(router, item) {
12982
- const tree = navItemUrlTree(router, item);
12983
- return tree ? router.serializeUrl(tree) : null;
12984
- }
12985
- /**
12986
- * Navigate to a nav item without jumping the viewport to the top.
12987
- *
12988
- * Apps that enable `withInMemoryScrolling({ scrollPositionRestoration:
12989
- * 'enabled' })` scroll to `[0, 0]` on every forward navigation. That is wrong
12990
- * for in-page tabs/segments. Passing `{ scroll: 'manual' }` tells Angular's
12991
- * RouterScroller to skip scrolling for this navigation.
12992
- *
12993
- * @param router - App router.
12994
- * @param item - Nav item with `routerLink`.
12995
- * @param keepScroll - When true (default for tabs/segments), skip router scroll.
12996
- * @returns Navigation promise, or `null` when the item is not routed.
12997
- */
12998
- function navigateNavItem(router, item, keepScroll = true) {
12999
- const tree = navItemUrlTree(router, item);
13000
- if (!tree) {
13001
- return null;
13002
- }
13003
- return router.navigateByUrl(tree, keepScroll ? { scroll: 'manual' } : undefined);
13004
- }
13005
-
13006
13206
  const DEFAULT_LINK_ACTIVE$2 = {
13007
13207
  paths: 'exact',
13008
13208
  queryParams: 'exact',
@@ -18763,6 +18963,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
18763
18963
  }] });
18764
18964
 
18765
18965
  const FEEDBACK = [
18966
+ AccordionComponent,
18766
18967
  LoadingStateComponent,
18767
18968
  ErrorStateComponent,
18768
18969
  ErrorIndicatorComponent,
@@ -18772,7 +18973,7 @@ const FEEDBACK = [
18772
18973
  ChipComponent,
18773
18974
  ];
18774
18975
  /**
18775
- * Async feedback states, inline alert, and status chips.
18976
+ * Async feedback states, accordion panels, inline alert, and status chips.
18776
18977
  *
18777
18978
  * Toast stays out of this module — register {@link provideAfricaniesToasts} instead.
18778
18979
  *
@@ -18786,13 +18987,15 @@ const FEEDBACK = [
18786
18987
  */
18787
18988
  class AfricaniesFeedbackModule {
18788
18989
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AfricaniesFeedbackModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
18789
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.0.8", ngImport: i0, type: AfricaniesFeedbackModule, imports: [LoadingStateComponent,
18990
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.0.8", ngImport: i0, type: AfricaniesFeedbackModule, imports: [AccordionComponent,
18991
+ LoadingStateComponent,
18790
18992
  ErrorStateComponent,
18791
18993
  ErrorIndicatorComponent,
18792
18994
  EmptyStateComponent,
18793
18995
  AsyncStateComponent,
18794
18996
  AlertComponent,
18795
- ChipComponent], exports: [LoadingStateComponent,
18997
+ ChipComponent], exports: [AccordionComponent,
18998
+ LoadingStateComponent,
18796
18999
  ErrorStateComponent,
18797
19000
  ErrorIndicatorComponent,
18798
19001
  EmptyStateComponent,
@@ -19084,5 +19287,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
19084
19287
  * Generated bundle index. Do not edit.
19085
19288
  */
19086
19289
 
19087
- export { AFRICANIES_BRAND_LOGO_MINI_URL, AFRICANIES_BRAND_LOGO_URL, ActionMenuComponent, ActionMenuTriggerDirective, AddressInputComponent, AfricaniesActionsModule, AfricaniesFeedbackModule, AfricaniesFormsModule, AfricaniesInfoPopoverModule, AfricaniesNavigationModule, AfricaniesOverlayRef, AfricaniesStepperModule, AfricaniesTableModule, AfricaniesTooltipModule, AlertComponent, AppShellComponent, AppShellContentHeaderComponent, AppShellHeaderComponent, AppShellHeaderEndDirective, AppShellHeaderSlotDirective, AppShellHeaderStartDirective, AsyncStateComponent, AvatarComponent, AvatarMenuComponent, BrandLogoComponent, BreadcrumbComponent, ButtonComponent, CarrierLogoComponent, CellDefDirective, CheckboxComponent, ChipComponent, ConfirmDialogComponent, ConfirmService, ContentStackComponent, CopyButtonComponent, DatePickerComponent, DrawerService, EmptyStateComponent, ErrorIndicatorComponent, ErrorStateComponent, FileUploadComponent, FilterDrawerPanel, FilterDrawerService, FilterQueryService, GOOGLE_PLACES_CONFIG, GooglePlacesService, HeaderCellDefDirective, ImageComponent, InfoPopoverComponent, InfoPopoverContentDirective, InfoPopoverTriggerDirective, LoadingStateComponent, MODAL_SIZE_PANEL_CLASS, ModalService, NotificationDrawerPanel, NotificationDrawerService, NumberInputComponent, OVERLAY_DATA, OtpInputComponent, OverlayFooterDirective, OverlayFrameComponent, OverlayHeaderDirective, PageHeaderComponent, PaginationComponent, RadioComponent, RowDetailDefDirective, SearchComboboxComponent, SegmentComponent, SelectComponent, ShippingModeSwitchComponent, SideNavComponent, StepDefDirective, StepperComponent, TOAST_DURATION_MS, TOAST_ICONS, TabDefDirective, TableComponent, TabsComponent, TextInputComponent, TextareaComponent, ToastService, ToggleComponent, TooltipComponent, TooltipTriggerDirective, acceptLabels, buildBreadcrumbsFromSideNav, deliveryVendorOptionsForStoredValue, deliveryVendorSelectOptions, deliveryVendorSelected, fileExtensionLabel, fileMatchesAccept, headerGreetingFirstName, headerGreetingPeriod, isCatalogRootRoute, isNavItemActive, isNestedChildRoute, navItemUrlTree, normalizeCarrierLogoSlug, normalizeNavPath, pickHeaderGreeting, provideAfricaniesToasts, provideAfricaniesUiOverlays, provideGooglePlaces, resolveCatalogRootLink, resolveContentBackTarget, resolveHeaderBackTarget, resolveParentPathFromRootSnapshot, toastFingerprint };
19290
+ export { AFRICANIES_BRAND_LOGO_MINI_URL, AFRICANIES_BRAND_LOGO_URL, AccordionComponent, ActionMenuComponent, ActionMenuTriggerDirective, AddressInputComponent, AfricaniesActionsModule, AfricaniesFeedbackModule, AfricaniesFormsModule, AfricaniesInfoPopoverModule, AfricaniesNavigationModule, AfricaniesOverlayRef, AfricaniesStepperModule, AfricaniesTableModule, AfricaniesTooltipModule, AlertComponent, AppShellComponent, AppShellContentHeaderComponent, AppShellHeaderComponent, AppShellHeaderEndDirective, AppShellHeaderSlotDirective, AppShellHeaderStartDirective, AsyncStateComponent, AvatarComponent, AvatarMenuComponent, BrandLogoComponent, BreadcrumbComponent, ButtonComponent, CarrierLogoComponent, CellDefDirective, CheckboxComponent, ChipComponent, ConfirmDialogComponent, ConfirmService, ContentStackComponent, CopyButtonComponent, DatePickerComponent, DrawerService, EmptyStateComponent, ErrorIndicatorComponent, ErrorStateComponent, FileUploadComponent, FilterDrawerPanel, FilterDrawerService, FilterQueryService, GOOGLE_PLACES_CONFIG, GooglePlacesService, HeaderCellDefDirective, ImageComponent, InfoPopoverComponent, InfoPopoverContentDirective, InfoPopoverTriggerDirective, LoadingStateComponent, MODAL_SIZE_PANEL_CLASS, ModalService, NotificationDrawerPanel, NotificationDrawerService, NumberInputComponent, OVERLAY_DATA, OtpInputComponent, OverlayFooterDirective, OverlayFrameComponent, OverlayHeaderDirective, PageHeaderComponent, PaginationComponent, RadioComponent, RowDetailDefDirective, SearchComboboxComponent, SegmentComponent, SelectComponent, ShippingModeSwitchComponent, SideNavComponent, StepDefDirective, StepperComponent, TOAST_DURATION_MS, TOAST_ICONS, TabDefDirective, TableComponent, TabsComponent, TextInputComponent, TextareaComponent, ToastService, ToggleComponent, TooltipComponent, TooltipTriggerDirective, acceptLabels, buildBreadcrumbsFromSideNav, deliveryVendorOptionsForStoredValue, deliveryVendorSelectOptions, deliveryVendorSelected, fileExtensionLabel, fileMatchesAccept, headerGreetingFirstName, headerGreetingPeriod, isCatalogRootRoute, isNavItemActive, isNestedChildRoute, navItemUrlTree, normalizeCarrierLogoSlug, normalizeNavPath, pickHeaderGreeting, provideAfricaniesToasts, provideAfricaniesUiOverlays, provideGooglePlaces, resolveCatalogRootLink, resolveContentBackTarget, resolveHeaderBackTarget, resolveParentPathFromRootSnapshot, toastFingerprint };
19088
19291
  //# sourceMappingURL=africanies-africanies-ui.mjs.map