$ show irihitech/Semi.Avalonia
Semi.Avalonia is a comprehensive Avalonia UI theme library inspired by Semi Design, delivered as multiple NuGet packages. It provides a complete set of styled controls (buttons, text boxes, data grids, color pickers, etc.) with Light, Dark, and High Contrast themes, plus localization in 16 languages. The architecture follows Avalonia's resource dictionary and control theme patterns: each control has shared, light, dark, and high contrast XAML files that define visual states, triggers, and animations. A central `SemiTheme` class orchestrates theme swapping and locale selection via merged resource dictionaries. The repository also includes a demo application for desktop, Web, Android, and Lixux DRM platforms. The theming system is built on a well-structured token system using `Variables.axaml` and color palette files (e.g., `Light.axaml`, `Dark.axaml`) that define design tokens like spacing, border radii, and semantic colors. Control themes extensively use `DynamicResource` references, enabling runtime theme switching. The color picker extension (`Semi.Avalonia.ColorPicker`) is a notable sub-system with spectrum, palette, and component tabs supporting RGBA and HSVA models. Animations (e.g., `SemiPopupAnimations`) and custom converters (e.g., `PositionToAngleConverter`) add polish. The demo application is an MVVM-based showcase that exercises all controls and provides installation instructions. The CI/CD pipeline builds and publishes NuGet packages and cross-platform demos. Overall, this is a production-quality theming library with good mainainability, though some duplication between variant themes and a large icon file present potential maintenance costs.
The LLM identified 3 files worth highlighting for reuse:
Defines a reusable `SemiPopupAnimation` resource dictionary with keyed `DoubleAnimation` and `TransformAnimation` definitions for popup open/close. It uses `SplineEasing` and scale transforms, and can be extracted as a generic popup animation set for any Avalonia application looking for smooth, non-trival popup transitions.
Iplements `IValueConverter` that maps a `Point` (relative position) to an angle in degrees. This is used in controls like `SplitButton` to rotate chevrons based on placement. It is self-contained, stateless, and can be reused wherever trigonometry-based angle conversion from a position is needed (e.g., radial menus, progress rings).
A sophisticated control theme for a notification card with entry/exit animations, multiple states (open, close, stale), and adaptive layout. It demonstrates non-obvious use of `Style.Animations`, `KeyFrame`, and `DynamicResource` theming to create a reusable notification banner that can be extracted with minimal modifcation for any Avalonia app.