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
42 changes: 34 additions & 8 deletions book-examples/dioxus/src/icons.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ pub fn Icons() -> Element {
IconsN1 {}
IconsO1 {}
IconsP1 {}
IconsP2 {}
IconsQ1 {}
IconsR1 {}
IconsS1 {}
Expand Down Expand Up @@ -2128,9 +2129,9 @@ pub fn IconsC1() -> Element {
),
(
rsx! {
Chrome {}
Chromium {}
},
"Chrome",
"Chromium",
),
(
rsx! {
Expand Down Expand Up @@ -6791,6 +6792,12 @@ pub fn IconsP1() -> Element {
},
"Panel Left Open",
),
(
rsx! {
PanelLeftRightDashed {}
},
"Panel Left Right Dashed",
),
(
rsx! {
PanelRight {}
Expand Down Expand Up @@ -6821,6 +6828,12 @@ pub fn IconsP1() -> Element {
},
"Panel Top",
),
(
rsx! {
PanelTopBottomDashed {}
},
"Panel Top Bottom Dashed",
),
(
rsx! {
PanelTopClose {}
Expand Down Expand Up @@ -7247,12 +7260,6 @@ pub fn IconsP1() -> Element {
},
"Puzzle",
),
(
rsx! {
Pyramid {}
},
"Pyramid",
),
];
rsx! {
for (icon , name) in icons {
Expand All @@ -7266,6 +7273,25 @@ pub fn IconsP1() -> Element {
}
}
#[component]
pub fn IconsP2() -> Element {
let icons = [(
rsx! {
Pyramid {}
},
"Pyramid",
)];
rsx! {
for (icon , name) in icons {
div {
key: "{name}",
class: "flex flex-wrap items-center gap-4 text-sm",
{icon}
span { {name} }
}
}
}
}
#[component]
pub fn IconsQ1() -> Element {
let icons = [
(
Expand Down
4 changes: 3 additions & 1 deletion book-examples/leptos/src/icons.rs
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ pub fn IconsC() -> impl IntoView {
(view! { <ChevronsRightLeft /> }.into_any(), "Chevrons Right Left"),
(view! { <ChevronsUp /> }.into_any(), "Chevrons Up"),
(view! { <ChevronsUpDown /> }.into_any(), "Chevrons Up Down"),
(view! { <Chrome /> }.into_any(), "Chrome"),
(view! { <Chromium /> }.into_any(), "Chromium"),
(view! { <Church /> }.into_any(), "Church"),
(view! { <Cigarette /> }.into_any(), "Cigarette"),
(view! { <CigaretteOff /> }.into_any(), "Cigarette Off"),
Expand Down Expand Up @@ -1425,11 +1425,13 @@ pub fn IconsP() -> impl IntoView {
(view! { <PanelLeftClose /> }.into_any(), "Panel Left Close"),
(view! { <PanelLeftDashed /> }.into_any(), "Panel Left Dashed"),
(view! { <PanelLeftOpen /> }.into_any(), "Panel Left Open"),
(view! { <PanelLeftRightDashed /> }.into_any(), "Panel Left Right Dashed"),
(view! { <PanelRight /> }.into_any(), "Panel Right"),
(view! { <PanelRightClose /> }.into_any(), "Panel Right Close"),
(view! { <PanelRightDashed /> }.into_any(), "Panel Right Dashed"),
(view! { <PanelRightOpen /> }.into_any(), "Panel Right Open"),
(view! { <PanelTop /> }.into_any(), "Panel Top"),
(view! { <PanelTopBottomDashed /> }.into_any(), "Panel Top Bottom Dashed"),
(view! { <PanelTopClose /> }.into_any(), "Panel Top Close"),
(view! { <PanelTopDashed /> }.into_any(), "Panel Top Dashed"),
(view! { <PanelTopOpen /> }.into_any(), "Panel Top Open"),
Expand Down
10 changes: 9 additions & 1 deletion book-examples/yew/src/icons.rs
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ pub fn IconsC() -> Html {
(html! { <ChevronsRightLeft /> }, "Chevrons Right Left"),
(html! { <ChevronsUp /> }, "Chevrons Up"),
(html! { <ChevronsUpDown /> }, "Chevrons Up Down"),
(html! { <Chrome /> }, "Chrome"),
(html! { <Chromium /> }, "Chromium"),
(html! { <Church /> }, "Church"),
(html! { <Cigarette /> }, "Cigarette"),
(html! { <CigaretteOff /> }, "Cigarette Off"),
Expand Down Expand Up @@ -1447,11 +1447,19 @@ pub fn IconsP() -> Html {
(html! { <PanelLeftClose /> }, "Panel Left Close"),
(html! { <PanelLeftDashed /> }, "Panel Left Dashed"),
(html! { <PanelLeftOpen /> }, "Panel Left Open"),
(
html! { <PanelLeftRightDashed /> },
"Panel Left Right Dashed",
),
(html! { <PanelRight /> }, "Panel Right"),
(html! { <PanelRightClose /> }, "Panel Right Close"),
(html! { <PanelRightDashed /> }, "Panel Right Dashed"),
(html! { <PanelRightOpen /> }, "Panel Right Open"),
(html! { <PanelTop /> }, "Panel Top"),
(
html! { <PanelTopBottomDashed /> },
"Panel Top Bottom Dashed",
),
(html! { <PanelTopClose /> }, "Panel Top Close"),
(html! { <PanelTopDashed /> }, "Panel Top Dashed"),
(html! { <PanelTopOpen /> }, "Panel Top Open"),
Expand Down
23 changes: 11 additions & 12 deletions packages/dioxus/src/building.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,23 @@ pub fn Building(props: BuildingProps) -> Element {
"stroke-width": "{stroke_width}",
"stroke-linecap": "round",
"stroke-linejoin": "round",
rect {
"width": "16",
"height": "20",
"x": "4",
"y": "2",
"rx": "2",
"ry": "2",
}
path { "d": "M9 22v-4h6v4" }
path { "d": "M8 6h.01" }
path { "d": "M16 6h.01" }
path { "d": "M12 6h.01" }
path { "d": "M12 10h.01" }
path { "d": "M12 14h.01" }
path { "d": "M12 6h.01" }
path { "d": "M16 10h.01" }
path { "d": "M16 14h.01" }
path { "d": "M16 6h.01" }
path { "d": "M8 10h.01" }
path { "d": "M8 14h.01" }
path { "d": "M8 6h.01" }
path { "d": "M9 22v-3a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3" }
rect {
"x": "4",
"y": "2",
"width": "16",
"height": "20",
"rx": "2",
}
}
}
}
44 changes: 44 additions & 0 deletions packages/dioxus/src/chromium.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
use dioxus::prelude::*;
#[derive(Clone, PartialEq, Props)]
pub struct ChromiumProps {
#[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 Chromium(props: ChromiumProps) -> 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": "M10.88 21.94 15.46 14" }
path { "d": "M21.17 8H12" }
path { "d": "M3.95 6.06 8.54 14" }
circle { "cx": "12", "cy": "12", "r": "10" }
circle { "cx": "12", "cy": "12", "r": "4" }
}
}
}
18 changes: 9 additions & 9 deletions packages/dioxus/src/cog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,20 @@ pub fn Cog(props: CogProps) -> Element {
"stroke-width": "{stroke_width}",
"stroke-linecap": "round",
"stroke-linejoin": "round",
path { "d": "M12 20a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z" }
path { "d": "M12 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" }
path { "d": "M12 2v2" }
path { "d": "M12 22v-2" }
path { "d": "m17 20.66-1-1.73" }
path { "d": "M11 10.27 7 3.34" }
path { "d": "m20.66 17-1.73-1" }
path { "d": "m3.34 7 1.73 1" }
path { "d": "m11 13.73-4 6.93" }
path { "d": "M12 22v-2" }
path { "d": "M12 2v2" }
path { "d": "M14 12h8" }
path { "d": "m17 20.66-1-1.73" }
path { "d": "m17 3.34-1 1.73" }
path { "d": "M2 12h2" }
path { "d": "m20.66 17-1.73-1" }
path { "d": "m20.66 7-1.73 1" }
path { "d": "m3.34 17 1.73-1" }
path { "d": "m17 3.34-1 1.73" }
path { "d": "m11 13.73-4 6.93" }
path { "d": "m3.34 7 1.73 1" }
circle { "cx": "12", "cy": "12", "r": "2" }
circle { "cx": "12", "cy": "12", "r": "8" }
}
}
}
12 changes: 10 additions & 2 deletions packages/dioxus/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,7 @@ mod chevrons_up;
#[cfg(feature = "arrows")]
mod chevrons_up_down;
#[cfg(feature = "brands")]
mod chrome;
mod chromium;
#[cfg(any(feature = "buildings", feature = "navigation"))]
mod church;
#[cfg(any(feature = "travel", feature = "transportation", feature = "medical"))]
Expand Down Expand Up @@ -2593,6 +2593,8 @@ mod panel_left_dashed;
#[cfg(any(feature = "layout", feature = "arrows"))]
mod panel_left_open;
#[cfg(feature = "layout")]
mod panel_left_right_dashed;
#[cfg(feature = "layout")]
mod panel_right;
#[cfg(any(feature = "layout", feature = "arrows"))]
mod panel_right_close;
Expand All @@ -2602,6 +2604,8 @@ mod panel_right_dashed;
mod panel_right_open;
#[cfg(any(feature = "layout", feature = "design", feature = "development"))]
mod panel_top;
#[cfg(feature = "layout")]
mod panel_top_bottom_dashed;
#[cfg(any(feature = "layout", feature = "arrows"))]
mod panel_top_close;
#[cfg(feature = "layout")]
Expand Down Expand Up @@ -4956,7 +4960,7 @@ pub use chevrons_up::*;
#[cfg(feature = "arrows")]
pub use chevrons_up_down::*;
#[cfg(feature = "brands")]
pub use chrome::*;
pub use chromium::*;
#[cfg(any(feature = "buildings", feature = "navigation"))]
pub use church::*;
#[cfg(any(feature = "travel", feature = "transportation", feature = "medical"))]
Expand Down Expand Up @@ -6742,6 +6746,8 @@ pub use panel_left_dashed::*;
#[cfg(any(feature = "layout", feature = "arrows"))]
pub use panel_left_open::*;
#[cfg(feature = "layout")]
pub use panel_left_right_dashed::*;
#[cfg(feature = "layout")]
pub use panel_right::*;
#[cfg(any(feature = "layout", feature = "arrows"))]
pub use panel_right_close::*;
Expand All @@ -6751,6 +6757,8 @@ pub use panel_right_dashed::*;
pub use panel_right_open::*;
#[cfg(any(feature = "layout", feature = "design", feature = "development"))]
pub use panel_top::*;
#[cfg(feature = "layout")]
pub use panel_top_bottom_dashed::*;
#[cfg(any(feature = "layout", feature = "arrows"))]
pub use panel_top_close::*;
#[cfg(feature = "layout")]
Expand Down
54 changes: 54 additions & 0 deletions packages/dioxus/src/panel_left_right_dashed.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
use dioxus::prelude::*;
#[derive(Clone, PartialEq, Props)]
pub struct PanelLeftRightDashedProps {
#[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 PanelLeftRightDashed(props: PanelLeftRightDashedProps) -> 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": "M16 10V9" }
path { "d": "M16 15v-1" }
path { "d": "M16 21v-2" }
path { "d": "M16 5V3" }
path { "d": "M8 10V9" }
path { "d": "M8 15v-1" }
path { "d": "M8 21v-2" }
path { "d": "M8 5V3" }
rect {
"x": "3",
"y": "3",
"width": "18",
"height": "18",
"rx": "2",
}
}
}
}
Loading
Loading