From 34bea90531870851c2d0e3b66da7b746946b23c5 Mon Sep 17 00:00:00 2001 From: Israel Barbara Date: Tue, 7 Jan 2025 16:32:27 -0300 Subject: [PATCH 1/4] Add table to project --- packages/leptos/table/Cargo.toml | 17 +++++++++++++++++ packages/leptos/table/README.md | 21 +++++++++++++++++++++ packages/leptos/table/src/lib.rs | 14 ++++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 packages/leptos/table/Cargo.toml create mode 100644 packages/leptos/table/README.md create mode 100644 packages/leptos/table/src/lib.rs diff --git a/packages/leptos/table/Cargo.toml b/packages/leptos/table/Cargo.toml new file mode 100644 index 0000000..5070a72 --- /dev/null +++ b/packages/leptos/table/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "shadcn-ui-leptos-table" +description = "Leptos port of shadcn/ui Table." +homepage = "https://shadcn-ui.rustforweb.org/components/card.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/table/README.md b/packages/leptos/table/README.md new file mode 100644 index 0000000..54c2be7 --- /dev/null +++ b/packages/leptos/table/README.md @@ -0,0 +1,21 @@ +

+ + Rust shadcn/ui Logo + +

+ +

shadcn-ui-leptos-table

+ +A responsive table component. + +[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/table/src/lib.rs b/packages/leptos/table/src/lib.rs new file mode 100644 index 0000000..b93cf3f --- /dev/null +++ b/packages/leptos/table/src/lib.rs @@ -0,0 +1,14 @@ +pub fn add(left: u64, right: u64) -> u64 { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } +} From eb00dcc41aba403789d728c9fadbb532ea5ecf73 Mon Sep 17 00:00:00 2001 From: Israel Barbara Date: Tue, 7 Jan 2025 16:49:44 -0300 Subject: [PATCH 2/4] Add default and new-york --- packages/leptos/table/src/default.rs | 215 ++++++++++++++++++++++++++ packages/leptos/table/src/new_york.rs | 215 ++++++++++++++++++++++++++ 2 files changed, 430 insertions(+) create mode 100644 packages/leptos/table/src/default.rs create mode 100644 packages/leptos/table/src/new_york.rs diff --git a/packages/leptos/table/src/default.rs b/packages/leptos/table/src/default.rs new file mode 100644 index 0000000..b568ffb --- /dev/null +++ b/packages/leptos/table/src/default.rs @@ -0,0 +1,215 @@ +use leptos_node_ref::AnyNodeRef; +use tailwind_fuse::*; +use leptos::prelude::*; +use leptos_style::Style; + + +#[component] +pub fn Table( + #[prop(into, optional)] class: MaybeProp, + #[prop(into, optional)] id: MaybeProp, + #[prop(into, optional)] style: Signal