Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions book-examples/dioxus/src/icons.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7595,6 +7595,12 @@ pub fn IconsR1() -> Element {
},
"Roller Coaster",
),
(
rsx! {
Rose {}
},
"Rose",
),
(
rsx! {
Rotate3D {}
Expand Down
1 change: 1 addition & 0 deletions book-examples/leptos/src/icons.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1588,6 +1588,7 @@ pub fn IconsR() -> impl IntoView {
(view! { <Rocket /> }.into_any(), "Rocket"),
(view! { <RockingChair /> }.into_any(), "Rocking Chair"),
(view! { <RollerCoaster /> }.into_any(), "Roller Coaster"),
(view! { <Rose /> }.into_any(), "Rose"),
(view! { <Rotate3D /> }.into_any(), "Rotate 3 D"),
(view! { <RotateCcw /> }.into_any(), "Rotate Ccw"),
(view! { <RotateCcwKey /> }.into_any(), "Rotate Ccw Key"),
Expand Down
1 change: 1 addition & 0 deletions book-examples/yew/src/icons.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1608,6 +1608,7 @@ pub fn IconsR() -> Html {
(html! { <Rocket /> }, "Rocket"),
(html! { <RockingChair /> }, "Rocking Chair"),
(html! { <RollerCoaster /> }, "Roller Coaster"),
(html! { <Rose /> }, "Rose"),
(html! { <Rotate3D /> }, "Rotate 3 D"),
(html! { <RotateCcw /> }, "Rotate Ccw"),
(html! { <RotateCcwKey /> }, "Rotate Ccw Key"),
Expand Down
2 changes: 1 addition & 1 deletion packages/dioxus/src/camera.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub fn Camera(props: CameraProps) -> Element {
"stroke-width": "{stroke_width}",
"stroke-linecap": "round",
"stroke-linejoin": "round",
path { "d": "M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z" }
path { "d": "M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z" }
circle { "cx": "12", "cy": "13", "r": "3" }
}
}
Expand Down
13 changes: 4 additions & 9 deletions packages/dioxus/src/camera_off.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,10 @@ pub fn CameraOff(props: CameraOffProps) -> Element {
"stroke-width": "{stroke_width}",
"stroke-linecap": "round",
"stroke-linejoin": "round",
line {
"x1": "2",
"x2": "22",
"y1": "2",
"y2": "22",
}
path { "d": "M7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16" }
path { "d": "M9.5 4h5L17 7h3a2 2 0 0 1 2 2v7.5" }
path { "d": "M14.121 15.121A3 3 0 1 1 9.88 10.88" }
path { "d": "M14.564 14.558a3 3 0 1 1-4.122-4.121" }
path { "d": "m2 2 20 20" }
path { "d": "M20 20H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 .819-.175" }
path { "d": "M9.695 4.024A2 2 0 0 1 10.004 4h3.993a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v7.344" }
}
}
}
16 changes: 16 additions & 0 deletions packages/dioxus/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2944,6 +2944,14 @@ mod rocket;
mod rocking_chair;
#[cfg(feature = "navigation")]
mod roller_coaster;
#[cfg(any(
feature = "nature",
feature = "seasons",
feature = "sustainability",
feature = "home",
feature = "social"
))]
mod rose;
#[cfg(feature = "design")]
mod rotate_3_d;
#[cfg(any(feature = "arrows", feature = "design", feature = "photography"))]
Expand Down Expand Up @@ -7085,6 +7093,14 @@ pub use rocket::*;
pub use rocking_chair::*;
#[cfg(feature = "navigation")]
pub use roller_coaster::*;
#[cfg(any(
feature = "nature",
feature = "seasons",
feature = "sustainability",
feature = "home",
feature = "social"
))]
pub use rose::*;
#[cfg(feature = "design")]
pub use rotate_3_d::*;
#[cfg(any(feature = "arrows", feature = "design", feature = "photography"))]
Expand Down
44 changes: 44 additions & 0 deletions packages/dioxus/src/rose.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
use dioxus::prelude::*;
#[derive(Clone, PartialEq, Props)]
pub struct RoseProps {
#[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<String>,
pub style: Option<String>,
}
#[component]
pub fn Rose(props: RoseProps) -> 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 10h-1a4 4 0 1 1 4-4v.534" }
path { "d": "M17 6h1a4 4 0 0 1 1.42 7.74l-2.29.87a6 6 0 0 1-5.339-10.68l2.069-1.31" }
path { "d": "M4.5 17c2.8-.5 4.4 0 5.5.8s1.8 2.2 2.3 3.7c-2 .4-3.5.4-4.8-.3-1.2-.6-2.3-1.9-3-4.2" }
path { "d": "M9.77 12C4 15 2 22 2 22" }
circle { "cx": "17", "cy": "8", "r": "2" }
}
}
}
6 changes: 3 additions & 3 deletions packages/dioxus/src/umbrella.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ pub fn Umbrella(props: UmbrellaProps) -> Element {
"stroke-width": "{stroke_width}",
"stroke-linecap": "round",
"stroke-linejoin": "round",
path { "d": "M22 12a10.06 10.06 1 0 0-20 0Z" }
path { "d": "M12 12v8a2 2 0 0 0 4 0" }
path { "d": "M12 2v1" }
path { "d": "M12 13v7a2 2 0 0 0 4 0" }
path { "d": "M12 2v2" }
path { "d": "M20.992 13a1 1 0 0 0 .97-1.274 10.284 10.284 0 0 0-19.923 0A1 1 0 0 0 3 13z" }
}
}
}
7 changes: 4 additions & 3 deletions packages/dioxus/src/umbrella_off.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@ pub fn UmbrellaOff(props: UmbrellaOffProps) -> Element {
"stroke-width": "{stroke_width}",
"stroke-linecap": "round",
"stroke-linejoin": "round",
path { "d": "M12 2v1" }
path { "d": "M15.5 21a1.85 1.85 0 0 1-3.5-1v-8H2a10 10 0 0 1 3.428-6.575" }
path { "d": "M17.5 12H22A10 10 0 0 0 9.004 3.455" }
path { "d": "M12 13v7a2 2 0 0 0 4 0" }
path { "d": "M12 2v2" }
path { "d": "M18.656 13h2.336a1 1 0 0 0 .97-1.274 10.284 10.284 0 0 0-12.07-7.51" }
path { "d": "m2 2 20 20" }
path { "d": "M5.961 5.957a10.28 10.28 0 0 0-3.922 5.769A1 1 0 0 0 3 13h10" }
}
}
}
2 changes: 1 addition & 1 deletion packages/leptos/src/camera.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub fn Camera(
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z" />
<path d="M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z" />
<circle cx="12" cy="13" r="3" />
</svg>
}
Expand Down
8 changes: 4 additions & 4 deletions packages/leptos/src/camera_off.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ pub fn CameraOff(
stroke-linecap="round"
stroke-linejoin="round"
>
<line x1="2" x2="22" y1="2" y2="22" />
<path d="M7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16" />
<path d="M9.5 4h5L17 7h3a2 2 0 0 1 2 2v7.5" />
<path d="M14.121 15.121A3 3 0 1 1 9.88 10.88" />
<path d="M14.564 14.558a3 3 0 1 1-4.122-4.121" />
<path d="m2 2 20 20" />
<path d="M20 20H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 .819-.175" />
<path d="M9.695 4.024A2 2 0 0 1 10.004 4h3.993a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v7.344" />
</svg>
}
}
16 changes: 16 additions & 0 deletions packages/leptos/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2944,6 +2944,14 @@ mod rocket;
mod rocking_chair;
#[cfg(feature = "navigation")]
mod roller_coaster;
#[cfg(any(
feature = "nature",
feature = "seasons",
feature = "sustainability",
feature = "home",
feature = "social"
))]
mod rose;
#[cfg(feature = "design")]
mod rotate_3_d;
#[cfg(any(feature = "arrows", feature = "design", feature = "photography"))]
Expand Down Expand Up @@ -7085,6 +7093,14 @@ pub use rocket::*;
pub use rocking_chair::*;
#[cfg(feature = "navigation")]
pub use roller_coaster::*;
#[cfg(any(
feature = "nature",
feature = "seasons",
feature = "sustainability",
feature = "home",
feature = "social"
))]
pub use rose::*;
#[cfg(feature = "design")]
pub use rotate_3_d::*;
#[cfg(any(feature = "arrows", feature = "design", feature = "photography"))]
Expand Down
39 changes: 39 additions & 0 deletions packages/leptos/src/rose.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
use leptos::{prelude::*, svg::Svg};
#[component]
pub fn Rose(
#[prop(default = 24.into(), into)] size: Signal<usize>,
#[prop(default = "currentColor".into(), into)] color: Signal<String>,
#[prop(default = "none".into(), into)] fill: Signal<String>,
#[prop(default = 2.into(), into)] stroke_width: Signal<usize>,
#[prop(default = false.into(), into)] absolute_stroke_width: Signal<bool>,
#[prop(optional)] node_ref: NodeRef<Svg>,
) -> impl IntoView {
let stroke_width = Signal::derive(move || {
if absolute_stroke_width.get() {
stroke_width.get() * 24 / size.get()
} else {
stroke_width.get()
}
});
view! {
<svg
node_ref=node_ref
class:lucide=true
xmlns="http://www.w3.org/2000/svg"
width=size
height=size
viewBox="0 0 24 24"
fill=fill
stroke=color
stroke-width=stroke_width
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M17 10h-1a4 4 0 1 1 4-4v.534" />
<path d="M17 6h1a4 4 0 0 1 1.42 7.74l-2.29.87a6 6 0 0 1-5.339-10.68l2.069-1.31" />
<path d="M4.5 17c2.8-.5 4.4 0 5.5.8s1.8 2.2 2.3 3.7c-2 .4-3.5.4-4.8-.3-1.2-.6-2.3-1.9-3-4.2" />
<path d="M9.77 12C4 15 2 22 2 22" />
<circle cx="17" cy="8" r="2" />
</svg>
}
}
6 changes: 3 additions & 3 deletions packages/leptos/src/umbrella.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ pub fn Umbrella(
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M22 12a10.06 10.06 1 0 0-20 0Z" />
<path d="M12 12v8a2 2 0 0 0 4 0" />
<path d="M12 2v1" />
<path d="M12 13v7a2 2 0 0 0 4 0" />
<path d="M12 2v2" />
<path d="M20.992 13a1 1 0 0 0 .97-1.274 10.284 10.284 0 0 0-19.923 0A1 1 0 0 0 3 13z" />
</svg>
}
}
7 changes: 4 additions & 3 deletions packages/leptos/src/umbrella_off.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ pub fn UmbrellaOff(
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M12 2v1" />
<path d="M15.5 21a1.85 1.85 0 0 1-3.5-1v-8H2a10 10 0 0 1 3.428-6.575" />
<path d="M17.5 12H22A10 10 0 0 0 9.004 3.455" />
<path d="M12 13v7a2 2 0 0 0 4 0" />
<path d="M12 2v2" />
<path d="M18.656 13h2.336a1 1 0 0 0 .97-1.274 10.284 10.284 0 0 0-12.07-7.51" />
<path d="m2 2 20 20" />
<path d="M5.961 5.957a10.28 10.28 0 0 0-3.922 5.769A1 1 0 0 0 3 13h10" />
</svg>
}
}
2 changes: 1 addition & 1 deletion packages/yew/src/camera.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pub fn Camera(props: &CameraProps) -> Html {
stroke-linejoin="round"
>
<path
d="M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z"
d="M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z"
/>
<circle cx="12" cy="13" r="3" />
</svg>
Expand Down
10 changes: 6 additions & 4 deletions packages/yew/src/camera_off.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,12 @@ pub fn CameraOff(props: &CameraOffProps) -> Html {
stroke-linecap="round"
stroke-linejoin="round"
>
<line x1="2" x2="22" y1="2" y2="22" />
<path d="M7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16" />
<path d="M9.5 4h5L17 7h3a2 2 0 0 1 2 2v7.5" />
<path d="M14.121 15.121A3 3 0 1 1 9.88 10.88" />
<path d="M14.564 14.558a3 3 0 1 1-4.122-4.121" />
<path d="m2 2 20 20" />
<path d="M20 20H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 .819-.175" />
<path
d="M9.695 4.024A2 2 0 0 1 10.004 4h3.993a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v7.344"
/>
</svg>
}
}
16 changes: 16 additions & 0 deletions packages/yew/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2946,6 +2946,14 @@ mod rocket;
mod rocking_chair;
#[cfg(feature = "navigation")]
mod roller_coaster;
#[cfg(any(
feature = "nature",
feature = "seasons",
feature = "sustainability",
feature = "home",
feature = "social"
))]
mod rose;
#[cfg(feature = "design")]
mod rotate_3_d;
#[cfg(any(feature = "arrows", feature = "design", feature = "photography"))]
Expand Down Expand Up @@ -7087,6 +7095,14 @@ pub use rocket::*;
pub use rocking_chair::*;
#[cfg(feature = "navigation")]
pub use roller_coaster::*;
#[cfg(any(
feature = "nature",
feature = "seasons",
feature = "sustainability",
feature = "home",
feature = "social"
))]
pub use rose::*;
#[cfg(feature = "design")]
pub use rotate_3_d::*;
#[cfg(any(feature = "arrows", feature = "design", feature = "photography"))]
Expand Down
53 changes: 53 additions & 0 deletions packages/yew/src/rose.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
use yew::prelude::*;
#[derive(PartialEq, Properties)]
pub struct RoseProps {
#[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<AttrValue>,
#[prop_or_default]
pub node_ref: NodeRef,
}
#[function_component]
pub fn Rose(props: &RoseProps) -> Html {
let stroke_width = if props.absolute_stroke_width {
props.stroke_width * 24 / props.size
} else {
props.stroke_width
};
html! {
<svg
ref={props.node_ref.clone()}
class={classes!("lucide", props.class
.clone())}
style={props.style.clone()}
xmlns="http://www.w3.org/2000/svg"
width={props.size.to_string()}
height={props.size.to_string()}
viewBox="0 0 24 24"
fill={& props.fill}
stroke={& props.color}
stroke-width={stroke_width.to_string()}
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M17 10h-1a4 4 0 1 1 4-4v.534" />
<path d="M17 6h1a4 4 0 0 1 1.42 7.74l-2.29.87a6 6 0 0 1-5.339-10.68l2.069-1.31" />
<path
d="M4.5 17c2.8-.5 4.4 0 5.5.8s1.8 2.2 2.3 3.7c-2 .4-3.5.4-4.8-.3-1.2-.6-2.3-1.9-3-4.2"
/>
<path d="M9.77 12C4 15 2 22 2 22" />
<circle cx="17" cy="8" r="2" />
</svg>
}
}
Loading