UNPKG

@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
# 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.