//! # Component
//!
//! This module exposes the component traits
use crate Rect;
use crate::;
/// A Mock Component represents a component which defines all the properties and states it can handle and represent
/// and the way it should be rendered. It must also define how to behave in case of a `Cmd` (command).
/// Despite that, it won't define how to behave after an `Event` and it won't send any `Msg`.
/// The MockComponent is intended to be used as a reusable component to implement your application component.
///
/// ### In practice
///
/// A real life example would be an Input field.
/// The mock component is represented by the `Input`, which will define the properties (e.g. max input length, input type, ...)
/// and by its behaviour (e.g. when the user types 'a', 'a' char is added to input state).
///
/// In your application though, you may use a `IpAddressInput` which is the `Component` using the `Input` mock component.
/// If you want more example, just dive into the `examples/` folder in the project root.
/// The component describes the application level component, which is a wrapper around the `MockComponent`,
/// which, in addition to all the methods exposed by the mock, it will handle the event coming from the `View`.
/// The Event are passed to the `on` method, which will eventually return a `Msg`,
/// which is defined in your application as an enum. (Don't forget to derive `PartialEq` for your enum).
/// In your application you should have a Component for each element on your UI, but the logic to implement
/// is very tiny, since the most of the work should already be done into the `MockComponent`
/// and many of them are available in the standard library at <https://github.com/veeso/tui-realm-stdlib>.
///
/// Don't forget you can find an example in the `examples/` directory and you can discover many more information
/// about components in the repository documentation.