Skip to content

Commit

Permalink
🚧 Add some system components.
Browse files Browse the repository at this point in the history
  • Loading branch information
langyo committed Oct 31, 2024
1 parent 4e7462c commit 304519c
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 0 deletions.
23 changes: 23 additions & 0 deletions packages/components/src/container/system/breakpoint.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
use stylist::yew::styled_component;
use yew::prelude::*;

#[derive(Properties, Debug, PartialEq)]
pub struct Props {
#[prop_or_default]
pub children: Children,
}

#[styled_component]
pub fn Breakpoint(props: &Props) -> Html {
html! {
<div
class={css!(r#"
display: flex;
align-items: center;
justify-content: center;
"#)}
>
{props.children.clone()}
</div>
}
}
23 changes: 23 additions & 0 deletions packages/components/src/container/system/cursor.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
use stylist::yew::styled_component;
use yew::prelude::*;

#[derive(Properties, Debug, PartialEq)]
pub struct Props {
#[prop_or_default]
pub children: Children,
}

#[styled_component]
pub fn Cursor(props: &Props) -> Html {
html! {
<div
class={css!(r#"
display: flex;
align-items: center;
justify-content: center;
"#)}
>
{props.children.clone()}
</div>
}
}
23 changes: 23 additions & 0 deletions packages/components/src/container/system/flex.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
use stylist::yew::styled_component;
use yew::prelude::*;

#[derive(Properties, Debug, PartialEq)]
pub struct Props {
#[prop_or_default]
pub children: Children,
}

#[styled_component]
pub fn Flex(props: &Props) -> Html {
html! {
<div
class={css!(r#"
display: flex;
align-items: center;
justify-content: center;
"#)}
>
{props.children.clone()}
</div>
}
}
6 changes: 6 additions & 0 deletions packages/components/src/container/system/mod.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
mod breakpoint;
mod cursor;
mod draggable;
mod flex;
mod modal;
mod resizable;
mod scrollable;

pub use breakpoint::Breakpoint;
pub use cursor::Cursor;
pub use draggable::Draggable;
pub use flex::Flex;
pub use modal::Modal;
pub use resizable::Resizable;
pub use scrollable::Scrollable;
1 change: 1 addition & 0 deletions packages/theme/src/prelude/material/mod.rs
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
// https://m3.material.io/components/
// https://vuetifyjs.com/zh-Hans/

0 comments on commit 304519c

Please sign in to comment.