@tamyla/ui-components-react
Version:
React-based UI component library with Factory Bridge pattern - integrates seamlessly with @tamyla/ui-components. Enhanced AI agent discoverability with structured component registry, comprehensive Storybook (8 components), and detailed guides.
226 lines (181 loc) โข 8.27 kB
Markdown
# Sample HTML### By Use Case
- **Interactive Testing**: `interactive-testing.html`
- **Complete Showcase**: `complete-showcase.html`
- **Factory Bridge Demo**: `factory-bridge-docs.html`
- **Responsive Design**: `responsive-theming-showcase.html`
- **CSS Integration**: `css-responsive-showcase.html`
## ๐งฉ Component Index
### Buttons & Controls
- **Button Variants**: `interactive-testing.html` (variants, sizes, states)
- **ButtonPrimary/ButtonSecondary**: `complete-showcase.html`
- **Icon Buttons**: `interactive-testing.html`
- **Loading States**: `interactive-testing.html`
### Form Components
- **Input Fields**: `interactive-testing.html` (text, email, password)
- **Input Validation**: `interactive-testing.html`
- **Form Layout**: `complete-showcase.html`
### Layout Components
- **Cards**: `interactive-testing.html`, `complete-showcase.html`
- **CardHeader/CardTitle**: `complete-showcase.html`
- **Grid Systems**: `responsive-theming-showcase.html`
- **Responsive Layout**: `css-responsive-showcase.html`
### Advanced Features
- **Factory Bridge**: `factory-bridge-docs.html`
- **Redux Integration**: `complete-showcase.html`
- **Theme Switching**: `themed-showcase.html`
- **CSS Custom Properties**: `css-responsive-showcase.html`
## ๐ Files Overviews - Tamyla UI Components React
This directory contains comprehensive HTML examples demonstrating the React UI components and their integration with the vanilla ui-components library through the Factory Bridge pattern.
## ๏ฟฝ Quick Component Lookup
### By Category
- **Buttons**: `interactive-testing.html`, `complete-showcase.html`
- **Forms**: `interactive-testing.html`, `factory-bridge-docs.html`
- **Cards**: `complete-showcase.html`, `interactive-testing.html`
- **Layout**: `complete-showcase.html`, `responsive-theming-showcase.html`
- **Theming**: `themed-showcase.html`, `responsive-theming-showcase.html`
### By Use Case
- **Interactive Testing**: `interactive-testing.html`
- **Complete Showcase**: `complete-showcase.html`
- **Factory Bridge Demo**: `factory-bridge-docs.html`
- **Responsive Design**: `responsive-theming-showcase.html`
- **CSS Integration**: `css-responsive-showcase.html`
## ๏ฟฝ๐ Files Overview
### 1. `complete-showcase.html`
**๐จ Complete Component Showcase**
- Comprehensive demonstration of all React components
- Atomic Design methodology (Atoms โ Molecules โ Organisms โ Applications)
- Redux integration examples
- Styled Components integration
- Real-world application examples
- Factory Bridge pattern explanation with visual demonstrations
**Features:**
- โ๏ธ **Atoms**: Buttons, Inputs, Avatars, Badges
- ๐งฌ **Molecules**: User Profile Cards, Search Forms, Settings Panels
- ๐ฆ **Organisms**: Dashboard Headers, Complex UI Sections
- ๐๏ธ **Applications**: Complete Interface Layout
- ๐ **Integration Showcase**: Factory Bridge benefits and implementation
### 2. `interactive-testing.html`
**๐งช Interactive Component Testing Suite**
- Live component testing environment
- Real-time prop manipulation
- Code generation preview
- Component examples gallery
- Factory Bridge pattern demonstration
**Features:**
- ๐๏ธ **Interactive Controls**: Modify component props in real-time
- ๐ **Code Generation**: See generated JSX code for current configuration
- ๐ฏ **Component Examples**: Pre-built examples for quick testing
- ๐ **Live Preview**: Instant component updates
- ๐ **Bridge Documentation**: Technical implementation details
**Components Included:**
- Button (variants, sizes, states)
- Input (types, validation, states)
- Avatar (sizes, shapes, placeholders)
- Badge (variants, sizes)
- Alert (types, dismissible)
- Card (shadows, layouts)
- Modal (interactive demonstration)
### 3. `factory-bridge-docs.html`
**๐ Technical Documentation & Architecture**
- In-depth Factory Bridge pattern explanation
- Architecture flow diagrams
- Implementation examples
- Benefits and use cases
- Comparison with other approaches
- Live interactive demonstrations
**Sections:**
- ๐ฏ **Overview**: Pattern introduction and benefits
- ๐๏ธ **Architecture Flow**: Step-by-step process visualization
- ๐ป **Implementation**: Code examples and technical details
- โจ **Benefits**: Detailed advantage analysis
- ๐ **Comparison**: vs other approaches (separate implementations, web components)
- ๐ **Real-World Examples**: Application use cases
- ๐ฏ **Use Cases**: When to use this pattern
- ๐จ **Live Demo**: Interactive comparison
## ๐ How to Use
### Option 1: Direct File Opening
1. Navigate to the `examples/` directory
2. Double-click any `.html` file to open in your browser
3. All dependencies are loaded via CDN - no setup required
### Option 2: Local Server (Recommended)
For better experience with advanced features:
```bash
# Using Python (if installed)
cd examples
python -m http.server 8000
# Using Node.js (if installed)
npx serve .
# Using VS Code Live Server extension
# Right-click any HTML file โ "Open with Live Server"
```
Then navigate to:
- `http://localhost:8000/complete-showcase.html`
- `http://localhost:8000/interactive-testing.html`
- `http://localhost:8000/factory-bridge-docs.html`
## ๐ง Technical Implementation
### Factory Bridge Pattern
All examples demonstrate the Factory Bridge pattern that enables seamless integration between vanilla ui-components and React:
```javascript
// Factory Bridge Function
const createFactoryComponent = (VanillaComponent) => {
return React.forwardRef((props, ref) => {
return React.createElement(VanillaComponent, { ...props, ref });
});
};
// Creating React Components (Conceptual Example)
const ReactButton = createFactoryComponent(TamylaUIComponents.Button);
const ReactInput = createFactoryComponent(TamylaUIComponents.Input);
// For production use, import pre-built components:
import { ButtonPrimary, ButtonSecondary, Input } from '@tamyla/ui-components-react';
```
### Key Benefits Demonstrated
1. **๐ Code Reusability**: Same component logic across frameworks
2. **๐ฏ Consistency**: Uniform design system implementation
3. **โก Performance**: Minimal wrapper overhead
4. **๐ ๏ธ Maintenance**: Single source of truth for updates
5. **๐ฆ Bundle Optimization**: Shared component logic
6. **๐ง TypeScript Ready**: Full type safety support
## ๐จ Component Library Features
### Comprehensive Component Set
- **Form Controls**: Buttons, Inputs, Selects, Checkboxes
- **Layout**: Cards, Modals, Grids, Containers
- **Feedback**: Alerts, Badges, Loading States
- **Navigation**: Breadcrumbs, Tabs, Menus
- **Data Display**: Tables, Lists, Avatars
- **Interactive**: Tooltips, Dropdowns, Modals
### Integration Capabilities
- **Redux/Toolkit**: State management examples
- **Styled Components**: CSS-in-JS integration
- **Framer Motion**: Animation capabilities
- **TypeScript**: Full type safety
- **React Hooks**: Modern React patterns
## ๐ Development Notes
### Testing Environment
The interactive testing suite (`interactive-testing.html`) provides:
- Real-time prop manipulation
- Code generation
- Component state management
- Visual feedback
- Export capabilities
### Documentation Standards
All examples follow:
- Comprehensive commenting
- Clear code structure
- Real-world use cases
- Performance best practices
- Accessibility considerations
## ๐ Related Resources
- **Main Library**: `@tamyla/ui-components` (vanilla JavaScript)
- **React Library**: `@tamyla/ui-components-react` (this package)
- **Documentation**: Factory Bridge pattern technical documentation
- **Examples**: Complete application implementation examples
## ๐ค Contributing
When adding new examples:
1. Follow the established HTML structure
2. Include comprehensive documentation
3. Demonstrate Factory Bridge integration
4. Provide interactive elements where appropriate
5. Ensure cross-browser compatibility
6. Include performance considerations
## ๐ License
These examples are part of the Tamyla UI Components React library and follow the same licensing terms.