@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.
- package/dist/StudentProfile-BPsZBaJj.cjs +1 -0
- package/dist/StudentProfile-Cw2p-RZn.js +3273 -0
- package/dist/assessment-toolbar/question-navigator.d.ts +1 -1
- package/dist/assessment-toolbar/timer-display.d.ts +1 -1
- package/dist/common/index.d.ts +2 -1
- package/dist/common/pagination.d.ts +26 -0
- package/dist/common/types.d.ts +1 -0
- package/dist/components.css +1 -1
- package/dist/content/audio-player.d.ts +22 -0
- package/dist/content/code-block.d.ts +30 -0
- package/dist/content/embed-block.d.ts +28 -0
- package/dist/content/index.d.ts +6 -0
- package/dist/content/types.d.ts +24 -0
- package/dist/curriculum/course-card.d.ts +51 -0
- package/dist/curriculum/index.d.ts +2 -0
- package/dist/curriculum/types.d.ts +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +495 -439
- package/dist/license/HydraContext.d.ts +16 -0
- package/dist/license/ProBadge.d.ts +6 -0
- package/dist/license/index.d.ts +7 -0
- package/dist/license/tiers.d.ts +6 -0
- package/dist/license/useHydraLicense.d.ts +6 -0
- package/dist/license/validate.d.ts +13 -0
- package/dist/license/withProGate.d.ts +6 -0
- package/dist/modules/AssignmentModule/AssignmentModule.d.ts +4 -7
- package/dist/modules/AssignmentModule/types.d.ts +5 -1
- package/dist/modules/CertificateModule/CertificateModule.d.ts +4 -8
- package/dist/modules/CertificateModule/types.d.ts +6 -4
- package/dist/modules/CourseCatalogModule/CourseCatalogModule.d.ts +5 -0
- package/dist/modules/CourseCatalogModule/types.d.ts +43 -0
- package/dist/modules/CoursePlayer/CoursePlayer.d.ts +4 -1
- package/dist/modules/DiscussionModule/DiscussionModule.d.ts +4 -7
- package/dist/modules/ExamModule/ExamModule.d.ts +4 -7
- package/dist/modules/ExamModule/types.d.ts +5 -14
- package/dist/modules/FlashcardLab/FlashcardLab.d.ts +4 -1
- package/dist/modules/FlashcardLab/types.d.ts +2 -0
- package/dist/modules/GradeCenterModule/GradeCenterModule.d.ts +4 -8
- package/dist/modules/GradeCenterModule/types.d.ts +2 -0
- package/dist/modules/QuizModule/QuizModule.d.ts +4 -1
- package/dist/modules/QuizModule/types.d.ts +5 -14
- package/dist/modules/StudentDashboardModule/StudentDashboardModule.d.ts +5 -0
- package/dist/modules/StudentDashboardModule/types.d.ts +54 -0
- package/dist/modules/StudentProfileModule/StudentProfileModule.d.ts +5 -0
- package/dist/modules/StudentProfileModule/types.d.ts +43 -0
- package/dist/modules/SurveyModule/SurveyModule.d.ts +4 -6
- package/dist/modules/SurveyModule/types.d.ts +2 -0
- package/dist/modules/_shared/assessment-intro.d.ts +16 -0
- package/dist/modules/_shared/assessment-results.d.ts +23 -0
- package/dist/modules/_shared/types.d.ts +10 -0
- package/dist/modules/_shared/use-timer.d.ts +9 -0
- package/dist/modules/index.d.ts +6 -0
- package/dist/modules.cjs +1 -1
- package/dist/modules.js +1267 -854
- package/dist/progress/types.d.ts +2 -0
- package/dist/provider/HydraProvider.d.ts +5 -1
- package/dist/questions/choice.d.ts +1 -1
- package/dist/questions/confidence-indicator.d.ts +37 -0
- package/dist/questions/essay.d.ts +1 -1
- package/dist/questions/fill-in-the-blank.d.ts +1 -1
- package/dist/questions/hotspot.d.ts +1 -1
- package/dist/questions/index.d.ts +2 -0
- package/dist/questions/inline-choice.d.ts +1 -1
- package/dist/questions/matching.d.ts +1 -1
- package/dist/questions/multiple-choice.d.ts +1 -1
- package/dist/questions/numeric.d.ts +1 -1
- package/dist/questions/ordering.d.ts +1 -1
- package/dist/questions/question-renderer.d.ts +1 -1
- package/dist/questions/scenario.d.ts +1 -1
- package/dist/questions/spreadsheet.d.ts +1 -1
- package/dist/questions/true-false.d.ts +1 -1
- package/dist/sections/AdaptiveLearningPath/AdaptiveLearningPath.d.ts +5 -0
- package/dist/sections/AdaptiveLearningPath/path-connector.d.ts +8 -0
- package/dist/sections/AdaptiveLearningPath/path-milestone-marker.d.ts +7 -0
- package/dist/sections/AdaptiveLearningPath/path-node-card.d.ts +10 -0
- package/dist/sections/AdaptiveLearningPath/path-skill-bar.d.ts +8 -0
- package/dist/sections/AdaptiveLearningPath/types.d.ts +136 -0
- package/dist/sections/AnnouncementFeed/AnnouncementFeed.d.ts +1 -1
- package/dist/sections/AnnouncementFeed/types.d.ts +15 -1
- package/dist/sections/AssessmentReview/AssessmentReview.d.ts +1 -1
- package/dist/sections/AssessmentReview/types.d.ts +6 -0
- package/dist/sections/AssignmentSubmission/AssignmentSubmission.d.ts +1 -1
- package/dist/sections/AssignmentSubmission/types.d.ts +6 -0
- package/dist/sections/CertificateViewer/CertificateViewer.d.ts +1 -1
- package/dist/sections/CertificateViewer/certificate-variants.d.ts +42 -0
- package/dist/sections/CertificateViewer/types.d.ts +6 -0
- package/dist/sections/ContentAuthoringStudio/ContentAuthoringStudio.d.ts +5 -0
- package/dist/sections/ContentAuthoringStudio/block-editor-item.d.ts +14 -0
- package/dist/sections/ContentAuthoringStudio/block-type-picker.d.ts +12 -0
- package/dist/sections/ContentAuthoringStudio/types.d.ts +67 -0
- package/dist/sections/CourseCatalog/CourseCatalog.d.ts +2 -0
- package/dist/sections/CourseCatalog/types.d.ts +80 -0
- package/dist/sections/CourseOutline/CourseOutline.d.ts +1 -1
- package/dist/sections/CourseOutline/types.d.ts +6 -0
- package/dist/sections/DiscussionThread/DiscussionThread.d.ts +1 -1
- package/dist/sections/DiscussionThread/types.d.ts +6 -0
- package/dist/sections/EnrollmentWizard/EnrollmentWizard.d.ts +2 -0
- package/dist/sections/EnrollmentWizard/types.d.ts +66 -0
- package/dist/sections/ExamSession/ExamSession.d.ts +1 -1
- package/dist/sections/ExamSession/types.d.ts +6 -0
- package/dist/sections/FlashcardStudySession/FlashcardStudySession.d.ts +1 -1
- package/dist/sections/FlashcardStudySession/types.d.ts +6 -0
- package/dist/sections/ForumBoard/ForumBoard.d.ts +1 -1
- package/dist/sections/ForumBoard/types.d.ts +14 -0
- package/dist/sections/GradebookTable/GradebookTable.d.ts +1 -1
- package/dist/sections/GradebookTable/types.d.ts +14 -0
- package/dist/sections/LecturePlayer/LecturePlayer.d.ts +1 -1
- package/dist/sections/LecturePlayer/types.d.ts +8 -0
- package/dist/sections/LessonPage/LessonPage.d.ts +1 -1
- package/dist/sections/LessonPage/types.d.ts +6 -0
- package/dist/sections/PracticeQuiz/PracticeQuiz.d.ts +1 -1
- package/dist/sections/PracticeQuiz/types.d.ts +6 -0
- package/dist/sections/ProgressDashboard/ProgressDashboard.d.ts +1 -1
- package/dist/sections/ProgressDashboard/types.d.ts +6 -0
- package/dist/sections/QuizSession/QuizSession.d.ts +1 -1
- package/dist/sections/QuizSession/types.d.ts +6 -0
- package/dist/sections/RequirementsChecklist/RequirementsChecklist.d.ts +1 -1
- package/dist/sections/RequirementsChecklist/types.d.ts +6 -0
- package/dist/sections/ResourceLibrary/ResourceLibrary.d.ts +1 -1
- package/dist/sections/ResourceLibrary/types.d.ts +15 -1
- package/dist/sections/RubricView/RubricView.d.ts +1 -1
- package/dist/sections/RubricView/types.d.ts +6 -0
- package/dist/sections/ScrollableQuiz/ScrollableQuiz.d.ts +1 -1
- package/dist/sections/ScrollableQuiz/types.d.ts +6 -0
- package/dist/sections/StudentProfile/StudentProfile.d.ts +2 -0
- package/dist/sections/StudentProfile/types.d.ts +98 -0
- package/dist/sections/SurveyForm/SurveyForm.d.ts +1 -1
- package/dist/sections/SurveyForm/types.d.ts +6 -0
- package/dist/sections/_shared/merge-answers.d.ts +9 -0
- package/dist/sections/_shared/section-shell.d.ts +20 -0
- package/dist/sections/_shared/use-assessment-session.d.ts +30 -0
- package/dist/sections/index.d.ts +10 -0
- package/dist/sections.cjs +1 -1
- package/dist/sections.js +1361 -307
- package/dist/ui/badge.d.ts +1 -1
- package/dist/ui/index.d.ts +2 -0
- package/dist/ui/progress.d.ts +1 -1
- package/dist/ui/rich-text-editor.d.ts +3 -1
- package/dist/ui/toast.d.ts +43 -0
- package/dist/utils/debounce.d.ts +5 -1
- package/dist/utils/pick-palette-color.d.ts +19 -0
- package/dist/video/types.d.ts +15 -0
- package/dist/video/video-player.d.ts +1 -1
- package/dist/withProGate-BJdu1T9Y.cjs +2 -0
- package/dist/withProGate-BvFc7Jwy.js +4975 -0
- package/package.json +57 -226
- package/src/assessment-toolbar/question-navigator.tsx +10 -5
- package/src/assessment-toolbar/timer-display.tsx +4 -3
- package/src/assessment-toolbar/use-countdown.ts +1 -1
- package/src/common/empty-state.tsx +1 -0
- package/src/common/index.ts +2 -0
- package/src/common/pagination.tsx +135 -0
- package/src/common/search-input.tsx +2 -1
- package/src/common/types.ts +2 -0
- package/src/content/attachment-list.tsx +2 -0
- package/src/content/audio-player.tsx +196 -0
- package/src/content/code-block.tsx +113 -0
- package/src/content/content-block.tsx +64 -0
- package/src/content/embed-block.tsx +78 -0
- package/src/content/file-upload-zone.tsx +10 -0
- package/src/content/index.ts +6 -0
- package/src/content/types.ts +5 -0
- package/src/curriculum/course-card.tsx +199 -0
- package/src/curriculum/curriculum-item.tsx +3 -3
- package/src/curriculum/curriculum-tree.tsx +20 -13
- package/src/curriculum/index.ts +2 -0
- package/src/curriculum/types.ts +2 -2
- package/src/flashcards/flashcard.tsx +28 -8
- package/src/index.ts +3 -0
- package/src/license/HydraContext.tsx +62 -0
- package/src/license/ProBadge.tsx +43 -0
- package/src/license/index.ts +7 -0
- package/src/license/tiers.ts +34 -0
- package/src/license/useHydraLicense.ts +10 -0
- package/src/license/validate.ts +90 -0
- package/src/license/withProGate.tsx +21 -0
- package/src/modules/AssignmentModule/AssignmentModule.tsx +17 -8
- package/src/modules/AssignmentModule/types.ts +5 -1
- package/src/modules/CertificateModule/CertificateModule.tsx +21 -9
- package/src/modules/CertificateModule/types.ts +6 -4
- package/src/modules/CourseCatalogModule/CourseCatalogModule.tsx +126 -0
- package/src/modules/CourseCatalogModule/types.ts +47 -0
- package/src/modules/CoursePlayer/CoursePlayer.tsx +39 -22
- package/src/modules/DiscussionModule/DiscussionModule.tsx +57 -22
- package/src/modules/ExamModule/ExamModule.tsx +64 -198
- package/src/modules/ExamModule/types.ts +5 -14
- package/src/modules/FlashcardLab/FlashcardLab.tsx +10 -5
- package/src/modules/FlashcardLab/types.ts +2 -0
- package/src/modules/GradeCenterModule/GradeCenterModule.tsx +7 -2
- package/src/modules/GradeCenterModule/types.ts +2 -0
- package/src/modules/QuizModule/QuizModule.tsx +49 -169
- package/src/modules/QuizModule/types.ts +5 -15
- package/src/modules/StudentDashboardModule/StudentDashboardModule.tsx +117 -0
- package/src/modules/StudentDashboardModule/types.ts +56 -0
- package/src/modules/StudentProfileModule/StudentProfileModule.tsx +289 -0
- package/src/modules/StudentProfileModule/types.ts +45 -0
- package/src/modules/SurveyModule/SurveyModule.tsx +9 -4
- package/src/modules/SurveyModule/types.ts +2 -0
- package/src/modules/_shared/assessment-intro.tsx +75 -0
- package/src/modules/_shared/assessment-results.tsx +133 -0
- package/src/modules/_shared/types.ts +11 -0
- package/src/modules/_shared/use-timer.ts +49 -0
- package/src/modules/index.ts +9 -0
- package/src/progress/achievement-badge.tsx +3 -3
- package/src/progress/grade-indicator.tsx +9 -1
- package/src/progress/progress-ring.tsx +2 -1
- package/src/progress/stat-card.tsx +14 -2
- package/src/progress/types.ts +2 -0
- package/src/provider/HydraProvider.tsx +15 -6
- package/src/questions/choice.tsx +13 -6
- package/src/questions/confidence-indicator.tsx +107 -0
- package/src/questions/essay.tsx +6 -4
- package/src/questions/fill-in-the-blank.tsx +8 -4
- package/src/questions/hotspot.tsx +4 -4
- package/src/questions/index.ts +2 -0
- package/src/questions/inline-choice.tsx +5 -4
- package/src/questions/matching.tsx +5 -4
- package/src/questions/multiple-choice.tsx +13 -6
- package/src/questions/numeric.tsx +8 -4
- package/src/questions/ordering.tsx +12 -4
- package/src/questions/question-renderer.tsx +3 -2
- package/src/questions/scenario.tsx +4 -4
- package/src/questions/spreadsheet.tsx +5 -4
- package/src/questions/true-false.tsx +13 -6
- package/src/sections/AdaptiveLearningPath/AdaptiveLearningPath.tsx +251 -0
- package/src/sections/AdaptiveLearningPath/path-connector.tsx +27 -0
- package/src/sections/AdaptiveLearningPath/path-milestone-marker.tsx +50 -0
- package/src/sections/AdaptiveLearningPath/path-node-card.tsx +166 -0
- package/src/sections/AdaptiveLearningPath/path-skill-bar.tsx +49 -0
- package/src/sections/AdaptiveLearningPath/types.ts +159 -0
- package/src/sections/AnnouncementFeed/AnnouncementFeed.tsx +64 -8
- package/src/sections/AnnouncementFeed/types.ts +15 -1
- package/src/sections/AssessmentReview/AssessmentReview.tsx +37 -0
- package/src/sections/AssessmentReview/types.ts +6 -0
- package/src/sections/AssignmentSubmission/AssignmentSubmission.tsx +37 -1
- package/src/sections/AssignmentSubmission/types.ts +6 -0
- package/src/sections/CertificateViewer/CertificateViewer.tsx +29 -227
- package/src/sections/CertificateViewer/certificate-variants.tsx +170 -0
- package/src/sections/CertificateViewer/types.ts +6 -0
- package/src/sections/ContentAuthoringStudio/ContentAuthoringStudio.tsx +289 -0
- package/src/sections/ContentAuthoringStudio/block-editor-item.tsx +487 -0
- package/src/sections/ContentAuthoringStudio/block-type-picker.tsx +123 -0
- package/src/sections/ContentAuthoringStudio/types.ts +67 -0
- package/src/sections/CourseCatalog/CourseCatalog.tsx +220 -0
- package/src/sections/CourseCatalog/types.ts +76 -0
- package/src/sections/CourseOutline/CourseOutline.tsx +41 -0
- package/src/sections/CourseOutline/types.ts +6 -0
- package/src/sections/DiscussionThread/DiscussionThread.tsx +42 -1
- package/src/sections/DiscussionThread/types.ts +6 -0
- package/src/sections/EnrollmentWizard/EnrollmentWizard.tsx +343 -0
- package/src/sections/EnrollmentWizard/types.ts +65 -0
- package/src/sections/ExamSession/ExamSession.tsx +100 -94
- package/src/sections/ExamSession/types.ts +6 -0
- package/src/sections/FlashcardStudySession/FlashcardStudySession.tsx +53 -36
- package/src/sections/FlashcardStudySession/types.ts +6 -0
- package/src/sections/ForumBoard/ForumBoard.tsx +67 -7
- package/src/sections/ForumBoard/types.ts +14 -0
- package/src/sections/GradebookTable/GradebookTable.tsx +54 -1
- package/src/sections/GradebookTable/types.ts +14 -0
- package/src/sections/LecturePlayer/LecturePlayer.tsx +63 -37
- package/src/sections/LecturePlayer/types.ts +8 -0
- package/src/sections/LessonPage/LessonPage.tsx +34 -6
- package/src/sections/LessonPage/types.ts +6 -0
- package/src/sections/PracticeQuiz/PracticeQuiz.tsx +106 -74
- package/src/sections/PracticeQuiz/types.ts +6 -0
- package/src/sections/ProgressDashboard/ProgressDashboard.tsx +64 -10
- package/src/sections/ProgressDashboard/types.ts +6 -0
- package/src/sections/QuizSession/QuizSession.tsx +71 -82
- package/src/sections/QuizSession/types.ts +6 -0
- package/src/sections/RequirementsChecklist/RequirementsChecklist.tsx +41 -1
- package/src/sections/RequirementsChecklist/types.ts +6 -0
- package/src/sections/ResourceLibrary/ResourceLibrary.tsx +64 -8
- package/src/sections/ResourceLibrary/types.ts +15 -1
- package/src/sections/RubricView/RubricView.tsx +37 -1
- package/src/sections/RubricView/types.ts +6 -0
- package/src/sections/ScrollableQuiz/ScrollableQuiz.tsx +36 -15
- package/src/sections/ScrollableQuiz/types.ts +6 -0
- package/src/sections/StudentProfile/StudentProfile.tsx +279 -0
- package/src/sections/StudentProfile/types.ts +99 -0
- package/src/sections/SurveyForm/SurveyForm.tsx +32 -5
- package/src/sections/SurveyForm/types.ts +6 -0
- package/src/sections/_shared/merge-answers.ts +22 -0
- package/src/sections/_shared/section-shell.tsx +64 -0
- package/src/sections/_shared/use-assessment-session.ts +125 -0
- package/src/sections/index.ts +40 -0
- package/src/social/user-avatar.tsx +9 -5
- package/src/styles/globals.css +39 -41
- package/src/ui/badge.tsx +8 -0
- package/src/ui/index.ts +2 -0
- package/src/ui/progress.tsx +4 -0
- package/src/ui/rich-text-editor.tsx +10 -0
- package/src/ui/rich-text-toolbar.tsx +2 -1
- package/src/ui/toast.tsx +170 -0
- package/src/utils/debounce.ts +8 -2
- package/src/utils/pick-palette-color.ts +33 -0
- package/src/video/types.ts +16 -0
- package/src/video/video-player.tsx +27 -6
- package/dist/ForumBoard-CHXU3mjC.js +0 -2207
- package/dist/ForumBoard-d1w5-r6n.cjs +0 -1
- package/dist/tabs-DRM2Iq_J.cjs +0 -172
- 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.
|
|
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": "./
|
|
30
|
-
"module": "./
|
|
31
|
-
"types": "./
|
|
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": "./
|
|
44
|
-
"
|
|
43
|
+
"types": "./dist/index.d.ts",
|
|
44
|
+
"import": "./dist/index.js",
|
|
45
|
+
"require": "./dist/index.cjs"
|
|
45
46
|
},
|
|
46
47
|
"./sections": {
|
|
47
|
-
"types": "./
|
|
48
|
-
"
|
|
48
|
+
"types": "./dist/sections/index.d.ts",
|
|
49
|
+
"import": "./dist/sections.js",
|
|
50
|
+
"require": "./dist/sections.cjs"
|
|
49
51
|
},
|
|
50
|
-
"./sections
|
|
51
|
-
"types": "./src/sections
|
|
52
|
-
"default": "./src/sections
|
|
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": "./
|
|
132
|
-
"
|
|
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
|
|
143
|
-
"types": "./src/modules
|
|
144
|
-
"default": "./src/modules
|
|
61
|
+
"./modules/*": {
|
|
62
|
+
"types": "./src/modules/*/index.ts",
|
|
63
|
+
"default": "./src/modules/*/index.ts"
|
|
145
64
|
},
|
|
146
|
-
"./
|
|
147
|
-
"types": "./
|
|
148
|
-
"
|
|
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
|
-
"./
|
|
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
|
-
<
|
|
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
|
-
</
|
|
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
|
+
});
|
|
@@ -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">
|
package/src/common/index.ts
CHANGED
|
@@ -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;
|
package/src/common/types.ts
CHANGED
|
@@ -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>
|