Skip to content

Latest commit

History

190 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Synetics UI

Component library for the Synetics framework

Version 0.7.0-alphaTypeScript 5.0+MIT LicenseSynetics 0.7.0-alpha

AboutInstallationQuick StartComponentsRoadmapContributing

follow me


About

@synetics/ui is the official component library for the Synetics framework. It provides production-ready, accessible UI components built with fine-grained reactivity, TailwindCSS styling, and a fluent builder API for configuration.

Key Features

  • 🎨 Design Tokens: Uses @synetics/design-tokens for consistent styling
  • 📏 Size System: Standardized sizing (xs, sm, md, lg, xl) across all components
  • 🎭 Variant System: Multiple style variants (solid, outline, ghost, soft)
  • 🏗️ Builder Pattern: Fluent API for component configuration
  • 🎯 Type-Safe: Full TypeScript support with strict typing
  • Accessible: ARIA attributes and keyboard navigation built-in
  • 🚀 Synetics-Native: Built specifically for Synetics's reactivity system
  • 💅 TailwindCSS: Utility-first styling with custom configuration
  • 📦 Modular: Clean architecture with one item per file

🎨 Live Showcase

Explore 80+ Advanced Examples:GitHub Pages Showcase(Coming Soon)

The showcase demonstrates production-grade patterns from the Synetics ecosystem:

Featured Patterns

1. Portal/PortalSlot Architecture

// Modal with content projection - logic stays local, UI projects globally<Modalid="demo"isOpen={isOpen}onClose={closeModal}/><Portalid="demo"target="body"><inputvalue={localData()}onInput={updateLocalData}/>{/* Component scope preserved, UI rendered in portal */}</Portal>

Benefits:

  • UI projected to global DOM (modal, tooltip, dropdown)
  • State and logic remain in component scope
  • Clean separation of concerns
  • No prop drilling

2. Error Boundaries (Tryer/Catcher)

// Graceful error handling with isolated boundaries<Tryer><ComponentThatMightFail/><Catcher>{(error)=><ErrorDisplayerror={error}/>}</Catcher></Tryer>

Features:

  • Independent error boundaries
  • Prevents app-wide crashes
  • Fallback UI for failed sections
  • Error propagation control

3. Signal-Based Reactivity

// Fine-grained updates with automatic dependency trackingconst[count,setCount]=createSignal(0);constdouble=createMemo(()=>count()*2);// Only subscribed DOM nodes update - no virtual DOM diffing<div>{count()}</div>{/*Updateswhencountchanges*/}<div>{double()}</div>{/*Updateswhencountchanges*/}

4. Resource Caching

// Stale-while-revalidate with automatic cache managementconstuser=createResource(()=>fetchUser(id),{staleTime: 5000// Fresh for 5 seconds});// Instant cache hits, background revalidation<Showwhen={user.data}>{(u)=><Profileuser={u}/>}</Show>

5. Dependency Injection

// ServiceManager with lifecycle managementconstservices=newServiceManager();services.register('analytics',()=>newAnalytics(),{lifetime: 'singleton',// Single instance app-wide});// Use in componentsconstanalytics=inject('analytics');analytics.track('event');

6. Control Flow Primitives

// Declarative control flow with proper keying<Showwhen={isLoggedIn()}><Dashboard/></Show><Foreach={items()}>{(item)=><Item{...item}/>}</For><Indexeach={colors()}>{(color,i)=><Colorvalue={color()}/>}</Index>

Showcase Structure

📁 src/showcase/

├── reactivity/ # Signal, memo, effect demos
├── portal/ # Modal, tooltip portals
├── error-boundary/ # Tryer/Catcher patterns
├── resource/ # Data fetching, caching
├── di/ # Dependency injection
├── control-flow/ # Show, For, Index
└── components/ # Component composition

🔗 View Source:packages/synetics-ui.dev/src/showcase

Run Showcase Locally

pnpm showcase:dev # Development server
pnpm showcase:build # Build for production

Installation

pnpm add @synetics/ui

Dependencies

The component library requires:

  • pulsar - The Synetics framework
  • @synetics/design-tokens - Design system tokens
  • tailwindcss - Utility-first CSS framework

Quick Start

Builder Pattern Configuration

All components use a fluent builder pattern for configuration:

import{ComponentConfig,Button}from'@synetics/ui';// Create a configurationconstconfig=newComponentConfig('primary')// Start with color.variant('solid')// Set variant.size('lg')// Set size.rounded('md')// Border radius.shadow('lg')// Shadow.fullWidth()// Full width.build();// Build final config// Use configuration with componentconstmyButton=Button({
config,label: 'Click Me',onclick: ()=>console.log('Clicked!'),});

Simple Usage

import{PrimaryButton,Input,Badge}from'@synetics/ui';// Use factory variants for quick setupconstsaveButton=PrimaryButton({label: 'Save Changes',onclick: ()=>saveFn(),});constemailInput=Input({type: 'email',placeholder: 'your@email.com',required: true,});conststatusBadge=Badge({label: 'Active',color: 'success',});

Components

Atoms

  • Button - Interactive button with variants, sizes, icons, loading states
  • Input - Text input with prefix/suffix, error states, validation
  • Checkbox - Accessible checkbox with indeterminate state
  • Radio - Radio button for single selections
  • Toggle - Switch/toggle component for boolean states
  • Textarea - Multi-line text input
  • Spinner - Loading spinner with size variants
  • Skeleton - Skeleton loader for content placeholders
  • Typography - Heading, paragraph, and text components

Molecules

  • Badge - Status and label badges with colors and variants
  • Button Group - Grouped buttons with shared configuration
  • Label - Form labels with required indicators
  • Radio Group - Radio button groups with shared state

Organisms

  • Card - Container with header, body, footer sections

ComponentConfig Builder API

newComponentConfig(color)// 'primary' | 'secondary' | 'success' | 'warning' | 'error' | 'neutral'.variant(value)// 'solid' | 'outline' | 'ghost' | 'soft'.size(value)// 'xs' | 'sm' | 'md' | 'lg' | 'xl'.rounded(value)// 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'full'.shadow(value)// 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'.border(boolean)// Enable/disable border.disabled(boolean)// Disabled state.loading(boolean)// Loading state.fullWidth(boolean)// Full width.transition(boolean)// Enable transitions.transitionDuration(value)// 'fast' | 'normal' | 'slow'.hover(boolean)// Enable hover effects.focus(boolean)// Enable focus effects.active(boolean)// Enable active effects.className(string)// Additional CSS classes.build();// Returns IComponentConfig

Roadmap

✅ v0.1.0 - Foundation (Current)

  • ✅ Atoms: Button, Input, Checkbox, Radio, Toggle, Textarea, Spinner, Skeleton, Typography
  • ✅ Molecules: Badge, Button Group, Label, Radio Group
  • ✅ Organisms: Card
  • ✅ Builder pattern API
  • ✅ Design token integration
  • ✅ TypeScript strict mode
  • ✅ TailwindCSS integration

🚧 v0.2.0 - Enhanced Components (Q2 2026)

  • 🔄 Select - Dropdown select with search and multi-select
  • 🔄 Modal - Dialog and modal components
  • 🔄 Dropdown - Menu dropdown with keyboard navigation
  • 🔄 Tabs - Tab navigation component
  • 🔄 Accordion - Collapsible content panels
  • 🔄 Toast - Toast notifications system
  • 🔄 Tooltip - Contextual tooltips
  • 🔄 Popover - Popover content containers

🎯 v0.3.0 - Advanced Components (Q3 2026)

  • 📋 Table - Data table with sorting, filtering, pagination
  • 📊 Chart - Basic chart components (bar, line, pie)
  • 📅 Date Picker - Calendar date selection
  • 🎨 Color Picker - Color selection component
  • 📁 File Upload - Drag-and-drop file upload
  • 🔍 Search - Search input with suggestions
  • 🏷️ Tag Input - Multi-tag input component
  • 📝 Rich Text Editor - WYSIWYG editor

🌟 v1.0.0 - Production Ready (Q4 2026)

  • 🎨 Theming System - Custom theme creation and switching
  • 📱 Responsive Utilities - Mobile-first responsive components
  • 🌙 Dark Mode - Complete dark mode support
  • A11y Audit - Full accessibility compliance
  • 📖 Storybook - Interactive component documentation
  • 🧪 Test Coverage 90%+ - Comprehensive test suite
  • 📦 Tree Shaking - Optimized bundle sizes
  • 🎭 Animation Library - Pre-built animation presets

Ecosystem

Part of the Synetics framework ecosystem:

PackageDescriptionRepository
synetics.devMain reactive frameworkGitHub
@synetics/uiComponent library (this package)GitHub
@synetics/design-tokensDesign tokens & brand assetsGitHub
@synetics/transformerJSX transformerGitHub
@synetics/vite-pluginVite integrationGitHub
synetics-demoExample applicationsGitHub

Contributing

Contributions welcome! We need help with:

  • 🎨 New Components - Build additional UI components
  • Accessibility - Improve ARIA support and keyboard navigation
  • 📖 Documentation - Add examples and usage guides
  • 🧪 Tests - Increase test coverage
  • 🐛 Bug Fixes - Report and fix issues
  • 💡 Feature Requests - Suggest new components or improvements

Development Setup

# Clone the repository
git clone https://github.com/binaryjack/synetics-ui.dev.git
cd synetics-ui.dev
# Install dependencies
pnpm install
# Build
pnpm build
# Watch mode
pnpm dev

Code Guidelines

  • ✅ One item per file (interfaces, types, implementations)
  • ✅ TypeScript strict mode (no any types)
  • ✅ Prototype-based classes for components
  • ✅ Use Synetics.HtmlExtends<T> for HTML props
  • ✅ Builder pattern for component configuration
  • ✅ Comprehensive JSDoc comments

License

MIT License - Copyright (c) 2026 Synetics framework

See LICENSE for full details.


Acknowledgments

Built with ⚡ by Tadeo Piana and contributors.

Design inspiration from:


@synetics/ui - v0.1.0
Component library for the Synetics framework

GitHubSynetics frameworkConnect with the Creator

About

pulsar-ui component library

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages