@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,25 @@
1
+ "use client";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import {
4
+ createContext,
5
+ useContext,
6
+ useMemo,
7
+ useState
8
+ } from "react";
9
+ const SidebarContext = createContext(void 0);
10
+ function useSidebar() {
11
+ const context = useContext(SidebarContext);
12
+ if (!context) {
13
+ throw new Error("useSidebar must be used within SidebarProvider");
14
+ }
15
+ return context;
16
+ }
17
+ function SidebarProvider({ children }) {
18
+ const [open, setOpen] = useState(false);
19
+ const value = useMemo(() => ({ open, setOpen }), [open]);
20
+ return /* @__PURE__ */ jsx(SidebarContext.Provider, { value, children });
21
+ }
22
+ export {
23
+ SidebarProvider,
24
+ useSidebar
25
+ };
@@ -0,0 +1,4 @@
1
+ import { SidebarToggle } from "./sidebar-toggle";
2
+ export {
3
+ SidebarToggle
4
+ };
@@ -0,0 +1,36 @@
1
+ "use client";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import { Menu, X } from "lucide-react";
4
+ import { cn } from "../../lib/utils";
5
+ import { Button } from "../button";
6
+ function SidebarToggle({
7
+ className,
8
+ onToggle,
9
+ open
10
+ }) {
11
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
12
+ /* @__PURE__ */ jsx(
13
+ Button,
14
+ {
15
+ className: cn("lg:hidden", className),
16
+ onClick: onToggle,
17
+ size: "icon",
18
+ variant: "ghost",
19
+ children: open ? /* @__PURE__ */ jsx(X, { className: "h-5 w-5" }) : /* @__PURE__ */ jsx(Menu, { className: "h-5 w-5" })
20
+ }
21
+ ),
22
+ /* @__PURE__ */ jsx(
23
+ Button,
24
+ {
25
+ className: cn("hidden lg:flex", className),
26
+ onClick: onToggle,
27
+ size: "icon",
28
+ variant: "ghost",
29
+ children: /* @__PURE__ */ jsx(Menu, { className: "h-5 w-5" })
30
+ }
31
+ )
32
+ ] });
33
+ }
34
+ export {
35
+ SidebarToggle
36
+ };
@@ -0,0 +1,4 @@
1
+ import { Skeleton } from "./skeleton";
2
+ export {
3
+ Skeleton
4
+ };
@@ -0,0 +1,17 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { cn } from "../../lib/utils";
3
+ function Skeleton({
4
+ className,
5
+ ...props
6
+ }) {
7
+ return /* @__PURE__ */ jsx(
8
+ "div",
9
+ {
10
+ className: cn("animate-pulse rounded-md bg-muted", className),
11
+ ...props
12
+ }
13
+ );
14
+ }
15
+ export {
16
+ Skeleton
17
+ };
@@ -0,0 +1,4 @@
1
+ import { Slider } from "./slider";
2
+ export {
3
+ Slider
4
+ };
@@ -0,0 +1,24 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { forwardRef } from "react";
4
+ import * as SliderPrimitive from "@radix-ui/react-slider";
5
+ import { cn } from "../../lib/utils";
6
+ const Slider = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs(
7
+ SliderPrimitive.Root,
8
+ {
9
+ className: cn(
10
+ "relative flex w-full touch-none select-none items-center",
11
+ className
12
+ ),
13
+ ref,
14
+ ...props,
15
+ children: [
16
+ /* @__PURE__ */ jsx(SliderPrimitive.Track, { className: "relative h-2 w-full grow overflow-hidden rounded-full bg-secondary", children: /* @__PURE__ */ jsx(SliderPrimitive.Range, { className: "absolute h-full bg-primary" }) }),
17
+ /* @__PURE__ */ jsx(SliderPrimitive.Thumb, { className: "block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50" })
18
+ ]
19
+ }
20
+ ));
21
+ Slider.displayName = SliderPrimitive.Root.displayName;
22
+ export {
23
+ Slider
24
+ };
@@ -0,0 +1,6 @@
1
+ import {
2
+ Slideshow
3
+ } from "./slideshow";
4
+ export {
5
+ Slideshow
6
+ };
@@ -0,0 +1,440 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { memo, useCallback, useEffect, useState } from "react";
4
+ import { createPortal } from "react-dom";
5
+ import { useMounted } from "../../lib/use-mounted";
6
+ import { cn } from "../../lib/utils";
7
+ import { CompletionDialog } from "../completion-dialog";
8
+ const DEFAULT_LABELS = {
9
+ closeLabel: "Close",
10
+ closeTocLabel: "Close table of contents",
11
+ exitLabel: "Exit",
12
+ finishLabel: "Finish",
13
+ nextLabel: "Next",
14
+ openTocLabel: "Open table of contents",
15
+ prevLabel: "Prev",
16
+ sectionsLabel: "Sections"
17
+ };
18
+ function SlideshowImpl({
19
+ completedSections,
20
+ completionDialogTitle = "Mark section as complete?",
21
+ currentIndex,
22
+ labels = {},
23
+ onComplete,
24
+ onExit,
25
+ onNavigate,
26
+ onToggleSection,
27
+ renderContent,
28
+ sections,
29
+ title
30
+ }) {
31
+ const mergedLabels = { ...DEFAULT_LABELS, ...labels };
32
+ const [animationDirection, setAnimationDirection] = useState(null);
33
+ const [isCompletionDialogOpen, setIsCompletionDialogOpen] = useState(false);
34
+ const [isTocOpen, setIsTocOpen] = useState(false);
35
+ const mounted = useMounted();
36
+ const currentSection = sections[currentIndex];
37
+ const isCurrentCompleted = currentSection ? completedSections.has(currentSection.id) : false;
38
+ const isLastSection = currentIndex === sections.length - 1;
39
+ const canGoNext = currentIndex < sections.length - 1;
40
+ const canGoPrevious = currentIndex > 0;
41
+ const progress = (currentIndex + 1) / sections.length * 100;
42
+ useEffect(() => {
43
+ document.body.style.overflow = "hidden";
44
+ return () => {
45
+ document.body.style.overflow = "";
46
+ };
47
+ }, []);
48
+ const goToSection = useCallback(
49
+ (index, direction) => {
50
+ setAnimationDirection(direction);
51
+ setTimeout(() => {
52
+ onNavigate(index);
53
+ setAnimationDirection(null);
54
+ }, 150);
55
+ },
56
+ [onNavigate]
57
+ );
58
+ const handlePrevious = useCallback(() => {
59
+ if (canGoPrevious) goToSection(currentIndex - 1, "right");
60
+ }, [canGoPrevious, currentIndex, goToSection]);
61
+ const handleNext = useCallback(() => {
62
+ if (!canGoNext) {
63
+ if (isCurrentCompleted) onComplete();
64
+ else setIsCompletionDialogOpen(true);
65
+ return;
66
+ }
67
+ if (isCurrentCompleted) goToSection(currentIndex + 1, "left");
68
+ else setIsCompletionDialogOpen(true);
69
+ }, [canGoNext, currentIndex, goToSection, isCurrentCompleted, onComplete]);
70
+ const handleMarkComplete = useCallback(() => {
71
+ if (currentSection) onToggleSection(currentSection.id);
72
+ setIsCompletionDialogOpen(false);
73
+ if (isLastSection) onComplete();
74
+ else goToSection(currentIndex + 1, "left");
75
+ }, [
76
+ currentSection,
77
+ onToggleSection,
78
+ isLastSection,
79
+ onComplete,
80
+ goToSection,
81
+ currentIndex
82
+ ]);
83
+ const handleSkip = useCallback(() => {
84
+ setIsCompletionDialogOpen(false);
85
+ if (isLastSection) onComplete();
86
+ else goToSection(currentIndex + 1, "left");
87
+ }, [isLastSection, onComplete, goToSection, currentIndex]);
88
+ const handleTocNavigate = useCallback(
89
+ (index) => {
90
+ setIsTocOpen(false);
91
+ goToSection(index, index > currentIndex ? "left" : "right");
92
+ },
93
+ [currentIndex, goToSection]
94
+ );
95
+ useEffect(() => {
96
+ const handleKeyDown = (event) => {
97
+ if (isCompletionDialogOpen) return;
98
+ if (event.key === "Escape") {
99
+ event.preventDefault();
100
+ if (isTocOpen) setIsTocOpen(false);
101
+ else onExit();
102
+ return;
103
+ }
104
+ if (event.key === "t" || event.key === "T") {
105
+ event.preventDefault();
106
+ setIsTocOpen((p) => !p);
107
+ return;
108
+ }
109
+ if (event.key === "ArrowRight" || event.key === "j") {
110
+ event.preventDefault();
111
+ handleNext();
112
+ return;
113
+ }
114
+ if (event.key === "ArrowLeft" || event.key === "k") {
115
+ event.preventDefault();
116
+ handlePrevious();
117
+ }
118
+ };
119
+ document.addEventListener("keydown", handleKeyDown, true);
120
+ return () => {
121
+ document.removeEventListener("keydown", handleKeyDown, true);
122
+ };
123
+ }, [handleNext, handlePrevious, onExit, isTocOpen, isCompletionDialogOpen]);
124
+ if (!currentSection || !mounted) return null;
125
+ return createPortal(
126
+ /* @__PURE__ */ jsxs("div", { className: "fixed inset-0 z-[9999] bg-background flex flex-col", children: [
127
+ /* @__PURE__ */ jsx("div", { className: "absolute top-0 left-0 right-0 h-1 bg-muted z-10", children: /* @__PURE__ */ jsx(
128
+ "div",
129
+ {
130
+ className: "h-full bg-foreground transition-all duration-300 ease-out",
131
+ style: { width: `${progress}%` }
132
+ }
133
+ ) }),
134
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-4 py-3 mt-1 border-b border-border bg-background", children: [
135
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 min-w-0 flex-1", children: [
136
+ /* @__PURE__ */ jsx(
137
+ "button",
138
+ {
139
+ "aria-label": isTocOpen ? mergedLabels.closeTocLabel : mergedLabels.openTocLabel,
140
+ className: "flex-shrink-0 p-2 rounded-lg hover:bg-muted transition-colors",
141
+ onClick: () => {
142
+ setIsTocOpen((p) => !p);
143
+ },
144
+ type: "button",
145
+ children: isTocOpen ? /* @__PURE__ */ jsx(
146
+ "svg",
147
+ {
148
+ className: "h-5 w-5",
149
+ fill: "none",
150
+ stroke: "currentColor",
151
+ viewBox: "0 0 24 24",
152
+ children: /* @__PURE__ */ jsx(
153
+ "path",
154
+ {
155
+ d: "M6 18L18 6M6 6l12 12",
156
+ strokeLinecap: "round",
157
+ strokeLinejoin: "round",
158
+ strokeWidth: 2
159
+ }
160
+ )
161
+ }
162
+ ) : /* @__PURE__ */ jsx(
163
+ "svg",
164
+ {
165
+ className: "h-5 w-5",
166
+ fill: "none",
167
+ stroke: "currentColor",
168
+ viewBox: "0 0 24 24",
169
+ children: /* @__PURE__ */ jsx(
170
+ "path",
171
+ {
172
+ d: "M4 6h16M4 12h16M4 18h16",
173
+ strokeLinecap: "round",
174
+ strokeLinejoin: "round",
175
+ strokeWidth: 2
176
+ }
177
+ )
178
+ }
179
+ )
180
+ }
181
+ ),
182
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
183
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground truncate", children: title }),
184
+ /* @__PURE__ */ jsx("p", { className: "text-sm font-medium truncate", children: currentSection.title })
185
+ ] })
186
+ ] }),
187
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 flex-shrink-0", children: [
188
+ /* @__PURE__ */ jsxs("span", { className: "text-xs text-muted-foreground tabular-nums hidden sm:inline", children: [
189
+ currentIndex + 1,
190
+ "/",
191
+ sections.length
192
+ ] }),
193
+ /* @__PURE__ */ jsx(
194
+ "button",
195
+ {
196
+ "aria-label": mergedLabels.exitLabel,
197
+ className: "p-2 rounded-lg hover:bg-muted transition-colors",
198
+ onClick: onExit,
199
+ type: "button",
200
+ children: /* @__PURE__ */ jsx(
201
+ "svg",
202
+ {
203
+ className: "h-5 w-5",
204
+ fill: "none",
205
+ stroke: "currentColor",
206
+ viewBox: "0 0 24 24",
207
+ children: /* @__PURE__ */ jsx(
208
+ "path",
209
+ {
210
+ d: "M6 18L18 6M6 6l12 12",
211
+ strokeLinecap: "round",
212
+ strokeLinejoin: "round",
213
+ strokeWidth: 2
214
+ }
215
+ )
216
+ }
217
+ )
218
+ }
219
+ )
220
+ ] })
221
+ ] }),
222
+ /* @__PURE__ */ jsxs("div", { className: "relative flex-1 overflow-hidden", children: [
223
+ isTocOpen ? /* @__PURE__ */ jsxs(
224
+ "div",
225
+ {
226
+ className: "absolute inset-0 z-20 flex animate-in fade-in-0 duration-200",
227
+ onClick: () => {
228
+ setIsTocOpen(false);
229
+ },
230
+ onKeyDown: (event) => {
231
+ if (event.key === "Enter" || event.key === " ")
232
+ setIsTocOpen(false);
233
+ },
234
+ role: "button",
235
+ tabIndex: 0,
236
+ children: [
237
+ /* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-background/40" }),
238
+ /* @__PURE__ */ jsxs(
239
+ "div",
240
+ {
241
+ className: "relative w-full sm:max-w-sm bg-background border-r border-border h-full overflow-auto shadow-2xl",
242
+ onClick: (event) => {
243
+ event.stopPropagation();
244
+ },
245
+ onKeyDown: (event) => {
246
+ event.stopPropagation();
247
+ },
248
+ role: "dialog",
249
+ children: [
250
+ /* @__PURE__ */ jsxs("div", { className: "sticky top-0 flex items-center justify-between px-4 py-3 border-b border-border bg-background", children: [
251
+ /* @__PURE__ */ jsx("h3", { className: "font-semibold", children: mergedLabels.sectionsLabel }),
252
+ /* @__PURE__ */ jsx(
253
+ "button",
254
+ {
255
+ "aria-label": mergedLabels.closeLabel,
256
+ className: "p-2 rounded-lg hover:bg-muted transition-colors",
257
+ onClick: () => {
258
+ setIsTocOpen(false);
259
+ },
260
+ type: "button",
261
+ children: /* @__PURE__ */ jsx(
262
+ "svg",
263
+ {
264
+ className: "h-4 w-4",
265
+ fill: "none",
266
+ stroke: "currentColor",
267
+ viewBox: "0 0 24 24",
268
+ children: /* @__PURE__ */ jsx(
269
+ "path",
270
+ {
271
+ d: "M6 18L18 6M6 6l12 12",
272
+ strokeLinecap: "round",
273
+ strokeLinejoin: "round",
274
+ strokeWidth: 2
275
+ }
276
+ )
277
+ }
278
+ )
279
+ }
280
+ )
281
+ ] }),
282
+ /* @__PURE__ */ jsx("div", { className: "p-2", children: sections.map((section, index) => {
283
+ const isCompleted = completedSections.has(section.id);
284
+ const isCurrent = index === currentIndex;
285
+ return /* @__PURE__ */ jsxs(
286
+ "button",
287
+ {
288
+ className: cn(
289
+ "w-full flex items-center gap-3 p-3 rounded-lg text-left transition-colors",
290
+ isCurrent ? "bg-muted" : "hover:bg-muted/50"
291
+ ),
292
+ onClick: () => {
293
+ handleTocNavigate(index);
294
+ },
295
+ type: "button",
296
+ children: [
297
+ /* @__PURE__ */ jsx(
298
+ "div",
299
+ {
300
+ className: cn(
301
+ "flex-shrink-0 w-5 h-5 rounded-full border-2 flex items-center justify-center",
302
+ isCompleted ? "bg-foreground border-foreground" : "border-muted-foreground"
303
+ ),
304
+ children: isCompleted ? /* @__PURE__ */ jsx(
305
+ "svg",
306
+ {
307
+ className: "h-3 w-3 text-background",
308
+ fill: "none",
309
+ stroke: "currentColor",
310
+ viewBox: "0 0 24 24",
311
+ children: /* @__PURE__ */ jsx(
312
+ "path",
313
+ {
314
+ d: "M5 13l4 4L19 7",
315
+ strokeLinecap: "round",
316
+ strokeLinejoin: "round",
317
+ strokeWidth: 2
318
+ }
319
+ )
320
+ }
321
+ ) : null
322
+ }
323
+ ),
324
+ /* @__PURE__ */ jsx(
325
+ "span",
326
+ {
327
+ className: cn(
328
+ "flex-1 text-sm truncate",
329
+ isCompleted && "line-through opacity-60"
330
+ ),
331
+ children: section.title
332
+ }
333
+ )
334
+ ]
335
+ },
336
+ `${section.id}-${index}`
337
+ );
338
+ }) })
339
+ ]
340
+ }
341
+ )
342
+ ]
343
+ }
344
+ ) : null,
345
+ /* @__PURE__ */ jsx("div", { className: "h-full overflow-auto px-4 py-8 md:px-8 lg:px-16", children: /* @__PURE__ */ jsx("div", { className: "mx-auto max-w-3xl", children: /* @__PURE__ */ jsx(
346
+ "div",
347
+ {
348
+ className: cn(
349
+ "transition-all duration-150 ease-out",
350
+ animationDirection === "left" && "opacity-0 -translate-x-4",
351
+ animationDirection === "right" && "opacity-0 translate-x-4",
352
+ !animationDirection && "opacity-100 translate-x-0"
353
+ ),
354
+ children: renderContent(currentSection)
355
+ }
356
+ ) }) })
357
+ ] }),
358
+ /* @__PURE__ */ jsxs("div", { className: "relative z-20 flex items-center justify-between px-4 py-4 border-t border-border bg-background", children: [
359
+ /* @__PURE__ */ jsxs(
360
+ "button",
361
+ {
362
+ className: "min-w-[100px] gap-1 inline-flex items-center justify-center px-4 py-2 rounded-md hover:bg-muted transition-colors disabled:opacity-50 disabled:pointer-events-none",
363
+ disabled: !canGoPrevious,
364
+ onClick: handlePrevious,
365
+ type: "button",
366
+ children: [
367
+ /* @__PURE__ */ jsx(
368
+ "svg",
369
+ {
370
+ className: "h-4 w-4",
371
+ fill: "none",
372
+ stroke: "currentColor",
373
+ viewBox: "0 0 24 24",
374
+ children: /* @__PURE__ */ jsx(
375
+ "path",
376
+ {
377
+ d: "m15 19-7-7 7-7",
378
+ strokeLinecap: "round",
379
+ strokeLinejoin: "round",
380
+ strokeWidth: 2
381
+ }
382
+ )
383
+ }
384
+ ),
385
+ /* @__PURE__ */ jsx("span", { children: mergedLabels.prevLabel })
386
+ ]
387
+ }
388
+ ),
389
+ /* @__PURE__ */ jsxs(
390
+ "button",
391
+ {
392
+ className: "min-w-[100px] gap-1 inline-flex items-center justify-center px-4 py-2 rounded-md bg-foreground text-background hover:bg-foreground/90 transition-colors",
393
+ onClick: handleNext,
394
+ type: "button",
395
+ children: [
396
+ /* @__PURE__ */ jsx("span", { children: isLastSection ? mergedLabels.finishLabel : mergedLabels.nextLabel }),
397
+ !isLastSection && /* @__PURE__ */ jsx(
398
+ "svg",
399
+ {
400
+ className: "h-4 w-4",
401
+ fill: "none",
402
+ stroke: "currentColor",
403
+ viewBox: "0 0 24 24",
404
+ children: /* @__PURE__ */ jsx(
405
+ "path",
406
+ {
407
+ d: "m9 5 7 7-7 7",
408
+ strokeLinecap: "round",
409
+ strokeLinejoin: "round",
410
+ strokeWidth: 2
411
+ }
412
+ )
413
+ }
414
+ )
415
+ ]
416
+ }
417
+ )
418
+ ] }),
419
+ /* @__PURE__ */ jsx(
420
+ CompletionDialog,
421
+ {
422
+ description: `You're about to ${isLastSection ? "finish" : "move to the next section from"}: ${currentSection.title}`,
423
+ isOpen: isCompletionDialogOpen,
424
+ onCancel: handleSkip,
425
+ onClose: () => {
426
+ setIsCompletionDialogOpen(false);
427
+ },
428
+ onConfirm: handleMarkComplete,
429
+ title: completionDialogTitle
430
+ }
431
+ )
432
+ ] }),
433
+ document.body
434
+ );
435
+ }
436
+ const Slideshow = memo(SlideshowImpl);
437
+ Slideshow.displayName = "Slideshow";
438
+ export {
439
+ Slideshow
440
+ };
@@ -0,0 +1,6 @@
1
+ import { SocialFAB } from "./social-fab";
2
+ import { useSocialFab } from "./use-social-fab";
3
+ export {
4
+ SocialFAB,
5
+ useSocialFab
6
+ };