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
//! # dioxus-nox-timer
//!
//! **⚠️ Disclaimer:** This crate was entirely generated by AI (Claude) as part of a
//! personal learning project. It has not been battle-tested in production and may
//! contain bugs or unsound abstractions. Use at your own risk and exercise extreme
//! caution before depending on it in anything that matters.
//!
//! Headless timer primitives for Dioxus applications: countdown and stopwatch hooks.
//!
//! ## Features
//!
//! - **Wall-clock based** — survives browser tab backgrounding (no `setInterval` drift)
//! - **Cross-platform** — works on web (wasm32), desktop, iOS, and Android
//! - **Headless** — no rendered components, just hooks and state machines
//!
//! ## Quick start
//!
//! ```rust,ignore
//! use dioxus::prelude::*;
//! use dioxus_nox_timer::*;
//!
//! #[component]
//! fn RestTimer() -> Element {
//! let (remaining, state, controls) = use_countdown(None);
//!
//! rsx! {
//! div {
//! // Recommended ARIA attributes for consumers:
//! role: "timer",
//! aria_live: "polite",
//! "data-timer-state": match *state.read() {
//! TimerState::Idle => "idle",
//! TimerState::Running => "running",
//! TimerState::Paused => "paused",
//! TimerState::Complete => "complete",
//! },
//! p { "{format_duration(*remaining.read())}" }
//! button { onclick: move |_| controls.start.call(90), "Start 90s" }
//! button { onclick: move |_| controls.pause.call(()), "Pause" }
//! button { onclick: move |_| controls.resume.call(()), "Resume" }
//! }
//! }
//! }
//! ```
pub
pub use use_countdown;
pub use format_duration;
pub use use_stopwatch;
pub use ;