-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fc997e0
commit 1888a60
Showing
5 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[package] | ||
name = "shadcn-ui-leptos-textarea" | ||
description = "Leptos port of shadcn/ui textarea." | ||
publish = false | ||
|
||
authors.workspace = true | ||
edition.workspace = true | ||
license.workspace = true | ||
repository.workspace = true | ||
version.workspace = true | ||
|
||
[dependencies] | ||
leptos.workspace = true | ||
tailwind_fuse.workspace = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<p align="center"> | ||
<a href="../../../logo.svg" alt="Rust shadcn/ui logo"> | ||
<img src="../../../logo.svg" width="300" height="200"> | ||
</a> | ||
</p> | ||
|
||
<h1 align="center">shadcn-ui-leptos-textarea</h1> | ||
|
||
Displays a form textarea or a component that looks like a textarea. | ||
|
||
## Rust shadcn/ui | ||
|
||
[Rust shadcn/ui](https://github.com/NixySoftware/shadcn-ui) is a Rust port of [shadcn/ui](https://ui.shadcn.com/). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
use leptos::*; | ||
use tailwind_fuse::*; | ||
|
||
#[derive(TwClass)] | ||
#[tw( | ||
class = "flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50" | ||
)] | ||
pub struct TextareaClass {} | ||
|
||
#[component] | ||
pub fn Textarea( | ||
#[prop(into, optional)] class: MaybeSignal<String>, | ||
#[prop(attrs)] attributes: Vec<(&'static str, Attribute)>, | ||
) -> impl IntoView { | ||
let class = create_memo(move |_| TextareaClass {}.with_class(class.get())); | ||
|
||
view! { | ||
<textarea {..attributes} class=class /> | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
//! Leptos port of [shadcn/ui textarea](https://ui.shadcn.com/docs/components/textarea). | ||
//! | ||
//! Displays a form textarea or a component that looks like a textarea. | ||
//! | ||
//! See <https://ui.shadcn.com/docs/components/textarea> for the original documentation. | ||
pub mod default; | ||
pub mod new_york; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
use leptos::*; | ||
use tailwind_fuse::*; | ||
|
||
#[derive(TwClass)] | ||
#[tw( | ||
class = "flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50" | ||
)] | ||
pub struct TextareaClass {} | ||
|
||
#[component] | ||
pub fn Textarea( | ||
#[prop(into, optional)] class: MaybeSignal<String>, | ||
#[prop(attrs)] attributes: Vec<(&'static str, Attribute)>, | ||
) -> impl IntoView { | ||
let class = create_memo(move |_| TextareaClass {}.with_class(class.get())); | ||
|
||
view! { | ||
<textarea {..attributes} class=class /> | ||
} | ||
} |