Skip to main content

Design System

Bilko Design System Documentation

Project:Source: {{PROJECT_NAME}}Extracted from apps/web/tailwind.config.ts + brand identity spec Version:Design Language: {{VERSION}}Modern Date:Balkan {{DATE}}accounting Author:SaaS {{AUTHOR}} Status:clean, Draftprofessional, | In Review | Approved Reviewers: {{REVIEWERS}}accessible

Document History

VersionDateAuthorChanges
0.1{{DATE}}{{AUTHOR}}Initial draft

1.Color Design PrinciplesPalette

Primary Brand
PrincipleDescription
Clarity firstEvery UI element must communicate its purpose without explanation
Consistent over cleverPrefer familiar patterns over novel interactions
Accessible by defaultWCAG AA compliance is a baseline, not a feature
Density-awareSupport comfortable and compact density modes
TODO: Add principle{{DESCRIPTION}}

2. Color System

2.1 Primitive Palette (Raw Values)Colors

/*Primary:        Brand#00E5A0  primitives(Vibrant teal-greendoprimary NOTCTA, uselinks, directlyactive instates)
componentsPrimary */Dark:   --color-brand-50:#00B380  {{#F0F9FF}};(Darker --color-brand-100:variant {{#E0F2FE}};for --color-brand-500:hover {{#0EA5E9}};states)
--color-brand-600:Primary {{#0284C7}};Light:  --color-brand-900:#33EBB3  {{#0C4A6E}};(Lighter --color-neutral-0:variant #FFFFFF;for --color-neutral-50:  {{#F8FAFC}};
--color-neutral-100: {{#F1F5F9}};
--color-neutral-400: {{#94A3B8}};
--color-neutral-700: {{#334155}};
--color-neutral-900: {{#0F172A}};
--color-neutral-1000: #000000;backgrounds)

2.2Status Semantic Tokens (Light Mode)Colors

/*Success:        Background#22C55E  */(Green --color-bg-primary: var(--color-neutral-0);success --color-bg-secondary:states, var(--color-neutral-50);paid --color-bg-elevated:invoices, var(--color-neutral-0);positive /*metrics)
TextWarning:        */#F59E0B  --color-text-primary:(Amber var(--color-neutral-900); --color-text-secondary:warnings, var(--color-neutral-700);pending --color-text-disabled:items, var(--color-neutral-400);aging --color-text-inverse:invoices)
var(--color-neutral-0);Error:          /*#EF4444  Interactive(Red */ --color-interactive-primary:errors, var(--color-brand-500);overdue --color-interactive-primary-hover:invoices, var(--color-brand-600);negative --color-interactive-primary-active:actions)
var(--color-brand-700);Info:           /*#3B82F6  Semantic(Blue */ --color-success:informational {{#10B981}};messages, --color-warning:neutral {{#F59E0B}};
--color-error:    {{#EF4444}};
--color-info:     {{#3B82F6}};data)

2.3Text Semantic Tokens (Dark Mode)Colors

[data-theme="dark"]Text {Primary:   --color-bg-primary:#111113  var(--color-neutral-900);(Near-black --color-bg-secondary: var(--color-neutral-800);body --color-text-primary:text, var(--color-neutral-50);headings)
/*Text TODO:Secondary: Complete#6B7280  dark(Gray-600 mode tokensecondary mappingtext, */labels)
}Text Muted:     #888888  (Gray-500 — muted text, placeholders)

2.4Background ContrastColors

Ratios
Background Light:   #FAFAFA  (WCAG)Off-white — main content area background)
Background Surface: #FFFFFF  (White — card backgrounds, modals)

Border Color

Border:         
Gray-200 Green revenue bars/lines) Chart background

Typography

Font

Family labels) base: 16px (Body text, default) emphasized text) xl: 20px (Section titles) (Emphasis, table headers) semibold: 600
PairRatioWCAG AA#E5E7EB (4.5:1)WCAG AAAborders, dividers)

Chart Colors

Chart Revenue:  #22C55E  (7:1)
Expense: #EF4444 (Red — expense bars/lines) Chart Profit: #3B82F6 (Blue — profit bars/lines) Chart Neutral: #6B7280 (Gray — neutral data points)

Sidebar Colors (Dark Theme)

Sidebar BG:         #111113  (Near-black — sidebar background)
Sidebar Text:       #FAFAFA  (Off-white — sidebar text)
Sidebar Text primaryMuted: #888888  (Gray — inactive menu items)
Sidebar Active:     #00E5A0  (Primary green — active menu item)
Sidebar Hover:      #1F1F23  (Slightly lighter black — hover state)

Usage:

  • Sidebar = dark (#111113) with light text
  • Content area = light (#FAFAFA) with dark text
  • Cards = white (#FFFFFF) surface on bglight primary
{{X:1}} {{Pass/Fail}} {{Pass/Fail}}
Text
Sans Serif: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif

Source: Google Fonts Inter (variable font) Fallback: System UI fonts for performance

Font Sizes

xs:   12px  (Small badges, captions)
sm:   14px  (Table cells, secondary ontext, bgform primary
{{X:1}}{{Pass/Fail}}{{Pass/Fail}}
Interactivelg: on18px bg(Subheadings, primary{{X:1}}{{Pass/Fail}}{{Pass/Fail}}
White2xl: on24px brand-(Card titles, small headings) 3xl: 32px (Page headings) 4xl: 40px (Hero text, large numbers)

Font Weights

normal:    400  (Body text)
medium:    500
{{X:1}}{{Pass/Fail}}{{Pass/Fail}}
(Subheadings, button text) bold: 700 (Headings, metric numbers)

Type Scale Usage

  • Headings:
    • Page title: text-3xl font-bold (32px, 700)
    • Section title: text-2xl font-bold (24px, 700)
    • Card title: text-base font-semibold (16px, 600)
  • Body:
    • Default: text-base font-normal (16px, 400)
    • Table cells: text-sm font-medium (14px, 500)
    • Muted text: text-sm text-text-muted (14px, #888888)
  • Numbers:
    • Metrics: text-3xl font-bold (32px, 700)
    • Totals: text-2xl font-bold (24px, 700)
    • Amounts: text-base font-medium (16px, 500)

Spacing System (8px Grid)

xs:  4px   (Tight spacing, icon gaps)
sm:  8px   (Input padding, small gaps)
md:  16px  (Default spacing, card padding)
lg:  24px  (Section spacing)
xl:  32px  (Large section spacing)
2xl: 48px  (Major section breaks)
3xl: 64px  (Hero spacing)

TODO:Usage:

  • Card padding: p-6 (24px)
  • Form field gap: space-y-4 (16px)
  • Section spacing: space-y-6 (24px)
  • Grid gap: gap-6 (24px)

Consistency: RunAll contrastspacing checksuses with8px {{axeincrements |(4px, Colour8px, Contrast16px, Analyser}}24px, and32px, fill48px, table.64px)


3.Border TypographyRadius

sm:   

3.16px Font(Small Families

elements, badges)md:8px(Buttons,inputs,cards)lg:12px(Modals,large
Token Value Usage
--font-headingcards) full: 9999px (Circular elements, pills) {{Inter, sans-serif}}H1–H4, display text
--font-body{{Inter, sans-serif}}Body copy, labels, UI
--font-mono{{JetBrains Mono, monospace}}Code, technical data

3.2 Type Scale

TokenSizeWeightLine HeightLetter SpacingUsage
--text-display48px7001.1-0.02emHero headings
--text-h136px7001.2-0.01emPage titles
--text-h228px6001.25-0.01emSection headings
--text-h322px6001.30Subsections
--text-h418px6001.40Card headings
--text-body-lg18px4001.60Lead paragraphs
--text-body16px4001.60Default body copy
--text-body-sm14px4001.50Secondary text, captions
--text-label14px5001.40.01emForm labels, UI labels
--text-caption12px4001.40.02emTimestamps, meta
--text-code14px4001.60Inline code

TODO:Usage:

  • Cards: rounded-md (8px)
  • Buttons: rounded-md (8px)
  • Inputs: rounded-md (8px)
  • Badges: rounded-sm (6px)
  • User avatar: rounded-full (circular)

Shadows

Card Shadow:     0 2px 8px rgba(0, 0, 0, 0.08)   (Subtle card elevation)
Modal Shadow:    0 8px 24px rgba(0, 0, 0, 0.12)  (Dialog/modal elevation)
Dropdown Shadow: 0 4px 16px rgba(0, 0, 0, 0.10)  (Dropdown menu elevation)

Usage:

  • Cards: shadow-card
  • Modals/dialogs: shadow-modal
  • Dropdown menus: shadow-dropdown

Philosophy: VerifySubtle scaleshadows againstfor Figmadepth, avoid updateheavy valuesshadows if(material mismatched.design style)


4. Spacing & LayoutBreakpoints

sm:  

4.640px (Small tablets, large phones) md: 768px (Tablets) lg: 1024px (Small desktops, large tablets) xl: 1280px (Desktops)

Mobile-First Strategy:

  • Base styles = mobile (< 640px)
  • sm: = small tablet (640px+)
  • md: = tablet/desktop toggle (768px+)
  • lg: = desktop layout (1024px+)
  • xl: = wide desktop (1280px+)

Responsive Patterns:

  • Grid: grid-cols-1 Spacingmd:grid-cols-2 Scalelg:grid-cols-3
  • Sidebar: hidden md:block (4pxhide Baseon Unit)mobile)
  • Filters:
  • flex-col stack on mobile, row on
    TokenValueUsage
    --space-0sm:flex-row0px
    --space-14pxMicro gaps, icon padding
    --space-28pxTight inline spacing
    --space-312pxCompact form elements
    --space-416pxDefault content spacing
    --space-520pxCard padding (compact)
    --space-624pxCardtablet+) padding, section padding
    --space-832pxLarge section gaps
    --space-1040pxFeature section padding
    --space-1248pxSection separation
    --space-1664pxPage-level padding
    --space-2080pxHero sections

    4.2 Grid System

    PropertyValue
    Column count12
    Column gutter24px (mobile: 16px)
    Container max-width1280px
    Container side padding24px (mobile: 16px)

    4.3 Responsive Breakpoints

    NameMin WidthTarget Devices
    xs0pxSmall phones
    sm480pxLarge phones
    md768pxTablets
    lg1024pxSmall laptops
    xl1280pxDesktops
    2xl1536pxLarge displays

5. Component LibraryTokens

Button

5.1
    Primitive
  • Height: Components40px (Atoms)

default),
ComponentStatusVariantsStorybook
Button`{{DoneWIPPlanned}}`
Input`{{DoneWIPPlanned}}`
Select`{{DoneWIPPlanned}}`
Checkbox`{{DoneWIPPlanned}}`
Radio`{{DoneWIPPlanned}}`
Toggle/Switch`{{DoneWIPPlanned}}`
Textarea`{{DoneWIPPlanned}}`
Badge`{{DoneWIPPlanned}}`
Avatar`{{DoneWIPPlanned}}`
Tooltip`{{DoneWIPPlanned}}`
Spinner`{{DoneWIPPlanned}}`
Divider`{{DoneWIPPlanned}}`

5.2 Composite Components32px (Molecules)

sm),
ComponentStatusStorybook
Card{{Status}}{{URL}}
Modal / Dialog{{Status}}{{URL}}
Dropdown Menu{{Status}}{{URL}}
Table{{Status}}{{URL}}
Pagination{{Status}}{{URL}}
Toast / Notification{{Status}}{{URL}}
Form Field48px (labellg), + input + error){{Status}}{{URL}}
Search Bar{{Status}}{{URL}}
Breadcrumb{{Status}}{{URL}}
Tabs{{Status}}{{URL}}
Accordion{{Status}}{{URL}}
Date Picker{{Status}}{{URL}}

5.3 Layout Components

ComponentDescription
ContainerMax-width wrapper with responsive padding
StackVertical flex stack with configurable gap
InlineHorizontal flex row with configurable gap/alignment
GridCSS grid layout wrapper
PageLayoutFull-page layout with sidebar/header/main/footer slots
SectionContent section with standard vertical rhythm

6. Iconography Guidelines

(default), sm)
  • Font:
  • 12px
  • Variants:
  • Success:
  • Greenbackground
  • Warning:
  • nosemanticmeaning)

    Chart

    Primarygreen(#00E5A0)ring
  • Proper
  • headinghierarchy
    ItemStandard
    Library`{{Lucide React
    DeliveryInline SVG via component40px (noicon) sprite,
  • Padding: no16px iconhorizontal font)
  • Sizes16px12px (sm), 20px (md,lg)
  • Border Radius: 8px (md)
  • Font: 14px medium (default), 12px (sm), 16px (lg)
  • Variants:
    • Default: Primary green background, white text
    • Outline: Border only, transparent background
    • Ghost: No border, no background, hover shows background
    • Destructive: Error red background, white text
  • Input

    • Height: 40px
    • Padding: 12px horizontal
    • Border: 1px solid #E5E7EB (border color)
    • Border Radius: 8px (md)
    • Font: 14px normal
    • Focus: Primary color ring (2px)

    Card

    • Background: #FFFFFF (surface)
    • Border: 1px solid #E5E7EB
    • Border Radius: 8px (md)
    • Shadow: 0 2px 8px rgba(0, 0, 0, 0.08)
    • Padding: 24px (lg),default 32pxcontent padding)

    Badge

    • Padding: 4px 8px
    • Border Radius: 6px (xl)
    Strokemedium width1.5px
      at
    • Default: 24px,Gray scaledbackground
    • proportionally
    ColorInheritsAmber background
  • Destructive: Red background
  • Secondary: Light gray
  • Table

    • Row Height: 48px (default)
    • Cell Padding: 12px horizontal, 16px vertical
    • Border: 1px solid #E5E7EB (between rows)
    • Hover: Light gray background (#FAFAFA)
    • Header: Medium font weight, secondary text color

    Icon System

    Library: Lucide React (v0.469.0) Size: Consistent 16px (currentColorw-4 h-4) or 20px (w-5 h-5) Usage:

    • Buttons: 16px icon + 8px gap from text
    • Menu items: 20px icon + 12px gap from text
    • Standalone: 24px or larger

    Common Icons:

    • Plus (add actions)
    • Search (search inputs)
    • Menu (mobile sidebar toggle)
    • User (user menu)
    • Bell (notifications)
    • ChevronDown/Right (expandable sections)
    • Check (success, reconciliation)
    • X (close, delete)
    • Download (export actions)
    • Send (send email)

    Chart Design Tokens

    Chart Colors (Recharts)

    Revenue:  #22C55E  (Green bars)
    Expense:  #EF4444  (Red bars)
    Profit:   #3B82F6  (Blue bars)
    Neutral:  #6B7280  (Grayneverwhen hardcoded
    Interactive iconsMustTypography
    • Axis Labels: 12px normal
    • Tooltip: 14px medium
    • Legend: 12px normal

    Chart Layout

    • Responsive Container: 100% width, fixed height (250px default)
    • Cartesian Grid: Dashed, #E5E7EB stroke
    • Tooltip Background: White with border
    • Border Radius: 8px (md)

    Accessibility

    Color Contrast

    • All text colors meet WCAG AA standards
    • Primary text (#111113) on white = 16.17:1 (AAA)
    • Secondary text (#6B7280) on white = 4.69:1 (AA)
    • Primary green (#00E5A0) on white = 2.92:1 (fails — used for accents only, not body text)

    Focus Indicators

    • All interactive elements have visible focus ring
    • +
    • Focus 44×44pxring touchcolor: target
    Custom
  • Focus icons
  • SVGwidth: optimized2px via SVGO,

    Semantic placedHTML

    in
      src/components/icons/
    (h1

    Accessibility rule:h2 Icons conveyingh3) meaning

  • Form mustlabels haveproperly aria-label.associated Decorativewith icons:inputs
  • aria-hidden="true".

  • ARIA labels on icon-only buttons
  • Table headers properly scoped

  • 7. Motion & Animation Standards

    7.1 Duration Tokens

    TokenValueUsage
    --duration-instant50msMicro-feedback (checkbox check)
    --duration-fast100msButton states, hover
    --duration-normal200msModals, dropdowns
    --duration-slow300msPage transitions, large panels
    --duration-slower500msOnboarding, loading states

    7.2 Easing Tokens

    TokenValueUsage
    --ease-defaultcubic-bezier(0.4, 0, 0.2, 1)General UI
    --ease-entercubic-bezier(0, 0, 0.2, 1)Elements entering
    --ease-exitcubic-bezier(0.4, 0, 1, 1)Elements leaving
    --ease-springcubic-bezier(0.34, 1.56, 0.64, 1)Playful, emphasis

    7.3 Reduced Motion

    @media (prefers-reduced-motion: reduce) {
      *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
      }
    }
    

    Rule: Every animated component MUST respect prefers-reduced-motion.


    8. Accessibility Requirements Per Component

    RequirementButtonsInputsModalsTablesNavigation
    Keyboard accessible
    Focus visibleFocus trap
    ARIA rolebuttontextbox/comboboxdialogtable/gridnav
    Screen reader labelaria-label or visible text<label> associatedaria-labelledbyCaption + headersaria-label
    Error statearia-describedby error msgaria-invalid
    Touch target44×44px min44px heightRow: 44px min44×44px

    9. Design Token FormatPrinciples

    9.1 CSS Custom Properties (Source of Truth)

    /* tokens/colors.css */
    :root {
      --color-brand-500: #0EA5E9;
      /* ... */
    }
    

    9.2 Tailwind Config Extension

    // tailwind.config.ts
    export default {
      theme: {
        extend: {
          colors: {
            brand: {
              500: 'var(--color-brand-500)',
              // ...
            }
          }
        }
      }
    }
    

    9.3 JavaScript/TypeScript Constants

    // tokens/colors.ts — for use in charting libraries, canvas, etc.
    export const colors = {
      brand500: '#0EA5E9',
      // ...
    } as const;
    

    Token update process: Figma → Style Dictionary export → CSS/JS/Tailwind files → PR review.


    10. Component Documentation Standard

    Each component story must include:

    1. DefaultClarity over Decoration storybasic render withData-first, minimal propsornamentation
    2. AllConsistent VariantsSpacing storyevery8px visualgrid, variantpredictable displayedrhythm
    3. AllAccessible Statesby Default storyhover,WCAG focus,AA disabled,minimum, error,Radix loadingUI primitives
    4. ResponsiveMobile-First storybehaviorResponsive atfrom each375px+ breakpoint(iPhone SE)
    5. AccessibilityDark storySidebar + Light ContentkeyboardClear navigation,visual screenseparation
    6. reader
    7. Primary notesColor as Accent — Green (#00E5A0) for actions, not backgrounds
    8. Subtle Shadows — Elevation without heaviness
    9. Data-Dense UI — Tables, charts, metrics — optimized for information density

    Brand Identity Alignment

    ComponentFrom JSDoc minimum:~/system/specs/bilko-brand-identity.md:

    /**
      *
    • Primary Button component for primary user actions. * * @example * <Button variant="primary" onClick={handleSubmit}>Save Changes</Button> */

    Props table:Color: Every#00E5A0 prop(implemented) must

  • Typography: have:Inter type,(implemented)
  • default,
  • Tone: requiredModern, flag,professional, description.

    Balkan-focused (implemented)
  • Dark Sidebar: #111113 (implemented)
  • Logo Placement: Top left sidebar (implemented)

  • ApprovalFuture Tokens (Phase 2)

    When

    implementingAPIintegration:

  • Loading
  • States:Skeletoncomponentcolors
  • Error
  • States:Errormessagebackgrounds(#FEF2F2,light
  • Success
  • States:Successmessagebackgrounds(#F0FDF4,green)
  • Toast
  • Notifications:Background,text,border
  • Dark
  • Mode:Fulldarkthemevariant
    Role NameDateSignature
    Author
    Leadred) Designer
    Frontendlight Lead
    Accessibilitycolors Reviewer
    (optional)