@nualang/nualang-ui-components 0.1.1293 → 0.1.1295

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.
@@ -110,7 +110,10 @@ function Bot({
110
110
  xs: "column",
111
111
  sm: "row"
112
112
  },
113
- marginLeft: "60px"
113
+ marginLeft: {
114
+ sm: "0px",
115
+ md: "60px"
116
+ }
114
117
  },
115
118
  children: [/*#__PURE__*/_jsxs(Box, {
116
119
  display: "flex",
@@ -210,7 +210,6 @@ export default function AssignmentCard({
210
210
  })]
211
211
  }), /*#__PURE__*/_jsx(Grid, {
212
212
  size: {
213
- xs: 3,
214
213
  md: 2
215
214
  },
216
215
  children: isCreator && /*#__PURE__*/_jsxs(Box, {
@@ -127,7 +127,10 @@ function Course({
127
127
  })]
128
128
  }),
129
129
  sx: {
130
- marginLeft: 2
130
+ marginLeft: {
131
+ xs: 1,
132
+ md: 2
133
+ }
131
134
  }
132
135
  })]
133
136
  }), open ? /*#__PURE__*/_jsx(ExpandLessIcon, {
@@ -10,7 +10,7 @@ import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
10
10
  import ExpandLessIcon from "@mui/icons-material/ExpandLess";
11
11
  import RecordVoiceOverIcon from "@mui/icons-material/RecordVoiceOver";
12
12
  import ForumIcon from "@mui/icons-material/Forum";
13
- import FaceIcon from '@mui/icons-material/Face';
13
+ import FaceIcon from "@mui/icons-material/Face";
14
14
  import OndemandVideoIcon from "@mui/icons-material/OndemandVideo";
15
15
  import AssignmentRoleplaySelection from "../AssignmentRoleplaySelection/AssignmentRoleplaySelection";
16
16
  import { CardInfoSectionItem } from "../../Cards/CardElements";
@@ -22,7 +22,7 @@ import ColorLinearProgress from "../../Misc/ColorLinearProgress/ColorLinearProgr
22
22
  import { calcCompletions } from "../../utils";
23
23
  import AssignmentBotSelection from "../AssignmentBotSelection/AssignmentBotSelection";
24
24
  import { Clear } from "@mui/icons-material";
25
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
25
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
26
26
  function Exercise({
27
27
  name,
28
28
  description,
@@ -168,20 +168,26 @@ function Exercise({
168
168
  justifyContent: "space-between",
169
169
  disabled: isExerciseSelected || !isValidExercise || noRoleplays || noBots,
170
170
  sx: theme => ({
171
- [theme.breakpoints.up("sm")]: {
171
+ [theme.breakpoints.up("md")]: {
172
172
  ml: "60px"
173
173
  }
174
174
  }),
175
- children: [name.toLowerCase() === "listening" && /*#__PURE__*/_jsx(ListItemIcon, {
176
- children: /*#__PURE__*/_jsx(HearingIcon, {})
177
- }), name.toLowerCase() === "translation" && /*#__PURE__*/_jsx(ListItemIcon, {
178
- children: /*#__PURE__*/_jsx(SwapHorizIcon, {})
179
- }), name.toLowerCase() === "pronunciation" && /*#__PURE__*/_jsx(ListItemIcon, {
180
- children: /*#__PURE__*/_jsx(RecordVoiceOverIcon, {})
181
- }), name.toLowerCase() === "roleplays" && /*#__PURE__*/_jsx(ListItemIcon, {
182
- children: /*#__PURE__*/_jsx(ForumIcon, {})
183
- }), name.toLowerCase() === "bots" && /*#__PURE__*/_jsx(ListItemIcon, {
184
- children: /*#__PURE__*/_jsx(FaceIcon, {})
175
+ children: [/*#__PURE__*/_jsxs(Box, {
176
+ display: {
177
+ xs: "none",
178
+ sm: "flex"
179
+ },
180
+ children: [name.toLowerCase() === "listening" && /*#__PURE__*/_jsx(ListItemIcon, {
181
+ children: /*#__PURE__*/_jsx(HearingIcon, {})
182
+ }), name.toLowerCase() === "translation" && /*#__PURE__*/_jsx(ListItemIcon, {
183
+ children: /*#__PURE__*/_jsx(SwapHorizIcon, {})
184
+ }), name.toLowerCase() === "pronunciation" && /*#__PURE__*/_jsx(ListItemIcon, {
185
+ children: /*#__PURE__*/_jsx(RecordVoiceOverIcon, {})
186
+ }), name.toLowerCase() === "roleplays" && /*#__PURE__*/_jsx(ListItemIcon, {
187
+ children: /*#__PURE__*/_jsx(ForumIcon, {})
188
+ }), name.toLowerCase() === "bots" && /*#__PURE__*/_jsx(ListItemIcon, {
189
+ children: /*#__PURE__*/_jsx(FaceIcon, {})
190
+ })]
185
191
  }), /*#__PURE__*/_jsx(Box, {
186
192
  width: "100%",
187
193
  children: /*#__PURE__*/_jsx(ListItemText, {
@@ -190,12 +196,12 @@ function Exercise({
190
196
  })
191
197
  }), name.toLowerCase() === "roleplays" && /*#__PURE__*/_jsx(IconButton, {
192
198
  sx: {
193
- marginRight: "15px"
199
+ mr: useCase === "assignment-select" ? 2 : 0
194
200
  },
195
201
  children: roleplaysOpen ? /*#__PURE__*/_jsx(ExpandLessIcon, {}) : /*#__PURE__*/_jsx(ExpandMoreIcon, {})
196
202
  }), name.toLowerCase() === "bots" && /*#__PURE__*/_jsx(IconButton, {
197
203
  sx: {
198
- marginRight: "15px"
204
+ mr: useCase === "assignment-select" ? 2 : 0
199
205
  },
200
206
  children: botsOpen ? /*#__PURE__*/_jsx(ExpandLessIcon, {}) : /*#__PURE__*/_jsx(ExpandMoreIcon, {})
201
207
  }), (name.toLowerCase() === "listening" || name.toLowerCase() === "translation" || name.toLowerCase() === "pronunciation") && /*#__PURE__*/_jsxs(ListItemIcon, {
@@ -249,7 +255,10 @@ function Exercise({
249
255
  timeout: "auto",
250
256
  unmountOnExit: true,
251
257
  children: /*#__PURE__*/_jsx(Box, {
252
- ml: 7,
258
+ ml: {
259
+ sm: 0,
260
+ md: 7
261
+ },
253
262
  children: /*#__PURE__*/_jsx(AssignmentRoleplaySelection, {
254
263
  roleplays: roleplays,
255
264
  viewOnly: viewOnly,
@@ -273,7 +282,10 @@ function Exercise({
273
282
  timeout: "auto",
274
283
  unmountOnExit: true,
275
284
  children: /*#__PURE__*/_jsx(Box, {
276
- ml: 7,
285
+ ml: {
286
+ sm: 0,
287
+ md: 7
288
+ },
277
289
  children: /*#__PURE__*/_jsx(AssignmentBotSelection, {
278
290
  bots: bots,
279
291
  viewOnly: viewOnly,
@@ -188,11 +188,15 @@ function Roleplay({
188
188
  display: "flex",
189
189
  alignItems: "center",
190
190
  justifyContent: "space-between",
191
- flexDirection: {
192
- xs: "column",
193
- sm: "row"
191
+ flexDirection: "row",
192
+ marginLeft: {
193
+ sm: "0px",
194
+ md: "60px"
194
195
  },
195
- marginLeft: "60px"
196
+ gap: {
197
+ xs: 1,
198
+ sm: 2
199
+ }
196
200
  },
197
201
  children: [/*#__PURE__*/_jsxs(Box, {
198
202
  display: "flex",
@@ -202,25 +206,36 @@ function Roleplay({
202
206
  sm: "85%"
203
207
  },
204
208
  children: [/*#__PURE__*/_jsx(Avatar, {
205
- src: roleplay.picture
209
+ src: roleplay.picture,
210
+ sx: {
211
+ display: "flex",
212
+ width: 32,
213
+ height: 32
214
+ }
206
215
  }), /*#__PURE__*/_jsx(ListItemText, {
207
216
  primary: roleplay.roleplayName,
208
217
  secondary: roleplay.description,
209
218
  sx: {
210
- marginLeft: 2
219
+ ml: {
220
+ sm: 2,
221
+ xs: 1
222
+ }
211
223
  }
212
224
  })]
213
225
  }), roleplayHasInteractions && /*#__PURE__*/_jsxs(Box, {
214
- display: "flex",
226
+ display: {
227
+ xs: "none",
228
+ sm: "flex"
229
+ },
215
230
  alignItems: "center",
216
231
  children: [/*#__PURE__*/_jsx(ListItemText, {
217
232
  secondary: numberOfRoleplayInteractions,
218
233
  sx: {
219
- marginRight: 0.5
234
+ mr: 0.5
220
235
  }
221
236
  }), /*#__PURE__*/_jsx(ListItemIcon, {
222
237
  sx: {
223
- marginRight: {
238
+ mr: {
224
239
  xs: 0,
225
240
  sm: -3
226
241
  }
@@ -236,12 +251,15 @@ function Roleplay({
236
251
  })
237
252
  })]
238
253
  }), roleplayHasQuestions && /*#__PURE__*/_jsxs(Box, {
239
- display: "flex",
254
+ display: {
255
+ xs: "none",
256
+ sm: "flex"
257
+ },
240
258
  alignItems: "center",
241
259
  children: [/*#__PURE__*/_jsx(ListItemText, {
242
260
  secondary: numberOfRoleplayQuestions,
243
261
  sx: {
244
- marginRight: 0.5
262
+ mr: 0.5
245
263
  }
246
264
  }), /*#__PURE__*/_jsx(ListItemIcon, {
247
265
  children: /*#__PURE__*/_jsx(Tooltip, {
@@ -254,19 +272,25 @@ function Roleplay({
254
272
  })
255
273
  })
256
274
  })]
257
- }), /*#__PURE__*/_jsx(IconButton, {
258
- onClick: () => setOpen(!open),
259
- children: open ? /*#__PURE__*/_jsx(ExpandLessIcon, {
260
- sx: {
261
- color: "#757575"
262
- }
263
- }) : /*#__PURE__*/_jsx(ExpandMoreIcon, {
275
+ }), /*#__PURE__*/_jsxs(Box, {
276
+ display: "flex",
277
+ alignItems: "center",
278
+ gap: 1,
279
+ children: [/*#__PURE__*/_jsx(IconButton, {
280
+ onClick: () => setOpen(!open),
264
281
  sx: {
265
- color: "#757575"
266
- }
267
- })
268
- }), useCase === "assignment-view" && isPreview && /*#__PURE__*/_jsx(ListItemIcon, {
269
- children: /*#__PURE__*/_jsx(IconButton, {
282
+ ml: 2
283
+ },
284
+ children: open ? /*#__PURE__*/_jsx(ExpandLessIcon, {
285
+ sx: {
286
+ color: "#757575"
287
+ }
288
+ }) : /*#__PURE__*/_jsx(ExpandMoreIcon, {
289
+ sx: {
290
+ color: "#757575"
291
+ }
292
+ })
293
+ }), useCase === "assignment-view" && isPreview && /*#__PURE__*/_jsx(IconButton, {
270
294
  edge: "end",
271
295
  "aria-label": "remove-roleplay",
272
296
  onClick: e => {
@@ -277,20 +301,21 @@ function Roleplay({
277
301
  children: /*#__PURE__*/_jsx(ClearIcon, {
278
302
  fontSize: "small"
279
303
  })
280
- })
281
- }), useCase === "assignment-select" && /*#__PURE__*/_jsx(Tooltip, {
282
- title: t("select_all"),
283
- placement: "top",
284
- children: /*#__PURE__*/_jsx(ListItemIcon, {
304
+ }), useCase === "assignment-select" && /*#__PURE__*/_jsx(Tooltip, {
305
+ title: t("select_all"),
306
+ placement: "top",
285
307
  children: /*#__PURE__*/_jsx(Checkbox, {
286
308
  checked: isSelectAllChecked,
287
309
  indeterminate: indeterminate,
288
310
  onChange: handleSelectAll,
289
311
  onClick: event => {
290
312
  event.stopPropagation();
313
+ },
314
+ sx: {
315
+ mr: 2
291
316
  }
292
317
  })
293
- })
318
+ })]
294
319
  })]
295
320
  })
296
321
  })
@@ -299,7 +324,10 @@ function Roleplay({
299
324
  timeout: "auto",
300
325
  unmountOnExit: true,
301
326
  children: /*#__PURE__*/_jsxs(Box, {
302
- ml: 3.5,
327
+ ml: {
328
+ sm: 0,
329
+ md: 3.5
330
+ },
303
331
  children: [useCase === "assignment-select" && games.map((name, index) => /*#__PURE__*/_jsxs(ListItemButton, {
304
332
  onClick: () => handleSelectExercise([{
305
333
  roleplayId: roleplay.roleplayId,
@@ -310,13 +338,19 @@ function Roleplay({
310
338
  display: "flex",
311
339
  alignItems: "center",
312
340
  justifyContent: "space-between",
313
- flexDirection: {
314
- xs: "column",
315
- sm: "row"
316
- },
317
- marginLeft: "95px"
341
+ flexDirection: "row",
342
+ marginLeft: {
343
+ sm: "0px",
344
+ md: "95px"
345
+ }
318
346
  },
319
347
  children: [/*#__PURE__*/_jsx(ListItemIcon, {
348
+ sx: {
349
+ display: {
350
+ xs: "none",
351
+ sm: "flex"
352
+ }
353
+ },
320
354
  children: getIconAndStatusForGame(name)[0]
321
355
  }), /*#__PURE__*/_jsx(ListItemText, {
322
356
  primary: t(name.replace(/roleplay-/, "").replace(/-/g, "_")),
@@ -337,13 +371,19 @@ function Roleplay({
337
371
  display: "flex",
338
372
  alignItems: "center",
339
373
  justifyContent: "space-between",
340
- flexDirection: {
341
- xs: "column",
342
- sm: "row"
343
- },
344
- marginLeft: "95px"
374
+ flexDirection: "row",
375
+ marginLeft: {
376
+ sm: "0px",
377
+ md: "95px"
378
+ }
345
379
  },
346
380
  children: [/*#__PURE__*/_jsx(ListItemIcon, {
381
+ sx: {
382
+ display: {
383
+ xs: "none",
384
+ sm: "flex"
385
+ }
386
+ },
347
387
  children: getIconAndStatusForGame(name)[0]
348
388
  }), /*#__PURE__*/_jsx(ListItemText, {
349
389
  primary: t(name.replace(/roleplay-/, "").replace(/-/g, "_")),
@@ -49,7 +49,7 @@ export default function CreateAssignmentDialog({
49
49
  getCourses,
50
50
  initialData = {},
51
51
  dialogTitle,
52
- userEmail = '',
52
+ userEmail = "",
53
53
  assignedStudents
54
54
  }) {
55
55
  const {
@@ -298,17 +298,30 @@ export default function CreateAssignmentDialog({
298
298
  }), /*#__PURE__*/_jsxs(Box, {
299
299
  component: "main",
300
300
  className: classes.dialogContent,
301
+ sx: {
302
+ display: "flex",
303
+ flexDirection: {
304
+ xs: "column",
305
+ md: "row"
306
+ },
307
+ gap: 2,
308
+ width: "100%",
309
+ boxSizing: "border-box"
310
+ },
301
311
  children: [/*#__PURE__*/_jsx(Card, {
302
312
  sx: {
303
- display: "flex",
304
- flexDirection: "column",
313
+ flex: "unset",
314
+ minWidth: 0,
305
315
  padding: 1,
306
316
  boxShadow: 3,
307
- width: "50%"
317
+ width: {
318
+ xs: "100%",
319
+ md: "50%"
320
+ },
321
+ boxSizing: "border-box"
308
322
  },
309
323
  children: /*#__PURE__*/_jsxs(CardContent, {
310
324
  sx: {
311
- flexGrow: 1,
312
325
  display: "flex",
313
326
  flexDirection: "column",
314
327
  gap: 2
@@ -438,15 +451,18 @@ export default function CreateAssignmentDialog({
438
451
  })
439
452
  }), /*#__PURE__*/_jsx(Card, {
440
453
  sx: {
441
- display: "flex",
442
- flexDirection: "column",
454
+ flex: "unset",
455
+ minWidth: 0,
443
456
  padding: 1,
444
457
  boxShadow: 3,
445
- width: "50%"
458
+ width: {
459
+ xs: "100%",
460
+ md: "50%"
461
+ },
462
+ boxSizing: "border-box"
446
463
  },
447
464
  children: /*#__PURE__*/_jsxs(CardContent, {
448
465
  sx: {
449
- flexGrow: 1,
450
466
  display: "flex",
451
467
  flexDirection: "column",
452
468
  gap: 2
@@ -270,6 +270,7 @@ function ResponsiveTabs({
270
270
  localStorage.setItem(`creator-discuss-tour-completed`, "true");
271
271
  }
272
272
  };
273
+ const activeFabs = fabs.flat().filter(fab => fab.tabIndex === value);
273
274
  return /*#__PURE__*/_jsxs("div", {
274
275
  className: classes.root,
275
276
  children: [appbar ? /*#__PURE__*/_jsx(AppBar, {
@@ -286,15 +287,12 @@ function ResponsiveTabs({
286
287
  index: i,
287
288
  children: Child
288
289
  }, i) : null), /*#__PURE__*/_jsx(FabContainer, {
289
- children: fabs.map(btns => btns.map((fab, idx) => fab.link ? /*#__PURE__*/_jsx(Link, {
290
+ children: activeFabs.map(fab => fab.link ? /*#__PURE__*/_jsx(Link, {
290
291
  to: fab.link,
291
292
  id: fab.id,
292
293
  children: /*#__PURE__*/_jsx(Zoom, {
293
- in: value === fab.tabIndex,
294
+ in: true,
294
295
  timeout: transitionDuration,
295
- style: {
296
- transitionDelay: `${value === fab.tabIndex ? transitionDuration.exit : 0}ms`
297
- },
298
296
  unmountOnExit: true,
299
297
  children: /*#__PURE__*/_jsx(Tooltip, {
300
298
  title: fab.disabled ? t("no_members_tooltip") : fab.title,
@@ -308,12 +306,9 @@ function ResponsiveTabs({
308
306
  })
309
307
  })
310
308
  })
311
- }, idx) : /*#__PURE__*/_jsx(Zoom, {
312
- in: value === fab.tabIndex,
309
+ }, fab.id) : /*#__PURE__*/_jsx(Zoom, {
310
+ in: true,
313
311
  timeout: transitionDuration,
314
- style: {
315
- transitionDelay: `${value === fab.tabIndex ? transitionDuration.exit : 0}ms`
316
- },
317
312
  unmountOnExit: true,
318
313
  children: /*#__PURE__*/_jsx(Tooltip, {
319
314
  title: fab.disabled ? t("no_members_tooltip") : fab.title,
@@ -329,7 +324,7 @@ function ResponsiveTabs({
329
324
  })
330
325
  })
331
326
  })
332
- }, idx)))
327
+ }, fab.id))
333
328
  }), run && /*#__PURE__*/_jsx(Joyride, {
334
329
  callback: handleJoyrideCallback,
335
330
  continuous: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nualang/nualang-ui-components",
3
- "version": "0.1.1293",
3
+ "version": "0.1.1295",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "files": [
@@ -21,7 +21,7 @@
21
21
  "@hookform/resolvers": "^3.6.0",
22
22
  "@json2csv/plainjs": "^7.0.1",
23
23
  "@nualang/avatars": "2.0.3",
24
- "@nualang/nualang-api-and-queries": "^1.1.20",
24
+ "@nualang/nualang-api-and-queries": "^1.1.22",
25
25
  "@stripe/react-stripe-js": "^2.1.1",
26
26
  "@stripe/stripe-js": "^1.54.2",
27
27
  "ajv-keywords": "^3.5.2",