1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
//! Text cursor component for the text edit core system.
//!
//! This module provides a blinking cursor component used within text editing interfaces.
//! The cursor provides visual feedback for text insertion point and blinks at regular
//! intervals to maintain user attention.
use Instant;
use ;
use crateShapeCommand;
/// Width of the text cursor in device-independent pixels.
pub const CURSOR_WIDRH: Dp = Dp;
/// A blinking cursor component for text editing interfaces.
///
/// This component renders a vertical line cursor that blinks on and off at regular
/// intervals to indicate the text insertion point. The cursor automatically handles
/// its own blinking animation based on the provided timer.
///
/// # Parameters
///
/// * `height_px` - The height of the cursor in pixels, typically matching the line height
/// * `bink_timer` - Timer used to control the blinking animation cycle
///
/// # Blinking Behavior
///
/// The cursor follows a 1-second blinking cycle:
/// - Visible for 500ms
/// - Hidden for 500ms
/// - Repeats continuously
///
/// # Example
///
/// ```rust,ignore
/// use std::time::Instant;
/// use tessera_ui::Px;
///
/// // Create a cursor with line height and current time
/// cursor(Px(20.0), Instant::now());
/// ```
///
/// # Rendering
///
/// The cursor is rendered as a solid black rectangle with:
/// - Fixed width of 2.5 device-independent pixels
/// - Variable height matching the text line height
/// - No corner radius (sharp rectangular appearance)
/// - No shadow effects
pub