@vllnt/ui 0.2.1-canary.0aaaad2 → 0.2.1-canary.1180f3e

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 (117) hide show
  1. package/CHANGELOG.md +3 -0
  2. package/dist/components/activity-heatmap/activity-heatmap.js +2 -1
  3. package/dist/components/activity-log/activity-log.js +1 -1
  4. package/dist/components/ai-artifact/ai-artifact.js +8 -8
  5. package/dist/components/ai-chat-input/ai-chat-input.js +1 -1
  6. package/dist/components/ai-message-bubble/ai-message-bubble.js +1 -1
  7. package/dist/components/ai-sidebar/ai-sidebar.js +4 -4
  8. package/dist/components/ai-tool-call-display/ai-tool-call-display.js +1 -1
  9. package/dist/components/animated-text/animated-text.js +6 -3
  10. package/dist/components/annotation/annotation.js +1 -1
  11. package/dist/components/auto-reload/auto-reload.js +1 -1
  12. package/dist/components/avatar-group/avatar-group.js +1 -1
  13. package/dist/components/blog-card/blog-card.js +4 -2
  14. package/dist/components/bottom-activity-strip/bottom-activity-strip.js +2 -2
  15. package/dist/components/candlestick-chart/candlestick-chart.js +2 -1
  16. package/dist/components/canvas-shell/canvas-foundation-demo.js +1 -1
  17. package/dist/components/carousel/carousel.js +14 -6
  18. package/dist/components/category-filter/category-filter.js +1 -1
  19. package/dist/components/chat-dock-section/chat-dock-section.js +1 -1
  20. package/dist/components/checklist/checklist.js +35 -7
  21. package/dist/components/checklist/index.js +8 -2
  22. package/dist/components/chronological-timeline/chronological-timeline.js +2 -2
  23. package/dist/components/code-block/code-block.js +1 -0
  24. package/dist/components/code-playground/code-playground.js +4 -2
  25. package/dist/components/combobox/combobox.js +1 -6
  26. package/dist/components/comment-pin/comment-pin.js +2 -2
  27. package/dist/components/comparison/comparison.js +2 -1
  28. package/dist/components/completion-dialog/completion-dialog.js +19 -11
  29. package/dist/components/connector-edge/connector-edge.js +1 -1
  30. package/dist/components/content-intro/content-intro.js +18 -15
  31. package/dist/components/conversation-thread/conversation-thread.js +4 -4
  32. package/dist/components/countdown-timer/countdown-timer.js +1 -1
  33. package/dist/components/data-table/data-table.js +1 -1
  34. package/dist/components/date-picker/date-picker.js +1 -6
  35. package/dist/components/exercise/exercise.js +11 -3
  36. package/dist/components/faq/faq.js +6 -2
  37. package/dist/components/file-upload/file-upload.js +1 -6
  38. package/dist/components/filter-bar/filter-bar.js +7 -7
  39. package/dist/components/flashcard/flashcard.js +1 -1
  40. package/dist/components/floating-toolbar/floating-toolbar.js +2 -2
  41. package/dist/components/form/form.js +1 -1
  42. package/dist/components/gantt-chart/gantt-chart.js +8 -7
  43. package/dist/components/globe-3d/globe-3d.js +16 -4
  44. package/dist/components/horizontal-scroll-row/horizontal-scroll-row.js +2 -1
  45. package/dist/components/index.js +2 -0
  46. package/dist/components/inline-input/inline-input.js +1 -1
  47. package/dist/components/interactive-timeline/interactive-timeline.js +8 -5
  48. package/dist/components/jarvis-dock/jarvis-dock.js +2 -2
  49. package/dist/components/key-concept/key-concept.js +2 -1
  50. package/dist/components/keyboard-shortcuts-help/keyboard-shortcuts-help.js +2 -1
  51. package/dist/components/knowledge-check/knowledge-check.js +2 -2
  52. package/dist/components/lang-provider/lang-provider.js +3 -3
  53. package/dist/components/learning-objectives/learning-objectives.js +2 -1
  54. package/dist/components/live-feed/live-feed.js +2 -2
  55. package/dist/components/map-2d/map-2d.js +1 -1
  56. package/dist/components/map-timeline/map-timeline.js +5 -5
  57. package/dist/components/market-treemap/market-treemap.js +2 -2
  58. package/dist/components/mdx-content/mdx-content.js +19 -9
  59. package/dist/components/metric-gauge/metric-gauge.js +1 -1
  60. package/dist/components/model-selector/model-selector.js +1 -1
  61. package/dist/components/multi-select/multi-select.js +1 -1
  62. package/dist/components/navbar-saas/navbar-saas.js +6 -6
  63. package/dist/components/number-input/number-input.js +1 -1
  64. package/dist/components/number-ticker/number-ticker.js +1 -1
  65. package/dist/components/object-card/object-card.js +1 -1
  66. package/dist/components/order-book/order-book.js +2 -2
  67. package/dist/components/overview-board/overview-board.js +1 -1
  68. package/dist/components/policy-delivery-panel/policy-delivery-panel.js +2 -2
  69. package/dist/components/profile-section/profile-section.js +2 -1
  70. package/dist/components/progress-card/progress-card.js +1 -1
  71. package/dist/components/progress-tracker/progress-tracker.js +17 -9
  72. package/dist/components/prompt-templates/prompt-templates.js +2 -2
  73. package/dist/components/quiz/quiz.js +3 -2
  74. package/dist/components/relationship-inspector/relationship-inspector.js +2 -2
  75. package/dist/components/routing-assignment-panel/routing-assignment-panel.js +2 -2
  76. package/dist/components/run-timeline/run-timeline.js +2 -2
  77. package/dist/components/scope-selector/scope-selector.js +1 -1
  78. package/dist/components/search-dialog/search-dialog.js +484 -51
  79. package/dist/components/share-dialog/share-dialog.js +2 -2
  80. package/dist/components/share-section/share-section.js +2 -1
  81. package/dist/components/sidebar/sidebar.js +30 -25
  82. package/dist/components/sidebar-toggle/sidebar-toggle.js +3 -1
  83. package/dist/components/slideshow/slideshow.js +3 -2
  84. package/dist/components/social-fab/social-fab.js +10 -10
  85. package/dist/components/spinner/spinner.js +1 -1
  86. package/dist/components/spinner/unicode-spinner.js +4 -2
  87. package/dist/components/stat-card/stat-card.js +2 -2
  88. package/dist/components/static-code/index.js +4 -0
  89. package/dist/components/static-code/static-code-copy.js +29 -0
  90. package/dist/components/static-code/static-code.js +41 -0
  91. package/dist/components/status-board/status-board.js +13 -6
  92. package/dist/components/step-by-step/step-by-step.js +2 -1
  93. package/dist/components/table-of-contents/table-of-contents.js +5 -2
  94. package/dist/components/table-of-contents-panel/table-of-contents-panel.js +3 -1
  95. package/dist/components/tabs/tabs.js +26 -8
  96. package/dist/components/tags-input/tags-input.js +11 -3
  97. package/dist/components/terminal/terminal.js +13 -3
  98. package/dist/components/theme-toggle/theme-toggle.js +2 -2
  99. package/dist/components/thinking-block/thinking-block.js +2 -2
  100. package/dist/components/ticker-tape/ticker-tape.js +1 -1
  101. package/dist/components/timeline-scrubber/timeline-scrubber.js +2 -2
  102. package/dist/components/tldr-section/tldr-section.js +9 -7
  103. package/dist/components/tour/tour.js +1 -1
  104. package/dist/components/transaction-list/transaction-list.js +2 -2
  105. package/dist/components/tutorial-card/tutorial-card.js +1 -1
  106. package/dist/components/tutorial-complete/tutorial-complete.js +8 -6
  107. package/dist/components/tutorial-filters/tutorial-filters.js +2 -2
  108. package/dist/components/tutorial-intro-content/tutorial-intro-content.js +5 -5
  109. package/dist/components/tutorial-mdx/tutorial-mdx.js +6 -6
  110. package/dist/components/usage-breakdown/usage-breakdown.js +1 -1
  111. package/dist/components/viewport-bookmarks/viewport-bookmarks.js +2 -2
  112. package/dist/components/watchlist/watchlist.js +2 -1
  113. package/dist/components/world-breadcrumbs/world-breadcrumbs.js +2 -2
  114. package/dist/components/world-clock-bar/world-clock-bar.js +5 -4
  115. package/dist/components/zoom-hud/zoom-hud.js +1 -1
  116. package/dist/index.d.ts +126 -29
  117. package/package.json +3 -3
@@ -1,9 +1,10 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
- import { memo, useCallback, useEffect, useRef } from "react";
3
+ import { memo, useEffect, useRef } from "react";
4
4
  import { cn } from "../../lib/utils";
5
- import { Button } from "../button";
5
+ import { Button } from "../button/button";
6
6
  function DialogContent({
7
+ as: Heading = "h2",
7
8
  cancelLabel = "Skip",
8
9
  cancelShortcut = "S",
9
10
  className,
@@ -57,7 +58,7 @@ function DialogContent({
57
58
  }
58
59
  ),
59
60
  /* @__PURE__ */ jsxs("div", { className: "mb-4", children: [
60
- /* @__PURE__ */ jsx("h2", { className: "text-lg font-semibold", id: "completion-dialog-title", children: title }),
61
+ /* @__PURE__ */ jsx(Heading, { className: "text-lg font-semibold", id: "completion-dialog-title", children: title }),
61
62
  description ? /* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground mt-1.5", children: description }) : null
62
63
  ] }),
63
64
  /* @__PURE__ */ jsxs("div", { className: "flex flex-row gap-2", children: [
@@ -83,6 +84,7 @@ function DialogContent({
83
84
  );
84
85
  }
85
86
  function CompletionDialogImpl({
87
+ as,
86
88
  cancelLabel,
87
89
  cancelShortcut = "S",
88
90
  className,
@@ -96,8 +98,11 @@ function CompletionDialogImpl({
96
98
  onConfirm,
97
99
  title
98
100
  }) {
99
- const handleKeyDown = useCallback(
100
- (event) => {
101
+ const keyDownHandlerRef = useRef(() => {
102
+ return;
103
+ });
104
+ useEffect(() => {
105
+ keyDownHandlerRef.current = (event) => {
101
106
  if (!isOpen) return;
102
107
  if (event.key === "Escape") {
103
108
  event.preventDefault();
@@ -116,16 +121,18 @@ function CompletionDialogImpl({
116
121
  event.stopPropagation();
117
122
  onCancel();
118
123
  }
119
- },
120
- [isOpen, onClose, onConfirm, onCancel, confirmShortcut, cancelShortcut]
121
- );
124
+ };
125
+ }, [cancelShortcut, confirmShortcut, isOpen, onCancel, onClose, onConfirm]);
122
126
  useEffect(() => {
123
127
  if (!isOpen) return;
124
- document.addEventListener("keydown", handleKeyDown, true);
128
+ const onDocumentKeyDown = (event) => {
129
+ keyDownHandlerRef.current(event);
130
+ };
131
+ document.addEventListener("keydown", onDocumentKeyDown, true);
125
132
  return () => {
126
- document.removeEventListener("keydown", handleKeyDown, true);
133
+ document.removeEventListener("keydown", onDocumentKeyDown, true);
127
134
  };
128
- }, [isOpen, handleKeyDown]);
135
+ }, [isOpen]);
129
136
  if (!isOpen) return null;
130
137
  return /* @__PURE__ */ jsxs(
131
138
  "div",
@@ -149,6 +156,7 @@ function CompletionDialogImpl({
149
156
  /* @__PURE__ */ jsx(
150
157
  DialogContent,
151
158
  {
159
+ as,
152
160
  cancelLabel,
153
161
  cancelShortcut,
154
162
  className,
@@ -1,7 +1,7 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
3
  import { cn } from "../../lib/utils";
4
- import { EdgeLabel } from "../edge-label";
4
+ import { EdgeLabel } from "../edge-label/edge-label";
5
5
  const strokeClasses = {
6
6
  active: "stroke-sky-500",
7
7
  blocked: "stroke-amber-500",
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
- import { memo, useCallback, useEffect } from "react";
3
+ import { memo, useEffect, useRef } from "react";
4
4
  import { cn } from "../../lib/utils";
5
- import { Button } from "../button";
5
+ import { Button } from "../button/button";
6
6
  const DEFAULT_LABELS = {
7
7
  continueLabel: "Continue Tutorial",
8
8
  startLabel: "Start Tutorial",
@@ -19,33 +19,36 @@ function ContentIntroImpl({
19
19
  onStart,
20
20
  renderIntroContent,
21
21
  sections,
22
- title
22
+ title,
23
+ titleAs: TitleHeading = "h2",
24
+ tocLabelAs: TocHeading = "h3"
23
25
  }) {
24
26
  const mergedLabels = { ...DEFAULT_LABELS, ...labels };
25
27
  const hasProgress = completedSections.size > 0;
26
- const handleKeyDown = useCallback(
27
- (event) => {
28
+ const onStartRef = useRef(onStart);
29
+ useEffect(() => {
30
+ onStartRef.current = onStart;
31
+ }, [onStart]);
32
+ useEffect(() => {
33
+ const onDocumentKeyDown = (event) => {
28
34
  if (event.key === "Enter") {
29
35
  event.preventDefault();
30
- onStart();
36
+ onStartRef.current();
31
37
  }
32
- },
33
- [onStart]
34
- );
35
- useEffect(() => {
36
- document.addEventListener("keydown", handleKeyDown);
38
+ };
39
+ document.addEventListener("keydown", onDocumentKeyDown);
37
40
  return () => {
38
- document.removeEventListener("keydown", handleKeyDown);
41
+ document.removeEventListener("keydown", onDocumentKeyDown);
39
42
  };
40
- }, [handleKeyDown]);
43
+ }, []);
41
44
  return /* @__PURE__ */ jsxs(Fragment, { children: [
42
45
  /* @__PURE__ */ jsxs("div", { className: "animate-in fade-in-0 duration-500 pb-24", children: [
43
46
  /* @__PURE__ */ jsxs("section", { className: "py-6", children: [
44
- /* @__PURE__ */ jsx("h2", { className: "text-2xl md:text-3xl font-bold mb-6", children: title }),
47
+ /* @__PURE__ */ jsx(TitleHeading, { className: "text-2xl md:text-3xl font-semibold mb-6", children: title }),
45
48
  /* @__PURE__ */ jsx("div", { className: cn("max-w-none", "[&_h2:first-of-type]:hidden"), children: renderIntroContent() })
46
49
  ] }),
47
50
  /* @__PURE__ */ jsxs("section", { className: "mt-8 py-6 border-t border-border", children: [
48
- /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold mb-4", children: mergedLabels.tableOfContentsLabel }),
51
+ /* @__PURE__ */ jsx(TocHeading, { className: "text-lg font-semibold mb-4", children: mergedLabels.tableOfContentsLabel }),
49
52
  /* @__PURE__ */ jsx("ol", { className: "space-y-2", children: sections.map((section, index) => {
50
53
  const isCompleted = !isLoading && completedSections.has(section.id);
51
54
  return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(
@@ -12,7 +12,7 @@ import {
12
12
  } from "react";
13
13
  import { ArrowDown, RefreshCw, ThumbsDown, ThumbsUp } from "lucide-react";
14
14
  import { cn } from "../../lib/utils";
15
- import { ThinkingBlock } from "../thinking-block";
15
+ import { ThinkingBlock } from "../thinking-block/thinking-block";
16
16
  const ConversationThreadContext = createContext(null);
17
17
  function useConversationThreadContext() {
18
18
  const ctx = useContext(ConversationThreadContext);
@@ -319,18 +319,18 @@ const ConversationLoading = forwardRef(({ className }, reference) => {
319
319
  /* @__PURE__ */ jsx(
320
320
  "span",
321
321
  {
322
- className: "size-2 animate-bounce rounded-full bg-muted-foreground",
322
+ className: "size-2 animate-pulse rounded-full bg-muted-foreground",
323
323
  style: { animationDelay: "-0.3s" }
324
324
  }
325
325
  ),
326
326
  /* @__PURE__ */ jsx(
327
327
  "span",
328
328
  {
329
- className: "size-2 animate-bounce rounded-full bg-muted-foreground",
329
+ className: "size-2 animate-pulse rounded-full bg-muted-foreground",
330
330
  style: { animationDelay: "-0.15s" }
331
331
  }
332
332
  ),
333
- /* @__PURE__ */ jsx("span", { className: "size-2 animate-bounce rounded-full bg-muted-foreground" })
333
+ /* @__PURE__ */ jsx("span", { className: "size-2 animate-pulse rounded-full bg-muted-foreground" })
334
334
  ]
335
335
  }
336
336
  );
@@ -2,7 +2,7 @@
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import * as React from "react";
4
4
  import { cn } from "../../lib/utils";
5
- import { Badge } from "../badge";
5
+ import { Badge } from "../badge/badge";
6
6
  import {
7
7
  Card,
8
8
  CardContent,
@@ -11,7 +11,7 @@ import {
11
11
  } from "@tanstack/react-table";
12
12
  import { ArrowDown, ArrowUp, ArrowUpDown } from "lucide-react";
13
13
  import { cn } from "../../lib/utils";
14
- import { Button } from "../button";
14
+ import { Button } from "../button/button";
15
15
  import { Checkbox } from "../checkbox";
16
16
  import { Input } from "../input";
17
17
  import {
@@ -3,7 +3,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import * as React from "react";
4
4
  import { CalendarIcon } from "lucide-react";
5
5
  import { cn } from "../../lib/utils";
6
- import { Button } from "../button";
6
+ import { Button } from "../button/button";
7
7
  import { Calendar } from "../calendar";
8
8
  import { Popover, PopoverContent, PopoverTrigger } from "../popover";
9
9
  const defaultDateFormatter = new Intl.DateTimeFormat("en-US", {
@@ -25,11 +25,6 @@ const DatePicker = React.forwardRef(
25
25
  value
26
26
  );
27
27
  const selectedDate = value ?? internalValue;
28
- React.useEffect(() => {
29
- if (value !== void 0) {
30
- setInternalValue(value);
31
- }
32
- }, [value]);
33
28
  const handleSelect = (nextDate) => {
34
29
  if (value === void 0) {
35
30
  setInternalValue(nextDate);
@@ -3,18 +3,24 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
3
  import { useState } from "react";
4
4
  import { Check, Dumbbell, Eye, EyeOff } from "lucide-react";
5
5
  import { cn } from "../../lib/utils";
6
- import { Button } from "../button";
6
+ import { Button } from "../button/button";
7
7
  const difficultyConfig = {
8
8
  easy: { className: "text-green-600 dark:text-green-400", label: "Easy" },
9
9
  hard: { className: "text-red-600 dark:text-red-400", label: "Hard" },
10
10
  medium: { className: "text-amber-600 dark:text-amber-400", label: "Medium" }
11
11
  };
12
- function ExerciseHeader({ completed, config, onToggle, title }) {
12
+ function ExerciseHeader({
13
+ completed,
14
+ config,
15
+ Heading,
16
+ onToggle,
17
+ title
18
+ }) {
13
19
  return /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-4 mb-4", children: [
14
20
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
15
21
  /* @__PURE__ */ jsx("div", { className: "flex size-10 items-center justify-center rounded-full bg-primary/10", children: /* @__PURE__ */ jsx(Dumbbell, { className: "size-5 text-primary" }) }),
16
22
  /* @__PURE__ */ jsxs("div", { children: [
17
- /* @__PURE__ */ jsx("h4", { className: "font-semibold text-foreground", children: title }),
23
+ /* @__PURE__ */ jsx(Heading, { className: "font-semibold text-foreground", children: title }),
18
24
  /* @__PURE__ */ jsx("span", { className: cn("text-xs font-medium", config.className), children: config.label })
19
25
  ] })
20
26
  ] }),
@@ -63,6 +69,7 @@ function ExerciseSolution({ onToggle, showSolution, solution }) {
63
69
  ] });
64
70
  }
65
71
  function Exercise({
72
+ as: Heading = "h4",
66
73
  children,
67
74
  difficulty = "medium",
68
75
  hint,
@@ -78,6 +85,7 @@ function Exercise({
78
85
  {
79
86
  completed,
80
87
  config: difficultyConfig[difficulty],
88
+ Heading,
81
89
  onToggle: () => {
82
90
  setCompleted(!completed);
83
91
  },
@@ -40,11 +40,15 @@ function FAQItem({ children, defaultOpen = false, question }) {
40
40
  )
41
41
  ] });
42
42
  }
43
- function FAQ({ children, title = "Frequently Asked Questions" }) {
43
+ function FAQ({
44
+ as: Heading = "h4",
45
+ children,
46
+ title = "Frequently Asked Questions"
47
+ }) {
44
48
  return /* @__PURE__ */ jsxs("div", { className: "my-6 rounded-lg border bg-card", children: [
45
49
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 p-4 border-b border-border", children: [
46
50
  /* @__PURE__ */ jsx(HelpCircle, { className: "size-5 text-primary" }),
47
- /* @__PURE__ */ jsx("h4", { className: "font-semibold", children: title })
51
+ /* @__PURE__ */ jsx(Heading, { className: "font-semibold", children: title })
48
52
  ] }),
49
53
  /* @__PURE__ */ jsx("div", { className: "px-4", children })
50
54
  ] });
@@ -3,16 +3,11 @@ import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import * as React from "react";
4
4
  import { FileUp, UploadCloud, X } from "lucide-react";
5
5
  import { cn } from "../../lib/utils";
6
- import { Button } from "../button";
6
+ import { Button } from "../button/button";
7
7
  function useFileUploadState(controlledFiles, multiple, onFilesChange) {
8
8
  const [internalFiles, setInternalFiles] = React.useState(
9
9
  controlledFiles ?? []
10
10
  );
11
- React.useEffect(() => {
12
- if (controlledFiles !== void 0) {
13
- setInternalFiles(controlledFiles);
14
- }
15
- }, [controlledFiles]);
16
11
  const resolvedFiles = controlledFiles ?? internalFiles;
17
12
  const updateFiles = React.useCallback(
18
13
  (nextFiles) => {
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
- import { memo, useCallback, useState } from "react";
3
+ import { memo, useCallback, useTransition } from "react";
4
4
  import { cn } from "../../lib/utils";
5
- import { Badge } from "../badge";
5
+ import { Badge } from "../badge/badge";
6
6
  function SearchInput({
7
7
  disabled,
8
8
  label,
@@ -160,15 +160,15 @@ function FilterBarImpl({
160
160
  searchQuery,
161
161
  tags
162
162
  }) {
163
- const [isPending, setIsPending] = useState(false);
163
+ const [isPending, startTransition] = useTransition();
164
164
  const mergedLabels = { ...DEFAULT_LABELS, ...labels };
165
165
  const handleDifficultyChange = useCallback(
166
166
  (difficulty) => {
167
- setIsPending(true);
168
- onFiltersChange({ difficulty });
169
- setIsPending(false);
167
+ startTransition(() => {
168
+ onFiltersChange({ difficulty });
169
+ });
170
170
  },
171
- [onFiltersChange]
171
+ [onFiltersChange, startTransition]
172
172
  );
173
173
  const handleSearchChange = useCallback(
174
174
  (search) => {
@@ -3,7 +3,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import { useState } from "react";
4
4
  import { RefreshCcw } from "lucide-react";
5
5
  import { cn } from "../../lib/utils";
6
- import { Badge } from "../badge";
6
+ import { Badge } from "../badge/badge";
7
7
  import { Button } from "../button";
8
8
  import { Card, CardContent, CardFooter, CardHeader, CardTitle } from "../card";
9
9
  function Flashcard({
@@ -31,7 +31,7 @@ const FloatingToolbar = forwardRef(
31
31
  ...rest,
32
32
  children: actions.map((action) => {
33
33
  const variant = action.variant ?? "ghost";
34
- const handleClick = () => {
34
+ const handleActivateToolbarAction = () => {
35
35
  action.onActivate();
36
36
  };
37
37
  return /* @__PURE__ */ jsxs(
@@ -46,7 +46,7 @@ const FloatingToolbar = forwardRef(
46
46
  "data-action-id": action.id,
47
47
  "data-variant": variant,
48
48
  disabled: action.disabled,
49
- onClick: handleClick,
49
+ onClick: handleActivateToolbarAction,
50
50
  type: "button",
51
51
  children: [
52
52
  action.glyph ? /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "inline-flex size-3", children: action.glyph }) : null,
@@ -10,7 +10,7 @@ import {
10
10
  useFormContext
11
11
  } from "react-hook-form";
12
12
  import { cn } from "../../lib/utils";
13
- import { Label } from "../label";
13
+ import { Label } from "../label/label";
14
14
  const FormRootContext = React.createContext(
15
15
  void 0
16
16
  );
@@ -56,7 +56,7 @@ function getTickDateTimeFormatter(locale, scale) {
56
56
  let formatter = TICK_FORMATTER_CACHE.get(key);
57
57
  if (!formatter) {
58
58
  const options = scale === "month" ? { month: "short", year: "numeric" } : { day: "2-digit", month: "short" };
59
- formatter = new Intl.DateTimeFormat(locale, options);
59
+ formatter = Intl.DateTimeFormat(locale, options);
60
60
  TICK_FORMATTER_CACHE.set(key, formatter);
61
61
  }
62
62
  return formatter;
@@ -93,13 +93,14 @@ function buildTicks(input) {
93
93
  const formatter = buildTickFormatter(scale, locale);
94
94
  const stepDays = getTickStep(scale);
95
95
  const tickCount = Math.floor(totalDays / stepDays);
96
- return Array.from({ length: tickCount + 1 }).map((_, index) => {
96
+ return Array.from({ length: tickCount + 1 }).reduce((ticks, _, index) => {
97
97
  const day = index * stepDays;
98
- return {
99
- date: new Date(start.getTime() + day * MS_PER_DAY),
100
- offset: day
101
- };
102
- }).filter((tick) => tick.date.getTime() <= end.getTime()).map((tick) => ({ label: formatter(tick.date), offset: tick.offset }));
98
+ const date = new Date(start.getTime() + day * MS_PER_DAY);
99
+ if (date.getTime() <= end.getTime()) {
100
+ ticks.push({ label: formatter(date), offset: day });
101
+ }
102
+ return ticks;
103
+ }, []);
103
104
  }
104
105
  function useChartGeometry(options) {
105
106
  const { endDate, locale, scale, startDate } = options;
@@ -161,9 +161,12 @@ const GlobeArc = forwardRef(
161
161
  GlobeArc.displayName = "GlobeArc";
162
162
  function buildLine(arguments_) {
163
163
  const { points, rotationLat, rotationLng } = arguments_;
164
- return points.map((coord) => project(coord, rotationLng, rotationLat)).reduce(
165
- (state, projected) => {
166
- if (!projected.visible) return { path: state.path, pen: "up" };
164
+ return points.reduce(
165
+ (state, coord) => {
166
+ const projected = project(coord, rotationLng, rotationLat);
167
+ if (!projected.visible) {
168
+ return { path: state.path, pen: "up" };
169
+ }
167
170
  const head = state.pen === "up" ? "M" : "L";
168
171
  const separator = state.path.length > 0 ? " " : "";
169
172
  return {
@@ -185,7 +188,16 @@ function Graticule({ rotationLat, rotationLng }) {
185
188
  const meridians = range(-150, 180, 30).map(
186
189
  (lng) => range(-85, 85, 5).map((lat) => ({ lat, lng }))
187
190
  );
188
- const lines = [...parallels, ...meridians].map((points) => buildLine({ points, rotationLat, rotationLng })).filter((path) => path.length > 0);
191
+ const lines = [...parallels, ...meridians].reduce(
192
+ (paths, points) => {
193
+ const path = buildLine({ points, rotationLat, rotationLng });
194
+ if (path.length > 0) {
195
+ paths.push(path);
196
+ }
197
+ return paths;
198
+ },
199
+ []
200
+ );
189
201
  return /* @__PURE__ */ jsx(
190
202
  "g",
191
203
  {
@@ -6,6 +6,7 @@ import { useHorizontalScroll } from "../../lib/use-horizontal-scroll";
6
6
  import { cn } from "../../lib/utils";
7
7
  import { Button } from "../button/button";
8
8
  const HorizontalScrollRow = memo(function HorizontalScrollRow2({
9
+ as: Heading = "h3",
9
10
  children,
10
11
  className,
11
12
  description,
@@ -16,7 +17,7 @@ const HorizontalScrollRow = memo(function HorizontalScrollRow2({
16
17
  return /* @__PURE__ */ jsxs("section", { className: cn("space-y-4", className), children: [
17
18
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
18
19
  /* @__PURE__ */ jsxs("div", { children: [
19
- /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold", children: title }),
20
+ /* @__PURE__ */ jsx(Heading, { className: "text-lg font-semibold", children: title }),
20
21
  description ? /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: description }) : null
21
22
  ] }),
22
23
  showControls ? /* @__PURE__ */ jsxs("div", { className: "flex gap-1", children: [
@@ -325,6 +325,7 @@ import {
325
325
  useAgentStepStatus
326
326
  } from "./agent-activity";
327
327
  import { StatCard, statCardVariants } from "./stat-card";
328
+ import { StaticCode } from "./static-code";
328
329
  import {
329
330
  dotVariants,
330
331
  StatusIndicator,
@@ -1263,6 +1264,7 @@ export {
1263
1264
  Spinner,
1264
1265
  StatCard,
1265
1266
  StateBadgeOverlay,
1267
+ StaticCode,
1266
1268
  StatusBoard,
1267
1269
  StatusIndicator,
1268
1270
  Step,
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  import { cn } from "../../lib/utils";
4
- import { Input } from "../input";
4
+ import { Input } from "../input/input";
5
5
  function InlineInput({
6
6
  className,
7
7
  onCancel,
@@ -219,7 +219,7 @@ function EventNode({
219
219
  if (!visible) return null;
220
220
  const titleText = typeof event.title === "string" ? event.title : "Event";
221
221
  const tooltipId = `${event.id}-tooltip`;
222
- const handleClick = (mouseEvent) => {
222
+ const handleSelectTimelineEvent = (mouseEvent) => {
223
223
  mouseEvent.stopPropagation();
224
224
  onSelect(event);
225
225
  };
@@ -236,7 +236,7 @@ function EventNode({
236
236
  "data-event-id": event.id,
237
237
  "data-event-track": event.track ?? "",
238
238
  "data-selected": active ? "true" : void 0,
239
- onClick: handleClick,
239
+ onClick: handleSelectTimelineEvent,
240
240
  style: {
241
241
  left: `${(left * 100).toString()}%`,
242
242
  width: isDuration ? `${(width * 100).toString()}%` : void 0
@@ -607,9 +607,12 @@ function useTimelineContextValue(arguments_) {
607
607
  function useTimelineFilter(categories, events) {
608
608
  const [hidden, setHidden] = useState(() => /* @__PURE__ */ new Set());
609
609
  const visibleCategories = useMemo(
610
- () => new Set(
611
- categories.filter((category) => !hidden.has(category.id)).map((category) => category.id)
612
- ),
610
+ () => categories.reduce((visible, category) => {
611
+ if (!hidden.has(category.id)) {
612
+ visible.add(category.id);
613
+ }
614
+ return visible;
615
+ }, /* @__PURE__ */ new Set()),
613
616
  [categories, hidden]
614
617
  );
615
618
  const toggleCategory = useCallback((id) => {
@@ -17,7 +17,7 @@ const DEFAULT_LABELS = {
17
17
  const ActionButton = (props) => {
18
18
  const { action } = props;
19
19
  const tone = action.tone ?? "neutral";
20
- const handleClick = () => {
20
+ const handleActivateAction = () => {
21
21
  action.onActivate();
22
22
  };
23
23
  return /* @__PURE__ */ jsxs(
@@ -26,7 +26,7 @@ const ActionButton = (props) => {
26
26
  className: "group relative flex size-12 flex-col items-center justify-center gap-0.5 rounded-md border border-transparent text-[10px] uppercase tracking-wide text-muted-foreground transition-colors hover:border-border hover:bg-muted/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
27
27
  "data-jarvis-action": action.id,
28
28
  "data-jarvis-tone": tone,
29
- onClick: handleClick,
29
+ onClick: handleActivateAction,
30
30
  type: "button",
31
31
  children: [
32
32
  /* @__PURE__ */ jsx(
@@ -43,13 +43,14 @@ function KeyConcept({
43
43
  );
44
44
  }
45
45
  function Glossary({
46
+ as: Heading = "h4",
46
47
  children,
47
48
  className,
48
49
  icon,
49
50
  title = "Key Terms"
50
51
  }) {
51
52
  return /* @__PURE__ */ jsxs("div", { className: cn("my-6", className), children: [
52
- /* @__PURE__ */ jsxs("h4", { className: "font-semibold mb-3 flex items-center gap-2", children: [
53
+ /* @__PURE__ */ jsxs(Heading, { className: "font-semibold mb-3 flex items-center gap-2", children: [
53
54
  icon ? /* @__PURE__ */ jsx("span", { className: "size-4", children: icon }) : /* @__PURE__ */ jsx(
54
55
  "svg",
55
56
  {
@@ -3,6 +3,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import { memo, useEffect, useRef } from "react";
4
4
  import { cn } from "../../lib/utils";
5
5
  function KeyboardShortcutsHelpImpl({
6
+ as: Heading = "h2",
6
7
  className,
7
8
  closeIcon,
8
9
  footer,
@@ -58,7 +59,7 @@ function KeyboardShortcutsHelpImpl({
58
59
  ),
59
60
  children: [
60
61
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-4", children: [
61
- /* @__PURE__ */ jsx("h2", { className: "text-lg font-semibold", id: "shortcuts-title", children: title }),
62
+ /* @__PURE__ */ jsx(Heading, { className: "text-lg font-semibold", id: "shortcuts-title", children: title }),
62
63
  /* @__PURE__ */ jsx(
63
64
  "button",
64
65
  {
@@ -238,13 +238,13 @@ function FillBlankField({
238
238
  onChange,
239
239
  value
240
240
  }) {
241
- const handleChange = useCallback(
241
+ const handleBlankValueChange = useCallback(
242
242
  (event) => {
243
243
  onChange(event.target.value);
244
244
  },
245
245
  [onChange]
246
246
  );
247
- return /* @__PURE__ */ jsx(Input, { id: inputId, onChange: handleChange, value });
247
+ return /* @__PURE__ */ jsx(Input, { id: inputId, onChange: handleBlankValueChange, value });
248
248
  }
249
249
  function QuestionField({
250
250
  groupName,
@@ -6,11 +6,11 @@ function LangProvider({
6
6
  supportedLanguages = ["en", "fr"]
7
7
  }) {
8
8
  const pathname = usePathname();
9
+ const langMatch = /^\/([a-z]{2})(?:\/|$)/.exec(pathname);
10
+ const lang = langMatch && supportedLanguages.includes(langMatch[1]) ? langMatch[1] : defaultLanguage;
9
11
  useEffect(() => {
10
- const langMatch = /^\/([a-z]{2})(?:\/|$)/.exec(pathname);
11
- const lang = langMatch && supportedLanguages.includes(langMatch[1]) ? langMatch[1] : defaultLanguage;
12
12
  document.documentElement.setAttribute("lang", lang);
13
- }, [pathname, defaultLanguage, supportedLanguages]);
13
+ }, [lang]);
14
14
  return null;
15
15
  }
16
16
  export {
@@ -2,6 +2,7 @@
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import { CheckCircle2, Clock, GraduationCap, Target } from "lucide-react";
4
4
  function LearningObjectives({
5
+ as: Heading = "h4",
5
6
  estimatedTime,
6
7
  objectives,
7
8
  title = "What you'll learn"
@@ -10,7 +11,7 @@ function LearningObjectives({
10
11
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-4", children: [
11
12
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
12
13
  /* @__PURE__ */ jsx(Target, { className: "size-5 text-primary" }),
13
- /* @__PURE__ */ jsx("h4", { className: "font-semibold text-foreground", children: title })
14
+ /* @__PURE__ */ jsx(Heading, { className: "font-semibold text-foreground", children: title })
14
15
  ] }),
15
16
  estimatedTime ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 text-sm text-muted-foreground", children: [
16
17
  /* @__PURE__ */ jsx(Clock, { className: "size-4" }),
@@ -2,7 +2,7 @@
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import * as React from "react";
4
4
  import { cn } from "../../lib/utils";
5
- import { Badge } from "../badge";
5
+ import { Badge } from "../badge/badge";
6
6
  import {
7
7
  Card,
8
8
  CardContent,
@@ -131,7 +131,7 @@ const LiveFeed = React.forwardRef(
131
131
  [events, maxItems]
132
132
  );
133
133
  return /* @__PURE__ */ jsxs(Card, { className: cn("shadow-sm", className), ref, ...props, children: [
134
- /* @__PURE__ */ jsxs(CardHeader, { className: "flex flex-row items-start justify-between gap-3 space-y-0 pb-3", children: [
134
+ /* @__PURE__ */ jsxs(CardHeader, { className: "flex flex-row items-start justify-between gap-3 gap-y-0 pb-3", children: [
135
135
  /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
136
136
  /* @__PURE__ */ jsx(CardTitle, { className: "text-base", children: title }),
137
137
  description ? /* @__PURE__ */ jsx(CardDescription, { children: description }) : null