Skip to main content

Crate lumen_primitives

Crate lumen_primitives 

Source
Expand description

Headless interaction primitives: scroll, drag, press, focus, resize.

  • Headless: state machines and per-OS physics constants only, with no visual styling.
  • Apps style by applying CSS skins or by assigning [Visuals] directly.
  • Scroll: each [MouseWheel] accumulates into the offset of the hovered scroll container; per-OS physics constants live in physics.

Re-exports§

pub use checkbox::CheckboxBox;
pub use checkbox::CheckboxPlugin;
pub use checkbox::CheckboxStyle;
pub use checkbox::Indeterminate;
pub use checkbox::clear_indeterminate_on_user_toggle;
pub use checkbox::sync_checkbox_visuals;
pub use controls::ControlsPlugin;
pub use controls::KnobGeometry;
pub use controls::SliderChanged;
pub use controls::SliderDragOrigin;
pub use controls::SliderThumb;
pub use controls::ToggleChanged;
pub use controls::ToggleKnob;
pub use controls::TrackStyle;
pub use controls::WHEEL_NOTCH_PX;
pub use controls::adjust_slider_on_wheel;
pub use controls::cancel_slider_drag_on_escape;
pub use controls::sync_slider_thumb;
pub use controls::sync_toggle_visuals;
pub use controls::sync_track_fill;
pub use cursor::CursorPlugin;
pub use cursor::update_cursor_request;
pub use drag::DragConfig;
pub use drag::DragPlugin;
pub use drag::DragState;
pub use drag::Draggable;
pub use hover::FocusOutlineSpec;
pub use hover::HoverTintPlugin;
pub use hover::HoverTween;
pub use hover::Interaction;
pub use hover::PressTween;
pub use hover::StateBorderHeld;
pub use hover::apply_state_borders;
pub use popup::PopupGap;
pub use popup::PopupPanel;
pub use popup::PopupSide;
pub use popup::anchored_popup_origin;
pub use popup::dismiss_popups_on_outside_press;
pub use popup::flip_open_dropdown_panels;
pub use popup_nav::ActivePopupNav;
pub use popup_nav::PopupNavConfig;
pub use popup_nav::PopupNavSession;
pub use popup_nav::TypeAheadBuffer;
pub use popup_nav::closed_dropdown_keys;
pub use popup_nav::follow_hover_highlight;
pub use popup_nav::popup_nav_keys;
pub use popup_nav::popup_nav_lifecycle;
pub use press::PressConfig;
pub use press::PressPlugin;
pub use press::PressStartedAt;
pub use progress::PROGRESS_PERIOD_MS;
pub use progress::ProgressBar;
pub use progress::ProgressChunk;
pub use progress::ProgressFill;
pub use progress::ProgressPlugin;
pub use progress::apply_progress_bindings;
pub use progress::sync_progress_fill;
pub use radio::RadioButton;
pub use radio::RadioDot;
pub use radio::RadioPlugin;
pub use radio::RadioStyle;
pub use radio::dispatch_radio_clicks;
pub use radio::radio_group_keys;
pub use radio::sync_radio_selected;
pub use radio::sync_radio_tab_index;
pub use radio::sync_radio_visuals;
pub use scroll::ScrollPlugin;
pub use scroll::accumulate_wheel;
pub use scrollbar::update_scrollbars;
pub use state_style::StatePatch;
pub use state_style::StateStylePlugin;
pub use state_style::StateVisuals;
pub use state_style::apply_state_visuals;
pub use state_style::eject_interaction_on_disable;
pub use switch::SWITCH_SLIDE_EASING;
pub use switch::SWITCH_SLIDE_MS;
pub use switch::SwitchPlugin;
pub use switch::SwitchThumb;
pub use switch::SwitchThumbSlide;
pub use switch::register_switch_systems;
pub use switch::step_switch_thumb;
pub use switch::sync_switch_visuals;
pub use tabs::DropdownButton;
pub use tabs::DropdownOptionButton;
pub use tabs::DropdownOptionSpec;
pub use tabs::MenuItemButton;
pub use tabs::TAB_SELECTED_BG;
pub use tabs::TabButtonStyle;
pub use tabs::TabStripButton;
pub use tabs::TabsPlugin;
pub use tabs::sync_tab_button_visuals;
pub use tabs::sync_tab_selected;
pub use tooltip::HoverStartedAt;
pub use tooltip::TooltipPlugin;
pub use tooltip::TooltipPopup;
pub use tooltip::TooltipSource;
pub use tooltip::cursor_tooltip_origin;
pub use transition::BackgroundTransition;
pub use transition::BorderColorTransition;
pub use transition::Easing;
pub use transition::Lerp;
pub use transition::OpacityTransition;
pub use transition::TextColorTransition;
pub use transition::Transition;
pub use transition::TransitionPlugin;
pub use transition::TransitionProperty;
pub use transition::TransitionSpec;
pub use transition::TransitionSpecs;
pub use transition::retarget;
pub use validation::ValidationPlugin;
pub use validation::apply_validation;
pub use validation::evaluate;
pub use validation::matches_pattern;

Modules§

checkbox
<checkbox> behavior: box + label control on top of the shared Toggleable machinery, with a tri-state indeterminate mode.
controls
Stateful control behaviors for the <toggle> and <slider> markup tags.
cursor
Mouse-cursor shape selection (spec: I-beam over text inputs, pointer over clickables, grab/grabbing on scrollbar + slider thumbs).
drag
Drag primitive: threshold + state machine.
hover
Interaction-state paint primitives: hover, press, focus ring - all folded into a single Interaction fat component.
physics
Per-OS physics constants used by the scroll, drag, and press primitives.
popup
Floating-panel behavior shared by <dropdown> and <menu>: outside-click dismissal and viewport edge-flip anchoring.
popup_nav
Keyboard interaction for popup widgets: <dropdown> (combobox) and <menu> panels. Matches the Qt contract:
press
Press primitive: long-press detection + double-click recognizer.
progress
<progress> bar behavior: determinate fill sync + indeterminate sweep animation.
radio
<radio> behavior: name-grouped exclusive selection with roving tab index and wrapping arrow-key navigation (Qt QRadioButton in an auto-exclusive group / WAI-ARIA radiogroup).
scroll
Scroll primitive.
scrollbar
Overlay-scrollbar interaction FSM + fade driver (spec section 16.2 / section 16.6).
state_style
State-driven text-color / opacity / box-shadow / background swaps.
switch
<switch> behavior: an on/off toggle rendered as a pill track with a thumb that slides between the two ends, built on the same shared Toggleable machinery as <checkbox>.
tabs
<tabs> strip-button runtime.
tooltip
Hover-delay tooltip widget driven by markup <tooltip text="Save" delay="500">...trigger...</tooltip>.
transition
Generic per-property tween primitive.
validation
Form-field validation driver.
wake
Reactive wake: schedule a follow-up tick whenever the current tick wrote typed properties that downstream consumers haven’t observed yet.

Structs§

Scroll
Scrollable container configuration. Each instance carries its own sensitivity, inertia, and momentum.
ScrollOffset
Current scroll offset (positive = content shifted up/left).

Enums§

ScrollAxis
Axis (or axes) a scroll container responds to. Used by lumen-input for scroll-aware hit-testing and by lumen-primitives for the accumulator and extract.