From e21768c223837ddd867819ef6f94bc7bd5a8ceac Mon Sep 17 00:00:00 2001 From: Israel Barbara Date: Sat, 28 Dec 2024 06:14:24 -0300 Subject: [PATCH 1/4] Add textarea impl --- Cargo.lock | 10 +++ packages/leptos/textarea/Cargo.toml | 18 ++++++ packages/leptos/textarea/README.md | 21 +++++++ packages/leptos/textarea/src/default.rs | 79 ++++++++++++++++++++++++ packages/leptos/textarea/src/lib.rs | 8 +++ packages/leptos/textarea/src/new_york.rs | 79 ++++++++++++++++++++++++ 6 files changed, 215 insertions(+) create mode 100644 packages/leptos/textarea/Cargo.toml create mode 100644 packages/leptos/textarea/README.md create mode 100644 packages/leptos/textarea/src/default.rs create mode 100644 packages/leptos/textarea/src/lib.rs create mode 100644 packages/leptos/textarea/src/new_york.rs diff --git a/Cargo.lock b/Cargo.lock index aa3ba82..8f9305c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3522,6 +3522,16 @@ dependencies = [ "tailwind_fuse", ] +[[package]] +name = "shadcn-ui-leptos-textarea" +version = "0.0.1" +dependencies = [ + "leptos 0.7.2", + "leptos-node-ref", + "leptos-style", + "tailwind_fuse", +] + [[package]] name = "shadcn-ui-leptos-utils" version = "0.0.1" diff --git a/packages/leptos/textarea/Cargo.toml b/packages/leptos/textarea/Cargo.toml new file mode 100644 index 0000000..98b658a --- /dev/null +++ b/packages/leptos/textarea/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "shadcn-ui-leptos-textarea" +description = "Leptos port of shadcn/ui Textarea." +homepage = "https://shadcn-ui.rustforweb.org/components/textarea.html" +publish = false + +authors.workspace = true +edition.workspace = true +license.workspace = true +repository.workspace = true +version.workspace = true + +[dependencies] +tailwind_fuse.workspace = true +leptos.workspace = true +leptos-style.workspace = true +leptos-node-ref.workspace = true + diff --git a/packages/leptos/textarea/README.md b/packages/leptos/textarea/README.md new file mode 100644 index 0000000..8fd28b2 --- /dev/null +++ b/packages/leptos/textarea/README.md @@ -0,0 +1,21 @@ +

+ + Rust shadcn/ui Logo + +

+ +

shadcn-ui-leptos-textarea

+ +Displays a form textarea or a component that looks like a textarea. + +[Rust shadcn/ui](https://github.com/RustForWeb/shadcn-ui) is a Rust port of [shadcn/ui](https://ui.shadcn.com/). + +## Documentation + +See [the Rust shadcn/ui book](https://shadcn-ui.rustforweb.org/) for documentation. + +## Rust For Web + +The Rust shadcn/ui project is part of the [Rust For Web](https://github.com/RustForWeb). + +[Rust For Web](https://github.com/RustForWeb) creates and ports web UI libraries for Rust. All projects are free and open source. diff --git a/packages/leptos/textarea/src/default.rs b/packages/leptos/textarea/src/default.rs new file mode 100644 index 0000000..805f590 --- /dev/null +++ b/packages/leptos/textarea/src/default.rs @@ -0,0 +1,79 @@ +use leptos_node_ref::AnyNodeRef; +use tailwind_fuse::*; +use leptos::{attr::autocapitalize, prelude::*}; +use leptos_style::Style; + + +#[component] +pub fn Textarea( + // Global attributes + #[prop(into, optional)] class: MaybeProp, + #[prop(into, optional)] id: MaybeProp, + #[prop(into, optional)] style: MaybeProp