From 190f09e88ef80a3948366c67985965907997ec2e Mon Sep 17 00:00:00 2001 From: "rust-for-web[bot]" <191031261+rust-for-web[bot]@users.noreply.github.com> Date: Thu, 26 Jun 2025 09:12:03 +0200 Subject: [PATCH] feat: update to upstream v0.522.0 (#102) Co-authored-by: rust-for-web[bot] <191031261+rust-for-web[bot]@users.noreply.github.com> --- book-examples/dioxus/src/icons.rs | 6 ++++ book-examples/leptos/src/icons.rs | 1 + book-examples/yew/src/icons.rs | 1 + packages/dioxus/src/lib.rs | 4 +++ packages/dioxus/src/line_squiggle.rs | 40 +++++++++++++++++++++++ packages/dioxus/src/shopping_bag.rs | 4 +-- packages/leptos/src/lib.rs | 4 +++ packages/leptos/src/line_squiggle.rs | 35 ++++++++++++++++++++ packages/leptos/src/shopping_bag.rs | 4 +-- packages/yew/src/lib.rs | 4 +++ packages/yew/src/line_squiggle.rs | 49 ++++++++++++++++++++++++++++ packages/yew/src/shopping_bag.rs | 6 ++-- scripts/src/lib.rs | 2 +- 13 files changed, 153 insertions(+), 7 deletions(-) create mode 100644 packages/dioxus/src/line_squiggle.rs create mode 100644 packages/leptos/src/line_squiggle.rs create mode 100644 packages/yew/src/line_squiggle.rs diff --git a/book-examples/dioxus/src/icons.rs b/book-examples/dioxus/src/icons.rs index 5b3eecf..01023f3 100644 --- a/book-examples/dioxus/src/icons.rs +++ b/book-examples/dioxus/src/icons.rs @@ -5426,6 +5426,12 @@ pub fn IconsL1() -> Element { }, "Lightbulb Off", ), + ( + rsx! { + LineSquiggle {} + }, + "Line Squiggle", + ), ( rsx! { Link {} diff --git a/book-examples/leptos/src/icons.rs b/book-examples/leptos/src/icons.rs index 6453f6d..b8a0a0f 100644 --- a/book-examples/leptos/src/icons.rs +++ b/book-examples/leptos/src/icons.rs @@ -1139,6 +1139,7 @@ pub fn IconsL() -> impl IntoView { (view! { }.into_any(), "Ligature"), (view! { }.into_any(), "Lightbulb"), (view! { }.into_any(), "Lightbulb Off"), + (view! { }.into_any(), "Line Squiggle"), (view! { }.into_any(), "Link"), (view! { }.into_any(), "Link 2"), (view! { }.into_any(), "Link 2 Off"), diff --git a/book-examples/yew/src/icons.rs b/book-examples/yew/src/icons.rs index c23f5d2..b996f66 100644 --- a/book-examples/yew/src/icons.rs +++ b/book-examples/yew/src/icons.rs @@ -1165,6 +1165,7 @@ pub fn IconsL() -> Html { (html! { }, "Ligature"), (html! { }, "Lightbulb"), (html! { }, "Lightbulb Off"), + (html! { }, "Line Squiggle"), (html! { }, "Link"), (html! { }, "Link 2"), (html! { }, "Link 2 Off"), diff --git a/packages/dioxus/src/lib.rs b/packages/dioxus/src/lib.rs index 0cca4e2..9fc3fa2 100644 --- a/packages/dioxus/src/lib.rs +++ b/packages/dioxus/src/lib.rs @@ -2105,6 +2105,8 @@ mod ligature; mod lightbulb; #[cfg(feature = "photography")] mod lightbulb_off; +#[cfg(any(feature = "shapes", feature = "math", feature = "design"))] +mod line_squiggle; #[cfg(any(feature = "text", feature = "account"))] mod link; #[cfg(any(feature = "text", feature = "account"))] @@ -6185,6 +6187,8 @@ pub use ligature::*; pub use lightbulb::*; #[cfg(feature = "photography")] pub use lightbulb_off::*; +#[cfg(any(feature = "shapes", feature = "math", feature = "design"))] +pub use line_squiggle::*; #[cfg(any(feature = "text", feature = "account"))] pub use link::*; #[cfg(any(feature = "text", feature = "account"))] diff --git a/packages/dioxus/src/line_squiggle.rs b/packages/dioxus/src/line_squiggle.rs new file mode 100644 index 0000000..da4b00f --- /dev/null +++ b/packages/dioxus/src/line_squiggle.rs @@ -0,0 +1,40 @@ +use dioxus::prelude::*; +#[derive(Clone, PartialEq, Props)] +pub struct LineSquiggleProps { + #[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 LineSquiggle(props: LineSquiggleProps) -> 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": "M7 3.5c5-2 7 2.5 3 4C1.5 10 2 15 5 16c5 2 9-10 14-7s.5 13.5-4 12c-5-2.5.5-11 6-2" } + } + } +} diff --git a/packages/dioxus/src/shopping_bag.rs b/packages/dioxus/src/shopping_bag.rs index f107f87..ac2de8f 100644 --- a/packages/dioxus/src/shopping_bag.rs +++ b/packages/dioxus/src/shopping_bag.rs @@ -34,9 +34,9 @@ pub fn ShoppingBag(props: ShoppingBagProps) -> Element { "stroke-width": "{stroke_width}", "stroke-linecap": "round", "stroke-linejoin": "round", - path { "d": "M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4Z" } - path { "d": "M3 6h18" } path { "d": "M16 10a4 4 0 0 1-8 0" } + path { "d": "M3.103 6.034h17.794" } + path { "d": "M3.4 5.467a2 2 0 0 0-.4 1.2V20a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6.667a2 2 0 0 0-.4-1.2l-2-2.667A2 2 0 0 0 17 2H7a2 2 0 0 0-1.6.8z" } } } } diff --git a/packages/leptos/src/lib.rs b/packages/leptos/src/lib.rs index 67b681d..9c31534 100644 --- a/packages/leptos/src/lib.rs +++ b/packages/leptos/src/lib.rs @@ -2105,6 +2105,8 @@ mod ligature; mod lightbulb; #[cfg(feature = "photography")] mod lightbulb_off; +#[cfg(any(feature = "shapes", feature = "math", feature = "design"))] +mod line_squiggle; #[cfg(any(feature = "text", feature = "account"))] mod link; #[cfg(any(feature = "text", feature = "account"))] @@ -6185,6 +6187,8 @@ pub use ligature::*; pub use lightbulb::*; #[cfg(feature = "photography")] pub use lightbulb_off::*; +#[cfg(any(feature = "shapes", feature = "math", feature = "design"))] +pub use line_squiggle::*; #[cfg(any(feature = "text", feature = "account"))] pub use link::*; #[cfg(any(feature = "text", feature = "account"))] diff --git a/packages/leptos/src/line_squiggle.rs b/packages/leptos/src/line_squiggle.rs new file mode 100644 index 0000000..f5478e4 --- /dev/null +++ b/packages/leptos/src/line_squiggle.rs @@ -0,0 +1,35 @@ +use leptos::{prelude::*, svg::Svg}; +#[component] +pub fn LineSquiggle( + #[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/leptos/src/shopping_bag.rs b/packages/leptos/src/shopping_bag.rs index 1cafbb5..57726f0 100644 --- a/packages/leptos/src/shopping_bag.rs +++ b/packages/leptos/src/shopping_bag.rs @@ -29,9 +29,9 @@ pub fn ShoppingBag( stroke-linecap="round" stroke-linejoin="round" > - - + + } } diff --git a/packages/yew/src/lib.rs b/packages/yew/src/lib.rs index 14fc2b9..f1403a9 100644 --- a/packages/yew/src/lib.rs +++ b/packages/yew/src/lib.rs @@ -2107,6 +2107,8 @@ mod ligature; mod lightbulb; #[cfg(feature = "photography")] mod lightbulb_off; +#[cfg(any(feature = "shapes", feature = "math", feature = "design"))] +mod line_squiggle; #[cfg(any(feature = "text", feature = "account"))] mod link; #[cfg(any(feature = "text", feature = "account"))] @@ -6187,6 +6189,8 @@ pub use ligature::*; pub use lightbulb::*; #[cfg(feature = "photography")] pub use lightbulb_off::*; +#[cfg(any(feature = "shapes", feature = "math", feature = "design"))] +pub use line_squiggle::*; #[cfg(any(feature = "text", feature = "account"))] pub use link::*; #[cfg(any(feature = "text", feature = "account"))] diff --git a/packages/yew/src/line_squiggle.rs b/packages/yew/src/line_squiggle.rs new file mode 100644 index 0000000..613b8b9 --- /dev/null +++ b/packages/yew/src/line_squiggle.rs @@ -0,0 +1,49 @@ +use yew::prelude::*; +#[derive(PartialEq, Properties)] +pub struct LineSquiggleProps { + #[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 LineSquiggle(props: &LineSquiggleProps) -> Html { + let stroke_width = if props.absolute_stroke_width { + props.stroke_width * 24 / props.size + } else { + props.stroke_width + }; + html! { + + + + } +} diff --git a/packages/yew/src/shopping_bag.rs b/packages/yew/src/shopping_bag.rs index 9d61c2d..71c27ee 100644 --- a/packages/yew/src/shopping_bag.rs +++ b/packages/yew/src/shopping_bag.rs @@ -41,9 +41,11 @@ pub fn ShoppingBag(props: &ShoppingBagProps) -> Html { stroke-linecap="round" stroke-linejoin="round" > - - + + } } diff --git a/scripts/src/lib.rs b/scripts/src/lib.rs index a633311..df5e764 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.521.0"; +pub const UPSTREAM_GIT_REF: &str = "0.522.0"; pub const UPSTREAM_GITHUB_URL: &str = "https://github.com/lucide-icons/lucide";