@vllnt/ui 0.2.1 → 0.3.0-canary.0572c35

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 (331) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/README.md +59 -30
  3. package/dist/components/accordion/accordion.js +2 -2
  4. package/dist/components/activity-heatmap/activity-heatmap.js +17 -14
  5. package/dist/components/activity-log/activity-log.js +12 -11
  6. package/dist/components/agent-activity/agent-activity.js +317 -0
  7. package/dist/components/agent-activity/index.js +18 -0
  8. package/dist/components/ai-artifact/ai-artifact.js +439 -0
  9. package/dist/components/ai-artifact/index.js +24 -0
  10. package/dist/components/ai-chat-input/ai-chat-input.js +6 -4
  11. package/dist/components/ai-message-bubble/ai-message-bubble.js +3 -3
  12. package/dist/components/ai-sidebar/ai-sidebar.js +255 -0
  13. package/dist/components/ai-sidebar/index.js +22 -0
  14. package/dist/components/ai-source-citation/ai-source-citation.js +2 -2
  15. package/dist/components/ai-tool-call-display/ai-tool-call-display.js +5 -5
  16. package/dist/components/alert-pulse/alert-pulse.js +93 -0
  17. package/dist/components/alert-pulse/index.js +6 -0
  18. package/dist/components/anchor-port/anchor-port.js +51 -0
  19. package/dist/components/anchor-port/index.js +4 -0
  20. package/dist/components/animated-text/animated-text.js +8 -7
  21. package/dist/components/annotation/annotation.js +1 -1
  22. package/dist/components/auto-reload/auto-reload.js +401 -0
  23. package/dist/components/auto-reload/index.js +6 -0
  24. package/dist/components/avatar/avatar.js +1 -1
  25. package/dist/components/avatar-group/avatar-group.js +5 -5
  26. package/dist/components/banner/banner.js +155 -0
  27. package/dist/components/banner/index.js +10 -0
  28. package/dist/components/blog-card/blog-card.js +5 -3
  29. package/dist/components/border-beam/border-beam.js +2 -2
  30. package/dist/components/bottom-activity-strip/bottom-activity-strip.js +91 -0
  31. package/dist/components/bottom-activity-strip/index.js +6 -0
  32. package/dist/components/bottom-bar/bottom-bar.js +25 -0
  33. package/dist/components/bottom-bar/index.js +4 -0
  34. package/dist/components/breadcrumb/breadcrumb.js +33 -26
  35. package/dist/components/button/button.js +1 -1
  36. package/dist/components/calendar/calendar.js +6 -6
  37. package/dist/components/callout/callout.js +1 -1
  38. package/dist/components/candlestick-chart/candlestick-chart.js +13 -12
  39. package/dist/components/canvas-shell/canvas-foundation-demo.js +183 -0
  40. package/dist/components/canvas-shell/canvas-shell-route-config.js +0 -0
  41. package/dist/components/canvas-shell/canvas-shell.js +264 -0
  42. package/dist/components/canvas-shell/index.js +4 -0
  43. package/dist/components/canvas-view/canvas-view.js +504 -0
  44. package/dist/components/canvas-view/index.js +6 -0
  45. package/dist/components/carousel/carousel.js +18 -10
  46. package/dist/components/category-filter/category-filter.js +1 -1
  47. package/dist/components/chain-of-thought/chain-of-thought.js +77 -0
  48. package/dist/components/chain-of-thought/index.js +6 -0
  49. package/dist/components/chart/area-chart.js +1 -0
  50. package/dist/components/chart/line-chart.js +1 -0
  51. package/dist/components/chat-dock-section/chat-dock-section.js +56 -0
  52. package/dist/components/chat-dock-section/index.js +6 -0
  53. package/dist/components/checkbox/checkbox.js +2 -2
  54. package/dist/components/checklist/checklist.js +45 -10
  55. package/dist/components/checklist/index.js +10 -2
  56. package/dist/components/choropleth-map/choropleth-map.js +378 -0
  57. package/dist/components/choropleth-map/index.js +10 -0
  58. package/dist/components/chronological-timeline/chronological-timeline.js +343 -0
  59. package/dist/components/chronological-timeline/index.js +8 -0
  60. package/dist/components/civilization-card/civilization-card.js +275 -0
  61. package/dist/components/civilization-card/index.js +8 -0
  62. package/dist/components/code-block/code-block.js +43 -22
  63. package/dist/components/code-playground/code-playground.js +16 -10
  64. package/dist/components/combobox/combobox.js +49 -30
  65. package/dist/components/command/command.js +1 -1
  66. package/dist/components/comment-pin/comment-pin.js +104 -0
  67. package/dist/components/comment-pin/index.js +6 -0
  68. package/dist/components/comparison/comparison.js +11 -10
  69. package/dist/components/completion-dialog/completion-dialog.js +20 -12
  70. package/dist/components/connector-edge/connector-edge.js +66 -0
  71. package/dist/components/connector-edge/index.js +6 -0
  72. package/dist/components/content-intro/content-intro.js +29 -22
  73. package/dist/components/context-lens/context-lens.js +98 -0
  74. package/dist/components/context-lens/index.js +6 -0
  75. package/dist/components/context-menu/context-menu.js +4 -4
  76. package/dist/components/conversation-thread/conversation-thread.js +348 -0
  77. package/dist/components/conversation-thread/index.js +20 -0
  78. package/dist/components/cookie-consent/cookie-consent.js +1 -1
  79. package/dist/components/copy-button/copy-button.js +189 -0
  80. package/dist/components/copy-button/index.js +8 -0
  81. package/dist/components/countdown-timer/countdown-timer.js +10 -9
  82. package/dist/components/credit-badge/credit-badge.js +1 -7
  83. package/dist/components/curriculum/curriculum.js +349 -0
  84. package/dist/components/curriculum/index.js +10 -0
  85. package/dist/components/data-list/data-list.js +2 -1
  86. package/dist/components/data-table/data-table.js +10 -9
  87. package/dist/components/date-picker/date-picker.js +4 -9
  88. package/dist/components/dialog/dialog.js +1 -1
  89. package/dist/components/document-sibling-nav/document-sibling-nav.js +111 -0
  90. package/dist/components/document-sibling-nav/index.js +8 -0
  91. package/dist/components/dropdown-menu/dropdown-menu.js +3 -3
  92. package/dist/components/edge-label/edge-label.js +26 -0
  93. package/dist/components/edge-label/index.js +4 -0
  94. package/dist/components/empty-state/empty-state.js +93 -0
  95. package/dist/components/empty-state/index.js +8 -0
  96. package/dist/components/era-comparison/era-comparison.js +216 -0
  97. package/dist/components/era-comparison/index.js +16 -0
  98. package/dist/components/exercise/exercise.js +15 -7
  99. package/dist/components/faq/faq.js +8 -4
  100. package/dist/components/file-upload/file-upload.js +4 -9
  101. package/dist/components/filter-bar/filter-bar.js +9 -8
  102. package/dist/components/flashcard/flashcard.js +10 -4
  103. package/dist/components/floating-action-button/floating-action-button.js +1 -1
  104. package/dist/components/floating-toolbar/floating-toolbar.js +66 -0
  105. package/dist/components/floating-toolbar/index.js +6 -0
  106. package/dist/components/flow-diagram/flow-controls.js +9 -9
  107. package/dist/components/flow-diagram/flow-error-boundary.js +2 -2
  108. package/dist/components/flow-diagram/flow-fullscreen.js +2 -2
  109. package/dist/components/follow-mode/follow-mode.js +89 -0
  110. package/dist/components/follow-mode/index.js +6 -0
  111. package/dist/components/form/form.js +432 -0
  112. package/dist/components/form/index.js +20 -0
  113. package/dist/components/gantt-chart/gantt-chart.js +334 -0
  114. package/dist/components/gantt-chart/index.js +6 -0
  115. package/dist/components/geography-quiz-map/geography-quiz-map.js +344 -0
  116. package/dist/components/geography-quiz-map/index.js +12 -0
  117. package/dist/components/glass-panel/glass-panel.js +21 -0
  118. package/dist/components/glass-panel/index.js +4 -0
  119. package/dist/components/globe-3d/globe-3d.js +429 -0
  120. package/dist/components/globe-3d/index.js +10 -0
  121. package/dist/components/group-hull/group-hull.js +29 -0
  122. package/dist/components/group-hull/index.js +4 -0
  123. package/dist/components/handoff-beacon/handoff-beacon.js +78 -0
  124. package/dist/components/handoff-beacon/index.js +6 -0
  125. package/dist/components/heat-map-overlay/heat-map-overlay.js +215 -0
  126. package/dist/components/heat-map-overlay/index.js +6 -0
  127. package/dist/components/heat-overlay/heat-overlay.js +92 -0
  128. package/dist/components/heat-overlay/index.js +6 -0
  129. package/dist/components/historic-timeline/historic-timeline.js +342 -0
  130. package/dist/components/historic-timeline/index.js +6 -0
  131. package/dist/components/historical-figure-card/historical-figure-card.js +270 -0
  132. package/dist/components/historical-figure-card/index.js +6 -0
  133. package/dist/components/horizontal-scroll-row/horizontal-scroll-row.js +6 -5
  134. package/dist/components/index.js +578 -1
  135. package/dist/components/infinite-plane/index.js +6 -0
  136. package/dist/components/infinite-plane/infinite-plane.js +75 -0
  137. package/dist/components/inline-input/inline-input.js +1 -1
  138. package/dist/components/input-otp/input-otp.js +1 -1
  139. package/dist/components/interactive-timeline/index.js +16 -0
  140. package/dist/components/interactive-timeline/interactive-timeline.js +724 -0
  141. package/dist/components/jarvis-dock/index.js +6 -0
  142. package/dist/components/jarvis-dock/jarvis-dock.js +98 -0
  143. package/dist/components/kbd/index.js +5 -0
  144. package/dist/components/kbd/kbd.js +125 -0
  145. package/dist/components/key-concept/key-concept.js +6 -5
  146. package/dist/components/keyboard-shortcuts-help/keyboard-shortcuts-help.js +4 -3
  147. package/dist/components/knowledge-check/index.js +6 -0
  148. package/dist/components/knowledge-check/knowledge-check.js +473 -0
  149. package/dist/components/lang-provider/lang-provider.js +3 -3
  150. package/dist/components/learning-objectives/learning-objectives.js +14 -13
  151. package/dist/components/left-rail/index.js +4 -0
  152. package/dist/components/left-rail/left-rail.js +25 -0
  153. package/dist/components/live-cursor/index.js +6 -0
  154. package/dist/components/live-cursor/live-cursor.js +62 -0
  155. package/dist/components/live-feed/live-feed.js +18 -16
  156. package/dist/components/map-2d/index.js +20 -0
  157. package/dist/components/map-2d/map-2d.js +455 -0
  158. package/dist/components/map-timeline/index.js +16 -0
  159. package/dist/components/map-timeline/map-timeline.js +506 -0
  160. package/dist/components/market-treemap/market-treemap.js +3 -3
  161. package/dist/components/mdx-content/mdx-content.js +25 -11
  162. package/dist/components/menubar/menubar.js +4 -4
  163. package/dist/components/metric-cluster/index.js +6 -0
  164. package/dist/components/metric-cluster/metric-cluster.js +96 -0
  165. package/dist/components/metric-gauge/metric-gauge.js +3 -3
  166. package/dist/components/mini-map-panel/index.js +6 -0
  167. package/dist/components/mini-map-panel/mini-map-panel.js +74 -0
  168. package/dist/components/model-comparison/index.js +12 -0
  169. package/dist/components/model-comparison/model-comparison.js +230 -0
  170. package/dist/components/model-selector/model-selector.js +8 -8
  171. package/dist/components/multi-select/index.js +6 -0
  172. package/dist/components/multi-select/multi-select.js +258 -0
  173. package/dist/components/multi-select-lasso/index.js +6 -0
  174. package/dist/components/multi-select-lasso/multi-select-lasso.js +76 -0
  175. package/dist/components/navbar-saas/navbar-saas.js +11 -10
  176. package/dist/components/navigation-menu/navigation-menu.js +2 -2
  177. package/dist/components/newsletter-signup/index.js +8 -0
  178. package/dist/components/newsletter-signup/newsletter-signup.js +269 -0
  179. package/dist/components/number-input/number-input.js +2 -2
  180. package/dist/components/number-ticker/number-ticker.js +11 -4
  181. package/dist/components/object-card/index.js +6 -0
  182. package/dist/components/object-card/object-card.js +126 -0
  183. package/dist/components/object-handle/index.js +4 -0
  184. package/dist/components/object-handle/object-handle.js +38 -0
  185. package/dist/components/object-inspector/index.js +6 -0
  186. package/dist/components/object-inspector/object-inspector.js +136 -0
  187. package/dist/components/order-book/order-book.js +2 -2
  188. package/dist/components/overview-board/index.js +8 -0
  189. package/dist/components/overview-board/overview-board.js +127 -0
  190. package/dist/components/parallel-timeline/index.js +6 -0
  191. package/dist/components/parallel-timeline/parallel-timeline.js +251 -0
  192. package/dist/components/password-input/password-input.js +1 -1
  193. package/dist/components/plan-badge/plan-badge.js +1 -7
  194. package/dist/components/playback-ghost/index.js +6 -0
  195. package/dist/components/playback-ghost/playback-ghost.js +83 -0
  196. package/dist/components/policy-delivery-panel/index.js +6 -0
  197. package/dist/components/policy-delivery-panel/policy-delivery-panel.js +99 -0
  198. package/dist/components/presence-stack/index.js +6 -0
  199. package/dist/components/presence-stack/presence-stack.js +108 -0
  200. package/dist/components/presence-sync-indicator/index.js +6 -0
  201. package/dist/components/presence-sync-indicator/presence-sync-indicator.js +73 -0
  202. package/dist/components/pricing-table/index.js +8 -0
  203. package/dist/components/pricing-table/pricing-table.js +284 -0
  204. package/dist/components/primary-source-viewer/index.js +26 -0
  205. package/dist/components/primary-source-viewer/primary-source-viewer.js +439 -0
  206. package/dist/components/pro-tip/pro-tip.js +6 -6
  207. package/dist/components/profile-section/profile-section.js +3 -2
  208. package/dist/components/progress-card/progress-card.js +6 -5
  209. package/dist/components/progress-tracker/index.js +20 -0
  210. package/dist/components/progress-tracker/progress-tracker.js +537 -0
  211. package/dist/components/prompt-input/index.js +4 -0
  212. package/dist/components/prompt-input/prompt-input.js +186 -0
  213. package/dist/components/prompt-templates/index.js +6 -0
  214. package/dist/components/prompt-templates/prompt-templates.js +395 -0
  215. package/dist/components/property-section/index.js +6 -0
  216. package/dist/components/property-section/property-section.js +101 -0
  217. package/dist/components/quiz/quiz.js +7 -6
  218. package/dist/components/radio-group/radio-group.js +2 -2
  219. package/dist/components/rating/rating.js +3 -3
  220. package/dist/components/reasoning/index.js +4 -0
  221. package/dist/components/reasoning/reasoning.js +118 -0
  222. package/dist/components/relationship-inspector/index.js +6 -0
  223. package/dist/components/relationship-inspector/relationship-inspector.js +102 -0
  224. package/dist/components/resizable/resizable.js +1 -1
  225. package/dist/components/right-dock/index.js +4 -0
  226. package/dist/components/right-dock/right-dock.js +28 -0
  227. package/dist/components/route-map/index.js +6 -0
  228. package/dist/components/route-map/route-map.js +339 -0
  229. package/dist/components/routing-assignment-panel/index.js +6 -0
  230. package/dist/components/routing-assignment-panel/routing-assignment-panel.js +122 -0
  231. package/dist/components/run-timeline/index.js +6 -0
  232. package/dist/components/run-timeline/run-timeline.js +221 -0
  233. package/dist/components/runtime-overview-panel/index.js +6 -0
  234. package/dist/components/runtime-overview-panel/runtime-overview-panel.js +89 -0
  235. package/dist/components/scope-selector/scope-selector.js +13 -13
  236. package/dist/components/search-bar/search-bar.js +24 -2
  237. package/dist/components/search-dialog/search-dialog.js +485 -52
  238. package/dist/components/segmented-control/index.js +12 -0
  239. package/dist/components/segmented-control/segmented-control.js +61 -0
  240. package/dist/components/select/select.js +5 -5
  241. package/dist/components/selection-halo/index.js +6 -0
  242. package/dist/components/selection-halo/selection-halo.js +72 -0
  243. package/dist/components/selection-presence/index.js +6 -0
  244. package/dist/components/selection-presence/selection-presence.js +50 -0
  245. package/dist/components/severity-badge/severity-badge.js +2 -2
  246. package/dist/components/share-dialog/share-dialog.js +2 -2
  247. package/dist/components/share-section/share-section.js +2 -1
  248. package/dist/components/sheet/sheet.js +1 -1
  249. package/dist/components/sidebar/sidebar.js +31 -26
  250. package/dist/components/sidebar-toggle/sidebar-toggle.js +5 -3
  251. package/dist/components/slider/slider.js +1 -1
  252. package/dist/components/slideshow/slideshow.js +356 -275
  253. package/dist/components/snap-guides/index.js +6 -0
  254. package/dist/components/snap-guides/snap-guides.js +45 -0
  255. package/dist/components/social-fab/social-fab.js +12 -11
  256. package/dist/components/sparkline-grid/sparkline-grid.js +4 -3
  257. package/dist/components/spinner/spinner.js +4 -4
  258. package/dist/components/spinner/unicode-spinner.js +5 -2
  259. package/dist/components/stat-card/stat-card.js +5 -5
  260. package/dist/components/state-badge-overlay/index.js +6 -0
  261. package/dist/components/state-badge-overlay/state-badge-overlay.js +90 -0
  262. package/dist/components/static-code/index.js +4 -0
  263. package/dist/components/static-code/static-code-copy.js +24 -0
  264. package/dist/components/static-code/static-code.js +41 -0
  265. package/dist/components/status-board/status-board.js +15 -8
  266. package/dist/components/status-indicator/status-indicator.js +3 -3
  267. package/dist/components/step-by-step/step-by-step.js +10 -8
  268. package/dist/components/step-navigation/step-navigation.js +2 -2
  269. package/dist/components/stepper/stepper.js +3 -3
  270. package/dist/components/sticky-metric/index.js +6 -0
  271. package/dist/components/sticky-metric/sticky-metric.js +83 -0
  272. package/dist/components/story-map/index.js +8 -0
  273. package/dist/components/story-map/story-map.js +414 -0
  274. package/dist/components/subscription-card/subscription-card.js +1 -1
  275. package/dist/components/switch/switch.js +1 -1
  276. package/dist/components/table-of-contents/table-of-contents.js +5 -2
  277. package/dist/components/table-of-contents-panel/table-of-contents-panel.js +8 -6
  278. package/dist/components/tabs/tabs.js +26 -8
  279. package/dist/components/tags-input/index.js +4 -0
  280. package/dist/components/tags-input/tags-input.js +186 -0
  281. package/dist/components/terminal/terminal.js +61 -37
  282. package/dist/components/theme-preset-provider/index.js +4 -0
  283. package/dist/components/theme-preset-provider/theme-preset-provider.js +55 -0
  284. package/dist/components/theme-switcher/index.js +4 -0
  285. package/dist/components/theme-switcher/theme-switcher.js +43 -0
  286. package/dist/components/theme-toggle/theme-toggle.js +2 -2
  287. package/dist/components/thinking-block/thinking-block.js +3 -3
  288. package/dist/components/thread-bubble/index.js +6 -0
  289. package/dist/components/thread-bubble/thread-bubble.js +85 -0
  290. package/dist/components/threshold-ring/index.js +6 -0
  291. package/dist/components/threshold-ring/threshold-ring.js +160 -0
  292. package/dist/components/ticker-tape/ticker-tape.js +4 -4
  293. package/dist/components/timeline/index.js +12 -0
  294. package/dist/components/timeline/timeline.js +239 -0
  295. package/dist/components/timeline-scrubber/index.js +6 -0
  296. package/dist/components/timeline-scrubber/timeline-scrubber.js +179 -0
  297. package/dist/components/tldr-section/tldr-section.js +11 -9
  298. package/dist/components/top-bar/index.js +4 -0
  299. package/dist/components/top-bar/top-bar.js +31 -0
  300. package/dist/components/tour/tour.js +10 -4
  301. package/dist/components/transaction-list/index.js +14 -0
  302. package/dist/components/transaction-list/transaction-list.js +253 -0
  303. package/dist/components/tree-view/index.js +6 -0
  304. package/dist/components/tree-view/tree-view.js +298 -0
  305. package/dist/components/tutorial-card/tutorial-card.js +2 -2
  306. package/dist/components/tutorial-complete/tutorial-complete.js +18 -16
  307. package/dist/components/tutorial-filters/tutorial-filters.js +2 -2
  308. package/dist/components/tutorial-intro-content/tutorial-intro-content.js +5 -5
  309. package/dist/components/tutorial-mdx/tutorial-mdx.js +20 -20
  310. package/dist/components/usage-breakdown/usage-breakdown.js +12 -7
  311. package/dist/components/video-embed/video-embed.js +2 -2
  312. package/dist/components/viewport-bookmarks/index.js +6 -0
  313. package/dist/components/viewport-bookmarks/viewport-bookmarks.js +118 -0
  314. package/dist/components/wallet-card/wallet-card.js +1 -1
  315. package/dist/components/watchlist/watchlist.js +7 -6
  316. package/dist/components/workspace-switcher/index.js +6 -0
  317. package/dist/components/workspace-switcher/workspace-switcher.js +61 -0
  318. package/dist/components/world-breadcrumbs/index.js +6 -0
  319. package/dist/components/world-breadcrumbs/world-breadcrumbs.js +114 -0
  320. package/dist/components/world-clock-bar/world-clock-bar.js +35 -14
  321. package/dist/components/zoom-hud/index.js +4 -0
  322. package/dist/components/zoom-hud/zoom-hud.js +61 -0
  323. package/dist/index.d.ts +8176 -202
  324. package/dist/index.js +27 -1
  325. package/dist/lib/theme-presets.js +32 -0
  326. package/dist/lib/use-theme-preset.js +95 -0
  327. package/dist/tailwind-preset.js +19 -19
  328. package/package.json +15 -10
  329. package/styles.css +38 -38
  330. package/themes/default.css +39 -39
  331. package/themes/presets.css +547 -0
@@ -4,7 +4,7 @@ import { memo, useCallback, useEffect, useState } from "react";
4
4
  import { createPortal } from "react-dom";
5
5
  import { useMounted } from "../../lib/use-mounted";
6
6
  import { cn } from "../../lib/utils";
7
- import { CompletionDialog } from "../completion-dialog";
7
+ import { CompletionDialog } from "../completion-dialog/completion-dialog";
8
8
  const DEFAULT_LABELS = {
9
9
  closeLabel: "Close",
10
10
  closeTocLabel: "Close table of contents",
@@ -15,11 +15,323 @@ const DEFAULT_LABELS = {
15
15
  prevLabel: "Prev",
16
16
  sectionsLabel: "Sections"
17
17
  };
18
+ const EMPTY_SLIDESHOW_LABELS = {};
19
+ function SlideshowProgress({ progress }) {
20
+ return /* @__PURE__ */ jsx("div", { className: "absolute top-0 left-0 right-0 h-1 bg-muted z-10", children: /* @__PURE__ */ jsx(
21
+ "div",
22
+ {
23
+ className: "h-full bg-foreground transition-all duration-300 ease-out",
24
+ style: { width: `${progress}%` }
25
+ }
26
+ ) });
27
+ }
28
+ function SlideshowHeader({
29
+ currentIndex,
30
+ isTocOpen,
31
+ labels,
32
+ onExit,
33
+ onToggleToc,
34
+ sectionCount,
35
+ sectionTitle,
36
+ title
37
+ }) {
38
+ return /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-4 py-3 mt-1 border-b border-border bg-background", children: [
39
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 min-w-0 flex-1", children: [
40
+ /* @__PURE__ */ jsx(
41
+ "button",
42
+ {
43
+ "aria-label": isTocOpen ? labels.closeTocLabel : labels.openTocLabel,
44
+ className: "flex-shrink-0 p-2 rounded-lg hover:bg-muted transition-colors",
45
+ onClick: onToggleToc,
46
+ type: "button",
47
+ children: isTocOpen ? /* @__PURE__ */ jsx(
48
+ "svg",
49
+ {
50
+ className: "size-5",
51
+ fill: "none",
52
+ stroke: "currentColor",
53
+ viewBox: "0 0 24 24",
54
+ children: /* @__PURE__ */ jsx(
55
+ "path",
56
+ {
57
+ d: "M6 18L18 6M6 6l12 12",
58
+ strokeLinecap: "round",
59
+ strokeLinejoin: "round",
60
+ strokeWidth: 2
61
+ }
62
+ )
63
+ }
64
+ ) : /* @__PURE__ */ jsx(
65
+ "svg",
66
+ {
67
+ className: "size-5",
68
+ fill: "none",
69
+ stroke: "currentColor",
70
+ viewBox: "0 0 24 24",
71
+ children: /* @__PURE__ */ jsx(
72
+ "path",
73
+ {
74
+ d: "M4 6h16M4 12h16M4 18h16",
75
+ strokeLinecap: "round",
76
+ strokeLinejoin: "round",
77
+ strokeWidth: 2
78
+ }
79
+ )
80
+ }
81
+ )
82
+ }
83
+ ),
84
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
85
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground truncate", children: title }),
86
+ /* @__PURE__ */ jsx("p", { className: "text-sm font-medium truncate", children: sectionTitle })
87
+ ] })
88
+ ] }),
89
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 flex-shrink-0", children: [
90
+ /* @__PURE__ */ jsxs("span", { className: "text-xs text-muted-foreground tabular-nums hidden sm:inline", children: [
91
+ currentIndex + 1,
92
+ "/",
93
+ sectionCount
94
+ ] }),
95
+ /* @__PURE__ */ jsx(
96
+ "button",
97
+ {
98
+ "aria-label": labels.exitLabel,
99
+ className: "p-2 rounded-lg hover:bg-muted transition-colors",
100
+ onClick: onExit,
101
+ type: "button",
102
+ children: /* @__PURE__ */ jsx(
103
+ "svg",
104
+ {
105
+ className: "size-5",
106
+ fill: "none",
107
+ stroke: "currentColor",
108
+ viewBox: "0 0 24 24",
109
+ children: /* @__PURE__ */ jsx(
110
+ "path",
111
+ {
112
+ d: "M6 18L18 6M6 6l12 12",
113
+ strokeLinecap: "round",
114
+ strokeLinejoin: "round",
115
+ strokeWidth: 2
116
+ }
117
+ )
118
+ }
119
+ )
120
+ }
121
+ )
122
+ ] })
123
+ ] });
124
+ }
125
+ function SlideshowToc({
126
+ as: SectionsHeading = "h3",
127
+ completedSections,
128
+ currentIndex,
129
+ isOpen,
130
+ labels,
131
+ onClose,
132
+ onNavigate,
133
+ sections
134
+ }) {
135
+ if (!isOpen) return null;
136
+ return /* @__PURE__ */ jsxs(
137
+ "div",
138
+ {
139
+ className: "absolute inset-0 z-20 flex animate-in fade-in-0 duration-200",
140
+ onClick: onClose,
141
+ onKeyDown: (event) => {
142
+ if (event.key === "Enter" || event.key === " ") onClose();
143
+ },
144
+ role: "button",
145
+ tabIndex: 0,
146
+ children: [
147
+ /* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-background/40" }),
148
+ /* @__PURE__ */ jsxs(
149
+ "div",
150
+ {
151
+ className: "relative w-full sm:max-w-sm bg-background border-r border-border h-full overflow-auto shadow-2xl",
152
+ onClick: (event) => {
153
+ event.stopPropagation();
154
+ },
155
+ onKeyDown: (event) => {
156
+ event.stopPropagation();
157
+ },
158
+ role: "dialog",
159
+ children: [
160
+ /* @__PURE__ */ jsxs("div", { className: "sticky top-0 flex items-center justify-between px-4 py-3 border-b border-border bg-background", children: [
161
+ /* @__PURE__ */ jsx(SectionsHeading, { className: "font-semibold", children: labels.sectionsLabel }),
162
+ /* @__PURE__ */ jsx(
163
+ "button",
164
+ {
165
+ "aria-label": labels.closeLabel,
166
+ className: "p-2 rounded-lg hover:bg-muted transition-colors",
167
+ onClick: onClose,
168
+ type: "button",
169
+ children: /* @__PURE__ */ jsx(
170
+ "svg",
171
+ {
172
+ className: "size-4",
173
+ fill: "none",
174
+ stroke: "currentColor",
175
+ viewBox: "0 0 24 24",
176
+ children: /* @__PURE__ */ jsx(
177
+ "path",
178
+ {
179
+ d: "M6 18L18 6M6 6l12 12",
180
+ strokeLinecap: "round",
181
+ strokeLinejoin: "round",
182
+ strokeWidth: 2
183
+ }
184
+ )
185
+ }
186
+ )
187
+ }
188
+ )
189
+ ] }),
190
+ /* @__PURE__ */ jsx("div", { className: "p-2", children: sections.map((section, index) => {
191
+ const isCompleted = completedSections.has(section.id);
192
+ const isCurrent = index === currentIndex;
193
+ return /* @__PURE__ */ jsxs(
194
+ "button",
195
+ {
196
+ className: cn(
197
+ "w-full flex items-center gap-3 p-3 rounded-lg text-left transition-colors",
198
+ isCurrent ? "bg-muted" : "hover:bg-muted/50"
199
+ ),
200
+ onClick: () => {
201
+ onNavigate(index);
202
+ },
203
+ type: "button",
204
+ children: [
205
+ /* @__PURE__ */ jsx(
206
+ "div",
207
+ {
208
+ className: cn(
209
+ "flex-shrink-0 size-5 rounded-full border-2 flex items-center justify-center",
210
+ isCompleted ? "bg-foreground border-foreground" : "border-muted-foreground"
211
+ ),
212
+ children: isCompleted ? /* @__PURE__ */ jsx(
213
+ "svg",
214
+ {
215
+ className: "size-3 text-background",
216
+ fill: "none",
217
+ stroke: "currentColor",
218
+ viewBox: "0 0 24 24",
219
+ children: /* @__PURE__ */ jsx(
220
+ "path",
221
+ {
222
+ d: "M5 13l4 4L19 7",
223
+ strokeLinecap: "round",
224
+ strokeLinejoin: "round",
225
+ strokeWidth: 2
226
+ }
227
+ )
228
+ }
229
+ ) : null
230
+ }
231
+ ),
232
+ /* @__PURE__ */ jsx(
233
+ "span",
234
+ {
235
+ className: cn(
236
+ "flex-1 text-sm truncate",
237
+ isCompleted && "line-through opacity-60"
238
+ ),
239
+ children: section.title
240
+ }
241
+ )
242
+ ]
243
+ },
244
+ section.id
245
+ );
246
+ }) })
247
+ ]
248
+ }
249
+ )
250
+ ]
251
+ }
252
+ );
253
+ }
254
+ function SlideshowContent({
255
+ section,
256
+ source
257
+ }) {
258
+ return source(section);
259
+ }
260
+ function SlideshowNav({
261
+ canGoPrevious,
262
+ isLastSection,
263
+ labels,
264
+ onNext,
265
+ onPrevious
266
+ }) {
267
+ return /* @__PURE__ */ jsxs("div", { className: "relative z-20 flex items-center justify-between p-4 border-t border-border bg-background", children: [
268
+ /* @__PURE__ */ jsxs(
269
+ "button",
270
+ {
271
+ 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",
272
+ disabled: !canGoPrevious,
273
+ onClick: onPrevious,
274
+ type: "button",
275
+ children: [
276
+ /* @__PURE__ */ jsx(
277
+ "svg",
278
+ {
279
+ className: "size-4",
280
+ fill: "none",
281
+ stroke: "currentColor",
282
+ viewBox: "0 0 24 24",
283
+ children: /* @__PURE__ */ jsx(
284
+ "path",
285
+ {
286
+ d: "m15 19-7-7 7-7",
287
+ strokeLinecap: "round",
288
+ strokeLinejoin: "round",
289
+ strokeWidth: 2
290
+ }
291
+ )
292
+ }
293
+ ),
294
+ /* @__PURE__ */ jsx("span", { children: labels.prevLabel })
295
+ ]
296
+ }
297
+ ),
298
+ /* @__PURE__ */ jsxs(
299
+ "button",
300
+ {
301
+ 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",
302
+ onClick: onNext,
303
+ type: "button",
304
+ children: [
305
+ /* @__PURE__ */ jsx("span", { children: isLastSection ? labels.finishLabel : labels.nextLabel }),
306
+ !isLastSection && /* @__PURE__ */ jsx(
307
+ "svg",
308
+ {
309
+ className: "size-4",
310
+ fill: "none",
311
+ stroke: "currentColor",
312
+ viewBox: "0 0 24 24",
313
+ children: /* @__PURE__ */ jsx(
314
+ "path",
315
+ {
316
+ d: "m9 5 7 7-7 7",
317
+ strokeLinecap: "round",
318
+ strokeLinejoin: "round",
319
+ strokeWidth: 2
320
+ }
321
+ )
322
+ }
323
+ )
324
+ ]
325
+ }
326
+ )
327
+ ] });
328
+ }
18
329
  function SlideshowImpl({
330
+ as: SectionsHeading = "h3",
19
331
  completedSections,
20
332
  completionDialogTitle = "Mark section as complete?",
21
333
  currentIndex,
22
- labels = {},
334
+ labels = EMPTY_SLIDESHOW_LABELS,
23
335
  onComplete,
24
336
  onExit,
25
337
  onNavigate,
@@ -124,224 +436,38 @@ function SlideshowImpl({
124
436
  if (!currentSection || !mounted) return null;
125
437
  return createPortal(
126
438
  /* @__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",
439
+ /* @__PURE__ */ jsx(SlideshowProgress, { progress }),
440
+ /* @__PURE__ */ jsx(
441
+ SlideshowHeader,
129
442
  {
130
- className: "h-full bg-foreground transition-all duration-300 ease-out",
131
- style: { width: `${progress}%` }
443
+ currentIndex,
444
+ isTocOpen,
445
+ labels: mergedLabels,
446
+ onExit,
447
+ onToggleToc: () => {
448
+ setIsTocOpen((p) => !p);
449
+ },
450
+ sectionCount: sections.length,
451
+ sectionTitle: currentSection.title,
452
+ title
132
453
  }
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
- ] }),
454
+ ),
222
455
  /* @__PURE__ */ jsxs("div", { className: "relative flex-1 overflow-hidden", children: [
223
- isTocOpen ? /* @__PURE__ */ jsxs(
224
- "div",
456
+ /* @__PURE__ */ jsx(
457
+ SlideshowToc,
225
458
  {
226
- className: "absolute inset-0 z-20 flex animate-in fade-in-0 duration-200",
227
- onClick: () => {
459
+ as: SectionsHeading,
460
+ completedSections,
461
+ currentIndex,
462
+ isOpen: isTocOpen,
463
+ labels: mergedLabels,
464
+ onClose: () => {
228
465
  setIsTocOpen(false);
229
466
  },
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
- ]
467
+ onNavigate: handleTocNavigate,
468
+ sections
343
469
  }
344
- ) : null,
470
+ ),
345
471
  /* @__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
472
  "div",
347
473
  {
@@ -351,71 +477,26 @@ function SlideshowImpl({
351
477
  animationDirection === "right" && "opacity-0 translate-x-4",
352
478
  !animationDirection && "opacity-100 translate-x-0"
353
479
  ),
354
- children: renderContent(currentSection)
480
+ children: /* @__PURE__ */ jsx(
481
+ SlideshowContent,
482
+ {
483
+ section: currentSection,
484
+ source: renderContent
485
+ }
486
+ )
355
487
  }
356
488
  ) }) })
357
489
  ] }),
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
- ] }),
490
+ /* @__PURE__ */ jsx(
491
+ SlideshowNav,
492
+ {
493
+ canGoPrevious,
494
+ isLastSection,
495
+ labels: mergedLabels,
496
+ onNext: handleNext,
497
+ onPrevious: handlePrevious
498
+ }
499
+ ),
419
500
  /* @__PURE__ */ jsx(
420
501
  CompletionDialog,
421
502
  {
@@ -0,0 +1,6 @@
1
+ import {
2
+ SnapGuides
3
+ } from "./snap-guides";
4
+ export {
5
+ SnapGuides
6
+ };