lumen-dioxus 6.0.0

Lumen UI components for Dioxus: web, desktop, mobile, and Dioxus Native (Blitz).
Documentation
// Generated by scripts/generate-dioxus-motion-illustrations.mjs from graphics/lumen.graphics.json;
// do not edit.

/// Artwork drawn by [`Illustration`](super::Illustration), from Lumen's graphics catalog.
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
#[non_exhaustive]
pub enum IllustrationVariant {
    /// The `empty` artwork.
    #[default]
    Empty,
    /// The `success` artwork.
    Success,
    /// The `error` artwork.
    Error,
    /// The `offline` artwork.
    Offline,
}

impl IllustrationVariant {
    /// The catalog name, used as the class suffix.
    pub fn as_str(self) -> &'static str {
        match self {
            Self::Empty => "empty",
            Self::Success => "success",
            Self::Error => "error",
            Self::Offline => "offline",
        }
    }

    /// The shapes drawn over the shared wash circle.
    pub(crate) fn shapes(self) -> &'static [IllustrationShape] {
        match self {
            Self::Empty => &[
                IllustrationShape::Polygon(&[32.0, 48.0, 88.0, 48.0, 81.0, 83.0, 39.0, 83.0]),
                IllustrationShape::Polyline(&[43.0, 48.0, 49.0, 36.0, 71.0, 36.0, 77.0, 48.0]),
                IllustrationShape::Line(&[47.0, 66.0, 73.0, 66.0]),
            ],
            Self::Success => &[
                IllustrationShape::Circle { cx: 60.0, cy: 60.0, r: 28.0 },
                IllustrationShape::Polyline(&[45.0, 60.0, 55.0, 70.0, 76.0, 47.0]),
            ],
            Self::Error => &[
                IllustrationShape::Circle { cx: 60.0, cy: 60.0, r: 28.0 },
                IllustrationShape::Line(&[49.0, 49.0, 71.0, 71.0]),
                IllustrationShape::Line(&[71.0, 49.0, 49.0, 71.0]),
            ],
            Self::Offline => &[
                IllustrationShape::RoundedRect { x: 24.0, y: 45.0, width: 72.0, height: 35.0, radius: 18.0 },
                IllustrationShape::Line(&[30.0, 30.0, 90.0, 90.0]),
            ],
        }
    }
}

/// One shape of an illustration, in the 120 by 120 view box.
#[derive(Clone, Copy, Debug, PartialEq)]
pub(crate) enum IllustrationShape {
    /// A circle.
    Circle { cx: f64, cy: f64, r: f64 },
    /// A rectangle with rounded corners.
    RoundedRect { x: f64, y: f64, width: f64, height: f64, radius: f64 },
    /// A line: x1, y1, x2, y2.
    Line(&'static [f64]),
    /// A closed shape through coordinate pairs.
    Polygon(&'static [f64]),
    /// An open path through coordinate pairs.
    Polyline(&'static [f64]),
}