Skip to main content

orbital_shell/tokens/
interaction_state.rs

1//! Interaction states for hover / focus / pressed styling.
2
3/// Resting and interactive states for token-driven class composition.
4#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
5pub enum InteractionState {
6    Rest,
7    Hover,
8    Pressed,
9    Selected,
10    Focus,
11    Disabled,
12}
13
14impl InteractionState {
15    pub const fn as_class(self) -> &'static str {
16        match self {
17            Self::Rest => "orbital-token-state-rest",
18            Self::Hover => "orbital-token-state-hover",
19            Self::Pressed => "orbital-token-state-pressed",
20            Self::Selected => "orbital-token-state-selected",
21            Self::Focus => "orbital-token-state-focus",
22            Self::Disabled => "orbital-token-state-disabled",
23        }
24    }
25
26    /// Focus ring color token (stroke focus).
27    pub const fn focus_ring_token() -> &'static str {
28        "var(--orb-color-border-focus)"
29    }
30}