diff --git a/book-examples/dioxus/src/icons.rs b/book-examples/dioxus/src/icons.rs index a3a44a5..d449bca 100644 --- a/book-examples/dioxus/src/icons.rs +++ b/book-examples/dioxus/src/icons.rs @@ -8321,6 +8321,12 @@ pub fn IconsS2() -> Element { }, "Split", ), + ( + rsx! { + Spool {} + }, + "Spool", + ), ( rsx! { SprayCan {} @@ -8831,12 +8837,6 @@ pub fn IconsS2() -> Element { }, "Sun", ), - ( - rsx! { - SunDim {} - }, - "Sun Dim", - ), ]; rsx! { for (icon , name) in icons { @@ -8852,6 +8852,12 @@ pub fn IconsS2() -> Element { #[component] pub fn IconsS3() -> Element { let icons = [ + ( + rsx! { + SunDim {} + }, + "Sun Dim", + ), ( rsx! { SunMedium {} diff --git a/book-examples/leptos/src/icons.rs b/book-examples/leptos/src/icons.rs index 477ee29..464d953 100644 --- a/book-examples/leptos/src/icons.rs +++ b/book-examples/leptos/src/icons.rs @@ -1721,6 +1721,7 @@ pub fn IconsS() -> impl IntoView { (view! { }.into_any(), "Spline"), (view! { }.into_any(), "Spline Pointer"), (view! { }.into_any(), "Split"), + (view! { }.into_any(), "Spool"), (view! { }.into_any(), "Spray Can"), (view! { }.into_any(), "Sprout"), (view! { }.into_any(), "Square"), diff --git a/book-examples/yew/src/icons.rs b/book-examples/yew/src/icons.rs index 76ab56c..c7d3151 100644 --- a/book-examples/yew/src/icons.rs +++ b/book-examples/yew/src/icons.rs @@ -1740,6 +1740,7 @@ pub fn IconsS() -> Html { (html! { }, "Spline"), (html! { }, "Spline Pointer"), (html! { }, "Split"), + (html! { }, "Spool"), (html! { }, "Spray Can"), (html! { }, "Sprout"), (html! { }, "Square"), diff --git a/packages/dioxus/src/blocks.rs b/packages/dioxus/src/blocks.rs index 3bb1225..2ab27a1 100644 --- a/packages/dioxus/src/blocks.rs +++ b/packages/dioxus/src/blocks.rs @@ -34,14 +34,14 @@ pub fn Blocks(props: BlocksProps) -> Element { "stroke-width": "{stroke_width}", "stroke-linecap": "round", "stroke-linejoin": "round", + path { "d": "M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2" } rect { - "width": "7", - "height": "7", "x": "14", - "y": "3", + "y": "2", + "width": "8", + "height": "8", "rx": "1", } - path { "d": "M10 21V8a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-5a1 1 0 0 0-1-1H3" } } } } diff --git a/packages/dioxus/src/lib.rs b/packages/dioxus/src/lib.rs index 996d710..0584827 100644 --- a/packages/dioxus/src/lib.rs +++ b/packages/dioxus/src/lib.rs @@ -419,7 +419,7 @@ mod bitcoin; mod blend; #[cfg(feature = "home")] mod blinds; -#[cfg(any(feature = "development", feature = "shapes"))] +#[cfg(any(feature = "development", feature = "layout", feature = "shapes"))] mod blocks; #[cfg(any(feature = "connectivity", feature = "devices"))] mod bluetooth; @@ -3319,6 +3319,8 @@ mod spline; mod spline_pointer; #[cfg(any(feature = "development", feature = "arrows"))] mod split; +#[cfg(any(feature = "communication", feature = "tools", feature = "social"))] +mod spool; #[cfg(any(feature = "design", feature = "tools"))] mod spray_can; #[cfg(any(feature = "nature", feature = "gaming", feature = "sustainability"))] @@ -4493,7 +4495,7 @@ pub use bitcoin::*; pub use blend::*; #[cfg(feature = "home")] pub use blinds::*; -#[cfg(any(feature = "development", feature = "shapes"))] +#[cfg(any(feature = "development", feature = "layout", feature = "shapes"))] pub use blocks::*; #[cfg(any(feature = "connectivity", feature = "devices"))] pub use bluetooth::*; @@ -7393,6 +7395,8 @@ pub use spline::*; pub use spline_pointer::*; #[cfg(any(feature = "development", feature = "arrows"))] pub use split::*; +#[cfg(any(feature = "communication", feature = "tools", feature = "social"))] +pub use spool::*; #[cfg(any(feature = "design", feature = "tools"))] pub use spray_can::*; #[cfg(any(feature = "nature", feature = "gaming", feature = "sustainability"))] diff --git a/packages/dioxus/src/spool.rs b/packages/dioxus/src/spool.rs new file mode 100644 index 0000000..fe33070 --- /dev/null +++ b/packages/dioxus/src/spool.rs @@ -0,0 +1,41 @@ +use dioxus::prelude::*; +#[derive(Clone, PartialEq, Props)] +pub struct SpoolProps { + #[props(default = 24)] + pub size: usize, + #[props(default = "currentColor".to_owned())] + pub color: String, + #[props(default = "none".to_owned())] + pub fill: String, + #[props(default = 2)] + pub stroke_width: usize, + #[props(default = false)] + pub absolute_stroke_width: bool, + pub class: Option, + pub style: Option, +} +#[component] +pub fn Spool(props: SpoolProps) -> Element { + let stroke_width = if props.absolute_stroke_width { + props.stroke_width * 24 / props.size + } else { + props.stroke_width + }; + rsx! { + svg { + "xmlns": "http://www.w3.org/2000/svg", + "class": if let Some(class) = props.class { "{class}" }, + "style": if let Some(style) = props.style { "{style}" }, + "width": "{props.size}", + "height": "{props.size}", + "viewBox": "0 0 24 24", + "fill": "{props.fill}", + "stroke": "{props.color}", + "stroke-width": "{stroke_width}", + "stroke-linecap": "round", + "stroke-linejoin": "round", + path { "d": "M17 13.44 4.442 17.082A2 2 0 0 0 4.982 21H19a2 2 0 0 0 .558-3.921l-1.115-.32A2 2 0 0 1 17 14.837V7.66" } + path { "d": "m7 10.56 12.558-3.642A2 2 0 0 0 19.018 3H5a2 2 0 0 0-.558 3.921l1.115.32A2 2 0 0 1 7 9.163v7.178" } + } + } +} diff --git a/packages/leptos/src/blocks.rs b/packages/leptos/src/blocks.rs index 1c34058..ed78a33 100644 --- a/packages/leptos/src/blocks.rs +++ b/packages/leptos/src/blocks.rs @@ -29,8 +29,8 @@ pub fn Blocks( stroke-linecap="round" stroke-linejoin="round" > - - + + } } diff --git a/packages/leptos/src/lib.rs b/packages/leptos/src/lib.rs index cd6c046..c9d855c 100644 --- a/packages/leptos/src/lib.rs +++ b/packages/leptos/src/lib.rs @@ -419,7 +419,7 @@ mod bitcoin; mod blend; #[cfg(feature = "home")] mod blinds; -#[cfg(any(feature = "development", feature = "shapes"))] +#[cfg(any(feature = "development", feature = "layout", feature = "shapes"))] mod blocks; #[cfg(any(feature = "connectivity", feature = "devices"))] mod bluetooth; @@ -3319,6 +3319,8 @@ mod spline; mod spline_pointer; #[cfg(any(feature = "development", feature = "arrows"))] mod split; +#[cfg(any(feature = "communication", feature = "tools", feature = "social"))] +mod spool; #[cfg(any(feature = "design", feature = "tools"))] mod spray_can; #[cfg(any(feature = "nature", feature = "gaming", feature = "sustainability"))] @@ -4493,7 +4495,7 @@ pub use bitcoin::*; pub use blend::*; #[cfg(feature = "home")] pub use blinds::*; -#[cfg(any(feature = "development", feature = "shapes"))] +#[cfg(any(feature = "development", feature = "layout", feature = "shapes"))] pub use blocks::*; #[cfg(any(feature = "connectivity", feature = "devices"))] pub use bluetooth::*; @@ -7393,6 +7395,8 @@ pub use spline::*; pub use spline_pointer::*; #[cfg(any(feature = "development", feature = "arrows"))] pub use split::*; +#[cfg(any(feature = "communication", feature = "tools", feature = "social"))] +pub use spool::*; #[cfg(any(feature = "design", feature = "tools"))] pub use spray_can::*; #[cfg(any(feature = "nature", feature = "gaming", feature = "sustainability"))] diff --git a/packages/leptos/src/spool.rs b/packages/leptos/src/spool.rs new file mode 100644 index 0000000..40cede7 --- /dev/null +++ b/packages/leptos/src/spool.rs @@ -0,0 +1,36 @@ +use leptos::{prelude::*, svg::Svg}; +#[component] +pub fn Spool( + #[prop(default = 24.into(), into)] size: Signal, + #[prop(default = "currentColor".into(), into)] color: Signal, + #[prop(default = "none".into(), into)] fill: Signal, + #[prop(default = 2.into(), into)] stroke_width: Signal, + #[prop(default = false.into(), into)] absolute_stroke_width: Signal, + #[prop(optional)] node_ref: NodeRef, +) -> impl IntoView { + let stroke_width = Signal::derive(move || { + if absolute_stroke_width.get() { + stroke_width.get() * 24 / size.get() + } else { + stroke_width.get() + } + }); + view! { + + + + + } +} diff --git a/packages/yew/src/blocks.rs b/packages/yew/src/blocks.rs index c52ebfc..695439e 100644 --- a/packages/yew/src/blocks.rs +++ b/packages/yew/src/blocks.rs @@ -41,10 +41,10 @@ pub fn Blocks(props: &BlocksProps) -> Html { stroke-linecap="round" stroke-linejoin="round" > - + } } diff --git a/packages/yew/src/lib.rs b/packages/yew/src/lib.rs index 5a7238a..1e2c376 100644 --- a/packages/yew/src/lib.rs +++ b/packages/yew/src/lib.rs @@ -421,7 +421,7 @@ mod bitcoin; mod blend; #[cfg(feature = "home")] mod blinds; -#[cfg(any(feature = "development", feature = "shapes"))] +#[cfg(any(feature = "development", feature = "layout", feature = "shapes"))] mod blocks; #[cfg(any(feature = "connectivity", feature = "devices"))] mod bluetooth; @@ -3321,6 +3321,8 @@ mod spline; mod spline_pointer; #[cfg(any(feature = "development", feature = "arrows"))] mod split; +#[cfg(any(feature = "communication", feature = "tools", feature = "social"))] +mod spool; #[cfg(any(feature = "design", feature = "tools"))] mod spray_can; #[cfg(any(feature = "nature", feature = "gaming", feature = "sustainability"))] @@ -4495,7 +4497,7 @@ pub use bitcoin::*; pub use blend::*; #[cfg(feature = "home")] pub use blinds::*; -#[cfg(any(feature = "development", feature = "shapes"))] +#[cfg(any(feature = "development", feature = "layout", feature = "shapes"))] pub use blocks::*; #[cfg(any(feature = "connectivity", feature = "devices"))] pub use bluetooth::*; @@ -7395,6 +7397,8 @@ pub use spline::*; pub use spline_pointer::*; #[cfg(any(feature = "development", feature = "arrows"))] pub use split::*; +#[cfg(any(feature = "communication", feature = "tools", feature = "social"))] +pub use spool::*; #[cfg(any(feature = "design", feature = "tools"))] pub use spray_can::*; #[cfg(any(feature = "nature", feature = "gaming", feature = "sustainability"))] diff --git a/packages/yew/src/spool.rs b/packages/yew/src/spool.rs new file mode 100644 index 0000000..9c9272d --- /dev/null +++ b/packages/yew/src/spool.rs @@ -0,0 +1,52 @@ +use yew::prelude::*; +#[derive(PartialEq, Properties)] +pub struct SpoolProps { + #[prop_or(24)] + pub size: usize, + #[prop_or(AttrValue::from("currentColor"))] + pub color: AttrValue, + #[prop_or(AttrValue::from("none"))] + pub fill: AttrValue, + #[prop_or(2)] + pub stroke_width: usize, + #[prop_or(false)] + pub absolute_stroke_width: bool, + #[prop_or_default] + pub class: Classes, + #[prop_or_default] + pub style: std::option::Option, + #[prop_or_default] + pub node_ref: NodeRef, +} +#[function_component] +pub fn Spool(props: &SpoolProps) -> Html { + let stroke_width = if props.absolute_stroke_width { + props.stroke_width * 24 / props.size + } else { + props.stroke_width + }; + html! { + + + + + } +} diff --git a/scripts/src/lib.rs b/scripts/src/lib.rs index a29bd06..cb2471f 100644 --- a/scripts/src/lib.rs +++ b/scripts/src/lib.rs @@ -11,5 +11,5 @@ pub const GITHUB_OWNER: &str = "RustForWeb"; pub const GITHUB_REPO: &str = "lucide"; pub const UPSTREAM_GIT_URL: &str = "https://github.com/lucide-icons/lucide.git"; -pub const UPSTREAM_GIT_REF: &str = "0.518.0"; +pub const UPSTREAM_GIT_REF: &str = "0.519.0"; pub const UPSTREAM_GITHUB_URL: &str = "https://github.com/lucide-icons/lucide";