@africanies/angular-web-sdk 0.1.6 → 0.1.8
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/.nx/cache/{17491371155400585077 → 13466509747676776487}/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs +139 -51
- package/.nx/cache/13466509747676776487/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs.map +1 -0
- package/.nx/cache/{17491371155400585077 → 13466509747676776487}/dist/libs/africanies-core/types/africanies-africanies-core.d.ts +14 -11
- package/.nx/cache/{17499961385238663835 → 14995846848874973576}/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs +83 -63
- package/.nx/cache/14995846848874973576/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs.map +1 -0
- package/.nx/cache/{17499961385238663835 → 14995846848874973576}/dist/libs/africanies-ui/types/africanies-africanies-ui.d.ts +22 -19
- package/.nx/cache/{12276756491762927325 → 15302120112746851896}/dist/libs/africanies-theme/fesm2022/africanies-africanies-theme.mjs +34 -6
- package/.nx/cache/15302120112746851896/dist/libs/africanies-theme/fesm2022/africanies-africanies-theme.mjs.map +1 -0
- package/.nx/cache/{12276756491762927325 → 15302120112746851896}/dist/libs/africanies-theme/tailwind-preset.cjs +104 -19
- package/.nx/cache/{12276756491762927325 → 15302120112746851896}/dist/libs/africanies-theme/types/africanies-africanies-theme.d.ts +21 -2
- package/.nx/cache/18393832731522001121/dist/libs/africanies-core/README.md +85 -0
- package/.nx/cache/18393832731522001121/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs +4634 -0
- package/.nx/cache/18393832731522001121/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs.map +1 -0
- package/.nx/cache/18393832731522001121/dist/libs/africanies-core/package.json +31 -0
- package/.nx/cache/18393832731522001121/dist/libs/africanies-core/types/africanies-africanies-core.d.ts +2743 -0
- package/.nx/cache/5151121439688073678/dist/libs/africanies-icons/README.md +69 -0
- package/.nx/cache/5151121439688073678/dist/libs/africanies-icons/assets/icons.sprite.svg +1851 -0
- package/.nx/cache/5151121439688073678/dist/libs/africanies-icons/fesm2022/africanies-africanies-icons.mjs +833 -0
- package/.nx/cache/5151121439688073678/dist/libs/africanies-icons/fesm2022/africanies-africanies-icons.mjs.map +1 -0
- package/.nx/cache/5151121439688073678/dist/libs/africanies-icons/package.json +30 -0
- package/.nx/cache/5151121439688073678/dist/libs/africanies-icons/types/africanies-africanies-icons.d.ts +108 -0
- package/.nx/cache/{4082520855419352840 → 6673686859704879504}/dist/libs/africanies-theme/fesm2022/africanies-africanies-theme.mjs +12 -2
- package/.nx/cache/6673686859704879504/dist/libs/africanies-theme/fesm2022/africanies-africanies-theme.mjs.map +1 -0
- package/.nx/cache/{4082520855419352840 → 6673686859704879504}/dist/libs/africanies-theme/tailwind-preset.cjs +16 -7
- package/.nx/cache/{4082520855419352840 → 6673686859704879504}/dist/libs/africanies-theme/types/africanies-africanies-theme.d.ts +11 -3
- package/.nx/cache/877026836685850193/dist/libs/africanies-models/README.md +60 -0
- package/.nx/cache/877026836685850193/dist/libs/africanies-models/fesm2022/africanies-africanies-models.mjs +613 -0
- package/.nx/cache/877026836685850193/dist/libs/africanies-models/fesm2022/africanies-africanies-models.mjs.map +1 -0
- package/.nx/cache/877026836685850193/dist/libs/africanies-models/package.json +23 -0
- package/.nx/cache/877026836685850193/dist/libs/africanies-models/types/africanies-africanies-models.d.ts +1452 -0
- package/.nx/cache/{3314955264390318442 → 9406544675747598148}/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs +866 -632
- package/.nx/cache/9406544675747598148/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs.map +1 -0
- package/.nx/cache/{3314955264390318442 → 9406544675747598148}/dist/libs/africanies-ui/types/africanies-africanies-ui.d.ts +170 -130
- package/.nx/cache/run.json +42 -42
- package/.nx/cache/terminalOutputs/{17491371155400585077 → 13466509747676776487} +1 -1
- package/.nx/cache/terminalOutputs/14995846848874973576 +21 -0
- package/.nx/cache/terminalOutputs/{3017748574492080228 → 15149466893522345489} +16 -7
- package/.nx/cache/terminalOutputs/{4082520855419352840 → 15302120112746851896} +1 -1
- package/.nx/cache/terminalOutputs/{8648260256613557249 → 15835338512221847842} +18 -8
- package/.nx/cache/terminalOutputs/17960163310445607219 +6 -0
- package/.nx/cache/terminalOutputs/18393832731522001121 +21 -0
- package/.nx/cache/terminalOutputs/{3314955264390318442 → 5151121439688073678} +6 -6
- package/.nx/cache/terminalOutputs/{12276756491762927325 → 6673686859704879504} +2 -2
- package/.nx/cache/terminalOutputs/7462873189468732296 +17 -0
- package/.nx/cache/terminalOutputs/8032148447904822353 +185 -0
- package/.nx/cache/terminalOutputs/877026836685850193 +21 -0
- package/.nx/cache/terminalOutputs/9406544675747598148 +21 -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 +3962 -0
- package/.nx/workspace-data/d/server-process.json +2 -2
- package/.nx/workspace-data/file-map.json +3102 -3036
- package/.nx/workspace-data/nx_files.nxt +0 -0
- package/.nx/workspace-data/project-graph.json +7 -2
- package/apps/playground/src/app/pages/button-page.ts +5 -3
- package/apps/playground/src/app/pages/feedback-page.ts +1 -1
- package/apps/playground/src/app/pages/home-page.ts +1 -1
- package/apps/playground/src/app/pages/icons-page.ts +3 -3
- package/apps/playground/src/app/pages/lecture-page.ts +3 -3
- package/apps/playground/src/app/pages/models-page.ts +1 -1
- package/apps/playground/src/app/pages/overlay-demos.ts +1 -1
- package/apps/playground/src/app/pages/tokens-page.ts +29 -11
- package/apps/playground/src/app/pages/usecases/onboarding-login.page.ts +1 -1
- package/apps/playground/src/app/pages/usecases/onboarding-reset-password.page.ts +1 -1
- package/apps/playground/src/app/pages/usecases/shipment-detail.page.ts +1 -1
- package/apps/playground/src/app/pages/viewport-preview.component.ts +1 -1
- package/apps/playground/src/app/snippets/button.snippets.ts +4 -3
- package/apps/playground/src/app/snippets/filters.snippets.ts +10 -0
- package/apps/playground/src/index.html +6 -0
- package/apps/playground/src/styles.css +4 -5
- package/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs +131 -8
- package/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs.map +1 -1
- package/dist/libs/africanies-core/types/africanies-africanies-core.d.ts +8 -6
- package/dist/libs/africanies-icons/assets/icons.sprite.svg +7 -0
- package/dist/libs/africanies-icons/fesm2022/africanies-africanies-icons.mjs +1 -0
- package/dist/libs/africanies-icons/fesm2022/africanies-africanies-icons.mjs.map +1 -1
- package/dist/libs/africanies-icons/types/africanies-africanies-icons.d.ts +2 -2
- package/dist/libs/africanies-models/fesm2022/africanies-africanies-models.mjs +22 -8
- package/dist/libs/africanies-models/fesm2022/africanies-africanies-models.mjs.map +1 -1
- package/dist/libs/africanies-theme/fesm2022/africanies-africanies-theme.mjs +30 -8
- package/dist/libs/africanies-theme/fesm2022/africanies-africanies-theme.mjs.map +1 -1
- package/dist/libs/africanies-theme/tailwind-preset.cjs +89 -12
- package/dist/libs/africanies-theme/types/africanies-africanies-theme.d.ts +14 -4
- package/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs +765 -615
- package/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs.map +1 -1
- package/dist/libs/africanies-ui/types/africanies-africanies-ui.d.ts +148 -115
- package/libs/africanies-core/src/index.ts +1 -0
- package/libs/africanies-core/src/lib/notification/index.ts +1 -1
- package/libs/africanies-core/src/lib/notification/notification-link.spec.ts +40 -7
- package/libs/africanies-core/src/lib/notification/notification-link.ts +143 -7
- package/libs/africanies-icons/src/assets/icons.sprite.svg +7 -0
- package/libs/africanies-icons/src/lib/icon-name.ts +1 -0
- package/libs/africanies-models/src/lib/filters/configs/seed-configs.ts +22 -8
- package/libs/africanies-theme/src/lib/mode-color.safelist.ts +20 -2
- package/libs/africanies-theme/src/lib/mode-color.service.spec.ts +55 -0
- package/libs/africanies-theme/src/lib/mode-color.service.ts +23 -7
- package/libs/africanies-theme/tailwind-preset.cjs +89 -12
- package/libs/africanies-ui/src/lib/action-menu/action-menu.component.ts +3 -3
- package/libs/africanies-ui/src/lib/alert/alert.component.ts +4 -4
- package/libs/africanies-ui/src/lib/avatar/avatar-menu.component.ts +2 -2
- package/libs/africanies-ui/src/lib/button/button.component.spec.ts +7 -7
- package/libs/africanies-ui/src/lib/button/button.component.ts +10 -6
- package/libs/africanies-ui/src/lib/chip/chip.component.ts +4 -4
- package/libs/africanies-ui/src/lib/content-stack/content-stack.component.ts +1 -1
- package/libs/africanies-ui/src/lib/feedback/empty-state.component.ts +1 -1
- package/libs/africanies-ui/src/lib/feedback/error-indicator.component.ts +3 -3
- package/libs/africanies-ui/src/lib/feedback/error-state.component.ts +3 -3
- package/libs/africanies-ui/src/lib/filters/filter-drawer.panel.ts +44 -27
- package/libs/africanies-ui/src/lib/forms/checkbox/checkbox.component.ts +2 -1
- package/libs/africanies-ui/src/lib/forms/file-upload/file-preview.dialog.ts +2 -2
- package/libs/africanies-ui/src/lib/forms/file-upload/file-upload.component.ts +5 -5
- package/libs/africanies-ui/src/lib/forms/form-field.classes.ts +37 -7
- package/libs/africanies-ui/src/lib/forms/otp-input/otp-input.component.ts +2 -1
- package/libs/africanies-ui/src/lib/forms/radio/radio.component.ts +2 -1
- package/libs/africanies-ui/src/lib/forms/select/select.component.ts +2 -2
- package/libs/africanies-ui/src/lib/forms/toggle/toggle.component.ts +1 -1
- package/libs/africanies-ui/src/lib/image/image.component.ts +1 -1
- package/libs/africanies-ui/src/lib/info-popover/info-popover.component.ts +2 -2
- package/libs/africanies-ui/src/lib/layout/app-shell-content-header.component.ts +1 -1
- package/libs/africanies-ui/src/lib/layout/app-shell-header.component.ts +6 -6
- package/libs/africanies-ui/src/lib/layout/app-shell.component.html +2 -2
- package/libs/africanies-ui/src/lib/layout/app-shell.component.ts +5 -5
- package/libs/africanies-ui/src/lib/navigation/shipping-mode-switch/shipping-mode-switch.component.ts +4 -4
- package/libs/africanies-ui/src/lib/navigation/side-nav/africanies-side-nav.component.html +21 -13
- package/libs/africanies-ui/src/lib/navigation/side-nav/africanies-side-nav.component.ts +23 -13
- package/libs/africanies-ui/src/lib/notifications/notification-drawer.panel.ts +27 -14
- package/libs/africanies-ui/src/lib/overlay/confirm-dialog.component.ts +2 -2
- package/libs/africanies-ui/src/lib/overlay/drawer.service.ts +3 -3
- package/libs/africanies-ui/src/lib/overlay/modal.service.ts +4 -4
- package/libs/africanies-ui/src/lib/overlay/overlay-frame.component.ts +1 -1
- package/libs/africanies-ui/src/lib/pagination/pagination.component.ts +4 -4
- package/libs/africanies-ui/src/lib/stepper/stepper.component.ts +7 -7
- package/libs/africanies-ui/src/lib/table/table-column.ts +9 -0
- package/libs/africanies-ui/src/lib/table/table.component.spec.ts +99 -0
- package/libs/africanies-ui/src/lib/table/table.component.ts +75 -33
- package/libs/africanies-ui/src/lib/toast/toast-host.component.ts +4 -4
- package/libs/africanies-ui/src/lib/toast/toast-item.component.ts +7 -7
- package/package.json +1 -1
- package/svg/hand-coins.svg +9 -0
- package/.nx/cache/12276756491762927325/dist/libs/africanies-theme/fesm2022/africanies-africanies-theme.mjs.map +0 -1
- package/.nx/cache/17491371155400585077/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs.map +0 -1
- package/.nx/cache/17499961385238663835/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs.map +0 -1
- package/.nx/cache/3314955264390318442/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs.map +0 -1
- package/.nx/cache/4082520855419352840/dist/libs/africanies-theme/fesm2022/africanies-africanies-theme.mjs.map +0 -1
- package/.nx/cache/terminalOutputs/17499961385238663835 +0 -21
- /package/.nx/cache/{17491371155400585077 → 13466509747676776487}/dist/libs/africanies-core/README.md +0 -0
- /package/.nx/cache/{17491371155400585077 → 13466509747676776487}/dist/libs/africanies-core/package.json +0 -0
- /package/.nx/cache/{17499961385238663835 → 14995846848874973576}/dist/libs/africanies-ui/README.md +0 -0
- /package/.nx/cache/{17499961385238663835 → 14995846848874973576}/dist/libs/africanies-ui/assets/brand/africanies-logo-mini.png +0 -0
- /package/.nx/cache/{17499961385238663835 → 14995846848874973576}/dist/libs/africanies-ui/assets/brand/africanies-logo.png +0 -0
- /package/.nx/cache/{17499961385238663835 → 14995846848874973576}/dist/libs/africanies-ui/assets/brand/africanies-logo.svg +0 -0
- /package/.nx/cache/{17499961385238663835 → 14995846848874973576}/dist/libs/africanies-ui/assets/carriers/dhl.svg +0 -0
- /package/.nx/cache/{17499961385238663835 → 14995846848874973576}/dist/libs/africanies-ui/package.json +0 -0
- /package/.nx/cache/{12276756491762927325 → 15302120112746851896}/dist/libs/africanies-theme/README.md +0 -0
- /package/.nx/cache/{12276756491762927325 → 15302120112746851896}/dist/libs/africanies-theme/package.json +0 -0
- /package/.nx/cache/{4082520855419352840 → 6673686859704879504}/dist/libs/africanies-theme/README.md +0 -0
- /package/.nx/cache/{4082520855419352840 → 6673686859704879504}/dist/libs/africanies-theme/package.json +0 -0
- /package/.nx/cache/{3314955264390318442 → 9406544675747598148}/dist/libs/africanies-ui/README.md +0 -0
- /package/.nx/cache/{3314955264390318442 → 9406544675747598148}/dist/libs/africanies-ui/assets/brand/africanies-logo-mini.png +0 -0
- /package/.nx/cache/{3314955264390318442 → 9406544675747598148}/dist/libs/africanies-ui/assets/brand/africanies-logo.png +0 -0
- /package/.nx/cache/{3314955264390318442 → 9406544675747598148}/dist/libs/africanies-ui/assets/brand/africanies-logo.svg +0 -0
- /package/.nx/cache/{3314955264390318442 → 9406544675747598148}/dist/libs/africanies-ui/assets/carriers/dhl.svg +0 -0
- /package/.nx/cache/{3314955264390318442 → 9406544675747598148}/dist/libs/africanies-ui/package.json +0 -0
- /package/.nx/cache/terminalOutputs/{16279119293212733518 → 14005735098959303198} +0 -0
- /package/.nx/cache/terminalOutputs/{7126777490381568487 → 1446890025183346611} +0 -0
- /package/.nx/cache/terminalOutputs/{9408529484792607601 → 6337357866566791975} +0 -0
|
@@ -6,29 +6,59 @@
|
|
|
6
6
|
* when consumers scan the published UI bundle.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* Inset focus ring — stays inside the control border box.
|
|
11
|
+
*
|
|
12
|
+
* Prefer this over `outline` + `outline-offset`. Those paint *outside* the box
|
|
13
|
+
* and are clipped by `overflow: hidden|clip|auto` ancestors (modals, drawers,
|
|
14
|
+
* steppers, scroll panes). `box-sizing` does not affect outlines.
|
|
15
|
+
*/
|
|
16
|
+
export const FORM_FOCUS_WITHIN_CLASS =
|
|
17
|
+
'focus-within:outline-none focus-within:ring-2 focus-within:ring-inset focus-within:ring-focus';
|
|
18
|
+
|
|
19
|
+
/** Same inset ring for host / button-style focus-visible. */
|
|
20
|
+
export const FORM_FOCUS_VISIBLE_CLASS =
|
|
21
|
+
'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus';
|
|
22
|
+
|
|
23
|
+
/** Peer-driven inset ring (checkbox / radio control chrome). */
|
|
24
|
+
export const FORM_FOCUS_VISIBLE_PEER_CLASS =
|
|
25
|
+
'peer-focus-visible:outline-none peer-focus-visible:ring-2 peer-focus-visible:ring-inset peer-focus-visible:ring-focus';
|
|
26
|
+
|
|
27
|
+
/** Direct focus (OTP cells and similar). */
|
|
28
|
+
export const FORM_FOCUS_CLASS =
|
|
29
|
+
'focus:outline-none focus:ring-2 focus:ring-inset focus:ring-focus';
|
|
30
|
+
|
|
9
31
|
/** Label above the control. Hidden when empty so callers can omit a label. */
|
|
10
32
|
export const FORM_LABEL_CLASS =
|
|
11
33
|
'block text-body-sm font-medium text-ink dark:text-white mb-1.5 empty:hidden';
|
|
12
34
|
|
|
13
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* Default control shell — `h-10` matches md `africanies-button`.
|
|
37
|
+
*
|
|
38
|
+
* Focus utilities are inlined (not concatenated) so Tailwind content scanning
|
|
39
|
+
* always sees the full class names in this string literal.
|
|
40
|
+
*/
|
|
14
41
|
export const FORM_FIELD_CLASS =
|
|
15
|
-
'flex items-center w-full h-10 box-border rounded-
|
|
16
|
-
'focus-within:outline focus-within:
|
|
42
|
+
'flex items-center w-full h-10 box-border rounded-control border border-control bg-surface dark:bg-ink-950 text-ink dark:text-white dark:border-white/25 ' +
|
|
43
|
+
'focus-within:outline-none focus-within:ring-2 focus-within:ring-inset focus-within:ring-focus';
|
|
17
44
|
|
|
18
45
|
/**
|
|
19
|
-
* Error border — `!` so it wins over shell `border-
|
|
46
|
+
* Error border — `!` so it wins over shell `border-border` /
|
|
20
47
|
* `dark:border-white/25` (same specificity; those utilities sort later in the
|
|
21
48
|
* generated CSS and otherwise paint over `border-danger`).
|
|
22
49
|
*
|
|
50
|
+
* Use `danger` (`#ff001c`) for both border and focus ring so field chrome
|
|
51
|
+
* matches validation copy (not the darker accessible `danger-dark` text token).
|
|
52
|
+
*
|
|
23
53
|
* Keep these literals static for Tailwind content scanning in consumer apps.
|
|
24
54
|
*/
|
|
25
55
|
export const FORM_FIELD_ERROR_CLASS =
|
|
26
|
-
'!border-danger dark:!border-danger focus-within:!
|
|
56
|
+
'!border-danger dark:!border-danger focus-within:!ring-danger focus:!ring-danger';
|
|
27
57
|
|
|
28
58
|
/** Native input / textarea inside a shell. */
|
|
29
59
|
export const FORM_CONTROL_INNER_CLASS =
|
|
30
60
|
'flex-1 min-w-0 min-h-0 h-full w-full bg-transparent border-0 outline-none text-body text-ink dark:text-white px-3 py-0 ' +
|
|
31
|
-
'placeholder:text-neutral-
|
|
61
|
+
'placeholder:text-neutral-500 disabled:cursor-not-allowed';
|
|
32
62
|
|
|
33
63
|
/** Prefix / suffix projection gutters. Hidden when nothing is projected. */
|
|
34
64
|
export const FORM_AFFIX_CLASS =
|
|
@@ -50,7 +80,7 @@ export const FORM_DATE_INNER_CLASS =
|
|
|
50
80
|
export const FORM_HINT_CLASS =
|
|
51
81
|
'mt-1.5 text-caption text-neutral-600 dark:text-neutral-400 m-0';
|
|
52
82
|
|
|
53
|
-
/** Field-level validation message (not ErrorStateComponent). */
|
|
83
|
+
/** Field-level validation message (not ErrorStateComponent). Matches `#ff001c`. */
|
|
54
84
|
export const FORM_ERROR_CLASS = 'mt-1.5 text-caption text-danger m-0';
|
|
55
85
|
|
|
56
86
|
/** Disabled shell — dimmed with not-allowed cursor over the full field chrome. */
|
|
@@ -24,6 +24,7 @@ import { ButtonComponent } from '../../button/button.component';
|
|
|
24
24
|
import {
|
|
25
25
|
FORM_ERROR_CLASS,
|
|
26
26
|
FORM_FIELD_ERROR_CLASS,
|
|
27
|
+
FORM_FOCUS_CLASS,
|
|
27
28
|
FORM_HINT_CLASS,
|
|
28
29
|
FORM_LABEL_CLASS,
|
|
29
30
|
} from '../form-field.classes';
|
|
@@ -165,7 +166,7 @@ export class OtpInputComponent implements ControlValueAccessor, OnDestroy {
|
|
|
165
166
|
let classes =
|
|
166
167
|
'size-10 shrink-0 rounded-md border border-neutral-300 bg-white text-center text-body font-medium text-ink outline-none transition-colors ' +
|
|
167
168
|
'dark:border-white/25 dark:bg-ink-950 dark:text-white ' +
|
|
168
|
-
|
|
169
|
+
`${FORM_FOCUS_CLASS} disabled:cursor-not-allowed`;
|
|
169
170
|
if (this.masked()) {
|
|
170
171
|
classes += ' africanies-otp-cell-masked text-body-lg';
|
|
171
172
|
}
|
|
@@ -18,6 +18,7 @@ import { ModeColorService } from '@africanies/africanies-theme';
|
|
|
18
18
|
|
|
19
19
|
import {
|
|
20
20
|
FORM_ERROR_CLASS,
|
|
21
|
+
FORM_FOCUS_VISIBLE_PEER_CLASS,
|
|
21
22
|
FORM_HINT_CLASS,
|
|
22
23
|
FORM_LABEL_CLASS,
|
|
23
24
|
} from '../form-field.classes';
|
|
@@ -178,7 +179,7 @@ export class RadioComponent<T = string> implements ControlValueAccessor {
|
|
|
178
179
|
protected markClass(opt: RadioOption<T>): string {
|
|
179
180
|
const base =
|
|
180
181
|
'pointer-events-none flex size-4 items-center justify-center rounded-full border-2 bg-transparent transition-colors ' +
|
|
181
|
-
|
|
182
|
+
FORM_FOCUS_VISIBLE_PEER_CLASS;
|
|
182
183
|
const err = this.error() ? ' !border-danger dark:!border-danger' : '';
|
|
183
184
|
if (this.isSelected(opt)) {
|
|
184
185
|
// Ring uses mode accent; fill stays transparent so the center dot reads clearly.
|
|
@@ -186,7 +186,7 @@ const SELECT_PANEL_POSITIONS: ConnectedPosition[] = [
|
|
|
186
186
|
@if (multiple() && selectedList().length) {
|
|
187
187
|
@for (chip of selectedList(); track trackOption(chip)) {
|
|
188
188
|
<span
|
|
189
|
-
class="inline-flex items-center gap-1 rounded-md border border-neutral-300 bg-background-welcome dark:border-white/20 dark:bg-ink text-body-sm text-ink dark:text-white px-2 py-0.5"
|
|
189
|
+
class="inline-flex items-center gap-1 rounded-md border border-neutral-300 bg-background-welcome dark:border-white/20 dark:bg-ink-950 text-body-sm text-ink dark:text-white px-2 py-0.5"
|
|
190
190
|
>
|
|
191
191
|
@if (chip.prefix; as prefixIcon) {
|
|
192
192
|
<africanies-icon [name]="prefixIcon" [size]="14" class="shrink-0" />
|
|
@@ -305,7 +305,7 @@ const SELECT_PANEL_POSITIONS: ConnectedPosition[] = [
|
|
|
305
305
|
<input
|
|
306
306
|
#searchInput
|
|
307
307
|
type="search"
|
|
308
|
-
class="w-full rounded-md border border-neutral-300 dark:border-white/25 bg-transparent text-body text-ink dark:text-white px-2.5 py-1.5 outline-none focus-visible:outline focus-visible:
|
|
308
|
+
class="w-full rounded-md border border-neutral-300 dark:border-white/25 bg-transparent text-body text-ink dark:text-white px-2.5 py-1.5 outline-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ink"
|
|
309
309
|
[value]="searchQuery()"
|
|
310
310
|
placeholder="Search…"
|
|
311
311
|
(input)="onSearchInput($event)"
|
|
@@ -71,7 +71,7 @@ let nextToggleId = 0;
|
|
|
71
71
|
[id]="controlId"
|
|
72
72
|
type="button"
|
|
73
73
|
role="switch"
|
|
74
|
-
class="relative inline-flex h-5 w-9 shrink-0 items-center rounded-full border border-border p-0.5 box-border transition-colors focus-visible:outline focus-visible:
|
|
74
|
+
class="relative inline-flex h-5 w-9 shrink-0 items-center rounded-full border border-border p-0.5 box-border transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ink dark:border-white/15"
|
|
75
75
|
[ngClass]="trackClass()"
|
|
76
76
|
[attr.aria-checked]="on()"
|
|
77
77
|
[attr.aria-busy]="loading() ? true : null"
|
|
@@ -70,7 +70,7 @@ export type ImageFit = 'cover' | 'contain';
|
|
|
70
70
|
|
|
71
71
|
@if (showPlaceholder()) {
|
|
72
72
|
<div
|
|
73
|
-
class="absolute inset-0 flex items-center justify-center bg-neutral-200 text-neutral-
|
|
73
|
+
class="absolute inset-0 flex items-center justify-center bg-neutral-200 text-neutral-600 dark:bg-white/10 dark:text-neutral-400"
|
|
74
74
|
[class.animate-pulse]="pending()"
|
|
75
75
|
aria-hidden="true"
|
|
76
76
|
>
|
|
@@ -245,9 +245,9 @@ export class InfoPopoverComponent {
|
|
|
245
245
|
*/
|
|
246
246
|
protected readonly panelArrowClass = computed(() => {
|
|
247
247
|
const card =
|
|
248
|
-
'relative z-10 w-max max-w-xs rounded-
|
|
248
|
+
'relative z-10 w-max max-w-xs rounded-panel border border-border bg-surface px-4 py-3 text-ink shadow-floating dark:border-white/15 dark:bg-ink-950 dark:text-white';
|
|
249
249
|
const base =
|
|
250
|
-
"before:pointer-events-none before:absolute before:z-0 before:h-2.5 before:w-2.5 before:rotate-45 before:border before:border-border before:bg-
|
|
250
|
+
"before:pointer-events-none before:absolute before:z-0 before:h-2.5 before:w-2.5 before:rotate-45 before:border before:border-border before:bg-surface before:content-[''] dark:before:border-white/15 dark:before:bg-ink-950";
|
|
251
251
|
switch (this.placement()) {
|
|
252
252
|
case 'bottom':
|
|
253
253
|
return `${card} ${base} before:left-1/2 before:top-0 before:-translate-x-1/2 before:-translate-y-1/2 before:border-b-0 before:border-r-0`;
|
|
@@ -39,7 +39,7 @@ import { PageHeaderComponent } from './page-header.component';
|
|
|
39
39
|
<div class="flex min-w-0 items-center gap-2 sm:gap-3">
|
|
40
40
|
@if (showBackButton()) {
|
|
41
41
|
<a
|
|
42
|
-
class="inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-lg text-neutral-600 transition-colors hover:bg-background-
|
|
42
|
+
class="inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-lg 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"
|
|
43
43
|
[attr.aria-label]="backLabel()"
|
|
44
44
|
[routerLink]="backTarget()!.routerLink"
|
|
45
45
|
[queryParams]="backTarget()!.queryParams"
|
|
@@ -81,7 +81,7 @@ export class AppShellHeaderEndDirective {}
|
|
|
81
81
|
@if (greeting(); as hello) {
|
|
82
82
|
<div class="min-w-0 overflow-hidden">
|
|
83
83
|
<p
|
|
84
|
-
class="m-0 truncate text-caption leading-none text-neutral-
|
|
84
|
+
class="m-0 truncate text-caption leading-none text-neutral-600 dark:text-neutral-400"
|
|
85
85
|
>
|
|
86
86
|
{{ hello.kicker }}
|
|
87
87
|
</p>
|
|
@@ -107,7 +107,7 @@ export class AppShellHeaderEndDirective {}
|
|
|
107
107
|
<africanies-icon
|
|
108
108
|
[name]="weatherIcon()"
|
|
109
109
|
[size]="18"
|
|
110
|
-
class="text-neutral-
|
|
110
|
+
class="text-neutral-600 dark:text-neutral-400"
|
|
111
111
|
/>
|
|
112
112
|
@if (weatherTemp(); as temp) {
|
|
113
113
|
<span
|
|
@@ -117,7 +117,7 @@ export class AppShellHeaderEndDirective {}
|
|
|
117
117
|
</span>
|
|
118
118
|
}
|
|
119
119
|
<span
|
|
120
|
-
class="hidden text-caption text-neutral-
|
|
120
|
+
class="hidden text-caption text-neutral-600 md:inline dark:text-neutral-400"
|
|
121
121
|
>
|
|
122
122
|
{{ weatherPlace() }}
|
|
123
123
|
</span>
|
|
@@ -127,7 +127,7 @@ export class AppShellHeaderEndDirective {}
|
|
|
127
127
|
@if (showClock()) {
|
|
128
128
|
<div class="flex items-baseline gap-2" aria-live="polite">
|
|
129
129
|
<time
|
|
130
|
-
class="hidden text-caption text-neutral-
|
|
130
|
+
class="hidden text-caption text-neutral-600 md:inline dark:text-neutral-400"
|
|
131
131
|
[dateTime]="nowIso()"
|
|
132
132
|
>
|
|
133
133
|
{{ now() | date: clockDateFormat() }}
|
|
@@ -157,7 +157,7 @@ export class AppShellHeaderEndDirective {}
|
|
|
157
157
|
@if (showNotifications()) {
|
|
158
158
|
<button
|
|
159
159
|
type="button"
|
|
160
|
-
class="relative inline-flex size-9 cursor-pointer items-center justify-center rounded-lg text-neutral-600 transition-colors hover:bg-background-
|
|
160
|
+
class="relative inline-flex size-9 cursor-pointer items-center justify-center rounded-lg 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"
|
|
161
161
|
[attr.aria-label]="notificationAriaLabel()"
|
|
162
162
|
(click)="openNotifications()"
|
|
163
163
|
>
|
|
@@ -349,7 +349,7 @@ export class AppShellHeaderComponent {
|
|
|
349
349
|
this.notificationsDrawer
|
|
350
350
|
.open({
|
|
351
351
|
title: this.notificationsTitle(),
|
|
352
|
-
notifications:
|
|
352
|
+
notifications: this.notifications(),
|
|
353
353
|
onLoadPage,
|
|
354
354
|
onMarkRead,
|
|
355
355
|
onMarkAllRead,
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
>
|
|
22
22
|
<button
|
|
23
23
|
type="button"
|
|
24
|
-
class="inline-flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-lg border border-
|
|
24
|
+
class="inline-flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-lg border border-control text-ink transition-colors hover:bg-background-hover dark:border-white/15 dark:text-white dark:hover:bg-white/10"
|
|
25
25
|
[attr.aria-label]="mobileNavOpen() ? 'Close navigation' : 'Open navigation'"
|
|
26
26
|
[attr.aria-expanded]="mobileNavOpen()"
|
|
27
27
|
(click)="toggleMobileNav()"
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
<div
|
|
40
|
-
class="sticky top-0 z-30 border-b border-border bg-
|
|
40
|
+
class="sticky top-0 z-30 border-b border-border bg-surface/90 backdrop-blur-md dark:border-white/10 dark:bg-ink-950/90"
|
|
41
41
|
>
|
|
42
42
|
@if (hasCustomHeader()) {
|
|
43
43
|
<ng-content select="[africaniesAppShellHeader]" />
|
|
@@ -199,8 +199,8 @@ export class AppShellComponent {
|
|
|
199
199
|
|
|
200
200
|
protected readonly shellRootClass = computed(() =>
|
|
201
201
|
this.layoutPreview()
|
|
202
|
-
? 'relative flex h-full min-h-0'
|
|
203
|
-
: 'relative flex min-h-full',
|
|
202
|
+
? 'relative flex h-full min-h-0 bg-background-chrome dark:bg-ink-950'
|
|
203
|
+
: 'relative flex min-h-full bg-background-chrome dark:bg-ink-950',
|
|
204
204
|
);
|
|
205
205
|
|
|
206
206
|
protected readonly headerDensity = computed((): 'mobile' | 'tablet' | 'desktop' => {
|
|
@@ -229,16 +229,16 @@ export class AppShellComponent {
|
|
|
229
229
|
// Preview embeds: absolute/h-full so the drawer stays inside the frame.
|
|
230
230
|
// Production: h-dvh so the rail fills the viewport (h-full only matches parent).
|
|
231
231
|
if (preview === 'desktop') {
|
|
232
|
-
return 'z-50 shrink-0 self-start sticky top-0 block h-full';
|
|
232
|
+
return 'z-50 shrink-0 self-start sticky top-0 block h-full min-h-0';
|
|
233
233
|
}
|
|
234
234
|
|
|
235
235
|
if (preview === 'mobile' || preview === 'tablet') {
|
|
236
236
|
return open
|
|
237
|
-
? 'z-50 shrink-0 self-start absolute inset-y-0 left-0 h-full shadow-xl'
|
|
237
|
+
? 'z-50 shrink-0 self-start absolute inset-y-0 left-0 h-full min-h-0 shadow-xl'
|
|
238
238
|
: 'hidden';
|
|
239
239
|
}
|
|
240
240
|
|
|
241
|
-
const base = 'z-50 shrink-0 self-start h-dvh';
|
|
241
|
+
const base = 'z-50 shrink-0 self-start h-dvh min-h-0';
|
|
242
242
|
if (open) {
|
|
243
243
|
return `${base} fixed inset-y-0 left-0 shadow-xl lg:sticky lg:top-0 lg:block`;
|
|
244
244
|
}
|
package/libs/africanies-ui/src/lib/navigation/shipping-mode-switch/shipping-mode-switch.component.ts
CHANGED
|
@@ -159,18 +159,18 @@ export class ShippingModeSwitchComponent {
|
|
|
159
159
|
const compact = this.collapsed();
|
|
160
160
|
const base =
|
|
161
161
|
'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
|
-
'focus-visible:outline focus-visible:
|
|
162
|
+
'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus ' +
|
|
163
163
|
(compact ? 'min-h-9 px-1 py-1.5' : 'min-h-[4.5rem] px-1.5 py-2');
|
|
164
164
|
const idle =
|
|
165
|
-
'border-
|
|
165
|
+
'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
166
|
|
|
167
167
|
if (option === 'stn') {
|
|
168
168
|
return selected
|
|
169
|
-
? `${base} border-import bg-import text-white`
|
|
169
|
+
? `${base} border-import-strong bg-import-strong text-white dark:border-import dark:bg-import`
|
|
170
170
|
: `${base} ${idle}`;
|
|
171
171
|
}
|
|
172
172
|
return selected
|
|
173
|
-
? `${base} border-export bg-export text-white`
|
|
173
|
+
? `${base} border-export-strong bg-export-strong text-white dark:border-export dark:bg-export`
|
|
174
174
|
: `${base} ${idle}`;
|
|
175
175
|
}
|
|
176
176
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<aside
|
|
2
|
-
class="relative flex h-full flex-col overflow-visible border-r border-border bg-
|
|
2
|
+
class="relative flex h-full min-h-0 flex-col overflow-visible border-r border-border bg-surface transition-[width] duration-200 ease-out dark:border-white/10 dark:bg-ink-950"
|
|
3
3
|
[style.width]="collapsed() ? '3.75rem' : '15rem'"
|
|
4
4
|
[attr.aria-label]="ariaLabel()"
|
|
5
5
|
>
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
></div>
|
|
11
11
|
|
|
12
12
|
<div
|
|
13
|
-
class="flex shrink-0 items-center gap-2 border-b border-border py-3 dark:border-white/10"
|
|
13
|
+
class="sticky top-0 z-20 flex shrink-0 items-center gap-2 border-b border-border bg-surface py-3 dark:border-white/10 dark:bg-ink-950"
|
|
14
14
|
[class.flex-col]="collapsed()"
|
|
15
15
|
[class.px-3]="collapsed()"
|
|
16
16
|
[class.pl-4]="!collapsed()"
|
|
@@ -43,7 +43,8 @@
|
|
|
43
43
|
}
|
|
44
44
|
<button
|
|
45
45
|
type="button"
|
|
46
|
-
class="inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-md text-neutral-600 transition-colors hover:bg-background-
|
|
46
|
+
class="inline-flex size-8 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"
|
|
47
|
+
data-onboarding="nav-collapse"
|
|
47
48
|
[attr.aria-label]="
|
|
48
49
|
collapsed() ? 'Expand navigation' : 'Collapse navigation'
|
|
49
50
|
"
|
|
@@ -57,21 +58,28 @@
|
|
|
57
58
|
</button>
|
|
58
59
|
</div>
|
|
59
60
|
|
|
60
|
-
<nav
|
|
61
|
+
<nav
|
|
62
|
+
class="africanies-overlay-scroll relative min-h-0 flex-1 overflow-y-auto overflow-x-visible px-3 py-3"
|
|
63
|
+
>
|
|
61
64
|
@if (!collapsed() && expandParents() && hasOpenBranches()) {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
65
|
+
<!-- Zero-height sticky host: keeps the control pinned without reserving a row. -->
|
|
66
|
+
<div class="sticky top-0 z-10 h-0 overflow-visible">
|
|
67
|
+
<button
|
|
68
|
+
type="button"
|
|
69
|
+
class="absolute right-0 top-0 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-white/10 dark:hover:text-white"
|
|
70
|
+
data-onboarding="nav-branches-collapse"
|
|
71
|
+
aria-label="Collapse all"
|
|
72
|
+
(click)="collapseAllBranches()"
|
|
73
|
+
>
|
|
74
|
+
<africanies-icon name="compress" [size]="14" />
|
|
75
|
+
</button>
|
|
76
|
+
</div>
|
|
70
77
|
}
|
|
71
78
|
<ul class="m-0 flex list-none flex-col gap-0.5 p-0">
|
|
72
79
|
@for (item of items(); track item.id) {
|
|
73
80
|
<li
|
|
74
|
-
class="relative overflow-visible"
|
|
81
|
+
class="relative overflow-visible last:mb-0"
|
|
82
|
+
[class.mb-3]="!collapsed() && !item.children?.length"
|
|
75
83
|
(mouseenter)="onItemEnter(item.id)"
|
|
76
84
|
(mouseleave)="onItemLeave(item.id)"
|
|
77
85
|
>
|
|
@@ -38,14 +38,16 @@ const DEFAULT_LINK_ACTIVE: IsActiveMatchOptions = {
|
|
|
38
38
|
/**
|
|
39
39
|
* App shell side navigation with icons, nested items, and a collapsible rail.
|
|
40
40
|
*
|
|
41
|
-
* **Design - ink spine:** a continuous mode-accent edge
|
|
42
|
-
*
|
|
43
|
-
*
|
|
41
|
+
* **Design - ink spine:** a continuous mode-accent edge; active leaves use
|
|
42
|
+
* primary fill + white text (portal parity); expanded parents of an active
|
|
43
|
+
* child use primary text on white. Collapsed mode keeps icons; hover opens a
|
|
44
|
+
* floating label blade (name + children) instead of a plain tooltip.
|
|
44
45
|
*
|
|
45
46
|
* ## Parent items with children
|
|
46
47
|
* **Expanded rail:** branches start open by default (`expandBranchesByDefault`).
|
|
47
48
|
* Clicking a parent only opens/closes the branch (no route change). When any
|
|
48
|
-
* branch is open, a collapse-all control sits above the list (top right).
|
|
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.
|
|
49
51
|
* **Collapsed rail:** clicking a parent expands the rail, opens the
|
|
50
52
|
* branch, and activates the first enabled child (router or `activeId`).
|
|
51
53
|
*
|
|
@@ -72,7 +74,7 @@ const DEFAULT_LINK_ACTIVE: IsActiveMatchOptions = {
|
|
|
72
74
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
73
75
|
imports: [AfricaniesIconComponent, RouterLink, NgTemplateOutlet],
|
|
74
76
|
host: {
|
|
75
|
-
class: 'relative z-20 block h-full',
|
|
77
|
+
class: 'relative z-20 block h-full min-h-0',
|
|
76
78
|
},
|
|
77
79
|
styleUrl: './africanies-side-nav.component.css',
|
|
78
80
|
templateUrl: './africanies-side-nav.component.html',
|
|
@@ -196,10 +198,15 @@ export class SideNavComponent {
|
|
|
196
198
|
}
|
|
197
199
|
|
|
198
200
|
/** Fold every parent branch on the expanded rail. */
|
|
199
|
-
|
|
201
|
+
collapseAllBranches(): void {
|
|
200
202
|
this.openBranches.set(new Set());
|
|
201
203
|
}
|
|
202
204
|
|
|
205
|
+
/** Open every parent branch (e.g. so the collapse-all control is visible). */
|
|
206
|
+
expandAllBranches(): void {
|
|
207
|
+
this.openBranches.set(new Set(this.collectParentIds(this.items())));
|
|
208
|
+
}
|
|
209
|
+
|
|
203
210
|
protected onItemEnter(id: string): void {
|
|
204
211
|
if (this.collapsed()) {
|
|
205
212
|
this.hoverId.set(id);
|
|
@@ -238,21 +245,24 @@ export class SideNavComponent {
|
|
|
238
245
|
protected rowClass(item: AfricaniesSideNavItem): string {
|
|
239
246
|
const base =
|
|
240
247
|
'group relative flex w-full items-center gap-2 rounded-lg text-body-sm no-underline transition-colors ' +
|
|
241
|
-
'focus-visible:outline focus-visible:
|
|
248
|
+
'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus ' +
|
|
242
249
|
(this.collapsed() ? 'justify-center px-1.5 py-2' : 'px-3 py-2') +
|
|
243
250
|
(item.disabled ? ' cursor-not-allowed opacity-50' : ' cursor-pointer');
|
|
244
251
|
|
|
245
252
|
const leaf = this.isLeafActive(item);
|
|
246
253
|
const ancestor = !leaf && this.isItemActive(item);
|
|
254
|
+
const colors = this.modeColor.classes();
|
|
247
255
|
|
|
256
|
+
// Portal: active leaf / collapsed rail = primary fill + white text.
|
|
248
257
|
if (leaf) {
|
|
249
|
-
return `${base} ${
|
|
258
|
+
return `${base} ${colors.activeFill} font-semibold`;
|
|
250
259
|
}
|
|
260
|
+
// Portal: expanded parent of active child = primary text on white.
|
|
251
261
|
if (ancestor) {
|
|
252
|
-
return `${base}
|
|
262
|
+
return `${base} bg-transparent ${colors.text} font-semibold`;
|
|
253
263
|
}
|
|
254
264
|
return (
|
|
255
|
-
`${base} font-medium text-neutral-600 hover:bg-background-
|
|
265
|
+
`${base} font-medium text-neutral-600 hover:bg-background-hover hover:text-ink ` +
|
|
256
266
|
'dark:text-neutral-400 dark:hover:bg-white/10 dark:hover:text-white'
|
|
257
267
|
);
|
|
258
268
|
}
|
|
@@ -260,14 +270,14 @@ export class SideNavComponent {
|
|
|
260
270
|
protected childRowClass(item: AfricaniesSideNavItem): string {
|
|
261
271
|
const base =
|
|
262
272
|
'relative flex w-full items-center gap-2 rounded-lg px-3 py-1.5 text-body-sm no-underline transition-colors ' +
|
|
263
|
-
'focus-visible:outline focus-visible:
|
|
273
|
+
'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus ' +
|
|
264
274
|
(item.disabled ? 'cursor-not-allowed opacity-50 ' : 'cursor-pointer ');
|
|
265
275
|
|
|
266
276
|
if (this.isLeafActive(item)) {
|
|
267
|
-
return `${base} ${this.modeColor.classes().
|
|
277
|
+
return `${base} ${this.modeColor.classes().activeFill} font-semibold`;
|
|
268
278
|
}
|
|
269
279
|
return (
|
|
270
|
-
`${base} font-medium text-neutral-600 hover:bg-background-
|
|
280
|
+
`${base} font-medium text-neutral-600 hover:bg-background-hover hover:text-ink ` +
|
|
271
281
|
'dark:text-neutral-400 dark:hover:bg-white/10 dark:hover:text-white'
|
|
272
282
|
);
|
|
273
283
|
}
|
|
@@ -66,7 +66,7 @@ const MARK_ALL_CONFIRM_MS = 4000;
|
|
|
66
66
|
{{ title() }}
|
|
67
67
|
</h2>
|
|
68
68
|
@if (hasUnread()) {
|
|
69
|
-
<p class="m-0 text-caption text-neutral-
|
|
69
|
+
<p class="m-0 text-caption text-neutral-600 dark:text-neutral-400">
|
|
70
70
|
{{ unreadCount() }} unread
|
|
71
71
|
</p>
|
|
72
72
|
}
|
|
@@ -112,7 +112,7 @@ const MARK_ALL_CONFIRM_MS = 4000;
|
|
|
112
112
|
<africanies-icon
|
|
113
113
|
name="spinner"
|
|
114
114
|
[size]="24"
|
|
115
|
-
class="animate-spin text-neutral-
|
|
115
|
+
class="animate-spin text-neutral-600 dark:text-neutral-400"
|
|
116
116
|
/>
|
|
117
117
|
<p class="m-0 text-body-sm text-neutral-600 dark:text-neutral-400">
|
|
118
118
|
Loading notifications…
|
|
@@ -127,7 +127,7 @@ const MARK_ALL_CONFIRM_MS = 4000;
|
|
|
127
127
|
<button
|
|
128
128
|
africanies-button
|
|
129
129
|
type="button"
|
|
130
|
-
variant="
|
|
130
|
+
variant="flat"
|
|
131
131
|
size="sm"
|
|
132
132
|
(click)="retryInitialLoad()"
|
|
133
133
|
>
|
|
@@ -179,7 +179,7 @@ const MARK_ALL_CONFIRM_MS = 4000;
|
|
|
179
179
|
</h3>
|
|
180
180
|
@if (item.timestamp) {
|
|
181
181
|
<time
|
|
182
|
-
class="shrink-0 whitespace-nowrap text-[11px] tabular-nums text-neutral-
|
|
182
|
+
class="shrink-0 whitespace-nowrap text-[11px] tabular-nums text-neutral-600 dark:text-neutral-400"
|
|
183
183
|
[dateTime]="item.timestamp"
|
|
184
184
|
>
|
|
185
185
|
{{ formatTimestamp(item.timestamp) }}
|
|
@@ -258,7 +258,7 @@ const MARK_ALL_CONFIRM_MS = 4000;
|
|
|
258
258
|
>
|
|
259
259
|
@if (loadingMore()) {
|
|
260
260
|
<span
|
|
261
|
-
class="inline-flex items-center gap-2 text-caption text-neutral-
|
|
261
|
+
class="inline-flex items-center gap-2 text-caption text-neutral-600 dark:text-neutral-400"
|
|
262
262
|
aria-live="polite"
|
|
263
263
|
>
|
|
264
264
|
<africanies-icon name="spinner" [size]="14" class="animate-spin" />
|
|
@@ -290,19 +290,20 @@ export class NotificationDrawerPanel {
|
|
|
290
290
|
const base =
|
|
291
291
|
'inline-flex cursor-pointer items-center gap-1 self-start text-caption font-semibold underline underline-offset-[3px] transition-colors';
|
|
292
292
|
if (this.shipping.mode() === 'stn') {
|
|
293
|
-
return `${base} text-import decoration-import/35 hover:decoration-import dark:text-import-light dark:decoration-import-light/40 dark:hover:decoration-import-light`;
|
|
293
|
+
return `${base} text-import-strong decoration-import-strong/35 hover:decoration-import-strong dark:text-import-light dark:decoration-import-light/40 dark:hover:decoration-import-light`;
|
|
294
294
|
}
|
|
295
|
-
return `${base} text-export decoration-export/35 hover:decoration-export dark:text-export-light dark:decoration-export-light/40 dark:hover:decoration-export-light`;
|
|
295
|
+
return `${base} text-export-strong decoration-export-strong/35 hover:decoration-export-strong dark:text-export-light dark:decoration-export-light/40 dark:hover:decoration-export-light`;
|
|
296
296
|
});
|
|
297
297
|
|
|
298
298
|
protected readonly title = computed(() => this.data.title ?? 'Notifications');
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
);
|
|
299
|
+
private readonly seededItems = this.data.notifications ?? [];
|
|
300
|
+
protected readonly items = signal<AfricaniesNotification[]>(this.seededItems);
|
|
302
301
|
protected readonly markingId = signal<string | null>(null);
|
|
303
302
|
protected readonly markingAll = signal(false);
|
|
304
303
|
protected readonly confirmingMarkAll = signal(false);
|
|
305
|
-
protected readonly loadingInitial = signal(
|
|
304
|
+
protected readonly loadingInitial = signal(
|
|
305
|
+
!!this.data.onLoadPage && this.seededItems.length === 0,
|
|
306
|
+
);
|
|
306
307
|
protected readonly loadingMore = signal(false);
|
|
307
308
|
protected readonly loadError = signal<string | null>(null);
|
|
308
309
|
protected readonly hasMore = signal(false);
|
|
@@ -334,7 +335,12 @@ export class NotificationDrawerPanel {
|
|
|
334
335
|
|
|
335
336
|
constructor() {
|
|
336
337
|
if (this.data.onLoadPage) {
|
|
337
|
-
this.
|
|
338
|
+
if (this.seededItems.length > 0) {
|
|
339
|
+
this.currentPage.set(1);
|
|
340
|
+
this.fetchPage(1, 'refresh');
|
|
341
|
+
} else {
|
|
342
|
+
this.fetchPage(1, 'replace');
|
|
343
|
+
}
|
|
338
344
|
}
|
|
339
345
|
|
|
340
346
|
effect(() => {
|
|
@@ -578,7 +584,10 @@ export class NotificationDrawerPanel {
|
|
|
578
584
|
this.fetchPage(this.currentPage() + 1, 'append');
|
|
579
585
|
}
|
|
580
586
|
|
|
581
|
-
private fetchPage(
|
|
587
|
+
private fetchPage(
|
|
588
|
+
page: number,
|
|
589
|
+
mode: 'replace' | 'append' | 'refresh',
|
|
590
|
+
): void {
|
|
582
591
|
const loadPage = this.data.onLoadPage;
|
|
583
592
|
if (!loadPage) {
|
|
584
593
|
return;
|
|
@@ -587,6 +596,8 @@ export class NotificationDrawerPanel {
|
|
|
587
596
|
if (mode === 'replace') {
|
|
588
597
|
this.loadingInitial.set(true);
|
|
589
598
|
this.loadError.set(null);
|
|
599
|
+
} else if (mode === 'refresh') {
|
|
600
|
+
this.loadError.set(null);
|
|
590
601
|
} else {
|
|
591
602
|
this.loadingMore.set(true);
|
|
592
603
|
}
|
|
@@ -594,7 +605,7 @@ export class NotificationDrawerPanel {
|
|
|
594
605
|
this.runPageLoad(
|
|
595
606
|
() => loadPage(page),
|
|
596
607
|
(result) => {
|
|
597
|
-
if (mode === 'replace') {
|
|
608
|
+
if (mode === 'replace' || mode === 'refresh') {
|
|
598
609
|
this.items.set(result.items ?? []);
|
|
599
610
|
} else {
|
|
600
611
|
this.appendItems(result.items ?? []);
|
|
@@ -614,6 +625,8 @@ export class NotificationDrawerPanel {
|
|
|
614
625
|
if (mode === 'replace') {
|
|
615
626
|
this.loadError.set('Could not load notifications. Try again.');
|
|
616
627
|
this.loadingInitial.set(false);
|
|
628
|
+
} else if (mode === 'refresh' && this.items().length === 0) {
|
|
629
|
+
this.loadError.set('Could not load notifications. Try again.');
|
|
617
630
|
}
|
|
618
631
|
this.loadingMore.set(false);
|
|
619
632
|
},
|
|
@@ -161,8 +161,8 @@ export class ConfirmDialogComponent {
|
|
|
161
161
|
const well =
|
|
162
162
|
'inline-flex size-14 shrink-0 items-center justify-center rounded-2xl';
|
|
163
163
|
return this.options.danger
|
|
164
|
-
? `${well} bg-danger-subtle text-danger dark:bg-danger/20 dark:text-danger`
|
|
165
|
-
: `${well} bg-export-subtle text-export dark:bg-export/20 dark:text-export-light`;
|
|
164
|
+
? `${well} bg-danger-subtle text-danger-dark dark:bg-danger/20 dark:text-danger`
|
|
165
|
+
: `${well} bg-export-subtle text-export-strong dark:bg-export/20 dark:text-export-light`;
|
|
166
166
|
});
|
|
167
167
|
|
|
168
168
|
constructor() {
|
|
@@ -59,15 +59,15 @@ export class DrawerService implements OverlayOpener {
|
|
|
59
59
|
'africanies-overlay-backdrop',
|
|
60
60
|
'bg-ink/45',
|
|
61
61
|
'backdrop-blur-sm',
|
|
62
|
-
'dark:bg-ink/60',
|
|
62
|
+
'dark:bg-ink-950/60',
|
|
63
63
|
],
|
|
64
64
|
panelClass: [
|
|
65
65
|
'africanies-drawer-panel',
|
|
66
|
-
'bg-
|
|
66
|
+
'bg-surface',
|
|
67
67
|
'dark:bg-ink-950',
|
|
68
68
|
'text-ink',
|
|
69
69
|
'dark:text-white',
|
|
70
|
-
'shadow-
|
|
70
|
+
'shadow-floating',
|
|
71
71
|
'border-l',
|
|
72
72
|
'border-border',
|
|
73
73
|
'dark:border-white/15',
|