diff --git a/gh-pages/src/app.rs b/gh-pages/src/app.rs index dd905ad..ac000f4 100644 --- a/gh-pages/src/app.rs +++ b/gh-pages/src/app.rs @@ -6,26 +6,26 @@ use leptos_router::*; pub fn App() -> impl IntoView { view! { - - + + - - - - - - - - - - - - - + + + + + + + + + + + + + - - - + + + } diff --git a/gh-pages/src/components/demo.rs b/gh-pages/src/components/demo.rs index adbb6d0..ee4d18a 100644 --- a/gh-pages/src/components/demo.rs +++ b/gh-pages/src/components/demo.rs @@ -12,15 +12,15 @@ pub struct DemoCode { pub fn Demo(demo_code: DemoCode, children: Children) -> impl IntoView { mount_style("demo", prisms::prism_css!()); view! { -
- { children() } -
-
+
+ {children()} +
+
-                    { (demo_code.children)() }
+                    {(demo_code.children)()}
                 
-
+
} } diff --git a/gh-pages/src/components/site_header.rs b/gh-pages/src/components/site_header.rs index b4e9517..fa6b3d8 100644 --- a/gh-pages/src/components/site_header.rs +++ b/gh-pages/src/components/site_header.rs @@ -5,18 +5,24 @@ use melt_ui::*; #[component] pub fn SiteHeader() -> impl IntoView { view! { - - + + + "Melt UI" - diff --git a/gh-pages/src/pages/button/mod.rs b/gh-pages/src/pages/button/mod.rs index 6162124..5da9613 100644 --- a/gh-pages/src/pages/button/mod.rs +++ b/gh-pages/src/pages/button/mod.rs @@ -10,20 +10,15 @@ pub fn ButtonPage() -> impl IntoView {

"Button"

- - - - + + + + - "PRIMARY" @@ -36,27 +31,26 @@ pub fn ButtonPage() -> impl IntoView { - "#, "rust")> + "#, + "rust" + ) + > + ""

"color"

- - - - + + + + - "PRIMARY Color" @@ -69,7 +63,11 @@ pub fn ButtonPage() -> impl IntoView { - "#, "rust")> + "#, + "rust" + ) + > + "" @@ -79,30 +77,47 @@ pub fn ButtonPage() -> impl IntoView { - + - "#, "rust")> + "#, + "rust" + ) + > + "" - +

"style"

- "style blue" - "#, "rust")> + "#, + "rust" + ) + > + "" @@ -133,7 +148,10 @@ pub fn LoadingButton() -> impl IntoView { "Click Me" - impl IntoView { } - "#, "rust")> + "#, + "rust" + ) + > + "" diff --git a/gh-pages/src/pages/checkbox/mod.rs b/gh-pages/src/pages/checkbox/mod.rs index 73b625e..53521e8 100644 --- a/gh-pages/src/pages/checkbox/mod.rs +++ b/gh-pages/src/pages/checkbox/mod.rs @@ -13,10 +13,11 @@ pub fn CheckboxPage() -> impl IntoView {

"Checkbox"

- - "Click" - - "Click" + impl IntoView { "Click" } - "#, "rust")> + "#, + "rust" + ) + > + ""

"group"

- - - + + + -
- "value: " { move || format!("{:?}", value.get()) } -
- "value: " {move || format!("{:?}", value.get())}
+ impl IntoView { } - "#, "rust")> + "#, + "rust" + ) + > + "" diff --git a/gh-pages/src/pages/components.rs b/gh-pages/src/pages/components.rs index a559a0c..f59ef19 100644 --- a/gh-pages/src/pages/components.rs +++ b/gh-pages/src/pages/components.rs @@ -32,31 +32,31 @@ pub fn ComponentsPage() -> impl IntoView { }); view! { - + - - - - - - - - - - + + + + + + + + + + - - - + + + - + diff --git a/gh-pages/src/pages/home.rs b/gh-pages/src/pages/home.rs index c96dc6c..a027388 100644 --- a/gh-pages/src/pages/home.rs +++ b/gh-pages/src/pages/home.rs @@ -10,21 +10,24 @@ pub fn Home() -> impl IntoView { navigate(path, Default::default()); } view! { - -

- "Melt UI" -

+ +

"Melt UI"

"An easy to use leptos component library"

- + diff --git a/gh-pages/src/pages/image/mod.rs b/gh-pages/src/pages/image/mod.rs index 30cd0bc..96f2213 100644 --- a/gh-pages/src/pages/image/mod.rs +++ b/gh-pages/src/pages/image/mod.rs @@ -11,10 +11,17 @@ pub fn ImagePage() -> impl IntoView { - - "#, "rust")> + "#, + "rust" + ) + > + "" diff --git a/gh-pages/src/pages/input/mod.rs b/gh-pages/src/pages/input/mod.rs index 2656311..8b343af 100644 --- a/gh-pages/src/pages/input/mod.rs +++ b/gh-pages/src/pages/input/mod.rs @@ -11,14 +11,21 @@ pub fn InputPage() -> impl IntoView {

"Input"

- - + - "#, "rust")> - "" + "#, + "rust" + ) + > + + "" "" diff --git a/gh-pages/src/pages/menu/mod.rs b/gh-pages/src/pages/menu/mod.rs index 3aa1129..1c4c0ed 100644 --- a/gh-pages/src/pages/menu/mod.rs +++ b/gh-pages/src/pages/menu/mod.rs @@ -14,14 +14,21 @@ pub fn MenuPage() -> impl IntoView { - - "#, "rust")> + "#, + "rust" + ) + > + "" diff --git a/gh-pages/src/pages/mobile.rs b/gh-pages/src/pages/mobile.rs index 0b71fa1..01936a5 100644 --- a/gh-pages/src/pages/mobile.rs +++ b/gh-pages/src/pages/mobile.rs @@ -4,7 +4,10 @@ use leptos::*; pub fn MobilePage(path: &'static str) -> impl IntoView { view! {
-
} } diff --git a/gh-pages/src/pages/modal/mod.rs b/gh-pages/src/pages/modal/mod.rs index 5f9e906..d972efc 100644 --- a/gh-pages/src/pages/modal/mod.rs +++ b/gh-pages/src/pages/modal/mod.rs @@ -10,13 +10,14 @@ pub fn ModalPage() -> impl IntoView {

"Modal"

- + "hello" - @@ -25,7 +26,11 @@ pub fn ModalPage() -> impl IntoView { "hello" - "#, "rust")> + "#, + "rust" + ) + > + "" diff --git a/gh-pages/src/pages/nav_bar/mod.rs b/gh-pages/src/pages/nav_bar/mod.rs index 67b457f..3eee9fb 100644 --- a/gh-pages/src/pages/nav_bar/mod.rs +++ b/gh-pages/src/pages/nav_bar/mod.rs @@ -14,7 +14,10 @@ pub fn NavBarPage() -> impl IntoView {

"Navbar"

"" - impl IntoView { click_left=click_left click_right=click_right /> - "#, "rust")> + "#, + "rust" + ) + > + ""
- +
} @@ -45,10 +52,15 @@ pub fn NavBarDemoPage() -> impl IntoView { view! {
- -
- { move || click_text.get() } -
+ +
{move || click_text.get()}
} } diff --git a/gh-pages/src/pages/select/mod.rs b/gh-pages/src/pages/select/mod.rs index 5cade38..2b2266f 100644 --- a/gh-pages/src/pages/select/mod.rs +++ b/gh-pages/src/pages/select/mod.rs @@ -16,7 +16,10 @@ pub fn SelectPage() -> impl IntoView {

"Select"

- "#, "rust")> + "#, + "rust" + ) + > + "" diff --git a/gh-pages/src/pages/slider/mod.rs b/gh-pages/src/pages/slider/mod.rs index c8d1b35..6600381 100644 --- a/gh-pages/src/pages/slider/mod.rs +++ b/gh-pages/src/pages/slider/mod.rs @@ -12,11 +12,18 @@ pub fn SliderPage() -> impl IntoView {

"Slider"

- - "#, "rust")> + "#, + "rust" + ) + > + "" diff --git a/gh-pages/src/pages/space/mod.rs b/gh-pages/src/pages/space/mod.rs index 1a423cc..d8c9be2 100644 --- a/gh-pages/src/pages/space/mod.rs +++ b/gh-pages/src/pages/space/mod.rs @@ -14,13 +14,20 @@ pub fn SpacePage() -> impl IntoView { - - "#, "rust")> + "#, + "rust" + ) + > + "" @@ -31,13 +38,20 @@ pub fn SpacePage() -> impl IntoView { - - "#, "rust")> + "#, + "rust" + ) + > + "" @@ -53,7 +67,10 @@ pub fn SpacePage() -> impl IntoView { - @@ -64,7 +81,11 @@ pub fn SpacePage() -> impl IntoView { - "#, "rust")> + "#, + "rust" + ) + > + "" diff --git a/gh-pages/src/pages/tabbar/mod.rs b/gh-pages/src/pages/tabbar/mod.rs index 3af079b..9868e49 100644 --- a/gh-pages/src/pages/tabbar/mod.rs +++ b/gh-pages/src/pages/tabbar/mod.rs @@ -14,7 +14,10 @@ pub fn TabbarPage() -> impl IntoView {

"Tabbar"

"" - @@ -28,13 +31,17 @@ pub fn TabbarPage() -> impl IntoView { "or" - "#, "rust")> + "#, + "rust" + ) + > + ""
- +
} @@ -45,14 +52,9 @@ pub fn TabbarDemoPage() -> impl IntoView { let selected = create_rw_signal(String::from("o")); view! {
- { move || selected.get() } - - - "and" - - - "if" - + {move || selected.get()} + "and" + "if" "or" diff --git a/gh-pages/src/pages/tabs/mod.rs b/gh-pages/src/pages/tabs/mod.rs index 039abbf..22691a2 100644 --- a/gh-pages/src/pages/tabs/mod.rs +++ b/gh-pages/src/pages/tabs/mod.rs @@ -18,7 +18,10 @@ pub fn TabsPage() -> impl IntoView { "pear" - @@ -28,7 +31,11 @@ pub fn TabsPage() -> impl IntoView { "pear" - "#, "rust")> + "#, + "rust" + ) + > + "" diff --git a/gh-pages/src/pages/toast/mod.rs b/gh-pages/src/pages/toast/mod.rs index 1680a89..e437826 100644 --- a/gh-pages/src/pages/toast/mod.rs +++ b/gh-pages/src/pages/toast/mod.rs @@ -16,7 +16,10 @@ pub fn ToastPage() -> impl IntoView {

"Toast"

"" - impl IntoView { }); count.set(count.get_untracked() + 1); }; - "#, "rust")> + "#, + "rust" + ) + > + ""
- +
} diff --git a/src/button/mod.rs b/src/button/mod.rs index 9a43c15..21ee386 100644 --- a/src/button/mod.rs +++ b/src/button/mod.rs @@ -119,25 +119,28 @@ pub fn Button( class=("melt-button--disabled", move || disabled.get()) style=move || format!("{}{}", css_vars.get(), style.get()) on:click=on_click - > - { - move || { - if loading.get() { - view! { - - }.into() - } else if let Some(icon) = icon { - view! { - - }.into() - } else { - None - } + > + {move || { + if loading.get() { + view! { + } + .into() + } else if let Some(icon) = icon { + view! { }.into() + } else { + None } - - { children() } - + }} + + + {children()} + } } diff --git a/src/card/mod.rs b/src/card/mod.rs index 2c29503..b4be4fd 100644 --- a/src/card/mod.rs +++ b/src/card/mod.rs @@ -36,37 +36,29 @@ pub fn Card( view! {
- - -
-
- - - { title.get() } - - { (header.children)() } - -
- -
- { (header_extra.children)() } -
+ + +
+
+ + {title.get()} + {(header.children)()}
- - -
- { children() } -
+ +
{(header_extra.children)()}
+
+
+
+
+
{children()}
- + - + -
+
} } diff --git a/src/checkbox/checkbox_item.rs b/src/checkbox/checkbox_item.rs index b4359b7..cb08f48 100644 --- a/src/checkbox/checkbox_item.rs +++ b/src/checkbox/checkbox_item.rs @@ -32,9 +32,5 @@ pub fn CheckboxItem( item_key.get_value() }; - view! { - - { label } - - } + view! { {label} } } diff --git a/src/checkbox/mod.rs b/src/checkbox/mod.rs index c1e16e2..be0b940 100644 --- a/src/checkbox/mod.rs +++ b/src/checkbox/mod.rs @@ -30,9 +30,13 @@ pub fn Checkbox( }); view! { -
- +
+
@@ -40,9 +44,7 @@ pub fn Checkbox(
-
- { children() } -
+
{children()}
} } diff --git a/src/code/mod.rs b/src/code/mod.rs index e1aa131..19d921a 100644 --- a/src/code/mod.rs +++ b/src/code/mod.rs @@ -2,9 +2,5 @@ use leptos::*; #[component] pub fn Code(children: Children) -> impl IntoView { - view! { - - { children() } - - } + view! { {children()} } } diff --git a/src/image/mod.rs b/src/image/mod.rs index 2ec76d3..9b362be 100644 --- a/src/image/mod.rs +++ b/src/image/mod.rs @@ -30,7 +30,11 @@ pub fn Image( style }; view! { - - move + move } } diff --git a/src/input/mod.rs b/src/input/mod.rs index 2e43749..d179c4a 100644 --- a/src/input/mod.rs +++ b/src/input/mod.rs @@ -49,7 +49,12 @@ pub fn Input( }); view! {
- +
} } diff --git a/src/layout/layout_header.rs b/src/layout/layout_header.rs index aa8bff8..efbc081 100644 --- a/src/layout/layout_header.rs +++ b/src/layout/layout_header.rs @@ -7,7 +7,7 @@ pub fn LayoutHeader( ) -> impl IntoView { view! {
- { children() } + {children()}
} } diff --git a/src/layout/layout_sider.rs b/src/layout/layout_sider.rs index 950e2b6..3fd9d74 100644 --- a/src/layout/layout_sider.rs +++ b/src/layout/layout_sider.rs @@ -9,7 +9,7 @@ pub fn LayoutSider( mount_style("layout-sider", include_str!("./layout-sider.css")); view! {
- { children() } + {children()}
} } diff --git a/src/layout/mod.rs b/src/layout/mod.rs index 56cb3e1..e8089cd 100644 --- a/src/layout/mod.rs +++ b/src/layout/mod.rs @@ -39,8 +39,12 @@ pub fn Layout( style }); view! { -
- { children() } +
+ {children()}
} } diff --git a/src/menu/menu_group.rs b/src/menu/menu_group.rs index 46989d9..f74d43b 100644 --- a/src/menu/menu_group.rs +++ b/src/menu/menu_group.rs @@ -14,8 +14,8 @@ pub fn MenuGroup(label: &'static str, children: Children) -> impl IntoView { }); view! {
- { label } + {label}
- { children() } + {children()} } } diff --git a/src/menu/menu_item.rs b/src/menu/menu_item.rs index 0f2d610..6319b75 100644 --- a/src/menu/menu_item.rs +++ b/src/menu/menu_item.rs @@ -29,8 +29,13 @@ pub fn MenuItem( }); view! {
-
- { move || label.get() } +
+ {move || label.get()}
} diff --git a/src/menu/mod.rs b/src/menu/mod.rs index df23d8f..f69af91 100644 --- a/src/menu/mod.rs +++ b/src/menu/mod.rs @@ -30,11 +30,7 @@ pub fn Menu( } }); provide_context(menu_injection_key); - view! { -
- { children() } -
- } + view! {
{children()}
} } #[derive(Clone)] diff --git a/src/mobile/nav_bar/mod.rs b/src/mobile/nav_bar/mod.rs index 920fa40..3dfbcdf 100644 --- a/src/mobile/nav_bar/mod.rs +++ b/src/mobile/nav_bar/mod.rs @@ -26,7 +26,7 @@ pub fn NavBar( view! {
- +
@@ -34,17 +34,15 @@ pub fn NavBar( - { left_text.get() } + {left_text.get()}
-
- { move || title.get() } -
- +
{move || title.get()}
+
- { right_text.get() } + {right_text.get()}
diff --git a/src/mobile/tabbar/mod.rs b/src/mobile/tabbar/mod.rs index 00c1b2e..64cb234 100644 --- a/src/mobile/tabbar/mod.rs +++ b/src/mobile/tabbar/mod.rs @@ -26,11 +26,7 @@ pub fn Tabbar(#[prop(into)] selected: RwSignal, children: Children) -> i } }); provide_context(tabbar_injection_key); - view! { -
- { children() } -
- } + view! {
{children()}
} } #[derive(Clone)] diff --git a/src/mobile/tabbar/tabbar_item.rs b/src/mobile/tabbar/tabbar_item.rs index e2ec18c..0f3bf20 100644 --- a/src/mobile/tabbar/tabbar_item.rs +++ b/src/mobile/tabbar/tabbar_item.rs @@ -25,13 +25,16 @@ pub fn TabbarItem( }); view! { -
+
-
- { children() } -
+
{children()}
} } diff --git a/src/mobile/toast/mod.rs b/src/mobile/toast/mod.rs index ad43719..4158c00 100644 --- a/src/mobile/toast/mod.rs +++ b/src/mobile/toast/mod.rs @@ -12,11 +12,7 @@ pub fn show_toast(options: ToastOptions) { mount_style("toast", include_str!("./toast.css")); let parent = Element::from(document().body().expect("body element not to exist")); - let children = view! { -
- { options.message } -
- }; + let children = view! {
{options.message}
}; let node = children.into_view(); #[cfg(all(target_arch = "wasm32"))] diff --git a/src/modal/mod.rs b/src/modal/mod.rs index 7f6dfb3..e63b1b3 100644 --- a/src/modal/mod.rs +++ b/src/modal/mod.rs @@ -21,24 +21,25 @@ pub fn Modal( view! { -
+
- - { title.get() } - + {title.get()} - { children() } + {children()} - { (footer.children)() } + {(footer.children)()} diff --git a/src/progress/mod.rs b/src/progress/mod.rs index 2172637..ef2eff8 100644 --- a/src/progress/mod.rs +++ b/src/progress/mod.rs @@ -12,10 +12,8 @@ pub fn Progress( view! {
- - - { left_tip.get() } - + + {left_tip.get()} @@ -24,12 +22,10 @@ pub fn Progress( - - - { right_tip.get() } - + + {right_tip.get()} -
+
} } diff --git a/src/select/mod.rs b/src/select/mod.rs index 6da56d7..9638c68 100644 --- a/src/select/mod.rs +++ b/src/select/mod.rs @@ -85,30 +85,49 @@ where }); view! {
- { - move || select_option_label.get() - } + + {move || select_option_label.get()} +
-
+
- { item.get_value().label } +
+ {item.get_value().label}
} } - > -
+ /> +
} diff --git a/src/slider/mod.rs b/src/slider/mod.rs index b620707..9b1c825 100644 --- a/src/slider/mod.rs +++ b/src/slider/mod.rs @@ -68,9 +68,20 @@ pub fn Slider( view! {
-
+
-
+
} diff --git a/src/space/mod.rs b/src/space/mod.rs index b6ba89a..43cb60a 100644 --- a/src/space/mod.rs +++ b/src/space/mod.rs @@ -27,16 +27,20 @@ pub fn Space( }; view! { -
- { - children().nodes.into_iter().map(|node| { - view! { -
- {node} -
- } - }).collect::>() - } +
+ + {children() + .nodes + .into_iter() + .map(|node| { + view! {
{node}
} + }) + .collect::>()} +
} } diff --git a/src/table/mod.rs b/src/table/mod.rs index 0b3cc9b..0493fa3 100644 --- a/src/table/mod.rs +++ b/src/table/mod.rs @@ -4,9 +4,5 @@ use leptos::*; #[component] pub fn Table(children: Children) -> impl IntoView { mount_style("table", include_str!("./table.css")); - view! { - - {children()} -
- } + view! { {children()}
} } diff --git a/src/tabs/mod.rs b/src/tabs/mod.rs index 1cdf197..2a6af9b 100644 --- a/src/tabs/mod.rs +++ b/src/tabs/mod.rs @@ -36,41 +36,50 @@ pub fn Tabs(active_key: RwSignal<&'static str>, children: Children) -> impl Into view! {
- (); - create_effect( move |_| { - let Some(label) = label_ref.get() else { - return; + (); + create_effect(move |_| { + let Some(label) = label_ref.get() else { return; }; - let Some(label_list) = label_list_ref.get() else { - return; + let Some(label_list) = label_list_ref.get() else { return; }; - if options.key == active_key.get() { - request_animation_frame(move || { - let list_rect = label_list.get_bounding_client_rect(); - let rect = label.get_bounding_client_rect(); - label_line.set(Some(TabsLabelLine { - width: rect.width(), - left: rect.left() - list_rect.left(), - })); - }); + if options.key == active_key.get() { + request_animation_frame(move || { + let list_rect = label_list.get_bounding_client_rect(); + let rect = label.get_bounding_client_rect(); + label_line + .set( + Some(TabsLabelLine { + width: rect.width(), + left: rect.left() - list_rect.left(), + }), + ); + }); + } + }); + view! { + + {options.label} + } - }); - view! { - - { options.label } - } - }> - + /> +
-
- { children() } -
+
{children()}
} } diff --git a/src/tabs/tab.rs b/src/tabs/tab.rs index 53889f5..c9fddd9 100644 --- a/src/tabs/tab.rs +++ b/src/tabs/tab.rs @@ -14,8 +14,8 @@ pub fn Tab(key: &'static str, label: &'static str, children: Children) -> impl I let tabs = use_tabs(); tabs.push_tab_options(TabOptions { key, label }); view! { -
- { children() } +
+ {children()}
} } diff --git a/src/teleport/mod.rs b/src/teleport/mod.rs index 2e8fd0e..fe036ec 100644 --- a/src/teleport/mod.rs +++ b/src/teleport/mod.rs @@ -26,5 +26,5 @@ pub fn Teleport(#[prop(optional)] to: Option<&'static str>, children: Children) _ = children; } - view! { <> } + view! { <> } } diff --git a/src/wave/mod.rs b/src/wave/mod.rs index 893256c..3d7a90e 100644 --- a/src/wave/mod.rs +++ b/src/wave/mod.rs @@ -22,7 +22,7 @@ pub fn Wave(children: Children) -> impl IntoView { }); view! {
- { children() } + {children()}
} }