import * as i0 from '@angular/core'; /** * Tailwind safelist side-effect for shipping-mode color utilities. * * WHY this file exists: JIT/content scanning only keeps class names that appear * as *literal strings* in scanned sources. {@link ModeColorService} already * returns these literals, but keeping a dedicated comment list makes the * contract obvious for consumers who configure `safelist` or purge plugins. * * Do not rename these strings without updating ModeColorService and THEME.md. * * SFN (export / green): * text-export-strong bg-export-strong hover:bg-export-hover border-export-strong * text-export bg-export bg-export-subtle bg-export-light border-export * hover:bg-export-light hover:bg-export-subtle dark:bg-export/15 dark:hover:bg-export/15 * dark:bg-[color-mix(in_srgb,#26bd5d_15%,#212529)] dark:bg-export dark:text-export dark:border-export * * STN (import / orange): * text-import-strong bg-import-strong hover:bg-import-hover border-import-strong * text-import bg-import bg-import-subtle bg-import-light border-import * hover:bg-import-light hover:bg-import-subtle dark:bg-import/15 dark:hover:bg-import/15 * dark:bg-[color-mix(in_srgb,#f08829_15%,#212529)] dark:bg-import dark:text-import dark:border-import */ declare const MODE_COLOR_SAFELIST: readonly ["text-export", "text-export-strong", "bg-export", "bg-export-strong", "bg-export-subtle", "bg-export-light", "border-export", "border-export-strong", "hover:bg-export-hover", "hover:bg-export-light", "hover:bg-export-subtle", "dark:bg-export/15", "dark:hover:bg-export/15", "dark:hover:bg-export-light", "dark:bg-[color-mix(in_srgb,#26bd5d_15%,#212529)]", "dark:bg-export", "dark:text-export", "dark:border-export", "text-import", "text-import-strong", "bg-import", "bg-import-strong", "bg-import-subtle", "bg-import-light", "border-import", "border-import-strong", "hover:bg-import-hover", "hover:bg-import-light", "hover:bg-import-subtle", "dark:bg-import/15", "dark:hover:bg-import/15", "dark:hover:bg-import-light", "dark:bg-[color-mix(in_srgb,#f08829_15%,#212529)]", "dark:bg-import", "dark:text-import", "dark:border-import"]; /** * Tailwind class bundle for the active shipping mode (SFN export / STN import). * * Use these for **primary** product chrome: CTAs, selected controls, progress, * and accent text. Semantic colors (danger / warning) stay mode-independent. */ interface ModeColorClasses { /** * Accessible accent text — mode brand color in light and dark. */ text: string; /** Solid background utility, e.g. `bg-export`. */ bg: string; /** Soft background utility, e.g. `bg-export-subtle`. */ bgSubtle: string; /** Border matching the mode accent, e.g. `border-export`. */ border: string; /** * Filled primary CTA — `variant="primary"` on buttons. * Includes hover utility as a literal so Tailwind keeps it. */ primary: string; /** * Transparent / text-only CTA — `variant="ghost-primary"` on buttons. * Mode accent text + soft hover fill. */ ghostPrimary: string; /** * Soft highlight for selected / active rows (works in dark mode). * Dark uses a translucent tint — fine over solid surfaces, not for * sticky overlays (see {@link softSolid}). */ soft: string; /** * Opaque soft fill — same tint as {@link soft}, but dark mode mixes into * ink so scrolled content cannot show through (sticky table headers/cells). */ softSolid: string; /** * Soft hover highlight for menus and lists. */ softHover: string; /** * Active nav leaf / collapsed rail — solid mode fill + white text. */ activeFill: string; /** * Stroked secondary CTA — white fill, mode border + text (portal `.btn-stroked`). */ stroked: string; } /** * Maps {@link ShippingModeService} to mode-accent Tailwind classes. * * - **SFN** → export green is primary * - **STN** → import orange is primary * * WHY literal class strings: Tailwind's scanner cannot see dynamically built * names like `` `text-${token}` ``. Returning full literals (`text-export`, …) * keeps utilities in the compiled CSS. See {@link MODE_COLOR_SAFELIST}. * * @example * ```html * @let colors = modeColor.classes(); * * Mode accent * ``` */ declare class ModeColorService { private readonly shippingMode; /** * Mode-dependent utility classes. Recomputes when shipping mode changes. */ readonly classes: i0.Signal; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } /** * Supported UI color schemes for {@link ThemeService}. * * Kept as a closed string union so storage values and DOM class toggles stay * aligned — unknown persisted strings are ignored and fall back to system * preference / light. */ type Theme = 'light' | 'dark'; /** * Application light/dark theme preference. * * WHY signals (not BehaviorSubject): theme is synchronous UI state read from * templates and other services; a signal avoids RxJS subscription boilerplate * and matches Angular 22 change detection. Persistence goes through * {@link STORAGE_TOKEN} so tests can swap storage without touching `localStorage`. * * Applies the Tailwind `darkMode: 'class'` contract by toggling `dark` on * `document.documentElement`, and sets `color-scheme` so native UI (date * pickers, scrollbars, form controls) matches the app theme — class-based * dark mode alone does not restyle browser chrome. * * @example * ```ts * // app.config.ts * import { inject, provideAppInitializer } from '@angular/core'; * import { ThemeService } from '@africanies/africanies-theme'; * * export const appConfig = { * providers: [ * provideAppInitializer(() => { * inject(ThemeService); // applies stored / system theme once * }), * ], * }; * * // In a component * const theme = inject(ThemeService); * theme.toggle(); * theme.setTheme('dark'); * const current = theme.theme(); // 'light' | 'dark' * ``` */ declare class ThemeService { private readonly storage; private readonly document; /** * Current theme. Prefer reading via `theme()` in templates / computed values * rather than caching the string, so dark-class consumers stay in sync. */ readonly theme: i0.WritableSignal; constructor(); /** * Sets and persists the theme, updating the `dark` class and `color-scheme` * on ``. * * @param theme - Absolute preference to store. */ setTheme(theme: Theme): void; /** * Flips between light and dark. * * @returns The theme after the toggle. */ toggle(): Theme; private resolveInitialTheme; private prefersDark; private applyToDocument; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export { MODE_COLOR_SAFELIST, ModeColorService, ThemeService }; export type { ModeColorClasses, Theme };