@vllnt/ui 0.1.4 → 0.1.7-canary.2c4792f

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 (225) hide show
  1. package/dist/components/accordion/accordion.js +172 -0
  2. package/dist/components/accordion/index.js +12 -0
  3. package/dist/components/alert/alert.js +53 -0
  4. package/dist/components/alert/index.js +7 -0
  5. package/dist/components/alert-dialog/alert-dialog.js +117 -0
  6. package/dist/components/alert-dialog/index.js +26 -0
  7. package/dist/components/aspect-ratio/aspect-ratio.js +6 -0
  8. package/dist/components/aspect-ratio/index.js +4 -0
  9. package/dist/components/avatar/avatar.js +43 -0
  10. package/dist/components/avatar/index.js +6 -0
  11. package/dist/components/badge/badge.js +26 -0
  12. package/dist/components/badge/index.js +5 -0
  13. package/dist/components/blog-card/blog-card.js +50 -0
  14. package/dist/components/blog-card/index.js +5 -0
  15. package/dist/components/breadcrumb/breadcrumb.js +61 -0
  16. package/dist/components/breadcrumb/index.js +4 -0
  17. package/dist/components/button/button.js +48 -0
  18. package/dist/components/button/index.js +5 -0
  19. package/dist/components/calendar/calendar.js +71 -0
  20. package/dist/components/calendar/index.js +4 -0
  21. package/dist/components/callout/callout.js +59 -0
  22. package/dist/components/callout/index.js +4 -0
  23. package/dist/components/card/card.js +64 -0
  24. package/dist/components/card/index.js +16 -0
  25. package/dist/components/carousel/carousel.js +239 -0
  26. package/dist/components/carousel/index.js +14 -0
  27. package/dist/components/category-filter/category-filter.js +34 -0
  28. package/dist/components/category-filter/index.js +4 -0
  29. package/dist/components/chart/area-chart.js +99 -0
  30. package/dist/components/chart/bar-chart.js +80 -0
  31. package/dist/components/chart/index.js +3 -0
  32. package/dist/components/chart/line-chart.js +97 -0
  33. package/dist/components/checkbox/checkbox.js +28 -0
  34. package/dist/components/checkbox/index.js +4 -0
  35. package/dist/components/checklist/checklist.js +181 -0
  36. package/dist/components/checklist/index.js +6 -0
  37. package/dist/components/code-block/code-block.js +126 -0
  38. package/dist/components/code-block/index.js +4 -0
  39. package/dist/components/code-playground/code-playground.js +86 -0
  40. package/dist/components/code-playground/index.js +8 -0
  41. package/dist/components/collapsible/collapsible.js +10 -0
  42. package/dist/components/collapsible/index.js +10 -0
  43. package/dist/components/command/command.js +123 -0
  44. package/dist/components/command/index.js +22 -0
  45. package/dist/components/comparison/comparison.js +121 -0
  46. package/dist/components/comparison/index.js +8 -0
  47. package/dist/components/completion-dialog/completion-dialog.js +173 -0
  48. package/dist/components/completion-dialog/index.js +6 -0
  49. package/dist/components/content-intro/content-intro.js +144 -0
  50. package/dist/components/content-intro/index.js +6 -0
  51. package/dist/components/context-menu/context-menu.js +154 -0
  52. package/dist/components/context-menu/index.js +34 -0
  53. package/dist/components/cookie-consent/cookie-consent.js +175 -0
  54. package/dist/components/cookie-consent/index.js +8 -0
  55. package/dist/components/dialog/dialog.js +105 -0
  56. package/dist/components/dialog/index.js +24 -0
  57. package/dist/components/drawer/drawer.js +102 -0
  58. package/dist/components/drawer/index.js +24 -0
  59. package/dist/components/dropdown-menu/dropdown-menu.js +151 -0
  60. package/dist/components/dropdown-menu/index.js +34 -0
  61. package/dist/components/exercise/exercise.js +112 -0
  62. package/dist/components/exercise/index.js +4 -0
  63. package/dist/components/faq/faq.js +56 -0
  64. package/dist/components/faq/index.js +5 -0
  65. package/dist/components/filter-bar/filter-bar.js +244 -0
  66. package/dist/components/filter-bar/index.js +6 -0
  67. package/dist/components/floating-action-button/floating-action-button.js +35 -0
  68. package/dist/components/floating-action-button/index.js +6 -0
  69. package/dist/components/flow-diagram/flow-canvas.js +109 -0
  70. package/dist/components/flow-diagram/flow-controls.js +140 -0
  71. package/dist/components/flow-diagram/flow-diagram.js +114 -0
  72. package/dist/components/flow-diagram/flow-error-boundary.js +63 -0
  73. package/dist/components/flow-diagram/flow-fullscreen.js +58 -0
  74. package/dist/components/flow-diagram/index.js +12 -0
  75. package/dist/components/flow-diagram/types.js +0 -0
  76. package/dist/components/flow-diagram/use-flow-diagram.js +146 -0
  77. package/dist/components/horizontal-scroll-row/horizontal-scroll-row.js +66 -0
  78. package/dist/components/horizontal-scroll-row/index.js +6 -0
  79. package/dist/components/hover-card/hover-card.js +26 -0
  80. package/dist/components/hover-card/index.js +6 -0
  81. package/dist/components/index.js +641 -0
  82. package/dist/components/inline-input/index.js +4 -0
  83. package/dist/components/inline-input/inline-input.js +42 -0
  84. package/dist/components/input/index.js +4 -0
  85. package/dist/components/input/input.js +23 -0
  86. package/dist/components/input-otp/index.js +12 -0
  87. package/dist/components/input-otp/input-otp.js +54 -0
  88. package/dist/components/key-concept/index.js +8 -0
  89. package/dist/components/key-concept/key-concept.js +79 -0
  90. package/dist/components/keyboard-shortcuts-help/index.js +6 -0
  91. package/dist/components/keyboard-shortcuts-help/keyboard-shortcuts-help.js +121 -0
  92. package/dist/components/label/index.js +4 -0
  93. package/dist/components/label/label.js +21 -0
  94. package/dist/components/lang-provider/index.js +4 -0
  95. package/dist/components/lang-provider/lang-provider.js +18 -0
  96. package/dist/components/learning-objectives/index.js +10 -0
  97. package/dist/components/learning-objectives/learning-objectives.js +76 -0
  98. package/dist/components/mdx-content/index.js +4 -0
  99. package/dist/components/mdx-content/mdx-content.js +151 -0
  100. package/dist/components/menubar/index.js +36 -0
  101. package/dist/components/menubar/menubar.js +183 -0
  102. package/dist/components/model-selector/index.js +6 -0
  103. package/dist/components/model-selector/model-selector.js +374 -0
  104. package/dist/components/navbar-saas/index.js +6 -0
  105. package/dist/components/navbar-saas/navbar-saas.js +68 -0
  106. package/dist/components/navbar-saas/use-mobile.js +19 -0
  107. package/dist/components/navigation-menu/index.js +22 -0
  108. package/dist/components/navigation-menu/navigation-menu.js +108 -0
  109. package/dist/components/pagination/index.js +4 -0
  110. package/dist/components/pagination/pagination.js +44 -0
  111. package/dist/components/popover/index.js +12 -0
  112. package/dist/components/popover/popover.js +28 -0
  113. package/dist/components/pro-tip/index.js +8 -0
  114. package/dist/components/pro-tip/pro-tip.js +139 -0
  115. package/dist/components/profile-section/index.js +4 -0
  116. package/dist/components/profile-section/profile-section.js +45 -0
  117. package/dist/components/progress-bar/index.js +4 -0
  118. package/dist/components/progress-bar/progress-bar.js +56 -0
  119. package/dist/components/progress-card/index.js +6 -0
  120. package/dist/components/progress-card/progress-card.js +71 -0
  121. package/dist/components/quiz/index.js +4 -0
  122. package/dist/components/quiz/quiz.js +210 -0
  123. package/dist/components/radio-group/index.js +5 -0
  124. package/dist/components/radio-group/radio-group.js +36 -0
  125. package/dist/components/resizable/index.js +10 -0
  126. package/dist/components/resizable/resizable.js +39 -0
  127. package/dist/components/scroll-area/index.js +5 -0
  128. package/dist/components/scroll-area/scroll-area.js +39 -0
  129. package/dist/components/search-bar/index.js +4 -0
  130. package/dist/components/search-bar/search-bar.js +122 -0
  131. package/dist/components/search-dialog/index.js +4 -0
  132. package/dist/components/search-dialog/search-dialog.js +102 -0
  133. package/dist/components/select/index.js +24 -0
  134. package/dist/components/select/select.js +125 -0
  135. package/dist/components/separator/index.js +4 -0
  136. package/dist/components/separator/separator.js +25 -0
  137. package/dist/components/share-dialog/index.js +6 -0
  138. package/dist/components/share-dialog/share-dialog.js +121 -0
  139. package/dist/components/share-section/index.js +6 -0
  140. package/dist/components/share-section/share-section.js +57 -0
  141. package/dist/components/sheet/index.js +24 -0
  142. package/dist/components/sheet/sheet.js +116 -0
  143. package/dist/components/sidebar/index.js +4 -0
  144. package/dist/components/sidebar/sidebar.js +188 -0
  145. package/dist/components/sidebar-provider/index.js +5 -0
  146. package/dist/components/sidebar-provider/sidebar-provider.js +25 -0
  147. package/dist/components/sidebar-toggle/index.js +4 -0
  148. package/dist/components/sidebar-toggle/sidebar-toggle.js +36 -0
  149. package/dist/components/skeleton/index.js +4 -0
  150. package/dist/components/skeleton/skeleton.js +17 -0
  151. package/dist/components/slider/index.js +4 -0
  152. package/dist/components/slider/slider.js +24 -0
  153. package/dist/components/slideshow/index.js +6 -0
  154. package/dist/components/slideshow/slideshow.js +440 -0
  155. package/dist/components/social-fab/index.js +6 -0
  156. package/dist/components/social-fab/social-fab.js +211 -0
  157. package/dist/components/social-fab/use-social-fab.js +111 -0
  158. package/dist/components/spinner/index.js +4 -0
  159. package/dist/components/spinner/spinner.js +23 -0
  160. package/dist/components/step-by-step/index.js +8 -0
  161. package/dist/components/step-by-step/step-by-step.js +194 -0
  162. package/dist/components/step-navigation/index.js +4 -0
  163. package/dist/components/step-navigation/step-navigation.js +119 -0
  164. package/dist/components/switch/index.js +4 -0
  165. package/dist/components/switch/switch.js +28 -0
  166. package/dist/components/table/index.js +20 -0
  167. package/dist/components/table/table.js +87 -0
  168. package/dist/components/table-of-contents/index.js +4 -0
  169. package/dist/components/table-of-contents/table-of-contents.js +71 -0
  170. package/dist/components/table-of-contents-panel/index.js +6 -0
  171. package/dist/components/table-of-contents-panel/table-of-contents-panel.js +202 -0
  172. package/dist/components/tabs/index.js +12 -0
  173. package/dist/components/tabs/tabs.js +84 -0
  174. package/dist/components/terminal/index.js +8 -0
  175. package/dist/components/terminal/terminal.js +119 -0
  176. package/dist/components/textarea/index.js +4 -0
  177. package/dist/components/textarea/textarea.js +22 -0
  178. package/dist/components/theme-provider/index.js +4 -0
  179. package/dist/components/theme-provider/theme-provider.js +11 -0
  180. package/dist/components/theme-toggle/index.js +4 -0
  181. package/dist/components/theme-toggle/theme-toggle.js +170 -0
  182. package/dist/components/thinking-block/index.js +4 -0
  183. package/dist/components/thinking-block/thinking-block.js +56 -0
  184. package/dist/components/tldr-section/index.js +4 -0
  185. package/dist/components/tldr-section/tldr-section.js +101 -0
  186. package/dist/components/toast/index.js +18 -0
  187. package/dist/components/toast/toast.js +84 -0
  188. package/dist/components/toast/toaster.js +38 -0
  189. package/dist/components/toggle/index.js +5 -0
  190. package/dist/components/toggle/toggle.js +39 -0
  191. package/dist/components/toggle-group/index.js +5 -0
  192. package/dist/components/toggle-group/toggle-group.js +46 -0
  193. package/dist/components/tooltip/index.js +12 -0
  194. package/dist/components/tooltip/tooltip.js +27 -0
  195. package/dist/components/truncated-text/index.js +4 -0
  196. package/dist/components/truncated-text/truncated-text.js +25 -0
  197. package/dist/components/tutorial-card/index.js +6 -0
  198. package/dist/components/tutorial-card/tutorial-card.js +78 -0
  199. package/dist/components/tutorial-complete/index.js +6 -0
  200. package/dist/components/tutorial-complete/tutorial-complete.js +134 -0
  201. package/dist/components/tutorial-filters/index.js +6 -0
  202. package/dist/components/tutorial-filters/tutorial-filters.js +205 -0
  203. package/dist/components/tutorial-intro-content/index.js +6 -0
  204. package/dist/components/tutorial-intro-content/tutorial-intro-content.js +141 -0
  205. package/dist/components/tutorial-mdx/index.js +8 -0
  206. package/dist/components/tutorial-mdx/tutorial-mdx.js +219 -0
  207. package/dist/components/video-embed/index.js +4 -0
  208. package/dist/components/video-embed/video-embed.js +77 -0
  209. package/dist/components/view-switcher/index.js +6 -0
  210. package/dist/components/view-switcher/view-switcher.js +92 -0
  211. package/dist/index.d.ts +44 -2
  212. package/dist/index.js +14 -8556
  213. package/dist/lib/types.js +11 -0
  214. package/dist/lib/use-debounce.js +17 -0
  215. package/dist/lib/use-horizontal-scroll.js +60 -0
  216. package/dist/lib/use-mounted.js +17 -0
  217. package/dist/lib/utils.js +8 -0
  218. package/dist/tailwind-preset.d.ts +5 -0
  219. package/dist/tailwind-preset.js +9 -10
  220. package/dist/types/content.js +0 -0
  221. package/dist/types/index.js +0 -0
  222. package/package.json +42 -23
  223. package/LICENSE +0 -21
  224. package/dist/chunk-XRV5RSYH.js +0 -569
  225. package/dist/flow-diagram-N3EHM6VB.js +0 -2
@@ -0,0 +1,6 @@
1
+ import {
2
+ TutorialCard
3
+ } from "./tutorial-card";
4
+ export {
5
+ TutorialCard
6
+ };
@@ -0,0 +1,78 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { memo, useEffect, useState } from "react";
4
+ import { useMounted } from "../../lib/use-mounted";
5
+ import { Badge } from "../badge";
6
+ import {
7
+ Card,
8
+ CardContent,
9
+ CardDescription,
10
+ CardHeader,
11
+ CardTitle
12
+ } from "../card";
13
+ const DIFFICULTY_VARIANTS = {
14
+ advanced: "destructive",
15
+ beginner: "secondary",
16
+ intermediate: "default"
17
+ };
18
+ function DefaultLink({
19
+ children,
20
+ className,
21
+ href
22
+ }) {
23
+ return /* @__PURE__ */ jsx("a", { className, href, children });
24
+ }
25
+ function TutorialCardImpl({
26
+ getProgress,
27
+ href,
28
+ labels,
29
+ linkComponent: LinkComponent = DefaultLink,
30
+ tutorial
31
+ }) {
32
+ const [progress, setProgress] = useState(null);
33
+ const isHydrated = useMounted();
34
+ useEffect(() => {
35
+ if (getProgress) {
36
+ const result = getProgress(tutorial.id);
37
+ requestAnimationFrame(() => {
38
+ setProgress(result);
39
+ });
40
+ }
41
+ }, [getProgress, tutorial.id]);
42
+ const difficultyVariant = DIFFICULTY_VARIANTS[tutorial.difficulty];
43
+ const safeCompletedCount = progress ? Math.min(progress.completedCount, tutorial.sectionCount) : 0;
44
+ const showProgress = isHydrated && safeCompletedCount > 0;
45
+ return /* @__PURE__ */ jsx(LinkComponent, { className: "block h-full", href, children: /* @__PURE__ */ jsxs(Card, { className: "h-full flex flex-col hover:shadow-lg transition-shadow cursor-pointer", children: [
46
+ /* @__PURE__ */ jsxs(CardHeader, { children: [
47
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mb-2", children: [
48
+ /* @__PURE__ */ jsx(Badge, { className: "text-xs capitalize", variant: difficultyVariant, children: labels.difficulty[tutorial.difficulty] || tutorial.difficulty }),
49
+ showProgress ? /* @__PURE__ */ jsxs("span", { className: "text-xs text-muted-foreground", children: [
50
+ safeCompletedCount,
51
+ "/",
52
+ tutorial.sectionCount,
53
+ " ",
54
+ labels.completed
55
+ ] }) : null
56
+ ] }),
57
+ /* @__PURE__ */ jsx(CardTitle, { className: "line-clamp-2 text-lg", children: tutorial.title }),
58
+ /* @__PURE__ */ jsx(CardDescription, { className: "line-clamp-3", children: tutorial.description })
59
+ ] }),
60
+ /* @__PURE__ */ jsxs(CardContent, { className: "mt-auto space-y-2", children: [
61
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap gap-2 text-xs text-muted-foreground", children: [
62
+ /* @__PURE__ */ jsx("span", { children: tutorial.estimatedTime }),
63
+ /* @__PURE__ */ jsx("span", { children: "\u2022" }),
64
+ /* @__PURE__ */ jsxs("span", { children: [
65
+ tutorial.sectionCount,
66
+ " ",
67
+ labels.sectionsCount
68
+ ] })
69
+ ] }),
70
+ tutorial.tags.length > 0 ? /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1", children: tutorial.tags.map((tag) => /* @__PURE__ */ jsx(Badge, { className: "text-xs", variant: "outline", children: tag }, tag)) }) : null
71
+ ] })
72
+ ] }) });
73
+ }
74
+ const TutorialCard = memo(TutorialCardImpl);
75
+ TutorialCard.displayName = "TutorialCard";
76
+ export {
77
+ TutorialCard
78
+ };
@@ -0,0 +1,6 @@
1
+ import {
2
+ TutorialComplete
3
+ } from "./tutorial-complete";
4
+ export {
5
+ TutorialComplete
6
+ };
@@ -0,0 +1,134 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { memo } from "react";
4
+ import { Check, ChevronRight, RotateCcw } from "lucide-react";
5
+ import { Button } from "../button";
6
+ import { ProfileSection } from "../profile-section";
7
+ import { ShareSection } from "../share-section";
8
+ function DefaultLink({
9
+ children,
10
+ className,
11
+ href
12
+ }) {
13
+ return /* @__PURE__ */ jsx("a", { className, href, children });
14
+ }
15
+ function TutorialCompleteImpl({
16
+ backHref,
17
+ completedSections,
18
+ completionPercent,
19
+ labels,
20
+ linkComponent: LinkComponent = DefaultLink,
21
+ onGoToSection,
22
+ onRestart,
23
+ profile,
24
+ relatedContent,
25
+ sections,
26
+ shareUrl,
27
+ title
28
+ }) {
29
+ const isFullyComplete = completionPercent === 100;
30
+ return /* @__PURE__ */ jsxs("div", { children: [
31
+ /* @__PURE__ */ jsxs("div", { className: "text-center py-12", children: [
32
+ /* @__PURE__ */ jsx(
33
+ "div",
34
+ {
35
+ className: `inline-flex items-center justify-center w-20 h-20 rounded-full mb-6 ${isFullyComplete ? "bg-green-100 dark:bg-green-900/30" : "bg-muted"}`,
36
+ children: /* @__PURE__ */ jsx(
37
+ Check,
38
+ {
39
+ className: `h-10 w-10 ${isFullyComplete ? "text-green-600 dark:text-green-400" : "text-muted-foreground"}`
40
+ }
41
+ )
42
+ }
43
+ ),
44
+ /* @__PURE__ */ jsx("h2", { className: "text-3xl font-bold mb-2", children: isFullyComplete ? labels.tutorialComplete : labels.tutorialFinished }),
45
+ /* @__PURE__ */ jsx("p", { className: "text-muted-foreground mb-6", children: isFullyComplete ? `${labels.youveCompletedAll} "${title}"` : `${labels.youveFinishedWith} "${title}" (${completionPercent}%)` }),
46
+ /* @__PURE__ */ jsxs(Button, { className: "gap-2", onClick: onRestart, variant: "outline", children: [
47
+ /* @__PURE__ */ jsx(RotateCcw, { className: "h-4 w-4" }),
48
+ labels.startOver
49
+ ] })
50
+ ] }),
51
+ /* @__PURE__ */ jsxs("div", { className: "max-w-2xl mx-auto mt-8", children: [
52
+ /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold mb-4", children: labels.reviewSections }),
53
+ /* @__PURE__ */ jsx("div", { className: "space-y-2", children: sections.map((section, index) => {
54
+ const isCompleted = completedSections.has(section.id);
55
+ return /* @__PURE__ */ jsxs(
56
+ "button",
57
+ {
58
+ className: "w-full flex items-center gap-3 p-3 rounded-lg border border-border hover:bg-muted/50 transition-colors text-left",
59
+ onClick: () => {
60
+ onGoToSection(index);
61
+ },
62
+ type: "button",
63
+ children: [
64
+ /* @__PURE__ */ jsx(
65
+ "div",
66
+ {
67
+ className: `flex-shrink-0 w-5 h-5 rounded-full border-2 flex items-center justify-center ${isCompleted ? "bg-foreground border-foreground" : "border-muted-foreground"}`,
68
+ children: isCompleted ? /* @__PURE__ */ jsx(Check, { className: "h-3 w-3 text-background" }) : null
69
+ }
70
+ ),
71
+ /* @__PURE__ */ jsx("span", { className: "flex-1 truncate", children: section.title }),
72
+ /* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4 text-muted-foreground" })
73
+ ]
74
+ },
75
+ `${section.id}-${index}`
76
+ );
77
+ }) })
78
+ ] }),
79
+ relatedContent.length > 0 ? /* @__PURE__ */ jsxs("div", { className: "max-w-2xl mx-auto mt-12", children: [
80
+ /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold mb-4", children: labels.relatedContent }),
81
+ /* @__PURE__ */ jsx("div", { className: "space-y-2", children: relatedContent.map((item) => /* @__PURE__ */ jsxs(
82
+ LinkComponent,
83
+ {
84
+ className: "flex items-center gap-3 p-3 rounded-lg border border-border hover:bg-muted/50 transition-colors",
85
+ href: item.href,
86
+ children: [
87
+ /* @__PURE__ */ jsx("span", { className: "text-xs uppercase text-muted-foreground font-medium", children: item.type }),
88
+ /* @__PURE__ */ jsx("span", { className: "flex-1 truncate", children: item.title }),
89
+ /* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4 text-muted-foreground" })
90
+ ]
91
+ },
92
+ item.href
93
+ )) })
94
+ ] }) : null,
95
+ /* @__PURE__ */ jsx("div", { className: "max-w-4xl mx-auto mt-12", children: /* @__PURE__ */ jsx(
96
+ ShareSection,
97
+ {
98
+ shareOn: labels.shareOn,
99
+ shareTitle: labels.shareTitle,
100
+ title,
101
+ url: shareUrl
102
+ }
103
+ ) }),
104
+ profile ? /* @__PURE__ */ jsx("div", { className: "border-t border-border pt-8 mt-12", children: /* @__PURE__ */ jsx("div", { className: "max-w-4xl mx-auto", children: /* @__PURE__ */ jsx(
105
+ ProfileSection,
106
+ {
107
+ dict: {
108
+ profile: {
109
+ name: labels.profileName,
110
+ tagline: labels.profileTagline
111
+ }
112
+ },
113
+ imageSource: profile.imageSource,
114
+ socialLinks: profile.socialLinks
115
+ }
116
+ ) }) }) : null,
117
+ /* @__PURE__ */ jsx("div", { className: "text-center pt-8", children: /* @__PURE__ */ jsx(
118
+ LinkComponent,
119
+ {
120
+ className: "inline-flex items-center space-x-2 text-muted-foreground hover:text-foreground transition-colors",
121
+ href: backHref,
122
+ children: /* @__PURE__ */ jsxs("span", { children: [
123
+ "\u2190 ",
124
+ labels.backToTutorials
125
+ ] })
126
+ }
127
+ ) })
128
+ ] });
129
+ }
130
+ const TutorialComplete = memo(TutorialCompleteImpl);
131
+ TutorialComplete.displayName = "TutorialComplete";
132
+ export {
133
+ TutorialComplete
134
+ };
@@ -0,0 +1,6 @@
1
+ import {
2
+ TutorialFilters
3
+ } from "./tutorial-filters";
4
+ export {
5
+ TutorialFilters
6
+ };
@@ -0,0 +1,205 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { memo } from "react";
4
+ import { Badge } from "../badge";
5
+ function SearchInput({
6
+ isPending,
7
+ labels,
8
+ onSearchChange,
9
+ searchQuery
10
+ }) {
11
+ return /* @__PURE__ */ jsxs("div", { children: [
12
+ /* @__PURE__ */ jsx("label", { className: "sr-only", htmlFor: "tutorial-search", children: labels.searchLabel }),
13
+ /* @__PURE__ */ jsx(
14
+ "input",
15
+ {
16
+ className: "w-full px-4 py-2 border border-border rounded-lg bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
17
+ defaultValue: searchQuery,
18
+ disabled: isPending,
19
+ id: "tutorial-search",
20
+ onChange: onSearchChange,
21
+ placeholder: labels.searchPlaceholder,
22
+ type: "text"
23
+ }
24
+ )
25
+ ] });
26
+ }
27
+ function DifficultyFilter({
28
+ activeDifficulty,
29
+ difficultyOptions,
30
+ isPending,
31
+ labels,
32
+ onDifficultyChange
33
+ }) {
34
+ return /* @__PURE__ */ jsxs("div", { children: [
35
+ /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2 mb-2", children: /* @__PURE__ */ jsx("span", { className: "text-sm font-medium", children: labels.difficultyLabel }) }),
36
+ /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2", children: difficultyOptions.map((difficulty) => {
37
+ const isActive = difficulty === activeDifficulty;
38
+ return /* @__PURE__ */ jsx(
39
+ "button",
40
+ {
41
+ className: `px-3 py-1 text-sm rounded-lg border transition-colors ${isActive ? "bg-primary text-primary-foreground border-transparent" : "bg-background text-foreground border-border hover:bg-muted"}`,
42
+ disabled: isPending,
43
+ onClick: () => {
44
+ onDifficultyChange(difficulty);
45
+ },
46
+ type: "button",
47
+ children: /* @__PURE__ */ jsx("span", { className: "capitalize", children: labels.difficulty[difficulty] || difficulty })
48
+ },
49
+ difficulty
50
+ );
51
+ }) })
52
+ ] });
53
+ }
54
+ function TagFilter({
55
+ currentTags,
56
+ labels,
57
+ onClearTags,
58
+ onTagToggle,
59
+ tags
60
+ }) {
61
+ if (tags.length === 0) {
62
+ return null;
63
+ }
64
+ return /* @__PURE__ */ jsxs("div", { children: [
65
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mb-2", children: [
66
+ /* @__PURE__ */ jsx("span", { className: "text-sm font-medium", children: labels.tagsLabel }),
67
+ currentTags.length > 0 ? /* @__PURE__ */ jsx(
68
+ "button",
69
+ {
70
+ className: "text-xs text-muted-foreground hover:text-foreground transition-colors",
71
+ onClick: onClearTags,
72
+ type: "button",
73
+ children: labels.clear
74
+ }
75
+ ) : null
76
+ ] }),
77
+ /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2", children: tags.map((tag) => {
78
+ const isActive = currentTags.includes(tag);
79
+ return /* @__PURE__ */ jsx(
80
+ Badge,
81
+ {
82
+ className: `cursor-pointer transition-all ${isActive ? "bg-primary text-primary-foreground border-transparent" : "hover:bg-muted"}`,
83
+ onClick: () => {
84
+ onTagToggle(tag);
85
+ },
86
+ variant: isActive ? "default" : "outline",
87
+ children: tag
88
+ },
89
+ tag
90
+ );
91
+ }) })
92
+ ] });
93
+ }
94
+ function ActiveFiltersSummary({
95
+ currentDifficulty,
96
+ currentTags,
97
+ labels,
98
+ onClearAll,
99
+ searchQuery
100
+ }) {
101
+ if (!currentDifficulty && currentTags.length === 0 && !searchQuery) {
102
+ return null;
103
+ }
104
+ return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
105
+ /* @__PURE__ */ jsx("span", { children: labels.activeFilters }),
106
+ currentDifficulty ? /* @__PURE__ */ jsx(Badge, { className: "capitalize", variant: "secondary", children: labels.difficulty[currentDifficulty] || currentDifficulty }) : null,
107
+ currentTags.map((tag) => /* @__PURE__ */ jsx(Badge, { variant: "secondary", children: tag }, tag)),
108
+ searchQuery ? /* @__PURE__ */ jsxs(Badge, { variant: "secondary", children: [
109
+ labels.searchFilter,
110
+ ' "',
111
+ searchQuery,
112
+ '"'
113
+ ] }) : null,
114
+ /* @__PURE__ */ jsx(
115
+ "button",
116
+ {
117
+ className: "text-xs hover:underline",
118
+ onClick: onClearAll,
119
+ type: "button",
120
+ children: labels.clearAll
121
+ }
122
+ )
123
+ ] });
124
+ }
125
+ const DEFAULT_DIFFICULTY_OPTIONS = [
126
+ "all",
127
+ "beginner",
128
+ "intermediate",
129
+ "advanced"
130
+ ];
131
+ function TutorialFiltersImpl({
132
+ currentDifficulty,
133
+ currentTags,
134
+ difficultyOptions = DEFAULT_DIFFICULTY_OPTIONS,
135
+ isPending = false,
136
+ labels,
137
+ onFilterChange,
138
+ searchQuery,
139
+ tags
140
+ }) {
141
+ const activeDifficulty = currentDifficulty || "all";
142
+ const handleDifficultyChange = (difficulty) => {
143
+ onFilterChange({ difficulty });
144
+ };
145
+ const handleSearchChange = (event) => {
146
+ onFilterChange({ search: event.target.value });
147
+ };
148
+ const handleTagToggle = (tag) => {
149
+ const newTags = currentTags.includes(tag) ? currentTags.filter((t) => t !== tag) : [...currentTags, tag];
150
+ onFilterChange({ tags: newTags });
151
+ };
152
+ const handleClearAll = () => {
153
+ onFilterChange({ difficulty: "all", search: "", tags: [] });
154
+ const input = document.querySelector("#tutorial-search");
155
+ if (input) input.value = "";
156
+ };
157
+ return /* @__PURE__ */ jsxs("div", { className: "space-y-4 mb-8", children: [
158
+ /* @__PURE__ */ jsx(
159
+ SearchInput,
160
+ {
161
+ isPending,
162
+ labels,
163
+ onSearchChange: handleSearchChange,
164
+ searchQuery
165
+ }
166
+ ),
167
+ /* @__PURE__ */ jsx(
168
+ DifficultyFilter,
169
+ {
170
+ activeDifficulty,
171
+ difficultyOptions,
172
+ isPending,
173
+ labels,
174
+ onDifficultyChange: handleDifficultyChange
175
+ }
176
+ ),
177
+ /* @__PURE__ */ jsx(
178
+ TagFilter,
179
+ {
180
+ currentTags,
181
+ labels,
182
+ onClearTags: () => {
183
+ onFilterChange({ tags: [] });
184
+ },
185
+ onTagToggle: handleTagToggle,
186
+ tags
187
+ }
188
+ ),
189
+ /* @__PURE__ */ jsx(
190
+ ActiveFiltersSummary,
191
+ {
192
+ currentDifficulty,
193
+ currentTags,
194
+ labels,
195
+ onClearAll: handleClearAll,
196
+ searchQuery
197
+ }
198
+ )
199
+ ] });
200
+ }
201
+ const TutorialFilters = memo(TutorialFiltersImpl);
202
+ TutorialFilters.displayName = "TutorialFilters";
203
+ export {
204
+ TutorialFilters
205
+ };
@@ -0,0 +1,6 @@
1
+ import {
2
+ TutorialIntroContent
3
+ } from "./tutorial-intro-content";
4
+ export {
5
+ TutorialIntroContent
6
+ };
@@ -0,0 +1,141 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import ReactMarkdown from "react-markdown";
3
+ import { cn } from "../../lib/utils";
4
+ const serverMarkdownComponents = {
5
+ a: ({
6
+ children,
7
+ href,
8
+ ...props
9
+ }) => /* @__PURE__ */ jsx(
10
+ "a",
11
+ {
12
+ className: "text-primary underline underline-offset-4 hover:text-primary/80 font-medium",
13
+ href,
14
+ ...props,
15
+ children
16
+ }
17
+ ),
18
+ blockquote: ({
19
+ children,
20
+ ...props
21
+ }) => /* @__PURE__ */ jsx(
22
+ "blockquote",
23
+ {
24
+ className: "border-l-4 border-primary pl-4 italic text-muted-foreground my-6 py-2 text-sm",
25
+ ...props,
26
+ children
27
+ }
28
+ ),
29
+ code: ({
30
+ children,
31
+ className: codeClassName,
32
+ ...props
33
+ }) => {
34
+ const isBlock = codeClassName?.includes("language-");
35
+ if (isBlock) {
36
+ return /* @__PURE__ */ jsx("code", { className: cn("font-mono text-sm", codeClassName), ...props, children });
37
+ }
38
+ return /* @__PURE__ */ jsx(
39
+ "code",
40
+ {
41
+ className: "bg-muted px-1.5 py-0.5 rounded text-sm font-mono",
42
+ ...props,
43
+ children
44
+ }
45
+ );
46
+ },
47
+ h1: ({
48
+ children,
49
+ ...props
50
+ }) => /* @__PURE__ */ jsx("h1", { className: "text-2xl font-bold mt-8 mb-4", ...props, children }),
51
+ h2: ({
52
+ children,
53
+ ...props
54
+ }) => /* @__PURE__ */ jsx("h2", { className: "text-xl font-bold mt-6 mb-3", ...props, children }),
55
+ h3: ({
56
+ children,
57
+ ...props
58
+ }) => /* @__PURE__ */ jsx("h3", { className: "text-lg font-bold mt-4 mb-2", ...props, children }),
59
+ hr: (props) => /* @__PURE__ */ jsx("hr", { className: "my-8 border-border", ...props }),
60
+ li: ({
61
+ children,
62
+ ...props
63
+ }) => /* @__PURE__ */ jsx(
64
+ "li",
65
+ {
66
+ className: "mb-2 leading-relaxed text-muted-foreground text-sm pl-2",
67
+ ...props,
68
+ children
69
+ }
70
+ ),
71
+ ol: ({
72
+ children,
73
+ ...props
74
+ }) => /* @__PURE__ */ jsx(
75
+ "ol",
76
+ {
77
+ className: "list-decimal list-outside mb-6 space-y-2 ml-6 text-muted-foreground text-sm",
78
+ ...props,
79
+ children
80
+ }
81
+ ),
82
+ p: ({
83
+ children,
84
+ ...props
85
+ }) => /* @__PURE__ */ jsx(
86
+ "p",
87
+ {
88
+ className: "mb-4 leading-relaxed text-muted-foreground text-sm",
89
+ ...props,
90
+ children
91
+ }
92
+ ),
93
+ pre: ({
94
+ children,
95
+ ...props
96
+ }) => /* @__PURE__ */ jsx(
97
+ "pre",
98
+ {
99
+ className: "bg-zinc-950 dark:bg-zinc-900 text-zinc-100 p-4 rounded-lg overflow-x-auto my-6 border border-zinc-800 shadow-lg font-mono text-sm",
100
+ ...props,
101
+ children
102
+ }
103
+ ),
104
+ strong: ({
105
+ children,
106
+ ...props
107
+ }) => /* @__PURE__ */ jsx("strong", { className: "font-semibold text-foreground", ...props, children }),
108
+ ul: ({
109
+ children,
110
+ ...props
111
+ }) => /* @__PURE__ */ jsx(
112
+ "ul",
113
+ {
114
+ className: "list-disc list-outside mb-6 space-y-2 ml-6 text-muted-foreground text-sm",
115
+ ...props,
116
+ children
117
+ }
118
+ )
119
+ };
120
+ function stripMDXComponents(content) {
121
+ let cleaned = content.replaceAll(/<[A-Z][A-Za-z]*[^>]*\/>/g, "");
122
+ cleaned = cleaned.replaceAll(
123
+ /<[A-Z][A-Za-z]*[^>]*>[\S\s]*?<\/[A-Z][A-Za-z]*>/g,
124
+ ""
125
+ );
126
+ return cleaned;
127
+ }
128
+ function TutorialIntroContent({
129
+ className,
130
+ content,
131
+ title
132
+ }) {
133
+ const markdownContent = stripMDXComponents(content);
134
+ return /* @__PURE__ */ jsxs("section", { className: cn("py-6", className), children: [
135
+ /* @__PURE__ */ jsx("h2", { className: "text-2xl md:text-3xl font-bold mb-6", children: title }),
136
+ /* @__PURE__ */ jsx("div", { className: "max-w-none [&_h2:first-of-type]:hidden", children: /* @__PURE__ */ jsx(ReactMarkdown, { components: serverMarkdownComponents, children: markdownContent }) })
137
+ ] });
138
+ }
139
+ export {
140
+ TutorialIntroContent
141
+ };
@@ -0,0 +1,8 @@
1
+ import {
2
+ mdxComponents,
3
+ TutorialMDX
4
+ } from "./tutorial-mdx";
5
+ export {
6
+ TutorialMDX,
7
+ mdxComponents
8
+ };