@wandelbots/wandelbots-js-react-components 2.34.1-pr.feature-robot-precondition-list.372.c1de8ff → 2.34.1-pr.feature-robot-precondition-list.372.a71f99a

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,13 +1,13 @@
1
1
  export interface CycleTimerProps {
2
2
  /**
3
3
  * Callback that receives the timer control functions:
4
- * - `startNewCycle(maxTimeSeconds, elapsedSeconds?)` - Start a new timer cycle
4
+ * - `startNewCycle(maxTimeSeconds?, elapsedSeconds?)` - Start a new timer cycle (if maxTimeSeconds is omitted, runs as count-up timer)
5
5
  * - `pause()` - Pause the countdown while preserving remaining time
6
6
  * - `resume()` - Resume countdown from where it was paused
7
7
  * - `isPaused()` - Check current pause state
8
8
  */
9
9
  onCycleComplete: (controls: {
10
- startNewCycle: (maxTimeSeconds: number, elapsedSeconds?: number) => void;
10
+ startNewCycle: (maxTimeSeconds?: number, elapsedSeconds?: number) => void;
11
11
  pause: () => void;
12
12
  resume: () => void;
13
13
  isPaused: () => boolean;
@@ -24,13 +24,15 @@ export interface CycleTimerProps {
24
24
  className?: string;
25
25
  }
26
26
  /**
27
- * A circular gauge timer component that shows the remaining time of a cycle
27
+ * A circular gauge timer component that shows the remaining time of a cycle or counts up
28
28
  *
29
29
  * Features:
30
30
  * - Circular gauge with 264px diameter and 40px thickness
31
- * - Shows remaining time prominently in the center (60px font)
32
- * - Displays "remaining time" label at top and total time at bottom
33
- * - Automatically counts down and triggers callback when reaching zero
31
+ * - Two modes: count-down (with max time) or count-up (without max time)
32
+ * - Count-down mode: shows remaining time prominently, counts down to zero
33
+ * - Count-up mode: shows elapsed time, gauge progresses in minute steps
34
+ * - Displays appropriate labels based on mode
35
+ * - Automatically counts down/up and triggers callback when reaching zero (count-down only)
34
36
  * - Full timer control: start, pause, resume functionality
35
37
  * - Support for starting with elapsed time (resume mid-cycle)
36
38
  * - Smooth spring-based progress animations for all state transitions
@@ -47,29 +49,32 @@ export interface CycleTimerProps {
47
49
  *
48
50
  * Usage:
49
51
  * ```tsx
52
+ * // Count-down timer (with max time)
50
53
  * <CycleTimer
51
54
  * onCycleComplete={(controls) => {
52
- * // Start a 5-minute cycle
55
+ * // Start a 5-minute countdown cycle
53
56
  * controls.startNewCycle(300)
54
57
  *
55
58
  * // Or start a 5-minute cycle with 2 minutes already elapsed
56
59
  * controls.startNewCycle(300, 120)
60
+ * }}
61
+ * onCycleEnd={() => console.log('Cycle completed!')}
62
+ * />
57
63
  *
58
- * // Pause the timer
59
- * controls.pause()
60
- *
61
- * // Resume the timer
62
- * controls.resume()
64
+ * // Count-up timer (no max time)
65
+ * <CycleTimer
66
+ * onCycleComplete={(controls) => {
67
+ * // Start count-up timer
68
+ * controls.startNewCycle()
63
69
  *
64
- * // Check if paused
65
- * const paused = controls.isPaused()
70
+ * // Or start count-up timer with some elapsed time
71
+ * controls.startNewCycle(undefined, 120)
66
72
  * }}
67
- * onCycleEnd={() => console.log('Cycle completed!')}
68
73
  * />
69
74
  * ```
70
75
  *
71
76
  * Control Functions:
72
- * - `startNewCycle(maxTimeSeconds, elapsedSeconds?)` - Start a new timer cycle
77
+ * - `startNewCycle(maxTimeSeconds?, elapsedSeconds?)` - Start a new timer cycle (omit maxTimeSeconds for count-up mode)
73
78
  * - `pause()` - Pause the countdown while preserving remaining time
74
79
  * - `resume()` - Resume countdown from where it was paused
75
80
  * - `isPaused()` - Check current pause state
@@ -1 +1 @@
1
- {"version":3,"file":"CycleTimer.d.ts","sourceRoot":"","sources":["../../src/components/CycleTimer.tsx"],"names":[],"mappings":"AAQA,MAAM,WAAW,eAAe;IAC9B;;;;;;OAMG;IACH,eAAe,EAAE,CAAC,QAAQ,EAAE;QAC1B,aAAa,EAAE,CAAC,cAAc,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;QACxE,KAAK,EAAE,MAAM,IAAI,CAAA;QACjB,MAAM,EAAE,MAAM,IAAI,CAAA;Q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