@vllnt/ui 0.2.1-canary.06f0e84 → 0.2.1-canary.0cc4e50

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 (177) hide show
  1. package/CHANGELOG.md +3 -0
  2. package/dist/components/accordion/accordion.js +2 -2
  3. package/dist/components/activity-heatmap/activity-heatmap.js +17 -14
  4. package/dist/components/activity-log/activity-log.js +6 -6
  5. package/dist/components/agent-activity/agent-activity.js +8 -8
  6. package/dist/components/ai-artifact/ai-artifact.js +16 -16
  7. package/dist/components/ai-chat-input/ai-chat-input.js +3 -3
  8. package/dist/components/ai-message-bubble/ai-message-bubble.js +2 -2
  9. package/dist/components/ai-sidebar/ai-sidebar.js +8 -8
  10. package/dist/components/ai-source-citation/ai-source-citation.js +2 -2
  11. package/dist/components/ai-tool-call-display/ai-tool-call-display.js +5 -5
  12. package/dist/components/animated-text/animated-text.js +7 -7
  13. package/dist/components/annotation/annotation.js +1 -1
  14. package/dist/components/auto-reload/auto-reload.js +14 -4
  15. package/dist/components/avatar/avatar.js +1 -1
  16. package/dist/components/avatar-group/avatar-group.js +5 -5
  17. package/dist/components/banner/banner.js +3 -3
  18. package/dist/components/blog-card/blog-card.js +4 -2
  19. package/dist/components/bottom-activity-strip/bottom-activity-strip.js +3 -3
  20. package/dist/components/breadcrumb/breadcrumb.js +33 -26
  21. package/dist/components/button/button.js +1 -1
  22. package/dist/components/calendar/calendar.js +6 -6
  23. package/dist/components/callout/callout.js +1 -1
  24. package/dist/components/candlestick-chart/candlestick-chart.js +3 -2
  25. package/dist/components/canvas-shell/canvas-foundation-demo.js +5 -5
  26. package/dist/components/carousel/carousel.js +18 -10
  27. package/dist/components/category-filter/category-filter.js +1 -1
  28. package/dist/components/chat-dock-section/chat-dock-section.js +2 -2
  29. package/dist/components/checkbox/checkbox.js +2 -2
  30. package/dist/components/checklist/checklist.js +38 -10
  31. package/dist/components/checklist/index.js +8 -2
  32. package/dist/components/chronological-timeline/chronological-timeline.js +8 -7
  33. package/dist/components/civilization-card/civilization-card.js +1 -1
  34. package/dist/components/code-block/code-block.js +2 -2
  35. package/dist/components/code-playground/code-playground.js +11 -9
  36. package/dist/components/combobox/combobox.js +3 -8
  37. package/dist/components/command/command.js +1 -1
  38. package/dist/components/comment-pin/comment-pin.js +3 -3
  39. package/dist/components/comparison/comparison.js +11 -10
  40. package/dist/components/completion-dialog/completion-dialog.js +20 -12
  41. package/dist/components/connector-edge/connector-edge.js +1 -1
  42. package/dist/components/content-intro/content-intro.js +25 -21
  43. package/dist/components/context-menu/context-menu.js +4 -4
  44. package/dist/components/conversation-thread/conversation-thread.js +9 -9
  45. package/dist/components/cookie-consent/cookie-consent.js +1 -1
  46. package/dist/components/copy-button/copy-button.js +3 -3
  47. package/dist/components/countdown-timer/countdown-timer.js +9 -8
  48. package/dist/components/credit-badge/credit-badge.js +1 -7
  49. package/dist/components/curriculum/curriculum.js +10 -10
  50. package/dist/components/data-list/data-list.js +1 -1
  51. package/dist/components/data-table/data-table.js +6 -5
  52. package/dist/components/date-picker/date-picker.js +2 -7
  53. package/dist/components/dialog/dialog.js +1 -1
  54. package/dist/components/dropdown-menu/dropdown-menu.js +3 -3
  55. package/dist/components/empty-state/empty-state.js +3 -3
  56. package/dist/components/exercise/exercise.js +15 -7
  57. package/dist/components/faq/faq.js +8 -4
  58. package/dist/components/file-upload/file-upload.js +4 -9
  59. package/dist/components/filter-bar/filter-bar.js +9 -8
  60. package/dist/components/flashcard/flashcard.js +2 -2
  61. package/dist/components/floating-action-button/floating-action-button.js +1 -1
  62. package/dist/components/floating-toolbar/floating-toolbar.js +3 -3
  63. package/dist/components/flow-diagram/flow-controls.js +9 -9
  64. package/dist/components/flow-diagram/flow-error-boundary.js +2 -2
  65. package/dist/components/flow-diagram/flow-fullscreen.js +2 -2
  66. package/dist/components/form/form.js +1 -1
  67. package/dist/components/gantt-chart/gantt-chart.js +22 -19
  68. package/dist/components/globe-3d/globe-3d.js +16 -4
  69. package/dist/components/handoff-beacon/handoff-beacon.js +1 -1
  70. package/dist/components/historic-timeline/historic-timeline.js +2 -2
  71. package/dist/components/historical-figure-card/historical-figure-card.js +4 -7
  72. package/dist/components/horizontal-scroll-row/horizontal-scroll-row.js +6 -5
  73. package/dist/components/inline-input/inline-input.js +1 -1
  74. package/dist/components/input-otp/input-otp.js +1 -1
  75. package/dist/components/interactive-timeline/interactive-timeline.js +12 -9
  76. package/dist/components/jarvis-dock/jarvis-dock.js +4 -4
  77. package/dist/components/key-concept/key-concept.js +6 -5
  78. package/dist/components/keyboard-shortcuts-help/keyboard-shortcuts-help.js +4 -3
  79. package/dist/components/knowledge-check/knowledge-check.js +5 -5
  80. package/dist/components/lang-provider/lang-provider.js +3 -3
  81. package/dist/components/learning-objectives/learning-objectives.js +14 -13
  82. package/dist/components/live-feed/live-feed.js +17 -15
  83. package/dist/components/map-2d/map-2d.js +3 -3
  84. package/dist/components/map-timeline/map-timeline.js +5 -5
  85. package/dist/components/market-treemap/market-treemap.js +3 -3
  86. package/dist/components/mdx-content/mdx-content.js +19 -9
  87. package/dist/components/menubar/menubar.js +4 -4
  88. package/dist/components/metric-cluster/metric-cluster.js +1 -1
  89. package/dist/components/metric-gauge/metric-gauge.js +2 -2
  90. package/dist/components/model-comparison/model-comparison.js +2 -2
  91. package/dist/components/model-selector/model-selector.js +3 -3
  92. package/dist/components/multi-select/multi-select.js +4 -4
  93. package/dist/components/navbar-saas/navbar-saas.js +8 -7
  94. package/dist/components/navigation-menu/navigation-menu.js +2 -2
  95. package/dist/components/newsletter-signup/newsletter-signup.js +3 -3
  96. package/dist/components/number-input/number-input.js +2 -2
  97. package/dist/components/number-ticker/number-ticker.js +11 -4
  98. package/dist/components/object-card/object-card.js +1 -1
  99. package/dist/components/object-inspector/object-inspector.js +1 -1
  100. package/dist/components/order-book/order-book.js +2 -2
  101. package/dist/components/overview-board/overview-board.js +1 -1
  102. package/dist/components/parallel-timeline/parallel-timeline.js +2 -2
  103. package/dist/components/password-input/password-input.js +1 -1
  104. package/dist/components/plan-badge/plan-badge.js +1 -7
  105. package/dist/components/policy-delivery-panel/policy-delivery-panel.js +2 -2
  106. package/dist/components/presence-stack/presence-stack.js +2 -2
  107. package/dist/components/presence-sync-indicator/presence-sync-indicator.js +1 -1
  108. package/dist/components/pricing-table/pricing-table.js +3 -3
  109. package/dist/components/pro-tip/pro-tip.js +6 -6
  110. package/dist/components/profile-section/profile-section.js +3 -2
  111. package/dist/components/progress-card/progress-card.js +5 -4
  112. package/dist/components/progress-tracker/progress-tracker.js +24 -14
  113. package/dist/components/prompt-templates/prompt-templates.js +4 -4
  114. package/dist/components/quiz/quiz.js +7 -6
  115. package/dist/components/radio-group/radio-group.js +2 -2
  116. package/dist/components/rating/rating.js +3 -3
  117. package/dist/components/relationship-inspector/relationship-inspector.js +2 -2
  118. package/dist/components/resizable/resizable.js +1 -1
  119. package/dist/components/routing-assignment-panel/routing-assignment-panel.js +2 -2
  120. package/dist/components/run-timeline/run-timeline.js +2 -2
  121. package/dist/components/runtime-overview-panel/runtime-overview-panel.js +1 -1
  122. package/dist/components/scope-selector/scope-selector.js +8 -8
  123. package/dist/components/search-bar/search-bar.js +24 -2
  124. package/dist/components/search-dialog/search-dialog.js +484 -51
  125. package/dist/components/select/select.js +5 -5
  126. package/dist/components/selection-halo/selection-halo.js +1 -1
  127. package/dist/components/severity-badge/severity-badge.js +2 -2
  128. package/dist/components/share-dialog/share-dialog.js +2 -2
  129. package/dist/components/share-section/share-section.js +2 -1
  130. package/dist/components/sheet/sheet.js +1 -1
  131. package/dist/components/sidebar/sidebar.js +31 -26
  132. package/dist/components/sidebar-toggle/sidebar-toggle.js +3 -3
  133. package/dist/components/slider/slider.js +1 -1
  134. package/dist/components/slideshow/slideshow.js +15 -13
  135. package/dist/components/social-fab/social-fab.js +12 -11
  136. package/dist/components/sparkline-grid/sparkline-grid.js +1 -1
  137. package/dist/components/spinner/spinner.js +4 -4
  138. package/dist/components/spinner/unicode-spinner.js +4 -2
  139. package/dist/components/stat-card/stat-card.js +5 -5
  140. package/dist/components/state-badge-overlay/state-badge-overlay.js +1 -1
  141. package/dist/components/status-board/status-board.js +14 -7
  142. package/dist/components/status-indicator/status-indicator.js +3 -3
  143. package/dist/components/step-by-step/step-by-step.js +10 -8
  144. package/dist/components/step-navigation/step-navigation.js +2 -2
  145. package/dist/components/stepper/stepper.js +3 -3
  146. package/dist/components/sticky-metric/sticky-metric.js +1 -1
  147. package/dist/components/subscription-card/subscription-card.js +1 -1
  148. package/dist/components/switch/switch.js +1 -1
  149. package/dist/components/table-of-contents/table-of-contents.js +5 -2
  150. package/dist/components/table-of-contents-panel/table-of-contents-panel.js +8 -6
  151. package/dist/components/tabs/tabs.js +26 -8
  152. package/dist/components/tags-input/tags-input.js +12 -4
  153. package/dist/components/terminal/terminal.js +59 -37
  154. package/dist/components/theme-toggle/theme-toggle.js +2 -2
  155. package/dist/components/thinking-block/thinking-block.js +3 -3
  156. package/dist/components/ticker-tape/ticker-tape.js +4 -4
  157. package/dist/components/timeline/timeline.js +2 -2
  158. package/dist/components/timeline-scrubber/timeline-scrubber.js +2 -2
  159. package/dist/components/tldr-section/tldr-section.js +11 -9
  160. package/dist/components/tour/tour.js +2 -2
  161. package/dist/components/transaction-list/transaction-list.js +30 -9
  162. package/dist/components/tree-view/tree-view.js +2 -2
  163. package/dist/components/tutorial-card/tutorial-card.js +1 -1
  164. package/dist/components/tutorial-complete/tutorial-complete.js +16 -14
  165. package/dist/components/tutorial-filters/tutorial-filters.js +2 -2
  166. package/dist/components/tutorial-intro-content/tutorial-intro-content.js +5 -5
  167. package/dist/components/tutorial-mdx/tutorial-mdx.js +6 -6
  168. package/dist/components/usage-breakdown/usage-breakdown.js +10 -6
  169. package/dist/components/video-embed/video-embed.js +2 -2
  170. package/dist/components/viewport-bookmarks/viewport-bookmarks.js +3 -3
  171. package/dist/components/wallet-card/wallet-card.js +1 -1
  172. package/dist/components/watchlist/watchlist.js +7 -6
  173. package/dist/components/world-breadcrumbs/world-breadcrumbs.js +2 -2
  174. package/dist/components/world-clock-bar/world-clock-bar.js +35 -14
  175. package/dist/components/zoom-hud/zoom-hud.js +1 -1
  176. package/dist/index.d.ts +114 -30
  177. package/package.json +3 -3
@@ -26,7 +26,7 @@ const CommandDialog = ({ children, ...props }) => {
26
26
  const CommandInput = React.forwardRef(({ className, ...props }, reference) => (
27
27
  // eslint-disable-next-line react/no-unknown-property
28
28
  /* @__PURE__ */ jsxs("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [
29
- /* @__PURE__ */ jsx(Search, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
29
+ /* @__PURE__ */ jsx(Search, { className: "mr-2 size-4 shrink-0 opacity-50" }),
30
30
  /* @__PURE__ */ jsx(
31
31
  CommandPrimitive.Input,
32
32
  {
@@ -21,7 +21,7 @@ const PinBody = (props) => {
21
21
  {
22
22
  "aria-hidden": "true",
23
23
  className: cn(
24
- "flex h-7 w-7 items-center justify-center rounded-full border border-background text-[11px] font-semibold shadow-sm",
24
+ "flex size-7 items-center justify-center rounded-full border border-background text-[11px] font-semibold shadow-sm",
25
25
  STATE_FILL[props.state]
26
26
  ),
27
27
  "data-comment-pin-body": true,
@@ -57,7 +57,7 @@ const CommentPin = forwardRef(
57
57
  const resolvedLabels = { ...DEFAULT_LABELS, ...labels };
58
58
  const showBadge = typeof unread === "number" && unread > 0;
59
59
  const ariaLabel = showBadge ? `${resolvedLabels.region}, ${unread} ${resolvedLabels.unreadSuffix}` : resolvedLabels.region;
60
- const handleClick = () => {
60
+ const handleActivateComment = () => {
61
61
  onActivate?.();
62
62
  };
63
63
  const body = /* @__PURE__ */ jsx(
@@ -89,7 +89,7 @@ const CommentPin = forwardRef(
89
89
  "aria-label": ariaLabel,
90
90
  className: "relative inline-flex rounded-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
91
91
  "data-comment-pin-trigger": true,
92
- onClick: handleClick,
92
+ onClick: handleActivateComment,
93
93
  type: "button",
94
94
  children: body
95
95
  }
@@ -24,6 +24,7 @@ const variantConfig = {
24
24
  };
25
25
  function Comparison({
26
26
  after,
27
+ as: Heading = "h4",
27
28
  before,
28
29
  title,
29
30
  ...rest
@@ -40,7 +41,7 @@ function Comparison({
40
41
  const BeforeIcon = beforeConfig.icon;
41
42
  const AfterIcon = afterConfig.icon;
42
43
  return /* @__PURE__ */ jsxs("div", { className: "my-6", children: [
43
- title ? /* @__PURE__ */ jsx("h4", { className: "font-semibold mb-3", children: title }) : null,
44
+ title ? /* @__PURE__ */ jsx(Heading, { className: "font-semibold mb-3", children: title }) : null,
44
45
  /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
45
46
  /* @__PURE__ */ jsxs("div", { className: cn("rounded-lg border", beforeConfig.className), children: [
46
47
  /* @__PURE__ */ jsx(
@@ -53,18 +54,18 @@ function Comparison({
53
54
  children: before.title
54
55
  }
55
56
  ),
56
- /* @__PURE__ */ jsx("ul", { className: "p-4 space-y-2", children: before.items.map((item, index) => /* @__PURE__ */ jsxs("li", { className: "flex items-start gap-2 text-sm", children: [
57
+ /* @__PURE__ */ jsx("ul", { className: "p-4 space-y-2", children: before.items.map((item) => /* @__PURE__ */ jsxs("li", { className: "flex items-start gap-2 text-sm", children: [
57
58
  /* @__PURE__ */ jsx(
58
59
  BeforeIcon,
59
60
  {
60
61
  className: cn(
61
- "h-4 w-4 mt-0.5 flex-shrink-0",
62
+ "size-4 mt-0.5 flex-shrink-0",
62
63
  beforeConfig.iconClass
63
64
  )
64
65
  }
65
66
  ),
66
67
  /* @__PURE__ */ jsx("span", { children: item })
67
- ] }, index)) })
68
+ ] }, item)) })
68
69
  ] }),
69
70
  /* @__PURE__ */ jsxs("div", { className: cn("rounded-lg border", afterConfig.className), children: [
70
71
  /* @__PURE__ */ jsx(
@@ -77,18 +78,18 @@ function Comparison({
77
78
  children: after.title
78
79
  }
79
80
  ),
80
- /* @__PURE__ */ jsx("ul", { className: "p-4 space-y-2", children: after.items.map((item, index) => /* @__PURE__ */ jsxs("li", { className: "flex items-start gap-2 text-sm", children: [
81
+ /* @__PURE__ */ jsx("ul", { className: "p-4 space-y-2", children: after.items.map((item) => /* @__PURE__ */ jsxs("li", { className: "flex items-start gap-2 text-sm", children: [
81
82
  /* @__PURE__ */ jsx(
82
83
  AfterIcon,
83
84
  {
84
85
  className: cn(
85
- "h-4 w-4 mt-0.5 flex-shrink-0",
86
+ "size-4 mt-0.5 flex-shrink-0",
86
87
  afterConfig.iconClass
87
88
  )
88
89
  }
89
90
  ),
90
91
  /* @__PURE__ */ jsx("span", { children: item })
91
- ] }, index)) })
92
+ ] }, item)) })
92
93
  ] })
93
94
  ] })
94
95
  ] });
@@ -99,15 +100,15 @@ function BeforeAfter({ after, before, title }) {
99
100
  /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-[1fr_auto_1fr] gap-4 items-start", children: [
100
101
  /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-red-500/30 bg-red-500/5 overflow-hidden", children: [
101
102
  /* @__PURE__ */ jsxs("div", { className: "px-4 py-2 bg-red-500/10 text-red-700 dark:text-red-300 font-medium text-sm flex items-center gap-2", children: [
102
- /* @__PURE__ */ jsx(X, { className: "h-4 w-4" }),
103
+ /* @__PURE__ */ jsx(X, { className: "size-4" }),
103
104
  "Before"
104
105
  ] }),
105
106
  /* @__PURE__ */ jsx("div", { className: "p-4 text-sm [&>pre]:my-0", children: before })
106
107
  ] }),
107
- /* @__PURE__ */ jsx("div", { className: "hidden md:flex items-center justify-center h-full", children: /* @__PURE__ */ jsx(ArrowRight, { className: "h-6 w-6 text-muted-foreground" }) }),
108
+ /* @__PURE__ */ jsx("div", { className: "hidden md:flex items-center justify-center h-full", children: /* @__PURE__ */ jsx(ArrowRight, { className: "size-6 text-muted-foreground" }) }),
108
109
  /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-green-500/30 bg-green-500/5 overflow-hidden", children: [
109
110
  /* @__PURE__ */ jsxs("div", { className: "px-4 py-2 bg-green-500/10 text-green-700 dark:text-green-300 font-medium text-sm flex items-center gap-2", children: [
110
- /* @__PURE__ */ jsx(Check, { className: "h-4 w-4" }),
111
+ /* @__PURE__ */ jsx(Check, { className: "size-4" }),
111
112
  "After"
112
113
  ] }),
113
114
  /* @__PURE__ */ jsx("div", { className: "p-4 text-sm [&>pre]:my-0", children: after })
@@ -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,
@@ -39,7 +40,7 @@ function DialogContent({
39
40
  children: closeIcon ?? /* @__PURE__ */ jsx(
40
41
  "svg",
41
42
  {
42
- className: "h-4 w-4",
43
+ className: "size-4",
43
44
  fill: "none",
44
45
  stroke: "currentColor",
45
46
  viewBox: "0 0 24 24",
@@ -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,50 +1,54 @@
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",
9
9
  tableOfContentsLabel: "Table of Contents"
10
10
  };
11
+ const EMPTY_CONTENT_INTRO_LABELS = {};
11
12
  function ContentIntroImpl({
12
13
  additionalContent,
13
14
  completedSections,
14
15
  estimatedTime,
15
16
  isLoading = false,
16
- labels = {},
17
+ labels = EMPTY_CONTENT_INTRO_LABELS,
17
18
  onGoToSection,
18
19
  onStart,
19
20
  renderIntroContent,
20
21
  sections,
21
- title
22
+ title,
23
+ titleAs: TitleHeading = "h2",
24
+ tocLabelAs: TocHeading = "h3"
22
25
  }) {
23
26
  const mergedLabels = { ...DEFAULT_LABELS, ...labels };
24
27
  const hasProgress = completedSections.size > 0;
25
- const handleKeyDown = useCallback(
26
- (event) => {
28
+ const onStartRef = useRef(onStart);
29
+ useEffect(() => {
30
+ onStartRef.current = onStart;
31
+ }, [onStart]);
32
+ useEffect(() => {
33
+ const onDocumentKeyDown = (event) => {
27
34
  if (event.key === "Enter") {
28
35
  event.preventDefault();
29
- onStart();
36
+ onStartRef.current();
30
37
  }
31
- },
32
- [onStart]
33
- );
34
- useEffect(() => {
35
- document.addEventListener("keydown", handleKeyDown);
38
+ };
39
+ document.addEventListener("keydown", onDocumentKeyDown);
36
40
  return () => {
37
- document.removeEventListener("keydown", handleKeyDown);
41
+ document.removeEventListener("keydown", onDocumentKeyDown);
38
42
  };
39
- }, [handleKeyDown]);
43
+ }, []);
40
44
  return /* @__PURE__ */ jsxs(Fragment, { children: [
41
45
  /* @__PURE__ */ jsxs("div", { className: "animate-in fade-in-0 duration-500 pb-24", children: [
42
46
  /* @__PURE__ */ jsxs("section", { className: "py-6", children: [
43
- /* @__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 }),
44
48
  /* @__PURE__ */ jsx("div", { className: cn("max-w-none", "[&_h2:first-of-type]:hidden"), children: renderIntroContent() })
45
49
  ] }),
46
50
  /* @__PURE__ */ jsxs("section", { className: "mt-8 py-6 border-t border-border", children: [
47
- /* @__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 }),
48
52
  /* @__PURE__ */ jsx("ol", { className: "space-y-2", children: sections.map((section, index) => {
49
53
  const isCompleted = !isLoading && completedSections.has(section.id);
50
54
  return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(
@@ -60,7 +64,7 @@ function ContentIntroImpl({
60
64
  "span",
61
65
  {
62
66
  className: cn(
63
- "flex-shrink-0 w-6 h-6 rounded-full flex items-center justify-center text-xs font-medium tabular-nums transition-colors",
67
+ "flex-shrink-0 size-6 rounded-full flex items-center justify-center text-xs font-medium tabular-nums transition-colors",
64
68
  isLoading && "animate-pulse bg-muted",
65
69
  !isLoading && isCompleted && "bg-foreground text-background",
66
70
  !isLoading && !isCompleted && "bg-muted"
@@ -68,7 +72,7 @@ function ContentIntroImpl({
68
72
  children: isCompleted ? /* @__PURE__ */ jsx(
69
73
  "svg",
70
74
  {
71
- className: "h-3 w-3",
75
+ className: "size-3",
72
76
  fill: "none",
73
77
  stroke: "currentColor",
74
78
  viewBox: "0 0 24 24",
@@ -97,12 +101,12 @@ function ContentIntroImpl({
97
101
  )
98
102
  ]
99
103
  }
100
- ) }, `${section.id}-${index}`);
104
+ ) }, section.id);
101
105
  }) })
102
106
  ] }),
103
107
  additionalContent
104
108
  ] }),
105
- /* @__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 px-4 py-4", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-4", children: [
109
+ /* @__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: [
106
110
  /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground hidden sm:block", children: hasProgress ? `${completedSections.size}/${sections.length} completed` : `${sections.length} sections \xB7 ${estimatedTime}` }),
107
111
  /* @__PURE__ */ jsxs(
108
112
  Button,
@@ -114,7 +118,7 @@ function ContentIntroImpl({
114
118
  /* @__PURE__ */ jsx(
115
119
  "svg",
116
120
  {
117
- className: "h-5 w-5",
121
+ className: "size-5",
118
122
  fill: "none",
119
123
  stroke: "currentColor",
120
124
  viewBox: "0 0 24 24",
@@ -22,7 +22,7 @@ const ContextMenuSubTrigger = forwardRef(({ children, className, inset, ...props
22
22
  ...props,
23
23
  children: [
24
24
  children,
25
- /* @__PURE__ */ jsx(ChevronRight, { className: "ml-auto h-4 w-4" })
25
+ /* @__PURE__ */ jsx(ChevronRight, { className: "ml-auto size-4" })
26
26
  ]
27
27
  }
28
28
  ));
@@ -75,7 +75,7 @@ const ContextMenuCheckboxItem = forwardRef(({ checked, children, className, ...p
75
75
  ref,
76
76
  ...props,
77
77
  children: [
78
- /* @__PURE__ */ jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(ContextMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(Check, { className: "h-4 w-4" }) }) }),
78
+ /* @__PURE__ */ jsx("span", { className: "absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(ContextMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(Check, { className: "size-4" }) }) }),
79
79
  children
80
80
  ]
81
81
  }
@@ -91,7 +91,7 @@ const ContextMenuRadioItem = forwardRef(({ children, className, ...props }, ref)
91
91
  ref,
92
92
  ...props,
93
93
  children: [
94
- /* @__PURE__ */ jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(ContextMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(Circle, { className: "h-2 w-2 fill-current" }) }) }),
94
+ /* @__PURE__ */ jsx("span", { className: "absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(ContextMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(Circle, { className: "size-2 fill-current" }) }) }),
95
95
  children
96
96
  ]
97
97
  }
@@ -113,7 +113,7 @@ ContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;
113
113
  const ContextMenuSeparator = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
114
114
  ContextMenuPrimitive.Separator,
115
115
  {
116
- className: cn("-mx-1 my-1 h-px bg-border", className),
116
+ className: cn("-m-1 h-px bg-border", className),
117
117
  ref,
118
118
  ...props
119
119
  }
@@ -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);
@@ -35,7 +35,7 @@ function MessageActions({ messageId }) {
35
35
  onRetry(messageId);
36
36
  },
37
37
  type: "button",
38
- children: /* @__PURE__ */ jsx(RefreshCw, { className: "h-3 w-3" })
38
+ children: /* @__PURE__ */ jsx(RefreshCw, { className: "size-3" })
39
39
  }
40
40
  ) : null,
41
41
  onFeedback ? /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -48,7 +48,7 @@ function MessageActions({ messageId }) {
48
48
  onFeedback(messageId, "positive");
49
49
  },
50
50
  type: "button",
51
- children: /* @__PURE__ */ jsx(ThumbsUp, { className: "h-3 w-3" })
51
+ children: /* @__PURE__ */ jsx(ThumbsUp, { className: "size-3" })
52
52
  }
53
53
  ),
54
54
  /* @__PURE__ */ jsx(
@@ -60,7 +60,7 @@ function MessageActions({ messageId }) {
60
60
  onFeedback(messageId, "negative");
61
61
  },
62
62
  type: "button",
63
- children: /* @__PURE__ */ jsx(ThumbsDown, { className: "h-3 w-3" })
63
+ children: /* @__PURE__ */ jsx(ThumbsDown, { className: "size-3" })
64
64
  }
65
65
  )
66
66
  ] }) : null
@@ -290,13 +290,13 @@ const ConversationScrollButton = forwardRef(({ className }, reference) => {
290
290
  {
291
291
  "aria-label": "Scroll to bottom",
292
292
  className: cn(
293
- "absolute bottom-4 right-4 flex h-8 w-8 items-center justify-center rounded-full border bg-background shadow-md transition-colors hover:bg-muted",
293
+ "absolute bottom-4 right-4 flex size-8 items-center justify-center rounded-full border bg-background shadow-md transition-colors hover:bg-muted",
294
294
  className
295
295
  ),
296
296
  onClick: scrollToBottom,
297
297
  ref: reference,
298
298
  type: "button",
299
- children: /* @__PURE__ */ jsx(ArrowDown, { className: "h-4 w-4" })
299
+ children: /* @__PURE__ */ jsx(ArrowDown, { className: "size-4" })
300
300
  }
301
301
  );
302
302
  });
@@ -319,18 +319,18 @@ const ConversationLoading = forwardRef(({ className }, reference) => {
319
319
  /* @__PURE__ */ jsx(
320
320
  "span",
321
321
  {
322
- className: "h-2 w-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: "h-2 w-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: "h-2 w-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
  );
@@ -160,7 +160,7 @@ const CookieConsent = forwardRef(
160
160
  className: "absolute -right-2 -top-2 rounded-full border bg-background p-1 text-muted-foreground hover:text-foreground",
161
161
  onClick: handleClose,
162
162
  type: "button",
163
- children: /* @__PURE__ */ jsx(X, { className: "h-3 w-3" })
163
+ children: /* @__PURE__ */ jsx(X, { className: "size-3" })
164
164
  }
165
165
  ) : null
166
166
  ]
@@ -59,7 +59,7 @@ function CopyIcon({
59
59
  size
60
60
  }) {
61
61
  const Icon = copied ? Check : Copy;
62
- const sizeClass = size === "xs" ? "h-3 w-3" : "h-4 w-4";
62
+ const sizeClass = size === "xs" ? "size-3" : "size-4";
63
63
  return /* @__PURE__ */ jsx(Icon, { "aria-hidden": "true", className: cn(sizeClass, className) });
64
64
  }
65
65
  const ButtonTrigger = forwardRef(
@@ -101,7 +101,7 @@ const ButtonTrigger = forwardRef(
101
101
  {
102
102
  "aria-label": accessibleLabel,
103
103
  className: cn(
104
- "h-6 w-6 align-middle text-muted-foreground hover:text-foreground",
104
+ "size-6 align-middle text-muted-foreground hover:text-foreground",
105
105
  className
106
106
  ),
107
107
  onClick: onClickHandler,
@@ -118,7 +118,7 @@ const ButtonTrigger = forwardRef(
118
118
  Button,
119
119
  {
120
120
  "aria-label": accessibleLabel,
121
- className: cn("h-8 w-8", className),
121
+ className: cn("size-8", className),
122
122
  onClick: onClickHandler,
123
123
  ref,
124
124
  size: "icon",
@@ -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,
@@ -73,14 +73,15 @@ function formatSegments(milliseconds) {
73
73
  { label: "Seconds", value: String(seconds).padStart(2, "0") }
74
74
  ];
75
75
  }
76
+ const DEADLINE_FORMATTER = new Intl.DateTimeFormat("en-US", {
77
+ day: "numeric",
78
+ hour: "numeric",
79
+ minute: "2-digit",
80
+ month: "short",
81
+ timeZoneName: "short"
82
+ });
76
83
  function formatDeadline(date) {
77
- return new Intl.DateTimeFormat("en-US", {
78
- day: "numeric",
79
- hour: "numeric",
80
- minute: "2-digit",
81
- month: "short",
82
- timeZoneName: "short"
83
- }).format(date);
84
+ return DEADLINE_FORMATTER.format(date);
84
85
  }
85
86
  function getProgress(deadline, now, startedAt) {
86
87
  if (!startedAt) {
@@ -40,13 +40,7 @@ const CreditBadge = React.forwardRef(
40
40
  ref: reference,
41
41
  ...props,
42
42
  children: [
43
- /* @__PURE__ */ jsx(
44
- "span",
45
- {
46
- "aria-hidden": "true",
47
- className: "h-1.5 w-1.5 rounded-full bg-current"
48
- }
49
- ),
43
+ /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "size-1.5 rounded-full bg-current" }),
50
44
  /* @__PURE__ */ jsx("span", { children: amount ? `${amount} \u2022 ${label ?? getStatusLabel(status)}` : label ?? getStatusLabel(status) })
51
45
  ]
52
46
  }
@@ -56,15 +56,15 @@ function statusLabel(status) {
56
56
  }
57
57
  function statusIcon(status) {
58
58
  if (status === "completed") {
59
- return /* @__PURE__ */ jsx(CheckCircle2, { className: "h-4 w-4 flex-shrink-0 text-green-500" });
59
+ return /* @__PURE__ */ jsx(CheckCircle2, { className: "size-4 flex-shrink-0 text-green-500" });
60
60
  }
61
61
  if (status === "in-progress") {
62
- return /* @__PURE__ */ jsx(PlayCircle, { className: "h-4 w-4 flex-shrink-0 text-primary" });
62
+ return /* @__PURE__ */ jsx(PlayCircle, { className: "size-4 flex-shrink-0 text-primary" });
63
63
  }
64
64
  if (status === "locked") {
65
- return /* @__PURE__ */ jsx(Lock, { className: "h-4 w-4 flex-shrink-0 text-muted-foreground" });
65
+ return /* @__PURE__ */ jsx(Lock, { className: "size-4 flex-shrink-0 text-muted-foreground" });
66
66
  }
67
- return /* @__PURE__ */ jsx(BookOpen, { className: "h-4 w-4 flex-shrink-0 text-muted-foreground" });
67
+ return /* @__PURE__ */ jsx(BookOpen, { className: "size-4 flex-shrink-0 text-muted-foreground" });
68
68
  }
69
69
  const difficultyStyles = {
70
70
  advanced: "bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400",
@@ -105,7 +105,7 @@ function LessonMeta({
105
105
  "aria-label": prerequisitesLabel,
106
106
  className: "flex items-center gap-1 text-xs text-muted-foreground",
107
107
  title: prerequisitesLabel,
108
- children: /* @__PURE__ */ jsx(Link2, { "aria-hidden": "true", className: "h-3 w-3" })
108
+ children: /* @__PURE__ */ jsx(Link2, { "aria-hidden": "true", className: "size-3" })
109
109
  }
110
110
  ) : null,
111
111
  difficulty ? /* @__PURE__ */ jsx(
@@ -119,7 +119,7 @@ function LessonMeta({
119
119
  }
120
120
  ) : null,
121
121
  duration ? /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
122
- /* @__PURE__ */ jsx(Clock, { className: "h-3 w-3" }),
122
+ /* @__PURE__ */ jsx(Clock, { className: "size-3" }),
123
123
  duration
124
124
  ] }) : null
125
125
  ] });
@@ -162,7 +162,7 @@ function ModuleTrigger({
162
162
  ] }),
163
163
  /* @__PURE__ */ jsxs("div", { className: "mt-0.5 flex flex-shrink-0 items-center gap-3", children: [
164
164
  estimatedHours === void 0 ? null : /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
165
- /* @__PURE__ */ jsx(Clock, { className: "h-3.5 w-3.5" }),
165
+ /* @__PURE__ */ jsx(Clock, { className: "size-3.5" }),
166
166
  estimatedHours,
167
167
  "h"
168
168
  ] }),
@@ -170,7 +170,7 @@ function ModuleTrigger({
170
170
  ChevronDown,
171
171
  {
172
172
  className: cn(
173
- "h-4 w-4 text-muted-foreground transition-transform duration-200",
173
+ "size-4 text-muted-foreground transition-transform duration-200",
174
174
  isExpanded && "rotate-180"
175
175
  )
176
176
  }
@@ -215,11 +215,11 @@ function CurriculumRoot({
215
215
  children: [
216
216
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between border-b px-6 py-4", children: [
217
217
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
218
- /* @__PURE__ */ jsx(GraduationCap, { className: "h-5 w-5 text-primary" }),
218
+ /* @__PURE__ */ jsx(GraduationCap, { className: "size-5 text-primary" }),
219
219
  /* @__PURE__ */ jsx("h2", { className: "text-lg font-semibold", children: title })
220
220
  ] }),
221
221
  totalHours === void 0 ? null : /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 text-sm text-muted-foreground", children: [
222
- /* @__PURE__ */ jsx(Clock, { className: "h-4 w-4" }),
222
+ /* @__PURE__ */ jsx(Clock, { className: "size-4" }),
223
223
  /* @__PURE__ */ jsxs("span", { children: [
224
224
  totalHours,
225
225
  "h total"
@@ -18,7 +18,7 @@ const dataListVariants = cva(
18
18
  }
19
19
  );
20
20
  const dataListItemVariants = cva(
21
- "grid gap-1 px-4 py-4 sm:grid-cols-[minmax(0,12rem)_1fr] sm:gap-4 sm:px-5",
21
+ "grid gap-1 p-4 sm:grid-cols-[minmax(0,12rem)_1fr] sm:gap-4 sm:px-5",
22
22
  {
23
23
  defaultVariants: {
24
24
  density: "default"
@@ -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 {
@@ -31,13 +31,14 @@ import {
31
31
  } from "../table";
32
32
  function SortIcon({ direction }) {
33
33
  if (direction === "asc") {
34
- return /* @__PURE__ */ jsx(ArrowUp, { className: "h-4 w-4" });
34
+ return /* @__PURE__ */ jsx(ArrowUp, { className: "size-4" });
35
35
  }
36
36
  if (direction === "desc") {
37
- return /* @__PURE__ */ jsx(ArrowDown, { className: "h-4 w-4" });
37
+ return /* @__PURE__ */ jsx(ArrowDown, { className: "size-4" });
38
38
  }
39
- return /* @__PURE__ */ jsx(ArrowUpDown, { className: "h-4 w-4" });
39
+ return /* @__PURE__ */ jsx(ArrowUpDown, { className: "size-4" });
40
40
  }
41
+ const EMPTY_FILTERABLE_COLUMNS = [];
41
42
  function DataTableComponent({
42
43
  caption,
43
44
  className,
@@ -47,7 +48,7 @@ function DataTableComponent({
47
48
  enableFiltering = true,
48
49
  enablePagination = true,
49
50
  enableSelection = false,
50
- filterableColumns = [],
51
+ filterableColumns = EMPTY_FILTERABLE_COLUMNS,
51
52
  getRowId,
52
53
  pageSize = 10,
53
54
  searchPlaceholder = "Search rows...",