@hydralms/components 0.2.0 → 0.3.1

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 (302) hide show
  1. package/dist/StudentProfile-BPsZBaJj.cjs +1 -0
  2. package/dist/StudentProfile-Cw2p-RZn.js +3273 -0
  3. package/dist/assessment-toolbar/question-navigator.d.ts +1 -1
  4. package/dist/assessment-toolbar/timer-display.d.ts +1 -1
  5. package/dist/common/index.d.ts +2 -1
  6. package/dist/common/pagination.d.ts +26 -0
  7. package/dist/common/types.d.ts +1 -0
  8. package/dist/components.css +1 -1
  9. package/dist/content/audio-player.d.ts +22 -0
  10. package/dist/content/code-block.d.ts +30 -0
  11. package/dist/content/embed-block.d.ts +28 -0
  12. package/dist/content/index.d.ts +6 -0
  13. package/dist/content/types.d.ts +24 -0
  14. package/dist/curriculum/course-card.d.ts +51 -0
  15. package/dist/curriculum/index.d.ts +2 -0
  16. package/dist/curriculum/types.d.ts +2 -2
  17. package/dist/index.cjs +1 -1
  18. package/dist/index.d.ts +1 -0
  19. package/dist/index.js +495 -439
  20. package/dist/license/HydraContext.d.ts +16 -0
  21. package/dist/license/ProBadge.d.ts +6 -0
  22. package/dist/license/index.d.ts +7 -0
  23. package/dist/license/tiers.d.ts +6 -0
  24. package/dist/license/useHydraLicense.d.ts +6 -0
  25. package/dist/license/validate.d.ts +13 -0
  26. package/dist/license/withProGate.d.ts +6 -0
  27. package/dist/modules/AssignmentModule/AssignmentModule.d.ts +4 -7
  28. package/dist/modules/AssignmentModule/types.d.ts +5 -1
  29. package/dist/modules/CertificateModule/CertificateModule.d.ts +4 -8
  30. package/dist/modules/CertificateModule/types.d.ts +6 -4
  31. package/dist/modules/CourseCatalogModule/CourseCatalogModule.d.ts +5 -0
  32. package/dist/modules/CourseCatalogModule/types.d.ts +43 -0
  33. package/dist/modules/CoursePlayer/CoursePlayer.d.ts +4 -1
  34. package/dist/modules/DiscussionModule/DiscussionModule.d.ts +4 -7
  35. package/dist/modules/ExamModule/ExamModule.d.ts +4 -7
  36. package/dist/modules/ExamModule/types.d.ts +5 -14
  37. package/dist/modules/FlashcardLab/FlashcardLab.d.ts +4 -1
  38. package/dist/modules/FlashcardLab/types.d.ts +2 -0
  39. package/dist/modules/GradeCenterModule/GradeCenterModule.d.ts +4 -8
  40. package/dist/modules/GradeCenterModule/types.d.ts +2 -0
  41. package/dist/modules/QuizModule/QuizModule.d.ts +4 -1
  42. package/dist/modules/QuizModule/types.d.ts +5 -14
  43. package/dist/modules/StudentDashboardModule/StudentDashboardModule.d.ts +5 -0
  44. package/dist/modules/StudentDashboardModule/types.d.ts +54 -0
  45. package/dist/modules/StudentProfileModule/StudentProfileModule.d.ts +5 -0
  46. package/dist/modules/StudentProfileModule/types.d.ts +43 -0
  47. package/dist/modules/SurveyModule/SurveyModule.d.ts +4 -6
  48. package/dist/modules/SurveyModule/types.d.ts +2 -0
  49. package/dist/modules/_shared/assessment-intro.d.ts +16 -0
  50. package/dist/modules/_shared/assessment-results.d.ts +23 -0
  51. package/dist/modules/_shared/types.d.ts +10 -0
  52. package/dist/modules/_shared/use-timer.d.ts +9 -0
  53. package/dist/modules/index.d.ts +6 -0
  54. package/dist/modules.cjs +1 -1
  55. package/dist/modules.js +1267 -854
  56. package/dist/progress/types.d.ts +2 -0
  57. package/dist/provider/HydraProvider.d.ts +5 -1
  58. package/dist/questions/choice.d.ts +1 -1
  59. package/dist/questions/confidence-indicator.d.ts +37 -0
  60. package/dist/questions/essay.d.ts +1 -1
  61. package/dist/questions/fill-in-the-blank.d.ts +1 -1
  62. package/dist/questions/hotspot.d.ts +1 -1
  63. package/dist/questions/index.d.ts +2 -0
  64. package/dist/questions/inline-choice.d.ts +1 -1
  65. package/dist/questions/matching.d.ts +1 -1
  66. package/dist/questions/multiple-choice.d.ts +1 -1
  67. package/dist/questions/numeric.d.ts +1 -1
  68. package/dist/questions/ordering.d.ts +1 -1
  69. package/dist/questions/question-renderer.d.ts +1 -1
  70. package/dist/questions/scenario.d.ts +1 -1
  71. package/dist/questions/spreadsheet.d.ts +1 -1
  72. package/dist/questions/true-false.d.ts +1 -1
  73. package/dist/sections/AdaptiveLearningPath/AdaptiveLearningPath.d.ts +5 -0
  74. package/dist/sections/AdaptiveLearningPath/path-connector.d.ts +8 -0
  75. package/dist/sections/AdaptiveLearningPath/path-milestone-marker.d.ts +7 -0
  76. package/dist/sections/AdaptiveLearningPath/path-node-card.d.ts +10 -0
  77. package/dist/sections/AdaptiveLearningPath/path-skill-bar.d.ts +8 -0
  78. package/dist/sections/AdaptiveLearningPath/types.d.ts +136 -0
  79. package/dist/sections/AnnouncementFeed/AnnouncementFeed.d.ts +1 -1
  80. package/dist/sections/AnnouncementFeed/types.d.ts +15 -1
  81. package/dist/sections/AssessmentReview/AssessmentReview.d.ts +1 -1
  82. package/dist/sections/AssessmentReview/types.d.ts +6 -0
  83. package/dist/sections/AssignmentSubmission/AssignmentSubmission.d.ts +1 -1
  84. package/dist/sections/AssignmentSubmission/types.d.ts +6 -0
  85. package/dist/sections/CertificateViewer/CertificateViewer.d.ts +1 -1
  86. package/dist/sections/CertificateViewer/certificate-variants.d.ts +42 -0
  87. package/dist/sections/CertificateViewer/types.d.ts +6 -0
  88. package/dist/sections/ContentAuthoringStudio/ContentAuthoringStudio.d.ts +5 -0
  89. package/dist/sections/ContentAuthoringStudio/block-editor-item.d.ts +14 -0
  90. package/dist/sections/ContentAuthoringStudio/block-type-picker.d.ts +12 -0
  91. package/dist/sections/ContentAuthoringStudio/types.d.ts +67 -0
  92. package/dist/sections/CourseCatalog/CourseCatalog.d.ts +2 -0
  93. package/dist/sections/CourseCatalog/types.d.ts +80 -0
  94. package/dist/sections/CourseOutline/CourseOutline.d.ts +1 -1
  95. package/dist/sections/CourseOutline/types.d.ts +6 -0
  96. package/dist/sections/DiscussionThread/DiscussionThread.d.ts +1 -1
  97. package/dist/sections/DiscussionThread/types.d.ts +6 -0
  98. package/dist/sections/EnrollmentWizard/EnrollmentWizard.d.ts +2 -0
  99. package/dist/sections/EnrollmentWizard/types.d.ts +66 -0
  100. package/dist/sections/ExamSession/ExamSession.d.ts +1 -1
  101. package/dist/sections/ExamSession/types.d.ts +6 -0
  102. package/dist/sections/FlashcardStudySession/FlashcardStudySession.d.ts +1 -1
  103. package/dist/sections/FlashcardStudySession/types.d.ts +6 -0
  104. package/dist/sections/ForumBoard/ForumBoard.d.ts +1 -1
  105. package/dist/sections/ForumBoard/types.d.ts +14 -0
  106. package/dist/sections/GradebookTable/GradebookTable.d.ts +1 -1
  107. package/dist/sections/GradebookTable/types.d.ts +14 -0
  108. package/dist/sections/LecturePlayer/LecturePlayer.d.ts +1 -1
  109. package/dist/sections/LecturePlayer/types.d.ts +8 -0
  110. package/dist/sections/LessonPage/LessonPage.d.ts +1 -1
  111. package/dist/sections/LessonPage/types.d.ts +6 -0
  112. package/dist/sections/PracticeQuiz/PracticeQuiz.d.ts +1 -1
  113. package/dist/sections/PracticeQuiz/types.d.ts +6 -0
  114. package/dist/sections/ProgressDashboard/ProgressDashboard.d.ts +1 -1
  115. package/dist/sections/ProgressDashboard/types.d.ts +6 -0
  116. package/dist/sections/QuizSession/QuizSession.d.ts +1 -1
  117. package/dist/sections/QuizSession/types.d.ts +6 -0
  118. package/dist/sections/RequirementsChecklist/RequirementsChecklist.d.ts +1 -1
  119. package/dist/sections/RequirementsChecklist/types.d.ts +6 -0
  120. package/dist/sections/ResourceLibrary/ResourceLibrary.d.ts +1 -1
  121. package/dist/sections/ResourceLibrary/types.d.ts +15 -1
  122. package/dist/sections/RubricView/RubricView.d.ts +1 -1
  123. package/dist/sections/RubricView/types.d.ts +6 -0
  124. package/dist/sections/ScrollableQuiz/ScrollableQuiz.d.ts +1 -1
  125. package/dist/sections/ScrollableQuiz/types.d.ts +6 -0
  126. package/dist/sections/StudentProfile/StudentProfile.d.ts +2 -0
  127. package/dist/sections/StudentProfile/types.d.ts +98 -0
  128. package/dist/sections/SurveyForm/SurveyForm.d.ts +1 -1
  129. package/dist/sections/SurveyForm/types.d.ts +6 -0
  130. package/dist/sections/_shared/merge-answers.d.ts +9 -0
  131. package/dist/sections/_shared/section-shell.d.ts +20 -0
  132. package/dist/sections/_shared/use-assessment-session.d.ts +30 -0
  133. package/dist/sections/index.d.ts +10 -0
  134. package/dist/sections.cjs +1 -1
  135. package/dist/sections.js +1361 -307
  136. package/dist/ui/badge.d.ts +1 -1
  137. package/dist/ui/index.d.ts +2 -0
  138. package/dist/ui/progress.d.ts +1 -1
  139. package/dist/ui/rich-text-editor.d.ts +3 -1
  140. package/dist/ui/toast.d.ts +43 -0
  141. package/dist/utils/debounce.d.ts +5 -1
  142. package/dist/utils/pick-palette-color.d.ts +19 -0
  143. package/dist/video/types.d.ts +15 -0
  144. package/dist/video/video-player.d.ts +1 -1
  145. package/dist/withProGate-BJdu1T9Y.cjs +2 -0
  146. package/dist/withProGate-BvFc7Jwy.js +4975 -0
  147. package/package.json +57 -226
  148. package/src/assessment-toolbar/question-navigator.tsx +10 -5
  149. package/src/assessment-toolbar/timer-display.tsx +4 -3
  150. package/src/assessment-toolbar/use-countdown.ts +1 -1
  151. package/src/common/empty-state.tsx +1 -0
  152. package/src/common/index.ts +2 -0
  153. package/src/common/pagination.tsx +135 -0
  154. package/src/common/search-input.tsx +2 -1
  155. package/src/common/types.ts +2 -0
  156. package/src/content/attachment-list.tsx +2 -0
  157. package/src/content/audio-player.tsx +196 -0
  158. package/src/content/code-block.tsx +113 -0
  159. package/src/content/content-block.tsx +64 -0
  160. package/src/content/embed-block.tsx +78 -0
  161. package/src/content/file-upload-zone.tsx +10 -0
  162. package/src/content/index.ts +6 -0
  163. package/src/content/types.ts +5 -0
  164. package/src/curriculum/course-card.tsx +199 -0
  165. package/src/curriculum/curriculum-item.tsx +3 -3
  166. package/src/curriculum/curriculum-tree.tsx +20 -13
  167. package/src/curriculum/index.ts +2 -0
  168. package/src/curriculum/types.ts +2 -2
  169. package/src/flashcards/flashcard.tsx +28 -8
  170. package/src/index.ts +3 -0
  171. package/src/license/HydraContext.tsx +62 -0
  172. package/src/license/ProBadge.tsx +43 -0
  173. package/src/license/index.ts +7 -0
  174. package/src/license/tiers.ts +34 -0
  175. package/src/license/useHydraLicense.ts +10 -0
  176. package/src/license/validate.ts +90 -0
  177. package/src/license/withProGate.tsx +21 -0
  178. package/src/modules/AssignmentModule/AssignmentModule.tsx +17 -8
  179. package/src/modules/AssignmentModule/types.ts +5 -1
  180. package/src/modules/CertificateModule/CertificateModule.tsx +21 -9
  181. package/src/modules/CertificateModule/types.ts +6 -4
  182. package/src/modules/CourseCatalogModule/CourseCatalogModule.tsx +126 -0
  183. package/src/modules/CourseCatalogModule/types.ts +47 -0
  184. package/src/modules/CoursePlayer/CoursePlayer.tsx +39 -22
  185. package/src/modules/DiscussionModule/DiscussionModule.tsx +57 -22
  186. package/src/modules/ExamModule/ExamModule.tsx +64 -198
  187. package/src/modules/ExamModule/types.ts +5 -14
  188. package/src/modules/FlashcardLab/FlashcardLab.tsx +10 -5
  189. package/src/modules/FlashcardLab/types.ts +2 -0
  190. package/src/modules/GradeCenterModule/GradeCenterModule.tsx +7 -2
  191. package/src/modules/GradeCenterModule/types.ts +2 -0
  192. package/src/modules/QuizModule/QuizModule.tsx +49 -169
  193. package/src/modules/QuizModule/types.ts +5 -15
  194. package/src/modules/StudentDashboardModule/StudentDashboardModule.tsx +117 -0
  195. package/src/modules/StudentDashboardModule/types.ts +56 -0
  196. package/src/modules/StudentProfileModule/StudentProfileModule.tsx +289 -0
  197. package/src/modules/StudentProfileModule/types.ts +45 -0
  198. package/src/modules/SurveyModule/SurveyModule.tsx +9 -4
  199. package/src/modules/SurveyModule/types.ts +2 -0
  200. package/src/modules/_shared/assessment-intro.tsx +75 -0
  201. package/src/modules/_shared/assessment-results.tsx +133 -0
  202. package/src/modules/_shared/types.ts +11 -0
  203. package/src/modules/_shared/use-timer.ts +49 -0
  204. package/src/modules/index.ts +9 -0
  205. package/src/progress/achievement-badge.tsx +3 -3
  206. package/src/progress/grade-indicator.tsx +9 -1
  207. package/src/progress/progress-ring.tsx +2 -1
  208. package/src/progress/stat-card.tsx +14 -2
  209. package/src/progress/types.ts +2 -0
  210. package/src/provider/HydraProvider.tsx +15 -6
  211. package/src/questions/choice.tsx +13 -6
  212. package/src/questions/confidence-indicator.tsx +107 -0
  213. package/src/questions/essay.tsx +6 -4
  214. package/src/questions/fill-in-the-blank.tsx +8 -4
  215. package/src/questions/hotspot.tsx +4 -4
  216. package/src/questions/index.ts +2 -0
  217. package/src/questions/inline-choice.tsx +5 -4
  218. package/src/questions/matching.tsx +5 -4
  219. package/src/questions/multiple-choice.tsx +13 -6
  220. package/src/questions/numeric.tsx +8 -4
  221. package/src/questions/ordering.tsx +12 -4
  222. package/src/questions/question-renderer.tsx +3 -2
  223. package/src/questions/scenario.tsx +4 -4
  224. package/src/questions/spreadsheet.tsx +5 -4
  225. package/src/questions/true-false.tsx +13 -6
  226. package/src/sections/AdaptiveLearningPath/AdaptiveLearningPath.tsx +251 -0
  227. package/src/sections/AdaptiveLearningPath/path-connector.tsx +27 -0
  228. package/src/sections/AdaptiveLearningPath/path-milestone-marker.tsx +50 -0
  229. package/src/sections/AdaptiveLearningPath/path-node-card.tsx +166 -0
  230. package/src/sections/AdaptiveLearningPath/path-skill-bar.tsx +49 -0
  231. package/src/sections/AdaptiveLearningPath/types.ts +159 -0
  232. package/src/sections/AnnouncementFeed/AnnouncementFeed.tsx +64 -8
  233. package/src/sections/AnnouncementFeed/types.ts +15 -1
  234. package/src/sections/AssessmentReview/AssessmentReview.tsx +37 -0
  235. package/src/sections/AssessmentReview/types.ts +6 -0
  236. package/src/sections/AssignmentSubmission/AssignmentSubmission.tsx +37 -1
  237. package/src/sections/AssignmentSubmission/types.ts +6 -0
  238. package/src/sections/CertificateViewer/CertificateViewer.tsx +29 -227
  239. package/src/sections/CertificateViewer/certificate-variants.tsx +170 -0
  240. package/src/sections/CertificateViewer/types.ts +6 -0
  241. package/src/sections/ContentAuthoringStudio/ContentAuthoringStudio.tsx +289 -0
  242. package/src/sections/ContentAuthoringStudio/block-editor-item.tsx +487 -0
  243. package/src/sections/ContentAuthoringStudio/block-type-picker.tsx +123 -0
  244. package/src/sections/ContentAuthoringStudio/types.ts +67 -0
  245. package/src/sections/CourseCatalog/CourseCatalog.tsx +220 -0
  246. package/src/sections/CourseCatalog/types.ts +76 -0
  247. package/src/sections/CourseOutline/CourseOutline.tsx +41 -0
  248. package/src/sections/CourseOutline/types.ts +6 -0
  249. package/src/sections/DiscussionThread/DiscussionThread.tsx +42 -1
  250. package/src/sections/DiscussionThread/types.ts +6 -0
  251. package/src/sections/EnrollmentWizard/EnrollmentWizard.tsx +343 -0
  252. package/src/sections/EnrollmentWizard/types.ts +65 -0
  253. package/src/sections/ExamSession/ExamSession.tsx +100 -94
  254. package/src/sections/ExamSession/types.ts +6 -0
  255. package/src/sections/FlashcardStudySession/FlashcardStudySession.tsx +53 -36
  256. package/src/sections/FlashcardStudySession/types.ts +6 -0
  257. package/src/sections/ForumBoard/ForumBoard.tsx +67 -7
  258. package/src/sections/ForumBoard/types.ts +14 -0
  259. package/src/sections/GradebookTable/GradebookTable.tsx +54 -1
  260. package/src/sections/GradebookTable/types.ts +14 -0
  261. package/src/sections/LecturePlayer/LecturePlayer.tsx +63 -37
  262. package/src/sections/LecturePlayer/types.ts +8 -0
  263. package/src/sections/LessonPage/LessonPage.tsx +34 -6
  264. package/src/sections/LessonPage/types.ts +6 -0
  265. package/src/sections/PracticeQuiz/PracticeQuiz.tsx +106 -74
  266. package/src/sections/PracticeQuiz/types.ts +6 -0
  267. package/src/sections/ProgressDashboard/ProgressDashboard.tsx +64 -10
  268. package/src/sections/ProgressDashboard/types.ts +6 -0
  269. package/src/sections/QuizSession/QuizSession.tsx +71 -82
  270. package/src/sections/QuizSession/types.ts +6 -0
  271. package/src/sections/RequirementsChecklist/RequirementsChecklist.tsx +41 -1
  272. package/src/sections/RequirementsChecklist/types.ts +6 -0
  273. package/src/sections/ResourceLibrary/ResourceLibrary.tsx +64 -8
  274. package/src/sections/ResourceLibrary/types.ts +15 -1
  275. package/src/sections/RubricView/RubricView.tsx +37 -1
  276. package/src/sections/RubricView/types.ts +6 -0
  277. package/src/sections/ScrollableQuiz/ScrollableQuiz.tsx +36 -15
  278. package/src/sections/ScrollableQuiz/types.ts +6 -0
  279. package/src/sections/StudentProfile/StudentProfile.tsx +279 -0
  280. package/src/sections/StudentProfile/types.ts +99 -0
  281. package/src/sections/SurveyForm/SurveyForm.tsx +32 -5
  282. package/src/sections/SurveyForm/types.ts +6 -0
  283. package/src/sections/_shared/merge-answers.ts +22 -0
  284. package/src/sections/_shared/section-shell.tsx +64 -0
  285. package/src/sections/_shared/use-assessment-session.ts +125 -0
  286. package/src/sections/index.ts +40 -0
  287. package/src/social/user-avatar.tsx +9 -5
  288. package/src/styles/globals.css +39 -41
  289. package/src/ui/badge.tsx +8 -0
  290. package/src/ui/index.ts +2 -0
  291. package/src/ui/progress.tsx +4 -0
  292. package/src/ui/rich-text-editor.tsx +10 -0
  293. package/src/ui/rich-text-toolbar.tsx +2 -1
  294. package/src/ui/toast.tsx +170 -0
  295. package/src/utils/debounce.ts +8 -2
  296. package/src/utils/pick-palette-color.ts +33 -0
  297. package/src/video/types.ts +16 -0
  298. package/src/video/video-player.tsx +27 -6
  299. package/dist/ForumBoard-CHXU3mjC.js +0 -2207
  300. package/dist/ForumBoard-d1w5-r6n.cjs +0 -1
  301. package/dist/tabs-DRM2Iq_J.cjs +0 -172
  302. package/dist/tabs-Wf3h_Cx3.js +0 -21580
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hydralms/components",
3
- "version": "0.2.0",
3
+ "version": "0.3.1",
4
4
  "description": "React component library for LMS platforms",
5
5
  "license": "MIT",
6
6
  "author": "HydraLMS",
@@ -26,9 +26,9 @@
26
26
  "course"
27
27
  ],
28
28
  "type": "module",
29
- "main": "./src/index.ts",
30
- "module": "./src/index.ts",
31
- "types": "./src/index.ts",
29
+ "main": "./dist/index.cjs",
30
+ "module": "./dist/index.js",
31
+ "types": "./dist/index.d.ts",
32
32
  "files": [
33
33
  "src",
34
34
  "dist",
@@ -40,132 +40,32 @@
40
40
  ],
41
41
  "exports": {
42
42
  ".": {
43
- "types": "./src/index.ts",
44
- "default": "./src/index.ts"
43
+ "types": "./dist/index.d.ts",
44
+ "import": "./dist/index.js",
45
+ "require": "./dist/index.cjs"
45
46
  },
46
47
  "./sections": {
47
- "types": "./src/sections/index.ts",
48
- "default": "./src/sections/index.ts"
48
+ "types": "./dist/sections/index.d.ts",
49
+ "import": "./dist/sections.js",
50
+ "require": "./dist/sections.cjs"
49
51
  },
50
- "./sections/QuizSession": {
51
- "types": "./src/sections/QuizSession/QuizSession.tsx",
52
- "default": "./src/sections/QuizSession/QuizSession.tsx"
53
- },
54
- "./sections/LecturePlayer": {
55
- "types": "./src/sections/LecturePlayer/LecturePlayer.tsx",
56
- "default": "./src/sections/LecturePlayer/LecturePlayer.tsx"
57
- },
58
- "./sections/FlashcardStudySession": {
59
- "types": "./src/sections/FlashcardStudySession/FlashcardStudySession.tsx",
60
- "default": "./src/sections/FlashcardStudySession/FlashcardStudySession.tsx"
61
- },
62
- "./sections/AssessmentReview": {
63
- "types": "./src/sections/AssessmentReview/AssessmentReview.tsx",
64
- "default": "./src/sections/AssessmentReview/AssessmentReview.tsx"
65
- },
66
- "./sections/CourseOutline": {
67
- "types": "./src/sections/CourseOutline/CourseOutline.tsx",
68
- "default": "./src/sections/CourseOutline/CourseOutline.tsx"
69
- },
70
- "./sections/ScrollableQuiz": {
71
- "types": "./src/sections/ScrollableQuiz/ScrollableQuiz.tsx",
72
- "default": "./src/sections/ScrollableQuiz/ScrollableQuiz.tsx"
73
- },
74
- "./sections/PracticeQuiz": {
75
- "types": "./src/sections/PracticeQuiz/PracticeQuiz.tsx",
76
- "default": "./src/sections/PracticeQuiz/PracticeQuiz.tsx"
77
- },
78
- "./sections/ExamSession": {
79
- "types": "./src/sections/ExamSession/ExamSession.tsx",
80
- "default": "./src/sections/ExamSession/ExamSession.tsx"
81
- },
82
- "./sections/SurveyForm": {
83
- "types": "./src/sections/SurveyForm/SurveyForm.tsx",
84
- "default": "./src/sections/SurveyForm/SurveyForm.tsx"
85
- },
86
- "./sections/LessonPage": {
87
- "types": "./src/sections/LessonPage/LessonPage.tsx",
88
- "default": "./src/sections/LessonPage/LessonPage.tsx"
89
- },
90
- "./sections/ResourceLibrary": {
91
- "types": "./src/sections/ResourceLibrary/ResourceLibrary.tsx",
92
- "default": "./src/sections/ResourceLibrary/ResourceLibrary.tsx"
93
- },
94
- "./sections/AnnouncementFeed": {
95
- "types": "./src/sections/AnnouncementFeed/AnnouncementFeed.tsx",
96
- "default": "./src/sections/AnnouncementFeed/AnnouncementFeed.tsx"
97
- },
98
- "./sections/DiscussionThread": {
99
- "types": "./src/sections/DiscussionThread/DiscussionThread.tsx",
100
- "default": "./src/sections/DiscussionThread/DiscussionThread.tsx"
101
- },
102
- "./sections/AssignmentSubmission": {
103
- "types": "./src/sections/AssignmentSubmission/AssignmentSubmission.tsx",
104
- "default": "./src/sections/AssignmentSubmission/AssignmentSubmission.tsx"
105
- },
106
- "./sections/GradebookTable": {
107
- "types": "./src/sections/GradebookTable/GradebookTable.tsx",
108
- "default": "./src/sections/GradebookTable/GradebookTable.tsx"
109
- },
110
- "./sections/ProgressDashboard": {
111
- "types": "./src/sections/ProgressDashboard/ProgressDashboard.tsx",
112
- "default": "./src/sections/ProgressDashboard/ProgressDashboard.tsx"
113
- },
114
- "./sections/CertificateViewer": {
115
- "types": "./src/sections/CertificateViewer/CertificateViewer.tsx",
116
- "default": "./src/sections/CertificateViewer/CertificateViewer.tsx"
117
- },
118
- "./sections/RubricView": {
119
- "types": "./src/sections/RubricView/RubricView.tsx",
120
- "default": "./src/sections/RubricView/RubricView.tsx"
121
- },
122
- "./sections/RequirementsChecklist": {
123
- "types": "./src/sections/RequirementsChecklist/RequirementsChecklist.tsx",
124
- "default": "./src/sections/RequirementsChecklist/RequirementsChecklist.tsx"
125
- },
126
- "./sections/ForumBoard": {
127
- "types": "./src/sections/ForumBoard/ForumBoard.tsx",
128
- "default": "./src/sections/ForumBoard/ForumBoard.tsx"
52
+ "./sections/*": {
53
+ "types": "./src/sections/*/index.ts",
54
+ "default": "./src/sections/*/index.ts"
129
55
  },
130
56
  "./modules": {
131
- "types": "./src/modules/index.ts",
132
- "default": "./src/modules/index.ts"
133
- },
134
- "./modules/QuizModule": {
135
- "types": "./src/modules/QuizModule/QuizModule.tsx",
136
- "default": "./src/modules/QuizModule/QuizModule.tsx"
137
- },
138
- "./modules/FlashcardLab": {
139
- "types": "./src/modules/FlashcardLab/FlashcardLab.tsx",
140
- "default": "./src/modules/FlashcardLab/FlashcardLab.tsx"
57
+ "types": "./dist/modules/index.d.ts",
58
+ "import": "./dist/modules.js",
59
+ "require": "./dist/modules.cjs"
141
60
  },
142
- "./modules/CoursePlayer": {
143
- "types": "./src/modules/CoursePlayer/CoursePlayer.tsx",
144
- "default": "./src/modules/CoursePlayer/CoursePlayer.tsx"
61
+ "./modules/*": {
62
+ "types": "./src/modules/*/index.ts",
63
+ "default": "./src/modules/*/index.ts"
145
64
  },
146
- "./modules/ExamModule": {
147
- "types": "./src/modules/ExamModule/ExamModule.tsx",
148
- "default": "./src/modules/ExamModule/ExamModule.tsx"
149
- },
150
- "./modules/SurveyModule": {
151
- "types": "./src/modules/SurveyModule/SurveyModule.tsx",
152
- "default": "./src/modules/SurveyModule/SurveyModule.tsx"
153
- },
154
- "./modules/GradeCenterModule": {
155
- "types": "./src/modules/GradeCenterModule/GradeCenterModule.tsx",
156
- "default": "./src/modules/GradeCenterModule/GradeCenterModule.tsx"
157
- },
158
- "./modules/AssignmentModule": {
159
- "types": "./src/modules/AssignmentModule/AssignmentModule.tsx",
160
- "default": "./src/modules/AssignmentModule/AssignmentModule.tsx"
161
- },
162
- "./modules/CertificateModule": {
163
- "types": "./src/modules/CertificateModule/CertificateModule.tsx",
164
- "default": "./src/modules/CertificateModule/CertificateModule.tsx"
165
- },
166
- "./modules/DiscussionModule": {
167
- "types": "./src/modules/DiscussionModule/DiscussionModule.tsx",
168
- "default": "./src/modules/DiscussionModule/DiscussionModule.tsx"
65
+ "./license": {
66
+ "types": "./dist/license/index.d.ts",
67
+ "import": "./dist/license.js",
68
+ "require": "./dist/license.cjs"
169
69
  },
170
70
  "./provider": {
171
71
  "types": "./src/provider/index.ts",
@@ -207,115 +107,37 @@
207
107
  "types": "./src/social/index.ts",
208
108
  "default": "./src/social/index.ts"
209
109
  },
210
- "./ui/card": {
211
- "types": "./src/ui/card.tsx",
212
- "default": "./src/ui/card.tsx"
213
- },
214
- "./ui/progress": {
215
- "types": "./src/ui/progress.tsx",
216
- "default": "./src/ui/progress.tsx"
217
- },
218
- "./provider/HydraProvider": {
219
- "types": "./src/provider/HydraProvider.tsx",
220
- "default": "./src/provider/HydraProvider.tsx"
221
- },
222
- "./styles.css": "./src/styles/globals.css",
223
- "./styles/globals.css": "./src/styles/globals.css",
110
+ "./styles.css": "./dist/components.css",
224
111
  "./package.json": "./package.json"
225
112
  },
226
- "publishConfig": {
227
- "main": "./dist/index.cjs",
228
- "module": "./dist/index.js",
229
- "types": "./dist/index.d.ts",
230
- "exports": {
231
- ".": {
232
- "types": "./dist/index.d.ts",
233
- "import": "./dist/index.js",
234
- "require": "./dist/index.cjs"
235
- },
236
- "./sections": {
237
- "types": "./dist/sections/index.d.ts",
238
- "import": "./dist/sections.js",
239
- "require": "./dist/sections.cjs"
240
- },
241
- "./sections/*": {
242
- "types": "./src/sections/*/index.ts",
243
- "default": "./src/sections/*/index.ts"
244
- },
245
- "./modules": {
246
- "types": "./dist/modules/index.d.ts",
247
- "import": "./dist/modules.js",
248
- "require": "./dist/modules.cjs"
249
- },
250
- "./modules/*": {
251
- "types": "./src/modules/*/index.ts",
252
- "default": "./src/modules/*/index.ts"
253
- },
254
- "./provider": {
255
- "types": "./src/provider/index.ts",
256
- "default": "./src/provider/index.ts"
257
- },
258
- "./questions": {
259
- "types": "./src/questions/index.ts",
260
- "default": "./src/questions/index.ts"
261
- },
262
- "./assessment-toolbar": {
263
- "types": "./src/assessment-toolbar/index.ts",
264
- "default": "./src/assessment-toolbar/index.ts"
265
- },
266
- "./flashcards": {
267
- "types": "./src/flashcards/index.ts",
268
- "default": "./src/flashcards/index.ts"
269
- },
270
- "./curriculum": {
271
- "types": "./src/curriculum/index.ts",
272
- "default": "./src/curriculum/index.ts"
273
- },
274
- "./video": {
275
- "types": "./src/video/index.ts",
276
- "default": "./src/video/index.ts"
277
- },
278
- "./progress": {
279
- "types": "./src/progress/index.ts",
280
- "default": "./src/progress/index.ts"
281
- },
282
- "./feedback": {
283
- "types": "./src/feedback/index.ts",
284
- "default": "./src/feedback/index.ts"
285
- },
286
- "./content": {
287
- "types": "./src/content/index.ts",
288
- "default": "./src/content/index.ts"
289
- },
290
- "./social": {
291
- "types": "./src/social/index.ts",
292
- "default": "./src/social/index.ts"
293
- },
294
- "./styles.css": "./dist/components.css",
295
- "./package.json": "./package.json"
296
- }
297
- },
298
- "scripts": {
299
- "build": "vite build",
300
- "dev": "vite build --watch",
301
- "generate-docs": "tsx scripts/generate-docs.ts",
302
- "check-docs": "tsx scripts/generate-docs.ts --check",
303
- "typecheck": "tsc --noEmit",
304
- "test": "vitest run",
305
- "test:watch": "vitest",
306
- "prepublishOnly": "pnpm run build"
307
- },
308
113
  "peerDependencies": {
309
114
  "react": "^18.0.0 || ^19.0.0",
310
115
  "react-dom": "^18.0.0 || ^19.0.0",
311
- "tailwindcss": "^4.0.0"
116
+ "tailwindcss": "^4.0.0",
117
+ "@tiptap/react": "^3.0.0",
118
+ "@tiptap/starter-kit": "^3.0.0",
119
+ "@tiptap/extension-link": "^3.0.0",
120
+ "@tiptap/extension-placeholder": "^3.0.0",
121
+ "@tiptap/extension-underline": "^3.0.0"
122
+ },
123
+ "peerDependenciesMeta": {
124
+ "@tiptap/react": {
125
+ "optional": true
126
+ },
127
+ "@tiptap/starter-kit": {
128
+ "optional": true
129
+ },
130
+ "@tiptap/extension-link": {
131
+ "optional": true
132
+ },
133
+ "@tiptap/extension-placeholder": {
134
+ "optional": true
135
+ },
136
+ "@tiptap/extension-underline": {
137
+ "optional": true
138
+ }
312
139
  },
313
140
  "dependencies": {
314
- "@tiptap/extension-link": "^3.20.1",
315
- "@tiptap/extension-placeholder": "^3.20.1",
316
- "@tiptap/extension-underline": "^3.20.1",
317
- "@tiptap/react": "^3.20.1",
318
- "@tiptap/starter-kit": "^3.20.1",
319
141
  "class-variance-authority": "^0.7.1",
320
142
  "clsx": "^2.1.1",
321
143
  "lucide-react": "^0.475.0",
@@ -339,5 +161,14 @@
339
161
  "vite": "^6.0.0",
340
162
  "vite-plugin-dts": "^4.0.0",
341
163
  "vitest": "^4.0.18"
164
+ },
165
+ "scripts": {
166
+ "build": "vite build",
167
+ "dev": "vite build --watch",
168
+ "generate-docs": "tsx scripts/generate-docs.ts",
169
+ "check-docs": "tsx scripts/generate-docs.ts --check",
170
+ "typecheck": "tsc --noEmit",
171
+ "test": "vitest run",
172
+ "test:watch": "vitest"
342
173
  }
343
- }
174
+ }
@@ -1,3 +1,4 @@
1
+ import { memo } from "react";
1
2
  import type { QuestionNavigatorProps } from "./types";
2
3
  import { cn } from "../lib/utils";
3
4
 
@@ -18,12 +19,12 @@ const getChipVariant = (
18
19
  return "default";
19
20
  };
20
21
 
21
- export const QuestionNavigator = ({
22
+ export const QuestionNavigator = memo(function QuestionNavigator({
22
23
  questions,
23
24
  currentQuestionUid,
24
25
  onNavigate,
25
26
  readOnly = false,
26
- }: QuestionNavigatorProps) => {
27
+ }: QuestionNavigatorProps) {
27
28
  const getTooltipContent = (q: (typeof questions)[0]): string => {
28
29
  const parts: string[] = [`Question ${q.sequence + 1}`];
29
30
  if (q.isFlagged) parts.push("Flagged");
@@ -37,22 +38,26 @@ export const QuestionNavigator = ({
37
38
  {questions.map((q) => {
38
39
  const variant = getChipVariant(q, currentQuestionUid);
39
40
  return (
40
- <div
41
+ <button
42
+ type="button"
41
43
  key={q.uid}
42
44
  title={getTooltipContent(q)}
45
+ aria-label={getTooltipContent(q)}
46
+ aria-current={q.uid === currentQuestionUid ? "step" : undefined}
43
47
  className={cn(
44
48
  "inline-flex items-center justify-center px-1.5 py-0.5 rounded border text-[11px] leading-tight transition-all duration-150 min-w-5.5",
45
49
  CHIP_CLASSES[variant],
46
50
  readOnly ? "cursor-default" : "cursor-pointer hover:shadow-sm hover:-translate-y-px",
47
51
  )}
48
52
  onClick={readOnly ? undefined : () => onNavigate?.(q.uid)}
53
+ disabled={readOnly}
49
54
  >
50
55
  <span className="font-semibold min-w-3.5 text-center">
51
56
  {q.sequence + 1}
52
57
  </span>
53
- </div>
58
+ </button>
54
59
  );
55
60
  })}
56
61
  </div>
57
62
  );
58
- };
63
+ });
@@ -1,3 +1,4 @@
1
+ import { memo } from "react";
1
2
  import { Clock } from "lucide-react";
2
3
  import { cn } from "../lib/utils";
3
4
  import { formatTimer } from "../utils/format-duration";
@@ -22,11 +23,11 @@ function getTimerClasses(isDanger: boolean, isWarning: boolean) {
22
23
  };
23
24
  }
24
25
 
25
- export const TimerDisplay = ({
26
+ export const TimerDisplay = memo(function TimerDisplay({
26
27
  timeElapsedSeconds,
27
28
  timeLimitSeconds,
28
29
  variant = "compact",
29
- }: TimerDisplayProps) => {
30
+ }: TimerDisplayProps) {
30
31
  const hasTimeLimit = timeLimitSeconds != null && timeLimitSeconds > 0;
31
32
  const remainingSeconds = hasTimeLimit
32
33
  ? Math.max(0, timeLimitSeconds - timeElapsedSeconds)
@@ -70,4 +71,4 @@ export const TimerDisplay = ({
70
71
  </span>
71
72
  </div>
72
73
  );
73
- };
74
+ });
@@ -134,7 +134,7 @@ export function useCountdown({
134
134
  startInterval();
135
135
  }
136
136
  return clearTimer;
137
- }, []); // eslint-disable-line react-hooks/exhaustive-deps
137
+ }, [autoStart, startInterval, clearTimer]);
138
138
 
139
139
  const state = stateRef.current;
140
140
 
@@ -6,6 +6,7 @@ export function EmptyState({ icon, title, description, action, className, style
6
6
  <div
7
7
  className={cn("flex flex-col items-center justify-center text-center px-3 py-6", className)}
8
8
  style={style}
9
+ role="status"
9
10
  >
10
11
  {icon && (
11
12
  <div className="mb-2 text-muted-foreground [&>svg]:size-12">
@@ -4,6 +4,7 @@ export { SearchInput } from "./search-input";
4
4
  export { StatusBadge } from "./status-badge";
5
5
  export { DueDateDisplay } from "./due-date-display";
6
6
  export { Stepper } from "./stepper";
7
+ export { Pagination } from "./pagination";
7
8
  export type {
8
9
  EmptyStateProps,
9
10
  ConfirmDialogProps,
@@ -12,4 +13,5 @@ export type {
12
13
  DueDateDisplayProps,
13
14
  StepperProps,
14
15
  StepDefinition,
16
+ PaginationProps,
15
17
  } from "./types";
@@ -0,0 +1,135 @@
1
+ import { memo, useMemo } from "react";
2
+ import { ChevronLeft, ChevronRight } from "lucide-react";
3
+ import { cn } from "../lib/utils";
4
+ import { Button } from "../ui/button";
5
+
6
+ /**
7
+ * Pagination provides page navigation controls with page numbers,
8
+ * previous/next buttons, and ellipsis for large page ranges.
9
+ *
10
+ * @example
11
+ * <Pagination
12
+ * currentPage={3}
13
+ * totalPages={10}
14
+ * onPageChange={(page) => setPage(page)}
15
+ * />
16
+ */
17
+ export interface PaginationProps {
18
+ /** Current active page (1-indexed) */
19
+ currentPage: number;
20
+ /** Total number of pages */
21
+ totalPages: number;
22
+ /** Called when the user navigates to a page */
23
+ onPageChange: (page: number) => void;
24
+ /** Number of page buttons shown on each side of the current page (default 1) */
25
+ siblingCount?: number;
26
+ /** CSS class name for the root element */
27
+ className?: string;
28
+ /** Inline styles for the root element */
29
+ style?: React.CSSProperties;
30
+ }
31
+
32
+ function getPageRange(
33
+ current: number,
34
+ total: number,
35
+ siblings: number,
36
+ ): (number | "ellipsis")[] {
37
+ const totalSlots = siblings * 2 + 5;
38
+ if (total <= totalSlots) {
39
+ return Array.from({ length: total }, (_, i) => i + 1);
40
+ }
41
+
42
+ const leftSibling = Math.max(current - siblings, 1);
43
+ const rightSibling = Math.min(current + siblings, total);
44
+ const showLeftEllipsis = leftSibling > 2;
45
+ const showRightEllipsis = rightSibling < total - 1;
46
+
47
+ if (!showLeftEllipsis && showRightEllipsis) {
48
+ const leftCount = siblings * 2 + 3;
49
+ const leftRange = Array.from({ length: leftCount }, (_, i) => i + 1);
50
+ return [...leftRange, "ellipsis", total];
51
+ }
52
+
53
+ if (showLeftEllipsis && !showRightEllipsis) {
54
+ const rightCount = siblings * 2 + 3;
55
+ const rightRange = Array.from(
56
+ { length: rightCount },
57
+ (_, i) => total - rightCount + i + 1,
58
+ );
59
+ return [1, "ellipsis", ...rightRange];
60
+ }
61
+
62
+ const middleRange = Array.from(
63
+ { length: rightSibling - leftSibling + 1 },
64
+ (_, i) => leftSibling + i,
65
+ );
66
+ return [1, "ellipsis", ...middleRange, "ellipsis", total];
67
+ }
68
+
69
+ export const Pagination = memo(function Pagination({
70
+ currentPage,
71
+ totalPages,
72
+ onPageChange,
73
+ siblingCount = 1,
74
+ className,
75
+ style,
76
+ }: PaginationProps) {
77
+ const pages = useMemo(
78
+ () => getPageRange(currentPage, totalPages, siblingCount),
79
+ [currentPage, totalPages, siblingCount],
80
+ );
81
+
82
+ if (totalPages <= 1) return null;
83
+
84
+ return (
85
+ <nav
86
+ data-slot="pagination"
87
+ aria-label="Pagination"
88
+ className={cn("flex items-center justify-center gap-1", className)}
89
+ style={style}
90
+ >
91
+ <Button
92
+ variant="ghost"
93
+ size="icon-sm"
94
+ onClick={() => onPageChange(currentPage - 1)}
95
+ disabled={currentPage <= 1}
96
+ aria-label="Previous page"
97
+ >
98
+ <ChevronLeft className="size-4" />
99
+ </Button>
100
+
101
+ {pages.map((page, i) =>
102
+ page === "ellipsis" ? (
103
+ <span
104
+ key={`ellipsis-${i}`}
105
+ className="flex items-center justify-center size-8 text-xs text-muted-foreground"
106
+ >
107
+ <span aria-hidden="true">...</span>
108
+ <span className="sr-only">More pages</span>
109
+ </span>
110
+ ) : (
111
+ <Button
112
+ key={page}
113
+ variant={page === currentPage ? "default" : "ghost"}
114
+ size="icon-sm"
115
+ onClick={() => onPageChange(page)}
116
+ aria-label={`Page ${page}`}
117
+ aria-current={page === currentPage ? "page" : undefined}
118
+ >
119
+ <span className="text-xs">{page}</span>
120
+ </Button>
121
+ ),
122
+ )}
123
+
124
+ <Button
125
+ variant="ghost"
126
+ size="icon-sm"
127
+ onClick={() => onPageChange(currentPage + 1)}
128
+ disabled={currentPage >= totalPages}
129
+ aria-label="Next page"
130
+ >
131
+ <ChevronRight className="size-4" />
132
+ </Button>
133
+ </nav>
134
+ );
135
+ });
@@ -1,4 +1,4 @@
1
- import { useState, useMemo, useRef } from "react";
1
+ import { useState, useMemo, useRef, useEffect } from "react";
2
2
  import { Search, X } from "lucide-react";
3
3
  import { debounce } from "../utils/debounce";
4
4
  import type { SearchInputProps } from "./types";
@@ -23,6 +23,7 @@ export function SearchInput({
23
23
  () => debounce((val: string) => onChangeRef.current(val), debounceMs),
24
24
  [debounceMs],
25
25
  );
26
+ useEffect(() => () => debouncedOnChange.cancel(), [debouncedOnChange]);
26
27
 
27
28
  function handleChange(e: React.ChangeEvent<HTMLInputElement>) {
28
29
  const next = e.target.value;
@@ -166,3 +166,5 @@ export interface StepperProps {
166
166
  /** Inline styles for the root element */
167
167
  style?: React.CSSProperties;
168
168
  }
169
+
170
+ export type { PaginationProps } from "./pagination";
@@ -68,6 +68,7 @@ export function AttachmentList({
68
68
  size="sm"
69
69
  className="shrink-0 h-7 w-7 p-0"
70
70
  onClick={() => onDownload(file)}
71
+ aria-label={`Download ${file.name}`}
71
72
  >
72
73
  <Download size={14} />
73
74
  </Button>
@@ -78,6 +79,7 @@ export function AttachmentList({
78
79
  size="sm"
79
80
  className="shrink-0 h-7 w-7 p-0 text-muted-foreground hover:text-destructive"
80
81
  onClick={() => onRemove(file)}
82
+ aria-label={`Remove ${file.name}`}
81
83
  >
82
84
  <X size={14} />
83
85
  </Button>