@africanies/angular-web-sdk 0.1.8 → 0.1.10
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.
- package/.angular/cache/22.0.9/playground/.tsbuildinfo +1 -1
- package/.nx/cache/1149535958171016935/dist/libs/africanies-theme/README.md +46 -0
- package/.nx/cache/1149535958171016935/dist/libs/africanies-theme/fesm2022/africanies-africanies-theme.mjs +243 -0
- package/.nx/cache/1149535958171016935/dist/libs/africanies-theme/fesm2022/africanies-africanies-theme.mjs.map +1 -0
- package/.nx/cache/1149535958171016935/dist/libs/africanies-theme/package.json +35 -0
- package/.nx/cache/1149535958171016935/dist/libs/africanies-theme/tailwind-preset.cjs +330 -0
- package/.nx/cache/1149535958171016935/dist/libs/africanies-theme/types/africanies-africanies-theme.d.ts +178 -0
- package/.nx/cache/17289624717336768573/dist/libs/africanies-core/README.md +85 -0
- package/.nx/cache/17289624717336768573/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs +4639 -0
- package/.nx/cache/17289624717336768573/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs.map +1 -0
- package/.nx/cache/17289624717336768573/dist/libs/africanies-core/package.json +31 -0
- package/.nx/cache/17289624717336768573/dist/libs/africanies-core/types/africanies-africanies-core.d.ts +2748 -0
- package/.nx/cache/3735952477975556635/dist/libs/africanies-ui/README.md +68 -0
- package/.nx/cache/3735952477975556635/dist/libs/africanies-ui/assets/brand/africanies-logo-mini.png +0 -0
- package/.nx/cache/3735952477975556635/dist/libs/africanies-ui/assets/brand/africanies-logo.png +0 -0
- package/.nx/cache/3735952477975556635/dist/libs/africanies-ui/assets/brand/africanies-logo.svg +5 -0
- package/.nx/cache/3735952477975556635/dist/libs/africanies-ui/assets/carriers/dhl.svg +7 -0
- package/.nx/cache/3735952477975556635/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs +19998 -0
- package/.nx/cache/3735952477975556635/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs.map +1 -0
- package/.nx/cache/3735952477975556635/dist/libs/africanies-ui/package.json +35 -0
- package/.nx/cache/3735952477975556635/dist/libs/africanies-ui/types/africanies-africanies-ui.d.ts +5616 -0
- package/.nx/cache/3953970051755345887/dist/libs/africanies-ui/README.md +68 -0
- package/.nx/cache/3953970051755345887/dist/libs/africanies-ui/assets/brand/africanies-logo-mini.png +0 -0
- package/.nx/cache/3953970051755345887/dist/libs/africanies-ui/assets/brand/africanies-logo.png +0 -0
- package/.nx/cache/3953970051755345887/dist/libs/africanies-ui/assets/brand/africanies-logo.svg +5 -0
- package/.nx/cache/3953970051755345887/dist/libs/africanies-ui/assets/carriers/dhl.svg +7 -0
- package/.nx/cache/3953970051755345887/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs +19500 -0
- package/.nx/cache/3953970051755345887/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs.map +1 -0
- package/.nx/cache/3953970051755345887/dist/libs/africanies-ui/package.json +35 -0
- package/.nx/cache/3953970051755345887/dist/libs/africanies-ui/types/africanies-africanies-ui.d.ts +5521 -0
- package/.nx/cache/4225324930345532464/dist/libs/africanies-theme/README.md +46 -0
- package/.nx/cache/4225324930345532464/dist/libs/africanies-theme/fesm2022/africanies-africanies-theme.mjs +243 -0
- package/.nx/cache/4225324930345532464/dist/libs/africanies-theme/fesm2022/africanies-africanies-theme.mjs.map +1 -0
- package/.nx/cache/4225324930345532464/dist/libs/africanies-theme/package.json +35 -0
- package/.nx/cache/4225324930345532464/dist/libs/africanies-theme/tailwind-preset.cjs +330 -0
- package/.nx/cache/4225324930345532464/dist/libs/africanies-theme/types/africanies-africanies-theme.d.ts +176 -0
- package/.nx/cache/run.json +26 -26
- package/.nx/cache/terminalOutputs/1149535958171016935 +21 -0
- package/.nx/cache/terminalOutputs/12565224028063674529 +37 -0
- package/.nx/cache/terminalOutputs/13478445034325959094 +176 -0
- package/.nx/cache/terminalOutputs/15835338512221847842 +184 -182
- package/.nx/cache/terminalOutputs/17289624717336768573 +21 -0
- package/.nx/cache/terminalOutputs/17571479482482478257 +35 -0
- package/.nx/cache/terminalOutputs/3088264223473143358 +8 -0
- package/.nx/cache/terminalOutputs/3735952477975556635 +21 -0
- package/.nx/cache/terminalOutputs/3953970051755345887 +21 -0
- package/.nx/cache/terminalOutputs/4225324930345532464 +21 -0
- package/.nx/cache/terminalOutputs/4363587767476846758 +176 -0
- package/.nx/cache/terminalOutputs/8193462679279018087 +39 -0
- package/.nx/workspace-data/0091ABA9-5C90-580D-953C-8C94E763ADB5-v3.db +0 -0
- package/.nx/workspace-data/0091ABA9-5C90-580D-953C-8C94E763ADB5-v3.db-shm +0 -0
- package/.nx/workspace-data/0091ABA9-5C90-580D-953C-8C94E763ADB5-v3.db-wal +0 -0
- package/.nx/workspace-data/d/daemon.log +5890 -0
- package/.nx/workspace-data/d/server-process.json +2 -2
- package/.nx/workspace-data/file-map.json +3610 -3620
- package/.nx/workspace-data/nx_files.nxt +0 -0
- package/.nx/workspace-data/project-graph.json +2 -2
- package/apps/playground/src/app/pages/chip-page.ts +11 -1
- package/apps/playground/src/app/pages/tokens-page.ts +2 -2
- package/apps/playground/src/app/snippets/chip.snippets.ts +5 -0
- package/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs +6 -1
- package/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs.map +1 -1
- package/dist/libs/africanies-core/types/africanies-africanies-core.d.ts +6 -1
- package/dist/libs/africanies-theme/fesm2022/africanies-africanies-theme.mjs +8 -8
- package/dist/libs/africanies-theme/fesm2022/africanies-africanies-theme.mjs.map +1 -1
- package/dist/libs/africanies-theme/tailwind-preset.cjs +3 -3
- package/dist/libs/africanies-theme/types/africanies-africanies-theme.d.ts +5 -3
- package/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs +848 -375
- package/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs.map +1 -1
- package/dist/libs/africanies-ui/types/africanies-africanies-ui.d.ts +123 -30
- package/libs/africanies-core/src/index.ts +1 -1
- package/libs/africanies-core/src/lib/notification/notification-link.ts +6 -1
- package/libs/africanies-theme/src/lib/mode-color.safelist.ts +2 -2
- package/libs/africanies-theme/src/lib/mode-color.service.spec.ts +9 -7
- package/libs/africanies-theme/src/lib/mode-color.service.ts +9 -7
- package/libs/africanies-theme/tailwind-preset.cjs +3 -3
- package/libs/africanies-ui/src/lib/avatar/avatar-menu.component.ts +25 -21
- package/libs/africanies-ui/src/lib/button/button.component.spec.ts +13 -8
- package/libs/africanies-ui/src/lib/chip/chip.component.ts +74 -6
- package/libs/africanies-ui/src/lib/layout/app-shell-header.component.ts +39 -16
- package/libs/africanies-ui/src/lib/layout/header-greeting.util.ts +1 -1
- package/libs/africanies-ui/src/lib/layout/header-weather.spec.ts +87 -5
- package/libs/africanies-ui/src/lib/layout/header-weather.ts +35 -15
- package/libs/africanies-ui/src/lib/navigation/segment/segment.component.ts +98 -22
- package/libs/africanies-ui/src/lib/navigation/shipping-mode-switch/shipping-mode-switch.component.ts +193 -65
- package/libs/africanies-ui/src/lib/navigation/side-nav/africanies-side-nav.component.html +4 -2
- package/libs/africanies-ui/src/lib/navigation/side-nav/africanies-side-nav.component.ts +3 -1
- package/libs/africanies-ui/src/lib/table/table.component.spec.ts +3 -0
- package/libs/africanies-ui/src/lib/table/table.component.ts +197 -57
- package/package.json +1 -1
- package/tools/build-icon-sprite.mjs +1 -1
package/libs/africanies-ui/src/lib/navigation/shipping-mode-switch/shipping-mode-switch.component.ts
CHANGED
|
@@ -3,13 +3,46 @@ import {
|
|
|
3
3
|
ChangeDetectionStrategy,
|
|
4
4
|
Component,
|
|
5
5
|
computed,
|
|
6
|
+
effect,
|
|
6
7
|
inject,
|
|
7
8
|
input,
|
|
9
|
+
model,
|
|
8
10
|
} from '@angular/core';
|
|
9
11
|
|
|
10
12
|
import { ShippingModeService } from '@africanies/africanies-core';
|
|
13
|
+
import { AfricaniesIconComponent } from '@africanies/africanies-icons';
|
|
11
14
|
import type { ShippingMode } from '@africanies/africanies-models';
|
|
12
15
|
|
|
16
|
+
import { ChipComponent, type ChipVariant } from '../../chip/chip.component';
|
|
17
|
+
|
|
18
|
+
const PANEL_OPEN_STORAGE_KEY = 'africanies-shipping-mode-panel-open';
|
|
19
|
+
|
|
20
|
+
function readStoredPanelOpen(): boolean {
|
|
21
|
+
if (typeof localStorage === 'undefined') {
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
try {
|
|
25
|
+
const raw = localStorage.getItem(PANEL_OPEN_STORAGE_KEY);
|
|
26
|
+
if (raw === null) {
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
return raw !== '0' && raw !== 'false';
|
|
30
|
+
} catch {
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function writeStoredPanelOpen(open: boolean): void {
|
|
36
|
+
if (typeof localStorage === 'undefined') {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
try {
|
|
40
|
+
localStorage.setItem(PANEL_OPEN_STORAGE_KEY, open ? '1' : '0');
|
|
41
|
+
} catch {
|
|
42
|
+
// Private mode / quota — panel still toggles in-session.
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
13
46
|
/**
|
|
14
47
|
* Shared globe + plane glyph for STN / SFN. STN paints it rotated 180°.
|
|
15
48
|
*
|
|
@@ -25,12 +58,13 @@ const SHIPPING_MODE_GLYPH = `M88.42,68.75a48.8,48.8,0,0,1-4.74,11.1h9.89a7.67,7.
|
|
|
25
58
|
* import orange; **from Nigeria** uses export green. Both tiles keep equal
|
|
26
59
|
* chrome so unselected does not look like floating text.
|
|
27
60
|
*
|
|
28
|
-
* Project into `<africanies-side-nav>` with the `
|
|
61
|
+
* Project into `<africanies-side-nav>` with the `pre-nav` attribute (above the
|
|
62
|
+
* nav list). `footer` still works for legacy placement under the list.
|
|
29
63
|
*
|
|
30
64
|
* @example
|
|
31
65
|
* ```html
|
|
32
66
|
* <africanies-side-nav [items]="nav" [(collapsed)]="collapsed">
|
|
33
|
-
* <africanies-shipping-mode-switch
|
|
67
|
+
* <africanies-shipping-mode-switch pre-nav [collapsed]="collapsed()" />
|
|
34
68
|
* </africanies-side-nav>
|
|
35
69
|
* ```
|
|
36
70
|
*/
|
|
@@ -38,71 +72,140 @@ const SHIPPING_MODE_GLYPH = `M88.42,68.75a48.8,48.8,0,0,1-4.74,11.1h9.89a7.67,7.
|
|
|
38
72
|
selector: 'africanies-shipping-mode-switch',
|
|
39
73
|
standalone: true,
|
|
40
74
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
75
|
+
imports: [AfricaniesIconComponent, ChipComponent],
|
|
41
76
|
host: {
|
|
42
77
|
'[class]': 'hostClass()',
|
|
43
78
|
},
|
|
44
79
|
template: `
|
|
45
|
-
@if (
|
|
46
|
-
|
|
47
|
-
|
|
80
|
+
@if (collapsed()) {
|
|
81
|
+
<!-- Narrow rail: icon tiles only — chip + chevron reads as cramped. -->
|
|
82
|
+
<div
|
|
83
|
+
class="grid grid-cols-1 gap-1.5"
|
|
84
|
+
role="radiogroup"
|
|
85
|
+
aria-label="Shipping mode"
|
|
48
86
|
>
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
aria-label="Shipping mode"
|
|
58
|
-
>
|
|
59
|
-
<button
|
|
60
|
-
type="button"
|
|
61
|
-
role="radio"
|
|
62
|
-
[attr.aria-checked]="mode() === 'stn'"
|
|
63
|
-
aria-label="Shipping to Nigeria"
|
|
64
|
-
[class]="cardClass('stn')"
|
|
65
|
-
(click)="select('stn')"
|
|
66
|
-
>
|
|
67
|
-
<svg
|
|
68
|
-
viewBox="0 0 122.88 107.54"
|
|
69
|
-
class="h-6 w-6 shrink-0 rotate-180"
|
|
70
|
-
aria-hidden="true"
|
|
71
|
-
focusable="false"
|
|
87
|
+
<button
|
|
88
|
+
type="button"
|
|
89
|
+
role="radio"
|
|
90
|
+
[attr.aria-checked]="mode() === 'stn'"
|
|
91
|
+
aria-label="Shipping to Nigeria"
|
|
92
|
+
title="Shipping to Nigeria"
|
|
93
|
+
[class]="cardClass('stn')"
|
|
94
|
+
(click)="select('stn')"
|
|
72
95
|
>
|
|
73
|
-
<
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
96
|
+
<svg
|
|
97
|
+
viewBox="0 0 122.88 107.54"
|
|
98
|
+
class="h-5 w-5 shrink-0 rotate-180"
|
|
99
|
+
aria-hidden="true"
|
|
100
|
+
focusable="false"
|
|
101
|
+
>
|
|
102
|
+
<path [attr.d]="glyphPath()" fill="currentColor" />
|
|
103
|
+
</svg>
|
|
104
|
+
</button>
|
|
105
|
+
<button
|
|
106
|
+
type="button"
|
|
107
|
+
role="radio"
|
|
108
|
+
[attr.aria-checked]="mode() === 'sfn'"
|
|
109
|
+
aria-label="Shipping from Nigeria"
|
|
110
|
+
title="Shipping from Nigeria"
|
|
111
|
+
[class]="cardClass('sfn')"
|
|
112
|
+
(click)="select('sfn')"
|
|
113
|
+
>
|
|
114
|
+
<svg
|
|
115
|
+
viewBox="0 0 122.88 107.54"
|
|
116
|
+
class="h-5 w-5 shrink-0"
|
|
117
|
+
aria-hidden="true"
|
|
118
|
+
focusable="false"
|
|
119
|
+
>
|
|
120
|
+
<path [attr.d]="glyphPath()" fill="currentColor" />
|
|
121
|
+
</svg>
|
|
122
|
+
</button>
|
|
123
|
+
</div>
|
|
124
|
+
} @else {
|
|
125
|
+
<div class="mb-2 flex items-center gap-1.5">
|
|
126
|
+
<p
|
|
127
|
+
class="m-0 shrink-0 px-1 text-caption font-semibold uppercase tracking-wide text-neutral-600 dark:text-neutral-400"
|
|
95
128
|
>
|
|
96
|
-
|
|
97
|
-
</
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
129
|
+
Shipping mode
|
|
130
|
+
</p>
|
|
131
|
+
<africanies-chip [variant]="modeChipVariant()" size="sm">
|
|
132
|
+
{{ modeChipLabel() }}
|
|
133
|
+
</africanies-chip>
|
|
134
|
+
<span class="min-w-0 flex-1" aria-hidden="true"></span>
|
|
135
|
+
<button
|
|
136
|
+
type="button"
|
|
137
|
+
class="inline-flex size-7 shrink-0 cursor-pointer items-center justify-center rounded-md text-neutral-600 transition-colors hover:bg-background-hover hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus dark:text-neutral-400 dark:hover:bg-white/10 dark:hover:text-white"
|
|
138
|
+
[attr.aria-label]="
|
|
139
|
+
panelOpen() ? 'Hide shipping modes' : 'Show shipping modes'
|
|
140
|
+
"
|
|
141
|
+
[attr.aria-expanded]="panelOpen()"
|
|
142
|
+
(click)="togglePanel()"
|
|
143
|
+
>
|
|
144
|
+
<africanies-icon
|
|
145
|
+
[name]="panelOpen() ? 'chevron-up' : 'chevron-down'"
|
|
146
|
+
[size]="14"
|
|
147
|
+
/>
|
|
148
|
+
</button>
|
|
149
|
+
</div>
|
|
150
|
+
|
|
151
|
+
<div
|
|
152
|
+
class="grid transition-[grid-template-rows] duration-200 ease-out motion-reduce:transition-none"
|
|
153
|
+
[style.grid-template-rows]="panelOpen() ? '1fr' : '0fr'"
|
|
154
|
+
[attr.aria-hidden]="!panelOpen()"
|
|
155
|
+
[class.pointer-events-none]="!panelOpen()"
|
|
156
|
+
>
|
|
157
|
+
<div class="min-h-0 overflow-hidden">
|
|
158
|
+
<div
|
|
159
|
+
class="grid grid-cols-2 gap-1.5"
|
|
160
|
+
role="radiogroup"
|
|
161
|
+
aria-label="Shipping mode"
|
|
162
|
+
>
|
|
163
|
+
<button
|
|
164
|
+
type="button"
|
|
165
|
+
role="radio"
|
|
166
|
+
[attr.aria-checked]="mode() === 'stn'"
|
|
167
|
+
aria-label="Shipping to Nigeria"
|
|
168
|
+
[class]="cardClass('stn')"
|
|
169
|
+
(click)="select('stn')"
|
|
170
|
+
>
|
|
171
|
+
<svg
|
|
172
|
+
viewBox="0 0 122.88 107.54"
|
|
173
|
+
class="h-6 w-6 shrink-0 rotate-180"
|
|
174
|
+
aria-hidden="true"
|
|
175
|
+
focusable="false"
|
|
176
|
+
>
|
|
177
|
+
<path [attr.d]="glyphPath()" fill="currentColor" />
|
|
178
|
+
</svg>
|
|
179
|
+
<span class="flex flex-col leading-tight">
|
|
180
|
+
<span>Shipping</span>
|
|
181
|
+
<span>to Nigeria</span>
|
|
182
|
+
</span>
|
|
183
|
+
</button>
|
|
184
|
+
<button
|
|
185
|
+
type="button"
|
|
186
|
+
role="radio"
|
|
187
|
+
[attr.aria-checked]="mode() === 'sfn'"
|
|
188
|
+
aria-label="Shipping from Nigeria"
|
|
189
|
+
[class]="cardClass('sfn')"
|
|
190
|
+
(click)="select('sfn')"
|
|
191
|
+
>
|
|
192
|
+
<svg
|
|
193
|
+
viewBox="0 0 122.88 107.54"
|
|
194
|
+
class="h-6 w-6 shrink-0"
|
|
195
|
+
aria-hidden="true"
|
|
196
|
+
focusable="false"
|
|
197
|
+
>
|
|
198
|
+
<path [attr.d]="glyphPath()" fill="currentColor" />
|
|
199
|
+
</svg>
|
|
200
|
+
<span class="flex flex-col leading-tight">
|
|
201
|
+
<span>Shipping</span>
|
|
202
|
+
<span>from Nigeria</span>
|
|
203
|
+
</span>
|
|
204
|
+
</button>
|
|
205
|
+
</div>
|
|
206
|
+
</div>
|
|
207
|
+
</div>
|
|
208
|
+
}
|
|
106
209
|
`,
|
|
107
210
|
})
|
|
108
211
|
export class ShippingModeSwitchComponent {
|
|
@@ -125,16 +228,41 @@ export class ShippingModeSwitchComponent {
|
|
|
125
228
|
*/
|
|
126
229
|
readonly collapsed = input(false, { transform: booleanAttribute });
|
|
127
230
|
|
|
231
|
+
/**
|
|
232
|
+
* When true, the mode tiles are visible. Persisted in `localStorage`.
|
|
233
|
+
* Two-way bindable for hosts that need to force-open (e.g. onboarding).
|
|
234
|
+
*/
|
|
235
|
+
readonly panelOpen = model(readStoredPanelOpen());
|
|
236
|
+
|
|
128
237
|
/** Active mode from {@link ShippingModeService}. */
|
|
129
238
|
protected readonly mode = this.shipping.mode;
|
|
130
239
|
|
|
131
|
-
|
|
240
|
+
protected readonly modeChipLabel = computed(() =>
|
|
241
|
+
this.mode() === 'stn' ? 'STN' : 'SFN',
|
|
242
|
+
);
|
|
243
|
+
|
|
244
|
+
protected readonly modeChipVariant = computed(
|
|
245
|
+
(): ChipVariant => (this.mode() === 'stn' ? 'import' : 'export'),
|
|
246
|
+
);
|
|
247
|
+
|
|
248
|
+
/** Host padding / divider — sits above the nav list (`border-b`). */
|
|
132
249
|
protected readonly hostClass = computed(() =>
|
|
133
250
|
this.collapsed()
|
|
134
|
-
? 'block shrink-0 border-
|
|
135
|
-
: 'block shrink-0 border-
|
|
251
|
+
? 'block shrink-0 border-b border-border px-1.5 py-2 dark:border-white/10'
|
|
252
|
+
: 'block shrink-0 border-b border-border px-2 py-2.5 dark:border-white/10',
|
|
136
253
|
);
|
|
137
254
|
|
|
255
|
+
constructor() {
|
|
256
|
+
effect(() => {
|
|
257
|
+
writeStoredPanelOpen(this.panelOpen());
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/** Show or hide the mode tiles. */
|
|
262
|
+
protected togglePanel(): void {
|
|
263
|
+
this.panelOpen.update((open) => !open);
|
|
264
|
+
}
|
|
265
|
+
|
|
138
266
|
/**
|
|
139
267
|
* Requests a mode change through {@link ShippingModeService.requestModeChange}
|
|
140
268
|
* so feature guards (e.g. Create Shipment confirm) can run first.
|
|
@@ -160,7 +288,7 @@ export class ShippingModeSwitchComponent {
|
|
|
160
288
|
const base =
|
|
161
289
|
'flex w-full cursor-pointer flex-col items-center justify-center gap-1 rounded-lg border text-center text-caption font-medium transition-colors ' +
|
|
162
290
|
'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus ' +
|
|
163
|
-
(compact ? 'min-h-
|
|
291
|
+
(compact ? 'size-9 min-h-0 px-0 py-0' : 'min-h-[4.5rem] px-1.5 py-2');
|
|
164
292
|
const idle =
|
|
165
293
|
'border-control bg-surface text-ink hover:bg-background-hover dark:border-white/15 dark:bg-ink-950 dark:text-white dark:hover:bg-white/10';
|
|
166
294
|
|
|
@@ -170,7 +298,7 @@ export class ShippingModeSwitchComponent {
|
|
|
170
298
|
: `${base} ${idle}`;
|
|
171
299
|
}
|
|
172
300
|
return selected
|
|
173
|
-
? `${base} border-export
|
|
301
|
+
? `${base} border-export bg-export text-white dark:border-export dark:bg-export`
|
|
174
302
|
: `${base} ${idle}`;
|
|
175
303
|
}
|
|
176
304
|
}
|
|
@@ -58,15 +58,17 @@
|
|
|
58
58
|
</button>
|
|
59
59
|
</div>
|
|
60
60
|
|
|
61
|
+
<ng-content select="[pre-nav]" />
|
|
62
|
+
|
|
61
63
|
<nav
|
|
62
64
|
class="africanies-overlay-scroll relative min-h-0 flex-1 overflow-y-auto overflow-x-visible px-3 py-3"
|
|
63
65
|
>
|
|
64
66
|
@if (!collapsed() && expandParents() && hasOpenBranches()) {
|
|
65
67
|
<!-- Zero-height sticky host: keeps the control pinned without reserving a row. -->
|
|
66
|
-
<div class="sticky top-0 z-
|
|
68
|
+
<div class="sticky top-0 z-20 h-0 overflow-visible">
|
|
67
69
|
<button
|
|
68
70
|
type="button"
|
|
69
|
-
class="absolute right-
|
|
71
|
+
class="absolute -right-2 -top-1 inline-flex size-7 cursor-pointer items-center justify-center rounded-md bg-surface text-neutral-600 shadow-sm ring-1 ring-border-strong transition-colors hover:bg-background-hover hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus dark:bg-ink-950 dark:text-neutral-400 dark:ring-white/15 dark:hover:bg-ink-surface dark:hover:text-white"
|
|
70
72
|
data-onboarding="nav-branches-collapse"
|
|
71
73
|
aria-label="Collapse all"
|
|
72
74
|
(click)="collapseAllBranches()"
|
|
@@ -47,7 +47,9 @@ const DEFAULT_LINK_ACTIVE: IsActiveMatchOptions = {
|
|
|
47
47
|
* **Expanded rail:** branches start open by default (`expandBranchesByDefault`).
|
|
48
48
|
* Clicking a parent only opens/closes the branch (no route change). When any
|
|
49
49
|
* branch is open, a sticky collapse-all control sits above the list (top right).
|
|
50
|
-
* The rail expand/collapse control stays pinned in the logo header.
|
|
50
|
+
* The rail expand/collapse control stays pinned in the logo header. Project
|
|
51
|
+
* chrome above the scrollable list with `pre-nav` (e.g. shipping modes) or
|
|
52
|
+
* below with `footer`.
|
|
51
53
|
* **Collapsed rail:** clicking a parent expands the rail, opens the
|
|
52
54
|
* branch, and activates the first enabled child (router or `activeId`).
|
|
53
55
|
*
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Component, signal } from '@angular/core';
|
|
2
2
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
3
3
|
|
|
4
|
+
import { of } from 'rxjs';
|
|
5
|
+
|
|
4
6
|
import { ShippingModeService } from '@africanies/africanies-core';
|
|
5
7
|
import type { ShippingMode } from '@africanies/africanies-models';
|
|
6
8
|
|
|
@@ -45,6 +47,7 @@ describe('TableComponent keep-rows loading', () => {
|
|
|
45
47
|
provide: ShippingModeService,
|
|
46
48
|
useValue: {
|
|
47
49
|
mode: mode.asReadonly(),
|
|
50
|
+
requestModeChange: () => of(true),
|
|
48
51
|
},
|
|
49
52
|
},
|
|
50
53
|
],
|