Skip to content

Commit dc588ea

Browse files
feat: update to upstream v1.23.0 (#384)
Co-authored-by: rust-for-web[bot] <191031261+rust-for-web[bot]@users.noreply.github.com>
1 parent 27b87f3 commit dc588ea

11 files changed

Lines changed: 159 additions & 9 deletions

File tree

book-examples/dioxus/src/icons.rs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7170,6 +7170,12 @@ pub fn IconsP1() -> Element {
71707170
},
71717171
"Panels Top Left",
71727172
),
7173+
(
7174+
rsx! {
7175+
PaperBag {}
7176+
},
7177+
"Paper Bag",
7178+
),
71737179
(
71747180
rsx! {
71757181
Paperclip {}
@@ -7554,12 +7560,6 @@ pub fn IconsP1() -> Element {
75547560
},
75557561
"Presentation",
75567562
),
7557-
(
7558-
rsx! {
7559-
Printer {}
7560-
},
7561-
"Printer",
7562-
),
75637563
];
75647564
rsx! {
75657565
for (icon, name) in icons {
@@ -7575,6 +7575,12 @@ pub fn IconsP1() -> Element {
75757575
#[component]
75767576
pub fn IconsP2() -> Element {
75777577
let icons = [
7578+
(
7579+
rsx! {
7580+
Printer {}
7581+
},
7582+
"Printer",
7583+
),
75787584
(
75797585
rsx! {
75807586
PrinterCheck {}

book-examples/leptos/src/icons.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1599,6 +1599,7 @@ pub fn IconsP1() -> impl IntoView {
15991599
(view! { <PanelsLeftBottom /> }.into_any(), "Panels Left Bottom"),
16001600
(view! { <PanelsRightBottom /> }.into_any(), "Panels Right Bottom"),
16011601
(view! { <PanelsTopLeft /> }.into_any(), "Panels Top Left"),
1602+
(view! { <PaperBag /> }.into_any(), "Paper Bag"),
16021603
(view! { <Paperclip /> }.into_any(), "Paperclip"),
16031604
(view! { <Parasol /> }.into_any(), "Parasol"),
16041605
(view! { <Parentheses /> }.into_any(), "Parentheses"),
@@ -1663,7 +1664,6 @@ pub fn IconsP1() -> impl IntoView {
16631664
(view! { <Power /> }.into_any(), "Power"),
16641665
(view! { <PowerOff /> }.into_any(), "Power Off"),
16651666
(view! { <Presentation /> }.into_any(), "Presentation"),
1666-
(view! { <Printer /> }.into_any(), "Printer"),
16671667
]
16681668
key=|icon| icon.1
16691669
children=move |(icon, name)| {
@@ -1681,6 +1681,7 @@ pub fn IconsP2() -> impl IntoView {
16811681
view! {
16821682
<For
16831683
each=move || [
1684+
(view! { <Printer /> }.into_any(), "Printer"),
16841685
(view! { <PrinterCheck /> }.into_any(), "Printer Check"),
16851686
(view! { <PrinterX /> }.into_any(), "Printer X"),
16861687
(view! { <Projector /> }.into_any(), "Projector"),

book-examples/yew/src/icons.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1518,6 +1518,7 @@ pub fn IconsP() -> Html {
15181518
(html! { <PanelsLeftBottom /> }, "Panels Left Bottom"),
15191519
(html! { <PanelsRightBottom /> }, "Panels Right Bottom"),
15201520
(html! { <PanelsTopLeft /> }, "Panels Top Left"),
1521+
(html! { <PaperBag /> }, "Paper Bag"),
15211522
(html! { <Paperclip /> }, "Paperclip"),
15221523
(html! { <Parasol /> }, "Parasol"),
15231524
(html! { <Parentheses /> }, "Parentheses"),

packages/dioxus/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2716,6 +2716,8 @@ mod panels_left_bottom;
27162716
mod panels_right_bottom;
27172717
#[cfg(any(feature = "layout", feature = "design", feature = "development"))]
27182718
mod panels_top_left;
2719+
#[cfg(any(feature = "food-beverage", feature = "shopping"))]
2720+
mod paper_bag;
27192721
#[cfg(any(
27202722
feature = "text",
27212723
feature = "design",
@@ -7148,6 +7150,8 @@ pub use panels_left_bottom::*;
71487150
pub use panels_right_bottom::*;
71497151
#[cfg(any(feature = "layout", feature = "design", feature = "development"))]
71507152
pub use panels_top_left::*;
7153+
#[cfg(any(feature = "food-beverage", feature = "shopping"))]
7154+
pub use paper_bag::*;
71517155
#[cfg(any(
71527156
feature = "text",
71537157
feature = "design",

packages/dioxus/src/paper_bag.rs

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
use dioxus::prelude::*;
2+
#[derive(Clone, PartialEq, Props)]
3+
pub struct PaperBagProps {
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 PaperBag(props: PaperBagProps) -> 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": "M5.364 3.848C4 6 3 9.652 3 12.652V19a2 2 0 002 2h14a2 2 0 002-2v-5c0-2.334-1.816-4.668-2.622-7.002" }
38+
path { "d": "M7 3h11.379a2 2 0 011.789 1.106l.723 1.447A1 1 0 0119.997 7h-8.525a2 2 0 01-1.789-1.106L8.79 4.105a2 2 0 10-3.579 1.789l2.261 4.522A5 5 0 018 12.652V21" }
39+
}
40+
}
41+
}

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; 1744usize] = [
8+
pub static ICON_NAMES: [&str; 1745usize] = [
99
"a-arrow-down",
1010
"a-arrow-up",
1111
"a-large-small",
@@ -1141,6 +1141,7 @@ pub static ICON_NAMES: [&str; 1744usize] = [
11411141
"panels-left-bottom",
11421142
"panels-right-bottom",
11431143
"panels-top-left",
1144+
"paper-bag",
11441145
"paperclip",
11451146
"parasol",
11461147
"parentheses",

packages/leptos/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2716,6 +2716,8 @@ mod panels_left_bottom;
27162716
mod panels_right_bottom;
27172717
#[cfg(any(feature = "layout", feature = "design", feature = "development"))]
27182718
mod panels_top_left;
2719+
#[cfg(any(feature = "food-beverage", feature = "shopping"))]
2720+
mod paper_bag;
27192721
#[cfg(any(
27202722
feature = "text",
27212723
feature = "design",
@@ -7148,6 +7150,8 @@ pub use panels_left_bottom::*;
71487150
pub use panels_right_bottom::*;
71497151
#[cfg(any(feature = "layout", feature = "design", feature = "development"))]
71507152
pub use panels_top_left::*;
7153+
#[cfg(any(feature = "food-beverage", feature = "shopping"))]
7154+
pub use paper_bag::*;
71517155
#[cfg(any(
71527156
feature = "text",
71537157
feature = "design",

packages/leptos/src/paper_bag.rs

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
use leptos::{prelude::*, svg::Svg};
2+
#[component]
3+
pub fn PaperBag(
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="M5.364 3.848C4 6 3 9.652 3 12.652V19a2 2 0 002 2h14a2 2 0 002-2v-5c0-2.334-1.816-4.668-2.622-7.002" />
33+
<path d="M7 3h11.379a2 2 0 011.789 1.106l.723 1.447A1 1 0 0119.997 7h-8.525a2 2 0 01-1.789-1.106L8.79 4.105a2 2 0 10-3.579 1.789l2.261 4.522A5 5 0 018 12.652V21" />
34+
</svg>
35+
}
36+
}

packages/yew/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2718,6 +2718,8 @@ mod panels_left_bottom;
27182718
mod panels_right_bottom;
27192719
#[cfg(any(feature = "layout", feature = "design", feature = "development"))]
27202720
mod panels_top_left;
2721+
#[cfg(any(feature = "food-beverage", feature = "shopping"))]
2722+
mod paper_bag;
27212723
#[cfg(any(
27222724
feature = "text",
27232725
feature = "design",
@@ -7150,6 +7152,8 @@ pub use panels_left_bottom::*;
71507152
pub use panels_right_bottom::*;
71517153
#[cfg(any(feature = "layout", feature = "design", feature = "development"))]
71527154
pub use panels_top_left::*;
7155+
#[cfg(any(feature = "food-beverage", feature = "shopping"))]
7156+
pub use paper_bag::*;
71537157
#[cfg(any(
71547158
feature = "text",
71557159
feature = "design",

packages/yew/src/paper_bag.rs

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
use yew::prelude::*;
2+
#[derive(PartialEq, Properties)]
3+
pub struct PaperBagProps {
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 PaperBag(props: &PaperBagProps) -> 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
45+
d="M5.364 3.848C4 6 3 9.652 3 12.652V19a2 2 0 002 2h14a2 2 0 002-2v-5c0-2.334-1.816-4.668-2.622-7.002"
46+
/>
47+
<path
48+
d="M7 3h11.379a2 2 0 011.789 1.106l.723 1.447A1 1 0 0119.997 7h-8.525a2 2 0 01-1.789-1.106L8.79 4.105a2 2 0 10-3.579 1.789l2.261 4.522A5 5 0 018 12.652V21"
49+
/>
50+
</svg>
51+
}
52+
}

0 commit comments

Comments
 (0)