@wandelbots/wandelbots-js-react-components 2.32.0-pr.feature-robot-precondition-list.372.297bf4f → 2.32.0-pr.feature-robot-precondition-list.372.5d8a86e
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.map +1 -1
- package/dist/components/ProgramControl.d.ts +6 -1
- package/dist/components/ProgramControl.d.ts.map +1 -1
- package/dist/components/ProgramStateIndicator.d.ts +1 -1
- package/dist/components/ProgramStateIndicator.d.ts.map +1 -1
- package/dist/components/RobotCard.d.ts +73 -0
- package/dist/components/RobotCard.d.ts.map +1 -0
- package/dist/components/RobotSetupReadinessIndicator.d.ts.map +1 -1
- package/dist/components/robots/Robot.d.ts +3 -2
- package/dist/components/robots/Robot.d.ts.map +1 -1
- package/dist/index.cjs +48 -48
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6840 -6442
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/CycleTimer.tsx +43 -64
- package/src/components/ProgramControl.tsx +20 -10
- package/src/components/ProgramStateIndicator.tsx +20 -8
- package/src/components/RobotCard.tsx +568 -0
- package/src/components/RobotSetupReadinessIndicator.tsx +2 -0
- package/src/components/robots/Robot.tsx +5 -2
- package/src/i18n/locales/de/translations.json +3 -1
- package/src/i18n/locales/en/translations.json +3 -1
- package/src/index.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wandelbots/wandelbots-js-react-components",
|
|
3
|
-
"version": "2.32.0-pr.feature-robot-precondition-list.372.
|
|
3
|
+
"version": "2.32.0-pr.feature-robot-precondition-list.372.5d8a86e",
|
|
4
4
|
"description": "React UI toolkit for building applications on top of the Wandelbots platform",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -301,77 +301,56 @@ export const CycleTimer = externalizeComponent(
|
|
|
301
301
|
sx={{
|
|
302
302
|
display: "flex",
|
|
303
303
|
alignItems: "center",
|
|
304
|
-
|
|
304
|
+
m: 0,
|
|
305
|
+
gap: 1, // 8px gap between circle and text
|
|
305
306
|
}}
|
|
306
307
|
>
|
|
307
|
-
{/* Animated progress
|
|
308
|
+
{/* Animated progress ring icon */}
|
|
308
309
|
<Box
|
|
309
310
|
sx={{
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
height: 40,
|
|
311
|
+
width: 20,
|
|
312
|
+
height: 20,
|
|
313
313
|
display: "flex",
|
|
314
314
|
alignItems: "center",
|
|
315
315
|
justifyContent: "center",
|
|
316
|
-
|
|
317
|
-
|
|
316
|
+
opacity: isPausedState ? 0.6 : 1,
|
|
317
|
+
transition: "opacity 0.2s ease",
|
|
318
318
|
}}
|
|
319
319
|
>
|
|
320
|
-
<
|
|
321
|
-
width=
|
|
322
|
-
height=
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
},
|
|
355
|
-
[`& circle`]: {
|
|
356
|
-
display: "none",
|
|
357
|
-
},
|
|
358
|
-
}}
|
|
359
|
-
/>
|
|
360
|
-
|
|
361
|
-
{/* Inner circle overlay to prevent flashing */}
|
|
362
|
-
<Box
|
|
363
|
-
sx={{
|
|
364
|
-
position: "absolute",
|
|
365
|
-
top: "50%",
|
|
366
|
-
left: "50%",
|
|
367
|
-
transform: "translate(-50%, -50%)",
|
|
368
|
-
width: 13,
|
|
369
|
-
height: 13,
|
|
370
|
-
borderRadius: "50%",
|
|
371
|
-
backgroundColor: theme.palette.background?.paper || "white",
|
|
372
|
-
pointerEvents: "none",
|
|
373
|
-
}}
|
|
374
|
-
/>
|
|
320
|
+
<svg
|
|
321
|
+
width="20"
|
|
322
|
+
height="20"
|
|
323
|
+
viewBox="0 0 20 20"
|
|
324
|
+
style={{ transform: "rotate(-90deg)" }}
|
|
325
|
+
role="img"
|
|
326
|
+
aria-label="Timer progress"
|
|
327
|
+
>
|
|
328
|
+
{/* Background ring */}
|
|
329
|
+
<circle
|
|
330
|
+
cx="10"
|
|
331
|
+
cy="10"
|
|
332
|
+
r="8"
|
|
333
|
+
fill="none"
|
|
334
|
+
stroke={theme.palette.success.main}
|
|
335
|
+
strokeWidth="2"
|
|
336
|
+
opacity={0.3}
|
|
337
|
+
/>
|
|
338
|
+
{/* Progress ring */}
|
|
339
|
+
<circle
|
|
340
|
+
cx="10"
|
|
341
|
+
cy="10"
|
|
342
|
+
r="8"
|
|
343
|
+
fill="none"
|
|
344
|
+
stroke={theme.palette.success.main}
|
|
345
|
+
strokeWidth="2"
|
|
346
|
+
strokeLinecap="round"
|
|
347
|
+
strokeDasharray={`${2 * Math.PI * 8}`}
|
|
348
|
+
strokeDashoffset={`${2 * Math.PI * 8 * (1 - progressValue / 100)}`}
|
|
349
|
+
style={{
|
|
350
|
+
transition: "stroke-dashoffset 0.1s ease-out",
|
|
351
|
+
}}
|
|
352
|
+
/>
|
|
353
|
+
</svg>
|
|
375
354
|
</Box>
|
|
376
355
|
|
|
377
356
|
{/* Timer text display */}
|
|
@@ -383,8 +362,8 @@ export const CycleTimer = externalizeComponent(
|
|
|
383
362
|
}}
|
|
384
363
|
>
|
|
385
364
|
{compact
|
|
386
|
-
? // Compact mode: show
|
|
387
|
-
formatTime(remainingTime)
|
|
365
|
+
? // Compact mode: show remaining time with "min." suffix
|
|
366
|
+
`${formatTime(remainingTime)} ${t("CycleTimer.Time.lb", { time: "" }).replace(/\s*$/, "")}`
|
|
388
367
|
: // Full mode: show "remaining / of total min." format
|
|
389
368
|
`${formatTime(remainingTime)} / ${t("CycleTimer.Time.lb", { time: formatTime(maxTime) })}`}
|
|
390
369
|
</Typography>
|
|
@@ -4,7 +4,12 @@ import { observer } from "mobx-react-lite"
|
|
|
4
4
|
import { useTranslation } from "react-i18next"
|
|
5
5
|
import { externalizeComponent } from "../externalizeComponent"
|
|
6
6
|
|
|
7
|
-
export
|
|
7
|
+
export enum ProgramState {
|
|
8
|
+
IDLE = "idle",
|
|
9
|
+
RUNNING = "running",
|
|
10
|
+
PAUSED = "paused",
|
|
11
|
+
STOPPING = "stopping",
|
|
12
|
+
}
|
|
8
13
|
|
|
9
14
|
export interface ProgramControlProps {
|
|
10
15
|
/** The current state of the program control */
|
|
@@ -70,22 +75,24 @@ export const ProgramControl = externalizeComponent(
|
|
|
70
75
|
const getButtonConfigs = (): ButtonConfig[] => {
|
|
71
76
|
const baseConfigs: Record<string, ButtonConfig> = {
|
|
72
77
|
run: {
|
|
73
|
-
enabled:
|
|
78
|
+
enabled:
|
|
79
|
+
state === ProgramState.IDLE || state === ProgramState.PAUSED,
|
|
74
80
|
label:
|
|
75
|
-
state ===
|
|
81
|
+
state === ProgramState.PAUSED
|
|
76
82
|
? t("ProgramControl.Resume.bt")
|
|
77
83
|
: t("ProgramControl.Start.bt"),
|
|
78
84
|
color: theme.palette.success.main,
|
|
79
85
|
onClick: onRun,
|
|
80
86
|
},
|
|
81
87
|
pause: {
|
|
82
|
-
enabled: state ===
|
|
88
|
+
enabled: state === ProgramState.RUNNING,
|
|
83
89
|
label: t("ProgramControl.Pause.bt"),
|
|
84
90
|
color: "#FFFFFF33",
|
|
85
91
|
onClick: onPause || (() => {}),
|
|
86
92
|
},
|
|
87
93
|
stop: {
|
|
88
|
-
enabled:
|
|
94
|
+
enabled:
|
|
95
|
+
state === ProgramState.RUNNING || state === ProgramState.PAUSED,
|
|
89
96
|
label: t("ProgramControl.Stop.bt"),
|
|
90
97
|
color: theme.palette.error.main,
|
|
91
98
|
onClick: onStop,
|
|
@@ -157,7 +164,7 @@ export const ProgramControl = externalizeComponent(
|
|
|
157
164
|
variant="contained"
|
|
158
165
|
disabled={
|
|
159
166
|
!config.enabled ||
|
|
160
|
-
(state ===
|
|
167
|
+
(state === ProgramState.STOPPING && !requiresManualReset)
|
|
161
168
|
}
|
|
162
169
|
onClick={config.onClick}
|
|
163
170
|
sx={{
|
|
@@ -167,14 +174,17 @@ export const ProgramControl = externalizeComponent(
|
|
|
167
174
|
backgroundColor: config.color,
|
|
168
175
|
opacity:
|
|
169
176
|
config.enabled &&
|
|
170
|
-
!(state ===
|
|
177
|
+
!(state === ProgramState.STOPPING && !requiresManualReset)
|
|
171
178
|
? 1
|
|
172
179
|
: 0.3,
|
|
173
180
|
"&:hover": {
|
|
174
181
|
backgroundColor: config.color,
|
|
175
182
|
opacity:
|
|
176
183
|
config.enabled &&
|
|
177
|
-
!(
|
|
184
|
+
!(
|
|
185
|
+
state === ProgramState.STOPPING &&
|
|
186
|
+
!requiresManualReset
|
|
187
|
+
)
|
|
178
188
|
? 0.8
|
|
179
189
|
: 0.3,
|
|
180
190
|
},
|
|
@@ -194,13 +204,13 @@ export const ProgramControl = externalizeComponent(
|
|
|
194
204
|
sx={{
|
|
195
205
|
color:
|
|
196
206
|
config.enabled &&
|
|
197
|
-
!(state ===
|
|
207
|
+
!(state === ProgramState.STOPPING && !requiresManualReset)
|
|
198
208
|
? config.color
|
|
199
209
|
: theme.palette.text.disabled,
|
|
200
210
|
textAlign: "center",
|
|
201
211
|
opacity:
|
|
202
212
|
config.enabled &&
|
|
203
|
-
!(state ===
|
|
213
|
+
!(state === ProgramState.STOPPING && !requiresManualReset)
|
|
204
214
|
? 1
|
|
205
215
|
: 0.3,
|
|
206
216
|
}}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Chip, useTheme } from "@mui/material"
|
|
1
|
+
import { Chip, Typography, useTheme } from "@mui/material"
|
|
2
2
|
import type {
|
|
3
3
|
RobotControllerStateOperationModeEnum,
|
|
4
4
|
RobotControllerStateSafetyStateEnum,
|
|
@@ -6,7 +6,7 @@ import type {
|
|
|
6
6
|
import { observer } from "mobx-react-lite"
|
|
7
7
|
import { useTranslation } from "react-i18next"
|
|
8
8
|
import { externalizeComponent } from "../externalizeComponent"
|
|
9
|
-
import
|
|
9
|
+
import { ProgramState } from "./ProgramControl"
|
|
10
10
|
|
|
11
11
|
export interface ProgramStateIndicatorProps {
|
|
12
12
|
/** The current state of the program */
|
|
@@ -77,22 +77,22 @@ export const ProgramStateIndicator = externalizeComponent(
|
|
|
77
77
|
// For normal safety states, check program state
|
|
78
78
|
if (safetyState === "SAFETY_STATE_NORMAL") {
|
|
79
79
|
switch (programState) {
|
|
80
|
-
case
|
|
80
|
+
case ProgramState.RUNNING:
|
|
81
81
|
return {
|
|
82
82
|
label: t("ProgramStateIndicator.Running.lb"),
|
|
83
83
|
color: theme.palette.success.main,
|
|
84
84
|
}
|
|
85
|
-
case
|
|
85
|
+
case ProgramState.PAUSED:
|
|
86
86
|
return {
|
|
87
87
|
label: t("ProgramStateIndicator.Paused.lb"),
|
|
88
88
|
color: theme.palette.grey[600],
|
|
89
89
|
}
|
|
90
|
-
case
|
|
90
|
+
case ProgramState.STOPPING:
|
|
91
91
|
return {
|
|
92
92
|
label: t("ProgramStateIndicator.Stopped.lb"),
|
|
93
93
|
color: theme.palette.error.main,
|
|
94
94
|
}
|
|
95
|
-
case
|
|
95
|
+
case ProgramState.IDLE:
|
|
96
96
|
default:
|
|
97
97
|
return {
|
|
98
98
|
label: t("ProgramStateIndicator.Ready.lb"),
|
|
@@ -131,14 +131,26 @@ export const ProgramStateIndicator = externalizeComponent(
|
|
|
131
131
|
return (
|
|
132
132
|
<Chip
|
|
133
133
|
className={className}
|
|
134
|
-
label={
|
|
134
|
+
label={
|
|
135
|
+
<Typography
|
|
136
|
+
variant="body2"
|
|
137
|
+
sx={{
|
|
138
|
+
fontSize: "0.75rem", // Smaller than body2
|
|
139
|
+
lineHeight: 1.2,
|
|
140
|
+
}}
|
|
141
|
+
>
|
|
142
|
+
{fullLabel}
|
|
143
|
+
</Typography>
|
|
144
|
+
}
|
|
135
145
|
variant="filled"
|
|
136
146
|
sx={{
|
|
137
147
|
backgroundColor: color,
|
|
138
148
|
color: theme.palette.getContrastText(color),
|
|
139
149
|
fontWeight: 500,
|
|
150
|
+
height: "auto",
|
|
140
151
|
"& .MuiChip-label": {
|
|
141
|
-
paddingX:
|
|
152
|
+
paddingX: 1.5,
|
|
153
|
+
paddingY: 0.5,
|
|
142
154
|
},
|
|
143
155
|
}}
|
|
144
156
|
/>
|