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
44 changes: 28 additions & 16 deletions book-examples/dioxus/src/icons.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1863,6 +1863,12 @@ pub fn IconsC1() -> Element {
},
"Car",
),
(
rsx! {
CarBattery {}
},
"Car Battery",
),
(
rsx! {
CarFront {}
Expand Down Expand Up @@ -2235,12 +2241,6 @@ pub fn IconsC1() -> Element {
},
"Chevrons Up",
),
(
rsx! {
ChevronsUpDown {}
},
"Chevrons Up Down",
),
];
rsx! {
for (icon, name) in icons {
Expand All @@ -2256,6 +2256,12 @@ pub fn IconsC1() -> Element {
#[component]
pub fn IconsC2() -> Element {
let icons = [
(
rsx! {
ChevronsUpDown {}
},
"Chevrons Up Down",
),
(
rsx! {
Church {}
Expand Down Expand Up @@ -2850,12 +2856,6 @@ pub fn IconsC2() -> Element {
},
"Cloud Moon Rain",
),
(
rsx! {
CloudOff {}
},
"Cloud Off",
),
];
rsx! {
for (icon, name) in icons {
Expand All @@ -2871,6 +2871,12 @@ pub fn IconsC2() -> Element {
#[component]
pub fn IconsC3() -> Element {
let icons = [
(
rsx! {
CloudOff {}
},
"Cloud Off",
),
(
rsx! {
CloudRain {}
Expand Down Expand Up @@ -9395,15 +9401,15 @@ pub fn IconsS2() -> Element {
),
(
rsx! {
SquareUser {}
SquareText {}
},
"Square User",
"Square Text",
),
(
rsx! {
SquareUserRound {}
SquareUser {}
},
"Square User Round",
"Square User",
),
];
rsx! {
Expand All @@ -9420,6 +9426,12 @@ pub fn IconsS2() -> Element {
#[component]
pub fn IconsS3() -> Element {
let icons = [
(
rsx! {
SquareUserRound {}
},
"Square User Round",
),
(
rsx! {
SquareX {}
Expand Down
8 changes: 5 additions & 3 deletions book-examples/leptos/src/icons.rs
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,7 @@ pub fn IconsC1() -> impl IntoView {
(view! { <Captions /> }.into_any(), "Captions"),
(view! { <CaptionsOff /> }.into_any(), "Captions Off"),
(view! { <Car /> }.into_any(), "Car"),
(view! { <CarBattery /> }.into_any(), "Car Battery"),
(view! { <CarFront /> }.into_any(), "Car Front"),
(view! { <CarTaxiFront /> }.into_any(), "Car Taxi Front"),
(view! { <Caravan /> }.into_any(), "Caravan"),
Expand Down Expand Up @@ -521,7 +522,6 @@ pub fn IconsC1() -> impl IntoView {
(view! { <ChevronsRight /> }.into_any(), "Chevrons Right"),
(view! { <ChevronsRightLeft /> }.into_any(), "Chevrons Right Left"),
(view! { <ChevronsUp /> }.into_any(), "Chevrons Up"),
(view! { <ChevronsUpDown /> }.into_any(), "Chevrons Up Down"),
]
key=|icon| icon.1
children=move |(icon, name)| {
Expand All @@ -539,6 +539,7 @@ pub fn IconsC2() -> impl IntoView {
view! {
<For
each=move || [
(view! { <ChevronsUpDown /> }.into_any(), "Chevrons Up Down"),
(view! { <Church /> }.into_any(), "Church"),
(view! { <Cigarette /> }.into_any(), "Cigarette"),
(view! { <CigaretteOff /> }.into_any(), "Cigarette Off"),
Expand Down Expand Up @@ -638,7 +639,6 @@ pub fn IconsC2() -> impl IntoView {
(view! { <CloudLightning /> }.into_any(), "Cloud Lightning"),
(view! { <CloudMoon /> }.into_any(), "Cloud Moon"),
(view! { <CloudMoonRain /> }.into_any(), "Cloud Moon Rain"),
(view! { <CloudOff /> }.into_any(), "Cloud Off"),
]
key=|icon| icon.1
children=move |(icon, name)| {
Expand All @@ -656,6 +656,7 @@ pub fn IconsC3() -> impl IntoView {
view! {
<For
each=move || [
(view! { <CloudOff /> }.into_any(), "Cloud Off"),
(view! { <CloudRain /> }.into_any(), "Cloud Rain"),
(view! { <CloudRainWind /> }.into_any(), "Cloud Rain Wind"),
(view! { <CloudSnow /> }.into_any(), "Cloud Snow"),
Expand Down Expand Up @@ -2051,8 +2052,8 @@ pub fn IconsS2() -> impl IntoView {
(view! { <SquareStar /> }.into_any(), "Square Star"),
(view! { <SquareStop /> }.into_any(), "Square Stop"),
(view! { <SquareTerminal /> }.into_any(), "Square Terminal"),
(view! { <SquareText /> }.into_any(), "Square Text"),
(view! { <SquareUser /> }.into_any(), "Square User"),
(view! { <SquareUserRound /> }.into_any(), "Square User Round"),
]
key=|icon| icon.1
children=move |(icon, name)| {
Expand All @@ -2070,6 +2071,7 @@ pub fn IconsS3() -> impl IntoView {
view! {
<For
each=move || [
(view! { <SquareUserRound /> }.into_any(), "Square User Round"),
(view! { <SquareX /> }.into_any(), "Square X"),
(view! { <SquaresExclude /> }.into_any(), "Squares Exclude"),
(view! { <SquaresIntersect /> }.into_any(), "Squares Intersect"),
Expand Down
2 changes: 2 additions & 0 deletions book-examples/yew/src/icons.rs
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,7 @@ pub fn IconsC() -> Html {
(html! { <Captions /> }, "Captions"),
(html! { <CaptionsOff /> }, "Captions Off"),
(html! { <Car /> }, "Car"),
(html! { <CarBattery /> }, "Car Battery"),
(html! { <CarFront /> }, "Car Front"),
(html! { <CarTaxiFront /> }, "Car Taxi Front"),
(html! { <Caravan /> }, "Caravan"),
Expand Down Expand Up @@ -1969,6 +1970,7 @@ pub fn IconsS() -> Html {
(html! { <SquareStar /> }, "Square Star"),
(html! { <SquareStop /> }, "Square Stop"),
(html! { <SquareTerminal /> }, "Square Terminal"),
(html! { <SquareText /> }, "Square Text"),
(html! { <SquareUser /> }, "Square User"),
(html! { <SquareUserRound /> }, "Square User Round"),
(html! { <SquareX /> }, "Square X"),
Expand Down
51 changes: 51 additions & 0 deletions packages/dioxus/src/car_battery.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
use dioxus::prelude::*;
#[derive(Clone, PartialEq, Props)]
pub struct CarBatteryProps {
#[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 CarBattery(props: CarBatteryProps) -> 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": "M14 13h4" }
path { "d": "M16 15v-4" }
path { "d": "M18 5v2" }
path { "d": "M6 13h4" }
path { "d": "M6 5v2" }
rect {
"x": "2",
"y": "7",
"width": "20",
"height": "12",
"rx": "2",
}
}
}
}
8 changes: 8 additions & 0 deletions packages/dioxus/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,8 @@ mod captions;
mod captions_off;
#[cfg(feature = "transportation")]
mod car;
#[cfg(any(feature = "connectivity", feature = "transportation"))]
mod car_battery;
#[cfg(feature = "transportation")]
mod car_front;
#[cfg(feature = "transportation")]
Expand Down Expand Up @@ -3796,6 +3798,8 @@ mod square_star;
mod square_stop;
#[cfg(feature = "development")]
mod square_terminal;
#[cfg(any(feature = "text", feature = "shapes", feature = "development"))]
mod square_text;
#[cfg(feature = "account")]
mod square_user;
#[cfg(feature = "account")]
Expand Down Expand Up @@ -5175,6 +5179,8 @@ pub use captions::*;
pub use captions_off::*;
#[cfg(feature = "transportation")]
pub use car::*;
#[cfg(any(feature = "connectivity", feature = "transportation"))]
pub use car_battery::*;
#[cfg(feature = "transportation")]
pub use car_front::*;
#[cfg(feature = "transportation")]
Expand Down Expand Up @@ -8303,6 +8309,8 @@ pub use square_star::*;
pub use square_stop::*;
#[cfg(feature = "development")]
pub use square_terminal::*;
#[cfg(any(feature = "text", feature = "shapes", feature = "development"))]
pub use square_text::*;
#[cfg(feature = "account")]
pub use square_user::*;
#[cfg(feature = "account")]
Expand Down
49 changes: 49 additions & 0 deletions packages/dioxus/src/square_text.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
use dioxus::prelude::*;
#[derive(Clone, PartialEq, Props)]
pub struct SquareTextProps {
#[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 SquareText(props: SquareTextProps) -> 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",
rect {
"width": "18",
"height": "18",
"x": "3",
"y": "3",
"rx": "2",
}
path { "d": "M7 8h8" }
path { "d": "M7 12h10" }
path { "d": "M7 16h6" }
}
}
}
4 changes: 3 additions & 1 deletion packages/icon-name/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
//! See [the Rust Lucide book](https://lucide.rustforweb.org/) for more documenation.

/// [Lucide](https://lucide.dev/) icon names.
pub static ICON_NAMES: [&str; 1767usize] = [
pub static ICON_NAMES: [&str; 1769usize] = [
"a-arrow-down",
"a-arrow-up",
"a-large-small",
Expand Down Expand Up @@ -299,6 +299,7 @@ pub static ICON_NAMES: [&str; 1767usize] = [
"captions",
"captions-off",
"car",
"car-battery",
"car-front",
"car-taxi-front",
"caravan",
Expand Down Expand Up @@ -1499,6 +1500,7 @@ pub static ICON_NAMES: [&str; 1767usize] = [
"square-star",
"square-stop",
"square-terminal",
"square-text",
"square-user",
"square-user-round",
"square-x",
Expand Down
40 changes: 40 additions & 0 deletions packages/leptos/src/car_battery.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
use leptos::{prelude::*, svg::Svg};
#[component]
pub fn CarBattery(
#[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="M14 13h4" />
<path d="M16 15v-4" />
<path d="M18 5v2" />
<path d="M6 13h4" />
<path d="M6 5v2" />
<rect x="2" y="7" width="20" height="12" rx="2" />
</svg>
}
}
Loading