Metadata-Version: 2.4
Name: rc-tui
Version: 0.2.1
Summary: High-performance React-inspired TUI library for Python
Author-email: Pomilon <pomilon@proton.me>
License: MIT License
        
        Copyright (c) 2026 Pomilon
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pybind11>=2.12.0
Requires-Dist: pyfiglet>=0.8.post1
Requires-Dist: tree-sitter<0.24.0,>=0.22.0
Requires-Dist: tree-sitter-python<0.24.0,>=0.22.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0.0; extra == "dev"
Requires-Dist: twine>=5.0.0; extra == "dev"
Dynamic: license-file

# rc-tui

**rc-tui** is a high-performance, React-inspired Terminal User Interface (TUI) library for Python. It combines the declarative power of modern web frameworks with a high-performance C++ rendering engine to create fluid, beautiful, and complex terminal applications.

## Why rc-tui?

- **Declarative & Component-Based**: Build your UI with functional components and hooks (`useState`, `useEffect`).
- **Hybrid Performance**: High-frequency render logic and terminal diffing are in C++; layout and logic are in Python.
- **Advanced Styling**: Web-standard colors (Hex, RGB), pseudo-classes (`hover`, `focus`), and rich text attributes.
- **Cross-Platform**: Fully supports Linux, macOS, and Windows 10+ (Verified via CI/CD).

## Key Features (v0.2.0)

- **Rich Styling**: Hex colors, inheritance, `box_shadow`, and `text_transform`.
- **Interactive Pseudo-classes**: Define `hover_style` and `focus_style` for responsive components.
- **Full Mouse Support**: Real-time motion tracking for hovers and tooltips.
- **Flexbox Layout**: Powerful layout engine with `gap`, `flex_grow`, and percentage dimensions.
- **Markdown & Code**: Built-in support for Markdown and syntax-highlighted code blocks (via Tree-sitter).

## Installation

```bash
pip install rc-tui
```

## Quick Start

```python
from rc_tui import App, Component, Box, Text, Button, useState

class Counter(Component):
    def render(self):
        count, set_count = useState(0)
        
        return Box(
            flex_direction="column",
            align_items="center",
            gap=1,
            border="rounded",
            padding=1,
            children=[
                Text(f"Value: {count}", style={'bold': True, 'fg': 'cyan'}),
                Button(
                    "Increment", 
                    on_click=lambda _: set_count(count + 1),
                    style={'hover_style': {'bg': 'green'}}
                )
            ]
        )

if __name__ == "__main__":
    App(Counter).run()
```

## Advanced Styling

```python
Text("Polished Text", style={
    'fg': '#ff00ff',           # Hex colors
    'italic': True,             # Rich attributes
    'text_transform': 'uppercase',
    'hover_style': {'fg': 'white', 'bold': True}
})
```

## Platform Support

| Platform | Support Status | Notes |
| :--- | :--- | :--- |
| **Linux** | ✅ Fully Supported | Primary development platform. |
| **macOS** | ✅ Supported | Verified via CI/CD. |
| **Windows** | ✅ Supported | Verified via CI/CD. Requires Windows 10+. |

## Documentation

- [Architecture Reference](./docs/architecture.md)
- [Component & Props API](./docs/components.md)
- [Hooks API](./docs/hooks.md)
- [Event System](./docs/events.md)

## Examples

Check out the [examples/](./examples) directory:
- `counter.py`: Basic state management.
- `styling_showcase.py`: Comprehensive styling engine demo.
- `dashboard.py`: Layout and progress indicators.

## License

MIT
