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

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;
@@ -22,17 +22,22 @@ export interface CycleTimerProps {
22
22
  compact?: boolean;
23
23
  /** Additional CSS classes */
24
24
  className?: string;
25
+ /** Whether the timer is in an error state (pauses timer and shows error styling) */
26
+ hasError?: boolean;
25
27
  }
26
28
  /**
27
- * A circular gauge timer component that shows the remaining time of a cycle
29
+ * A circular gauge timer component that shows the remaining time of a cycle or counts up
28
30
  *
29
31
  * Features:
30
32
  * - 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
33
+ * - Two modes: count-down (with max time) or count-up (without max time)
34
+ * - Count-down mode: shows remaining time prominently, counts down to zero
35
+ * - Count-up mode: shows elapsed time, gauge progresses in minute steps
36
+ * - Displays appropriate labels based on mode
37
+ * - Automatically counts down/up and triggers callback when reaching zero (count-down only)
34
38
  * - Full timer control: start, pause, resume functionality
35
39
  * - Support for starting with elapsed time (resume mid-cycle)
40
+ * - Error state support: pauses timer and shows error styling (red color)
36
41
  * - Smooth spring-based progress animations for all state transitions
37
42
  * - Fully localized with i18next
38
43
  * - Material-UI theming integration
@@ -44,37 +49,49 @@ export interface CycleTimerProps {
44
49
  * @param variant - Visual variant: "default" (large gauge) or "small" (animated icon with text)
45
50
  * @param compact - For small variant: whether to hide remaining time details
46
51
  * @param className - Additional CSS classes
52
+ * @param hasError - Whether the timer is in an error state (pauses timer and shows error styling)
47
53
  *
48
54
  * Usage:
49
55
  * ```tsx
56
+ * // Count-down timer (with max time)
50
57
  * <CycleTimer
51
58
  * onCycleComplete={(controls) => {
52
- * // Start a 5-minute cycle
59
+ * // Start a 5-minute countdown cycle
53
60
  * controls.startNewCycle(300)
54
61
  *
55
62
  * // Or start a 5-minute cycle with 2 minutes already elapsed
56
63
  * controls.startNewCycle(300, 120)
64
+ * }}
65
+ * onCycleEnd={() => console.log('Cycle completed!')}
66
+ * />
57
67
  *
58
- * // Pause the timer
59
- * controls.pause()
68
+ * // Count-up timer (no max time)
69
+ * <CycleTimer
70
+ * onCycleComplete={(controls) => {
71
+ * // Start count-up timer
72
+ * controls.startNewCycle()
60
73
  *
61
- * // Resume the timer
62
- * controls.resume()
74
+ * // Or start count-up timer with some elapsed time
75
+ * controls.startNewCycle(undefined, 120)
76
+ * }}
77
+ * />
63
78
  *
64
- * // Check if paused
65
- * const paused = controls.isPaused()
79
+ * // Timer with error state
80
+ * <CycleTimer
81
+ * hasError={errorCondition}
82
+ * onCycleComplete={(controls) => {
83
+ * controls.startNewCycle(300)
66
84
  * }}
67
- * onCycleEnd={() => console.log('Cycle completed!')}
68
85
  * />
69
86
  * ```
70
87
  *
71
88
  * Control Functions:
72
- * - `startNewCycle(maxTimeSeconds, elapsedSeconds?)` - Start a new timer cycle
89
+ * - `startNewCycle(maxTimeSeconds?, elapsedSeconds?)` - Start a new timer cycle (omit maxTimeSeconds for count-up mode)
73
90
  * - `pause()` - Pause the countdown while preserving remaining time
74
91
  * - `resume()` - Resume countdown from where it was paused
75
92
  * - `isPaused()` - Check current pause state
76
93
  */
77
- export declare const CycleTimer: (({ onCycleComplete, onCycleEnd, autoStart, variant, compact, className, }: CycleTimerProps) => import("react/jsx-runtime").JSX.Element) & {
94
+ export declare const CycleTimer: (({ onCycleComplete, onCycleEnd, autoStart, variant, compact, className, hasError, }: CycleTimerProps) => import("react/jsx-runtime").JSX.Element) & {
78
95
  displayName: string;
79
96
  };
80
97
  //# sourceMappingURL=CycleTimer.d.ts.map
@@ -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;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,eAAO,MAAM,UAAU,8EAShB,eAAe;;CAsXrB,CAAA"}
1
+ {"version":3,"file":"CycleTimer.d.ts","sourceRoot":"","sources":["../../src/components/CycleTimer.tsx"],"names":[],"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