import { Component } from '@angular/core'; import { DemoSectionComponent } from '../shared/demo-section.component'; import { PageHeaderComponent } from '../shared/page-header.component'; import { TOKENS_CORE, TOKENS_EXPORT, TOKENS_FEEDBACK, TOKENS_IMPORT, TOKENS_MODE_ACCENTS, TOKENS_NEUTRAL, TOKENS_SETUP, TOKENS_TYPE, } from '../snippets'; interface TokenSwatch { name: string; bgClass: string; hex: string; group: string; } /** * Design token catalog — Tailwind preset colors, typography scale, and mode accents. */ @Component({ selector: 'app-tokens-page', standalone: true, imports: [PageHeaderComponent, DemoSectionComponent], template: `

Extend the AFRICANIES theme preset and scan both your app sources and the published @africanies/africanies-ui bundle so JIT keeps classes used inside the library.

@for (group of groups; track group) {
@for (token of colorsIn(group); track token.name) {

{{ token.name }}

{{ token.hex }}

}
}
  • heading-1 · 2.5rem / 700

    Ship across continents

  • heading-2 · 2rem / 700

    Shipment details

  • heading-3 · 1.5rem / 600

    Cargo summary

  • body-lg

    Supporting sentence for denser marketing or empty states.

  • body

    Default reading size for forms, tables, and dialogs.

  • body-sm

    Secondary copy and dense metadata.

  • caption

    Hints, timestamps, and chip labels.

The color grids above show raw tokens. These cards show the same export (SFN green) and import (STN orange) families applied to panels — the way mode accents appear in product UI. Switch shipping mode in the sidebar header and compare with primary buttons elsewhere.

SFN / export

Lagos outbound

Uses export green tokens.

STN / import

US inbound

Uses import orange tokens.

`, }) export class TokensPage { protected readonly groups = [ 'Core', 'Neutral', 'Export (SFN)', 'Import (STN)', 'Feedback', ]; protected readonly setupCode = TOKENS_SETUP; protected readonly typeCode = TOKENS_TYPE; protected readonly modeAccentsCode = TOKENS_MODE_ACCENTS; protected readonly groupCode: Record = { Core: TOKENS_CORE, Neutral: TOKENS_NEUTRAL, 'Export (SFN)': TOKENS_EXPORT, 'Import (STN)': TOKENS_IMPORT, Feedback: TOKENS_FEEDBACK, }; protected codeForGroup(group: string): string { return this.groupCode[group] ?? this.setupCode; } protected readonly colors: TokenSwatch[] = [ { name: 'black', bgClass: 'bg-black', hex: '#000000', group: 'Core' }, { name: 'white', bgClass: 'bg-white', hex: '#ffffff', group: 'Core' }, { name: 'ink', bgClass: 'bg-ink', hex: '#172033', group: 'Core' }, { name: 'ink-blue', bgClass: 'bg-ink-blue', hex: '#192a3e', group: 'Core' }, { name: 'ink-brand', bgClass: 'bg-ink-brand', hex: '#172033', group: 'Core' }, { name: 'ink-surface', bgClass: 'bg-ink-surface', hex: '#212529', group: 'Core' }, { name: 'ink-950', bgClass: 'bg-ink-950', hex: '#272729', group: 'Core' }, { name: 'surface', bgClass: 'bg-surface', hex: '#ffffff', group: 'Neutral' }, { name: 'neutral-500', bgClass: 'bg-neutral-500', hex: '#667185', group: 'Neutral' }, { name: 'neutral-600', bgClass: 'bg-neutral-600', hex: '#526071', group: 'Neutral' }, { name: 'border', bgClass: 'bg-border', hex: '#dde3ea', group: 'Neutral' }, { name: 'border-strong', bgClass: 'bg-border-strong', hex: '#c4cdd8', group: 'Neutral' }, { name: 'control', bgClass: 'bg-control', hex: '#8793a3', group: 'Neutral' }, { name: 'focus', bgClass: 'bg-focus', hex: '#175cd3', group: 'Neutral' }, { name: 'background-chrome', bgClass: 'bg-background-chrome', hex: '#f4f6f8', group: 'Neutral', }, { name: 'background-well', bgClass: 'bg-background-well', hex: '#eef2f6', group: 'Neutral', }, { name: 'background-welcome', bgClass: 'bg-background-welcome', hex: '#f8fafc', group: 'Neutral', }, { name: 'export', bgClass: 'bg-export', hex: '#26bd5d', group: 'Export (SFN)' }, { name: 'export-strong', bgClass: 'bg-export-strong', hex: '#0b7a3e', group: 'Export (SFN)' }, { name: 'export-light', bgClass: 'bg-export-light', hex: '#24dc6d', group: 'Export (SFN)' }, { name: 'export-subtle', bgClass: 'bg-export-subtle', hex: '#e4fff3', group: 'Export (SFN)' }, { name: 'import', bgClass: 'bg-import', hex: '#f08829', group: 'Import (STN)' }, { name: 'import-strong', bgClass: 'bg-import-strong', hex: '#f08829', group: 'Import (STN)' }, { name: 'import-light', bgClass: 'bg-import-light', hex: '#ffa95b', group: 'Import (STN)' }, { name: 'import-subtle', bgClass: 'bg-import-subtle', hex: '#fffcef', group: 'Import (STN)' }, { name: 'danger', bgClass: 'bg-danger', hex: '#ff001c', group: 'Feedback' }, { name: 'danger-dark', bgClass: 'bg-danger-dark', hex: '#b4233c', group: 'Feedback' }, { name: 'danger-strong', bgClass: 'bg-danger-strong', hex: '#C00B19', group: 'Feedback' }, { name: 'danger-subtle', bgClass: 'bg-danger-subtle', hex: '#FFF2F2', group: 'Feedback' }, { name: 'warning', bgClass: 'bg-warning', hex: '#DBB316', group: 'Feedback' }, { name: 'warning-dark', bgClass: 'bg-warning-dark', hex: '#8a5a00', group: 'Feedback' }, { name: 'warning-subtle', bgClass: 'bg-warning-subtle', hex: '#FFF6E6', group: 'Feedback' }, { name: 'info', bgClass: 'bg-info', hex: '#175cd3', group: 'Feedback' }, ]; protected colorsIn(group: string): TokenSwatch[] { return this.colors.filter((c) => c.group === group); } protected countIn(group: string): number { return this.colorsIn(group).length; } }