← back to joeleaver__rinch

Function bodies 1,000 total

All specs Real LLM only Function bodies
class_name function · rust · L37-L44 (8 LOC)
crates/rinch-components/src/drawer.rs
    pub fn class_name(&self) -> &'static str {
        match self {
            DrawerPosition::Left => "rinch-drawer--left",
            DrawerPosition::Right => "rinch-drawer--right",
            DrawerPosition::Top => "rinch-drawer--top",
            DrawerPosition::Bottom => "rinch-drawer--bottom",
        }
    }
from_str function · rust · L49-L57 (9 LOC)
crates/rinch-components/src/drawer.rs
    fn from_str(s: &str) -> Result<Self, Self::Err> {
        match s.to_lowercase().as_str() {
            "left" => Ok(DrawerPosition::Left),
            "right" => Ok(DrawerPosition::Right),
            "top" => Ok(DrawerPosition::Top),
            "bottom" => Ok(DrawerPosition::Bottom),
            _ => Err(()),
        }
    }
class_name function · rust · L73-L82 (10 LOC)
crates/rinch-components/src/drawer.rs
    pub fn class_name(&self) -> &'static str {
        match self {
            DrawerSize::Xs => "rinch-drawer--xs",
            DrawerSize::Sm => "rinch-drawer--sm",
            DrawerSize::Md => "rinch-drawer--md",
            DrawerSize::Lg => "rinch-drawer--lg",
            DrawerSize::Xl => "rinch-drawer--xl",
            DrawerSize::Full => "rinch-drawer--full",
        }
    }
from_str function · rust · L87-L97 (11 LOC)
crates/rinch-components/src/drawer.rs
    fn from_str(s: &str) -> Result<Self, Self::Err> {
        match s.to_lowercase().as_str() {
            "xs" => Ok(DrawerSize::Xs),
            "sm" => Ok(DrawerSize::Sm),
            "md" => Ok(DrawerSize::Md),
            "lg" => Ok(DrawerSize::Lg),
            "xl" => Ok(DrawerSize::Xl),
            "full" => Ok(DrawerSize::Full),
            _ => Err(()),
        }
    }
fmt function · rust · L161-L179 (19 LOC)
crates/rinch-components/src/drawer.rs
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        f.debug_struct("Drawer")
            .field("opened", &self.opened)
            .field("opened_fn", &self.opened_fn.as_ref().map(|_| "<reactive>"))
            .field("title", &self.title)
            .field("position", &self.position)
            .field("size", &self.size)
            .field("with_overlay", &self.with_overlay)
            .field("overlay_opacity", &self.overlay_opacity)
            .field("close_on_click_outside", &self.close_on_click_outside)
            .field("close_on_escape", &self.close_on_escape)
            .field("with_close_button", &self.with_close_button)
            .field("padding", &self.padding)
            .field("z_index", &self.z_index)
            .field("lock_scroll", &self.lock_scroll)
            .field("trap_focus", &self.trap_focus)
            .field("onclose", &self.onclose.as_ref().map(|_| "<callback>"))
            .finish()
    }
default function · rust · L183-L201 (19 LOC)
crates/rinch-components/src/drawer.rs
    fn default() -> Self {
        Self {
            opened: false,
            opened_fn: None,
            title: String::new(),
            position: String::new(),
            size: String::new(),
            with_overlay: true,
            overlay_opacity: None,
            close_on_click_outside: true,
            close_on_escape: true,
            with_close_button: true,
            padding: String::new(),
            z_index: None,
            lock_scroll: true,
            trap_focus: true,
            onclose: None,
        }
    }
class_string_with_opened function · rust · L208-L231 (24 LOC)
crates/rinch-components/src/drawer.rs
    pub fn class_string_with_opened(&self, opened: bool) -> String {
        let mut classes = vec!["rinch-drawer"];

        if !self.position.is_empty() {
            if let Ok(pos) = self.position.parse::<DrawerPosition>() {
                classes.push(pos.class_name());
            }
        } else {
            classes.push(DrawerPosition::Left.class_name());
        }

        if !self.size.is_empty() {
            if let Ok(size) = self.size.parse::<DrawerSize>() {
                classes.push(size.class_name());
            }
        }

        if opened {
            classes.push("rinch-drawer--opened");
        }

        classes.join(" ")
    }
Want this analysis on your repo? https://repobility.com/scan/
render function · rust · L235-L360 (126 LOC)
crates/rinch-components/src/drawer.rs
    fn render(&self, __scope: &mut RenderScope, children: &[NodeHandle]) -> NodeHandle {
        // Determine initial opened state
        let is_opened = if let Some(ref opened_fn) = self.opened_fn {
            opened_fn()
        } else {
            self.opened
        };

        let class = self.class_string_with_opened(is_opened);

        // Build overlay styles
        let overlay_style = self
            .overlay_opacity
            .map(|o| format!("--rinch-drawer-overlay-opacity: {}", o));

        // Build content styles
        let content_style = if self.padding.is_empty() {
            None
        } else {
            Some(format!("padding: {}", self.padding))
        };

        // Build close button handler
        let close_handler_id = self.onclose.as_ref().map(|cb| {
            __scope.register_handler({
                let cb = cb.clone();
                move || cb.invoke()
            })
        });

        // Create root container with visibility class
     
class_name function · rust · L28-L43 (16 LOC)
crates/rinch-components/src/dropdown_menu.rs
    pub fn class_name(&self) -> &'static str {
        match self {
            DropdownMenuPosition::Bottom => "rinch-dropdown-menu--bottom",
            DropdownMenuPosition::BottomStart => "rinch-dropdown-menu--bottom-start",
            DropdownMenuPosition::BottomEnd => "rinch-dropdown-menu--bottom-end",
            DropdownMenuPosition::Top => "rinch-dropdown-menu--top",
            DropdownMenuPosition::TopStart => "rinch-dropdown-menu--top-start",
            DropdownMenuPosition::TopEnd => "rinch-dropdown-menu--top-end",
            DropdownMenuPosition::Left => "rinch-dropdown-menu--left",
            DropdownMenuPosition::LeftStart => "rinch-dropdown-menu--left-start",
            DropdownMenuPosition::LeftEnd => "rinch-dropdown-menu--left-end",
            DropdownMenuPosition::Right => "rinch-dropdown-menu--right",
            DropdownMenuPosition::RightStart => "rinch-dropdown-menu--right-start",
            DropdownMenuPosition::RightEnd => "rinch-dropdown-menu--right-en
from_str function · rust · L48-L64 (17 LOC)
crates/rinch-components/src/dropdown_menu.rs
    fn from_str(s: &str) -> Result<Self, Self::Err> {
        match s.to_lowercase().replace('-', "_").as_str() {
            "bottom" => Ok(DropdownMenuPosition::Bottom),
            "bottom_start" | "bottomstart" => Ok(DropdownMenuPosition::BottomStart),
            "bottom_end" | "bottomend" => Ok(DropdownMenuPosition::BottomEnd),
            "top" => Ok(DropdownMenuPosition::Top),
            "top_start" | "topstart" => Ok(DropdownMenuPosition::TopStart),
            "top_end" | "topend" => Ok(DropdownMenuPosition::TopEnd),
            "left" => Ok(DropdownMenuPosition::Left),
            "left_start" | "leftstart" => Ok(DropdownMenuPosition::LeftStart),
            "left_end" | "leftend" => Ok(DropdownMenuPosition::LeftEnd),
            "right" => Ok(DropdownMenuPosition::Right),
            "right_start" | "rightstart" => Ok(DropdownMenuPosition::RightStart),
            "right_end" | "rightend" => Ok(DropdownMenuPosition::RightEnd),
            _ => Err(()),
        }
    }
default function · rust · L113-L125 (13 LOC)
crates/rinch-components/src/dropdown_menu.rs
    fn default() -> Self {
        Self {
            opened: false,
            position: String::new(),
            offset: None,
            radius: String::new(),
            shadow: String::new(),
            close_on_click_outside: true,
            close_on_item_click: true,
            width: String::new(),
            z_index: None,
        }
    }
class_string function · rust · L129-L167 (39 LOC)
crates/rinch-components/src/dropdown_menu.rs
    pub fn class_string(&self) -> String {
        let mut classes = vec!["rinch-dropdown-menu"];

        if !self.position.is_empty() {
            if let Ok(pos) = self.position.parse::<DropdownMenuPosition>() {
                classes.push(pos.class_name());
            }
        } else {
            classes.push(DropdownMenuPosition::Bottom.class_name());
        }

        if !self.radius.is_empty() {
            match self.radius.as_str() {
                "xs" => classes.push("rinch-dropdown-menu--radius-xs"),
                "sm" => classes.push("rinch-dropdown-menu--radius-sm"),
                "md" => classes.push("rinch-dropdown-menu--radius-md"),
                "lg" => classes.push("rinch-dropdown-menu--radius-lg"),
                "xl" => classes.push("rinch-dropdown-menu--radius-xl"),
                _ => {}
            }
        }

        if !self.shadow.is_empty() {
            match self.shadow.as_str() {
                "xs" => classes.push("rinch-dropdown-menu--sh
render function · rust · L171-L192 (22 LOC)
crates/rinch-components/src/dropdown_menu.rs
    fn render(&self, __scope: &mut RenderScope, children: &[NodeHandle]) -> NodeHandle {
        let mut style_parts = Vec::new();
        if let Some(offset) = self.offset {
            style_parts.push(format!("--rinch-dropdown-menu-offset: {}px", offset));
        }
        if !self.width.is_empty() {
            style_parts.push(format!("--rinch-dropdown-menu-width: {}", self.width));
        }

        let root = rinch_macros::rsx! { div { class: "rinch-dropdown-menu" } };
        root.set_attribute("class", &self.class_string());

        if !style_parts.is_empty() {
            root.set_attribute("style", &style_parts.join("; "));
        }

        for child in children {
            root.append_child(child);
        }

        root
    }
render function · rust · L200-L208 (9 LOC)
crates/rinch-components/src/dropdown_menu.rs
    fn render(&self, __scope: &mut RenderScope, children: &[NodeHandle]) -> NodeHandle {
        let target = rinch_macros::rsx! { div { class: "rinch-dropdown-menu__target" } };

        for child in children {
            target.append_child(child);
        }

        target
    }
render function · rust · L216-L224 (9 LOC)
crates/rinch-components/src/dropdown_menu.rs
    fn render(&self, __scope: &mut RenderScope, children: &[NodeHandle]) -> NodeHandle {
        let dropdown = rinch_macros::rsx! { div { class: "rinch-dropdown-menu__dropdown" } };

        for child in children {
            dropdown.append_child(child);
        }

        dropdown
    }
Want fix-PRs on findings? Install Repobility's GitHub App · github.com/apps/repobility-bot
render function · rust · L243-L309 (67 LOC)
crates/rinch-components/src/dropdown_menu.rs
    fn render(&self, __scope: &mut RenderScope, children: &[NodeHandle]) -> NodeHandle {
        let mut classes = vec!["rinch-dropdown-menu__item"];

        if self.disabled {
            classes.push("rinch-dropdown-menu__item--disabled");
        }

        let color_style = if self.color.is_empty() {
            None
        } else {
            let c = &self.color;
            if c.starts_with('#') || c.starts_with("rgb") || c.starts_with("hsl") {
                Some(format!("--rinch-dropdown-menu-item-color: {}", c))
            } else {
                Some(format!(
                    "--rinch-dropdown-menu-item-color: var(--rinch-color-{}-6)",
                    c
                ))
            }
        };

        let btn = rinch_macros::rsx! { button { class: "rinch-dropdown-menu__item" } };
        btn.set_attribute("class", &classes.join(" "));

        if let Some(ref style) = color_style {
            btn.set_attribute("style", style);
        }

        if self.disa
render function · rust · L317-L325 (9 LOC)
crates/rinch-components/src/dropdown_menu.rs
    fn render(&self, __scope: &mut RenderScope, children: &[NodeHandle]) -> NodeHandle {
        let label = rinch_macros::rsx! { div { class: "rinch-dropdown-menu__label" } };

        for child in children {
            label.append_child(child);
        }

        label
    }
class_string function · rust · L23-L48 (26 LOC)
crates/rinch-components/src/fieldset.rs
    pub fn class_string(&self) -> String {
        let mut classes = vec!["rinch-fieldset"];

        // Variant
        if !self.variant.is_empty() {
            match self.variant.as_str() {
                "filled" => classes.push("rinch-fieldset--filled"),
                "unstyled" => classes.push("rinch-fieldset--unstyled"),
                _ => {} // default has no extra class
            }
        }

        // Size
        if !self.size.is_empty() {
            match self.size.as_str() {
                "xs" => classes.push("rinch-fieldset--xs"),
                "sm" => classes.push("rinch-fieldset--sm"),
                "md" => classes.push("rinch-fieldset--md"),
                "lg" => classes.push("rinch-fieldset--lg"),
                "xl" => classes.push("rinch-fieldset--xl"),
                _ => {}
            }
        }

        classes.join(" ")
    }
render function · rust · L52-L71 (20 LOC)
crates/rinch-components/src/fieldset.rs
    fn render(&self, __scope: &mut RenderScope, children: &[NodeHandle]) -> NodeHandle {
        let container = rinch_macros::rsx! { fieldset { class: "rinch-fieldset" } };
        container.set_attribute("class", &self.class_string());

        if self.disabled {
            container.set_attribute("disabled", "");
        }

        if !self.legend.is_empty() {
            let legend_elem = rinch_macros::rsx! { legend { class: "rinch-fieldset__legend" } };
            let text_node = __scope.create_text(&self.legend);
            legend_elem.append_child(&text_node);
            container.append_child(&legend_elem);
        }

        for child in children {
            container.append_child(child);
        }
        container
    }
default function · rust · L60-L72 (13 LOC)
crates/rinch-components/src/floating_panel.rs
    fn default() -> Self {
        Self {
            title: String::new(),
            x: None,
            y: None,
            width: None,
            height: None,
            min_width: None,
            min_height: None,
            resizable: true,
            on_close: None,
        }
    }
fmt function · rust · L76-L84 (9 LOC)
crates/rinch-components/src/floating_panel.rs
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        f.debug_struct("FloatingPanel")
            .field("title", &self.title)
            .field("min_width", &self.min_width)
            .field("min_height", &self.min_height)
            .field("resizable", &self.resizable)
            .field("on_close", &self.on_close.as_ref().map(|_| "<callback>"))
            .finish_non_exhaustive()
    }
render function · rust · L88-L211 (124 LOC)
crates/rinch-components/src/floating_panel.rs
    fn render(&self, scope: &mut RenderScope, children: &[NodeHandle]) -> NodeHandle {
        // Read initial values from signals (or use defaults)
        let x_sig = self.x.unwrap_or_else(|| Signal::new(50.0));
        let y_sig = self.y.unwrap_or_else(|| Signal::new(50.0));
        let w_sig = self.width.unwrap_or_else(|| Signal::new(300.0));
        let h_sig = self.height.unwrap_or_else(|| Signal::new(200.0));

        let init_x = x_sig.get();
        let init_y = y_sig.get();
        let init_w = w_sig.get();
        let init_h = h_sig.get();

        let min_w = self.min_width.unwrap_or(200.0);
        let min_h = self.min_height.unwrap_or(100.0);
        let resizable = self.resizable;

        // Root container — position: absolute
        let root = scope.create_element("div");
        root.set_attribute("class", "rinch-floating-panel");
        root.set_style("left", &format!("{}px", init_x));
        root.set_style("top", &format!("{}px", init_y));
        root.set_style(
class_name function · rust · L21-L29 (9 LOC)
crates/rinch-components/src/group.rs
    pub fn class_name(&self) -> &'static str {
        match self {
            GroupGap::Xs => "rinch-group--gap-xs",
            GroupGap::Sm => "rinch-group--gap-sm",
            GroupGap::Md => "rinch-group--gap-md",
            GroupGap::Lg => "rinch-group--gap-lg",
            GroupGap::Xl => "rinch-group--gap-xl",
        }
    }
Repobility · MCP-ready · https://repobility.com
from_str function · rust · L34-L44 (11 LOC)
crates/rinch-components/src/group.rs
    fn from_str(s: &str) -> Result<Self, Self::Err> {
        match s.to_lowercase().as_str() {
            "xs" => Ok(GroupGap::Xs),
            "sm" => Ok(GroupGap::Sm),
            "md" => Ok(GroupGap::Md),
            "lg" => Ok(GroupGap::Lg),
            "xl" => Ok(GroupGap::Xl),
            _ => Err(()),
        }
    }
class_name function · rust · L60-L68 (9 LOC)
crates/rinch-components/src/group.rs
    pub fn class_name(&self) -> &'static str {
        match self {
            GroupAlign::Stretch => "rinch-group--align-stretch",
            GroupAlign::Start => "rinch-group--align-start",
            GroupAlign::Center => "rinch-group--align-center",
            GroupAlign::End => "rinch-group--align-end",
            GroupAlign::Baseline => "rinch-group--align-baseline",
        }
    }
from_str function · rust · L73-L83 (11 LOC)
crates/rinch-components/src/group.rs
    fn from_str(s: &str) -> Result<Self, Self::Err> {
        match s.to_lowercase().as_str() {
            "stretch" => Ok(GroupAlign::Stretch),
            "start" | "flex-start" => Ok(GroupAlign::Start),
            "center" => Ok(GroupAlign::Center),
            "end" | "flex-end" => Ok(GroupAlign::End),
            "baseline" => Ok(GroupAlign::Baseline),
            _ => Err(()),
        }
    }
class_name function · rust · L99-L107 (9 LOC)
crates/rinch-components/src/group.rs
    pub fn class_name(&self) -> &'static str {
        match self {
            GroupJustify::Start => "rinch-group--justify-start",
            GroupJustify::Center => "rinch-group--justify-center",
            GroupJustify::End => "rinch-group--justify-end",
            GroupJustify::Between => "rinch-group--justify-between",
            GroupJustify::Around => "rinch-group--justify-around",
        }
    }
from_str function · rust · L112-L122 (11 LOC)
crates/rinch-components/src/group.rs
    fn from_str(s: &str) -> Result<Self, Self::Err> {
        match s.to_lowercase().as_str() {
            "start" | "flex-start" => Ok(GroupJustify::Start),
            "center" => Ok(GroupJustify::Center),
            "end" | "flex-end" => Ok(GroupJustify::End),
            "between" | "space-between" => Ok(GroupJustify::Between),
            "around" | "space-around" => Ok(GroupJustify::Around),
            _ => Err(()),
        }
    }
class_string function · rust · L142-L179 (38 LOC)
crates/rinch-components/src/group.rs
    pub fn class_string(&self) -> String {
        let mut classes = vec!["rinch-group"];

        // Gap class
        let gap: GroupGap = if self.gap.is_empty() {
            GroupGap::default()
        } else {
            self.gap.parse().unwrap_or_default()
        };
        classes.push(gap.class_name());

        // Alignment class
        let align: GroupAlign = if self.align.is_empty() {
            GroupAlign::default()
        } else {
            self.align.parse().unwrap_or_default()
        };
        classes.push(align.class_name());

        // Justification class
        if !self.justify.is_empty() {
            if let Ok(j) = self.justify.parse::<GroupJustify>() {
                classes.push(j.class_name());
            }
        }

        // Wrap
        if self.wrap {
            classes.push("rinch-group--wrap");
        }

        // Grow
        if self.grow {
            classes.push("rinch-group--grow");
        }

        classes.join(" ")
    }
render function · rust · L183-L192 (10 LOC)
crates/rinch-components/src/group.rs
    fn render(&self, __scope: &mut RenderScope, children: &[NodeHandle]) -> NodeHandle {
        let container = rinch_macros::rsx! {
            div { class: "rinch-group" }
        };
        container.set_attribute("class", &self.class_string());
        for child in children {
            container.append_child(child);
        }
        container
    }
default function · rust · L33-L40 (8 LOC)
crates/rinch-components/src/highlight.rs
    fn default() -> Self {
        Self {
            text: String::new(),
            highlight: String::new(),
            color: String::new(),
            ignore_case: true,
        }
    }
Source: Repobility analyzer · https://repobility.com
render function · rust · L44-L106 (63 LOC)
crates/rinch-components/src/highlight.rs
    fn render(&self, __scope: &mut RenderScope, _children: &[NodeHandle]) -> NodeHandle {
        let text = &self.text;
        let highlight = &self.highlight;

        let container = rinch_macros::rsx! { span { class: "rinch-highlight" } };

        // Color style
        if !self.color.is_empty() {
            let c = &self.color;
            let style = if c.starts_with('#') || c.starts_with("rgb") || c.starts_with("hsl") {
                format!("--rinch-highlight-color: {}", c)
            } else {
                format!("--rinch-highlight-color: var(--rinch-color-{}-2)", c)
            };
            container.set_attribute("style", &style);
        }

        if highlight.is_empty() {
            let text_node = __scope.create_text(text);
            container.append_child(&text_node);
            return container;
        }

        // Find and highlight matches
        let mut last_end = 0;

        let search_text = if self.ignore_case {
            text.to_lowercase()
 
class_name function · rust · L27-L42 (16 LOC)
crates/rinch-components/src/hover_card.rs
    pub fn class_name(&self) -> &'static str {
        match self {
            HoverCardPosition::Top => "rinch-hover-card--top",
            HoverCardPosition::TopStart => "rinch-hover-card--top-start",
            HoverCardPosition::TopEnd => "rinch-hover-card--top-end",
            HoverCardPosition::Bottom => "rinch-hover-card--bottom",
            HoverCardPosition::BottomStart => "rinch-hover-card--bottom-start",
            HoverCardPosition::BottomEnd => "rinch-hover-card--bottom-end",
            HoverCardPosition::Left => "rinch-hover-card--left",
            HoverCardPosition::LeftStart => "rinch-hover-card--left-start",
            HoverCardPosition::LeftEnd => "rinch-hover-card--left-end",
            HoverCardPosition::Right => "rinch-hover-card--right",
            HoverCardPosition::RightStart => "rinch-hover-card--right-start",
            HoverCardPosition::RightEnd => "rinch-hover-card--right-end",
        }
    }
from_str function · rust · L47-L63 (17 LOC)
crates/rinch-components/src/hover_card.rs
    fn from_str(s: &str) -> Result<Self, Self::Err> {
        match s.to_lowercase().replace('-', "_").as_str() {
            "top" => Ok(HoverCardPosition::Top),
            "top_start" | "topstart" => Ok(HoverCardPosition::TopStart),
            "top_end" | "topend" => Ok(HoverCardPosition::TopEnd),
            "bottom" => Ok(HoverCardPosition::Bottom),
            "bottom_start" | "bottomstart" => Ok(HoverCardPosition::BottomStart),
            "bottom_end" | "bottomend" => Ok(HoverCardPosition::BottomEnd),
            "left" => Ok(HoverCardPosition::Left),
            "left_start" | "leftstart" => Ok(HoverCardPosition::LeftStart),
            "left_end" | "leftend" => Ok(HoverCardPosition::LeftEnd),
            "right" => Ok(HoverCardPosition::Right),
            "right_start" | "rightstart" => Ok(HoverCardPosition::RightStart),
            "right_end" | "rightend" => Ok(HoverCardPosition::RightEnd),
            _ => Err(()),
        }
    }
class_string function · rust · L111-L149 (39 LOC)
crates/rinch-components/src/hover_card.rs
    pub fn class_string(&self) -> String {
        let mut classes = vec!["rinch-hover-card"];

        if !self.position.is_empty() {
            if let Ok(pos) = self.position.parse::<HoverCardPosition>() {
                classes.push(pos.class_name());
            }
        } else {
            classes.push(HoverCardPosition::Bottom.class_name());
        }

        if !self.radius.is_empty() {
            match self.radius.as_str() {
                "xs" => classes.push("rinch-hover-card--radius-xs"),
                "sm" => classes.push("rinch-hover-card--radius-sm"),
                "md" => classes.push("rinch-hover-card--radius-md"),
                "lg" => classes.push("rinch-hover-card--radius-lg"),
                "xl" => classes.push("rinch-hover-card--radius-xl"),
                _ => {}
            }
        }

        if !self.shadow.is_empty() {
            match self.shadow.as_str() {
                "xs" => classes.push("rinch-hover-card--shadow-xs"),
                
render function · rust · L153-L180 (28 LOC)
crates/rinch-components/src/hover_card.rs
    fn render(&self, __scope: &mut RenderScope, children: &[NodeHandle]) -> NodeHandle {
        let mut style_parts = Vec::new();
        if let Some(offset) = self.offset {
            style_parts.push(format!("--rinch-hover-card-offset: {}px", offset));
        }
        if !self.width.is_empty() {
            let w = &self.width;
            style_parts.push(format!("--rinch-hover-card-width: {}", w));
        }
        if let Some(delay) = self.open_delay {
            style_parts.push(format!("--rinch-hover-card-open-delay: {}ms", delay));
        }
        if let Some(delay) = self.close_delay {
            style_parts.push(format!("--rinch-hover-card-close-delay: {}ms", delay));
        }

        let root = rinch_macros::rsx! { div { class: "rinch-hover-card" } };
        root.set_attribute("class", &self.class_string());
        if !style_parts.is_empty() {
            root.set_attribute("style", &style_parts.join("; "));
        }

        for child in children {
           
render function · rust · L188-L194 (7 LOC)
crates/rinch-components/src/hover_card.rs
    fn render(&self, __scope: &mut RenderScope, children: &[NodeHandle]) -> NodeHandle {
        let target = rinch_macros::rsx! { div { class: "rinch-hover-card__target" } };
        for child in children {
            target.append_child(child);
        }
        target
    }
render function · rust · L202-L208 (7 LOC)
crates/rinch-components/src/hover_card.rs
    fn render(&self, __scope: &mut RenderScope, children: &[NodeHandle]) -> NodeHandle {
        let dropdown = rinch_macros::rsx! { div { class: "rinch-hover-card__dropdown" } };
        for child in children {
            dropdown.append_child(child);
        }
        dropdown
    }
chevron_up_dom function · rust · L12-L26 (15 LOC)
crates/rinch-components/src/icons.rs
pub fn chevron_up_dom(scope: &mut RenderScope) -> NodeHandle {
    let svg = scope.create_element("svg");
    svg.set_attribute("width", "10");
    svg.set_attribute("height", "10");
    svg.set_attribute("viewBox", "0 0 24 24");
    svg.set_attribute("fill", "none");
    svg.set_attribute("stroke", "currentColor");
    svg.set_attribute("stroke-width", "2");

    let path = scope.create_element("path");
    path.set_attribute("d", "M18 15l-6-6-6 6");
    svg.append_child(&path);

    svg
}
Want this analysis on your repo? https://repobility.com/scan/
chevron_down_small_dom function · rust · L29-L43 (15 LOC)
crates/rinch-components/src/icons.rs
pub fn chevron_down_small_dom(scope: &mut RenderScope) -> NodeHandle {
    let svg = scope.create_element("svg");
    svg.set_attribute("width", "10");
    svg.set_attribute("height", "10");
    svg.set_attribute("viewBox", "0 0 24 24");
    svg.set_attribute("fill", "none");
    svg.set_attribute("stroke", "currentColor");
    svg.set_attribute("stroke-width", "2");

    let path = scope.create_element("path");
    path.set_attribute("d", "M6 9l6 6 6-6");
    svg.append_child(&path);

    svg
}
eye_dom function · rust · L46-L68 (23 LOC)
crates/rinch-components/src/icons.rs
pub fn eye_dom(scope: &mut RenderScope) -> NodeHandle {
    let svg = scope.create_element("svg");
    svg.set_attribute("width", "16");
    svg.set_attribute("height", "16");
    svg.set_attribute("viewBox", "0 0 24 24");
    svg.set_attribute("fill", "none");
    svg.set_attribute("stroke", "currentColor");
    svg.set_attribute("stroke-width", "2");
    svg.set_attribute("stroke-linecap", "round");
    svg.set_attribute("stroke-linejoin", "round");

    let path = scope.create_element("path");
    path.set_attribute("d", "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z");
    svg.append_child(&path);

    let circle = scope.create_element("circle");
    circle.set_attribute("cx", "12");
    circle.set_attribute("cy", "12");
    circle.set_attribute("r", "3");
    svg.append_child(&circle);

    svg
}
eye_off_dom function · rust · L71-L94 (24 LOC)
crates/rinch-components/src/icons.rs
pub fn eye_off_dom(scope: &mut RenderScope) -> NodeHandle {
    let svg = scope.create_element("svg");
    svg.set_attribute("width", "16");
    svg.set_attribute("height", "16");
    svg.set_attribute("viewBox", "0 0 24 24");
    svg.set_attribute("fill", "none");
    svg.set_attribute("stroke", "currentColor");
    svg.set_attribute("stroke-width", "2");
    svg.set_attribute("stroke-linecap", "round");
    svg.set_attribute("stroke-linejoin", "round");

    let path = scope.create_element("path");
    path.set_attribute("d", "M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24");
    svg.append_child(&path);

    let line = scope.create_element("line");
    line.set_attribute("x1", "1");
    line.set_attribute("y1", "1");
    line.set_attribute("x2", "23");
    line.set_attribute("y2", "23");
    svg.append_child(&line);

    svg
}
checkmark_dom function · rust · L97-L128 (32 LOC)
crates/rinch-components/src/icons.rs
pub fn checkmark_dom(scope: &mut RenderScope) -> NodeHandle {
    let svg = scope.create_element("svg");
    svg.set_attribute("viewBox", "0 0 10 7");
    svg.set_attribute("fill", "none");
    svg.set_attribute("xmlns", "http://www.w3.org/2000/svg");

    let path = scope.create_element("path");
    path.set_attribute("d", "M4 4.586L1.707 2.293A1 1 0 1 0 .293 3.707l3 3a1 1 0 0 0 1.414 0l5-5A1 1 0 0 0 8.293.293L4 4.586z");
    path.set_attribute("fill", "white");
    svg.append_child(&path);

    svg
}

/// Create an indeterminate icon as a NodeHandle (for DOM rendering).
pub fn indeterminate_dom(scope: &mut RenderScope) -> NodeHandle {
    let svg = scope.create_element("svg");
    svg.set_attribute("viewBox", "0 0 12 12");
    svg.set_attribute("fill", "none");
    svg.set_attribute("xmlns", "http://www.w3.org/2000/svg");

    let rect = scope.create_element("rect");
    rect.set_attribute("x", "2");
    rect.set_attribute("y", "5");
    rect.set_attribute("width", "8");
    rect.set
close_icon_lines_dom function · rust · L132-L154 (23 LOC)
crates/rinch-components/src/icons.rs
pub fn close_icon_lines_dom(scope: &mut RenderScope) -> NodeHandle {
    let svg = scope.create_element("svg");
    svg.set_attribute("viewBox", "0 0 24 24");
    svg.set_attribute("fill", "none");
    svg.set_attribute("stroke", "currentColor");
    svg.set_attribute("stroke-width", "2");

    let line1 = scope.create_element("line");
    line1.set_attribute("x1", "18");
    line1.set_attribute("y1", "6");
    line1.set_attribute("x2", "6");
    line1.set_attribute("y2", "18");
    svg.append_child(&line1);

    let line2 = scope.create_element("line");
    line2.set_attribute("x1", "6");
    line2.set_attribute("y1", "6");
    line2.set_attribute("x2", "18");
    line2.set_attribute("y2", "18");
    svg.append_child(&line2);

    svg
}
close_icon_dom function · rust · L157-L173 (17 LOC)
crates/rinch-components/src/icons.rs
pub fn close_icon_dom(scope: &mut RenderScope, size: &str) -> NodeHandle {
    let svg = scope.create_element("svg");
    svg.set_attribute("width", size);
    svg.set_attribute("height", size);
    svg.set_attribute("viewBox", "0 0 24 24");
    svg.set_attribute("fill", "none");
    svg.set_attribute("stroke", "currentColor");
    svg.set_attribute("stroke-width", "2");
    svg.set_attribute("stroke-linecap", "round");
    svg.set_attribute("stroke-linejoin", "round");

    let path = scope.create_element("path");
    path.set_attribute("d", "M18 6L6 18M6 6l12 12");
    svg.append_child(&path);

    svg
}
chevron_left_dom function · rust · L176-L188 (13 LOC)
crates/rinch-components/src/icons.rs
pub fn chevron_left_dom(scope: &mut RenderScope) -> NodeHandle {
    let svg = scope.create_element("svg");
    svg.set_attribute("viewBox", "0 0 24 24");
    svg.set_attribute("fill", "none");
    svg.set_attribute("stroke", "currentColor");
    svg.set_attribute("stroke-width", "2");

    let polyline = scope.create_element("polyline");
    polyline.set_attribute("points", "15 18 9 12 15 6");
    svg.append_child(&polyline);

    svg
}
chevron_right_dom function · rust · L191-L203 (13 LOC)
crates/rinch-components/src/icons.rs
pub fn chevron_right_dom(scope: &mut RenderScope) -> NodeHandle {
    let svg = scope.create_element("svg");
    svg.set_attribute("viewBox", "0 0 24 24");
    svg.set_attribute("fill", "none");
    svg.set_attribute("stroke", "currentColor");
    svg.set_attribute("stroke-width", "2");

    let polyline = scope.create_element("polyline");
    polyline.set_attribute("points", "9 18 15 12 9 6");
    svg.append_child(&polyline);

    svg
}
Want fix-PRs on findings? Install Repobility's GitHub App · github.com/apps/repobility-bot
chevrons_left_dom function · rust · L206-L222 (17 LOC)
crates/rinch-components/src/icons.rs
pub fn chevrons_left_dom(scope: &mut RenderScope) -> NodeHandle {
    let svg = scope.create_element("svg");
    svg.set_attribute("viewBox", "0 0 24 24");
    svg.set_attribute("fill", "none");
    svg.set_attribute("stroke", "currentColor");
    svg.set_attribute("stroke-width", "2");

    let polyline1 = scope.create_element("polyline");
    polyline1.set_attribute("points", "11 17 6 12 11 7");
    svg.append_child(&polyline1);

    let polyline2 = scope.create_element("polyline");
    polyline2.set_attribute("points", "18 17 13 12 18 7");
    svg.append_child(&polyline2);

    svg
}
chevrons_right_dom function · rust · L225-L241 (17 LOC)
crates/rinch-components/src/icons.rs
pub fn chevrons_right_dom(scope: &mut RenderScope) -> NodeHandle {
    let svg = scope.create_element("svg");
    svg.set_attribute("viewBox", "0 0 24 24");
    svg.set_attribute("fill", "none");
    svg.set_attribute("stroke", "currentColor");
    svg.set_attribute("stroke-width", "2");

    let polyline1 = scope.create_element("polyline");
    polyline1.set_attribute("points", "13 17 18 12 13 7");
    svg.append_child(&polyline1);

    let polyline2 = scope.create_element("polyline");
    polyline2.set_attribute("points", "6 17 11 12 6 7");
    svg.append_child(&polyline2);

    svg
}
check_dom function · rust · L244-L256 (13 LOC)
crates/rinch-components/src/icons.rs
pub fn check_dom(scope: &mut RenderScope) -> NodeHandle {
    let svg = scope.create_element("svg");
    svg.set_attribute("viewBox", "0 0 24 24");
    svg.set_attribute("fill", "none");
    svg.set_attribute("stroke", "currentColor");
    svg.set_attribute("stroke-width", "2");

    let polyline = scope.create_element("polyline");
    polyline.set_attribute("points", "20 6 9 17 4 12");
    svg.append_child(&polyline);

    svg
}
‹ prevpage 3 / 20next ›