learning_ai_common_plat/packages/design-tokens
saravanakumardb1 cc0bffea86 feat(packages): close ROADMAP TODOs #1, #2, #3 — density tier, react-auth fix, routePrefix
Three coordinated package changes addressing Wave 1 cross-repo TODOs
from the UI/UX roadmap (learning_ai_uxui_web/docs/ROADMAP_2026.md §10).

═══════════════════════════════════════════════════════════════════════
TODO #2 — @bytelyst/react-auth bump 0.1.8 → 0.2.0
═══════════════════════════════════════════════════════════════════════
  - Changes 'workspace:*' to 'workspace:^' for the @bytelyst/api-client
    dependency. On pnpm publish this resolves to a caret range (e.g.
    ^0.1.6) instead of '*', restoring installability for consumers.
    (The 0.1.6 tarball was published with a literal 'workspace:*'
    string — newer minor bump unblocks the showcase react-auth demo.)
  - 21 tests still passing.

═══════════════════════════════════════════════════════════════════════
TODO #3 — @bytelyst/dashboard-shell bump 0.1.7 → 0.2.0
═══════════════════════════════════════════════════════════════════════
  - Adds 'routePrefix?: string' prop to DashboardShellProps, SidebarProps,
    and TopBarProps. Threads through DashboardShell → Sidebar + TopBar.
  - Built-in /profile, /billing, /settings links now use the prefix:
      routePrefix="/app" → /app/profile, /app/billing, /app/settings
  - Defaults to '' (empty string) — fully back-compat with 0.1.x callers.
  - 2 new vitest cases covering both prefixed and default behavior;
    43 / 43 tests passing (+2 from 41).

═══════════════════════════════════════════════════════════════════════
TODO #1 — @bytelyst/design-tokens bump 0.1.8 → 0.2.0
═══════════════════════════════════════════════════════════════════════
  - Adds a density-aware spacing tier on top of the existing raw
    --ml-space-* tier:
        --bl-space-scale: 1                       (default :root)
        --bl-space-1..16: calc(--ml-space-N × --bl-space-scale)
  - Emits density selectors at the end of tokens.css:
        [data-density="compact"]    { --bl-space-scale: 0.875; }
        [data-density="comfortable"] { --bl-space-scale: 1; }
        [data-density="spacious"]   { --bl-space-scale: 1.125; }
  - Generator (scripts/generate.ts) emits both tiers automatically; the
    auto-generated per-product CSS files (lysnrai, mindlyst, etc.) gain
    a single blank-line diff from regeneration — no semantic change.
  - 11 / 11 token tests passing.

═══════════════════════════════════════════════════════════════════════
Decision doc — docs/ROADMAP_2026_DECISIONS.md
═══════════════════════════════════════════════════════════════════════
  - Records pragmatic defaults for TODO ledger items #9–#13 so
    implementation work doesn't block:
      #9  Storybook hosting → self-hosted on Gitea Pages (free)
      #10 useChat protocol  → adopt Vercel AI SDK shape, abstract transport
      #11 react-auth fold-in → defer to Wave 7
      #12 dashboard-shell merge → defer to Wave 7
      #13 mobile-native UI → out of scope (tokens-only sharing)
  - Each decision is reversible via RFC.

═══════════════════════════════════════════════════════════════════════
Publish flow
═══════════════════════════════════════════════════════════════════════
  These three packages now require a release. The existing publish
  workflow (.gitea/workflows/publish-packages.yml) has PACKAGE_FILTER
  pinned to @bytelyst/errors and won't pick them up automatically — a
  manual workflow_dispatch with a broader filter (or the existing
  publish-all-packages.yml on workflow_dispatch) is needed to ship
  0.2.0 to the Gitea npm registry.

Refs: learning_ai_uxui_web/docs/ROADMAP_2026.md §10 TODOs #1, #2, #3, #9–#13
2026-05-27 11:49:20 -07:00
..
generated feat(packages): close ROADMAP TODOs #1, #2, #3 — density tier, react-auth fix, routePrefix 2026-05-27 11:49:20 -07:00
scripts feat(packages): close ROADMAP TODOs #1, #2, #3 — density tier, react-auth fix, routePrefix 2026-05-27 11:49:20 -07:00
src feat: add package tests (58 new) + @bytelyst/fastify-core package 2026-02-12 22:17:17 -08:00
tokens feat(design-tokens): add actiontrail, notelett, localmemgpt, localllmlab product palettes 2026-03-27 16:23:13 -07:00
bytelyst-design-tokens-0.1.0.tgz chore: update chat history archive + design-tokens tarball 2026-03-31 01:42:48 -07:00
package.json feat(packages): close ROADMAP TODOs #1, #2, #3 — density tier, react-auth fix, routePrefix 2026-05-27 11:49:20 -07:00
README.md docs: design system audit, onboarding guide, and AGENTS.md updates 2026-03-03 21:55:02 -08:00
tsconfig.json feat(design-tokens): add @bytelyst/design-tokens package 2026-02-12 11:22:52 -08:00

@bytelyst/design-tokens

ByteLyst cross-platform design system tokens. Single source of truth for colors, typography, spacing, and more across Web, iOS, Android/KMP, and React Native.

Quick Start

Install

# This is a workspace package - use from source
# Copy generated files to your project

Generate Tokens

# From the monorepo root
pnpm --filter @bytelyst/design-tokens generate

This regenerates all platform outputs from tokens/bytelyst.tokens.json.


Token Structure

Color Tokens

Token Path Example Value Usage
color.semantic.dark.bgCanvas #06070A Dark mode background
color.semantic.dark.accentPrimary #5A8CFF Primary brand color
color.semantic.light.surfaceCard #FFFFFF Light mode card background
color.nomgap.stageKetosis #5A8CFF Product-specific color

Typography Tokens

Token Path Value CSS Output
typography.fontFamily.display 'Space Grotesk' --ml-font-display
typography.fontSize.lg 18 --ml-fs-lg: 18px
typography.fontWeight.semibold 600

Spacing Tokens (8pt Grid)

Token Value CSS
spacing.1 4 --ml-space-1: 4px
spacing.4 16 --ml-space-4: 16px
spacing.8 32 --ml-space-8: 32px

Elevation Tokens

Token CSS Output
elevation.sm --ml-elevation-sm: 0 4px 12px rgba(0,0,0,0.12)
elevation.md --ml-elevation-md: 0 12px 28px rgba(0,0,0,0.18)

Platform Usage

Web (CSS)

/* Import the CSS file */
@import '@bytelyst/design-tokens/generated/tokens.css';

/* Use tokens */
.my-component {
  background-color: var(--ml-bg-canvas);
  color: var(--ml-text-primary);
  padding: var(--ml-space-4);
  border-radius: var(--ml-radius-md);
  box-shadow: var(--ml-elevation-sm);
  font-family: var(--ml-font-display);
  font-size: var(--ml-fs-lg);
}

With Tailwind CSS

<!-- Use arbitrary values with CSS variables -->
<div class="bg-[var(--ml-bg-canvas)] text-[var(--ml-text-primary)] p-[var(--ml-space-4)]">
  Content
</div>

Web (TypeScript)

import { tokens } from '@bytelyst/design-tokens/generated/tokens';

// Access any token programmatically
const primaryColor = tokens.color.semantic.dark.accentPrimary;
const fontSize = tokens.typography.fontSize.lg;

iOS (SwiftUI)

import SwiftUI

// Copy MindLystTheme.swift to your project
// Rename to YourProductTheme.swift

struct MyView: View {
    var body: some View {
        Text("Hello")
            .foregroundColor(ProductColors.darkTextPrimary)
            .background(ProductColors.darkBgCanvas)
            .font(.system(size: ProductSpacing.x4))
    }
}

Android/KMP (Kotlin + Compose)

import com.mindlyst.shared.theme.MindLystTokens

@Composable
fun MyComponent() {
    Box(
        modifier = Modifier
            .background(Color(MindLystTokens.Dark.BG_CANVAS))
            .padding(MindLystTokens.Spacing.X4.dp)
    ) {
        Text(
            text = "Hello",
            color = Color(MindLystTokens.Dark.TEXT_PRIMARY),
            fontSize = MindLystTokens.Typography.SIZE_LG.sp
        )
    }
}

React Native (Expo)

import { tokens } from '@bytelyst/design-tokens/generated/react-native/tokens';
import { StyleSheet } from 'react-native';

const styles = StyleSheet.create({
  container: {
    backgroundColor: tokens.colors.bgCanvas,
    padding: tokens.spacing['4'],
    borderRadius: tokens.radius.md,
  },
  text: {
    color: tokens.colors.textPrimary,
    fontSize: tokens.typography.fontSize.lg,
  },
});

Product-Specific Tokens

Each product has dedicated color tokens:

{
  "color": {
    "nomgap": {
      "stageFed": "#FF9F43",
      "stageKetosis": "#5A8CFF",
      "autophagyMeter": "#5AE68C"
    },
    "chronomind": {
      "urgencyCritical": "#FF6E6E",
      "focusMode": "#7C6BFF"
    },
    "peakpulse": {
      "activityHike": "#34D399",
      "speedZoneFast": "#FFD166"
    }
  }
}

Validation & Compliance

Check for Hardcoded Colors

# From your product repo
node ../learning_ai_common_plat/packages/design-tokens/scripts/validate-tokens.cjs src/

This scans for #RRGGBB, rgb(), rgba(), and hsl() patterns.

Get Token Coverage Report

# From your product repo
node ../learning_ai_common_plat/packages/design-tokens/scripts/token-coverage.cjs src/

Reports:

  • Percentage of files using tokens
  • Number of hardcoded colors found
  • Token adoption rate

CI Integration

GitHub Actions Example

- name: Check for hardcoded colors
  run: |
    node ../../learning_ai_common_plat/packages/design-tokens/scripts/validate-tokens.cjs src/
    if [ $? -ne 0 ]; then
      echo "❌ Hardcoded colors found. Use design tokens instead."
      exit 1
    fi    

Pre-commit Hook

# .husky/pre-commit or .git/hooks/pre-commit
node packages/design-tokens/scripts/validate-tokens.cjs src/ || true

Token Categories (v1.1.0)

Category Count Description
Color 80+ Palette, semantic (dark/light), product-specific
Typography 20+ Font families, sizes, weights, line heights
Spacing 13 8pt grid (0-64px)
Radius 6 Corner radii (xs to pill)
Elevation 4 Shadow depths
Motion 7 Durations, easings
Z-Index 9 Layer stacking
Icon 6 Icon sizes
Grid 12 12-column system
Opacity 11 Alpha values

Version History

Version Date Changes
1.1.0 2026-03-03 Added product tokens (PeakPulse, ChronoMind, NomGap, LysnrAI), z-index, icon sizes, grid, opacity
1.0.0 2026-02-12 Initial release with color, typography, spacing, radius, elevation, motion

Contributing

  1. Edit tokens/bytelyst.tokens.json (canonical source)
  2. Run pnpm generate to regenerate outputs
  3. Copy generated files to consumer repos
  4. Commit both source and generated files

Never edit generated files directly — they will be overwritten.


See Also