@tumaet/prompt-ui-components 1.0.10 → 1.1.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.
Files changed (144) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +106 -0
  3. package/dist/components/DynamicIcon.js +34 -0
  4. package/dist/components/DynamicIcon.js.map +1 -0
  5. package/dist/components/ExportedApplicationAnswerTable.js +15 -0
  6. package/dist/components/ExportedApplicationAnswerTable.js.map +1 -0
  7. package/dist/components/FileList.js +43 -0
  8. package/dist/components/FileList.js.map +1 -0
  9. package/dist/components/FileUpload.js +76 -0
  10. package/dist/components/FileUpload.js.map +1 -0
  11. package/dist/components/FilterBadge.js +7 -0
  12. package/dist/components/FilterBadge.js.map +1 -0
  13. package/dist/components/MissingConfig.js +10 -0
  14. package/dist/components/MissingConfig.js.map +1 -0
  15. package/dist/components/MissingSettings.js +8 -0
  16. package/dist/components/MissingSettings.js.map +1 -0
  17. package/dist/components/ScoreLevelSelector.js +2 -5
  18. package/dist/components/ScoreLevelSelector.js.map +1 -1
  19. package/dist/components/SettingsCard.js +7 -0
  20. package/dist/components/SettingsCard.js.map +1 -0
  21. package/dist/components/StudentAvatar.js +11 -0
  22. package/dist/components/StudentAvatar.js.map +1 -0
  23. package/dist/components/StudentProfile.js +12 -0
  24. package/dist/components/StudentProfile.js.map +1 -0
  25. package/dist/components/StudentProfilePicture.js +13 -0
  26. package/dist/components/StudentProfilePicture.js.map +1 -0
  27. package/dist/components/ThemeToggle.js +9 -0
  28. package/dist/components/ThemeToggle.js.map +1 -0
  29. package/dist/components/index.js +26 -0
  30. package/dist/components/index.js.map +1 -1
  31. package/dist/components/minimal-tiptap/components/bubble-menu/link-bubble-menu.js +3 -3
  32. package/dist/components/minimal-tiptap/components/bubble-menu/link-bubble-menu.js.map +1 -1
  33. package/dist/components/minimal-tiptap/extensions/code-block-lowlight/code-block-lowlight.js +8 -1
  34. package/dist/components/minimal-tiptap/extensions/code-block-lowlight/code-block-lowlight.js.map +1 -1
  35. package/dist/components/minimal-tiptap/extensions/image/image.js +7 -2
  36. package/dist/components/minimal-tiptap/extensions/image/image.js.map +1 -1
  37. package/dist/components/minimal-tiptap/extensions/link/link.js +12 -1
  38. package/dist/components/minimal-tiptap/extensions/link/link.js.map +1 -1
  39. package/dist/components/minimal-tiptap/extensions/selection/selection.js.map +1 -1
  40. package/dist/components/pages/CoursePhaseParticipationsTable/CoursePhaseParticipationsTable.js +17 -0
  41. package/dist/components/pages/CoursePhaseParticipationsTable/CoursePhaseParticipationsTable.js.map +1 -0
  42. package/dist/components/pages/CoursePhaseParticipationsTable/table/participationActions.js +46 -0
  43. package/dist/components/pages/CoursePhaseParticipationsTable/table/participationActions.js.map +1 -0
  44. package/dist/components/pages/CoursePhaseParticipationsTable/table/participationColumns.js +37 -0
  45. package/dist/components/pages/CoursePhaseParticipationsTable/table/participationColumns.js.map +1 -0
  46. package/dist/components/pages/CoursePhaseParticipationsTable/table/participationFilters.js +22 -0
  47. package/dist/components/pages/CoursePhaseParticipationsTable/table/participationFilters.js.map +1 -0
  48. package/dist/components/pages/CoursePhaseParticipationsTable/table/participationRow.js +27 -0
  49. package/dist/components/pages/CoursePhaseParticipationsTable/table/participationRow.js.map +1 -0
  50. package/dist/components/pages/CoursePhaseParticipationsTable/utils/downloadParticipations.js +72 -0
  51. package/dist/components/pages/CoursePhaseParticipationsTable/utils/downloadParticipations.js.map +1 -0
  52. package/dist/components/pages/CoursePhaseParticipationsTable/utils/updateBatch.js +19 -0
  53. package/dist/components/pages/CoursePhaseParticipationsTable/utils/updateBatch.js.map +1 -0
  54. package/dist/components/pages/Mailing/CoursePhaseMailing.js +87 -0
  55. package/dist/components/pages/Mailing/CoursePhaseMailing.js.map +1 -0
  56. package/dist/components/pages/Mailing/components/AvailableMailPlaceholders.js +60 -0
  57. package/dist/components/pages/Mailing/components/AvailableMailPlaceholders.js.map +1 -0
  58. package/dist/components/pages/Mailing/components/ConfirmSendEmailDialog.js +43 -0
  59. package/dist/components/pages/Mailing/components/ConfirmSendEmailDialog.js.map +1 -0
  60. package/dist/components/pages/Mailing/components/MailingEditor.js +25 -0
  61. package/dist/components/pages/Mailing/components/MailingEditor.js.map +1 -0
  62. package/dist/components/pages/Mailing/components/ManualMailSending.js +33 -0
  63. package/dist/components/pages/Mailing/components/ManualMailSending.js.map +1 -0
  64. package/dist/components/pages/Mailing/components/SettingsCard.js +13 -0
  65. package/dist/components/pages/Mailing/components/SettingsCard.js.map +1 -0
  66. package/dist/components/table/GroupActionDialog.js +7 -0
  67. package/dist/components/table/GroupActionDialog.js.map +1 -0
  68. package/dist/components/table/PromptTable/filters/TableFiltersMenu.js +1 -1
  69. package/dist/components/table/PromptTable/filters/TableFiltersMenu.js.map +1 -1
  70. package/dist/components/table/SortableHeader.js +6 -0
  71. package/dist/components/table/SortableHeader.js.map +1 -0
  72. package/dist/contexts/DarkModeProvider.js +56 -0
  73. package/dist/contexts/DarkModeProvider.js.map +1 -0
  74. package/dist/index.js +2 -0
  75. package/dist/index.js.map +1 -1
  76. package/dist/lib/formatFileSize.js +9 -0
  77. package/dist/lib/formatFileSize.js.map +1 -0
  78. package/dist/lib/getCountries.js +15 -0
  79. package/dist/lib/getCountries.js.map +1 -0
  80. package/dist/lib/getGravatarUrl.js +7 -0
  81. package/dist/lib/getGravatarUrl.js.map +1 -0
  82. package/dist/lib/getStatusBadge.js +27 -0
  83. package/dist/lib/getStatusBadge.js.map +1 -0
  84. package/dist/lib/getStatusColor.js +13 -0
  85. package/dist/lib/getStatusColor.js.map +1 -0
  86. package/dist/lib/index.js +6 -0
  87. package/dist/lib/index.js.map +1 -1
  88. package/dist/lib/openFileDownload.js +17 -0
  89. package/dist/lib/openFileDownload.js.map +1 -0
  90. package/dist/lib/translations.json +18 -0
  91. package/dist/types/components/DynamicIcon.d.ts +6 -0
  92. package/dist/types/components/ExportedApplicationAnswerTable.d.ts +6 -0
  93. package/dist/types/components/FileList.d.ts +9 -0
  94. package/dist/types/components/FileUpload.d.ts +13 -0
  95. package/dist/types/components/FilterBadge.d.ts +6 -0
  96. package/dist/types/components/MissingConfig.d.ts +13 -0
  97. package/dist/types/components/MissingSettings.d.ts +11 -0
  98. package/dist/types/components/MultiSelect.d.ts +1 -1
  99. package/dist/types/components/SettingsCard.d.ts +8 -0
  100. package/dist/types/components/StudentAvatar.d.ts +17 -0
  101. package/dist/types/components/StudentProfile.d.ts +7 -0
  102. package/dist/types/components/StudentProfilePicture.d.ts +9 -0
  103. package/dist/types/components/ThemeToggle.d.ts +1 -0
  104. package/dist/types/components/index.d.ts +26 -0
  105. package/dist/types/components/minimal-tiptap/extensions/color/color.d.ts +1 -1
  106. package/dist/types/components/minimal-tiptap/extensions/image/image.d.ts +1 -1
  107. package/dist/types/components/minimal-tiptap/extensions/link/link.d.ts +1 -1
  108. package/dist/types/components/minimal-tiptap/hooks/use-minimal-tiptap.d.ts +1 -1
  109. package/dist/types/components/pages/CoursePhaseParticipationsTable/CoursePhaseParticipationsTable.d.ts +15 -0
  110. package/dist/types/components/pages/CoursePhaseParticipationsTable/table/participationActions.d.ts +11 -0
  111. package/dist/types/components/pages/CoursePhaseParticipationsTable/table/participationColumns.d.ts +3 -0
  112. package/dist/types/components/pages/CoursePhaseParticipationsTable/table/participationFilters.d.ts +2 -0
  113. package/dist/types/components/pages/CoursePhaseParticipationsTable/table/participationRow.d.ts +35 -0
  114. package/dist/types/components/pages/CoursePhaseParticipationsTable/utils/downloadParticipations.d.ts +3 -0
  115. package/dist/types/components/pages/CoursePhaseParticipationsTable/utils/updateBatch.d.ts +5 -0
  116. package/dist/types/components/pages/Mailing/CoursePhaseMailing.d.ts +6 -0
  117. package/dist/types/components/pages/Mailing/components/AvailableMailPlaceholders.d.ts +12 -0
  118. package/dist/types/components/pages/Mailing/components/ConfirmSendEmailDialog.d.ts +8 -0
  119. package/dist/types/components/pages/Mailing/components/MailingEditor.d.ts +12 -0
  120. package/dist/types/components/pages/Mailing/components/ManualMailSending.d.ts +7 -0
  121. package/dist/types/components/pages/Mailing/components/SettingsCard.d.ts +7 -0
  122. package/dist/types/components/table/GroupActionDialog.d.ts +11 -0
  123. package/dist/types/components/table/SortableHeader.d.ts +4 -0
  124. package/dist/types/components/ui/alert.d.ts +1 -1
  125. package/dist/types/components/ui/badge.d.ts +1 -1
  126. package/dist/types/components/ui/button.d.ts +1 -1
  127. package/dist/types/components/ui/label.d.ts +1 -1
  128. package/dist/types/components/ui/sheet.d.ts +1 -1
  129. package/dist/types/components/ui/sidebar.d.ts +1 -1
  130. package/dist/types/components/ui/toast.d.ts +1 -1
  131. package/dist/types/components/ui/toggle-group.d.ts +2 -2
  132. package/dist/types/components/ui/toggle.d.ts +2 -2
  133. package/dist/types/contexts/DarkModeProvider.d.ts +11 -0
  134. package/dist/types/index.d.ts +2 -0
  135. package/dist/types/lib/formatFileSize.d.ts +1 -0
  136. package/dist/types/lib/getCountries.d.ts +5 -0
  137. package/dist/types/lib/getGravatarUrl.d.ts +1 -0
  138. package/dist/types/lib/getStatusBadge.d.ts +3 -0
  139. package/dist/types/lib/getStatusColor.d.ts +2 -0
  140. package/dist/types/lib/index.d.ts +6 -0
  141. package/dist/types/lib/openFileDownload.d.ts +6 -0
  142. package/package.json +54 -36
  143. package/tailwind-config.js +50 -0
  144. package/readme.md +0 -36
@@ -0,0 +1,43 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { Send, Loader2, AlertCircle, CheckCircle, X } from 'lucide-react';
3
+ import { useMutation } from '@tanstack/react-query';
4
+ import { useParams } from 'react-router-dom';
5
+ import { useState, useEffect } from 'react';
6
+ import { PassStatus } from '@tumaet/prompt-shared-state';
7
+ import { sendStatusMail } from '@tumaet/prompt-shared-state';
8
+ import { getCoursePhaseParticipationStatusCounts } from '@tumaet/prompt-shared-state';
9
+ import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, Button, Alert, AlertDescription, AlertTitle, } from '../../../../components';
10
+ export const ConfirmSendEmailDialog = ({ isOpen, onClose, emailType, }) => {
11
+ const { phaseId } = useParams();
12
+ const [mailRecipients, setMailRecipients] = useState({});
13
+ const { mutate: sendEmails, isPending, isError, error, data, reset, } = useMutation({
14
+ mutationFn: (statusToSend) => {
15
+ return sendStatusMail(phaseId ?? 'undefined', statusToSend);
16
+ },
17
+ });
18
+ const onConfirm = () => {
19
+ sendEmails({ statusMailToBeSend: emailType });
20
+ };
21
+ const handleClose = () => {
22
+ reset();
23
+ onClose();
24
+ };
25
+ useEffect(() => {
26
+ const fetchMailRecipientsCount = async () => {
27
+ const d = await getCoursePhaseParticipationStatusCounts(phaseId ?? '');
28
+ setMailRecipients(d);
29
+ };
30
+ fetchMailRecipientsCount();
31
+ }, [phaseId]);
32
+ return (_jsx(Dialog, { open: isOpen, onOpenChange: handleClose, children: _jsxs(DialogContent, { children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { children: isPending
33
+ ? 'Sending Emails'
34
+ : isError
35
+ ? 'Error'
36
+ : data
37
+ ? 'Email Send Results'
38
+ : 'Confirm Email Send' }), _jsx(DialogDescription, { children: !isPending &&
39
+ !isError &&
40
+ !data &&
41
+ `Are you sure you want to send an Email to ALL students that ${emailType === PassStatus.PASSED ? 'have been accepted' : 'have been rejected'}?` }), _jsx(DialogDescription, { children: !isPending && !isError && !data && (_jsxs(_Fragment, { children: ["This will send out an email to", ' ', _jsxs("span", { className: 'font-bold', children: [mailRecipients[emailType] ?? 0, ' ', mailRecipients[emailType] === 1 ? 'recipient' : 'recipients'] })] })) })] }), isPending && (_jsxs(Alert, { children: [_jsx(Loader2, { className: 'h-4 w-4 animate-spin text-blue-500' }), _jsx(AlertTitle, { children: "Sending Mails" }), _jsx(AlertDescription, { children: "Please wait while we process your request." })] })), isError && (_jsxs(Alert, { variant: 'destructive', children: [_jsx(AlertCircle, { className: 'h-4 w-4' }), _jsx(AlertTitle, { children: "Error" }), _jsx(AlertDescription, { children: error?.message || 'An unexpected error occurred.' })] })), data && (_jsxs(Alert, { children: [_jsx(CheckCircle, { className: 'h-4 w-4 text-green-500' }), _jsx(AlertTitle, { children: "Email Send Results" }), _jsxs(AlertDescription, { children: ["Successfully sent: ", data.successfulEmails ? data.successfulEmails.length : 0, " emails", _jsx("br", {}), "Failed to send: ", data.failedEmails ? data.failedEmails.length : 0, " emails"] })] })), _jsxs(DialogFooter, { children: [!isPending && !isError && !data && (_jsxs(_Fragment, { children: [_jsx(Button, { variant: 'outline', onClick: handleClose, children: "Cancel" }), _jsxs(Button, { onClick: onConfirm, children: [_jsx(Send, { className: 'mr-2 h-4 w-4' }), "Confirm Send"] })] })), (isError || data) && (_jsxs(Button, { onClick: handleClose, children: [_jsx(X, { className: 'mr-2 h-4 w-4' }), "Close"] }))] })] }) }));
42
+ };
43
+ //# sourceMappingURL=ConfirmSendEmailDialog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConfirmSendEmailDialog.js","sourceRoot":"","sources":["../../../../../src/components/pages/Mailing/components/ConfirmSendEmailDialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC,EAAE,MAAM,cAAc,CAAA;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC5C,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAC3C,OAAO,EAAkB,UAAU,EAAE,MAAM,6BAA6B,CAAA;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAC5D,OAAO,EAAE,uCAAuC,EAAE,MAAM,6BAA6B,CAAA;AACrF,OAAO,EACL,MAAM,EACN,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,MAAM,EACN,KAAK,EACL,gBAAgB,EAChB,UAAU,GACX,MAAM,cAAc,CAAA;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CAAC,CAAC,CAAC,CAAC,eAChD,IACb,CACT,EAED,MAAC,YAAY,eACV,CAAC,SAAS,IAAI,CAAC,OAAO,IAAI,CAAC,IAAI,IAAI,CAClC,8BACE,KAAC,MAAM,IAAC,OAAO,EAAC,SAAS,EAAC,OAAO,EAAE,WAAW,uBAErC,EACT,MAAC,MAAM,IAAC,OAAO,EAAE,SAAS,aACxB,KAAC,IAAI,IAAC,SAAS,EAAC,cAAc,GAAG,oBAE1B,IACR,CACJ,EACA,CAAC,OAAO,IAAI,IAAI,CAAC,IAAI,CACpB,MAAC,MAAM,IAAC,OAAO,EAAE,WAAW,aAC1B,KAAC,CAAC,IAAC,SAAS,EAAC,cAAc,GAAG,aAEvB,CACV,IACY,IACD,GACT,CACV,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,25 @@
1
+ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
+ import { useState } from 'react';
3
+ import { Label, TooltipProvider, Input, Card, CardContent, CardHeader, CardTitle, MailingTiptapEditor, } from '../../../../components';
4
+ export const EmailTemplateEditor = ({ subject, content, onInputChange, label, subjectHTMLLabel, contentHTMLLabel, placeholders, }) => {
5
+ // Local state to hold warning message
6
+ const [subjectWarning, setSubjectWarning] = useState('');
7
+ // Regular expression to allow only ASCII characters
8
+ const asciiOnlyRegex = /^[\x20-\x7F]*$/;
9
+ // Custom onChange handler for subject input
10
+ const handleSubjectChange = (e) => {
11
+ const value = e.target.value;
12
+ if (!asciiOnlyRegex.test(value)) {
13
+ // Set a warning message and do not propagate the change
14
+ setSubjectWarning('Warning: Only ASCII characters are allowed.');
15
+ return;
16
+ }
17
+ // Clear any warning and propagate the valid change
18
+ setSubjectWarning('');
19
+ onInputChange(e);
20
+ };
21
+ return (_jsxs(Card, { children: [_jsx(CardHeader, { children: _jsxs(CardTitle, { children: [label, " Mail Template"] }) }), _jsxs(CardContent, { className: 'space-y-4', children: [_jsxs("div", { children: [_jsxs(Label, { htmlFor: subjectHTMLLabel, children: [label, " Subject"] }), _jsx(Input, { type: 'text', name: subjectHTMLLabel, value: subject, onChange: handleSubjectChange, className: 'w-full mt-1' }), subjectWarning && _jsx("p", { className: 'text-red-500 text-sm mt-1', children: subjectWarning })] }), _jsxs("div", { children: [_jsxs(Label, { htmlFor: contentHTMLLabel, children: [label, " E-Mail Template"] }), _jsx(TooltipProvider, { children: _jsx(MailingTiptapEditor, { value: content, onChange: (newContent) => onInputChange({
22
+ target: { name: contentHTMLLabel, value: newContent },
23
+ }), className: 'w-full mt-1', editorContentClassName: 'p-4', output: 'html', placeholder: 'Type your email here...', autofocus: false, editable: true, editorClassName: 'focus:outline-none', placeholders: placeholders }) })] })] })] }));
24
+ };
25
+ //# sourceMappingURL=MailingEditor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MailingEditor.js","sourceRoot":"","sources":["../../../../../src/components/pages/Mailing/components/MailingEditor.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACvC,OAAO,EACL,KAAK,EACL,eAAe,EACf,KAAK,EACL,IAAI,EACJ,WAAW,EACX,UAAU,EACV,SAAS,EACT,mBAAmB,GACpB,MAAM,cAAc,CAAA;AAYrB,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,EAClC,OAAO,EACP,OAAO,EACP,aAAa,EACb,KAAK,EACL,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,GACa,EAAE,EAAE;IAC7B,sCAAsC;IACtC,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAA;IAExD,oDAAoD;IACpD,MAAM,cAAc,GAAG,gBAAgB,CAAA;IAEvC,4CAA4C;IAC5C,MAAM,mBAAmB,GAAG,CAAC,CAAsC,EAAE,EAAE;QACrE,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,CAAA;QAC5B,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,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
+ import { Send } from 'lucide-react';
3
+ import { PassStatus } from '@tumaet/prompt-shared-state';
4
+ import { useState } from 'react';
5
+ import { ConfirmSendEmailDialog } from './ConfirmSendEmailDialog';
6
+ import { Button, Label, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from '../../../../components';
7
+ import { useGetMailingIsConfigured } from '@tumaet/prompt-shared-state';
8
+ export const ManualMailSending = ({ mailingMetaData, isModified }) => {
9
+ const [confirmationDialogOpen, setConfirmationDialogOpen] = useState(false);
10
+ const [sendEmailType, setSendEmailType] = useState(null);
11
+ const courseMailingIsConfigured = useGetMailingIsConfigured();
12
+ const isDisabled = (type) => {
13
+ if (isModified)
14
+ return true;
15
+ const contentCheck = type === PassStatus.PASSED
16
+ ? mailingMetaData?.passedMailContent && mailingMetaData?.passedMailSubject
17
+ : mailingMetaData?.failedMailContent && mailingMetaData?.failedMailSubject;
18
+ return !(contentCheck && courseMailingIsConfigured);
19
+ };
20
+ const tooltipMessage = courseMailingIsConfigured
21
+ ? 'Configure the mail subject and content and save changes before sending.'
22
+ : 'Configure the mailing in the course mail settings before sending.';
23
+ return (_jsx(_Fragment, { children: _jsxs(TooltipProvider, { children: [_jsxs("div", { className: 'flex flex-col sm:flex-row sm:items-center justify-between gap-2', children: [_jsxs("div", { className: 'space-y-0.5', children: [_jsx(Label, { children: "Manual Acceptance Emails" }), _jsx("p", { className: 'text-sm text-muted-foreground', children: "Send an acceptance mail to ALL accepted students." })] }), _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { children: _jsxs(Button, { className: 'w-full sm:w-auto', variant: 'outline', onClick: (e) => {
24
+ e.preventDefault();
25
+ setSendEmailType(PassStatus.PASSED);
26
+ setConfirmationDialogOpen(true);
27
+ }, disabled: isDisabled(PassStatus.PASSED), children: [_jsx(Send, { className: 'mr-2 h-4 w-4' }), "Send Acceptance Mails"] }) }), isDisabled(PassStatus.PASSED) && _jsxs(TooltipContent, { children: [tooltipMessage, " "] })] })] }), _jsxs("div", { className: 'flex flex-col sm:flex-row sm:items-center justify-between gap-2', children: [_jsxs("div", { className: 'space-y-0.5', children: [_jsx(Label, { children: "Manual Rejection Emails" }), _jsx("p", { className: 'text-sm text-muted-foreground', children: "Send a rejection mail to ALL rejected students." })] }), _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { children: _jsxs(Button, { className: 'w-full sm:w-auto', variant: 'outline', onClick: (e) => {
28
+ e.preventDefault();
29
+ setSendEmailType(PassStatus.FAILED);
30
+ setConfirmationDialogOpen(true);
31
+ }, disabled: isDisabled(PassStatus.FAILED), children: [_jsx(Send, { className: 'mr-2 h-4 w-4' }), "Send Rejection Mails"] }) }), isDisabled(PassStatus.FAILED) && _jsxs(TooltipContent, { children: [tooltipMessage, " "] })] })] }), confirmationDialogOpen && sendEmailType && (_jsx(ConfirmSendEmailDialog, { isOpen: confirmationDialogOpen, onClose: () => setConfirmationDialogOpen(false), emailType: sendEmailType }))] }) }));
32
+ };
33
+ //# sourceMappingURL=ManualMailSending.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ManualMailSending.js","sourceRoot":"","sources":["../../../../../src/components/pages/Mailing/components/ManualMailSending.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,UAAU,EAAgC,MAAM,6BAA6B,CAAA;AACtF,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChC,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,EACL,MAAM,EACN,KAAK,EACL,OAAO,EACP,cAAc,EACd,eAAe,EACf,cAAc,GACf,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AAOvE,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,EAAE,eAAe,EAAE,UAAU,EAA0B,EAAE,EAAE;IAC3F,MAAM,CAAC,sBAAsB,EAAE,yBAAyB,CAAC,GAAG,QA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I,MAAC,cAAc,eAAE,cAAc,SAAmB,IAC5E,IACN,EACN,eAAK,SAAS,EAAC,iEAAiE,aAC9E,eAAK,SAAS,EAAC,aAAa,aAC1B,KAAC,KAAK,0CAAgC,EACtC,YAAG,SAAS,EAAC,+BAA+B,gEAExC,IACA,EACN,MAAC,OAAO,eACN,KAAC,cAAc,cACb,MAAC,MAAM,IACL,SAAS,EAAC,kBAAkB,EAC5B,OAAO,EAAC,SAAS,EACjB,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;4CACb,CAAC,CAAC,cAAc,EAAE,CAAA;4CAClB,gBAAgB,CAAC,UAAU,CAAC,MAAM,CAAC,CAAA;4CACnC,yBAAyB,CAAC,IAAI,CAAC,CAAA;wCACjC,CAAC,EACD,QAAQ,EAAE,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,aAEvC,KAAC,IAAI,IAAC,SAAS,EAAC,cAAc,GAAG,4BAE1B,GACM,EAChB,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,MAAC,cAAc,eAAE,cAAc,SAAmB,IAC5E,IACN,EACL,sBAAsB,IAAI,aAAa,IAAI,CAC1C,KAAC,sBAAsB,IACrB,MAAM,EAAE,sBAAsB,EAC9B,OAAO,EAAE,GAAG,EAAE,CAAC,yBAAyB,CAAC,KAAK,CAAC,EAC/C,SAAS,EAAE,aAAa,GACxB,CACH,IACe,GACjB,CACJ,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { Badge, Card, CardContent, CardDescription, CardHeader, CardTitle } from '../../../../components';
3
+ import { ManualMailSending } from './ManualMailSending';
4
+ import { Info } from 'lucide-react';
5
+ export const SettingsCard = ({ mailingMetaData, isModified }) => {
6
+ const someMailFunctionDisabled = isModified ||
7
+ !mailingMetaData?.passedMailContent ||
8
+ !mailingMetaData?.passedMailSubject ||
9
+ !mailingMetaData?.failedMailContent ||
10
+ !mailingMetaData?.failedMailSubject;
11
+ return (_jsx(_Fragment, { children: _jsxs(Card, { className: 'w-full', children: [_jsxs(CardHeader, { children: [_jsxs("div", { className: 'flex items-center justify-between', children: [_jsx(CardTitle, { children: "E-Mail Settings" }), isModified && (_jsx(Badge, { variant: 'outline', className: 'bg-yellow-100 text-yellow-800 border-yellow-300', children: "Unsaved Changes" }))] }), _jsx(CardDescription, { children: "Configure email settings for the application phase" })] }), _jsxs(CardContent, { className: 'space-y-6', children: [someMailFunctionDisabled && (_jsxs("div", { className: 'flex items-start space-x-2 text-sm text-muted-foreground bg-muted p-3 rounded-md', children: [_jsx(Info, { className: 'h-4 w-4 mt-0.5 flex-shrink-0' }), _jsx("p", { children: "Some of the following mailing options are disabled. Please make sure to configure and save the corresponding mail subject and content." })] })), _jsx("div", { className: 'space-y-4', children: _jsx(ManualMailSending, { mailingMetaData: mailingMetaData, isModified: isModified }) })] })] }) }));
12
+ };
13
+ //# sourceMappingURL=SettingsCard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SettingsCard.js","sourceRoot":"","sources":["../../../../../src/components/pages/Mailing/components/SettingsCard.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,eAAe,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAC/F,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAEvD,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAOnC,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAAE,eAAe,EAAE,UAAU,EAAqB,EAAE,EAAE;IACjF,MAAM,wBAAwB,GAC5B,UAAU;QACV,CAAC,eAAe,EAAE,iBAAiB;QACnC,CAAC,eAAe,EAAE,iBAAiB;QACnC,CAAC,eAAe,EAAE,iBAAiB;QACnC,CAAC,eAAe,EAAE,iBAAiB,CAAA;IAErC,OAAO,CACL,4BACE,MAAC,IAAI,IAAC,SAAS,EAAC,QAAQ,aACtB,MAAC,UAAU,eACT,eAAK,SAAS,EAAC,mCAAmC,aAChD,KAAC,SAAS,kCAA4B,EACrC,UAAU,IAAI,CACb,KAAC,KAAK,IAAC,OAAO,EAAC,SAAS,EAAC,SAAS,EAAC,iDAAiD,gCAE5E,CACT,IACG,EACN,KAAC,eAAe,qEAAqE,IAC1E,EACb,MAAC,WAAW,IAAC,SAAS,EAAC,WAAW,aAC/B,wBAAwB,IAAI,CAC3B,eAAK,SAAS,EAAC,kFAAkF,aAC/F,KAAC,IAAI,IAAC,SAAS,EAAC,8BAA8B,GAAG,EACjD,iKAGI,IACA,CACP,EACD,cAAK,SAAS,EAAC,WAAW,YACxB,KAAC,iBAAiB,IAAC,eAAe,EAAE,eAAe,EAAE,UAAU,EAAE,UAAU,GAAI,GAC3E,IACM,IACT,GACN,CACJ,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Button, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, } from '../../components';
3
+ export const ActionDialog = ({ title, description, confirmLabel, confirmVariant = 'default', isOpen, onClose, onConfirm, }) => (_jsx(Dialog, { open: isOpen, onOpenChange: onClose, children: _jsxs(DialogContent, { children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { children: title }), _jsx(DialogDescription, { children: description })] }), _jsxs(DialogFooter, { children: [_jsx(Button, { variant: 'outline', onClick: onClose, children: "Cancel" }), _jsx(Button, { variant: confirmVariant, onClick: () => {
4
+ onConfirm();
5
+ onClose();
6
+ }, children: confirmLabel })] })] }) }));
7
+ //# sourceMappingURL=GroupActionDialog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GroupActionDialog.js","sourceRoot":"","sources":["../../../src/components/table/GroupActionDialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,MAAM,EACN,MAAM,EACN,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,WAAW,GACZ,MAAM,cAAc,CAAA;AAYrB,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAC3B,KAAK,EACL,WAAW,EACX,YAAY,EACZ,cAAc,GAAG,SAAS,EAC1B,MAAM,EACN,OAAO,EACP,SAAS,GACS,EAAE,EAAE,CAAC,CACvB,KAAC,MAAM,IAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,YACzC,MAAC,aAAa,eACZ,MAAC,YAAY,eACX,KAAC,WAAW,cAAE,KAAK,GAAe,EAClC,KAAC,iBAAiB,cAAE,WAAW,GAAqB,IACvC,EACf,MAAC,YAAY,eACX,KAAC,MAAM,IAAC,OAAO,EAAC,SAAS,EAAC,OAAO,EAAE,OAAO,uBAEjC,EACT,KAAC,MAAM,IACL,OAAO,EAAE,cAAc,EACvB,OAAO,EAAE,GAAG,EAAE;4BACZ,SAAS,EAAE,CAAA;4BACX,OAAO,EAAE,CAAA;wBACX,CAAC,YAEA,YAAY,GACN,IACI,IACD,GACT,CACV,CAAA"}
@@ -4,7 +4,7 @@ import { SelectFilterSection } from './SelectFilterSection';
4
4
  import { NumericRangeFilterSection } from './NumericRangeFilterSection';
5
5
  import { Filter } from 'lucide-react';
6
6
  export function TableFiltersMenu({ table, filters, trigger }) {
7
- return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: trigger ?? (_jsxs(Button, { variant: 'outline', className: 'justify-start', children: [_jsx(Filter, { className: 'h-4 w-4' }), _jsx("span", { className: 'hidden sm:inline', children: "Filter" })] })) }), _jsx(DropdownMenuContent, { className: 'w-64', children: filters.map((filter) => {
7
+ return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: trigger ?? (_jsxs(Button, { variant: 'outline', className: 'justify-start', children: [_jsx(Filter, { className: 'h-4 w-4' }), _jsx("span", { className: 'hidden sm:inline', children: "Filter" })] })) }), _jsx(DropdownMenuContent, { className: 'w-64 max-h-[60vh] overflow-y-auto', children: filters.map((filter) => {
8
8
  const column = table.getColumn(filter.id);
9
9
  if (!column)
10
10
  return null;
@@ -1 +1 @@
1
- {"version":3,"file":"TableFiltersMenu.js","sourceRoot":"","sources":["../../../../../src/components/table/PromptTable/filters/TableFiltersMenu.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAIhG,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AACvE,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAQrC,MAAM,UAAU,gBAAgB,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAyB;IACjF,OAAO,CACL,MAAC,YAAY,eACX,KAAC,mBAAmB,IAAC,OAAO,kBACzB,OAAO,IAAI,CACV,MAAC,MAAM,IAAC,OAAO,EAAC,SAAS,EAAC,SAAS,EAAC,eAAe,aACjD,KAAC,MAAM,IAAC,SAAS,EAAC,SAAS,GAAG,EAC9B,eAAM,SAAS,EAAC,kBAAkB,uBAAc,IACzC,CACV,GACmB,EAEtB,KAAC,mBAAmB,IAAC,SAAS,EAAC,MAAM,YAClC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;oBACtB,MAAM,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;oBACzC,IAAI,CAAC,MAAM;wBAAE,OAAO,IAAI,CAAA;oBAExB,IAAI,MAAM,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;wBAC7B,OAAO,CACL,KAAC,mBAAmB,IAElB,KAAK,EAAE,MAAM,CAAC,KAAK,EACnB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,CAAC,OAAO,EACvB,UAAU,EAAE,MAAM,CAAC,WAAW,IAJzB,MAAM,CAAC,EAAE,CAKd,CACH,CAAA;oBACH,CAAC;oBAED,IAAI,MAAM,CAAC,IAAI,KAAK,cAAc,EAAE,CAAC;wBACnC,OAAO,CACL,KAAC,yBAAyB,IAExB,KAAK,EAAE,MAAM,CAAC,KAAK,EACnB,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,MAAM,CAAC,YAAY,IAH5B,MAAM,CAAC,EAAE,CAId,CACH,CAAA;oBACH,CAAC;oBAED,OAAO,wBAAsB,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,IAA5C,MAAM,CAAC,EAAE,CAA0C,CAAA;gBACtE,CAAC,CAAC,GACkB,IACT,CAChB,CAAA;AACH,CAAC"}
1
+ {"version":3,"file":"TableFiltersMenu.js","sourceRoot":"","sources":["../../../../../src/components/table/PromptTable/filters/TableFiltersMenu.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAIhG,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AACvE,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAQrC,MAAM,UAAU,gBAAgB,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAyB;IACjF,OAAO,CACL,MAAC,YAAY,eACX,KAAC,mBAAmB,IAAC,OAAO,kBACzB,OAAO,IAAI,CACV,MAAC,MAAM,IAAC,OAAO,EAAC,SAAS,EAAC,SAAS,EAAC,eAAe,aACjD,KAAC,MAAM,IAAC,SAAS,EAAC,SAAS,GAAG,EAC9B,eAAM,SAAS,EAAC,kBAAkB,uBAAc,IACzC,CACV,GACmB,EAEtB,KAAC,mBAAmB,IAAC,SAAS,EAAC,mCAAmC,YAC/D,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;oBACtB,MAAM,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;oBACzC,IAAI,CAAC,MAAM;wBAAE,OAAO,IAAI,CAAA;oBAExB,IAAI,MAAM,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;wBAC7B,OAAO,CACL,KAAC,mBAAmB,IAElB,KAAK,EAAE,MAAM,CAAC,KAAK,EACnB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,CAAC,OAAO,EACvB,UAAU,EAAE,MAAM,CAAC,WAAW,IAJzB,MAAM,CAAC,EAAE,CAKd,CACH,CAAA;oBACH,CAAC;oBAED,IAAI,MAAM,CAAC,IAAI,KAAK,cAAc,EAAE,CAAC;wBACnC,OAAO,CACL,KAAC,yBAAyB,IAExB,KAAK,EAAE,MAAM,CAAC,KAAK,EACnB,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,MAAM,CAAC,YAAY,IAH5B,MAAM,CAAC,EAAE,CAId,CACH,CAAA;oBACH,CAAC;oBAED,OAAO,wBAAsB,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,IAA5C,MAAM,CAAC,EAAE,CAA0C,CAAA;gBACtE,CAAC,CAAC,GACkB,IACT,CAChB,CAAA;AACH,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { ArrowDown, ArrowUp, ArrowUpDown } from 'lucide-react';
3
+ export const SortableHeader = ({ column, title }) => {
4
+ return (_jsxs("button", { type: 'button', onClick: () => column.toggleSorting(column.getIsSorted() === 'asc'), className: 'flex items-center hover:cursor-pointer', children: [title, column.getIsSorted() === 'asc' ? (_jsx(ArrowUp, { className: 'ml-2 h-4 w-4' })) : column.getIsSorted() === 'desc' ? (_jsx(ArrowDown, { className: 'ml-2 h-4 w-4' })) : (_jsx(ArrowUpDown, { className: 'ml-2 h-4 w-4' }))] }));
5
+ };
6
+ //# sourceMappingURL=SortableHeader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SortableHeader.js","sourceRoot":"","sources":["../../../src/components/table/SortableHeader.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAE9D,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAAE,MAAM,EAAE,KAAK,EAAkC,EAAE,EAAE;IAClF,OAAO,CACL,kBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,KAAK,CAAC,EACnE,SAAS,EAAC,wCAAwC,aAEjD,KAAK,EACL,MAAM,CAAC,WAAW,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,CAChC,KAAC,OAAO,IAAC,SAAS,EAAC,cAAc,GAAG,CACrC,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,MAAM,CAAC,CAAC,CAAC,CACpC,KAAC,SAAS,IAAC,SAAS,EAAC,cAAc,GAAG,CACvC,CAAC,CAAC,CAAC,CACF,KAAC,WAAW,IAAC,SAAS,EAAC,cAAc,GAAG,CACzC,IACM,CACV,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,56 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { createContext, useContext, useEffect, useState } from 'react';
3
+ const DarkModeContext = createContext(undefined);
4
+ export const useDarkMode = () => {
5
+ const context = useContext(DarkModeContext);
6
+ if (!context) {
7
+ throw new Error('useDarkMode must be used within a DarkModeProvider');
8
+ }
9
+ return context;
10
+ };
11
+ const getSystemTheme = () => {
12
+ if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
13
+ return 'dark';
14
+ }
15
+ return 'light';
16
+ };
17
+ const DarkModeProvider = ({ children }) => {
18
+ const [theme, setTheme] = useState(() => {
19
+ const savedTheme = localStorage.getItem('theme');
20
+ if (savedTheme)
21
+ return savedTheme;
22
+ return 'system';
23
+ });
24
+ useEffect(() => {
25
+ const root = document.documentElement;
26
+ const currentTheme = theme === 'system' ? getSystemTheme() : theme;
27
+ if (currentTheme === 'dark') {
28
+ root.classList.add('dark');
29
+ }
30
+ else {
31
+ root.classList.remove('dark');
32
+ }
33
+ localStorage.setItem('theme', theme);
34
+ }, [theme]);
35
+ useEffect(() => {
36
+ const handleSystemThemeChange = (e) => {
37
+ if (theme === 'system') {
38
+ const root = document.documentElement;
39
+ if (e.matches) {
40
+ root.classList.add('dark');
41
+ }
42
+ else {
43
+ root.classList.remove('dark');
44
+ }
45
+ }
46
+ };
47
+ const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');
48
+ mediaQuery.addEventListener('change', handleSystemThemeChange);
49
+ return () => {
50
+ mediaQuery.removeEventListener('change', handleSystemThemeChange);
51
+ };
52
+ }, [theme]);
53
+ return _jsx(DarkModeContext.Provider, { value: { theme, setTheme }, children: children });
54
+ };
55
+ export default DarkModeProvider;
56
+ //# sourceMappingURL=DarkModeProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DarkModeProvider.js","sourceRoot":"","sources":["../../src/contexts/DarkModeProvider.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAS7E,MAAM,eAAe,GAAG,aAAa,CAAmC,SAAS,CAAC,CAAA;AAElF,MAAM,CAAC,MAAM,WAAW,GAAG,GAAyB,EAAE;IACpD,MAAM,OAAO,GAAG,UAAU,CAAC,eAAe,CAAC,CAAA;IAC3C,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAA;IACvE,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA;AAED,MAAM,cAAc,GAAG,GAAU,EAAE;IACjC,IAAI,MAAM,CAAC,UAAU,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C,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;gBAC/B,CAAC;YACH,CAAC;QACH,CAAC,CAAA;QAED,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC,8BAA8B,CAAC,CAAA;QACpE,UAAU,CAAC,gBAAgB,CAAC,QAAQ,EAAE,uBAAuB,CAAC,CAAA;QAE9D,OAAO,GAAG,EAAE;YACV,UAAU,CAAC,mBAAmB,CAAC,QAAQ,EAAE,uBAAuB,CAAC,CAAA;QACnE,CAAC,CAAA;IACH,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAA;IAEX,OAAO,KAAC,eAAe,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,YAAG,QAAQ,GAA4B,CAAA;AACpG,CAAC,CAAA;AAED,eAAe,gBAAgB,CAAA"}
package/dist/index.js CHANGED
@@ -2,4 +2,6 @@
2
2
  export * from './components';
3
3
  export * from './hooks';
4
4
  export * from './lib';
5
+ export * from './contexts/DarkModeProvider';
6
+ export { default as DarkModeProvider } from './contexts/DarkModeProvider';
5
7
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA;AACvB,cAAc,OAAO,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA;AACvB,cAAc,OAAO,CAAA;AACrB,cAAc,6BAA6B,CAAA;AAC3C,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,6BAA6B,CAAA"}
@@ -0,0 +1,9 @@
1
+ export const formatFileSize = (bytes) => {
2
+ if (!bytes)
3
+ return '0 Bytes';
4
+ const k = 1024;
5
+ const sizes = ['Bytes', 'KB', 'MB', 'GB'];
6
+ const i = Math.floor(Math.log(bytes) / Math.log(k));
7
+ return `${Math.round((bytes / Math.pow(k, i)) * 100) / 100} ${sizes[i]}`;
8
+ };
9
+ //# sourceMappingURL=formatFileSize.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatFileSize.js","sourceRoot":"","sources":["../../src/lib/formatFileSize.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAa,EAAU,EAAE;IACtD,IAAI,CAAC,KAAK;QAAE,OAAO,SAAS,CAAA;IAC5B,MAAM,CAAC,GAAG,IAAI,CAAA;IACd,MAAM,KAAK,GAAG,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;IACzC,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;IACnD,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,CAAA;AAC1E,CAAC,CAAA"}
@@ -0,0 +1,15 @@
1
+ // Getting the list of countries
2
+ import countries from 'i18n-iso-countries';
3
+ import enLocale from 'i18n-iso-countries/langs/en.json';
4
+ countries.registerLocale(enLocale);
5
+ export const countriesArr = Object.entries(countries.getNames('en', { select: 'alias' })).map(([key, value]) => {
6
+ return {
7
+ label: value,
8
+ value: key,
9
+ };
10
+ });
11
+ // Getting the name of the country by its code
12
+ export const getCountryName = (code) => {
13
+ return countriesArr.find((country) => country.value === code)?.label;
14
+ };
15
+ //# sourceMappingURL=getCountries.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getCountries.js","sourceRoot":"","sources":["../../src/lib/getCountries.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,OAAO,SAAS,MAAM,oBAAoB,CAAA;AAC1C,OAAO,QAAQ,MAAM,kCAAkC,CAAA;AAEvD,SAAS,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAA;AAClC,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,GAAG,CAC3F,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;IACf,OAAO;QACL,KAAK,EAAE,KAAK;QACZ,KAAK,EAAE,GAAG;KACX,CAAA;AACH,CAAC,CACF,CAAA;AAED,8CAA8C;AAC9C,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,IAAY,EAAsB,EAAE;IACjE,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,KAAK,IAAI,CAAC,EAAE,KAAK,CAAA;AACtE,CAAC,CAAA"}
@@ -0,0 +1,7 @@
1
+ import { sha256 } from 'js-sha256';
2
+ export const getGravatarUrl = (email, size) => {
3
+ const requestedSize = size ?? 200;
4
+ const hash = sha256(email.trim().toLowerCase());
5
+ return `https://www.gravatar.com/avatar/${hash}?d=identicon&d=404&size=${requestedSize}`;
6
+ };
7
+ //# sourceMappingURL=getGravatarUrl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getGravatarUrl.js","sourceRoot":"","sources":["../../src/lib/getGravatarUrl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAElC,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAa,EAAE,IAAa,EAAE,EAAE;IAC7D,MAAM,aAAa,GAAG,IAAI,IAAI,GAAG,CAAA;IACjC,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,CAAA;IAE/C,OAAO,mCAAmC,IAAI,2BAA2B,aAAa,EAAE,CAAA;AAC1F,CAAC,CAAA"}
@@ -0,0 +1,27 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Badge } from '../components';
3
+ export function getStatusBadge(status) {
4
+ switch (status) {
5
+ case 'passed':
6
+ return _jsx(Badge, { className: 'bg-green-500 hover:bg-green-500', children: "Passed" });
7
+ case 'failed':
8
+ return _jsx(Badge, { className: 'bg-red-500 hover:bg-red-500', children: "Failed" });
9
+ case 'not_assessed':
10
+ return _jsx(Badge, { className: 'bg-gray-500 hover:bg-gray-500', children: "Not Assessed" });
11
+ default:
12
+ return _jsx(Badge, { className: 'bg-gray-500 hover:bg-gray-500', children: "Unknown" });
13
+ }
14
+ }
15
+ export function getStatusString(status) {
16
+ switch (status) {
17
+ case 'passed':
18
+ return 'Passed';
19
+ case 'failed':
20
+ return 'Failed';
21
+ case 'not_assessed':
22
+ return 'Not Assessed';
23
+ default:
24
+ return 'Unknown';
25
+ }
26
+ }
27
+ //# sourceMappingURL=getStatusBadge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getStatusBadge.js","sourceRoot":"","sources":["../../src/lib/getStatusBadge.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AAGpC,MAAM,UAAU,cAAc,CAAC,MAAkB;IAC/C,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,QAAQ;YACX,OAAO,KAAC,KAAK,IAAC,SAAS,EAAC,iCAAiC,uBAAe,CAAA;QAC1E,KAAK,QAAQ;YACX,OAAO,KAAC,KAAK,IAAC,SAAS,EAAC,6BAA6B,uBAAe,CAAA;QACtE,KAAK,cAAc;YACjB,OAAO,KAAC,KAAK,IAAC,SAAS,EAAC,+BAA+B,6BAAqB,CAAA;QAC9E;YACE,OAAO,KAAC,KAAK,IAAC,SAAS,EAAC,+BAA+B,wBAAgB,CAAA;IAC3E,CAAC;AACH,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,MAAkB;IAChD,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,QAAQ;YACX,OAAO,QAAQ,CAAA;QACjB,KAAK,QAAQ;YACX,OAAO,QAAQ,CAAA;QACjB,KAAK,cAAc;YACjB,OAAO,cAAc,CAAA;QACvB;YACE,OAAO,SAAS,CAAA;IACpB,CAAC;AACH,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { PassStatus } from '@tumaet/prompt-shared-state';
2
+ export const getStatusColor = (assessmentStatus) => {
3
+ switch (assessmentStatus) {
4
+ case PassStatus.PASSED:
5
+ return 'bg-green-500 dark:bg-green-700';
6
+ case PassStatus.FAILED:
7
+ return 'bg-red-500 dark:bg-red-700';
8
+ case PassStatus.NOT_ASSESSED:
9
+ default:
10
+ return 'bg-gray-500 dark:bg-gray-700';
11
+ }
12
+ };
13
+ //# sourceMappingURL=getStatusColor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getStatusColor.js","sourceRoot":"","sources":["../../src/lib/getStatusColor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAExD,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,gBAA4B,EAAE,EAAE;IAC7D,QAAQ,gBAAgB,EAAE,CAAC;QACzB,KAAK,UAAU,CAAC,MAAM;YACpB,OAAO,gCAAgC,CAAA;QACzC,KAAK,UAAU,CAAC,MAAM;YACpB,OAAO,4BAA4B,CAAA;QACrC,KAAK,UAAU,CAAC,YAAY,CAAC;QAC7B;YACE,OAAO,8BAA8B,CAAA;IACzC,CAAC;AACH,CAAC,CAAA"}
package/dist/lib/index.js CHANGED
@@ -1,2 +1,8 @@
1
1
  export * from './utils';
2
+ export * from './formatFileSize';
3
+ export * from './getCountries';
4
+ export * from './getGravatarUrl';
5
+ export * from './getStatusBadge';
6
+ export * from './getStatusColor';
7
+ export * from './openFileDownload';
2
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,kBAAkB,CAAA;AAChC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,kBAAkB,CAAA;AAChC,cAAc,kBAAkB,CAAA;AAChC,cAAc,kBAAkB,CAAA;AAChC,cAAc,oBAAoB,CAAA"}
@@ -0,0 +1,17 @@
1
+ export const openFileDownload = async ({ downloadUrl, fileName, }) => {
2
+ if (!downloadUrl) {
3
+ console.error('No download URL available for this file.');
4
+ return;
5
+ }
6
+ const link = document.createElement('a');
7
+ link.href = downloadUrl;
8
+ link.target = '_blank';
9
+ link.rel = 'noopener noreferrer';
10
+ if (fileName) {
11
+ link.download = fileName;
12
+ }
13
+ document.body.appendChild(link);
14
+ link.click();
15
+ link.remove();
16
+ };
17
+ //# sourceMappingURL=openFileDownload.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openFileDownload.js","sourceRoot":"","sources":["../../src/lib/openFileDownload.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,EAAE,EACrC,WAAW,EACX,QAAQ,GACe,EAAiB,EAAE;IAC1C,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,OAAO,CAAC,KAAK,CAAC,0CAA0C,CAAC,CAAA;QACzD,OAAM;IACR,CAAC;IAED,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAA;IACxC,IAAI,CAAC,IAAI,GAAG,WAAW,CAAA;IACvB,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAA;IACtB,IAAI,CAAC,GAAG,GAAG,qBAAqB,CAAA;IAChC,IAAI,QAAQ,EAAE,CAAC;QACb,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;IAC1B,CAAC;IACD,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;IAC/B,IAAI,CAAC,KAAK,EAAE,CAAA;IACZ,IAAI,CAAC,MAAM,EAAE,CAAA;AACf,CAAC,CAAA"}
@@ -0,0 +1,18 @@
1
+ {
2
+ "university": {
3
+ "name": "TUM",
4
+ "login-name": "TUM-ID",
5
+ "matriculationNumberRegex": "^0\\d{7}$",
6
+ "matriculationExample": "0xxxxxxx",
7
+ "universityLoginRegex": "^[a-zA-Z]{2}\\d{2}[a-zA-Z]{3}$",
8
+ "universityLoginExample": "ab12cde",
9
+ "studyPrograms": ["Computer Science", "Information Systems", "Games Engineering", "Management and Technology"],
10
+ "studyProgramShortNames": {
11
+ "Computer Science": "CS",
12
+ "Information Systems": "IS",
13
+ "Games Engineering": "GE",
14
+ "Management and Technology": "M&T",
15
+ "Other": "Other"
16
+ }
17
+ }
18
+ }
@@ -0,0 +1,6 @@
1
+ import { LucideProps } from 'lucide-react';
2
+ interface IconProps extends Omit<LucideProps, 'ref'> {
3
+ name: string;
4
+ }
5
+ declare const DynamicIcon: ({ name, ...props }: IconProps) => import("react/jsx-runtime").JSX.Element;
6
+ export default DynamicIcon;
@@ -0,0 +1,6 @@
1
+ import { ExportedApplicationAnswer } from '@tumaet/prompt-shared-state';
2
+ interface ExportedApplicationAnswerTableProps {
3
+ applicationAnswers: ExportedApplicationAnswer[];
4
+ }
5
+ export declare const ExportedApplicationAnswerTable: ({ applicationAnswers, }: ExportedApplicationAnswerTableProps) => import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1,9 @@
1
+ import * as React from 'react';
2
+ import { FileResponse } from '@tumaet/prompt-shared-state';
3
+ export interface FileListProps {
4
+ files: FileResponse[];
5
+ onDelete?: (fileId: string) => void;
6
+ allowDelete?: boolean;
7
+ className?: string;
8
+ }
9
+ export declare const FileList: React.FC<FileListProps>;
@@ -0,0 +1,13 @@
1
+ import * as React from 'react';
2
+ import { FileResponse } from '@tumaet/prompt-shared-state';
3
+ export interface FileUploadProps {
4
+ coursePhaseId?: string;
5
+ description?: string;
6
+ tags?: string;
7
+ accept?: string;
8
+ maxSizeMB?: number;
9
+ onSuccess?: (file: FileResponse) => void;
10
+ onError?: (error: Error) => void;
11
+ className?: string;
12
+ }
13
+ export declare const FileUpload: React.FC<FileUploadProps>;
@@ -0,0 +1,6 @@
1
+ interface FilterBadgeProps {
2
+ label: string;
3
+ onRemove: () => void;
4
+ }
5
+ export declare const FilterBadge: ({ label, onRemove }: FilterBadgeProps) => import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1,13 @@
1
+ import { ElementType } from 'react';
2
+ export interface MissingConfigItem {
3
+ title: string;
4
+ icon: ElementType;
5
+ description?: string;
6
+ link: string;
7
+ hide?: () => void;
8
+ }
9
+ interface MissingConfigProps {
10
+ elements: MissingConfigItem[];
11
+ }
12
+ export declare const MissingConfig: ({ elements }: MissingConfigProps) => import("react/jsx-runtime").JSX.Element;
13
+ export {};
@@ -0,0 +1,11 @@
1
+ import { ElementType } from 'react';
2
+ export interface MissingSettingsItem {
3
+ title: string;
4
+ icon: ElementType;
5
+ description?: string;
6
+ }
7
+ interface MissingSettingsProps {
8
+ elements: MissingSettingsItem[];
9
+ }
10
+ export declare const MissingSettings: ({ elements }: MissingSettingsProps) => import("react/jsx-runtime").JSX.Element;
11
+ export {};
@@ -6,7 +6,7 @@ import { type VariantProps } from 'class-variance-authority';
6
6
  */
7
7
  declare const multiSelectVariants: (props?: ({
8
8
  variant?: "default" | "destructive" | "secondary" | "inverted" | null | undefined;
9
- } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
9
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
10
10
  /**
11
11
  * Props for MultiSelect component
12
12
  */
@@ -0,0 +1,8 @@
1
+ import { PropsWithChildren, ReactNode } from 'react';
2
+ interface SettingsCardProps extends PropsWithChildren {
3
+ icon: ReactNode;
4
+ title: string;
5
+ description: string;
6
+ }
7
+ export declare function SettingsCard({ children, icon, title, description }: SettingsCardProps): import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,17 @@
1
+ import { ReactNode } from 'react';
2
+ interface MinimalStudent {
3
+ id?: string;
4
+ firstName: string;
5
+ lastName: string;
6
+ email: string;
7
+ }
8
+ interface StudentAvatarProps {
9
+ student: MinimalStudent;
10
+ }
11
+ export declare const StudentAvatar: ({ student }: StudentAvatarProps) => import("react/jsx-runtime").JSX.Element;
12
+ export declare const RenderStudents: ({ students, fallback, className, }: {
13
+ students: MinimalStudent[];
14
+ fallback: ReactNode;
15
+ className?: string;
16
+ }) => import("react/jsx-runtime").JSX.Element;
17
+ export {};
@@ -0,0 +1,7 @@
1
+ import { Student, PassStatus } from '@tumaet/prompt-shared-state';
2
+ interface StudentProfileProps {
3
+ student: Student;
4
+ status?: PassStatus;
5
+ }
6
+ export declare const StudentProfile: ({ student, status }: StudentProfileProps) => import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,9 @@
1
+ type AvatarSize = 'lg' | 'md' | 'sm';
2
+ export declare function ProfilePicture({ email, firstName, lastName, size, className, }: {
3
+ email: string;
4
+ firstName: string;
5
+ lastName: string;
6
+ size?: AvatarSize;
7
+ className?: string;
8
+ }): import("react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -0,0 +1 @@
1
+ export declare function ThemeToggle(): import("react/jsx-runtime").JSX.Element;
@@ -13,3 +13,29 @@ export * from './SaveChangesAlert';
13
13
  export * from './ScoreLevelSelector';
14
14
  export * from './UnauthorizedPage';
15
15
  export * from './getLevelConfig';
16
+ export { default as DynamicIcon } from './DynamicIcon';
17
+ export * from './ExportedApplicationAnswerTable';
18
+ export * from './FileList';
19
+ export * from './FileUpload';
20
+ export * from './FilterBadge';
21
+ export * from './MissingConfig';
22
+ export * from './MissingSettings';
23
+ export * from './SettingsCard';
24
+ export * from './StudentAvatar';
25
+ export * from './StudentProfile';
26
+ export * from './StudentProfilePicture';
27
+ export * from './ThemeToggle';
28
+ export * from './pages/CoursePhaseParticipationsTable/CoursePhaseParticipationsTable';
29
+ export * from './pages/CoursePhaseParticipationsTable/table/participationActions';
30
+ export * from './pages/CoursePhaseParticipationsTable/table/participationColumns';
31
+ export * from './pages/CoursePhaseParticipationsTable/table/participationFilters';
32
+ export * from './pages/CoursePhaseParticipationsTable/table/participationRow';
33
+ export * from './pages/CoursePhaseParticipationsTable/utils/downloadParticipations';
34
+ export * from './pages/CoursePhaseParticipationsTable/utils/updateBatch';
35
+ export * from './pages/Mailing/CoursePhaseMailing';
36
+ export * from './pages/Mailing/components/AvailableMailPlaceholders';
37
+ export * from './pages/Mailing/components/ConfirmSendEmailDialog';
38
+ export * from './pages/Mailing/components/MailingEditor';
39
+ export * from './pages/Mailing/components/ManualMailSending';
40
+ export { SettingsCard as MailingSettingsCard } from './pages/Mailing/components/SettingsCard';
41
+ export * from './table/GroupActionDialog';