Skip to content

Commit 0a7c499

Browse files
feat: update to upstream v0.570.0 (#275)
Co-authored-by: rust-for-web[bot] <191031261+rust-for-web[bot]@users.noreply.github.com>
1 parent 230bf01 commit 0a7c499

11 files changed

Lines changed: 171 additions & 16 deletions

File tree

book-examples/dioxus/src/icons.rs

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9688,6 +9688,12 @@ pub fn IconsT1() -> Element {
96889688
},
96899689
"Touchpad Off",
96909690
),
9691+
(
9692+
rsx! {
9693+
TowelRack {}
9694+
},
9695+
"Towel Rack",
9696+
),
96919697
(
96929698
rsx! {
96939699
TowerControl {}
@@ -9892,12 +9898,6 @@ pub fn IconsT1() -> Element {
98929898
},
98939899
"Twitter",
98949900
),
9895-
(
9896-
rsx! {
9897-
Type {}
9898-
},
9899-
"Type",
9900-
),
99019901
];
99029902
rsx! {
99039903
for (icon , name) in icons {
@@ -9912,12 +9912,20 @@ pub fn IconsT1() -> Element {
99129912
}
99139913
#[component]
99149914
pub fn IconsT2() -> Element {
9915-
let icons = [(
9916-
rsx! {
9917-
TypeOutline {}
9918-
},
9919-
"Type Outline",
9920-
)];
9915+
let icons = [
9916+
(
9917+
rsx! {
9918+
Type {}
9919+
},
9920+
"Type",
9921+
),
9922+
(
9923+
rsx! {
9924+
TypeOutline {}
9925+
},
9926+
"Type Outline",
9927+
),
9928+
];
99219929
rsx! {
99229930
for (icon , name) in icons {
99239931
div {

book-examples/leptos/src/icons.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2124,6 +2124,7 @@ pub fn IconsT1() -> impl IntoView {
21242124
(view! { <Torus /> }.into_any(), "Torus"),
21252125
(view! { <Touchpad /> }.into_any(), "Touchpad"),
21262126
(view! { <TouchpadOff /> }.into_any(), "Touchpad Off"),
2127+
(view! { <TowelRack /> }.into_any(), "Towel Rack"),
21272128
(view! { <TowerControl /> }.into_any(), "Tower Control"),
21282129
(view! { <ToyBrick /> }.into_any(), "Toy Brick"),
21292130
(view! { <Tractor /> }.into_any(), "Tractor"),
@@ -2158,7 +2159,6 @@ pub fn IconsT1() -> impl IntoView {
21582159
(view! { <TvMinimalPlay /> }.into_any(), "Tv Minimal Play"),
21592160
(view! { <Twitch /> }.into_any(), "Twitch"),
21602161
(view! { <Twitter /> }.into_any(), "Twitter"),
2161-
(view! { <Type /> }.into_any(), "Type"),
21622162
]
21632163
key=|icon| icon.1
21642164
children=move |(icon, name)| {
@@ -2175,7 +2175,10 @@ pub fn IconsT1() -> impl IntoView {
21752175
pub fn IconsT2() -> impl IntoView {
21762176
view! {
21772177
<For
2178-
each=move || [(view! { <TypeOutline /> }.into_any(), "Type Outline")]
2178+
each=move || [
2179+
(view! { <Type /> }.into_any(), "Type"),
2180+
(view! { <TypeOutline /> }.into_any(), "Type Outline"),
2181+
]
21792182
key=|icon| icon.1
21802183
children=move |(icon, name)| {
21812184
view! {

book-examples/yew/src/icons.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2015,6 +2015,7 @@ pub fn IconsT() -> Html {
20152015
(html! { <Torus /> }, "Torus"),
20162016
(html! { <Touchpad /> }, "Touchpad"),
20172017
(html! { <TouchpadOff /> }, "Touchpad Off"),
2018+
(html! { <TowelRack /> }, "Towel Rack"),
20182019
(html! { <TowerControl /> }, "Tower Control"),
20192020
(html! { <ToyBrick /> }, "Toy Brick"),
20202021
(html! { <Tractor /> }, "Tractor"),

packages/dioxus/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3849,6 +3849,8 @@ mod torus;
38493849
mod touchpad;
38503850
#[cfg(feature = "devices")]
38513851
mod touchpad_off;
3852+
#[cfg(any(feature = "home", feature = "travel"))]
3853+
mod towel_rack;
38523854
#[cfg(any(feature = "travel", feature = "transportation"))]
38533855
mod tower_control;
38543856
#[cfg(any(feature = "gaming", feature = "development"))]
@@ -8079,6 +8081,8 @@ pub use torus::*;
80798081
pub use touchpad::*;
80808082
#[cfg(feature = "devices")]
80818083
pub use touchpad_off::*;
8084+
#[cfg(any(feature = "home", feature = "travel"))]
8085+
pub use towel_rack::*;
80828086
#[cfg(any(feature = "travel", feature = "transportation"))]
80838087
pub use tower_control::*;
80848088
#[cfg(any(feature = "gaming", feature = "development"))]

packages/dioxus/src/towel_rack.rs

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
use dioxus::prelude::*;
2+
#[derive(Clone, PartialEq, Props)]
3+
pub struct TowelRackProps {
4+
#[props(default = 24)]
5+
pub size: usize,
6+
#[props(default = "currentColor".to_owned())]
7+
pub color: String,
8+
#[props(default = "none".to_owned())]
9+
pub fill: String,
10+
#[props(default = 2)]
11+
pub stroke_width: usize,
12+
#[props(default = false)]
13+
pub absolute_stroke_width: bool,
14+
pub class: Option<String>,
15+
pub style: Option<String>,
16+
}
17+
#[component]
18+
pub fn TowelRack(props: TowelRackProps) -> Element {
19+
let stroke_width = if props.absolute_stroke_width {
20+
props.stroke_width * 24 / props.size
21+
} else {
22+
props.stroke_width
23+
};
24+
rsx! {
25+
svg {
26+
"xmlns": "http://www.w3.org/2000/svg",
27+
"class": if let Some(class) = props.class { "{class}" },
28+
"style": if let Some(style) = props.style { "{style}" },
29+
"width": "{props.size}",
30+
"height": "{props.size}",
31+
"viewBox": "0 0 24 24",
32+
"fill": "{props.fill}",
33+
"stroke": "{props.color}",
34+
"stroke-width": "{stroke_width}",
35+
"stroke-linecap": "round",
36+
"stroke-linejoin": "round",
37+
path { "d": "M22 7h-2" }
38+
path { "d": "M6.5 3h11A2.5 2.5 0 0 1 20 5.5V20a1 1 0 0 1-1 1h-9a1 1 0 0 1-1-1V5.5a1 1 0 0 0-5 0V17a1 1 0 0 0 1 1h4" }
39+
path { "d": "M9 7H2" }
40+
}
41+
}
42+
}

packages/icon-name/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
//! See [the Rust Lucide book](https://lucide.rustforweb.org/) for more documenation.
66
77
/// [Lucide](https://lucide.dev/) icon names.
8-
pub static ICON_NAMES: [&str; 1678usize] = [
8+
pub static ICON_NAMES: [&str; 1679usize] = [
99
"a-arrow-down",
1010
"a-arrow-up",
1111
"a-large-small",
@@ -1543,6 +1543,7 @@ pub static ICON_NAMES: [&str; 1678usize] = [
15431543
"torus",
15441544
"touchpad",
15451545
"touchpad-off",
1546+
"towel-rack",
15461547
"tower-control",
15471548
"toy-brick",
15481549
"tractor",

packages/leptos/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3849,6 +3849,8 @@ mod torus;
38493849
mod touchpad;
38503850
#[cfg(feature = "devices")]
38513851
mod touchpad_off;
3852+
#[cfg(any(feature = "home", feature = "travel"))]
3853+
mod towel_rack;
38523854
#[cfg(any(feature = "travel", feature = "transportation"))]
38533855
mod tower_control;
38543856
#[cfg(any(feature = "gaming", feature = "development"))]
@@ -8079,6 +8081,8 @@ pub use torus::*;
80798081
pub use touchpad::*;
80808082
#[cfg(feature = "devices")]
80818083
pub use touchpad_off::*;
8084+
#[cfg(any(feature = "home", feature = "travel"))]
8085+
pub use towel_rack::*;
80828086
#[cfg(any(feature = "travel", feature = "transportation"))]
80838087
pub use tower_control::*;
80848088
#[cfg(any(feature = "gaming", feature = "development"))]

packages/leptos/src/towel_rack.rs

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
use leptos::{prelude::*, svg::Svg};
2+
#[component]
3+
pub fn TowelRack(
4+
#[prop(default = 24.into(), into)] size: Signal<usize>,
5+
#[prop(default = "currentColor".into(), into)] color: Signal<String>,
6+
#[prop(default = "none".into(), into)] fill: Signal<String>,
7+
#[prop(default = 2.into(), into)] stroke_width: Signal<usize>,
8+
#[prop(default = false.into(), into)] absolute_stroke_width: Signal<bool>,
9+
#[prop(optional)] node_ref: NodeRef<Svg>,
10+
) -> impl IntoView {
11+
let stroke_width = Signal::derive(move || {
12+
if absolute_stroke_width.get() {
13+
stroke_width.get() * 24 / size.get()
14+
} else {
15+
stroke_width.get()
16+
}
17+
});
18+
view! {
19+
<svg
20+
node_ref=node_ref
21+
class:lucide=true
22+
xmlns="http://www.w3.org/2000/svg"
23+
width=size
24+
height=size
25+
viewBox="0 0 24 24"
26+
fill=fill
27+
stroke=color
28+
stroke-width=stroke_width
29+
stroke-linecap="round"
30+
stroke-linejoin="round"
31+
>
32+
<path d="M22 7h-2" />
33+
<path d="M6.5 3h11A2.5 2.5 0 0 1 20 5.5V20a1 1 0 0 1-1 1h-9a1 1 0 0 1-1-1V5.5a1 1 0 0 0-5 0V17a1 1 0 0 0 1 1h4" />
34+
<path d="M9 7H2" />
35+
</svg>
36+
}
37+
}

packages/yew/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3851,6 +3851,8 @@ mod torus;
38513851
mod touchpad;
38523852
#[cfg(feature = "devices")]
38533853
mod touchpad_off;
3854+
#[cfg(any(feature = "home", feature = "travel"))]
3855+
mod towel_rack;
38543856
#[cfg(any(feature = "travel", feature = "transportation"))]
38553857
mod tower_control;
38563858
#[cfg(any(feature = "gaming", feature = "development"))]
@@ -8081,6 +8083,8 @@ pub use torus::*;
80818083
pub use touchpad::*;
80828084
#[cfg(feature = "devices")]
80838085
pub use touchpad_off::*;
8086+
#[cfg(any(feature = "home", feature = "travel"))]
8087+
pub use towel_rack::*;
80848088
#[cfg(any(feature = "travel", feature = "transportation"))]
80858089
pub use tower_control::*;
80868090
#[cfg(any(feature = "gaming", feature = "development"))]

packages/yew/src/towel_rack.rs

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
use yew::prelude::*;
2+
#[derive(PartialEq, Properties)]
3+
pub struct TowelRackProps {
4+
#[prop_or(24)]
5+
pub size: usize,
6+
#[prop_or(AttrValue::from("currentColor"))]
7+
pub color: AttrValue,
8+
#[prop_or(AttrValue::from("none"))]
9+
pub fill: AttrValue,
10+
#[prop_or(2)]
11+
pub stroke_width: usize,
12+
#[prop_or(false)]
13+
pub absolute_stroke_width: bool,
14+
#[prop_or_default]
15+
pub class: Classes,
16+
#[prop_or_default]
17+
pub style: std::option::Option<AttrValue>,
18+
#[prop_or_default]
19+
pub node_ref: NodeRef,
20+
}
21+
#[component]
22+
pub fn TowelRack(props: &TowelRackProps) -> Html {
23+
let stroke_width = if props.absolute_stroke_width {
24+
props.stroke_width * 24 / props.size
25+
} else {
26+
props.stroke_width
27+
};
28+
html! {
29+
<svg
30+
ref={props.node_ref.clone()}
31+
class={classes!("lucide", props.class
32+
.clone())}
33+
style={props.style.clone()}
34+
xmlns="http://www.w3.org/2000/svg"
35+
width={props.size.to_string()}
36+
height={props.size.to_string()}
37+
viewBox="0 0 24 24"
38+
fill={& props.fill}
39+
stroke={& props.color}
40+
stroke-width={stroke_width.to_string()}
41+
stroke-linecap="round"
42+
stroke-linejoin="round"
43+
>
44+
<path d="M22 7h-2" />
45+
<path
46+
d="M6.5 3h11A2.5 2.5 0 0 1 20 5.5V20a1 1 0 0 1-1 1h-9a1 1 0 0 1-1-1V5.5a1 1 0 0 0-5 0V17a1 1 0 0 0 1 1h4"
47+
/>
48+
<path d="M9 7H2" />
49+
</svg>
50+
}
51+
}

0 commit comments

Comments
 (0)