-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
7 changed files
with
76 additions
and
13 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
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,25 @@ | ||
//! Contains the [`ButtonGroup`] component. | ||
use leptos::*; | ||
|
||
use super::button::ButtonProps; | ||
|
||
/// A group of buttons | ||
#[component] | ||
pub fn ButtonGroup( | ||
/// These will be transformed into [`Button`] elements. | ||
children: Vec<ButtonProps>, | ||
) -> impl IntoView { | ||
let class = "max-w-full flex align-center gap-px [&>*]:flex-1 \ | ||
[&>*:not(:first-child):not(:last-child)]:ml-0 \ | ||
[&>*:not(:first-child):not(:last-child)]:rounded-none \ | ||
[&>*:not(:only-child):first-child]:rounded-r-none \ | ||
[&>*:not(:only-child):last-child]:rounded-l-none \ | ||
[&>*:not(:only-child):last-child]:ml-0"; | ||
|
||
view! { | ||
<div class=class> | ||
{children} | ||
</div> | ||
} | ||
} |
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 |
---|---|---|
@@ -1,7 +1,12 @@ | ||
//! Contains small components that do not contain child components. | ||
mod button; | ||
mod button_group; | ||
mod number_input; | ||
|
||
pub use button::Button; | ||
pub use button::{ | ||
Button, | ||
ButtonProps, | ||
}; | ||
pub use button_group::ButtonGroup; | ||
pub use number_input::NumberInput; |
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
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
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
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