@hydralms/components 0.1.3 → 0.3.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 (344) hide show
  1. package/dist/StudentProfile-BVfZMbnV.cjs +1 -0
  2. package/dist/StudentProfile-DeMxdrL3.js +3275 -0
  3. package/dist/assessment-toolbar/assessment-toolbar.d.ts +1 -1
  4. package/dist/assessment-toolbar/index.d.ts +5 -1
  5. package/dist/assessment-toolbar/question-header-bar.d.ts +2 -0
  6. package/dist/assessment-toolbar/question-materials-drawer.d.ts +2 -0
  7. package/dist/assessment-toolbar/question-navigator.d.ts +1 -1
  8. package/dist/assessment-toolbar/timer-display.d.ts +1 -1
  9. package/dist/assessment-toolbar/types.d.ts +52 -4
  10. package/dist/assessment-toolbar/use-countdown.d.ts +43 -0
  11. package/dist/common/index.d.ts +3 -1
  12. package/dist/common/pagination.d.ts +26 -0
  13. package/dist/common/stepper.d.ts +6 -0
  14. package/dist/common/types.d.ts +38 -0
  15. package/dist/components.css +1 -1
  16. package/dist/content/attachment-list.d.ts +6 -0
  17. package/dist/content/audio-player.d.ts +22 -0
  18. package/dist/content/code-block.d.ts +30 -0
  19. package/dist/content/content-block.d.ts +1 -1
  20. package/dist/content/embed-block.d.ts +28 -0
  21. package/dist/content/index.d.ts +8 -1
  22. package/dist/content/types.d.ts +63 -0
  23. package/dist/curriculum/course-card.d.ts +51 -0
  24. package/dist/curriculum/curriculum-item.d.ts +1 -1
  25. package/dist/curriculum/index.d.ts +2 -0
  26. package/dist/curriculum/types.d.ts +2 -2
  27. package/dist/index.cjs +1 -1
  28. package/dist/index.d.ts +1 -0
  29. package/dist/index.js +597 -308
  30. package/dist/license/HydraContext.d.ts +16 -0
  31. package/dist/license/ProBadge.d.ts +6 -0
  32. package/dist/license/index.d.ts +7 -0
  33. package/dist/license/tiers.d.ts +3 -0
  34. package/dist/license/useHydraLicense.d.ts +6 -0
  35. package/dist/license/validate.d.ts +13 -0
  36. package/dist/license/withProGate.d.ts +6 -0
  37. package/dist/modules/AssignmentModule/AssignmentModule.d.ts +5 -0
  38. package/dist/modules/AssignmentModule/types.d.ts +69 -0
  39. package/dist/modules/CertificateModule/CertificateModule.d.ts +5 -0
  40. package/dist/modules/CertificateModule/types.d.ts +51 -0
  41. package/dist/modules/CourseCatalogModule/CourseCatalogModule.d.ts +5 -0
  42. package/dist/modules/CourseCatalogModule/types.d.ts +43 -0
  43. package/dist/modules/CoursePlayer/CoursePlayer.d.ts +4 -1
  44. package/dist/modules/DiscussionModule/DiscussionModule.d.ts +5 -0
  45. package/dist/modules/DiscussionModule/types.d.ts +47 -0
  46. package/dist/modules/ExamModule/ExamModule.d.ts +5 -0
  47. package/dist/modules/ExamModule/types.d.ts +55 -0
  48. package/dist/modules/FlashcardLab/FlashcardLab.d.ts +4 -1
  49. package/dist/modules/FlashcardLab/types.d.ts +2 -0
  50. package/dist/modules/GradeCenterModule/GradeCenterModule.d.ts +5 -0
  51. package/dist/modules/GradeCenterModule/types.d.ts +56 -0
  52. package/dist/modules/QuizModule/QuizModule.d.ts +4 -1
  53. package/dist/modules/QuizModule/types.d.ts +10 -14
  54. package/dist/modules/StudentDashboardModule/StudentDashboardModule.d.ts +5 -0
  55. package/dist/modules/StudentDashboardModule/types.d.ts +54 -0
  56. package/dist/modules/StudentProfileModule/StudentProfileModule.d.ts +5 -0
  57. package/dist/modules/StudentProfileModule/types.d.ts +43 -0
  58. package/dist/modules/SurveyModule/SurveyModule.d.ts +5 -0
  59. package/dist/modules/SurveyModule/types.d.ts +51 -0
  60. package/dist/modules/_shared/assessment-intro.d.ts +16 -0
  61. package/dist/modules/_shared/assessment-results.d.ts +23 -0
  62. package/dist/modules/_shared/types.d.ts +10 -0
  63. package/dist/modules/_shared/use-timer.d.ts +9 -0
  64. package/dist/modules/index.d.ts +18 -0
  65. package/dist/modules.cjs +1 -0
  66. package/dist/modules.js +1834 -0
  67. package/dist/progress/achievement-badge.d.ts +6 -0
  68. package/dist/progress/activity-timeline.d.ts +6 -0
  69. package/dist/progress/index.d.ts +4 -1
  70. package/dist/progress/stat-card.d.ts +1 -1
  71. package/dist/progress/streak-badge.d.ts +6 -0
  72. package/dist/progress/types.d.ts +99 -0
  73. package/dist/provider/HydraProvider.d.ts +5 -1
  74. package/dist/questions/choice.d.ts +1 -1
  75. package/dist/questions/confidence-indicator.d.ts +37 -0
  76. package/dist/questions/essay.d.ts +2 -2
  77. package/dist/questions/fill-in-the-blank.d.ts +1 -1
  78. package/dist/questions/hotspot.d.ts +21 -0
  79. package/dist/questions/index.d.ts +11 -1
  80. package/dist/questions/inline-choice.d.ts +21 -0
  81. package/dist/questions/matching.d.ts +22 -0
  82. package/dist/questions/multiple-choice.d.ts +1 -1
  83. package/dist/questions/numeric.d.ts +11 -0
  84. package/dist/questions/ordering.d.ts +12 -0
  85. package/dist/questions/question-renderer.d.ts +1 -1
  86. package/dist/questions/scenario.d.ts +23 -0
  87. package/dist/questions/scoring.d.ts +22 -0
  88. package/dist/questions/spreadsheet.d.ts +29 -0
  89. package/dist/questions/true-false.d.ts +1 -1
  90. package/dist/questions/types.d.ts +106 -1
  91. package/dist/questions/use-drag-reorder.d.ts +17 -0
  92. package/dist/sections/AnnouncementFeed/AnnouncementFeed.d.ts +1 -1
  93. package/dist/sections/AnnouncementFeed/types.d.ts +15 -1
  94. package/dist/sections/AssessmentReview/AssessmentReview.d.ts +1 -1
  95. package/dist/sections/AssessmentReview/types.d.ts +6 -0
  96. package/dist/sections/AssignmentSubmission/AssignmentSubmission.d.ts +1 -1
  97. package/dist/sections/AssignmentSubmission/types.d.ts +6 -0
  98. package/dist/sections/CertificateViewer/CertificateViewer.d.ts +1 -1
  99. package/dist/sections/CertificateViewer/certificate-variants.d.ts +42 -0
  100. package/dist/sections/CertificateViewer/types.d.ts +13 -5
  101. package/dist/sections/CourseCatalog/CourseCatalog.d.ts +2 -0
  102. package/dist/sections/CourseCatalog/types.d.ts +80 -0
  103. package/dist/sections/CourseOutline/CourseOutline.d.ts +1 -1
  104. package/dist/sections/CourseOutline/types.d.ts +6 -0
  105. package/dist/sections/DiscussionThread/DiscussionThread.d.ts +1 -1
  106. package/dist/sections/DiscussionThread/types.d.ts +6 -0
  107. package/dist/sections/EnrollmentWizard/EnrollmentWizard.d.ts +2 -0
  108. package/dist/sections/EnrollmentWizard/types.d.ts +66 -0
  109. package/dist/sections/ExamSession/ExamSession.d.ts +1 -1
  110. package/dist/sections/ExamSession/types.d.ts +12 -1
  111. package/dist/sections/FlashcardStudySession/FlashcardStudySession.d.ts +1 -1
  112. package/dist/sections/FlashcardStudySession/types.d.ts +6 -0
  113. package/dist/sections/ForumBoard/ForumBoard.d.ts +8 -0
  114. package/dist/sections/ForumBoard/types.d.ts +78 -0
  115. package/dist/sections/GradebookTable/GradebookTable.d.ts +1 -1
  116. package/dist/sections/GradebookTable/types.d.ts +14 -0
  117. package/dist/sections/LecturePlayer/LecturePlayer.d.ts +1 -1
  118. package/dist/sections/LecturePlayer/types.d.ts +8 -0
  119. package/dist/sections/LessonPage/LessonPage.d.ts +1 -1
  120. package/dist/sections/LessonPage/types.d.ts +6 -0
  121. package/dist/sections/PracticeQuiz/PracticeQuiz.d.ts +1 -1
  122. package/dist/sections/PracticeQuiz/types.d.ts +6 -0
  123. package/dist/sections/ProgressDashboard/ProgressDashboard.d.ts +1 -1
  124. package/dist/sections/ProgressDashboard/types.d.ts +6 -0
  125. package/dist/sections/QuizSession/QuizSession.d.ts +1 -1
  126. package/dist/sections/QuizSession/types.d.ts +12 -1
  127. package/dist/sections/RequirementsChecklist/RequirementsChecklist.d.ts +8 -0
  128. package/dist/sections/RequirementsChecklist/types.d.ts +43 -0
  129. package/dist/sections/ResourceLibrary/ResourceLibrary.d.ts +1 -1
  130. package/dist/sections/ResourceLibrary/types.d.ts +15 -1
  131. package/dist/sections/RubricView/RubricView.d.ts +9 -0
  132. package/dist/sections/RubricView/types.d.ts +56 -0
  133. package/dist/sections/ScrollableQuiz/ScrollableQuiz.d.ts +1 -1
  134. package/dist/sections/ScrollableQuiz/types.d.ts +6 -0
  135. package/dist/sections/StudentProfile/StudentProfile.d.ts +2 -0
  136. package/dist/sections/StudentProfile/types.d.ts +98 -0
  137. package/dist/sections/SurveyForm/SurveyForm.d.ts +1 -1
  138. package/dist/sections/SurveyForm/types.d.ts +6 -0
  139. package/dist/sections/_shared/merge-answers.d.ts +9 -0
  140. package/dist/sections/_shared/section-shell.d.ts +20 -0
  141. package/dist/sections/_shared/use-assessment-session.d.ts +30 -0
  142. package/dist/sections/index.d.ts +13 -1
  143. package/dist/sections.cjs +1 -1
  144. package/dist/sections.js +282 -1786
  145. package/dist/social/post-card.d.ts +1 -1
  146. package/dist/tabs-BsfVo2Bl.cjs +173 -0
  147. package/dist/tabs-BuY1iNJE.js +22305 -0
  148. package/dist/ui/alert.d.ts +1 -1
  149. package/dist/ui/badge.d.ts +1 -1
  150. package/dist/ui/button.d.ts +1 -1
  151. package/dist/ui/drawer.d.ts +84 -0
  152. package/dist/ui/index.d.ts +5 -0
  153. package/dist/ui/progress.d.ts +1 -1
  154. package/dist/ui/rich-text-editor.d.ts +32 -0
  155. package/dist/ui/rich-text-toolbar.d.ts +8 -0
  156. package/dist/ui/toast.d.ts +43 -0
  157. package/dist/utils/array-utils.d.ts +4 -0
  158. package/dist/utils/debounce.d.ts +5 -1
  159. package/dist/utils/flatten-leaves.d.ts +6 -0
  160. package/dist/utils/format-file-size.d.ts +1 -0
  161. package/dist/utils/format-timestamp.d.ts +1 -0
  162. package/dist/utils/is-empty-html.d.ts +5 -0
  163. package/dist/utils/pick-palette-color.d.ts +19 -0
  164. package/dist/utils/shuffle.d.ts +1 -0
  165. package/dist/utils/string-utils.d.ts +12 -0
  166. package/dist/video/types.d.ts +15 -0
  167. package/dist/video/video-bookmark.d.ts +1 -1
  168. package/dist/video/video-player.d.ts +1 -1
  169. package/dist/video/video-playlist-item.d.ts +1 -1
  170. package/dist/withProGate-BWqcKdPM.js +137 -0
  171. package/dist/withProGate-DX6XqKLp.cjs +1 -0
  172. package/package.json +40 -137
  173. package/src/assessment-toolbar/assessment-toolbar.tsx +54 -49
  174. package/src/assessment-toolbar/index.ts +6 -0
  175. package/src/assessment-toolbar/question-header-bar.tsx +61 -0
  176. package/src/assessment-toolbar/question-materials-drawer.tsx +55 -0
  177. package/src/assessment-toolbar/question-navigator.tsx +13 -36
  178. package/src/assessment-toolbar/timer-display.tsx +6 -5
  179. package/src/assessment-toolbar/types.ts +54 -4
  180. package/src/assessment-toolbar/use-countdown.ts +153 -0
  181. package/src/common/empty-state.tsx +1 -0
  182. package/src/common/index.ts +5 -0
  183. package/src/common/pagination.tsx +135 -0
  184. package/src/common/search-input.tsx +8 -6
  185. package/src/common/stepper.tsx +100 -0
  186. package/src/common/types.ts +41 -0
  187. package/src/content/attachment-list.tsx +92 -0
  188. package/src/content/audio-player.tsx +196 -0
  189. package/src/content/code-block.tsx +113 -0
  190. package/src/content/content-block.tsx +68 -2
  191. package/src/content/embed-block.tsx +78 -0
  192. package/src/content/file-upload-zone.tsx +11 -6
  193. package/src/content/index.ts +9 -0
  194. package/src/content/types.ts +46 -0
  195. package/src/curriculum/course-card.tsx +199 -0
  196. package/src/curriculum/curriculum-item.tsx +9 -5
  197. package/src/curriculum/curriculum-tree.tsx +20 -13
  198. package/src/curriculum/index.ts +2 -0
  199. package/src/curriculum/types.ts +2 -2
  200. package/src/feedback/feedback-banner.tsx +12 -14
  201. package/src/flashcards/flashcard-deck.tsx +1 -9
  202. package/src/flashcards/flashcard.tsx +29 -9
  203. package/src/index.ts +3 -0
  204. package/src/license/HydraContext.tsx +62 -0
  205. package/src/license/ProBadge.tsx +43 -0
  206. package/src/license/index.ts +7 -0
  207. package/src/license/tiers.ts +24 -0
  208. package/src/license/useHydraLicense.ts +10 -0
  209. package/src/license/validate.ts +90 -0
  210. package/src/license/withProGate.tsx +21 -0
  211. package/src/modules/AssignmentModule/AssignmentModule.tsx +314 -0
  212. package/src/modules/AssignmentModule/types.ts +77 -0
  213. package/src/modules/CertificateModule/CertificateModule.tsx +173 -0
  214. package/src/modules/CertificateModule/types.ts +49 -0
  215. package/src/modules/CourseCatalogModule/CourseCatalogModule.tsx +126 -0
  216. package/src/modules/CourseCatalogModule/types.ts +47 -0
  217. package/src/modules/CoursePlayer/CoursePlayer.tsx +80 -69
  218. package/src/modules/DiscussionModule/DiscussionModule.tsx +145 -0
  219. package/src/modules/DiscussionModule/types.ts +54 -0
  220. package/src/modules/ExamModule/ExamModule.tsx +151 -0
  221. package/src/modules/ExamModule/types.ts +57 -0
  222. package/src/modules/FlashcardLab/FlashcardLab.tsx +39 -21
  223. package/src/modules/FlashcardLab/types.ts +2 -0
  224. package/src/modules/GradeCenterModule/GradeCenterModule.tsx +174 -0
  225. package/src/modules/GradeCenterModule/types.ts +65 -0
  226. package/src/modules/QuizModule/QuizModule.tsx +58 -178
  227. package/src/modules/QuizModule/types.ts +10 -15
  228. package/src/modules/StudentDashboardModule/StudentDashboardModule.tsx +117 -0
  229. package/src/modules/StudentDashboardModule/types.ts +56 -0
  230. package/src/modules/StudentProfileModule/StudentProfileModule.tsx +289 -0
  231. package/src/modules/StudentProfileModule/types.ts +45 -0
  232. package/src/modules/SurveyModule/SurveyModule.tsx +185 -0
  233. package/src/modules/SurveyModule/types.ts +53 -0
  234. package/src/modules/_shared/assessment-intro.tsx +75 -0
  235. package/src/modules/_shared/assessment-results.tsx +133 -0
  236. package/src/modules/_shared/types.ts +11 -0
  237. package/src/modules/_shared/use-timer.ts +49 -0
  238. package/src/modules/index.ts +33 -0
  239. package/src/progress/achievement-badge.tsx +52 -0
  240. package/src/progress/activity-timeline.tsx +84 -0
  241. package/src/progress/grade-indicator.tsx +9 -1
  242. package/src/progress/index.ts +7 -0
  243. package/src/progress/progress-ring.tsx +2 -1
  244. package/src/progress/stat-card.tsx +37 -18
  245. package/src/progress/streak-badge.tsx +35 -0
  246. package/src/progress/types.ts +103 -0
  247. package/src/provider/HydraProvider.tsx +15 -6
  248. package/src/questions/choice.tsx +19 -14
  249. package/src/questions/confidence-indicator.tsx +107 -0
  250. package/src/questions/essay.tsx +28 -28
  251. package/src/questions/fill-in-the-blank.tsx +20 -19
  252. package/src/questions/hotspot.tsx +154 -0
  253. package/src/questions/index.ts +18 -0
  254. package/src/questions/inline-choice.tsx +152 -0
  255. package/src/questions/matching.tsx +229 -0
  256. package/src/questions/multiple-choice.tsx +19 -14
  257. package/src/questions/numeric.tsx +106 -0
  258. package/src/questions/ordering.tsx +167 -0
  259. package/src/questions/question-renderer.tsx +24 -2
  260. package/src/questions/scenario.tsx +140 -0
  261. package/src/questions/scoring.ts +201 -0
  262. package/src/questions/spreadsheet.tsx +260 -0
  263. package/src/questions/true-false.tsx +19 -14
  264. package/src/questions/types.ts +123 -1
  265. package/src/questions/use-drag-reorder.ts +80 -0
  266. package/src/sections/AnnouncementFeed/AnnouncementFeed.tsx +66 -23
  267. package/src/sections/AnnouncementFeed/types.ts +15 -1
  268. package/src/sections/AssessmentReview/AssessmentReview.tsx +50 -2
  269. package/src/sections/AssessmentReview/types.ts +6 -0
  270. package/src/sections/AssignmentSubmission/AssignmentSubmission.tsx +44 -6
  271. package/src/sections/AssignmentSubmission/types.ts +6 -0
  272. package/src/sections/CertificateViewer/CertificateViewer.tsx +215 -60
  273. package/src/sections/CertificateViewer/certificate-variants.tsx +170 -0
  274. package/src/sections/CertificateViewer/types.ts +19 -5
  275. package/src/sections/CourseCatalog/CourseCatalog.tsx +220 -0
  276. package/src/sections/CourseCatalog/types.ts +76 -0
  277. package/src/sections/CourseOutline/CourseOutline.tsx +45 -14
  278. package/src/sections/CourseOutline/types.ts +6 -0
  279. package/src/sections/DiscussionThread/DiscussionThread.tsx +55 -11
  280. package/src/sections/DiscussionThread/types.ts +6 -0
  281. package/src/sections/EnrollmentWizard/EnrollmentWizard.tsx +343 -0
  282. package/src/sections/EnrollmentWizard/types.ts +65 -0
  283. package/src/sections/ExamSession/ExamSession.tsx +125 -82
  284. package/src/sections/ExamSession/types.ts +12 -1
  285. package/src/sections/FlashcardStudySession/FlashcardStudySession.tsx +53 -36
  286. package/src/sections/FlashcardStudySession/types.ts +6 -0
  287. package/src/sections/ForumBoard/ForumBoard.tsx +342 -0
  288. package/src/sections/ForumBoard/types.ts +81 -0
  289. package/src/sections/GradebookTable/GradebookTable.tsx +55 -2
  290. package/src/sections/GradebookTable/types.ts +14 -0
  291. package/src/sections/LecturePlayer/LecturePlayer.tsx +63 -37
  292. package/src/sections/LecturePlayer/types.ts +8 -0
  293. package/src/sections/LessonPage/LessonPage.tsx +40 -13
  294. package/src/sections/LessonPage/types.ts +6 -0
  295. package/src/sections/PracticeQuiz/PracticeQuiz.tsx +119 -98
  296. package/src/sections/PracticeQuiz/types.ts +6 -0
  297. package/src/sections/ProgressDashboard/ProgressDashboard.tsx +121 -67
  298. package/src/sections/ProgressDashboard/types.ts +6 -0
  299. package/src/sections/QuizSession/QuizSession.tsx +115 -67
  300. package/src/sections/QuizSession/types.ts +12 -1
  301. package/src/sections/RequirementsChecklist/RequirementsChecklist.tsx +147 -0
  302. package/src/sections/RequirementsChecklist/types.ts +44 -0
  303. package/src/sections/ResourceLibrary/ResourceLibrary.tsx +68 -17
  304. package/src/sections/ResourceLibrary/types.ts +15 -1
  305. package/src/sections/RubricView/RubricView.tsx +174 -0
  306. package/src/sections/RubricView/types.ts +58 -0
  307. package/src/sections/ScrollableQuiz/ScrollableQuiz.tsx +58 -23
  308. package/src/sections/ScrollableQuiz/types.ts +6 -0
  309. package/src/sections/StudentProfile/StudentProfile.tsx +279 -0
  310. package/src/sections/StudentProfile/types.ts +99 -0
  311. package/src/sections/SurveyForm/SurveyForm.tsx +40 -10
  312. package/src/sections/SurveyForm/types.ts +6 -0
  313. package/src/sections/_shared/merge-answers.ts +22 -0
  314. package/src/sections/_shared/section-shell.tsx +64 -0
  315. package/src/sections/_shared/use-assessment-session.ts +125 -0
  316. package/src/sections/index.ts +42 -1
  317. package/src/social/post-card.tsx +8 -19
  318. package/src/social/user-avatar.tsx +10 -5
  319. package/src/styles/globals.css +52 -41
  320. package/src/ui/badge.tsx +8 -0
  321. package/src/ui/drawer.tsx +600 -0
  322. package/src/ui/index.ts +21 -0
  323. package/src/ui/progress.tsx +4 -0
  324. package/src/ui/rich-text-editor.tsx +119 -0
  325. package/src/ui/rich-text-toolbar.tsx +157 -0
  326. package/src/ui/toast.tsx +170 -0
  327. package/src/utils/array-utils.ts +17 -0
  328. package/src/utils/debounce.ts +8 -2
  329. package/src/utils/flatten-leaves.ts +17 -0
  330. package/src/utils/format-file-size.ts +5 -0
  331. package/src/utils/format-timestamp.ts +13 -0
  332. package/src/utils/is-empty-html.ts +7 -0
  333. package/src/utils/pick-palette-color.ts +33 -0
  334. package/src/utils/shuffle.ts +8 -0
  335. package/src/utils/string-utils.ts +30 -0
  336. package/src/video/types.ts +16 -0
  337. package/src/video/video-bookmark.tsx +4 -3
  338. package/src/video/video-chapter-list.tsx +9 -4
  339. package/src/video/video-player.tsx +24 -5
  340. package/src/video/video-playlist-item.tsx +8 -3
  341. package/src/video/video-thumbnail-card.tsx +4 -0
  342. package/src/video/video-transcript.tsx +8 -5
  343. package/dist/table-BrS5cDQu.js +0 -2510
  344. package/dist/table-D6AkBBEo.cjs +0 -1
@@ -1,7 +1,7 @@
1
1
  import { VariantProps } from 'class-variance-authority';
2
2
  import * as React from "react";
3
3
  declare const alertVariants: (props?: ({
4
- variant?: "default" | "destructive" | "success" | "warning" | "info" | null | undefined;
4
+ variant?: "info" | "warning" | "default" | "destructive" | "success" | null | undefined;
5
5
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
6
6
  declare function Alert({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps<typeof alertVariants>): import("react/jsx-runtime").JSX.Element;
7
7
  declare function AlertTitle({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import { VariantProps } from 'class-variance-authority';
2
2
  import * as React from "react";
3
3
  declare const badgeVariants: (props?: ({
4
- variant?: "default" | "destructive" | "success" | "warning" | "info" | "outline" | "secondary" | "muted" | null | undefined;
4
+ variant?: "info" | "warning" | "default" | "destructive" | "success" | "muted" | "outline" | "secondary" | "palette0" | "palette1" | "palette2" | "palette3" | null | undefined;
5
5
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
6
6
  declare function Badge({ className, variant, asChild, ...props }: React.ComponentProps<"span"> & VariantProps<typeof badgeVariants> & {
7
7
  asChild?: boolean;
@@ -2,7 +2,7 @@ import { VariantProps } from 'class-variance-authority';
2
2
  import * as React from "react";
3
3
  declare const buttonVariants: (props?: ({
4
4
  variant?: "default" | "destructive" | "link" | "outline" | "secondary" | "ghost" | null | undefined;
5
- size?: "default" | "icon" | "xs" | "sm" | "lg" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
5
+ size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
6
6
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
7
7
  declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
8
8
  asChild?: boolean;
@@ -0,0 +1,84 @@
1
+ import * as React from "react";
2
+ declare const drawerContentVariants: (props?: ({
3
+ side?: "left" | "right" | null | undefined;
4
+ size?: "default" | "full" | "sm" | "lg" | "xl" | null | undefined;
5
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
6
+ /**
7
+ * A slide-in side panel for contextual content like navigation, settings, or detail views.
8
+ *
9
+ * @example
10
+ * ```tsx
11
+ * <Drawer open={open} onOpenChange={setOpen} side="right">
12
+ * <DrawerContent>
13
+ * <DrawerHeader><DrawerTitle>Panel</DrawerTitle></DrawerHeader>
14
+ * <DrawerBody>Content</DrawerBody>
15
+ * </DrawerContent>
16
+ * </Drawer>
17
+ * ```
18
+ */
19
+ interface DrawerProps {
20
+ /** Compound component children (DrawerContent, DrawerTrigger, etc.) */
21
+ children: React.ReactNode;
22
+ /** Whether the drawer is open. */
23
+ open: boolean;
24
+ /** Callback fired when the drawer should open or close. */
25
+ onOpenChange: (open: boolean) => void;
26
+ /** Which edge of the viewport the drawer slides in from. */
27
+ side?: "left" | "right";
28
+ }
29
+ declare function Drawer({ children, open, onOpenChange, side }: DrawerProps): import("react/jsx-runtime").JSX.Element;
30
+ declare function DrawerTrigger({ className, onClick, ...props }: React.ComponentProps<"button">): import("react/jsx-runtime").JSX.Element;
31
+ declare function DrawerPortal({ children }: {
32
+ children: React.ReactNode;
33
+ }): React.ReactPortal;
34
+ declare function DrawerBackdrop({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
35
+ interface DrawerContentProps extends Omit<React.ComponentProps<"div">, "size"> {
36
+ /** Width preset for the drawer panel. */
37
+ size?: "sm" | "default" | "lg" | "xl" | "full";
38
+ /** Whether to lock body scroll when the drawer is open. */
39
+ scrollLock?: boolean;
40
+ }
41
+ declare function DrawerContent({ className, children, size, scrollLock: scrollLockProp, ...props }: DrawerContentProps): import("react/jsx-runtime").JSX.Element | null;
42
+ declare function DrawerHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
43
+ declare function DrawerBody({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
44
+ declare function DrawerFooter({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
45
+ declare function DrawerTitle({ className, ...props }: React.ComponentProps<"h2">): import("react/jsx-runtime").JSX.Element;
46
+ declare function DrawerDescription({ className, ...props }: React.ComponentProps<"p">): import("react/jsx-runtime").JSX.Element;
47
+ declare function DrawerClose({ className, children, onClick, ...props }: React.ComponentProps<"button">): import("react/jsx-runtime").JSX.Element;
48
+ /**
49
+ * A vertical icon rail for switching between views inside a Drawer.
50
+ * Provides controlled navigation state to DrawerNavItem children.
51
+ *
52
+ * @example
53
+ * ```tsx
54
+ * <DrawerNav value={activeView} onValueChange={setActiveView}>
55
+ * <DrawerNavItem value="notes" icon={<FileText />} label="Notes" />
56
+ * <DrawerNavItem value="bookmarks" icon={<Bookmark />} label="Bookmarks" />
57
+ * </DrawerNav>
58
+ * ```
59
+ */
60
+ interface DrawerNavProps extends React.ComponentProps<"nav"> {
61
+ /** The value of the currently active nav item. */
62
+ value: string;
63
+ /** Callback fired when the active nav item changes. */
64
+ onValueChange: (value: string) => void;
65
+ }
66
+ declare function DrawerNav({ value, onValueChange, className, children, ...props }: DrawerNavProps): import("react/jsx-runtime").JSX.Element;
67
+ /**
68
+ * An icon button inside a DrawerNav rail. Renders a tooltip on hover.
69
+ */
70
+ interface DrawerNavItemProps extends Omit<React.ComponentProps<"button">, "value"> {
71
+ /** Unique value identifying this view. Must match a DrawerViewport's conditional content. */
72
+ value: string;
73
+ /** Icon element to render (e.g., `<FileText />`). */
74
+ icon: React.ReactNode;
75
+ /** Accessible label shown in the tooltip. */
76
+ label: string;
77
+ }
78
+ declare function DrawerNavItem({ value, icon, label, className, ...props }: DrawerNavItemProps): import("react/jsx-runtime").JSX.Element;
79
+ /**
80
+ * Content panel paired with a DrawerNav rail. Wraps header/body/footer in the
81
+ * remaining space beside the icon rail.
82
+ */
83
+ declare function DrawerViewport({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
84
+ export { Drawer, DrawerTrigger, DrawerPortal, DrawerBackdrop, DrawerContent, DrawerHeader, DrawerBody, DrawerFooter, DrawerTitle, DrawerDescription, DrawerClose, DrawerNav, DrawerNavItem, DrawerViewport, drawerContentVariants, };
@@ -6,6 +6,7 @@ export { Alert, AlertTitle, AlertDescription, alertVariants } from './alert';
6
6
  export { Separator } from './separator';
7
7
  export { AlertDialog, AlertDialogTrigger, AlertDialogPortal, AlertDialogBackdrop, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel, } from './alert-dialog';
8
8
  export { Avatar, AvatarImage, AvatarFallback } from './avatar';
9
+ export { Drawer, DrawerTrigger, DrawerPortal, DrawerBackdrop, DrawerContent, DrawerHeader, DrawerBody, DrawerFooter, DrawerTitle, DrawerDescription, DrawerClose, DrawerNav, DrawerNavItem, DrawerViewport, drawerContentVariants, } from './drawer';
9
10
  export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent, } from './card';
10
11
  export { Tabs, TabsList, TabsTrigger, TabsContent } from './tabs';
11
12
  export { Progress, progressVariants } from './progress';
@@ -13,3 +14,7 @@ export type { ProgressProps } from './progress';
13
14
  export { Table, TableHeader, TableBody, TableFooter, TableRow, TableHead, TableCell, TableCaption, } from './table';
14
15
  export { Skeleton } from './skeleton';
15
16
  export { Tooltip, TooltipTrigger, TooltipContent } from './tooltip';
17
+ export { RichTextEditor } from './rich-text-editor';
18
+ export type { RichTextEditorProps, RichTextEditorVariant } from './rich-text-editor';
19
+ export { ToastProvider, Toaster, useToast, toastVariants } from './toast';
20
+ export type { ToastOptions, ToastVariant } from './toast';
@@ -1,7 +1,7 @@
1
1
  import { VariantProps } from 'class-variance-authority';
2
2
  import * as React from "react";
3
3
  declare const progressVariants: (props?: ({
4
- variant?: "default" | "success" | "warning" | "info" | null | undefined;
4
+ variant?: "info" | "warning" | "default" | "success" | "palette0" | "palette1" | "palette2" | "palette3" | null | undefined;
5
5
  size?: "default" | "sm" | null | undefined;
6
6
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
7
7
  interface ProgressProps extends Omit<React.ComponentProps<"div">, "children">, VariantProps<typeof progressVariants> {
@@ -0,0 +1,32 @@
1
+ export type RichTextEditorVariant = "default" | "minimal";
2
+ export interface RichTextEditorProps {
3
+ /** HTML string value */
4
+ value?: string;
5
+ /** Called with the HTML string on every content change */
6
+ onChange?: (html: string) => void;
7
+ /** Placeholder text shown when the editor is empty */
8
+ placeholder?: string;
9
+ /** Makes the editor non-editable (shows content without toolbar) */
10
+ readOnly?: boolean;
11
+ /** Visually disables the editor */
12
+ disabled?: boolean;
13
+ /** `"default"` shows full toolbar; `"minimal"` shows only basic formatting */
14
+ variant?: RichTextEditorVariant;
15
+ /** Accessible label for screen readers (defaults to "Rich text editor") */
16
+ ariaLabel?: string;
17
+ className?: string;
18
+ style?: React.CSSProperties;
19
+ }
20
+ /**
21
+ * RichTextEditor wraps Tiptap to provide a rich text editing experience
22
+ * styled to match the HydraLMS design system.
23
+ *
24
+ * @example
25
+ * <RichTextEditor
26
+ * value={html}
27
+ * onChange={setHtml}
28
+ * placeholder="Write your response..."
29
+ * variant="default"
30
+ * />
31
+ */
32
+ export declare function RichTextEditor({ value, onChange, placeholder, readOnly, disabled, variant, ariaLabel, className, style, }: RichTextEditorProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,8 @@
1
+ import { Editor } from '@tiptap/react';
2
+ type RichTextToolbarVariant = "default" | "minimal";
3
+ interface RichTextToolbarProps {
4
+ editor: Editor;
5
+ variant?: RichTextToolbarVariant;
6
+ }
7
+ export declare function RichTextToolbar({ editor, variant, }: RichTextToolbarProps): import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,43 @@
1
+ import { ReactNode } from 'react';
2
+ declare const toastVariants: (props?: ({
3
+ variant?: "info" | "warning" | "success" | "error" | null | undefined;
4
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
5
+ type ToastVariant = "success" | "error" | "warning" | "info";
6
+ /** Options for creating a toast notification. */
7
+ interface ToastOptions {
8
+ /** Toast message */
9
+ message: string;
10
+ /** Optional title */
11
+ title?: string;
12
+ /** Visual variant */
13
+ variant?: ToastVariant;
14
+ /** Auto-dismiss duration in ms (default 5000, 0 = no auto-dismiss) */
15
+ duration?: number;
16
+ }
17
+ interface ToastContextValue {
18
+ toast: (options: ToastOptions) => void;
19
+ }
20
+ /**
21
+ * ToastProvider wraps your app to enable toast notifications.
22
+ * Renders a fixed-position toast container via portal.
23
+ *
24
+ * @example
25
+ * <ToastProvider>
26
+ * <App />
27
+ * </ToastProvider>
28
+ */
29
+ declare function ToastProvider({ children }: {
30
+ children: ReactNode;
31
+ }): import("react/jsx-runtime").JSX.Element;
32
+ /**
33
+ * Hook to trigger toast notifications. Must be used within a ToastProvider.
34
+ *
35
+ * @example
36
+ * const { toast } = useToast();
37
+ * toast({ message: "Saved!", variant: "success" });
38
+ */
39
+ declare function useToast(): ToastContextValue;
40
+ /** Convenience alias for ToastProvider. */
41
+ declare const Toaster: typeof ToastProvider;
42
+ export { ToastProvider, Toaster, useToast, toastVariants };
43
+ export type { ToastOptions, ToastVariant };
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Group an array of items by a key derived from each item.
3
+ */
4
+ export declare function groupBy<T>(arr: T[], keyFn: (item: T) => string): Record<string, T[]>;
@@ -1 +1,5 @@
1
- export declare function debounce<T extends (...args: Parameters<T>) => void>(fn: T, delay: number): (...args: Parameters<T>) => void;
1
+ type Cancellable<T extends (...args: Parameters<T>) => void> = ((...args: Parameters<T>) => void) & {
2
+ cancel: () => void;
3
+ };
4
+ export declare function debounce<T extends (...args: Parameters<T>) => void>(fn: T, delay: number): Cancellable<T>;
5
+ export {};
@@ -0,0 +1,6 @@
1
+ import { CurriculumItem } from '../curriculum/types';
2
+ /**
3
+ * Recursively collects the UIDs of all leaf nodes (items with no children)
4
+ * in a curriculum tree.
5
+ */
6
+ export declare function flattenLeaves(items: CurriculumItem[]): string[];
@@ -0,0 +1 @@
1
+ export declare function formatFileSize(bytes: number): string;
@@ -0,0 +1 @@
1
+ export declare function formatTimestamp(iso: string): string;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Returns true if an HTML string contains no meaningful text content.
3
+ * Tiptap returns `"<p></p>"` for an empty editor, not an empty string.
4
+ */
5
+ export declare function isEmptyHtml(html: string): boolean;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Palette CSS variable names matching --palette-0 through --palette-3
3
+ * defined in globals.css.
4
+ */
5
+ export declare const PALETTE_VARS: readonly ["var(--palette-0)", "var(--palette-1)", "var(--palette-2)", "var(--palette-3)"];
6
+ /** Number of palette colors available. */
7
+ export declare const PALETTE_COUNT: 4;
8
+ /**
9
+ * Pick a palette CSS variable by cycling through the 4 palette colors.
10
+ * Useful for assigning varied colors to list items by index.
11
+ */
12
+ export declare function pickPaletteColor(index: number): string;
13
+ /** Palette variant name for CVA-based components (badge, progress). */
14
+ export type PaletteVariant = "palette0" | "palette1" | "palette2" | "palette3";
15
+ /**
16
+ * Pick a palette variant name by cycling through the 4 palette variants.
17
+ * Useful for assigning varied CVA variants to list items by index.
18
+ */
19
+ export declare function pickPaletteVariant(index: number): PaletteVariant;
@@ -0,0 +1 @@
1
+ export declare function shuffle<T>(array: T[]): T[];
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Truncate text to a maximum length, appending a suffix if truncated.
3
+ */
4
+ export declare function truncateText(text: string, maxLength: number, suffix?: string): string;
5
+ /**
6
+ * Format a decimal value as a percentage string.
7
+ */
8
+ export declare function formatPercentage(value: number, decimals?: number): string;
9
+ /**
10
+ * Return the singular or plural form of a word based on count.
11
+ */
12
+ export declare function pluralize(count: number, singular: string, plural?: string): string;
@@ -9,6 +9,19 @@
9
9
  * onEnded={() => markLessonComplete()}
10
10
  * />
11
11
  */
12
+ /** A text track (captions, subtitles) for the video element. */
13
+ export interface VideoTrack {
14
+ /** URL of the track file (e.g., .vtt) */
15
+ src: string;
16
+ /** Track kind */
17
+ kind: "captions" | "subtitles" | "descriptions" | "chapters" | "metadata";
18
+ /** Human-readable track label (e.g., "English") */
19
+ label: string;
20
+ /** BCP 47 language code (e.g., "en") */
21
+ srcLang: string;
22
+ /** Whether this track should be active by default */
23
+ default?: boolean;
24
+ }
12
25
  export interface VideoPlayerProps {
13
26
  /** URL of the video source */
14
27
  src?: string;
@@ -30,6 +43,8 @@ export interface VideoPlayerProps {
30
43
  readOnly?: boolean;
31
44
  /** Aspect ratio of the video container */
32
45
  aspectRatio?: "16/9" | "4/3" | "1/1";
46
+ /** Array of text tracks (captions, subtitles) for the video */
47
+ tracks?: VideoTrack[];
33
48
  /** CSS class name for the root element */
34
49
  className?: string;
35
50
  /** Inline styles for the root element */
@@ -1,2 +1,2 @@
1
1
  import { VideoBookmarkProps } from './types';
2
- export declare const VideoBookmark: ({ bookmark, onSeek, onDelete, onEdit, className, style, }: VideoBookmarkProps) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const VideoBookmark: import('react').NamedExoticComponent<VideoBookmarkProps>;
@@ -1,2 +1,2 @@
1
1
  import { VideoPlayerProps } from './types';
2
- export declare const VideoPlayer: ({ src, poster, title, autoPlay, onPlay, onPause, onEnded, onTimeUpdate, readOnly, aspectRatio, className, style, }: VideoPlayerProps) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const VideoPlayer: ({ src, poster, title, autoPlay, onPlay, onPause, onEnded, onTimeUpdate, readOnly, aspectRatio, tracks, className, style, }: VideoPlayerProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,2 +1,2 @@
1
1
  import { VideoPlaylistItemProps } from './types';
2
- export declare const VideoPlaylistItem: ({ thumbnail, title, duration, status, isActive, index, onClick, className, style, }: VideoPlaylistItemProps) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const VideoPlaylistItem: import('react').NamedExoticComponent<VideoPlaylistItemProps>;
@@ -0,0 +1,137 @@
1
+ import { jsx as a, jsxs as c } from "react/jsx-runtime";
2
+ import { createContext as f, useState as p, useEffect as h, useContext as y } from "react";
3
+ const s = "hydra_key_v", g = 300 * 1e3;
4
+ function k(e) {
5
+ try {
6
+ const t = sessionStorage.getItem(s);
7
+ if (t) {
8
+ const { result: n, ts: r, key: o } = JSON.parse(t);
9
+ if (o === e && Date.now() - r < g) return n;
10
+ }
11
+ } catch {
12
+ }
13
+ return null;
14
+ }
15
+ function m(e, t) {
16
+ try {
17
+ sessionStorage.setItem(s, JSON.stringify({ result: t, ts: Date.now(), key: e }));
18
+ } catch {
19
+ }
20
+ }
21
+ function l(e) {
22
+ try {
23
+ const t = sessionStorage.getItem(s);
24
+ if (t) {
25
+ const { result: n, key: r } = JSON.parse(t);
26
+ if (r === e && n === "valid-pro") return "valid-pro";
27
+ }
28
+ } catch {
29
+ }
30
+ return "invalid";
31
+ }
32
+ async function v(e, t) {
33
+ if (!t) return "skip";
34
+ if (!e) return "no-key";
35
+ const n = k(e);
36
+ if (n) return n;
37
+ try {
38
+ const r = await fetch(`${t}?key=${encodeURIComponent(e)}`, {
39
+ method: "GET",
40
+ signal: AbortSignal.timeout(4e3)
41
+ });
42
+ if (!r.ok) return l(e);
43
+ const o = await r.json();
44
+ let i;
45
+ return o.valid ? o.plan === "pro" || o.plan === "enterprise" ? i = "valid-pro" : i = "valid-free" : i = "invalid", m(e, i), i;
46
+ } catch {
47
+ return l(e);
48
+ }
49
+ }
50
+ const u = f({
51
+ plan: "free",
52
+ isPro: !1
53
+ });
54
+ function x(e) {
55
+ switch (e) {
56
+ case "valid-pro":
57
+ case "skip":
58
+ return "pro";
59
+ case "valid-free":
60
+ case "no-key":
61
+ return "free";
62
+ case "invalid":
63
+ return "invalid";
64
+ }
65
+ }
66
+ function H({ licenseKey: e, validateUrl: t = "", children: n }) {
67
+ const [r, o] = p(() => t ? e ? "validating" : "free" : "pro");
68
+ return h(() => {
69
+ if (!t) {
70
+ o("pro");
71
+ return;
72
+ }
73
+ let i = !1;
74
+ return v(e ?? null, t).then((d) => {
75
+ i || o(x(d));
76
+ }), () => {
77
+ i = !0;
78
+ };
79
+ }, [e, t]), /* @__PURE__ */ a(u.Provider, { value: { plan: r, isPro: r === "pro" }, children: n });
80
+ }
81
+ function P() {
82
+ return y(u);
83
+ }
84
+ function S({ children: e, feature: t }) {
85
+ return /* @__PURE__ */ c("div", { style: { position: "relative" }, children: [
86
+ e,
87
+ /* @__PURE__ */ c(
88
+ "a",
89
+ {
90
+ href: "https://hydralms.com/pro",
91
+ target: "_blank",
92
+ rel: "noopener noreferrer",
93
+ style: {
94
+ position: "absolute",
95
+ bottom: 14,
96
+ right: 16,
97
+ zIndex: 9999,
98
+ display: "flex",
99
+ alignItems: "center",
100
+ gap: 5,
101
+ padding: "4px 10px 4px 8px",
102
+ background: "rgba(0,0,0,0.5)",
103
+ backdropFilter: "blur(6px)",
104
+ borderRadius: 20,
105
+ fontFamily: "system-ui, -apple-system, sans-serif",
106
+ fontSize: 11,
107
+ fontWeight: 500,
108
+ color: "rgba(255,255,255,0.85)",
109
+ letterSpacing: "0.01em",
110
+ whiteSpace: "nowrap",
111
+ lineHeight: 1,
112
+ pointerEvents: "auto",
113
+ textDecoration: "none"
114
+ },
115
+ title: t ? `"${t}" is a HydraLMS Pro module` : "Upgrade to HydraLMS Pro",
116
+ children: [
117
+ /* @__PURE__ */ a("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", style: { opacity: 0.8 }, children: /* @__PURE__ */ a("path", { d: "M12 2.69l5.66 5.66a8 8 0 1 1-11.31 0z" }) }),
118
+ "HydraLMS Pro"
119
+ ]
120
+ }
121
+ )
122
+ ] });
123
+ }
124
+ function L(e, t) {
125
+ const n = (r) => {
126
+ const { isPro: o } = P();
127
+ return o ? /* @__PURE__ */ a(e, { ...r }) : /* @__PURE__ */ a(S, { feature: t, children: /* @__PURE__ */ a(e, { ...r }) });
128
+ };
129
+ return n.displayName = `ProGated(${t})`, n;
130
+ }
131
+ export {
132
+ H,
133
+ S as P,
134
+ u as a,
135
+ P as u,
136
+ L as w
137
+ };
@@ -0,0 +1 @@
1
+ "use strict";const s=require("react/jsx-runtime"),a=require("react"),c="hydra_key_v",h=300*1e3;function y(e){try{const t=sessionStorage.getItem(c);if(t){const{result:n,ts:r,key:i}=JSON.parse(t);if(i===e&&Date.now()-r<h)return n}}catch{}return null}function g(e,t){try{sessionStorage.setItem(c,JSON.stringify({result:t,ts:Date.now(),key:e}))}catch{}}function l(e){try{const t=sessionStorage.getItem(c);if(t){const{result:n,key:r}=JSON.parse(t);if(r===e&&n==="valid-pro")return"valid-pro"}}catch{}return"invalid"}async function x(e,t){if(!t)return"skip";if(!e)return"no-key";const n=y(e);if(n)return n;try{const r=await fetch(`${t}?key=${encodeURIComponent(e)}`,{method:"GET",signal:AbortSignal.timeout(4e3)});if(!r.ok)return l(e);const i=await r.json();let o;return i.valid?i.plan==="pro"||i.plan==="enterprise"?o="valid-pro":o="valid-free":o="invalid",g(e,o),o}catch{return l(e)}}const u=a.createContext({plan:"free",isPro:!1});function k(e){switch(e){case"valid-pro":case"skip":return"pro";case"valid-free":case"no-key":return"free";case"invalid":return"invalid"}}function v({licenseKey:e,validateUrl:t="",children:n}){const[r,i]=a.useState(()=>t?e?"validating":"free":"pro");return a.useEffect(()=>{if(!t){i("pro");return}let o=!1;return x(e??null,t).then(p=>{o||i(k(p))}),()=>{o=!0}},[e,t]),s.jsx(u.Provider,{value:{plan:r,isPro:r==="pro"},children:n})}function d(){return a.useContext(u)}function f({children:e,feature:t}){return s.jsxs("div",{style:{position:"relative"},children:[e,s.jsxs("a",{href:"https://hydralms.com/pro",target:"_blank",rel:"noopener noreferrer",style:{position:"absolute",bottom:14,right:16,zIndex:9999,display:"flex",alignItems:"center",gap:5,padding:"4px 10px 4px 8px",background:"rgba(0,0,0,0.5)",backdropFilter:"blur(6px)",borderRadius:20,fontFamily:"system-ui, -apple-system, sans-serif",fontSize:11,fontWeight:500,color:"rgba(255,255,255,0.85)",letterSpacing:"0.01em",whiteSpace:"nowrap",lineHeight:1,pointerEvents:"auto",textDecoration:"none"},title:t?`"${t}" is a HydraLMS Pro module`:"Upgrade to HydraLMS Pro",children:[s.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{opacity:.8},children:s.jsx("path",{d:"M12 2.69l5.66 5.66a8 8 0 1 1-11.31 0z"})}),"HydraLMS Pro"]})]})}function P(e,t){const n=r=>{const{isPro:i}=d();return i?s.jsx(e,{...r}):s.jsx(f,{feature:t,children:s.jsx(e,{...r})})};return n.displayName=`ProGated(${t})`,n}exports.HydraLicenseContext=u;exports.HydraLicenseProvider=v;exports.ProBadge=f;exports.useHydraLicense=d;exports.withProGate=P;