@wandelbots/wandelbots-js-react-components 2.49.0 → 2.50.0-pr.bugfix-remove-background-from-app-bar.394.be71b7f

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": "2.49.0",
3
+ "version": "2.50.0-pr.bugfix-remove-background-from-app-bar.394.be71b7f",
4
4
  "description": "React UI toolkit for building applications on top of the Wandelbots platform",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -37,6 +37,8 @@ export type AppHeaderProps = {
37
37
  apps?: AppItem[]
38
38
  /** Callback when an app is selected */
39
39
  onAppSelect?: (app: AppItem) => void
40
+ /** Disable the menu button */
41
+ disabled?: boolean
40
42
  /** Additional styling */
41
43
  sx?: SxProps
42
44
  }
@@ -47,7 +49,14 @@ export type AppHeaderProps = {
47
49
  */
48
50
  export const AppHeader = externalizeComponent(
49
51
  observer((props: AppHeaderProps) => {
50
- const { appIcon, appName, apps = [], onAppSelect, sx } = props
52
+ const {
53
+ appIcon,
54
+ appName,
55
+ apps = [],
56
+ onAppSelect,
57
+ disabled = false,
58
+ sx,
59
+ } = props
51
60
  const [anchorEl, setAnchorEl] = useState<HTMLElement | null>(null)
52
61
  const isMenuOpen = Boolean(anchorEl)
53
62
 
@@ -87,20 +96,17 @@ export const AppHeader = externalizeComponent(
87
96
  >
88
97
  <Toolbar sx={{ minHeight: "62px !important" }}>
89
98
  {/* App Icon */}
90
- <Box sx={{ mr: 2, display: "flex", alignItems: "center" }}>
99
+ <Box sx={{ mr: 1, display: "flex", alignItems: "center" }}>
91
100
  {appIcon}
92
101
  </Box>
93
102
 
94
103
  {/* App Name and Dropdown */}
95
104
  <Box sx={{ display: "flex", alignItems: "center", flexGrow: 1 }}>
96
105
  <Typography
97
- variant="h6"
98
- component="div"
106
+ component="h1"
99
107
  sx={{
100
- fontWeight: 700,
101
- fontSize: "20px",
102
- lineHeight: "24px",
103
- letterSpacing: 0,
108
+ fontWeight: "bold",
109
+ fontSize: "1rem",
104
110
  }}
105
111
  >
106
112
  {appName}
@@ -114,12 +120,13 @@ export const AppHeader = externalizeComponent(
114
120
  aria-controls="app-menu"
115
121
  aria-haspopup="true"
116
122
  onClick={handleMenuOpen}
123
+ disabled={disabled}
117
124
  sx={{
118
- ml: 2,
119
- width: 30,
120
- height: 30,
121
- borderRadius: "8px",
122
- padding: "5px",
125
+ ml: 1,
126
+ width: 28,
127
+ height: 28,
128
+ borderRadius: "6px",
129
+ padding: 0,
123
130
  backgroundColor: (theme) =>
124
131
  alpha(theme.palette.common.white, 0.1),
125
132
  opacity: 1,
@@ -128,9 +135,9 @@ export const AppHeader = externalizeComponent(
128
135
  alpha(theme.palette.common.white, 0.16),
129
136
  },
130
137
  "& .MuiSvgIcon-root": {
131
- fontSize: "10px",
132
- width: "10px",
133
- height: "8px",
138
+ fontSize: "8px",
139
+ width: "8px",
140
+ height: "6px",
134
141
  },
135
142
  }}
136
143
  >
@@ -175,21 +182,13 @@ export const AppHeader = externalizeComponent(
175
182
  }}
176
183
  >
177
184
  {apps.map((app) => (
178
- <MenuItem
179
- key={app.id}
180
- onClick={() => handleAppSelect(app)}
181
- sx={{
182
- display: "flex",
183
- alignItems: "center",
184
- gap: 2,
185
- py: 1.5,
186
- px: 2,
187
- }}
188
- >
185
+ <MenuItem key={app.id} onClick={() => handleAppSelect(app)}>
189
186
  <Box sx={{ display: "flex", alignItems: "center" }}>
190
187
  {app.icon}
191
188
  </Box>
192
- <Typography variant="body1">{app.name}</Typography>
189
+ <Typography variant="body1" sx={{ ml: 2 }}>
190
+ {app.name}
191
+ </Typography>
193
192
  </MenuItem>
194
193
  ))}
195
194
  </Menu>