| 1 | use topcoat::{ |
| 2 | Result, |
| 3 | view::{Attributes, View, class, component, view}, |
| 4 | }; |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | const TEXTAREA: &str = "field-sizing-content min-h-16 w-full rounded-lg border border-border \ |
| 13 | bg-background px-3 py-2 text-sm shadow-xs transition-colors outline-none \ |
| 14 | placeholder:text-muted-foreground \ |
| 15 | focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 \ |
| 16 | focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50"; |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | #[component] |
| 33 | pub async fn textarea(#[default] mut attrs: Attributes, #[default] child: View) -> Result { |
| 34 | view! { |
| 35 | <textarea class=(class!(TEXTAREA, attrs.remove("class"))) (attrs)> |
| 36 | (child) |
| 37 | </textarea> |
| 38 | } |
| 39 | } |