@wandelbots/wandelbots-js-react-components 1.10.4 → 1.11.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wandelbots/wandelbots-js-react-components",
3
- "version": "1.10.4",
3
+ "version": "1.11.0",
4
4
  "description": "React UI toolkit for building applications on top of the Wandelbots platform",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -0,0 +1,86 @@
1
+ import {
2
+ Button,
3
+ Dialog,
4
+ DialogActions,
5
+ DialogContent,
6
+ DialogTitle,
7
+ Stack,
8
+ Typography,
9
+ } from "@mui/material"
10
+ import { observer } from "mobx-react-lite"
11
+
12
+ function getBaseUrl(): string {
13
+ const currentUrl = window.location.href
14
+ return currentUrl.substring(
15
+ 0,
16
+ currentUrl.indexOf("/", currentUrl.indexOf("//") + 2),
17
+ )
18
+ }
19
+
20
+ export const NoMotionGroupModal = observer((baseUrl: string = getBaseUrl()) => {
21
+ return (
22
+ <Dialog
23
+ aria-labelledby="no-motion-group-modal-title"
24
+ open={true}
25
+ fullWidth
26
+ sx={{
27
+ "& .MuiModal-backdrop": {
28
+ backdropFilter: "blur(10px)",
29
+ },
30
+ "& .MuiDialog-paper": {
31
+ "::before": {
32
+ content: '""',
33
+ height: "8px",
34
+ width: "100%",
35
+ background: "linear-gradient(90deg, #FF0E65 0%, #47D3FF 100%)",
36
+ },
37
+ background: "#101629",
38
+ },
39
+ }}
40
+ >
41
+ <DialogTitle id="no-motion-group-modal-title">
42
+ No motion group found
43
+ </DialogTitle>
44
+
45
+ <DialogContent
46
+ sx={{
47
+ marginTop: "3rem",
48
+ marginBottom: "1.5rem",
49
+ textAlign: "center",
50
+ }}
51
+ >
52
+ <Typography color="#fff">Found no devices to connect to.</Typography>
53
+ <Typography color="#fff">
54
+ Please ensure a motion group has been created.
55
+ </Typography>
56
+ </DialogContent>
57
+
58
+ <DialogActions>
59
+ <Stack width="100%" maxWidth="300px" margin="auto" marginBottom="2rem">
60
+ <Button
61
+ href={`${baseUrl}/settings`}
62
+ variant="contained"
63
+ sx={{
64
+ borderRadius: "8px",
65
+ width: "100%",
66
+ }}
67
+ >
68
+ Go to settings app
69
+ </Button>
70
+ <Button
71
+ href={`${baseUrl}`}
72
+ variant="text"
73
+ sx={{
74
+ marginTop: "1rem",
75
+ color: "#fff",
76
+ textDecoration: "underline",
77
+ fontSize: "0.75rem",
78
+ }}
79
+ >
80
+ Back to Homescreen
81
+ </Button>
82
+ </Stack>
83
+ </DialogActions>
84
+ </Dialog>
85
+ )
86
+ })
package/src/index.ts CHANGED
@@ -37,5 +37,9 @@ export type * from "./components/VelocitySlider"
37
37
  import { VelocitySlider as VS } from "./components/VelocitySlider"
38
38
  export const VelocitySlider = externalizeComponent(VS)
39
39
 
40
+ export type * from "./components/modal/NoMotionGroupModal"
41
+ import { NoMotionGroupModal as NMGM } from "./components/modal/NoMotionGroupModal"
42
+ export const NoMotionGroupModal = externalizeComponent(NMGM)
43
+
40
44
  export * from "./components/utils/hooks"
41
45
  export * from "./components/robots/AxisConfig"