@academy-sdk/sdk 0.1.0 → 0.2.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 (102) hide show
  1. package/dist/bundle.js +70 -0
  2. package/dist/manifest.json +5 -0
  3. package/dist/styles.css +3307 -0
  4. package/package.json +40 -46
  5. package/src/components/atoms/Avatar.tsx +38 -0
  6. package/src/components/atoms/Badge.tsx +32 -0
  7. package/src/components/atoms/Button.tsx +48 -0
  8. package/src/components/atoms/Card.tsx +33 -0
  9. package/src/components/atoms/Input.tsx +39 -0
  10. package/src/components/atoms/ProgressBar.tsx +52 -0
  11. package/src/components/atoms/Tabs.tsx +47 -0
  12. package/src/components/atoms/index.ts +10 -0
  13. package/src/components/index.ts +11 -0
  14. package/src/components/molecules/CourseCard.tsx +215 -0
  15. package/src/components/molecules/EmptyState.tsx +23 -0
  16. package/src/components/molecules/LoadingSpinner.tsx +27 -0
  17. package/src/components/molecules/PageHeader.tsx +22 -0
  18. package/src/components/molecules/Pagination.tsx +82 -0
  19. package/src/components/molecules/SearchInput.tsx +35 -0
  20. package/src/components/molecules/index.ts +12 -0
  21. package/src/components/organisms/CourseSidebar.tsx +276 -0
  22. package/src/components/organisms/LearnerNavbar.tsx +129 -0
  23. package/src/components/organisms/LearnerSidebar.tsx +148 -0
  24. package/src/components/organisms/LessonBookmarks.tsx +128 -0
  25. package/src/components/organisms/LessonNotes.tsx +153 -0
  26. package/src/components/organisms/index.ts +10 -0
  27. package/src/components/pages/BundleDetailPage.tsx +388 -0
  28. package/src/components/pages/CatalogBundlesPage.tsx +96 -0
  29. package/src/components/pages/CatalogCoursesPage.tsx +299 -0
  30. package/src/components/pages/CourseDetailPage.tsx +582 -0
  31. package/src/components/pages/CoursePlayerPage.tsx +481 -0
  32. package/src/components/pages/CreatorProfilePage.tsx +161 -0
  33. package/src/components/pages/LearnerSettingsPage.tsx +58 -0
  34. package/src/components/pages/ManualReviewDetailPage.tsx +254 -0
  35. package/src/components/pages/ManualReviewPage.tsx +228 -0
  36. package/src/components/pages/MessagesPage.tsx +285 -0
  37. package/src/components/pages/MyLearningPage.tsx +239 -0
  38. package/src/components/pages/PaymentCancelPage.tsx +74 -0
  39. package/src/components/pages/PaymentSuccessPage.tsx +73 -0
  40. package/src/components/pages/index.ts +13 -0
  41. package/src/components/utils.ts +6 -0
  42. package/src/contracts/components.contract.ts +89 -0
  43. package/src/contracts/index.ts +4 -0
  44. package/src/contracts/layout.contract.ts +36 -0
  45. package/src/contracts/pages.contract.ts +275 -0
  46. package/src/contracts/template.contract.ts +100 -0
  47. package/src/default-template.tsx +52 -0
  48. package/src/hooks/index.ts +28 -0
  49. package/src/hooks/sdk-context.tsx +152 -0
  50. package/src/hooks/useAiCoach.ts +27 -0
  51. package/src/hooks/useBookmarks.ts +35 -0
  52. package/src/hooks/useCourseSearch.ts +18 -0
  53. package/src/hooks/useDebounce.ts +19 -0
  54. package/src/hooks/useMyBundles.ts +21 -0
  55. package/src/hooks/useMyCourses.ts +20 -0
  56. package/src/hooks/useNotes.ts +35 -0
  57. package/src/hooks/useNotifications.ts +16 -0
  58. package/src/hooks/useTheme.ts +17 -0
  59. package/src/hooks/useToast.ts +17 -0
  60. package/src/hooks/useUser.ts +33 -0
  61. package/src/index.ts +33 -0
  62. package/src/layouts/DefaultLayout.tsx +58 -0
  63. package/src/manifest.json +5 -0
  64. package/src/styles.css +43 -0
  65. package/src/types/ai-coach.ts +25 -0
  66. package/src/types/bookmarks.ts +20 -0
  67. package/src/types/bundle.ts +119 -0
  68. package/src/types/common.ts +24 -0
  69. package/src/types/course.ts +135 -0
  70. package/src/types/enrollment.ts +35 -0
  71. package/src/types/index.ts +15 -0
  72. package/src/types/lesson.ts +106 -0
  73. package/src/types/manual-review.ts +116 -0
  74. package/src/types/messaging.ts +109 -0
  75. package/src/types/notification.ts +30 -0
  76. package/src/types/payment.ts +40 -0
  77. package/src/types/progress.ts +19 -0
  78. package/src/types/rating.ts +20 -0
  79. package/src/types/search.ts +31 -0
  80. package/src/types/user.ts +16 -0
  81. package/src/utils/formatters.ts +74 -0
  82. package/src/utils/index.ts +8 -0
  83. package/dist/components/atoms/index.cjs +0 -318
  84. package/dist/components/atoms/index.js +0 -288
  85. package/dist/components/index.cjs +0 -1275
  86. package/dist/components/index.js +0 -1245
  87. package/dist/components/molecules/index.cjs +0 -334
  88. package/dist/components/molecules/index.js +0 -311
  89. package/dist/components/organisms/index.cjs +0 -855
  90. package/dist/components/organisms/index.js +0 -825
  91. package/dist/components/pages/index.cjs +0 -3306
  92. package/dist/components/pages/index.js +0 -3315
  93. package/dist/contracts/index.cjs +0 -52
  94. package/dist/contracts/index.js +0 -29
  95. package/dist/hooks/index.cjs +0 -165
  96. package/dist/hooks/index.js +0 -142
  97. package/dist/index.cjs +0 -630
  98. package/dist/index.js +0 -600
  99. package/dist/types/index.cjs +0 -18
  100. package/dist/types/index.js +0 -0
  101. package/dist/utils/index.cjs +0 -80
  102. package/dist/utils/index.js +0 -57
@@ -1,80 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/utils/index.ts
21
- var utils_exports = {};
22
- __export(utils_exports, {
23
- calculateProgress: () => calculateProgress,
24
- formatDate: () => formatDate,
25
- formatDuration: () => formatDuration,
26
- formatPrice: () => formatPrice,
27
- formatRelativeTime: () => formatRelativeTime,
28
- truncateText: () => truncateText
29
- });
30
- module.exports = __toCommonJS(utils_exports);
31
-
32
- // src/utils/formatters.ts
33
- function formatDuration(seconds) {
34
- if (!seconds || seconds < 0) return "0:00";
35
- const hours = Math.floor(seconds / 3600);
36
- const minutes = Math.floor(seconds % 3600 / 60);
37
- const secs = Math.floor(seconds % 60);
38
- if (hours > 0) {
39
- return `${hours}:${minutes.toString().padStart(2, "0")}:${secs.toString().padStart(2, "0")}`;
40
- }
41
- return `${minutes}:${secs.toString().padStart(2, "0")}`;
42
- }
43
- function formatPrice(amount, currency = "USD") {
44
- return new Intl.NumberFormat("en-US", {
45
- style: "currency",
46
- currency,
47
- minimumFractionDigits: 0,
48
- maximumFractionDigits: 2
49
- }).format(amount);
50
- }
51
- function formatDate(dateString, options) {
52
- const date = new Date(dateString);
53
- return date.toLocaleDateString("en-US", options != null ? options : {
54
- year: "numeric",
55
- month: "short",
56
- day: "numeric"
57
- });
58
- }
59
- function formatRelativeTime(dateString) {
60
- const date = new Date(dateString);
61
- const now = /* @__PURE__ */ new Date();
62
- const diffMs = now.getTime() - date.getTime();
63
- const diffSecs = Math.floor(diffMs / 1e3);
64
- const diffMins = Math.floor(diffSecs / 60);
65
- const diffHours = Math.floor(diffMins / 60);
66
- const diffDays = Math.floor(diffHours / 24);
67
- if (diffSecs < 60) return "just now";
68
- if (diffMins < 60) return `${diffMins}m ago`;
69
- if (diffHours < 24) return `${diffHours}h ago`;
70
- if (diffDays < 7) return `${diffDays}d ago`;
71
- return formatDate(dateString);
72
- }
73
- function calculateProgress(completed, total) {
74
- if (total === 0) return 0;
75
- return Math.round(completed / total * 100);
76
- }
77
- function truncateText(text, maxLength) {
78
- if (text.length <= maxLength) return text;
79
- return text.slice(0, maxLength).trimEnd() + "...";
80
- }
@@ -1,57 +0,0 @@
1
- // src/utils/formatters.ts
2
- function formatDuration(seconds) {
3
- if (!seconds || seconds < 0) return "0:00";
4
- const hours = Math.floor(seconds / 3600);
5
- const minutes = Math.floor(seconds % 3600 / 60);
6
- const secs = Math.floor(seconds % 60);
7
- if (hours > 0) {
8
- return `${hours}:${minutes.toString().padStart(2, "0")}:${secs.toString().padStart(2, "0")}`;
9
- }
10
- return `${minutes}:${secs.toString().padStart(2, "0")}`;
11
- }
12
- function formatPrice(amount, currency = "USD") {
13
- return new Intl.NumberFormat("en-US", {
14
- style: "currency",
15
- currency,
16
- minimumFractionDigits: 0,
17
- maximumFractionDigits: 2
18
- }).format(amount);
19
- }
20
- function formatDate(dateString, options) {
21
- const date = new Date(dateString);
22
- return date.toLocaleDateString("en-US", options != null ? options : {
23
- year: "numeric",
24
- month: "short",
25
- day: "numeric"
26
- });
27
- }
28
- function formatRelativeTime(dateString) {
29
- const date = new Date(dateString);
30
- const now = /* @__PURE__ */ new Date();
31
- const diffMs = now.getTime() - date.getTime();
32
- const diffSecs = Math.floor(diffMs / 1e3);
33
- const diffMins = Math.floor(diffSecs / 60);
34
- const diffHours = Math.floor(diffMins / 60);
35
- const diffDays = Math.floor(diffHours / 24);
36
- if (diffSecs < 60) return "just now";
37
- if (diffMins < 60) return `${diffMins}m ago`;
38
- if (diffHours < 24) return `${diffHours}h ago`;
39
- if (diffDays < 7) return `${diffDays}d ago`;
40
- return formatDate(dateString);
41
- }
42
- function calculateProgress(completed, total) {
43
- if (total === 0) return 0;
44
- return Math.round(completed / total * 100);
45
- }
46
- function truncateText(text, maxLength) {
47
- if (text.length <= maxLength) return text;
48
- return text.slice(0, maxLength).trimEnd() + "...";
49
- }
50
- export {
51
- calculateProgress,
52
- formatDate,
53
- formatDuration,
54
- formatPrice,
55
- formatRelativeTime,
56
- truncateText
57
- };