@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.
- package/dist/components/CycleTimer.d.ts +21 -16
- package/dist/components/CycleTimer.d.ts.map +1 -1
- package/dist/index.cjs +36 -36
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +7278 -7217
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/CycleTimer.tsx +188 -86
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
export interface CycleTimerProps {
|
|
2
2
|
/**
|
|
3
3
|
* Callback that receives the timer control functions:
|
|
4
|
-
* - `startNewCycle(maxTimeSeconds
|
|
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
|
|
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
|
-
* -
|
|
32
|
-
* -
|
|
33
|
-
* -
|
|
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
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
* //
|
|
62
|
-
* controls.
|
|
64
|
+
* // Count-up timer (no max time)
|
|
65
|
+
* <CycleTimer
|
|
66
|
+
* onCycleComplete={(controls) => {
|
|
67
|
+
* // Start count-up timer
|
|
68
|
+
* controls.startNewCycle()
|
|
63
69
|
*
|
|
64
|
-
* //
|
|
65
|
-
*
|
|
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
|
|
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;
|
|
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,CAAC,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;QACzE,KAAK,EAAE,MAAM,IAAI,CAAA;QACjB,MAAM,EAAE,MAAM,IAAI,CAAA;QAClB,QAAQ,EAAE,MAAM,OAAO,CAAA;KACxB,KAAK,IAAI,CAAA;IACV,oEAAoE;IACpE,UAAU,CAAC,EAAE,MAAM,IAAI,CAAA;IACvB,uEAAuE;IACvE,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,kCAAkC;IAClC,OAAO,CAAC,EAAE,SAAS,GAAG,OAAO,CAAA;IAC7B,qFAAqF;IACrF,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AACH,eAAO,MAAM,UAAU,8EAShB,eAAe;;CAudrB,CAAA"}
|