@red-hat-developer-hub/backstage-plugin-intelligent-assistant 5.0.1 → 5.0.2

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.
Files changed (93) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/alpha.d.ts +1 -2
  3. package/dist/components/Attachment.esm.js +10 -12
  4. package/dist/components/Attachment.esm.js.map +1 -1
  5. package/dist/components/CollapsedHistoryStrip.esm.js +46 -51
  6. package/dist/components/CollapsedHistoryStrip.esm.js.map +1 -1
  7. package/dist/components/FilePreview.esm.js +3 -2
  8. package/dist/components/FilePreview.esm.js.map +1 -1
  9. package/dist/components/LightSpeedChat.esm.js +580 -745
  10. package/dist/components/LightSpeedChat.esm.js.map +1 -1
  11. package/dist/components/LightspeedChatBox.esm.js +2 -3
  12. package/dist/components/LightspeedChatBox.esm.js.map +1 -1
  13. package/dist/components/LightspeedChatBoxHeader.esm.js +38 -34
  14. package/dist/components/LightspeedChatBoxHeader.esm.js.map +1 -1
  15. package/dist/components/LightspeedChatContainer.esm.js +6 -8
  16. package/dist/components/LightspeedChatContainer.esm.js.map +1 -1
  17. package/dist/components/LightspeedChatModelsState.esm.js +67 -73
  18. package/dist/components/LightspeedChatModelsState.esm.js.map +1 -1
  19. package/dist/components/LightspeedDrawerContext.esm.js.map +1 -1
  20. package/dist/components/LightspeedDrawerProvider.esm.js +13 -16
  21. package/dist/components/LightspeedDrawerProvider.esm.js.map +1 -1
  22. package/dist/components/LightspeedFABContent.esm.js +40 -9
  23. package/dist/components/LightspeedFABContent.esm.js.map +1 -1
  24. package/dist/components/LightspeedPage.esm.js +1 -10
  25. package/dist/components/LightspeedPage.esm.js.map +1 -1
  26. package/dist/components/McpConfigureServerModal.esm.js +79 -86
  27. package/dist/components/McpConfigureServerModal.esm.js.map +1 -1
  28. package/dist/components/McpServersSettings.esm.js +246 -212
  29. package/dist/components/McpServersSettings.esm.js.map +1 -1
  30. package/dist/components/MessageBarModelSelector.esm.js +29 -33
  31. package/dist/components/MessageBarModelSelector.esm.js.map +1 -1
  32. package/dist/components/PermissionRequiredState.esm.js +63 -63
  33. package/dist/components/PermissionRequiredState.esm.js.map +1 -1
  34. package/dist/components/RenameConversationModal.esm.js +38 -31
  35. package/dist/components/RenameConversationModal.esm.js.map +1 -1
  36. package/dist/components/Router.esm.js +4 -13
  37. package/dist/components/Router.esm.js.map +1 -1
  38. package/dist/components/ToastAlertGroup.esm.js +24 -40
  39. package/dist/components/ToastAlertGroup.esm.js.map +1 -1
  40. package/dist/components/ToolCallContent.esm.js +8 -11
  41. package/dist/components/ToolCallContent.esm.js.map +1 -1
  42. package/dist/components/notebooks/AddDocumentModal.esm.js +232 -252
  43. package/dist/components/notebooks/AddDocumentModal.esm.js.map +1 -1
  44. package/dist/components/notebooks/DeleteDocumentModal.esm.js +35 -77
  45. package/dist/components/notebooks/DeleteDocumentModal.esm.js.map +1 -1
  46. package/dist/components/notebooks/DeleteNotebookModal.esm.js +46 -81
  47. package/dist/components/notebooks/DeleteNotebookModal.esm.js.map +1 -1
  48. package/dist/components/notebooks/DocumentSidebar.esm.js +172 -196
  49. package/dist/components/notebooks/DocumentSidebar.esm.js.map +1 -1
  50. package/dist/components/notebooks/FileListItem.esm.js +69 -57
  51. package/dist/components/notebooks/FileListItem.esm.js.map +1 -1
  52. package/dist/components/notebooks/FileTypeIcon.esm.js +17 -27
  53. package/dist/components/notebooks/FileTypeIcon.esm.js.map +1 -1
  54. package/dist/components/notebooks/NotebookCard.esm.js +86 -25
  55. package/dist/components/notebooks/NotebookCard.esm.js.map +1 -1
  56. package/dist/components/notebooks/NotebookView.esm.js +367 -380
  57. package/dist/components/notebooks/NotebookView.esm.js.map +1 -1
  58. package/dist/components/notebooks/NotebooksTab.esm.js +93 -30
  59. package/dist/components/notebooks/NotebooksTab.esm.js.map +1 -1
  60. package/dist/components/notebooks/OverwriteConfirmModal.esm.js +142 -184
  61. package/dist/components/notebooks/OverwriteConfirmModal.esm.js.map +1 -1
  62. package/dist/components/notebooks/UploadResourceScreen.esm.js +58 -50
  63. package/dist/components/notebooks/UploadResourceScreen.esm.js.map +1 -1
  64. package/dist/components/notebooks/notebookDialogStyles.esm.js +33 -37
  65. package/dist/components/notebooks/notebookDialogStyles.esm.js.map +1 -1
  66. package/dist/const.esm.js +15 -2
  67. package/dist/const.esm.js.map +1 -1
  68. package/dist/hooks/useAutoScroll.esm.js +11 -11
  69. package/dist/hooks/useAutoScroll.esm.js.map +1 -1
  70. package/dist/hooks/useBufferedMessages.esm.js +5 -5
  71. package/dist/hooks/useBufferedMessages.esm.js.map +1 -1
  72. package/dist/hooks/useIsMobile.esm.js +3 -3
  73. package/dist/hooks/useIsMobile.esm.js.map +1 -1
  74. package/dist/translations/de.esm.js +1 -2
  75. package/dist/translations/de.esm.js.map +1 -1
  76. package/dist/translations/es.esm.js +1 -2
  77. package/dist/translations/es.esm.js.map +1 -1
  78. package/dist/translations/fr.esm.js +1 -2
  79. package/dist/translations/fr.esm.js.map +1 -1
  80. package/dist/translations/it.esm.js +1 -2
  81. package/dist/translations/it.esm.js.map +1 -1
  82. package/dist/translations/ja.esm.js +1 -2
  83. package/dist/translations/ja.esm.js.map +1 -1
  84. package/dist/translations/ref.esm.js +1 -2
  85. package/dist/translations/ref.esm.js.map +1 -1
  86. package/dist/types.esm.js.map +1 -1
  87. package/dist/utils/fab-anchor-utils.esm.js +41 -0
  88. package/dist/utils/fab-anchor-utils.esm.js.map +1 -0
  89. package/dist/utils/scoped-dialog-utils.esm.js +6 -3
  90. package/dist/utils/scoped-dialog-utils.esm.js.map +1 -1
  91. package/package.json +4 -8
  92. package/dist/utils/generateClassName.esm.js +0 -12
  93. package/dist/utils/generateClassName.esm.js.map +0 -1
@@ -1,6 +1,5 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import { useState, useEffect, useContext } from 'react';
3
- import { makeStyles } from '@material-ui/core/styles';
4
3
  import CloseIcon from '@mui/icons-material/Close';
5
4
  import Box from '@mui/material/Box';
6
5
  import Button from '@mui/material/Button';
@@ -9,6 +8,7 @@ import DialogActions from '@mui/material/DialogActions';
9
8
  import DialogContent from '@mui/material/DialogContent';
10
9
  import DialogTitle from '@mui/material/DialogTitle';
11
10
  import IconButton from '@mui/material/IconButton';
11
+ import { styled } from '@mui/material/styles';
12
12
  import Typography from '@mui/material/Typography';
13
13
  import { Alert, MultipleFileUpload, MultipleFileUploadMain, Tooltip, MultipleFileUploadContext } from '@patternfly/react-core';
14
14
  import { UploadIcon } from '@patternfly/react-icons';
@@ -19,136 +19,90 @@ import { runFileUploads } from '../../utils/notebook-upload-runner.esm.js';
19
19
  import { getNotebookAcceptedFileTypes, validateFiles } from '../../utils/notebook-upload-utils.esm.js';
20
20
  import { getScopedDialogProps } from '../../utils/scoped-dialog-utils.esm.js';
21
21
  import { FileListItem } from './FileListItem.esm.js';
22
- import { notebookDialogStyles } from './notebookDialogStyles.esm.js';
22
+ import { notebookDialogTitleTextSx, notebookDialogCloseButtonSx, notebookDialogTitleSx, notebookDialogContentSx, notebookDialogActionsSx, notebookDialogPaperSx, optionalStyle } from './notebookDialogStyles.esm.js';
23
23
 
24
24
  const UNIQUE_FILE_TYPE_LABELS = [
25
25
  ...new Set(Object.values(NOTEBOOK_EXTENSION_TO_FILE_TYPE))
26
26
  ].map((t) => t.toUpperCase());
27
- const useStyles = makeStyles((theme) => ({
28
- ...notebookDialogStyles(theme),
29
- titleTextCompact: {
30
- fontWeight: 600,
31
- fontSize: "1.125rem",
32
- lineHeight: "1.5rem",
33
- letterSpacing: "-0.25px"
34
- },
35
- errorAlert: {
36
- marginBottom: theme.spacing(2),
37
- "--pf-v6-c-alert--PaddingBlockEnd": "0",
38
- "& .pf-v6-c-alert__title": {
39
- marginBlockStart: 0
27
+ const ErrorAlert = styled(Alert)(({ theme }) => ({
28
+ marginBottom: theme.spacing(2),
29
+ "--pf-v6-c-alert--PaddingBlockEnd": "0",
30
+ "& .pf-v6-c-alert__title": {
31
+ marginBlockStart: 0
32
+ }
33
+ }));
34
+ const Dropzone = styled("div", {
35
+ shouldForwardProp: (prop) => prop !== "isDropzoneDisabled"
36
+ })(({ theme, isDropzoneDisabled }) => ({
37
+ borderColor: "var(--pf-t--global--border--color--brand--default)",
38
+ borderWidth: 2,
39
+ borderStyle: "dashed",
40
+ borderRadius: theme.spacing(1),
41
+ transition: "background-color 0.2s ease",
42
+ cursor: isDropzoneDisabled ? "default" : "pointer",
43
+ ...isDropzoneDisabled ? {
44
+ opacity: 0.5,
45
+ pointerEvents: "none",
46
+ "&:hover": {
47
+ backgroundColor: "transparent"
40
48
  }
41
- },
42
- dropzone: {
43
- borderColor: "var(--pf-t--global--border--color--brand--default)",
44
- borderWidth: 2,
45
- borderStyle: "dashed",
46
- borderRadius: theme.spacing(1),
47
- padding: theme.spacing(2),
48
- transition: "background-color 0.2s ease",
49
- cursor: "pointer",
49
+ } : {
50
50
  "&:hover": {
51
51
  backgroundColor: "color-mix(in srgb, var(--pf-t--global--color--brand--default) 10%, transparent)"
52
- },
53
- "& .pf-v6-c-multiple-file-upload__main": {
54
- border: "none",
55
- paddingBottom: 0
56
- },
57
- "& .pf-v6-c-multiple-file-upload__title-icon": {
58
- fontSize: "2rem"
59
52
  }
60
53
  },
61
- fileListContainer: {
62
- marginTop: theme.spacing(2),
63
- maxHeight: 200,
64
- overflowY: "auto"
65
- },
66
- fileListHeader: {
67
- display: "flex",
68
- alignItems: "center",
69
- justifyContent: "space-between",
70
- marginBottom: theme.spacing(1)
71
- },
72
- fileCount: {
73
- fontSize: "0.875rem",
74
- color: theme.palette.text.secondary
75
- },
76
- dialogActions: {
77
- padding: "16px 24px",
78
- justifyContent: "flex-start",
79
- gap: theme.spacing(1)
80
- },
81
- dialogActionsCompact: {
82
- padding: "12px 16px !important",
83
- justifyContent: "flex-start",
84
- gap: theme.spacing(1)
85
- },
86
- addButton: {
87
- textTransform: "none"
88
- },
89
- cancelButton: {
90
- textTransform: "none"
91
- },
92
- uploadIcon: {
93
- color: "var(--pf-t--global--icon--color--brand--default)"
54
+ "& .pf-v6-c-multiple-file-upload__main": {
55
+ border: "none",
56
+ paddingBottom: 0
94
57
  },
95
- supportedFormatsLabel: {
96
- fontSize: "0.875rem",
97
- color: theme.palette.text.secondary,
98
- textAlign: "center",
99
- marginTop: theme.spacing(1)
100
- },
101
- chipContainer: {
102
- display: "flex",
103
- flexWrap: "wrap",
104
- gap: theme.spacing(0.75),
105
- justifyContent: "center",
106
- marginTop: theme.spacing(0.5)
107
- },
108
- fileTypeChip: {
109
- display: "inline-block",
110
- padding: "2px 10px",
111
- borderRadius: 12,
112
- fontSize: "0.75rem",
113
- fontWeight: 500,
114
- backgroundColor: theme.palette.type === "dark" ? "rgba(255, 255, 255, 0.1)" : "rgba(0, 0, 0, 0.08)",
115
- color: theme.palette.text.secondary
116
- },
117
- maxFileSizeText: {
118
- fontSize: "0.875rem",
119
- color: theme.palette.text.secondary,
120
- textAlign: "center",
121
- marginTop: theme.spacing(1)
122
- },
123
- dropzoneDisabled: {
124
- opacity: 0.5,
125
- pointerEvents: "none",
126
- cursor: "default",
127
- "&:hover": {
128
- backgroundColor: "transparent"
129
- }
58
+ "& .pf-v6-c-multiple-file-upload__title-icon": {
59
+ fontSize: "2rem"
60
+ }
61
+ }));
62
+ const DropzoneClickAreaRoot = styled("div")(({ theme }) => ({
63
+ display: "block",
64
+ padding: theme.spacing(2),
65
+ cursor: "pointer",
66
+ '&[aria-disabled="true"]': {
67
+ cursor: "default"
130
68
  }
131
69
  }));
70
+ const StyledUploadIcon = styled(UploadIcon)({
71
+ color: "var(--pf-t--global--icon--color--brand--default)"
72
+ });
73
+ const FileTypeChip = styled("span")(({ theme }) => ({
74
+ display: "inline-block",
75
+ padding: "2px 10px",
76
+ borderRadius: 12,
77
+ fontSize: "0.75rem",
78
+ fontWeight: 500,
79
+ backgroundColor: theme.palette.mode === "dark" ? "rgba(255, 255, 255, 0.1)" : "rgba(0, 0, 0, 0.08)",
80
+ color: theme.palette.text.secondary
81
+ }));
132
82
  const DropzoneClickArea = ({
133
83
  children,
134
84
  isDisabled,
135
85
  ariaLabel
136
86
  }) => {
137
87
  const { open } = useContext(MultipleFileUploadContext);
88
+ const openFilePicker = (event) => {
89
+ event.stopPropagation();
90
+ open();
91
+ };
138
92
  return /* @__PURE__ */ jsx(
139
- "div",
93
+ DropzoneClickAreaRoot,
140
94
  {
141
95
  role: "button",
142
96
  "aria-label": ariaLabel,
97
+ "aria-disabled": isDisabled,
143
98
  tabIndex: isDisabled ? -1 : 0,
144
- onClick: isDisabled ? void 0 : open,
99
+ onClick: isDisabled ? void 0 : openFilePicker,
145
100
  onKeyDown: isDisabled ? void 0 : (e) => {
146
101
  if (e.key === "Enter" || e.key === " ") {
147
102
  e.preventDefault();
148
- open();
103
+ openFilePicker(e);
149
104
  }
150
105
  },
151
- style: { cursor: isDisabled ? "default" : "pointer" },
152
106
  children
153
107
  }
154
108
  );
@@ -167,7 +121,6 @@ const AddDocumentModal = ({
167
121
  onFilesAdded,
168
122
  isCompact = false
169
123
  }) => {
170
- const classes = useStyles();
171
124
  const { t } = useTranslation();
172
125
  const uploadMutation = useUploadDocument();
173
126
  const [validationErrors, setValidationErrors] = useState([]);
@@ -243,161 +196,188 @@ const AddDocumentModal = ({
243
196
  "aria-labelledby": "add-document-modal-title",
244
197
  ...scopedProps,
245
198
  PaperProps: {
246
- className: isCompact ? classes.dialogPaperCompact : classes.dialogPaper,
247
- ...scopedProps.PaperProps
199
+ ...scopedProps.PaperProps,
200
+ sx: [
201
+ notebookDialogPaperSx(isCompact),
202
+ optionalStyle(scopedProps.PaperProps?.sx)
203
+ ]
248
204
  },
249
205
  children: [
250
- /* @__PURE__ */ jsxs(
251
- DialogTitle,
252
- {
253
- className: isCompact ? classes.dialogTitleCompact : classes.dialogTitle,
254
- children: [
255
- /* @__PURE__ */ jsxs(
256
- Typography,
257
- {
258
- component: "h2",
259
- className: isCompact ? classes.titleTextCompact : classes.titleText,
260
- children: [
261
- t("notebook.upload.modal.title"),
262
- selectedFiles.length > 0 && ` (${selectedFiles.length}/${NOTEBOOK_MAX_FILES - existingDocumentNames.length})`
263
- ]
264
- }
265
- ),
266
- /* @__PURE__ */ jsx(
267
- IconButton,
268
- {
269
- "aria-label": t("common.close"),
270
- onClick: handleClose,
271
- className: classes.closeButton,
272
- size: "small",
273
- children: /* @__PURE__ */ jsx(CloseIcon, {})
274
- }
275
- )
276
- ]
277
- }
278
- ),
279
- /* @__PURE__ */ jsxs(
280
- DialogContent,
281
- {
282
- className: isCompact ? classes.dialogContentCompact : classes.dialogContent,
283
- children: [
284
- validationErrors.length > 0 && /* @__PURE__ */ jsx(
285
- Alert,
286
- {
287
- variant: "danger",
288
- isInline: true,
289
- className: classes.errorAlert,
290
- title: validationErrors.map((errorKey) => {
291
- const message = t(errorKey);
292
- return errorKey === "notebook.upload.error.tooManyFiles" ? message.replace("{{max}}", String(NOTEBOOK_MAX_FILES)) : message;
293
- }).join("\n")
294
- }
295
- ),
296
- hasUploadsInProgress && /* @__PURE__ */ jsx(
297
- Alert,
298
- {
299
- variant: "info",
300
- isInline: true,
301
- className: classes.errorAlert,
302
- title: t("notebook.view.documents.uploadsInProgress")
303
- }
304
- ),
305
- (() => {
306
- const isDropzoneDisabled = remainingSlots <= 0;
307
- const dropzoneContent = /* @__PURE__ */ jsx(
308
- MultipleFileUpload,
206
+ /* @__PURE__ */ jsxs(DialogTitle, { sx: notebookDialogTitleSx(isCompact), children: [
207
+ /* @__PURE__ */ jsxs(Typography, { component: "h2", sx: notebookDialogTitleTextSx(isCompact), children: [
208
+ t("notebook.upload.modal.title"),
209
+ selectedFiles.length > 0 && ` (${selectedFiles.length}/${NOTEBOOK_MAX_FILES - existingDocumentNames.length})`
210
+ ] }),
211
+ /* @__PURE__ */ jsx(
212
+ IconButton,
213
+ {
214
+ "aria-label": t("common.close"),
215
+ onClick: handleClose,
216
+ sx: notebookDialogCloseButtonSx,
217
+ size: "small",
218
+ children: /* @__PURE__ */ jsx(CloseIcon, {})
219
+ }
220
+ )
221
+ ] }),
222
+ /* @__PURE__ */ jsxs(DialogContent, { sx: notebookDialogContentSx(isCompact), children: [
223
+ validationErrors.length > 0 && /* @__PURE__ */ jsx(
224
+ ErrorAlert,
225
+ {
226
+ variant: "danger",
227
+ isInline: true,
228
+ title: validationErrors.map((errorKey) => {
229
+ const message = t(errorKey);
230
+ return errorKey === "notebook.upload.error.tooManyFiles" ? message.replace("{{max}}", String(NOTEBOOK_MAX_FILES)) : message;
231
+ }).join("\n")
232
+ }
233
+ ),
234
+ hasUploadsInProgress && /* @__PURE__ */ jsx(
235
+ ErrorAlert,
236
+ {
237
+ variant: "info",
238
+ isInline: true,
239
+ title: t("notebook.view.documents.uploadsInProgress")
240
+ }
241
+ ),
242
+ (() => {
243
+ const isDropzoneDisabled = remainingSlots <= 0;
244
+ const dropzoneContent = /* @__PURE__ */ jsx(Dropzone, { isDropzoneDisabled, children: /* @__PURE__ */ jsx(
245
+ MultipleFileUpload,
246
+ {
247
+ dropzoneProps: {
248
+ accept: getNotebookAcceptedFileTypes(),
249
+ onDropRejected: handleDropRejected,
250
+ disabled: isDropzoneDisabled,
251
+ noClick: true
252
+ },
253
+ onFileDrop: handleFileDrop,
254
+ children: /* @__PURE__ */ jsxs(
255
+ DropzoneClickArea,
309
256
  {
310
- className: `${classes.dropzone} ${isDropzoneDisabled ? classes.dropzoneDisabled : ""}`,
311
- dropzoneProps: {
312
- accept: getNotebookAcceptedFileTypes(),
313
- onDropRejected: handleDropRejected,
314
- disabled: isDropzoneDisabled
315
- },
316
- onFileDrop: handleFileDrop,
317
- children: /* @__PURE__ */ jsxs(
318
- DropzoneClickArea,
319
- {
320
- isDisabled: isDropzoneDisabled,
321
- ariaLabel: t("notebook.upload.modal.dragDropTitle"),
322
- children: [
323
- /* @__PURE__ */ jsx(
324
- MultipleFileUploadMain,
325
- {
326
- titleIcon: /* @__PURE__ */ jsx(UploadIcon, { className: classes.uploadIcon }),
327
- titleText: t("notebook.upload.modal.dragDropTitle"),
328
- isUploadButtonHidden: true
329
- }
330
- ),
331
- /* @__PURE__ */ jsx(Typography, { className: classes.supportedFormatsLabel, children: t("notebook.upload.modal.supportedFormats") }),
332
- /* @__PURE__ */ jsx("div", { className: classes.chipContainer, children: UNIQUE_FILE_TYPE_LABELS.map((label) => /* @__PURE__ */ jsx("span", { className: classes.fileTypeChip, children: label }, label)) }),
333
- /* @__PURE__ */ jsx(Typography, { className: classes.maxFileSizeText, children: t("notebook.upload.modal.maxFileSize") })
334
- ]
335
- }
336
- )
257
+ isDisabled: isDropzoneDisabled,
258
+ ariaLabel: t("notebook.upload.modal.dragDropTitle"),
259
+ children: [
260
+ /* @__PURE__ */ jsx(
261
+ MultipleFileUploadMain,
262
+ {
263
+ titleIcon: /* @__PURE__ */ jsx(StyledUploadIcon, {}),
264
+ titleText: t("notebook.upload.modal.dragDropTitle"),
265
+ isUploadButtonHidden: true
266
+ }
267
+ ),
268
+ /* @__PURE__ */ jsx(
269
+ Typography,
270
+ {
271
+ sx: {
272
+ fontSize: "0.875rem",
273
+ color: "text.secondary",
274
+ textAlign: "center",
275
+ mt: 1
276
+ },
277
+ children: t("notebook.upload.modal.supportedFormats")
278
+ }
279
+ ),
280
+ /* @__PURE__ */ jsx(
281
+ Box,
282
+ {
283
+ sx: {
284
+ display: "flex",
285
+ flexWrap: "wrap",
286
+ gap: 0.75,
287
+ justifyContent: "center",
288
+ mt: 0.5
289
+ },
290
+ children: UNIQUE_FILE_TYPE_LABELS.map((label) => /* @__PURE__ */ jsx(FileTypeChip, { children: label }, label))
291
+ }
292
+ ),
293
+ /* @__PURE__ */ jsx(
294
+ Typography,
295
+ {
296
+ sx: {
297
+ fontSize: "0.875rem",
298
+ color: "text.secondary",
299
+ textAlign: "center",
300
+ mt: 1
301
+ },
302
+ children: t("notebook.upload.modal.maxFileSize")
303
+ }
304
+ )
305
+ ]
337
306
  }
338
- );
339
- return isDropzoneDisabled ? /* @__PURE__ */ jsx(
340
- Tooltip,
307
+ )
308
+ }
309
+ ) });
310
+ return isDropzoneDisabled ? /* @__PURE__ */ jsx(
311
+ Tooltip,
312
+ {
313
+ content: t("notebook.view.documents.maxReached"),
314
+ position: "top",
315
+ children: /* @__PURE__ */ jsx("div", { children: dropzoneContent })
316
+ }
317
+ ) : dropzoneContent;
318
+ })(),
319
+ selectedFiles.length > 0 && /* @__PURE__ */ jsxs(Box, { sx: { mt: 2, maxHeight: 200, overflowY: "auto" }, children: [
320
+ /* @__PURE__ */ jsx(
321
+ Box,
322
+ {
323
+ sx: {
324
+ display: "flex",
325
+ alignItems: "center",
326
+ justifyContent: "space-between",
327
+ mb: 1
328
+ },
329
+ children: /* @__PURE__ */ jsx(
330
+ Typography,
341
331
  {
342
- content: t("notebook.view.documents.maxReached"),
343
- position: "top",
344
- children: /* @__PURE__ */ jsx("div", { children: dropzoneContent })
332
+ sx: { fontSize: "0.875rem", color: "text.secondary" },
333
+ children: t("notebook.upload.modal.selectedFiles", {
334
+ count: selectedFiles.length,
335
+ max: NOTEBOOK_MAX_FILES - existingDocumentNames.length
336
+ })
345
337
  }
346
- ) : dropzoneContent;
347
- })(),
348
- selectedFiles.length > 0 && /* @__PURE__ */ jsxs(Box, { className: classes.fileListContainer, children: [
349
- /* @__PURE__ */ jsx(Box, { className: classes.fileListHeader, children: /* @__PURE__ */ jsx(Typography, { className: classes.fileCount, children: t("notebook.upload.modal.selectedFiles", {
350
- count: selectedFiles.length,
351
- max: NOTEBOOK_MAX_FILES - existingDocumentNames.length
352
- }) }) }),
353
- selectedFiles.map((file, index) => /* @__PURE__ */ jsx(
354
- FileListItem,
338
+ )
339
+ }
340
+ ),
341
+ selectedFiles.map((file, index) => /* @__PURE__ */ jsx(
342
+ FileListItem,
343
+ {
344
+ file,
345
+ onRemove: () => handleRemoveFile(index),
346
+ removeAriaLabel: t(
347
+ "notebook.upload.modal.removeFile",
355
348
  {
356
- file,
357
- onRemove: () => handleRemoveFile(index),
358
- removeAriaLabel: t(
359
- "notebook.upload.modal.removeFile",
360
- {
361
- fileName: file.name
362
- }
363
- )
364
- },
365
- `${file.name}-${index}`
366
- ))
367
- ] })
368
- ]
369
- }
370
- ),
371
- /* @__PURE__ */ jsxs(
372
- DialogActions,
373
- {
374
- className: isCompact ? classes.dialogActionsCompact : classes.dialogActions,
375
- children: [
376
- /* @__PURE__ */ jsx(
377
- Button,
378
- {
379
- onClick: handleAddFiles,
380
- className: classes.addButton,
381
- variant: "contained",
382
- color: "primary",
383
- disabled: selectedFiles.length === 0 || hasUploadsInProgress,
384
- children: selectedFiles.length > 0 ? t("notebook.upload.modal.addButton", {
385
- count: selectedFiles.length
386
- }) : t("notebook.upload.modal.addButtonEmpty")
387
- }
388
- ),
389
- /* @__PURE__ */ jsx(
390
- Button,
391
- {
392
- onClick: handleClose,
393
- className: classes.cancelButton,
394
- color: "inherit",
395
- children: t("common.cancel")
396
- }
397
- )
398
- ]
399
- }
400
- )
349
+ fileName: file.name
350
+ }
351
+ )
352
+ },
353
+ `${file.name}-${index}`
354
+ ))
355
+ ] })
356
+ ] }),
357
+ /* @__PURE__ */ jsxs(DialogActions, { sx: notebookDialogActionsSx(isCompact), children: [
358
+ /* @__PURE__ */ jsx(
359
+ Button,
360
+ {
361
+ onClick: handleAddFiles,
362
+ sx: { textTransform: "none" },
363
+ variant: "contained",
364
+ color: "primary",
365
+ disabled: selectedFiles.length === 0 || hasUploadsInProgress,
366
+ children: selectedFiles.length > 0 ? t("notebook.upload.modal.addButton", {
367
+ count: selectedFiles.length
368
+ }) : t("notebook.upload.modal.addButtonEmpty")
369
+ }
370
+ ),
371
+ /* @__PURE__ */ jsx(
372
+ Button,
373
+ {
374
+ onClick: handleClose,
375
+ sx: { textTransform: "none" },
376
+ color: "inherit",
377
+ children: t("common.cancel")
378
+ }
379
+ )
380
+ ] })
401
381
  ]
402
382
  }
403
383
  );