@tumaet/prompt-ui-components 0.0.4 → 0.0.5

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 (123) hide show
  1. package/dist/components/DatePicker.js +4 -4
  2. package/dist/components/DateRangePicker.js +4 -4
  3. package/dist/components/DeleteConfirmationDialog.js +1 -1
  4. package/dist/components/ErrorPage.js +2 -2
  5. package/dist/components/MultiSelect.js +6 -6
  6. package/dist/components/UnauthorizedPage.js +3 -3
  7. package/dist/components/minimal-tiptap/components/image/image-edit-block.js +3 -3
  8. package/dist/components/minimal-tiptap/components/image/image-edit-dialog.js +1 -1
  9. package/dist/components/minimal-tiptap/components/link/link-edit-block.js +5 -5
  10. package/dist/components/minimal-tiptap/components/link/link-edit-popover.js +1 -1
  11. package/dist/components/minimal-tiptap/components/link/link-popover-block.js +1 -1
  12. package/dist/components/minimal-tiptap/components/section/one.js +2 -2
  13. package/dist/components/minimal-tiptap/components/section/three.js +3 -3
  14. package/dist/components/minimal-tiptap/components/shortcut-key.js +1 -1
  15. package/dist/components/minimal-tiptap/components/spinner.js +1 -1
  16. package/dist/components/minimal-tiptap/components/toolbar-button.js +3 -3
  17. package/dist/components/minimal-tiptap/components/toolbar-section.js +2 -2
  18. package/dist/components/minimal-tiptap/extensions/image/components/image-actions.js +4 -4
  19. package/dist/components/minimal-tiptap/extensions/image/components/image-overlay.js +1 -1
  20. package/dist/components/minimal-tiptap/extensions/image/components/image-view-block.js +1 -1
  21. package/dist/components/minimal-tiptap/extensions/image/components/resize-handle.js +1 -1
  22. package/dist/components/minimal-tiptap/form-description-tiptap.js +2 -2
  23. package/dist/components/minimal-tiptap/hooks/use-minimal-tiptap.js +1 -1
  24. package/dist/components/minimal-tiptap/mailing-tiptap.js +2 -2
  25. package/dist/components/minimal-tiptap/minimal-tiptap.js +2 -2
  26. package/dist/components/table/GroupActionDialog.js +2 -2
  27. package/dist/components/table/SortableHeader.js +1 -1
  28. package/dist/components/ui/accordion.js +1 -1
  29. package/dist/components/ui/alert-dialog.js +2 -2
  30. package/dist/components/ui/alert.js +1 -1
  31. package/dist/components/ui/avatar.js +1 -1
  32. package/dist/components/ui/badge.js +1 -1
  33. package/dist/components/ui/breadcrumb.js +1 -1
  34. package/dist/components/ui/button.js +1 -1
  35. package/dist/components/ui/calendar.js +2 -2
  36. package/dist/components/ui/card.js +1 -1
  37. package/dist/components/ui/chart.js +1 -1
  38. package/dist/components/ui/checkbox.js +1 -1
  39. package/dist/components/ui/command.js +2 -2
  40. package/dist/components/ui/dialog.js +1 -1
  41. package/dist/components/ui/dropdown-menu.js +1 -1
  42. package/dist/components/ui/form.js +2 -2
  43. package/dist/components/ui/input.js +1 -1
  44. package/dist/components/ui/label.js +1 -1
  45. package/dist/components/ui/popover.js +1 -1
  46. package/dist/components/ui/progress.js +1 -1
  47. package/dist/components/ui/radio-group.js +1 -1
  48. package/dist/components/ui/scroll-area.js +1 -1
  49. package/dist/components/ui/select.js +1 -1
  50. package/dist/components/ui/separator.js +1 -1
  51. package/dist/components/ui/sheet.js +1 -1
  52. package/dist/components/ui/sidebar.js +8 -8
  53. package/dist/components/ui/skeleton.js +1 -1
  54. package/dist/components/ui/switch.js +1 -1
  55. package/dist/components/ui/table.js +1 -1
  56. package/dist/components/ui/tabs.js +1 -1
  57. package/dist/components/ui/textarea.js +1 -1
  58. package/dist/components/ui/toast.js +1 -1
  59. package/dist/components/ui/toaster.js +2 -2
  60. package/dist/components/ui/toggle-group.js +2 -2
  61. package/dist/components/ui/toggle.js +1 -1
  62. package/dist/components/ui/tooltip.js +1 -1
  63. package/dist/types/components/minimal-tiptap/components/image/image-edit-dialog.d.ts +1 -1
  64. package/dist/types/components/minimal-tiptap/components/link/link-edit-popover.d.ts +1 -1
  65. package/dist/types/components/minimal-tiptap/components/section/five.d.ts +1 -1
  66. package/dist/types/components/minimal-tiptap/components/section/four.d.ts +1 -1
  67. package/dist/types/components/minimal-tiptap/components/section/mailingPlaceholders.d.ts +1 -1
  68. package/dist/types/components/minimal-tiptap/components/section/one.d.ts +1 -1
  69. package/dist/types/components/minimal-tiptap/components/section/three.d.ts +1 -1
  70. package/dist/types/components/minimal-tiptap/components/section/two.d.ts +1 -1
  71. package/dist/types/components/minimal-tiptap/components/toolbar-button.d.ts +1 -1
  72. package/dist/types/components/minimal-tiptap/components/toolbar-section.d.ts +1 -1
  73. package/dist/types/components/ui/sidebar.d.ts +2 -2
  74. package/dist/types/hooks/use-toast.d.ts +1 -1
  75. package/package.json +3 -2
  76. package/dist/components/ExportedApplicationAnswerTable.js +0 -16
  77. package/dist/components/ExportedApplicationAnswerTable.js.map +0 -1
  78. package/dist/components/MissingConfig.js +0 -12
  79. package/dist/components/MissingConfig.js.map +0 -1
  80. package/dist/components/StudentProfile.js +0 -14
  81. package/dist/components/StudentProfile.js.map +0 -1
  82. package/dist/components/ThemeToggle.js +0 -10
  83. package/dist/components/ThemeToggle.js.map +0 -1
  84. package/dist/components/pages/CoursePhaseParticpationsTable/CoursePhaseParticipationsTablePage.js +0 -71
  85. package/dist/components/pages/CoursePhaseParticpationsTable/CoursePhaseParticipationsTablePage.js.map +0 -1
  86. package/dist/components/pages/CoursePhaseParticpationsTable/components/FilterMenu.js +0 -43
  87. package/dist/components/pages/CoursePhaseParticpationsTable/components/FilterMenu.js.map +0 -1
  88. package/dist/components/pages/CoursePhaseParticpationsTable/components/GroupActionsMenu.js +0 -50
  89. package/dist/components/pages/CoursePhaseParticpationsTable/components/GroupActionsMenu.js.map +0 -1
  90. package/dist/components/pages/CoursePhaseParticpationsTable/components/columns.js +0 -84
  91. package/dist/components/pages/CoursePhaseParticpationsTable/components/columns.js.map +0 -1
  92. package/dist/components/pages/CoursePhaseParticpationsTable/interfaces/ExtraParticipationTableData.js +0 -2
  93. package/dist/components/pages/CoursePhaseParticpationsTable/interfaces/ExtraParticipationTableData.js.map +0 -1
  94. package/dist/components/pages/CoursePhaseParticpationsTable/utils/downloadParticipations.js +0 -70
  95. package/dist/components/pages/CoursePhaseParticpationsTable/utils/downloadParticipations.js.map +0 -1
  96. package/dist/components/pages/Mailing/CoursePhaseMailing.js +0 -88
  97. package/dist/components/pages/Mailing/CoursePhaseMailing.js.map +0 -1
  98. package/dist/components/pages/Mailing/components/AvailableMailPlaceholders.js +0 -61
  99. package/dist/components/pages/Mailing/components/AvailableMailPlaceholders.js.map +0 -1
  100. package/dist/components/pages/Mailing/components/ConfirmSendEmailDialog.js +0 -35
  101. package/dist/components/pages/Mailing/components/ConfirmSendEmailDialog.js.map +0 -1
  102. package/dist/components/pages/Mailing/components/MailingEditor.js +0 -29
  103. package/dist/components/pages/Mailing/components/MailingEditor.js.map +0 -1
  104. package/dist/components/pages/Mailing/components/ManualMailSending.js +0 -35
  105. package/dist/components/pages/Mailing/components/ManualMailSending.js.map +0 -1
  106. package/dist/components/pages/Mailing/components/SettingsCard.js +0 -14
  107. package/dist/components/pages/Mailing/components/SettingsCard.js.map +0 -1
  108. package/dist/types/components/ExportedApplicationAnswerTable.d.ts +0 -6
  109. package/dist/types/components/MissingConfig.d.ts +0 -13
  110. package/dist/types/components/StudentProfile.d.ts +0 -7
  111. package/dist/types/components/ThemeToggle.d.ts +0 -1
  112. package/dist/types/components/pages/CoursePhaseParticpationsTable/CoursePhaseParticipationsTablePage.d.ts +0 -13
  113. package/dist/types/components/pages/CoursePhaseParticpationsTable/components/FilterMenu.d.ts +0 -7
  114. package/dist/types/components/pages/CoursePhaseParticpationsTable/components/GroupActionsMenu.d.ts +0 -10
  115. package/dist/types/components/pages/CoursePhaseParticpationsTable/components/columns.d.ts +0 -9
  116. package/dist/types/components/pages/CoursePhaseParticpationsTable/interfaces/ExtraParticipationTableData.d.ts +0 -5
  117. package/dist/types/components/pages/CoursePhaseParticpationsTable/utils/downloadParticipations.d.ts +0 -3
  118. package/dist/types/components/pages/Mailing/CoursePhaseMailing.d.ts +0 -6
  119. package/dist/types/components/pages/Mailing/components/AvailableMailPlaceholders.d.ts +0 -12
  120. package/dist/types/components/pages/Mailing/components/ConfirmSendEmailDialog.d.ts +0 -8
  121. package/dist/types/components/pages/Mailing/components/MailingEditor.d.ts +0 -12
  122. package/dist/types/components/pages/Mailing/components/ManualMailSending.d.ts +0 -7
  123. package/dist/types/components/pages/Mailing/components/SettingsCard.d.ts +0 -7
@@ -4,14 +4,14 @@ import * as React from 'react';
4
4
  import { Slot } from '@radix-ui/react-slot';
5
5
  import { cva } from 'class-variance-authority';
6
6
  import { PanelLeft } from 'lucide-react';
7
- import { useIsMobile } from '@/hooks/use-mobile';
8
- import { cn } from '@/lib/utils';
9
- import { Button } from '@/components/ui/button';
10
- import { Input } from '@/components/ui/input';
11
- import { Separator } from '@/components/ui/separator';
12
- import { Sheet, SheetContent } from '@/components/ui/sheet';
13
- import { Skeleton } from '@/components/ui/skeleton';
14
- import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip';
7
+ import { useIsMobile } from '../../hooks/use-mobile';
8
+ import { cn } from '../../lib/utils';
9
+ import { Button } from '../../components/ui/button';
10
+ import { Input } from '../../components/ui/input';
11
+ import { Separator } from '../../components/ui/separator';
12
+ import { Sheet, SheetContent } from '../../components/ui/sheet';
13
+ import { Skeleton } from '../../components/ui/skeleton';
14
+ import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '../../components/ui/tooltip';
15
15
  const SIDEBAR_COOKIE_NAME = 'sidebar:state';
16
16
  const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
17
17
  const SIDEBAR_WIDTH = '18rem';
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { cn } from '@/lib/utils';
2
+ import { cn } from '../../lib/utils';
3
3
  function Skeleton({ className, ...props }) {
4
4
  return _jsx("div", { className: cn('animate-pulse rounded-md bg-muted', className), ...props });
5
5
  }
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
3
  import * as SwitchPrimitives from "@radix-ui/react-switch";
4
- import { cn } from "@/lib/utils";
4
+ import { cn } from "../../lib/utils";
5
5
  const Switch = React.forwardRef(({ className, ...props }, ref) => (_jsx(SwitchPrimitives.Root, { className: cn("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input", className), ...props, ref: ref, children: _jsx(SwitchPrimitives.Thumb, { className: cn("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0") }) })));
6
6
  Switch.displayName = SwitchPrimitives.Root.displayName;
7
7
  export { Switch };
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
- import { cn } from "@/lib/utils";
3
+ import { cn } from "../../lib/utils";
4
4
  const Table = React.forwardRef(({ className, ...props }, ref) => (_jsx("table", { ref: ref, className: cn("w-full caption-bottom text-sm", className), ...props })));
5
5
  Table.displayName = "Table";
6
6
  const TableHeader = React.forwardRef(({ className, ...props }, ref) => (_jsx("thead", { ref: ref, className: cn("sticky top-0 bg-secondary [&_tr]:border-b", className), ...props })));
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
3
  import * as TabsPrimitive from "@radix-ui/react-tabs";
4
- import { cn } from "@/lib/utils";
4
+ import { cn } from "../../lib/utils";
5
5
  const Tabs = TabsPrimitive.Root;
6
6
  const TabsList = React.forwardRef(({ className, ...props }, ref) => (_jsx(TabsPrimitive.List, { ref: ref, className: cn("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground", className), ...props })));
7
7
  TabsList.displayName = TabsPrimitive.List.displayName;
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
- import { cn } from "@/lib/utils";
3
+ import { cn } from "../../lib/utils";
4
4
  const Textarea = React.forwardRef(({ className, ...props }, ref) => {
5
5
  return (_jsx("textarea", { className: cn("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", className), ref: ref, ...props }));
6
6
  });
@@ -3,7 +3,7 @@ import * as React from "react";
3
3
  import * as ToastPrimitives from "@radix-ui/react-toast";
4
4
  import { cva } from "class-variance-authority";
5
5
  import { X } from "lucide-react";
6
- import { cn } from "@/lib/utils";
6
+ import { cn } from "../../lib/utils";
7
7
  const ToastProvider = ToastPrimitives.Provider;
8
8
  const ToastViewport = React.forwardRef(({ className, ...props }, ref) => (_jsx(ToastPrimitives.Viewport, { ref: ref, className: cn("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]", className), ...props })));
9
9
  ToastViewport.displayName = ToastPrimitives.Viewport.displayName;
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useToast } from "@/hooks/use-toast";
3
- import { Toast, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport, } from "@/components/ui/toast";
2
+ import { useToast } from "../../hooks/use-toast";
3
+ import { Toast, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport, } from "../../components/ui/toast";
4
4
  export function Toaster() {
5
5
  const { toasts } = useToast();
6
6
  return (_jsxs(ToastProvider, { children: [toasts.map(function ({ id, title, description, action, ...props }) {
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
3
  import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
4
- import { cn } from "@/lib/utils";
5
- import { toggleVariants } from "@/components/ui/toggle";
4
+ import { cn } from "../../lib/utils";
5
+ import { toggleVariants } from "../../components/ui/toggle";
6
6
  const ToggleGroupContext = React.createContext({
7
7
  size: "default",
8
8
  variant: "default",
@@ -3,7 +3,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import * as React from "react";
4
4
  import * as TogglePrimitive from "@radix-ui/react-toggle";
5
5
  import { cva } from "class-variance-authority";
6
- import { cn } from "@/lib/utils";
6
+ import { cn } from "../../lib/utils";
7
7
  const toggleVariants = cva("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 gap-2", {
8
8
  variants: {
9
9
  variant: {
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import * as React from 'react';
3
3
  import * as TooltipPrimitive from '@radix-ui/react-tooltip';
4
- import { cn } from '@/lib/utils';
4
+ import { cn } from '../../lib/utils';
5
5
  const TooltipProvider = TooltipPrimitive.Provider;
6
6
  const Tooltip = TooltipPrimitive.Root;
7
7
  const TooltipTrigger = TooltipPrimitive.Trigger;
@@ -1,6 +1,6 @@
1
1
  import type { Editor } from '@tiptap/react';
2
2
  import type { VariantProps } from 'class-variance-authority';
3
- import type { toggleVariants } from '@/components/ui/toggle';
3
+ import type { toggleVariants } from '../../../../../components/ui/toggle';
4
4
  interface ImageEditDialogProps extends VariantProps<typeof toggleVariants> {
5
5
  editor: Editor;
6
6
  }
@@ -1,6 +1,6 @@
1
1
  import type { Editor } from '@tiptap/react';
2
2
  import type { VariantProps } from 'class-variance-authority';
3
- import type { toggleVariants } from '@/components/ui/toggle';
3
+ import type { toggleVariants } from '../../../../../components/ui/toggle';
4
4
  interface LinkEditPopoverProps extends VariantProps<typeof toggleVariants> {
5
5
  editor: Editor;
6
6
  }
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import type { Editor } from '@tiptap/react';
3
- import type { toggleVariants } from '@/components/ui/toggle';
3
+ import type { toggleVariants } from '../../../../../components/ui/toggle';
4
4
  import type { VariantProps } from 'class-variance-authority';
5
5
  type InsertElementAction = 'codeBlock' | 'blockquote' | 'horizontalRule';
6
6
  interface SectionFiveProps extends VariantProps<typeof toggleVariants> {
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import type { Editor } from '@tiptap/react';
3
- import type { toggleVariants } from '@/components/ui/toggle';
3
+ import type { toggleVariants } from '../../../../../components/ui/toggle';
4
4
  import type { VariantProps } from 'class-variance-authority';
5
5
  type ListItemAction = 'orderedList' | 'bulletList';
6
6
  interface SectionFourProps extends VariantProps<typeof toggleVariants> {
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import type { Editor } from '@tiptap/react';
3
- import type { toggleVariants } from '@/components/ui/toggle';
3
+ import type { toggleVariants } from '../../../../../components/ui/toggle';
4
4
  import type { VariantProps } from 'class-variance-authority';
5
5
  interface SectionMailingPlaceholderProps extends VariantProps<typeof toggleVariants> {
6
6
  editor: Editor;
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import type { Editor } from '@tiptap/react';
3
3
  import type { Level } from '@tiptap/extension-heading';
4
4
  import type { VariantProps } from 'class-variance-authority';
5
- import type { toggleVariants } from '@/components/ui/toggle';
5
+ import type { toggleVariants } from '../../../../../components/ui/toggle';
6
6
  interface SectionOneProps extends VariantProps<typeof toggleVariants> {
7
7
  editor: Editor;
8
8
  activeLevels?: Level[];
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import type { Editor } from '@tiptap/react';
3
- import type { toggleVariants } from '@/components/ui/toggle';
3
+ import type { toggleVariants } from '../../../../../components/ui/toggle';
4
4
  import type { VariantProps } from 'class-variance-authority';
5
5
  interface SectionThreeProps extends VariantProps<typeof toggleVariants> {
6
6
  editor: Editor;
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import type { Editor } from '@tiptap/react';
3
- import type { toggleVariants } from '@/components/ui/toggle';
3
+ import type { toggleVariants } from '../../../../../components/ui/toggle';
4
4
  import type { VariantProps } from 'class-variance-authority';
5
5
  type TextStyleAction = 'bold' | 'italic' | 'underline' | 'strikethrough' | 'code' | 'clearFormatting';
6
6
  interface SectionTwoProps extends VariantProps<typeof toggleVariants> {
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import type { TooltipContentProps } from '@radix-ui/react-tooltip';
3
- import { Toggle } from '@/components/ui/toggle';
3
+ import { Toggle } from '../../../../components/ui/toggle';
4
4
  interface ToolbarButtonProps extends React.ComponentPropsWithoutRef<typeof Toggle> {
5
5
  isActive?: boolean;
6
6
  tooltip?: string;
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import type { Editor } from '@tiptap/react';
3
3
  import type { FormatAction } from '../types';
4
4
  import type { VariantProps } from 'class-variance-authority';
5
- import type { toggleVariants } from '@/components/ui/toggle';
5
+ import type { toggleVariants } from '../../../../components/ui/toggle';
6
6
  interface ToolbarSectionProps extends VariantProps<typeof toggleVariants> {
7
7
  editor: Editor;
8
8
  actions: FormatAction[];
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { VariantProps } from 'class-variance-authority';
3
- import { TooltipContent } from '@/components/ui/tooltip';
3
+ import { TooltipContent } from '../../../components/ui/tooltip';
4
4
  type SidebarContext = {
5
5
  state: 'expanded' | 'collapsed';
6
6
  open: boolean;
@@ -22,7 +22,7 @@ declare const Sidebar: React.ForwardRefExoticComponent<Omit<React.ClassAttribute
22
22
  variant?: "sidebar" | "floating" | "inset";
23
23
  collapsible?: "offcanvas" | "icon" | "none";
24
24
  }, "ref"> & React.RefAttributes<HTMLDivElement>>;
25
- declare const SidebarTrigger: React.ForwardRefExoticComponent<Omit<import("@/components/ui/button").ButtonProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
25
+ declare const SidebarTrigger: React.ForwardRefExoticComponent<Omit<import("../../../components/ui/button").ButtonProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
26
26
  declare const SidebarRail: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
27
27
  declare const SidebarInset: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
28
28
  declare const SidebarInput: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import type { ToastActionElement, ToastProps } from '@/components/ui/toast';
2
+ import type { ToastActionElement, ToastProps } from '../../components/ui/toast';
3
3
  type ToasterToast = ToastProps & {
4
4
  id: string;
5
5
  title?: React.ReactNode;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tumaet/prompt-ui-components",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/ls1intum/prompt-lib.git"
@@ -21,7 +21,7 @@
21
21
  "src/index.css"
22
22
  ],
23
23
  "scripts": {
24
- "build:esm": "tsc --project tsconfig.json",
24
+ "build:esm": "tsc --project tsconfig.json && tsc-alias",
25
25
  "build:css": "postcss src/index.css -o dist/index.css",
26
26
  "build": "yarn build:esm && yarn build:css",
27
27
  "lint": "eslint \"**/*.{js,jsx,ts,tsx}\""
@@ -84,6 +84,7 @@
84
84
  "recharts": "^2.15.3",
85
85
  "sonner": "^2.0.3",
86
86
  "tailwind-merge": "^2.5.4",
87
+ "tsc-alias": "^1.8.15",
87
88
  "typescript": "^5.7.3"
88
89
  },
89
90
  "devDependencies": {
@@ -1,16 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useMemo } from 'react';
3
- import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from '@/components/ui/table';
4
- import { AlignLeft, CheckSquare } from 'lucide-react';
5
- import { Badge } from './ui/badge';
6
- export const ExportedApplicationAnswerTable = ({ applicationAnswers, }) => {
7
- const orderedAnswers = useMemo(() => {
8
- if (!applicationAnswers)
9
- return [];
10
- return applicationAnswers?.sort((a, b) => a.orderNum - b.orderNum);
11
- }, [applicationAnswers]);
12
- return (_jsx("div", { className: 'overflow-x-auto', children: _jsxs(Table, { children: [_jsx(TableHeader, { children: _jsxs(TableRow, { children: [_jsx(TableHead, { className: 'w-1/12', children: "Type" }), _jsx(TableHead, { className: 'w-1/5', children: "Key" }), _jsx(TableHead, { children: "Answer" })] }) }), _jsx(TableBody, { children: orderedAnswers.map((answer, index) => {
13
- return (_jsxs(TableRow, { className: index % 2 === 0 ? 'bg-muted/50' : '', children: [_jsx(TableCell, { children: answer.type === 'multiselect' ? (_jsx(CheckSquare, { className: 'h-4 w-4 text-muted-foreground' })) : (_jsx(AlignLeft, { className: 'h-4 w-4 text-muted-foreground' })) }), _jsx(TableCell, { className: 'font-medium', children: _jsx("div", { className: 'flex items-center space-x-2', children: _jsx("span", { children: answer.key }) }) }), _jsx(TableCell, { children: Array.isArray(answer.answer) ? (_jsx("div", { children: answer.answer.map((item, idx) => (_jsx(Badge, { className: 'mr-1', children: item }, idx))) })) : (_jsx("p", { className: 'whitespace-pre-wrap break-words', children: answer.answer })) })] }, answer.key));
14
- }) })] }) }));
15
- };
16
- //# sourceMappingURL=ExportedApplicationAnswerTable.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ExportedApplicationAnswerTable.js","sourceRoot":"","sources":["../../src/components/ExportedApplicationAnswerTable.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAC/B,OAAO,EACL,KAAK,EACL,SAAS,EACT,SAAS,EACT,SAAS,EACT,WAAW,EACX,QAAQ,GACT,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAMlC,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,EAC7C,kBAAkB,GACkB,EAAE,EAAE;IACxC,MAAM,cAAc,GAAG,OAAO,CAAC,GAAG,EAAE;QAClC,IAAI,CAAC,kBAAkB;YAAE,OAAO,EAAE,CAAA;QAClC,OAAO,kBAAkB,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAA;IACpE,CAAC,EAAE,CAAC,kBAAkB,CAAC,CAAC,CAAA;IAExB,OAAO,CACL,cAAK,SAAS,EAAC,iBAAiB,YAC9B,MAAC,KAAK,eACJ,KAAC,WAAW,cACV,MAAC,QAAQ,eACP,KAAC,SAAS,IAAC,SAAS,EAAC,QAAQ,qBAAiB,EAC9C,KAAC,SAAS,IAAC,SAAS,EAAC,OAAO,oBAAgB,EAC5C,KAAC,SAAS,yBAAmB,IACpB,GACC,EACd,KAAC,SAAS,cACP,cAAc,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;wBACpC,OAAO,CACL,MAAC,QAAQ,IAAkB,SAAS,EAAE,KAAK,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,aACxE,KAAC,SAAS,cACP,MAAM,CAAC,IAAI,KAAK,aAAa,CAAC,CAAC,CAAC,CAC/B,KAAC,WAAW,IAAC,SAAS,EAAC,+BAA+B,GAAG,CAC1D,CAAC,CAAC,CAAC,CACF,KAAC,SAAS,IAAC,SAAS,EAAC,+BAA+B,GAAG,CACxD,GACS,EAEZ,KAAC,SAAS,IAAC,SAAS,EAAC,aAAa,YAChC,cAAK,SAAS,EAAC,6BAA6B,YAC1C,yBAAO,MAAM,CAAC,GAAG,GAAQ,GACrB,GACI,EACZ,KAAC,SAAS,cACP,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAC9B,wBACG,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC,CAChC,KAAC,KAAK,IAAW,SAAS,EAAC,MAAM,YAC9B,IAAI,IADK,GAAG,CAEP,CACT,CAAC,GACE,CACP,CAAC,CAAC,CAAC,CACF,YAAG,SAAS,EAAC,iCAAiC,YAAE,MAAM,CAAC,MAAM,GAAK,CACnE,GACS,KA1BC,MAAM,CAAC,GAAG,CA2Bd,CACZ,CAAA;oBACH,CAAC,CAAC,GACQ,IACN,GACJ,CACP,CAAA;AACH,CAAC,CAAA"}
@@ -1,12 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { Alert, AlertDescription, AlertTitle } from '@/components/ui/alert';
3
- import { Button } from '@/components/ui/button';
4
- import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
5
- import { AlertTriangle } from 'lucide-react';
6
- import { useNavigate } from 'react-router-dom';
7
- export const MissingConfig = ({ elements }) => {
8
- const navigate = useNavigate();
9
- return (_jsx(_Fragment, { children: elements.length > 0 && (_jsxs(Card, { className: 'mb-6 border-l-4 border-l-yellow-400', children: [_jsx(CardHeader, { children: _jsxs(CardTitle, { className: 'flex items-center', children: [_jsx(AlertTriangle, { className: 'mr-2 text-yellow-500' }), "Missing Configurations"] }) }), _jsx(CardContent, { children: _jsx("div", { className: 'space-y-2', children: elements.map((config) => (_jsxs(Alert, { className: 'flex items-start', children: [_jsx("div", { className: 'flex-grow', children: _jsxs("div", { className: 'flex items-center', children: [_jsx(config.icon, { className: 'h-4 w-4 text-yellow-500 mr-2 mt-1' }), _jsxs("div", { children: [_jsxs(AlertTitle, { className: 'mb-1', children: ["Missing: ", config.title] }), _jsx(AlertDescription, { children: config.description ||
10
- `Please configure the ${config.title.toLowerCase()} to ensure proper functionality.` })] })] }) }), config.hide && (_jsx(Button, { variant: 'outline', size: 'sm', onClick: config.hide, className: 'ml-4 mt-1 whitespace-nowrap', children: "Hide Warning" })), _jsx(Button, { variant: 'outline', size: 'sm', onClick: () => navigate(config.link), className: 'ml-4 mt-1 whitespace-nowrap', children: "Configure" })] }, config.title))) }) })] })) }));
11
- };
12
- //# sourceMappingURL=MissingConfig.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MissingConfig.js","sourceRoot":"","sources":["../../src/components/MissingConfig.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAC3E,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAC/C,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAC/E,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAE5C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAc9C,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,EAAE,QAAQ,EAAsB,EAAe,EAAE;IAC7E,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAA;IAE9B,OAAO,CACL,4BACG,QAAQ,CAAC,MAAM,GAAG,CAAC,IAAI,CACtB,MAAC,IAAI,IAAC,SAAS,EAAC,qCAAqC,aACnD,KAAC,UAAU,cACT,MAAC,SAAS,IAAC,SAAS,EAAC,mBAAmB,aACtC,KAAC,aAAa,IAAC,SAAS,EAAC,sBAAsB,GAAG,8BAExC,GACD,EACb,KAAC,WAAW,cACV,cAAK,SAAS,EAAC,WAAW,YACvB,QAAQ,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CACxB,MAAC,KAAK,IAAoB,SAAS,EAAC,kBAAkB,aACpD,cAAK,SAAS,EAAC,WAAW,YACxB,eAAK,SAAS,EAAC,mBAAmB,aAChC,KAAC,MAAM,CAAC,IAAI,IAAC,SAAS,EAAC,mCAAmC,GAAG,EAC7D,0BACE,MAAC,UAAU,IAAC,SAAS,EAAC,MAAM,0BAAW,MAAM,CAAC,KAAK,IAAc,EACjE,KAAC,gBAAgB,cACd,MAAM,CAAC,WAAW;4DACjB,wBAAwB,MAAM,CAAC,KAAK,CAAC,WAAW,EAAE,kCAAkC,GACrE,IACf,IACF,GACF,EACL,MAAM,CAAC,IAAI,IAAI,CACd,KAAC,MAAM,IACL,OAAO,EAAC,SAAS,EACjB,IAAI,EAAC,IAAI,EACT,OAAO,EAAE,MAAM,CAAC,IAAI,EACpB,SAAS,EAAC,6BAA6B,6BAGhC,CACV,EACD,KAAC,MAAM,IACL,OAAO,EAAC,SAAS,EACjB,IAAI,EAAC,IAAI,EACT,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,EACpC,SAAS,EAAC,6BAA6B,0BAGhC,KA9BC,MAAM,CAAC,KAAK,CA+BhB,CACT,CAAC,GACE,GACM,IACT,CACR,GACA,CACJ,CAAA;AACH,CAAC,CAAA"}
@@ -1,14 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { getGenderString, getStudyDegreeString, } from '@tumaet/prompt-shared-state';
3
- import { Mail, Flag, Book, GraduationCap, Calendar, Hash, Users, KeyRound } from 'lucide-react';
4
- import { Card, CardContent, CardHeader } from '@/components/ui/card';
5
- import { Avatar, AvatarFallback } from '@/components/ui/avatar';
6
- import { getCountryName } from '@/lib/getCountries';
7
- import translations from '@/lib/translations.json';
8
- import { AvatarImage } from '@radix-ui/react-avatar';
9
- import { getGravatarUrl } from '@/lib/getGravatarUrl';
10
- import { getStatusColor } from '@/lib/getStatusColor';
11
- export const StudentProfile = ({ student, status }) => {
12
- return (_jsxs(Card, { className: 'relative overflow-hidden', children: [_jsx("div", { className: `h-16 ${getStatusColor(status)}` }), _jsx("div", { className: 'mb-4', children: _jsxs(Avatar, { className: 'absolute w-24 h-24 border-4 border-background rounded-full transform left-3 -translate-y-1/2', children: [_jsx(AvatarImage, { src: getGravatarUrl(student.email), alt: student.lastName }), _jsxs(AvatarFallback, { className: 'rounded-lg font-bold text-lg', children: [student.firstName[0], student.lastName[0]] })] }) }), _jsx(CardHeader, { children: _jsx("div", { className: 'flex flex-col sm:flex-row items-center', children: _jsxs("div", { className: 'flex-1 text-center sm:text-left', children: [_jsx("div", { className: 'flex flex-col items-center sm:items-start pt-6', children: _jsxs("h1", { className: 'text-2xl font-bold', children: [student.firstName, " ", student.lastName] }) }), _jsxs("div", { className: 'mt-2 grid grid-cols-1 sm:grid-cols-2 gap-2 text-sm text-muted-foreground', children: [_jsxs("div", { className: 'space-y-1', children: [_jsxs("p", { className: 'flex items-center justify-center sm:justify-start', children: [_jsx(Mail, { className: 'w-4 h-4 mr-2' }), _jsx("span", { className: 'truncate', children: student.email })] }), student.nationality && (_jsxs("p", { className: 'flex items-center justify-center sm:justify-start', children: [_jsx(Flag, { className: 'w-4 h-4 mr-2' }), getCountryName(student.nationality)] })), student.gender && (_jsxs("p", { className: 'flex items-center justify-center sm:justify-start', children: [_jsx(Users, { className: 'w-4 h-4 mr-2' }), getGenderString(student.gender)] }))] }), _jsxs("div", { className: 'space-y-1', children: [student.universityLogin && (_jsxs("p", { className: 'flex items-center justify-center sm:justify-start', children: [_jsx(KeyRound, { className: 'w-4 h-4 mr-2' }), _jsxs("strong", { className: 'mr-1', children: [translations.university['login-name'], ":"] }), student.universityLogin] })), student.matriculationNumber && (_jsxs("p", { className: 'flex items-center justify-center sm:justify-start', children: [_jsx(Hash, { className: 'w-4 h-4 mr-2' }), _jsx("strong", { className: 'mr-1', children: "Matriculation:" }), student.matriculationNumber] }))] })] })] }) }) }), _jsx(CardContent, { children: _jsxs("div", { className: 'grid grid-cols-1 sm:grid-cols-3 gap-4 text-sm', children: [_jsxs("div", { className: 'flex items-center', children: [_jsx(Book, { className: 'w-5 h-5 mr-2 text-primary' }), _jsx("strong", { className: 'mr-2', children: "Program:" }), _jsx("span", { className: 'text-muted-foreground', children: student.studyProgram || 'N/A' })] }), _jsxs("div", { className: 'flex items-center', children: [_jsx(GraduationCap, { className: 'w-5 h-5 mr-2 text-primary' }), _jsx("strong", { className: 'mr-2', children: "Degree:" }), _jsx("span", { className: 'text-muted-foreground', children: getStudyDegreeString(student.studyDegree) || 'N/A' })] }), _jsxs("div", { className: 'flex items-center', children: [_jsx(Calendar, { className: 'w-5 h-5 mr-2 text-primary' }), _jsx("strong", { className: 'mr-2', children: "Semester:" }), _jsx("span", { className: 'text-muted-foreground', children: student.currentSemester || 'N/A' })] })] }) })] }));
13
- };
14
- //# sourceMappingURL=StudentProfile.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"StudentProfile.js","sourceRoot":"","sources":["../../src/components/StudentProfile.tsx"],"names":[],"mappings":";AACA,OAAO,EAGL,eAAe,EACf,oBAAoB,GACrB,MAAM,6BAA6B,CAAA;AACpC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAC/F,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACpE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACnD,OAAO,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BAAmB,aAChC,KAAC,QAAQ,IAAC,SAAS,EAAC,2BAA2B,GAAG,EAClD,iBAAQ,SAAS,EAAC,MAAM,0BAAmB,EAC3C,eAAM,SAAS,EAAC,uBAAuB,YAAE,OAAO,CAAC,eAAe,IAAI,KAAK,GAAQ,IAC7E,IACF,GACM,IACT,CACR,CAAA;AACH,CAAC,CAAA"}
@@ -1,10 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Moon, Sun, Monitor } from 'lucide-react';
3
- import { Button } from '@/components/ui/button';
4
- import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from '@/components/ui/dropdown-menu';
5
- import { useDarkMode } from '@/contexts/DarkModeProvider';
6
- export function ThemeToggle() {
7
- const { theme, setTheme } = useDarkMode();
8
- return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(Button, { variant: 'outline', size: 'icon', className: 'w-[120px]', children: [theme === 'light' && _jsx(Sun, { className: 'h-4 w-4' }), theme === 'dark' && _jsx(Moon, { className: 'h-4 w-4' }), theme === 'system' && _jsx(Monitor, { className: 'h-4 w-4' }), _jsx("span", { className: 'ml-2', children: theme?.charAt(0).toUpperCase() + theme?.slice(1) })] }) }), _jsxs(DropdownMenuContent, { align: 'end', children: [_jsxs(DropdownMenuItem, { onClick: () => setTheme('light'), children: [_jsx(Sun, { className: 'mr-2 h-4 w-4' }), _jsx("span", { children: "Light" })] }), _jsxs(DropdownMenuItem, { onClick: () => setTheme('dark'), children: [_jsx(Moon, { className: 'mr-2 h-4 w-4' }), _jsx("span", { children: "Dark" })] }), _jsxs(DropdownMenuItem, { onClick: () => setTheme('system'), children: [_jsx(Monitor, { className: 'mr-2 h-4 w-4' }), _jsx("span", { children: "System" })] })] })] }));
9
- }
10
- //# sourceMappingURL=ThemeToggle.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ThemeToggle.js","sourceRoot":"","sources":["../../src/components/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AAG,EACjC,kCAAiB,IACA,EACnB,MAAC,gBAAgB,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,aACjD,KAAC,OAAO,IAAC,SAAS,EAAC,cAAc,GAAG,EACpC,oCAAmB,IACF,IACC,IACT,CAChB,CAAA;AACH,CAAC"}
@@ -1,71 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { ScrollBar } from '@/components/ui/scroll-area';
3
- import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from '@/components/ui/table';
4
- import { ScrollArea } from '@radix-ui/react-scroll-area';
5
- import { SearchIcon } from 'lucide-react';
6
- import { flexRender, getCoreRowModel, getFilteredRowModel, getSortedRowModel, useReactTable, } from '@tanstack/react-table';
7
- import { useMemo, useState } from 'react';
8
- import { columns as baseColumns } from './components/columns';
9
- import { Input } from '@/components/ui/input';
10
- import { FilterMenu } from './components/FilterMenu';
11
- import { GroupActionsMenu } from './components/GroupActionsMenu';
12
- import { downloadParticipations } from './utils/downloadParticipations';
13
- export const CoursePhaseParticipationsTablePage = ({ participants = [], prevDataKeys = [], restrictedDataKeys = [], studentReadableDataKeys = [], extraData, extraColumnHeader = 'Additional', onClickRowAction, }) => {
14
- const [sorting, setSorting] = useState([{ id: 'lastName', desc: false }]);
15
- const [columnFilters, setColumnFilters] = useState([]);
16
- const [globalFilter, setGlobalFilter] = useState('');
17
- const extraDataMap = useMemo(() => {
18
- if (!extraData)
19
- return new Map();
20
- return new Map(extraData.map((d) => [d.courseParticipationID, d.value]));
21
- }, [extraData]);
22
- const baseCols = useMemo(() => baseColumns({ prevDataKeys, restrictedDataKeys, studentReadableDataKeys }), [prevDataKeys, restrictedDataKeys, studentReadableDataKeys]);
23
- const tableColumns = useMemo(() => {
24
- if (!extraData)
25
- return baseCols;
26
- const extraColumn = {
27
- id: 'extraColumn',
28
- header: extraColumnHeader,
29
- accessorFn: (row) => extraDataMap.get(row.courseParticipationID) ?? '',
30
- enableSorting: false,
31
- enableColumnFilter: false,
32
- meta: {
33
- // hide completely when every cell would be empty
34
- isEmpty: extraData.length === 0,
35
- },
36
- cell: (info) => info.getValue(),
37
- };
38
- return [...baseCols, extraColumn];
39
- }, [baseCols, extraData, extraColumnHeader, extraDataMap]);
40
- const table = useReactTable({
41
- data: participants,
42
- columns: tableColumns,
43
- getCoreRowModel: getCoreRowModel(),
44
- onSortingChange: setSorting,
45
- getSortedRowModel: getSortedRowModel(),
46
- getFilteredRowModel: getFilteredRowModel(),
47
- onColumnFiltersChange: setColumnFilters,
48
- globalFilterFn: (row, columnId, filterValue) => {
49
- const { student } = row.original;
50
- const searchableValues = [
51
- `${student.firstName} ${student.lastName}`.toLowerCase(),
52
- student.email?.toLowerCase(),
53
- student.matriculationNumber?.toString(),
54
- student.universityLogin?.toLowerCase(),
55
- ];
56
- return searchableValues.some((value) => value?.includes(filterValue.toLowerCase()));
57
- },
58
- state: {
59
- sorting,
60
- globalFilter,
61
- columnFilters,
62
- },
63
- });
64
- return (_jsxs("div", { children: [_jsx("div", { className: 'space-y-4 mb-2', children: _jsxs("div", { className: 'flex flex-col sm:flex-row items-start sm:items-center space-y-2 sm:space-y-0 sm:space-x-4', children: [_jsxs("div", { className: 'relative flex-grow max-w-md w-full', children: [_jsx(Input, { placeholder: 'Search participants...', value: globalFilter, onChange: (event) => setGlobalFilter(event.target.value), className: 'pl-10 w-full' }), _jsx(SearchIcon, { className: 'absolute left-3 top-1/2 -translate-y-1/2 h-5 w-5 text-gray-500 dark:text-gray-400' })] }), _jsxs("div", { className: 'flex space-x-2 w-full sm:w-auto', children: [_jsx(FilterMenu, { columnFilters: columnFilters, setColumnFilters: setColumnFilters }), _jsx(GroupActionsMenu, { disabled: table.getSelectedRowModel().rows.length === 0, selectedRows: table.getSelectedRowModel(), onClose: () => table.resetRowSelection(), onExport: () => {
65
- downloadParticipations(table.getSelectedRowModel().rows.map((row) => row.original), prevDataKeys, restrictedDataKeys, studentReadableDataKeys, extraData, extraColumnHeader);
66
- table.resetRowSelection();
67
- } })] })] }) }), _jsx("div", { className: 'rounded-md border', children: _jsxs(ScrollArea, { className: 'h-[calc(100vh-200px)] overflow-x-scroll', children: [_jsxs(Table, { className: 'table-auto min-w-full w-full relative', children: [_jsx(TableHeader, { className: 'bg-muted/100 sticky top-0 z-10', children: table.getHeaderGroups().map((headerGroup) => (_jsx(TableRow, { children: headerGroup.headers.map((header) => (_jsx(TableHead, { className: 'whitespace-nowrap', children: header.isPlaceholder
68
- ? null
69
- : flexRender(header.column.columnDef.header, header.getContext()) }, header.id))) }, headerGroup.id))) }), _jsx(TableBody, { children: table.getRowModel().rows?.length ? (table.getRowModel().rows.map((row) => (_jsx(TableRow, { "data-state": row.getIsSelected() && 'selected', onClick: () => onClickRowAction && onClickRowAction(row.original), className: onClickRowAction ? 'cursor-pointer' : '', children: row.getVisibleCells().map((cell) => (_jsx(TableCell, { children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id))) }, row.id)))) : (_jsx(TableRow, { children: _jsx(TableCell, { colSpan: tableColumns.length, className: 'h-24 text-center', children: "No results." }) })) })] }), _jsx(ScrollBar, { orientation: 'horizontal' })] }) })] }));
70
- };
71
- //# sourceMappingURL=CoursePhaseParticipationsTablePage.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CoursePhaseParticipationsTablePage.js","sourceRoot":"","sources":["../../../../src/components/pages/CoursePhaseParticpationsTable/CoursePhaseParticipationsTablePage.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAA;AACvD,OAAO,EACL,KAAK,EACL,SAAS,EACT,SAAS,EACT,SAAS,EACT,WAAW,EACX,QAAQ,GACT,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC,OAAO,EAGL,UAAU,EACV,eAAe,EACf,mBA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B,CAAC,CAAC,CAAC,EAAE,YAElD,GAAG,CAAC,eAAe,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACnC,KAAC,SAAS,cACP,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,IAD5C,IAAI,CAAC,EAAE,CAEX,CACb,CAAC,IATG,GAAG,CAAC,EAAE,CAUF,CACZ,CAAC,CACH,CAAC,CAAC,CAAC,CACF,KAAC,QAAQ,cACP,KAAC,SAAS,IAAC,OAAO,EAAE,YAAY,CAAC,MAAM,EAAE,SAAS,EAAC,kBAAkB,4BAEzD,GACH,CACZ,GACS,IACN,EACR,KAAC,SAAS,IAAC,WAAW,EAAC,YAAY,GAAG,IAC3B,GACT,IACF,CACP,CAAA;AACH,CAAC,CAAA"}
@@ -1,43 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Button } from '@/components/ui/button';
3
- import { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, } from '@/components/ui/dropdown-menu';
4
- import { PassStatus } from '@tumaet/prompt-shared-state';
5
- import { getStatusBadge } from '@/utils/getStatusBadge';
6
- import { Filter } from 'lucide-react';
7
- export const FilterMenu = ({ columnFilters, setColumnFilters, }) => {
8
- const isSelected = (id, value) => {
9
- return columnFilters.some((filter) => filter.id === id && Array.isArray(filter.value) && filter.value.includes(value));
10
- };
11
- const handleFilterChange = (id, value) => {
12
- setColumnFilters((prevFilters) => {
13
- const existingFilter = prevFilters.find((filter) => filter.id === id);
14
- if (existingFilter && Array.isArray(existingFilter.value)) {
15
- const updatedValue = existingFilter.value.includes(value)
16
- ? existingFilter.value.filter((v) => v !== value) // Remove if exists
17
- : [...existingFilter.value, value]; // Add if not exists
18
- return updatedValue.length > 0
19
- ? prevFilters.map((filter) => filter.id === id ? { ...filter, value: updatedValue } : filter)
20
- : prevFilters.filter((filter) => filter.id !== id); // Remove filter if no values
21
- }
22
- else {
23
- return [...prevFilters, { id, value: [value] }];
24
- }
25
- });
26
- };
27
- const renderFilterItems = (id, items, getDisplay) => {
28
- return Object.values(items).map((value) => {
29
- return (_jsx(DropdownMenuCheckboxItem, { checked: isSelected(id, value), onClick: (e) => {
30
- e.preventDefault();
31
- handleFilterChange(id, value);
32
- }, children: getDisplay(value) }, value));
33
- });
34
- };
35
- const resetFilters = () => {
36
- setColumnFilters([]);
37
- };
38
- return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(Button, { variant: 'outline', className: 'justify-start', children: [_jsx(Filter, { className: 'mr-2 h-4 w-4' }), "Filter"] }) }), _jsxs(DropdownMenuContent, { className: 'w-56', children: [_jsx(DropdownMenuLabel, { children: "Assessment" }), _jsx(DropdownMenuSeparator, {}), renderFilterItems('passStatus', PassStatus, getStatusBadge), _jsx(DropdownMenuSeparator, {}), _jsx("div", { className: 'p-2', children: _jsx(Button, { variant: 'outline', size: 'sm', className: 'w-full justify-center', onClick: (e) => {
39
- e.preventDefault();
40
- resetFilters();
41
- }, disabled: !(columnFilters.length > 0), children: "Clear Filters" }) })] })] }));
42
- };
43
- //# sourceMappingURL=FilterMenu.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FilterMenu.js","sourceRoot":"","sources":["../../../../../src/components/pages/CoursePhaseParticpationsTable/components/FilterMenu.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAC/C,OAAO,EACL,YAAY,EACZ,wBAAwB,EACxB,mBAAmB,EACnB,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,+BAA+B,CAAA;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAEvD,OAAO,EAAE,MA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AC,YAAY,EAAE,UAAU,EAAE,cAAc,CAAC,EAE5D,KAAC,qBAAqB,KAAG,EACzB,cAAK,SAAS,EAAC,KAAK,YAClB,KAAC,MAAM,IACL,OAAO,EAAC,SAAS,EACjB,IAAI,EAAC,IAAI,EACT,SAAS,EAAC,uBAAuB,EACjC,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;gCACb,CAAC,CAAC,cAAc,EAAE,CAAA;gCAClB,YAAY,EAAE,CAAA;4BAChB,CAAC,EACD,QAAQ,EAAE,CAAC,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC,8BAG9B,GACL,IACc,IACT,CAChB,CAAA;AACH,CAAC,CAAA"}
@@ -1,50 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { useState } from 'react';
3
- import { Button } from '@/components/ui/button';
4
- import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, } from '@/components/ui/dropdown-menu';
5
- import { MoreHorizontal, FileDown, CheckCircle, XCircle } from 'lucide-react';
6
- import { ActionDialog } from '@/components/table/GroupActionDialog';
7
- import { PassStatus } from '@tumaet/prompt-shared-state';
8
- import { useUpdateCoursePhaseParticipationBatch } from '@/hooks/useUpdateCoursePhaseParticipationBatch';
9
- import { useParams } from 'react-router-dom';
10
- export const GroupActionsMenu = ({ selectedRows, onClose, onExport, disabled = false, }) => {
11
- const { phaseId } = useParams();
12
- const [isOpen, setIsOpen] = useState(false);
13
- const [dialogState, setDialogState] = useState({ type: null, isOpen: false });
14
- const openDialog = (type) => {
15
- setIsOpen(false);
16
- setDialogState({ type, isOpen: true });
17
- };
18
- const closeDialog = () => setDialogState({ type: null, isOpen: false });
19
- // modifiers
20
- const { mutate: mutateUpdateCoursePhaseParticipations } = useUpdateCoursePhaseParticipationBatch();
21
- const numberOfRowsSelected = selectedRows.rows.length;
22
- return (_jsxs(_Fragment, { children: [_jsxs(DropdownMenu, { open: isOpen, onOpenChange: setIsOpen, children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(Button, { disabled: disabled, children: [_jsx(MoreHorizontal, { className: 'h-4 w-4' }), "Actions"] }) }), _jsxs(DropdownMenuContent, { align: 'end', className: 'w-48', children: [_jsx(DropdownMenuLabel, { children: "Group Actions" }), _jsx(DropdownMenuSeparator, {}), _jsxs(DropdownMenuItem, { onClick: () => openDialog('setPassed'), children: [_jsx(CheckCircle, { className: 'mr-2 h-4 w-4' }), "Set Passed"] }), _jsxs(DropdownMenuItem, { onClick: () => openDialog('setFailed'), children: [_jsx(XCircle, { className: 'mr-2 h-4 w-4' }), "Set Failed"] }), _jsx(DropdownMenuSeparator, {}), _jsxs(DropdownMenuItem, { onClick: onExport, children: [_jsx(FileDown, { className: 'mr-2 h-4 w-4' }), "Export"] })] })] }), dialogState.isOpen && dialogState.type === 'setPassed' && (_jsx(ActionDialog, { title: 'Confirm Set Passed', description: `Are you sure you want to mark ${numberOfRowsSelected} participants as passed?`, confirmLabel: 'Set Passed', isOpen: dialogState.type === 'setPassed' && dialogState.isOpen, onClose: closeDialog, onConfirm: () => {
23
- const mutations = selectedRows.rows.map((row) => {
24
- const update = {
25
- coursePhaseID: phaseId ?? '',
26
- courseParticipationID: row.original.courseParticipationID,
27
- passStatus: PassStatus.PASSED,
28
- restrictedData: {},
29
- studentReadableData: {},
30
- };
31
- return update;
32
- });
33
- mutateUpdateCoursePhaseParticipations(mutations);
34
- onClose();
35
- } })), dialogState.isOpen && dialogState.type === 'setFailed' && (_jsx(ActionDialog, { title: 'Confirm Set Failed', description: `Are you sure you want to mark ${numberOfRowsSelected} participants as failed?`, confirmLabel: 'Set Failed', isOpen: dialogState.type === 'setFailed' && dialogState.isOpen, onClose: closeDialog, onConfirm: () => {
36
- const mutations = selectedRows.rows.map((row) => {
37
- const update = {
38
- coursePhaseID: phaseId ?? '',
39
- courseParticipationID: row.original.courseParticipationID,
40
- passStatus: PassStatus.FAILED,
41
- restrictedData: {},
42
- studentReadableData: {},
43
- };
44
- return update;
45
- });
46
- mutateUpdateCoursePhaseParticipations(mutations);
47
- onClose();
48
- } }))] }));
49
- };
50
- //# sourceMappingURL=GroupActionsMenu.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GroupActionsMenu.js","sourceRoot":"","sources":["../../../../../src/components/pages/CoursePhaseParticpationsTable/components/GroupActionsMenu.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAC/C,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,+BAA+B,CAAA;AACtC,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAC7E,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAA;AAEnE,OAAO,EAAuC,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAC7F,OAAO,EAAE,sCAAsC,EAAE,MAAM,gDAAgD,CAAA;AAEvG,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAS5C,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,EAC/B,YAAY,EACZ,OAAO,EACP,QAAQ,EACR,QAAQ,GAAG,KAAK,GACM,EAAe,EAAE;IACvC,MAAM,EAAE,OAAO,EAAE,GAAG,SAAS,EAAuB,CAAA;IACpD,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IAC3C,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAG3C,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAA;IAEjC,MAAM,UAAU,GAAG,CAAC,IAA+B,EAAE,E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