@africanies/angular-web-sdk 0.1.10 → 0.1.11

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 (30) hide show
  1. package/.nx/cache/14892813664845064572/dist/libs/africanies-ui/README.md +68 -0
  2. package/.nx/cache/14892813664845064572/dist/libs/africanies-ui/assets/brand/africanies-logo-mini.png +0 -0
  3. package/.nx/cache/14892813664845064572/dist/libs/africanies-ui/assets/brand/africanies-logo.png +0 -0
  4. package/.nx/cache/14892813664845064572/dist/libs/africanies-ui/assets/brand/africanies-logo.svg +5 -0
  5. package/.nx/cache/14892813664845064572/dist/libs/africanies-ui/assets/carriers/dhl.svg +7 -0
  6. package/.nx/cache/14892813664845064572/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs +20013 -0
  7. package/.nx/cache/14892813664845064572/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs.map +1 -0
  8. package/.nx/cache/14892813664845064572/dist/libs/africanies-ui/package.json +35 -0
  9. package/.nx/cache/14892813664845064572/dist/libs/africanies-ui/types/africanies-africanies-ui.d.ts +5617 -0
  10. package/.nx/cache/run.json +16 -16
  11. package/.nx/cache/terminalOutputs/14892813664845064572 +21 -0
  12. package/.nx/cache/terminalOutputs/17909810599991457481 +40 -0
  13. package/.nx/cache/terminalOutputs/2927637324428060203 +42 -0
  14. package/.nx/cache/terminalOutputs/4787481949164239892 +8 -0
  15. package/.nx/workspace-data/0091ABA9-5C90-580D-953C-8C94E763ADB5-v3.db +0 -0
  16. package/.nx/workspace-data/0091ABA9-5C90-580D-953C-8C94E763ADB5-v3.db-shm +0 -0
  17. package/.nx/workspace-data/0091ABA9-5C90-580D-953C-8C94E763ADB5-v3.db-wal +0 -0
  18. package/.nx/workspace-data/d/daemon.log +2377 -0
  19. package/.nx/workspace-data/d/server-process.json +2 -2
  20. package/.nx/workspace-data/file-map.json +3465 -3469
  21. package/.nx/workspace-data/nx_files.nxt +0 -0
  22. package/.nx/workspace-data/project-graph.json +2 -2
  23. package/README.md +0 -17
  24. package/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs +149 -134
  25. package/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs.map +1 -1
  26. package/dist/libs/africanies-ui/types/africanies-africanies-ui.d.ts +14 -13
  27. package/libs/africanies-ui/src/lib/navigation/shipping-mode-switch/shipping-mode-switch.component.spec.ts +15 -0
  28. package/libs/africanies-ui/src/lib/navigation/shipping-mode-switch/shipping-mode-switch.component.ts +6 -3
  29. package/libs/africanies-ui/src/lib/table/table.component.ts +70 -65
  30. package/package.json +1 -1
@@ -59,4 +59,19 @@ describe('ShippingModeSwitchComponent', () => {
59
59
  expect(shipping.mode()).toBe('stn');
60
60
  expect(toNigeria.getAttribute('aria-checked')).toBe('true');
61
61
  });
62
+
63
+ it('should show the STN/SFN chip only when the mode panel is collapsed', () => {
64
+ fixture.componentRef.setInput('panelOpen', true);
65
+ fixture.detectChanges();
66
+ expect(fixture.nativeElement.textContent).not.toContain('SFN');
67
+
68
+ fixture.componentRef.setInput('panelOpen', false);
69
+ fixture.detectChanges();
70
+ expect(fixture.nativeElement.textContent).toContain('SFN');
71
+
72
+ shipping.setMode('stn');
73
+ fixture.detectChanges();
74
+ expect(fixture.nativeElement.textContent).toContain('STN');
75
+ expect(fixture.nativeElement.textContent).not.toContain('SFN');
76
+ });
62
77
  });
@@ -128,9 +128,12 @@ const SHIPPING_MODE_GLYPH = `M88.42,68.75a48.8,48.8,0,0,1-4.74,11.1h9.89a7.67,7.
128
128
  >
129
129
  Shipping mode
130
130
  </p>
131
- <africanies-chip [variant]="modeChipVariant()" size="sm">
132
- {{ modeChipLabel() }}
133
- </africanies-chip>
131
+ <!-- STN / SFN chip only when the tiles are collapsed — open panel already shows both modes. -->
132
+ @if (!panelOpen()) {
133
+ <africanies-chip [variant]="modeChipVariant()" size="sm">
134
+ {{ modeChipLabel() }}
135
+ </africanies-chip>
136
+ }
134
137
  <span class="min-w-0 flex-1" aria-hidden="true"></span>
135
138
  <button
136
139
  type="button"
@@ -45,8 +45,9 @@ import { TableColumn, TableSortChange } from './table-column';
45
45
  * `<ng-template africaniesCellDef="key">` templates. Columns without a matching
46
46
  * template fall back to rendering `row[key]` as plain text.
47
47
  *
48
- * Optional toolbar: top-left **shipping mode** segment (on by default;
49
- * `[showShippingMode]="false"` to hide) and **Refresh** (`showRefresh` →
48
+ * Optional toolbar: top-left **shipping mode** segment on its own row above
49
+ * Refresh / Filter / Export (on by default; `[showShippingMode]="false"` to
50
+ * hide) and **Refresh** (`showRefresh` →
50
51
  * {@link refreshClick}). Refresh is hidden while
51
52
  * the body shows empty or error — those states expose Retry instead.
52
53
  * While {@link refreshing} is true the rows stay on screen — the refresh icon
@@ -177,71 +178,75 @@ import { TableColumn, TableSortChange } from './table-column';
177
178
  showFilter() ||
178
179
  showExport()
179
180
  ) {
180
- <div class="flex flex-wrap items-center justify-between gap-2">
181
- <div class="flex min-w-0 flex-wrap items-center gap-2">
182
- @if (showShippingMode()) {
183
- <africanies-segment
184
- class="min-w-0"
185
- [items]="shippingModeItems"
186
- [activeId]="shippingModeActiveId()"
187
- ariaLabel="Shipping mode"
188
- (activeIdChange)="onShippingModeChange($event)"
189
- />
190
- }
191
- @if (showToolbarRefresh()) {
192
- <button
193
- africanies-button
194
- type="button"
195
- variant="flat"
196
- size="sm"
197
- [disabled]="loading() || refreshing()"
198
- [attr.aria-label]="refreshLabel()"
199
- (click)="refreshClick.emit()"
200
- >
201
- <africanies-icon
202
- name="refresh"
203
- [size]="16"
204
- [class]="refreshing() ? 'animate-spin' : ''"
205
- />
206
- {{ refreshLabel() }}
207
- </button>
208
- }
209
- </div>
210
- <div class="flex items-center gap-2">
211
- @if (showFilter()) {
212
- <button
213
- africanies-button
214
- type="button"
215
- variant="flat"
216
- size="sm"
217
- [attr.aria-label]="filterLabel()"
218
- (click)="filterClick.emit()"
219
- >
220
- <africanies-icon name="filter" [size]="16" />
221
- {{ filterLabel() }}
222
- @if (filterCount() > 0) {
223
- <span
224
- class="inline-flex min-w-5 items-center justify-center rounded-full bg-ink px-1.5 py-0.5 text-caption font-semibold tabular-nums text-white dark:bg-white dark:text-ink"
181
+ <div class="flex w-full min-w-0 flex-col gap-3">
182
+ @if (showShippingMode()) {
183
+ <africanies-segment
184
+ class="min-w-0 self-start"
185
+ [items]="shippingModeItems"
186
+ [activeId]="shippingModeActiveId()"
187
+ ariaLabel="Shipping mode"
188
+ (activeIdChange)="onShippingModeChange($event)"
189
+ />
190
+ }
191
+ @if (showToolbarRefresh() || showFilter() || showExport()) {
192
+ <div class="flex flex-wrap items-center justify-between gap-2">
193
+ <div class="flex min-w-0 flex-wrap items-center gap-2">
194
+ @if (showToolbarRefresh()) {
195
+ <button
196
+ africanies-button
197
+ type="button"
198
+ variant="flat"
199
+ size="sm"
200
+ [disabled]="loading() || refreshing()"
201
+ [attr.aria-label]="refreshLabel()"
202
+ (click)="refreshClick.emit()"
225
203
  >
226
- {{ filterCount() }}
227
- </span>
204
+ <africanies-icon
205
+ name="refresh"
206
+ [size]="16"
207
+ [class]="refreshing() ? 'animate-spin' : ''"
208
+ />
209
+ {{ refreshLabel() }}
210
+ </button>
228
211
  }
229
- </button>
230
- }
231
- @if (showExport()) {
232
- <button
233
- africanies-button
234
- type="button"
235
- variant="flat"
236
- size="sm"
237
- [attr.aria-label]="exportLabel()"
238
- (click)="exportClick.emit()"
239
- >
240
- <africanies-icon name="download" [size]="16" />
241
- {{ exportLabel() }}
242
- </button>
243
- }
244
- </div>
212
+ </div>
213
+ <div class="flex items-center gap-2">
214
+ @if (showFilter()) {
215
+ <button
216
+ africanies-button
217
+ type="button"
218
+ variant="flat"
219
+ size="sm"
220
+ [attr.aria-label]="filterLabel()"
221
+ (click)="filterClick.emit()"
222
+ >
223
+ <africanies-icon name="filter" [size]="16" />
224
+ {{ filterLabel() }}
225
+ @if (filterCount() > 0) {
226
+ <span
227
+ class="inline-flex min-w-5 items-center justify-center rounded-full bg-ink px-1.5 py-0.5 text-caption font-semibold tabular-nums text-white dark:bg-white dark:text-ink"
228
+ >
229
+ {{ filterCount() }}
230
+ </span>
231
+ }
232
+ </button>
233
+ }
234
+ @if (showExport()) {
235
+ <button
236
+ africanies-button
237
+ type="button"
238
+ variant="flat"
239
+ size="sm"
240
+ [attr.aria-label]="exportLabel()"
241
+ (click)="exportClick.emit()"
242
+ >
243
+ <africanies-icon name="download" [size]="16" />
244
+ {{ exportLabel() }}
245
+ </button>
246
+ }
247
+ </div>
248
+ </div>
249
+ }
245
250
  </div>
246
251
  }
247
252
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@africanies/angular-web-sdk",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "packageManager": "pnpm@11.24.0",
5
5
  "license": "MIT",
6
6
  "contributors": [