@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,108 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { forwardRef } from "react";
4
+ import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu";
5
+ import { cva } from "class-variance-authority";
6
+ import { ChevronDown } from "lucide-react";
7
+ import { cn } from "../../lib/utils";
8
+ const NavigationMenu = forwardRef(({ children, className, ...props }, ref) => /* @__PURE__ */ jsxs(
9
+ NavigationMenuPrimitive.Root,
10
+ {
11
+ className: cn(
12
+ "relative z-10 flex max-w-max flex-1 items-center justify-center",
13
+ className
14
+ ),
15
+ ref,
16
+ ...props,
17
+ children: [
18
+ children,
19
+ /* @__PURE__ */ jsx(NavigationMenuViewport, {})
20
+ ]
21
+ }
22
+ ));
23
+ NavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName;
24
+ const NavigationMenuList = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
25
+ NavigationMenuPrimitive.List,
26
+ {
27
+ className: cn(
28
+ "group flex flex-1 list-none items-center justify-center space-x-1",
29
+ className
30
+ ),
31
+ ref,
32
+ ...props
33
+ }
34
+ ));
35
+ NavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName;
36
+ const NavigationMenuItem = NavigationMenuPrimitive.Item;
37
+ const navigationMenuTriggerStyle = cva(
38
+ "group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50"
39
+ );
40
+ const NavigationMenuTrigger = forwardRef(({ children, className, ...props }, ref) => /* @__PURE__ */ jsxs(
41
+ NavigationMenuPrimitive.Trigger,
42
+ {
43
+ className: cn(navigationMenuTriggerStyle(), "group", className),
44
+ ref,
45
+ ...props,
46
+ children: [
47
+ children,
48
+ " ",
49
+ /* @__PURE__ */ jsx(
50
+ ChevronDown,
51
+ {
52
+ "aria-hidden": "true",
53
+ className: "relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180"
54
+ }
55
+ )
56
+ ]
57
+ }
58
+ ));
59
+ NavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName;
60
+ const NavigationMenuContent = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
61
+ NavigationMenuPrimitive.Content,
62
+ {
63
+ className: cn(
64
+ "left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto",
65
+ className
66
+ ),
67
+ ref,
68
+ ...props
69
+ }
70
+ ));
71
+ NavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName;
72
+ const NavigationMenuLink = NavigationMenuPrimitive.Link;
73
+ const NavigationMenuViewport = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { className: cn("absolute left-0 top-full flex justify-center"), children: /* @__PURE__ */ jsx(
74
+ NavigationMenuPrimitive.Viewport,
75
+ {
76
+ className: cn(
77
+ "origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",
78
+ className
79
+ ),
80
+ ref,
81
+ ...props
82
+ }
83
+ ) }));
84
+ NavigationMenuViewport.displayName = NavigationMenuPrimitive.Viewport.displayName;
85
+ const NavigationMenuIndicator = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
86
+ NavigationMenuPrimitive.Indicator,
87
+ {
88
+ className: cn(
89
+ "top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",
90
+ className
91
+ ),
92
+ ref,
93
+ ...props,
94
+ children: /* @__PURE__ */ jsx("div", { className: "relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md" })
95
+ }
96
+ ));
97
+ NavigationMenuIndicator.displayName = NavigationMenuPrimitive.Indicator.displayName;
98
+ export {
99
+ NavigationMenu,
100
+ NavigationMenuContent,
101
+ NavigationMenuIndicator,
102
+ NavigationMenuItem,
103
+ NavigationMenuLink,
104
+ NavigationMenuList,
105
+ NavigationMenuTrigger,
106
+ NavigationMenuViewport,
107
+ navigationMenuTriggerStyle
108
+ };
@@ -0,0 +1,4 @@
1
+ import { Pagination } from "./pagination";
2
+ export {
3
+ Pagination
4
+ };
@@ -0,0 +1,44 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import Link from "next/link";
3
+ import { Button } from "../button/button";
4
+ function Pagination({
5
+ baseUrl,
6
+ className,
7
+ currentPage,
8
+ totalPages
9
+ }) {
10
+ if (totalPages <= 1) return null;
11
+ const maxVisiblePages = 5;
12
+ let startPage = Math.max(1, currentPage - Math.floor(maxVisiblePages / 2));
13
+ const endPage = Math.min(totalPages, startPage + maxVisiblePages - 1);
14
+ if (endPage - startPage + 1 < maxVisiblePages) {
15
+ startPage = Math.max(1, endPage - maxVisiblePages + 1);
16
+ }
17
+ const previousButton = currentPage > 1 ? /* @__PURE__ */ jsx(Link, { href: `${baseUrl}?page=${currentPage - 1}`, children: /* @__PURE__ */ jsxs(Button, { size: "sm", variant: "outline", children: [
18
+ /* @__PURE__ */ jsx("span", { className: "text-sm", children: "\u2039" }),
19
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Previous" })
20
+ ] }) }, "prev") : null;
21
+ const pageNumbers = Array.from(
22
+ { length: endPage - startPage + 1 },
23
+ (_, index) => {
24
+ const pageNumber = startPage + index;
25
+ return /* @__PURE__ */ jsx(Link, { href: `${baseUrl}?page=${pageNumber}`, children: /* @__PURE__ */ jsx(
26
+ Button,
27
+ {
28
+ size: "sm",
29
+ variant: pageNumber === currentPage ? "default" : "outline",
30
+ children: pageNumber
31
+ }
32
+ ) }, pageNumber);
33
+ }
34
+ );
35
+ const nextButton = currentPage < totalPages ? /* @__PURE__ */ jsx(Link, { href: `${baseUrl}?page=${currentPage + 1}`, children: /* @__PURE__ */ jsxs(Button, { size: "sm", variant: "outline", children: [
36
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Next" }),
37
+ /* @__PURE__ */ jsx("span", { className: "text-sm", children: "\u203A" })
38
+ ] }) }, "next") : null;
39
+ const pages = [previousButton, ...pageNumbers, nextButton].filter(Boolean);
40
+ return /* @__PURE__ */ jsx("div", { className: `flex items-center justify-center gap-2 ${className}`, children: pages });
41
+ }
42
+ export {
43
+ Pagination
44
+ };
@@ -0,0 +1,12 @@
1
+ import {
2
+ Popover,
3
+ PopoverAnchor,
4
+ PopoverContent,
5
+ PopoverTrigger
6
+ } from "./popover";
7
+ export {
8
+ Popover,
9
+ PopoverAnchor,
10
+ PopoverContent,
11
+ PopoverTrigger
12
+ };
@@ -0,0 +1,28 @@
1
+ "use client";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { forwardRef } from "react";
4
+ import * as PopoverPrimitive from "@radix-ui/react-popover";
5
+ import { cn } from "../../lib/utils";
6
+ const Popover = PopoverPrimitive.Root;
7
+ const PopoverTrigger = PopoverPrimitive.Trigger;
8
+ const PopoverAnchor = PopoverPrimitive.Anchor;
9
+ const PopoverContent = forwardRef(({ align = "center", className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx(
10
+ PopoverPrimitive.Content,
11
+ {
12
+ align,
13
+ className: cn(
14
+ "z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
15
+ className
16
+ ),
17
+ ref,
18
+ sideOffset,
19
+ ...props
20
+ }
21
+ ) }));
22
+ PopoverContent.displayName = PopoverPrimitive.Content.displayName;
23
+ export {
24
+ Popover,
25
+ PopoverAnchor,
26
+ PopoverContent,
27
+ PopoverTrigger
28
+ };
@@ -0,0 +1,8 @@
1
+ import {
2
+ CommonMistake,
3
+ ProTip
4
+ } from "./pro-tip";
5
+ export {
6
+ CommonMistake,
7
+ ProTip
8
+ };
@@ -0,0 +1,139 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { cn } from "../../lib/utils";
3
+ const variantStyles = {
4
+ advanced: {
5
+ className: "border-purple-500/50 bg-purple-500/10 text-purple-700 dark:text-purple-300",
6
+ defaultTitle: "Advanced"
7
+ },
8
+ "best-practice": {
9
+ className: "border-blue-500/50 bg-blue-500/10 text-blue-700 dark:text-blue-300",
10
+ defaultTitle: "Best Practice"
11
+ },
12
+ expert: {
13
+ className: "border-amber-500/50 bg-amber-500/10 text-amber-700 dark:text-amber-300",
14
+ defaultTitle: "Expert Tip"
15
+ },
16
+ gotcha: {
17
+ className: "border-red-500/50 bg-red-500/10 text-red-700 dark:text-red-300",
18
+ defaultTitle: "Common Gotcha"
19
+ },
20
+ performance: {
21
+ className: "border-green-500/50 bg-green-500/10 text-green-700 dark:text-green-300",
22
+ defaultTitle: "Performance"
23
+ },
24
+ tip: {
25
+ className: "border-primary/50 bg-primary/10 text-primary",
26
+ defaultTitle: "Pro Tip"
27
+ }
28
+ };
29
+ function ProTip({
30
+ children,
31
+ className,
32
+ icon,
33
+ title,
34
+ variant = "tip"
35
+ }) {
36
+ const config = variantStyles[variant];
37
+ return /* @__PURE__ */ jsx(
38
+ "div",
39
+ {
40
+ className: cn("my-6 rounded-lg border p-4", config.className, className),
41
+ children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
42
+ /* @__PURE__ */ jsx("div", { className: "flex h-8 w-8 items-center justify-center rounded-full bg-current/10 flex-shrink-0", children: icon ? /* @__PURE__ */ jsx("span", { className: "h-4 w-4", children: icon }) : /* @__PURE__ */ jsx(
43
+ "svg",
44
+ {
45
+ className: "h-4 w-4",
46
+ fill: "none",
47
+ stroke: "currentColor",
48
+ viewBox: "0 0 24 24",
49
+ children: /* @__PURE__ */ jsx(
50
+ "path",
51
+ {
52
+ d: "M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z",
53
+ strokeLinecap: "round",
54
+ strokeLinejoin: "round",
55
+ strokeWidth: 2
56
+ }
57
+ )
58
+ }
59
+ ) }),
60
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
61
+ /* @__PURE__ */ jsx("p", { className: "font-semibold text-sm mb-1", children: title || config.defaultTitle }),
62
+ /* @__PURE__ */ jsx("div", { className: "text-sm [&>p]:mb-0 opacity-90", children })
63
+ ] })
64
+ ] })
65
+ }
66
+ );
67
+ }
68
+ function CommonMistake({
69
+ children,
70
+ className,
71
+ fix,
72
+ fixIcon,
73
+ icon,
74
+ title = "Common Mistake"
75
+ }) {
76
+ return /* @__PURE__ */ jsxs(
77
+ "div",
78
+ {
79
+ className: cn(
80
+ "my-6 rounded-lg border border-red-500/50 bg-red-500/5 overflow-hidden",
81
+ className
82
+ ),
83
+ children: [
84
+ /* @__PURE__ */ jsx("div", { className: "p-4", children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
85
+ icon ? /* @__PURE__ */ jsx("span", { className: "h-5 w-5 text-red-500 flex-shrink-0 mt-0.5", children: icon }) : /* @__PURE__ */ jsx(
86
+ "svg",
87
+ {
88
+ className: "h-5 w-5 text-red-500 flex-shrink-0 mt-0.5",
89
+ fill: "none",
90
+ stroke: "currentColor",
91
+ viewBox: "0 0 24 24",
92
+ children: /* @__PURE__ */ jsx(
93
+ "path",
94
+ {
95
+ d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z",
96
+ strokeLinecap: "round",
97
+ strokeLinejoin: "round",
98
+ strokeWidth: 2
99
+ }
100
+ )
101
+ }
102
+ ),
103
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
104
+ /* @__PURE__ */ jsx("p", { className: "font-semibold text-sm text-red-700 dark:text-red-300 mb-1", children: title }),
105
+ /* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground [&>p]:mb-0", children })
106
+ ] })
107
+ ] }) }),
108
+ fix ? /* @__PURE__ */ jsx("div", { className: "border-t border-red-500/30 bg-green-500/5 p-4", children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
109
+ fixIcon ? /* @__PURE__ */ jsx("span", { className: "h-5 w-5 text-green-500 flex-shrink-0 mt-0.5", children: fixIcon }) : /* @__PURE__ */ jsx(
110
+ "svg",
111
+ {
112
+ className: "h-5 w-5 text-green-500 flex-shrink-0 mt-0.5",
113
+ fill: "none",
114
+ stroke: "currentColor",
115
+ viewBox: "0 0 24 24",
116
+ children: /* @__PURE__ */ jsx(
117
+ "path",
118
+ {
119
+ d: "M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z",
120
+ strokeLinecap: "round",
121
+ strokeLinejoin: "round",
122
+ strokeWidth: 2
123
+ }
124
+ )
125
+ }
126
+ ),
127
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
128
+ /* @__PURE__ */ jsx("p", { className: "font-semibold text-sm text-green-700 dark:text-green-300 mb-1", children: "The Fix" }),
129
+ /* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground [&>p]:mb-0", children: fix })
130
+ ] })
131
+ ] }) }) : null
132
+ ]
133
+ }
134
+ );
135
+ }
136
+ export {
137
+ CommonMistake,
138
+ ProTip
139
+ };
@@ -0,0 +1,4 @@
1
+ import { ProfileSection } from "./profile-section";
2
+ export {
3
+ ProfileSection
4
+ };
@@ -0,0 +1,45 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import Image from "next/image";
3
+ import Link from "next/link";
4
+ import { Button } from "../button/button";
5
+ function ProfileSection({
6
+ compact = false,
7
+ dict,
8
+ imageAlt,
9
+ imageSource = "/profile.png",
10
+ socialLinks
11
+ }) {
12
+ const displayImageAlt = imageAlt ?? `${dict.profile.name} Profile`;
13
+ const showImage = !compact && Boolean(imageSource);
14
+ const showSocialLinks = !compact && Boolean(socialLinks && socialLinks.length > 0);
15
+ return /* @__PURE__ */ jsxs("div", { className: "text-center space-y-4", children: [
16
+ showImage ? /* @__PURE__ */ jsx("div", { className: "relative w-24 h-24 mx-auto overflow-hidden rounded-md", children: /* @__PURE__ */ jsx(
17
+ Image,
18
+ {
19
+ alt: displayImageAlt,
20
+ className: "w-full h-full object-cover rounded-md",
21
+ height: 96,
22
+ priority: true,
23
+ src: imageSource,
24
+ width: 96
25
+ }
26
+ ) }) : null,
27
+ /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
28
+ /* @__PURE__ */ jsx("h3", { className: `font-semibold ${compact ? "text-lg" : "text-xl"}`, children: dict.profile.name }),
29
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: compact ? dict.profile.tagline : `> ${dict.profile.tagline}` })
30
+ ] }),
31
+ showSocialLinks ? /* @__PURE__ */ jsx("div", { className: "flex flex-wrap justify-center items-center gap-2", children: socialLinks?.map((link) => /* @__PURE__ */ jsx(
32
+ Link,
33
+ {
34
+ href: link.href,
35
+ rel: "noopener noreferrer",
36
+ target: "_blank",
37
+ children: /* @__PURE__ */ jsx(Button, { className: "w-32", size: "sm", variant: "outline", children: link.label })
38
+ },
39
+ link.href
40
+ )) }) : null
41
+ ] });
42
+ }
43
+ export {
44
+ ProfileSection
45
+ };
@@ -0,0 +1,4 @@
1
+ import { ProgressBar } from "./progress-bar";
2
+ export {
3
+ ProgressBar
4
+ };
@@ -0,0 +1,56 @@
1
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
+ import { cn } from "../../lib/utils";
3
+ function ProgressBar({
4
+ className,
5
+ completedLabel,
6
+ currentLabel,
7
+ isComplete = false,
8
+ isLoading = false,
9
+ max,
10
+ showLabels = true,
11
+ value
12
+ }) {
13
+ const percent = max > 0 ? Math.round(value / max * 100) : 0;
14
+ return /* @__PURE__ */ jsxs(
15
+ "div",
16
+ {
17
+ className: cn(
18
+ "border rounded-lg p-4 transition-colors",
19
+ isLoading && "border-border bg-muted/30",
20
+ !isLoading && isComplete && "border-green-500/50 bg-green-500/5",
21
+ !isLoading && !isComplete && "border-border bg-muted/30",
22
+ className
23
+ ),
24
+ children: [
25
+ showLabels ? /* @__PURE__ */ jsx("div", { className: "flex items-center justify-between mb-2 h-5", children: isLoading ? /* @__PURE__ */ jsxs(Fragment, { children: [
26
+ /* @__PURE__ */ jsx("span", { className: "h-5 w-16 bg-muted rounded animate-pulse" }),
27
+ /* @__PURE__ */ jsx("span", { className: "h-5 w-24 bg-muted rounded animate-pulse" })
28
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
29
+ /* @__PURE__ */ jsx("span", { className: "text-sm font-medium leading-5", children: currentLabel ?? (isComplete ? "Complete" : "Progress") }),
30
+ /* @__PURE__ */ jsxs("span", { className: "text-sm text-muted-foreground leading-5", children: [
31
+ value,
32
+ " / ",
33
+ max,
34
+ " ",
35
+ completedLabel ?? ""
36
+ ] })
37
+ ] }) }) : null,
38
+ /* @__PURE__ */ jsx("div", { className: "h-2 bg-muted rounded-full overflow-hidden", children: /* @__PURE__ */ jsx(
39
+ "div",
40
+ {
41
+ className: cn(
42
+ "h-full transition-all duration-300",
43
+ isLoading && "w-0",
44
+ !isLoading && isComplete && "bg-green-500",
45
+ !isLoading && !isComplete && "bg-primary"
46
+ ),
47
+ style: isLoading ? void 0 : { width: `${percent}%` }
48
+ }
49
+ ) })
50
+ ]
51
+ }
52
+ );
53
+ }
54
+ export {
55
+ ProgressBar
56
+ };
@@ -0,0 +1,6 @@
1
+ import {
2
+ ContentCard
3
+ } from "./progress-card";
4
+ export {
5
+ ContentCard as ProgressCard
6
+ };
@@ -0,0 +1,71 @@
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
+ function DefaultLink({
14
+ children,
15
+ className,
16
+ href
17
+ }) {
18
+ return /* @__PURE__ */ jsx("a", { className, href, children });
19
+ }
20
+ function ContentCardImpl({
21
+ badgeLabel,
22
+ badgeVariant = "default",
23
+ description,
24
+ getProgress,
25
+ href,
26
+ linkComponent: LinkComponent = DefaultLink,
27
+ metadata = [],
28
+ progressLabel = "completed",
29
+ tags = [],
30
+ title
31
+ }) {
32
+ const [progress, setProgress] = useState(null);
33
+ const isHydrated = useMounted();
34
+ useEffect(() => {
35
+ if (getProgress) {
36
+ const result = getProgress();
37
+ requestAnimationFrame(() => {
38
+ setProgress(result);
39
+ });
40
+ }
41
+ }, [getProgress]);
42
+ const showProgress = isHydrated && progress && progress.completedCount > 0;
43
+ 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: [
44
+ /* @__PURE__ */ jsxs(CardHeader, { children: [
45
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mb-2", children: [
46
+ /* @__PURE__ */ jsx(Badge, { className: "text-xs capitalize", variant: badgeVariant, children: badgeLabel }),
47
+ showProgress ? /* @__PURE__ */ jsxs("span", { className: "text-xs text-muted-foreground", children: [
48
+ progress.completedCount,
49
+ "/",
50
+ progress.totalSections,
51
+ " ",
52
+ progressLabel
53
+ ] }) : null
54
+ ] }),
55
+ /* @__PURE__ */ jsx(CardTitle, { className: "line-clamp-2 text-lg", children: title }),
56
+ /* @__PURE__ */ jsx(CardDescription, { className: "line-clamp-3", children: description })
57
+ ] }),
58
+ /* @__PURE__ */ jsxs(CardContent, { className: "mt-auto space-y-2", children: [
59
+ metadata.length > 0 ? /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2 text-xs text-muted-foreground", children: metadata.map((item, index) => /* @__PURE__ */ jsxs("span", { children: [
60
+ index > 0 ? /* @__PURE__ */ jsx("span", { className: "mr-2", children: "\u2022" }) : null,
61
+ item
62
+ ] }, index)) }) : null,
63
+ tags.length > 0 ? /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1", children: tags.map((tag) => /* @__PURE__ */ jsx(Badge, { className: "text-xs", variant: "outline", children: tag }, tag)) }) : null
64
+ ] })
65
+ ] }) });
66
+ }
67
+ const ContentCard = memo(ContentCardImpl);
68
+ ContentCard.displayName = "ContentCard";
69
+ export {
70
+ ContentCard
71
+ };
@@ -0,0 +1,4 @@
1
+ import { Quiz } from "./quiz";
2
+ export {
3
+ Quiz
4
+ };