@vllnt/ui 0.4.0-canary.sha70c4c77 → 0.4.0-canary.shab30cb4b

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 (342) hide show
  1. package/dist/components/animated-text/animated-text.js +10 -5
  2. package/dist/components/category-filter/category-filter.js +1 -1
  3. package/dist/components/checklist/checklist.js +27 -21
  4. package/dist/components/chronological-timeline/chronological-timeline.js +0 -1
  5. package/dist/components/color-picker/color-picker.js +1 -1
  6. package/dist/components/command/command.js +14 -17
  7. package/dist/components/completion-dialog/completion-dialog.js +61 -38
  8. package/dist/components/content-intro/content-intro.js +145 -102
  9. package/dist/components/date-range-picker/date-range-picker.js +2 -2
  10. package/dist/components/filter-bar/filter-bar.js +27 -9
  11. package/dist/components/index.js +428 -322
  12. package/dist/components/inline-input/inline-input.js +4 -1
  13. package/dist/components/keyboard-shortcuts-help/keyboard-shortcuts-help.js +44 -36
  14. package/dist/components/mdx-content/mdx-content.js +0 -1
  15. package/dist/components/pro-tip/pro-tip.js +30 -24
  16. package/dist/components/progress-tracker/progress-tracker.js +296 -169
  17. package/dist/components/quiz/quiz.js +85 -76
  18. package/dist/components/range-calendar/range-calendar.js +1 -1
  19. package/dist/components/sidebar/sidebar.js +191 -100
  20. package/dist/components/slideshow/slideshow.js +24 -8
  21. package/dist/components/step-by-step/step-by-step.js +86 -93
  22. package/dist/components/step-navigation/step-navigation.js +31 -50
  23. package/dist/components/table-of-contents-panel/table-of-contents-panel.js +181 -134
  24. package/dist/components/tabs/tabs.js +23 -9
  25. package/dist/components/time-picker/time-picker.js +1 -1
  26. package/dist/components/tutorial-complete/tutorial-complete.js +155 -86
  27. package/dist/index.d.ts +12 -6
  28. package/package.json +1 -4
  29. package/dist/components/accordion/index.js +0 -12
  30. package/dist/components/activity-heatmap/index.js +0 -6
  31. package/dist/components/activity-log/index.js +0 -6
  32. package/dist/components/agent-activity/index.js +0 -18
  33. package/dist/components/ai-artifact/index.js +0 -24
  34. package/dist/components/ai-chat-input/index.js +0 -4
  35. package/dist/components/ai-message-bubble/index.js +0 -6
  36. package/dist/components/ai-sidebar/index.js +0 -22
  37. package/dist/components/ai-source-citation/index.js +0 -6
  38. package/dist/components/ai-streaming-text/index.js +0 -6
  39. package/dist/components/ai-tool-call-display/index.js +0 -6
  40. package/dist/components/alert/index.js +0 -7
  41. package/dist/components/alert-dialog/index.js +0 -26
  42. package/dist/components/alert-pulse/index.js +0 -6
  43. package/dist/components/anchor-port/index.js +0 -4
  44. package/dist/components/animated-beam/index.js +0 -4
  45. package/dist/components/animated-grid-pattern/index.js +0 -6
  46. package/dist/components/animated-list/index.js +0 -4
  47. package/dist/components/animated-tabs/index.js +0 -6
  48. package/dist/components/animated-testimonials/index.js +0 -6
  49. package/dist/components/animated-text/index.js +0 -4
  50. package/dist/components/animated-tooltip/index.js +0 -6
  51. package/dist/components/annotation/index.js +0 -8
  52. package/dist/components/aspect-ratio/index.js +0 -4
  53. package/dist/components/auto-reload/index.js +0 -6
  54. package/dist/components/avatar/index.js +0 -6
  55. package/dist/components/avatar-group/index.js +0 -10
  56. package/dist/components/badge/index.js +0 -5
  57. package/dist/components/banner/index.js +0 -10
  58. package/dist/components/bento-grid/index.js +0 -8
  59. package/dist/components/blog-card/index.js +0 -5
  60. package/dist/components/blur-reveal/index.js +0 -4
  61. package/dist/components/border-beam/index.js +0 -4
  62. package/dist/components/bottom-activity-strip/index.js +0 -6
  63. package/dist/components/bottom-bar/index.js +0 -4
  64. package/dist/components/breadcrumb/index.js +0 -4
  65. package/dist/components/button/index.js +0 -5
  66. package/dist/components/button-group/index.js +0 -8
  67. package/dist/components/calendar/index.js +0 -4
  68. package/dist/components/callout/index.js +0 -4
  69. package/dist/components/candlestick-chart/index.js +0 -6
  70. package/dist/components/canvas-shell/canvas-foundation-demo.js +0 -183
  71. package/dist/components/canvas-shell/index.js +0 -4
  72. package/dist/components/canvas-view/index.js +0 -6
  73. package/dist/components/card/index.js +0 -16
  74. package/dist/components/card-flip/index.js +0 -4
  75. package/dist/components/carousel/index.js +0 -14
  76. package/dist/components/category-filter/index.js +0 -4
  77. package/dist/components/chain-of-thought/index.js +0 -6
  78. package/dist/components/chart/index.js +0 -3
  79. package/dist/components/chat-dock-section/index.js +0 -6
  80. package/dist/components/checkbox/index.js +0 -4
  81. package/dist/components/checkbox-group/index.js +0 -8
  82. package/dist/components/checklist/index.js +0 -14
  83. package/dist/components/choropleth-map/index.js +0 -10
  84. package/dist/components/chronological-timeline/index.js +0 -8
  85. package/dist/components/civilization-card/index.js +0 -8
  86. package/dist/components/code-block/index.js +0 -4
  87. package/dist/components/code-playground/index.js +0 -8
  88. package/dist/components/collapsible/index.js +0 -10
  89. package/dist/components/color-picker/index.js +0 -4
  90. package/dist/components/combobox/index.js +0 -4
  91. package/dist/components/command/index.js +0 -22
  92. package/dist/components/comment-pin/index.js +0 -6
  93. package/dist/components/comparison/index.js +0 -8
  94. package/dist/components/completion-dialog/index.js +0 -6
  95. package/dist/components/connector-edge/index.js +0 -6
  96. package/dist/components/content-intro/index.js +0 -6
  97. package/dist/components/context-lens/index.js +0 -6
  98. package/dist/components/context-menu/index.js +0 -34
  99. package/dist/components/contribution-graph/index.js +0 -6
  100. package/dist/components/conversation-thread/index.js +0 -20
  101. package/dist/components/cookie-consent/index.js +0 -8
  102. package/dist/components/copy-button/index.js +0 -8
  103. package/dist/components/countdown-timer/index.js +0 -4
  104. package/dist/components/credit-badge/index.js +0 -6
  105. package/dist/components/curriculum/index.js +0 -10
  106. package/dist/components/cursor/index.js +0 -4
  107. package/dist/components/data-list/index.js +0 -16
  108. package/dist/components/data-table/index.js +0 -6
  109. package/dist/components/date-field/index.js +0 -4
  110. package/dist/components/date-picker/index.js +0 -4
  111. package/dist/components/date-range-picker/index.js +0 -6
  112. package/dist/components/dialog/index.js +0 -24
  113. package/dist/components/display/index.js +0 -4
  114. package/dist/components/dock/index.js +0 -5
  115. package/dist/components/document-sibling-nav/index.js +0 -8
  116. package/dist/components/dot-pattern/index.js +0 -4
  117. package/dist/components/drawer/index.js +0 -24
  118. package/dist/components/dropdown-menu/index.js +0 -34
  119. package/dist/components/edge-label/index.js +0 -4
  120. package/dist/components/empty-state/index.js +0 -8
  121. package/dist/components/era-comparison/index.js +0 -16
  122. package/dist/components/exercise/index.js +0 -4
  123. package/dist/components/expandable-cards/index.js +0 -6
  124. package/dist/components/faq/index.js +0 -5
  125. package/dist/components/field/index.js +0 -16
  126. package/dist/components/fieldset/index.js +0 -10
  127. package/dist/components/file-upload/index.js +0 -4
  128. package/dist/components/filter-bar/index.js +0 -6
  129. package/dist/components/flashcard/index.js +0 -4
  130. package/dist/components/floating-action-button/index.js +0 -6
  131. package/dist/components/floating-navbar/index.js +0 -4
  132. package/dist/components/floating-toolbar/index.js +0 -6
  133. package/dist/components/follow-mode/index.js +0 -6
  134. package/dist/components/form/index.js +0 -20
  135. package/dist/components/gantt-chart/index.js +0 -6
  136. package/dist/components/gauge-chart/index.js +0 -4
  137. package/dist/components/geography-quiz-map/index.js +0 -12
  138. package/dist/components/glass-card/index.js +0 -4
  139. package/dist/components/glass-panel/index.js +0 -4
  140. package/dist/components/glass-progress/index.js +0 -4
  141. package/dist/components/globe-3d/index.js +0 -10
  142. package/dist/components/grid/index.js +0 -4
  143. package/dist/components/group-hull/index.js +0 -4
  144. package/dist/components/handoff-beacon/index.js +0 -6
  145. package/dist/components/heading/index.js +0 -4
  146. package/dist/components/heat-map-overlay/index.js +0 -6
  147. package/dist/components/heat-overlay/index.js +0 -6
  148. package/dist/components/historic-timeline/index.js +0 -6
  149. package/dist/components/historical-figure-card/index.js +0 -6
  150. package/dist/components/horizontal-scroll-row/index.js +0 -6
  151. package/dist/components/hover-card/index.js +0 -6
  152. package/dist/components/infinite-plane/index.js +0 -6
  153. package/dist/components/inline-input/index.js +0 -4
  154. package/dist/components/input/index.js +0 -4
  155. package/dist/components/input-group/index.js +0 -14
  156. package/dist/components/input-otp/index.js +0 -12
  157. package/dist/components/interactive-timeline/index.js +0 -16
  158. package/dist/components/item/index.js +0 -18
  159. package/dist/components/jarvis-dock/index.js +0 -6
  160. package/dist/components/kbd/index.js +0 -5
  161. package/dist/components/key-concept/index.js +0 -8
  162. package/dist/components/keyboard-shortcuts-help/index.js +0 -6
  163. package/dist/components/knowledge-check/index.js +0 -6
  164. package/dist/components/label/index.js +0 -4
  165. package/dist/components/lang-provider/index.js +0 -4
  166. package/dist/components/learning-objectives/index.js +0 -10
  167. package/dist/components/left-rail/index.js +0 -4
  168. package/dist/components/link/index.js +0 -5
  169. package/dist/components/liquid-glass/index.js +0 -4
  170. package/dist/components/list-box/index.js +0 -8
  171. package/dist/components/live-cursor/index.js +0 -6
  172. package/dist/components/live-feed/index.js +0 -4
  173. package/dist/components/magnetic/index.js +0 -4
  174. package/dist/components/magnetic-button/index.js +0 -4
  175. package/dist/components/map-2d/index.js +0 -20
  176. package/dist/components/map-timeline/index.js +0 -16
  177. package/dist/components/market-treemap/index.js +0 -6
  178. package/dist/components/marquee/index.js +0 -4
  179. package/dist/components/mdx-content/index.js +0 -4
  180. package/dist/components/menubar/index.js +0 -36
  181. package/dist/components/meteors/index.js +0 -4
  182. package/dist/components/meter/index.js +0 -5
  183. package/dist/components/metric-cluster/index.js +0 -6
  184. package/dist/components/metric-gauge/index.js +0 -6
  185. package/dist/components/mini-map-panel/index.js +0 -6
  186. package/dist/components/model-comparison/index.js +0 -12
  187. package/dist/components/model-selector/index.js +0 -6
  188. package/dist/components/multi-select/index.js +0 -6
  189. package/dist/components/multi-select-lasso/index.js +0 -6
  190. package/dist/components/native-select/index.js +0 -4
  191. package/dist/components/navbar-saas/index.js +0 -6
  192. package/dist/components/navigation-menu/index.js +0 -22
  193. package/dist/components/newsletter-signup/index.js +0 -8
  194. package/dist/components/number-input/index.js +0 -4
  195. package/dist/components/number-ticker/index.js +0 -4
  196. package/dist/components/object-card/index.js +0 -6
  197. package/dist/components/object-handle/index.js +0 -4
  198. package/dist/components/object-inspector/index.js +0 -6
  199. package/dist/components/order-book/index.js +0 -6
  200. package/dist/components/overview-board/index.js +0 -8
  201. package/dist/components/pagination/index.js +0 -4
  202. package/dist/components/panel/index.js +0 -16
  203. package/dist/components/parallel-timeline/index.js +0 -6
  204. package/dist/components/particles/index.js +0 -4
  205. package/dist/components/password-input/index.js +0 -4
  206. package/dist/components/phone-input/index.js +0 -6
  207. package/dist/components/pie-chart/index.js +0 -4
  208. package/dist/components/plan-badge/index.js +0 -6
  209. package/dist/components/playback-ghost/index.js +0 -6
  210. package/dist/components/policy-delivery-panel/index.js +0 -6
  211. package/dist/components/popover/index.js +0 -12
  212. package/dist/components/presence-stack/index.js +0 -6
  213. package/dist/components/presence-sync-indicator/index.js +0 -6
  214. package/dist/components/pricing-table/index.js +0 -8
  215. package/dist/components/primary-source-viewer/index.js +0 -26
  216. package/dist/components/pro-tip/index.js +0 -8
  217. package/dist/components/profile-section/index.js +0 -4
  218. package/dist/components/progress-bar/index.js +0 -4
  219. package/dist/components/progress-card/index.js +0 -6
  220. package/dist/components/progress-tracker/index.js +0 -20
  221. package/dist/components/progressive-blur/index.js +0 -6
  222. package/dist/components/prompt-input/index.js +0 -4
  223. package/dist/components/prompt-templates/index.js +0 -6
  224. package/dist/components/property-section/index.js +0 -6
  225. package/dist/components/prose/index.js +0 -4
  226. package/dist/components/qr-code/index.js +0 -4
  227. package/dist/components/quiz/index.js +0 -4
  228. package/dist/components/radar-chart/index.js +0 -6
  229. package/dist/components/radio-group/index.js +0 -5
  230. package/dist/components/range-calendar/index.js +0 -4
  231. package/dist/components/rating/index.js +0 -4
  232. package/dist/components/reasoning/index.js +0 -4
  233. package/dist/components/relationship-inspector/index.js +0 -6
  234. package/dist/components/resizable/index.js +0 -10
  235. package/dist/components/reveal-text/index.js +0 -6
  236. package/dist/components/right-dock/index.js +0 -4
  237. package/dist/components/role-badge/index.js +0 -6
  238. package/dist/components/route-map/index.js +0 -6
  239. package/dist/components/routing-assignment-panel/index.js +0 -6
  240. package/dist/components/run-timeline/index.js +0 -6
  241. package/dist/components/runtime-overview-panel/index.js +0 -6
  242. package/dist/components/sankey-chart/index.js +0 -6
  243. package/dist/components/scope-selector/index.js +0 -6
  244. package/dist/components/scramble-text/index.js +0 -4
  245. package/dist/components/scroll-area/index.js +0 -5
  246. package/dist/components/scroll-progress/index.js +0 -4
  247. package/dist/components/search-bar/index.js +0 -4
  248. package/dist/components/search-dialog/index.js +0 -4
  249. package/dist/components/search-field/index.js +0 -4
  250. package/dist/components/segmented-control/index.js +0 -12
  251. package/dist/components/select/index.js +0 -24
  252. package/dist/components/selection-halo/index.js +0 -6
  253. package/dist/components/selection-presence/index.js +0 -6
  254. package/dist/components/separator/index.js +0 -4
  255. package/dist/components/severity-badge/index.js +0 -8
  256. package/dist/components/share-dialog/index.js +0 -6
  257. package/dist/components/share-section/index.js +0 -6
  258. package/dist/components/sheet/index.js +0 -24
  259. package/dist/components/shimmer-button/index.js +0 -4
  260. package/dist/components/shimmer-text/index.js +0 -4
  261. package/dist/components/shine-border/index.js +0 -4
  262. package/dist/components/shiny-button/index.js +0 -4
  263. package/dist/components/sidebar/index.js +0 -4
  264. package/dist/components/sidebar-provider/index.js +0 -5
  265. package/dist/components/sidebar-toggle/index.js +0 -4
  266. package/dist/components/skeleton/index.js +0 -4
  267. package/dist/components/slider/index.js +0 -4
  268. package/dist/components/slideshow/index.js +0 -6
  269. package/dist/components/snap-guides/index.js +0 -6
  270. package/dist/components/social-fab/index.js +0 -6
  271. package/dist/components/sparkles/index.js +0 -4
  272. package/dist/components/sparkline-grid/index.js +0 -6
  273. package/dist/components/spinner/index.js +0 -8
  274. package/dist/components/spinning-text/index.js +0 -4
  275. package/dist/components/spotlight-card/index.js +0 -4
  276. package/dist/components/stat-card/index.js +0 -5
  277. package/dist/components/state-badge-overlay/index.js +0 -6
  278. package/dist/components/static-code/index.js +0 -4
  279. package/dist/components/status-board/index.js +0 -6
  280. package/dist/components/status-indicator/index.js +0 -10
  281. package/dist/components/step-by-step/index.js +0 -8
  282. package/dist/components/step-navigation/index.js +0 -4
  283. package/dist/components/stepper/index.js +0 -4
  284. package/dist/components/sticky-metric/index.js +0 -6
  285. package/dist/components/story-map/index.js +0 -8
  286. package/dist/components/subscription-card/index.js +0 -6
  287. package/dist/components/switch/index.js +0 -4
  288. package/dist/components/table/index.js +0 -20
  289. package/dist/components/table-of-contents/index.js +0 -4
  290. package/dist/components/table-of-contents-panel/index.js +0 -6
  291. package/dist/components/tabs/index.js +0 -12
  292. package/dist/components/tag-group/index.js +0 -8
  293. package/dist/components/tags-input/index.js +0 -4
  294. package/dist/components/terminal/index.js +0 -8
  295. package/dist/components/text/index.js +0 -5
  296. package/dist/components/text-animate/index.js +0 -6
  297. package/dist/components/text-field/index.js +0 -4
  298. package/dist/components/text-reveal/index.js +0 -4
  299. package/dist/components/text-shimmer/index.js +0 -4
  300. package/dist/components/textarea/index.js +0 -4
  301. package/dist/components/theme-preset-provider/index.js +0 -4
  302. package/dist/components/theme-provider/index.js +0 -4
  303. package/dist/components/theme-switcher/index.js +0 -4
  304. package/dist/components/theme-toggle/index.js +0 -4
  305. package/dist/components/thinking-block/index.js +0 -4
  306. package/dist/components/thread-bubble/index.js +0 -6
  307. package/dist/components/threshold-ring/index.js +0 -6
  308. package/dist/components/ticker-tape/index.js +0 -6
  309. package/dist/components/tilt-card/index.js +0 -4
  310. package/dist/components/time-field/index.js +0 -4
  311. package/dist/components/time-picker/index.js +0 -4
  312. package/dist/components/timeline/index.js +0 -12
  313. package/dist/components/timeline-scrubber/index.js +0 -6
  314. package/dist/components/tldr-section/index.js +0 -4
  315. package/dist/components/toast/index.js +0 -18
  316. package/dist/components/toggle/index.js +0 -5
  317. package/dist/components/toggle-group/index.js +0 -5
  318. package/dist/components/toolbar/index.js +0 -8
  319. package/dist/components/tooltip/index.js +0 -12
  320. package/dist/components/top-bar/index.js +0 -4
  321. package/dist/components/tour/index.js +0 -4
  322. package/dist/components/transaction-list/index.js +0 -14
  323. package/dist/components/tree-view/index.js +0 -6
  324. package/dist/components/truncated-text/index.js +0 -4
  325. package/dist/components/tutorial-card/index.js +0 -6
  326. package/dist/components/tutorial-complete/index.js +0 -6
  327. package/dist/components/tutorial-filters/index.js +0 -6
  328. package/dist/components/tutorial-intro-content/index.js +0 -6
  329. package/dist/components/tutorial-mdx/index.js +0 -8
  330. package/dist/components/typewriter/index.js +0 -4
  331. package/dist/components/typography/index.js +0 -26
  332. package/dist/components/usage-breakdown/index.js +0 -6
  333. package/dist/components/video-embed/index.js +0 -4
  334. package/dist/components/view-switcher/index.js +0 -6
  335. package/dist/components/viewport-bookmarks/index.js +0 -6
  336. package/dist/components/wallet-card/index.js +0 -4
  337. package/dist/components/watchlist/index.js +0 -6
  338. package/dist/components/workspace-switcher/index.js +0 -6
  339. package/dist/components/world-breadcrumbs/index.js +0 -6
  340. package/dist/components/world-clock-bar/index.js +0 -6
  341. package/dist/components/zoom-hud/index.js +0 -4
  342. package/dist/test-setup.js +0 -44
@@ -2,9 +2,14 @@
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import * as React from "react";
4
4
  import { cn } from "../../lib/utils.js";
5
- const GLYPH_SEGMENTER = new Intl.Segmenter(void 0, {
6
- granularity: "grapheme"
7
- });
5
+ const glyphSegmenterCache = {};
6
+ function splitGlyphs(text) {
7
+ if (glyphSegmenterCache.segmenter === void 0) {
8
+ glyphSegmenterCache.segmenter = typeof Intl.Segmenter === "function" ? new Intl.Segmenter(void 0, { granularity: "grapheme" }) : null;
9
+ }
10
+ const { segmenter } = glyphSegmenterCache;
11
+ return segmenter ? Array.from(segmenter.segment(text), ({ segment }) => segment) : text.match(/./gsu) ?? [];
12
+ }
8
13
  const ASCII_RANDOM_CHARACTERS = Array.from(
9
14
  { length: 94 },
10
15
  (_, index) => String.fromCodePoint(index + 33)
@@ -24,12 +29,12 @@ const ANIMATED_TEXT_RANDOM_CHARACTER_PRESETS = {
24
29
  const DEFAULT_RANDOM_CHARACTERS = ANIMATED_TEXT_RANDOM_CHARACTER_PRESETS.matrix;
25
30
  function getSegments(text, splitBy) {
26
31
  if (splitBy === "character") {
27
- return Array.from(GLYPH_SEGMENTER.segment(text), ({ segment }) => segment);
32
+ return splitGlyphs(text);
28
33
  }
29
34
  return text.match(/\S+\s*/g) ?? [];
30
35
  }
31
36
  function getGlyphs(text) {
32
- return Array.from(GLYPH_SEGMENTER.segment(text), ({ segment }) => segment);
37
+ return splitGlyphs(text);
33
38
  }
34
39
  function getRandomMatrixGlyph(randomCharacters) {
35
40
  const glyphs = getGlyphs(randomCharacters);
@@ -8,7 +8,7 @@ function slugify(text) {
8
8
  }
9
9
  function CategoryFilter({ categories, lang }) {
10
10
  const pathname = usePathname();
11
- const allCategories = Array.from(new Set(categories)).sort();
11
+ const allCategories = [...new Set(categories)].sort();
12
12
  if (allCategories.length === 0) {
13
13
  return null;
14
14
  }
@@ -130,6 +130,29 @@ function ChecklistHeader({
130
130
  ] })
131
131
  ] });
132
132
  }
133
+ function readPersistedChecklist(persistKey) {
134
+ if (typeof window !== "undefined" && persistKey) {
135
+ const saved = localStorage.getItem(`checklist:${persistKey}`);
136
+ if (saved) {
137
+ return new Set(parseChecklistStorageValue(saved));
138
+ }
139
+ }
140
+ return /* @__PURE__ */ new Set();
141
+ }
142
+ function persistChecklist(persistKey, ids) {
143
+ try {
144
+ localStorage.setItem(
145
+ `checklist:${persistKey}`,
146
+ createChecklistStorageValue(ids)
147
+ );
148
+ window.dispatchEvent(
149
+ new CustomEvent(CHECKLIST_PROGRESS_EVENT, {
150
+ detail: { persistKey }
151
+ })
152
+ );
153
+ } catch {
154
+ }
155
+ }
133
156
  function Checklist({
134
157
  as: Heading = "h4",
135
158
  className,
@@ -138,33 +161,16 @@ function Checklist({
138
161
  persistKey,
139
162
  title
140
163
  }) {
141
- const [checked, setChecked] = useState(() => {
142
- if (typeof window !== "undefined" && persistKey) {
143
- const saved = localStorage.getItem(`checklist:${persistKey}`);
144
- if (saved) {
145
- return new Set(parseChecklistStorageValue(saved));
146
- }
147
- }
148
- return /* @__PURE__ */ new Set();
149
- });
164
+ const [checked, setChecked] = useState(
165
+ () => readPersistedChecklist(persistKey)
166
+ );
150
167
  const toggleItem = (id) => {
151
168
  const newChecked = new Set(checked);
152
169
  if (newChecked.has(id)) newChecked.delete(id);
153
170
  else newChecked.add(id);
154
171
  setChecked(newChecked);
155
172
  if (persistKey) {
156
- try {
157
- localStorage.setItem(
158
- `checklist:${persistKey}`,
159
- createChecklistStorageValue(newChecked)
160
- );
161
- window.dispatchEvent(
162
- new CustomEvent(CHECKLIST_PROGRESS_EVENT, {
163
- detail: { persistKey }
164
- })
165
- );
166
- } catch {
167
- }
173
+ persistChecklist(persistKey, newChecked);
168
174
  }
169
175
  if (newChecked.size === items.length) {
170
176
  onComplete?.();
@@ -175,7 +175,6 @@ const ChronoEvent = ({
175
175
  return (
176
176
  /* Passive focus tracking: the container observes focus bubbling from
177
177
  its interactive children to drive the scroll-spy active state. */
178
- // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
179
178
  /* @__PURE__ */ jsxs(
180
179
  "article",
181
180
  {
@@ -4,7 +4,7 @@ import * as React from "react";
4
4
  import { cn } from "../../lib/utils.js";
5
5
  import { Button } from "../button/button.js";
6
6
  import { Input } from "../input/input.js";
7
- import { Popover, PopoverContent, PopoverTrigger } from "../popover/index.js";
7
+ import { Popover, PopoverContent, PopoverTrigger } from "../popover/popover.js";
8
8
  const presetSwatches = [
9
9
  "#ef4444",
10
10
  "#f97316",
@@ -30,23 +30,20 @@ const CommandInput = ({
30
30
  className,
31
31
  ref: reference,
32
32
  ...props
33
- }) => (
34
- // eslint-disable-next-line react/no-unknown-property
35
- /* @__PURE__ */ jsxs("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [
36
- /* @__PURE__ */ jsx(Search, { className: "mr-2 size-4 shrink-0 opacity-50" }),
37
- /* @__PURE__ */ jsx(
38
- CommandPrimitive.Input,
39
- {
40
- className: cn(
41
- "flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
42
- className
43
- ),
44
- ref: reference,
45
- ...props
46
- }
47
- )
48
- ] })
49
- );
33
+ }) => /* @__PURE__ */ jsxs("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [
34
+ /* @__PURE__ */ jsx(Search, { className: "mr-2 size-4 shrink-0 opacity-50" }),
35
+ /* @__PURE__ */ jsx(
36
+ CommandPrimitive.Input,
37
+ {
38
+ className: cn(
39
+ "flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
40
+ className
41
+ ),
42
+ ref: reference,
43
+ ...props
44
+ }
45
+ )
46
+ ] });
50
47
  CommandInput.displayName = CommandPrimitive.Input.displayName;
51
48
  const CommandList = ({
52
49
  className,
@@ -3,6 +3,38 @@ import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import { memo, useEffect, useRef } from "react";
4
4
  import { cn } from "../../lib/utils.js";
5
5
  import { Button } from "../button/button.js";
6
+ function DialogCloseButton({
7
+ closeIcon,
8
+ onClose
9
+ }) {
10
+ return /* @__PURE__ */ jsx(
11
+ "button",
12
+ {
13
+ "aria-label": "Close",
14
+ className: "absolute right-4 top-4 rounded-sm opacity-70 hover:opacity-100 transition-opacity",
15
+ onClick: onClose,
16
+ type: "button",
17
+ children: closeIcon ?? /* @__PURE__ */ jsx(
18
+ "svg",
19
+ {
20
+ className: "size-4",
21
+ fill: "none",
22
+ stroke: "currentColor",
23
+ viewBox: "0 0 24 24",
24
+ children: /* @__PURE__ */ jsx(
25
+ "path",
26
+ {
27
+ d: "M6 18L18 6M6 6l12 12",
28
+ strokeLinecap: "round",
29
+ strokeLinejoin: "round",
30
+ strokeWidth: 2
31
+ }
32
+ )
33
+ }
34
+ )
35
+ }
36
+ );
37
+ }
6
38
  function DialogContent({
7
39
  as: Heading = "h2",
8
40
  cancelLabel = "Skip",
@@ -30,33 +62,7 @@ function DialogContent({
30
62
  className
31
63
  ),
32
64
  children: [
33
- /* @__PURE__ */ jsx(
34
- "button",
35
- {
36
- "aria-label": "Close",
37
- className: "absolute right-4 top-4 rounded-sm opacity-70 hover:opacity-100 transition-opacity",
38
- onClick: onClose,
39
- type: "button",
40
- children: closeIcon ?? /* @__PURE__ */ jsx(
41
- "svg",
42
- {
43
- className: "size-4",
44
- fill: "none",
45
- stroke: "currentColor",
46
- viewBox: "0 0 24 24",
47
- children: /* @__PURE__ */ jsx(
48
- "path",
49
- {
50
- d: "M6 18L18 6M6 6l12 12",
51
- strokeLinecap: "round",
52
- strokeLinejoin: "round",
53
- strokeWidth: 2
54
- }
55
- )
56
- }
57
- )
58
- }
59
- ),
65
+ /* @__PURE__ */ jsx(DialogCloseButton, { closeIcon, onClose }),
60
66
  /* @__PURE__ */ jsxs("div", { className: "mb-4", children: [
61
67
  /* @__PURE__ */ jsx(Heading, { className: "text-lg font-semibold", id: "completion-dialog-title", children: title }),
62
68
  description ? /* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground mt-1.5", children: description }) : null
@@ -83,20 +89,13 @@ function DialogContent({
83
89
  }
84
90
  );
85
91
  }
86
- function CompletionDialogImpl({
87
- as,
88
- cancelLabel,
89
- cancelShortcut = "S",
90
- className,
91
- closeIcon,
92
- confirmLabel,
93
- confirmShortcut = "D",
94
- description,
92
+ function useCompletionDialogKeyboard({
93
+ cancelShortcut,
94
+ confirmShortcut,
95
95
  isOpen,
96
96
  onCancel,
97
97
  onClose,
98
- onConfirm,
99
- title
98
+ onConfirm
100
99
  }) {
101
100
  const keyDownHandlerRef = useRef(() => {
102
101
  return;
@@ -133,6 +132,30 @@ function CompletionDialogImpl({
133
132
  document.removeEventListener("keydown", onDocumentKeyDown, true);
134
133
  };
135
134
  }, [isOpen]);
135
+ }
136
+ function CompletionDialogImpl({
137
+ as,
138
+ cancelLabel,
139
+ cancelShortcut = "S",
140
+ className,
141
+ closeIcon,
142
+ confirmLabel,
143
+ confirmShortcut = "D",
144
+ description,
145
+ isOpen,
146
+ onCancel,
147
+ onClose,
148
+ onConfirm,
149
+ title
150
+ }) {
151
+ useCompletionDialogKeyboard({
152
+ cancelShortcut,
153
+ confirmShortcut,
154
+ isOpen,
155
+ onCancel,
156
+ onClose,
157
+ onConfirm
158
+ });
136
159
  if (!isOpen) return null;
137
160
  return /* @__PURE__ */ jsxs(
138
161
  "div",
@@ -12,22 +12,115 @@ const EMPTY_CONTENT_INTRO_LABELS = {};
12
12
  function ContentIntroBody({ source }) {
13
13
  return source();
14
14
  }
15
- function ContentIntroImpl({
16
- additionalContent,
15
+ function ContentIntroToc({
17
16
  completedSections,
18
- estimatedTime,
19
- isLoading = false,
20
- labels = EMPTY_CONTENT_INTRO_LABELS,
17
+ isLoading,
18
+ label,
21
19
  onGoToSection,
22
- onStart,
23
- renderIntroContent,
24
20
  sections,
25
- title,
26
- titleAs: TitleHeading = "h2",
27
- tocLabelAs: TocHeading = "h3"
21
+ TocHeading
28
22
  }) {
29
- const mergedLabels = { ...DEFAULT_LABELS, ...labels };
30
- const hasProgress = completedSections.size > 0;
23
+ return /* @__PURE__ */ jsxs("section", { className: "mt-8 py-6 border-t border-border", children: [
24
+ /* @__PURE__ */ jsx(TocHeading, { className: "text-lg font-semibold mb-4", children: label }),
25
+ /* @__PURE__ */ jsx("ol", { className: "space-y-2", children: sections.map((section, index) => {
26
+ const isCompleted = !isLoading && completedSections.has(section.id);
27
+ return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(
28
+ "button",
29
+ {
30
+ className: "w-full flex items-center gap-3 p-2 -m-2 rounded-lg hover:bg-muted/50 transition-colors text-left",
31
+ onClick: () => {
32
+ onGoToSection(index);
33
+ },
34
+ type: "button",
35
+ children: [
36
+ /* @__PURE__ */ jsx(
37
+ "span",
38
+ {
39
+ className: cn(
40
+ "flex-shrink-0 size-6 rounded-full flex items-center justify-center text-xs font-medium tabular-nums transition-colors",
41
+ isLoading && "animate-pulse bg-muted",
42
+ !isLoading && isCompleted && "bg-foreground text-background",
43
+ !isLoading && !isCompleted && "bg-muted"
44
+ ),
45
+ children: isCompleted ? /* @__PURE__ */ jsx(
46
+ "svg",
47
+ {
48
+ className: "size-3",
49
+ fill: "none",
50
+ stroke: "currentColor",
51
+ viewBox: "0 0 24 24",
52
+ children: /* @__PURE__ */ jsx(
53
+ "path",
54
+ {
55
+ d: "M5 13l4 4L19 7",
56
+ strokeLinecap: "round",
57
+ strokeLinejoin: "round",
58
+ strokeWidth: 2
59
+ }
60
+ )
61
+ }
62
+ ) : index + 1
63
+ }
64
+ ),
65
+ /* @__PURE__ */ jsx(
66
+ "span",
67
+ {
68
+ className: cn(
69
+ "text-sm",
70
+ isCompleted && "line-through text-muted-foreground"
71
+ ),
72
+ children: section.title
73
+ }
74
+ )
75
+ ]
76
+ }
77
+ ) }, section.id);
78
+ }) })
79
+ ] });
80
+ }
81
+ function ContentIntroStickyBar({
82
+ completedCount,
83
+ estimatedTime,
84
+ hasProgress,
85
+ labels: mergedLabels,
86
+ onStart,
87
+ sectionCount
88
+ }) {
89
+ return /* @__PURE__ */ jsx("div", { className: "fixed bottom-0 left-0 right-0 z-50 border-t border-border bg-background/80 backdrop-blur-sm safe-bottom", children: /* @__PURE__ */ jsx("div", { className: "mx-auto max-w-3xl p-4", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-4", children: [
90
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground hidden sm:block", children: hasProgress ? `${completedCount}/${sectionCount} completed` : `${sectionCount} sections \xB7 ${estimatedTime}` }),
91
+ /* @__PURE__ */ jsxs(
92
+ Button,
93
+ {
94
+ className: "flex-1 sm:flex-none px-8 py-6 text-lg font-medium gap-2",
95
+ onClick: onStart,
96
+ size: "lg",
97
+ children: [
98
+ /* @__PURE__ */ jsx(
99
+ "svg",
100
+ {
101
+ className: "size-5",
102
+ fill: "none",
103
+ stroke: "currentColor",
104
+ viewBox: "0 0 24 24",
105
+ children: /* @__PURE__ */ jsx(
106
+ "path",
107
+ {
108
+ d: "M5 3l14 9-14 9V3z",
109
+ strokeLinecap: "round",
110
+ strokeLinejoin: "round",
111
+ strokeWidth: 2
112
+ }
113
+ )
114
+ }
115
+ ),
116
+ /* @__PURE__ */ jsx("span", { children: hasProgress ? mergedLabels.continueLabel : mergedLabels.startLabel }),
117
+ /* @__PURE__ */ jsx("kbd", { className: "hidden md:inline-flex ml-1 px-1.5 py-0.5 text-xs font-mono bg-primary-foreground/20 rounded", children: "\u21B5" })
118
+ ]
119
+ }
120
+ )
121
+ ] }) }) });
122
+ }
123
+ function useEnterToStart(onStart) {
31
124
  const onStartRef = useRef(onStart);
32
125
  useEffect(() => {
33
126
  onStartRef.current = onStart;
@@ -44,104 +137,54 @@ function ContentIntroImpl({
44
137
  document.removeEventListener("keydown", onDocumentKeyDown);
45
138
  };
46
139
  }, []);
140
+ }
141
+ function ContentIntroImpl({
142
+ additionalContent,
143
+ completedSections,
144
+ estimatedTime,
145
+ isLoading = false,
146
+ labels = EMPTY_CONTENT_INTRO_LABELS,
147
+ onGoToSection,
148
+ onStart,
149
+ renderIntroContent,
150
+ sections,
151
+ title,
152
+ titleAs: TitleHeading = "h2",
153
+ tocLabelAs: TocHeading = "h3"
154
+ }) {
155
+ const mergedLabels = { ...DEFAULT_LABELS, ...labels };
156
+ const hasProgress = completedSections.size > 0;
157
+ useEnterToStart(onStart);
47
158
  return /* @__PURE__ */ jsxs(Fragment, { children: [
48
159
  /* @__PURE__ */ jsxs("div", { className: "animate-in fade-in-0 duration-500 pb-24", children: [
49
160
  /* @__PURE__ */ jsxs("section", { className: "py-6", children: [
50
161
  /* @__PURE__ */ jsx(TitleHeading, { className: "text-2xl md:text-3xl font-semibold mb-6", children: title }),
51
162
  /* @__PURE__ */ jsx("div", { className: cn("max-w-none", "[&_h2:first-of-type]:hidden"), children: /* @__PURE__ */ jsx(ContentIntroBody, { source: renderIntroContent }) })
52
163
  ] }),
53
- /* @__PURE__ */ jsxs("section", { className: "mt-8 py-6 border-t border-border", children: [
54
- /* @__PURE__ */ jsx(TocHeading, { className: "text-lg font-semibold mb-4", children: mergedLabels.tableOfContentsLabel }),
55
- /* @__PURE__ */ jsx("ol", { className: "space-y-2", children: sections.map((section, index) => {
56
- const isCompleted = !isLoading && completedSections.has(section.id);
57
- return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(
58
- "button",
59
- {
60
- className: "w-full flex items-center gap-3 p-2 -m-2 rounded-lg hover:bg-muted/50 transition-colors text-left",
61
- onClick: () => {
62
- onGoToSection(index);
63
- },
64
- type: "button",
65
- children: [
66
- /* @__PURE__ */ jsx(
67
- "span",
68
- {
69
- className: cn(
70
- "flex-shrink-0 size-6 rounded-full flex items-center justify-center text-xs font-medium tabular-nums transition-colors",
71
- isLoading && "animate-pulse bg-muted",
72
- !isLoading && isCompleted && "bg-foreground text-background",
73
- !isLoading && !isCompleted && "bg-muted"
74
- ),
75
- children: isCompleted ? /* @__PURE__ */ jsx(
76
- "svg",
77
- {
78
- className: "size-3",
79
- fill: "none",
80
- stroke: "currentColor",
81
- viewBox: "0 0 24 24",
82
- children: /* @__PURE__ */ jsx(
83
- "path",
84
- {
85
- d: "M5 13l4 4L19 7",
86
- strokeLinecap: "round",
87
- strokeLinejoin: "round",
88
- strokeWidth: 2
89
- }
90
- )
91
- }
92
- ) : index + 1
93
- }
94
- ),
95
- /* @__PURE__ */ jsx(
96
- "span",
97
- {
98
- className: cn(
99
- "text-sm",
100
- isCompleted && "line-through text-muted-foreground"
101
- ),
102
- children: section.title
103
- }
104
- )
105
- ]
106
- }
107
- ) }, section.id);
108
- }) })
109
- ] }),
110
- additionalContent
111
- ] }),
112
- /* @__PURE__ */ jsx("div", { className: "fixed bottom-0 left-0 right-0 z-50 border-t border-border bg-background/80 backdrop-blur-sm safe-bottom", children: /* @__PURE__ */ jsx("div", { className: "mx-auto max-w-3xl p-4", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-4", children: [
113
- /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground hidden sm:block", children: hasProgress ? `${completedSections.size}/${sections.length} completed` : `${sections.length} sections \xB7 ${estimatedTime}` }),
114
- /* @__PURE__ */ jsxs(
115
- Button,
164
+ /* @__PURE__ */ jsx(
165
+ ContentIntroToc,
116
166
  {
117
- className: "flex-1 sm:flex-none px-8 py-6 text-lg font-medium gap-2",
118
- onClick: onStart,
119
- size: "lg",
120
- children: [
121
- /* @__PURE__ */ jsx(
122
- "svg",
123
- {
124
- className: "size-5",
125
- fill: "none",
126
- stroke: "currentColor",
127
- viewBox: "0 0 24 24",
128
- children: /* @__PURE__ */ jsx(
129
- "path",
130
- {
131
- d: "M5 3l14 9-14 9V3z",
132
- strokeLinecap: "round",
133
- strokeLinejoin: "round",
134
- strokeWidth: 2
135
- }
136
- )
137
- }
138
- ),
139
- /* @__PURE__ */ jsx("span", { children: hasProgress ? mergedLabels.continueLabel : mergedLabels.startLabel }),
140
- /* @__PURE__ */ jsx("kbd", { className: "hidden md:inline-flex ml-1 px-1.5 py-0.5 text-xs font-mono bg-primary-foreground/20 rounded", children: "\u21B5" })
141
- ]
167
+ completedSections,
168
+ isLoading,
169
+ label: mergedLabels.tableOfContentsLabel,
170
+ onGoToSection,
171
+ sections,
172
+ TocHeading
142
173
  }
143
- )
144
- ] }) }) })
174
+ ),
175
+ additionalContent
176
+ ] }),
177
+ /* @__PURE__ */ jsx(
178
+ ContentIntroStickyBar,
179
+ {
180
+ completedCount: completedSections.size,
181
+ estimatedTime,
182
+ hasProgress,
183
+ labels: mergedLabels,
184
+ onStart,
185
+ sectionCount: sections.length
186
+ }
187
+ )
145
188
  ] });
146
189
  }
147
190
  const ContentIntro = memo(ContentIntroImpl);
@@ -4,8 +4,8 @@ import * as React from "react";
4
4
  import { CalendarIcon } from "lucide-react";
5
5
  import { cn } from "../../lib/utils.js";
6
6
  import { Button } from "../button/button.js";
7
- import { Calendar } from "../calendar/index.js";
8
- import { Popover, PopoverContent, PopoverTrigger } from "../popover/index.js";
7
+ import { Calendar } from "../calendar/calendar.js";
8
+ import { Popover, PopoverContent, PopoverTrigger } from "../popover/popover.js";
9
9
  const rangeFormatter = new Intl.DateTimeFormat("en-US", {
10
10
  day: "numeric",
11
11
  month: "short",
@@ -150,18 +150,11 @@ const DEFAULT_LABELS = {
150
150
  tagsLabel: "Tags:"
151
151
  };
152
152
  const EMPTY_FILTER_BAR_LABELS = {};
153
- function FilterBarImpl({
154
- className,
155
- currentDifficulty,
153
+ function useFilterBarHandlers({
156
154
  currentTags,
157
- difficultyOptions,
158
- labels = EMPTY_FILTER_BAR_LABELS,
159
155
  onFiltersChange,
160
- searchQuery,
161
- tags
156
+ startTransition
162
157
  }) {
163
- const [isPending, startTransition] = useTransition();
164
- const mergedLabels = { ...DEFAULT_LABELS, ...labels };
165
158
  const handleDifficultyChange = useCallback(
166
159
  (difficulty) => {
167
160
  startTransition(() => {
@@ -188,6 +181,31 @@ function FilterBarImpl({
188
181
  const input = document.querySelector("#filter-search");
189
182
  if (input) input.value = "";
190
183
  }, [onFiltersChange]);
184
+ return {
185
+ handleClearAll,
186
+ handleDifficultyChange,
187
+ handleSearchChange,
188
+ handleTagToggle
189
+ };
190
+ }
191
+ function FilterBarImpl({
192
+ className,
193
+ currentDifficulty,
194
+ currentTags,
195
+ difficultyOptions,
196
+ labels = EMPTY_FILTER_BAR_LABELS,
197
+ onFiltersChange,
198
+ searchQuery,
199
+ tags
200
+ }) {
201
+ const [isPending, startTransition] = useTransition();
202
+ const mergedLabels = { ...DEFAULT_LABELS, ...labels };
203
+ const {
204
+ handleClearAll,
205
+ handleDifficultyChange,
206
+ handleSearchChange,
207
+ handleTagToggle
208
+ } = useFilterBarHandlers({ currentTags, onFiltersChange, startTransition });
191
209
  const activeDifficulty = currentDifficulty || "all";
192
210
  return /* @__PURE__ */ jsxs("div", { className: cn("space-y-4 mb-8", className), children: [
193
211
  /* @__PURE__ */ jsx(