@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
@@ -51,10 +51,10 @@ function ComparisonHeader({
51
51
  type: "button",
52
52
  variant: "outline",
53
53
  children: blind ? /* @__PURE__ */ jsxs(Fragment, { children: [
54
- /* @__PURE__ */ jsx(Eye, { "aria-hidden": "true", className: "mr-2 h-4 w-4" }),
54
+ /* @__PURE__ */ jsx(Eye, { "aria-hidden": "true", className: "mr-2 size-4" }),
55
55
  labels.reveal
56
56
  ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
57
- /* @__PURE__ */ jsx(EyeOff, { "aria-hidden": "true", className: "mr-2 h-4 w-4" }),
57
+ /* @__PURE__ */ jsx(EyeOff, { "aria-hidden": "true", className: "mr-2 size-4" }),
58
58
  labels.hide
59
59
  ] })
60
60
  }
@@ -3,7 +3,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import { useMemo, useRef, useState } from "react";
4
4
  import { ArrowUpDown, Filter } 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 {
9
9
  Command,
@@ -198,7 +198,7 @@ function ProviderFilterMenu({
198
198
  }) {
199
199
  return /* @__PURE__ */ jsxs(DropdownMenu, { children: [
200
200
  /* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(Button, { className: "h-9 gap-2", size: "sm", variant: "outline", children: [
201
- /* @__PURE__ */ jsx(Filter, { className: "h-4 w-4" }),
201
+ /* @__PURE__ */ jsx(Filter, { className: "size-4" }),
202
202
  providerFilter === "all" ? "All Providers" : providerFilter
203
203
  ] }) }),
204
204
  /* @__PURE__ */ jsxs(DropdownMenuContent, { align: "end", className: "w-48", children: [
@@ -214,7 +214,7 @@ function ProviderFilterMenu({
214
214
  function SortMenu({ onChange, sortBy }) {
215
215
  return /* @__PURE__ */ jsxs(DropdownMenu, { children: [
216
216
  /* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(Button, { className: "h-9 gap-2", size: "sm", variant: "outline", children: [
217
- /* @__PURE__ */ jsx(ArrowUpDown, { className: "h-4 w-4" }),
217
+ /* @__PURE__ */ jsx(ArrowUpDown, { className: "size-4" }),
218
218
  "Sort"
219
219
  ] }) }),
220
220
  /* @__PURE__ */ jsxs(DropdownMenuContent, { align: "end", className: "w-48", children: [
@@ -3,7 +3,7 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
3
  import * as React from "react";
4
4
  import { Check, ChevronDown } 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 {
9
9
  Command,
@@ -58,10 +58,10 @@ function OptionList({
58
58
  "span",
59
59
  {
60
60
  className: cn(
61
- "flex h-4 w-4 items-center justify-center rounded-sm border border-input bg-background text-primary transition-opacity",
61
+ "flex size-4 items-center justify-center rounded-sm border border-input bg-background text-primary transition-opacity",
62
62
  isSelected ? "opacity-100" : "opacity-50"
63
63
  ),
64
- children: isSelected ? /* @__PURE__ */ jsx(Check, { className: "h-3.5 w-3.5" }) : null
64
+ children: isSelected ? /* @__PURE__ */ jsx(Check, { className: "size-3.5" }) : null
65
65
  }
66
66
  ),
67
67
  /* @__PURE__ */ jsx("span", { className: "flex-1", children: option.label })
@@ -179,7 +179,7 @@ const MultiSelectTrigger = React.forwardRef(
179
179
  selectedOptions
180
180
  }
181
181
  ) }),
182
- /* @__PURE__ */ jsx(ChevronDown, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
182
+ /* @__PURE__ */ jsx(ChevronDown, { className: "ml-2 size-4 shrink-0 opacity-50" })
183
183
  ]
184
184
  }
185
185
  )
@@ -4,31 +4,32 @@ import { Menu, X } from "lucide-react";
4
4
  import Link from "next/link";
5
5
  import { usePathname } from "next/navigation";
6
6
  import { cn } from "../../lib/utils";
7
- import { Button } from "../button";
7
+ import { Button } from "../button/button";
8
8
  import { useSidebar } from "../sidebar-provider";
9
9
  import { ThemeToggle } from "../theme-toggle";
10
- import { useMobile } from "./use-mobile";
10
+ const EMPTY_NAV_ITEMS = [];
11
11
  function NavbarSaas({
12
12
  brand,
13
- navItems = [],
13
+ navItems = EMPTY_NAV_ITEMS,
14
14
  rightSlot,
15
15
  showMobileMenu = true
16
16
  }) {
17
17
  const pathname = usePathname();
18
18
  const { open, setOpen } = useSidebar();
19
- const isMobile = useMobile();
20
19
  return /* @__PURE__ */ jsx("header", { className: "sticky top-0 z-50 w-full border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60 shrink-0", children: /* @__PURE__ */ jsx("div", { className: "w-full", children: /* @__PURE__ */ jsxs("div", { className: "mx-auto flex h-16 items-center justify-between px-4", children: [
21
20
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4", children: [
22
- showMobileMenu && isMobile ? /* @__PURE__ */ jsx(
21
+ showMobileMenu ? /* @__PURE__ */ jsx(
23
22
  Button,
24
23
  {
25
- className: "lg:hidden",
24
+ "aria-expanded": open,
25
+ "aria-label": "Toggle sidebar",
26
+ "data-testid": "navbar-saas-mobile-trigger",
26
27
  onClick: () => {
27
28
  setOpen(!open);
28
29
  },
29
30
  size: "icon",
30
31
  variant: "ghost",
31
- children: open ? /* @__PURE__ */ jsx(X, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(Menu, { className: "h-4 w-4" })
32
+ children: open ? /* @__PURE__ */ jsx(X, { className: "size-4" }) : /* @__PURE__ */ jsx(Menu, { className: "size-4" })
32
33
  }
33
34
  ) : null,
34
35
  brand ? typeof brand === "string" ? /* @__PURE__ */ jsx(Link, { className: "text-xl font-bold truncate", href: "/", children: brand }) : brand : null,
@@ -50,7 +50,7 @@ const NavigationMenuTrigger = forwardRef(({ children, className, ...props }, ref
50
50
  ChevronDown,
51
51
  {
52
52
  "aria-hidden": "true",
53
- className: "relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180"
53
+ className: "relative top-[1px] ml-1 size-3 transition duration-200 group-data-[state=open]:rotate-180"
54
54
  }
55
55
  )
56
56
  ]
@@ -91,7 +91,7 @@ const NavigationMenuIndicator = forwardRef(({ className, ...props }, ref) => /*
91
91
  ),
92
92
  ref,
93
93
  ...props,
94
- children: /* @__PURE__ */ jsx("div", { className: "relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md" })
94
+ children: /* @__PURE__ */ jsx("div", { className: "relative top-[60%] size-2 rotate-45 rounded-tl-sm bg-border shadow-md" })
95
95
  }
96
96
  ));
97
97
  NavigationMenuIndicator.displayName = NavigationMenuPrimitive.Indicator.displayName;
@@ -65,12 +65,12 @@ function SubmitButton({
65
65
  let content;
66
66
  if (status === "sending") {
67
67
  content = /* @__PURE__ */ jsxs(Fragment, { children: [
68
- /* @__PURE__ */ jsx(Loader2, { "aria-hidden": "true", className: "mr-2 h-4 w-4 animate-spin" }),
68
+ /* @__PURE__ */ jsx(Loader2, { "aria-hidden": "true", className: "mr-2 size-4 animate-spin" }),
69
69
  labels.sending
70
70
  ] });
71
71
  } else if (status === "error") {
72
72
  content = /* @__PURE__ */ jsxs(Fragment, { children: [
73
- /* @__PURE__ */ jsx(XCircle, { "aria-hidden": "true", className: "mr-2 h-4 w-4" }),
73
+ /* @__PURE__ */ jsx(XCircle, { "aria-hidden": "true", className: "mr-2 size-4" }),
74
74
  labels.tryAgain
75
75
  ] });
76
76
  } else {
@@ -97,7 +97,7 @@ function SuccessPanel({ className, message }) {
97
97
  ),
98
98
  role: "status",
99
99
  children: [
100
- /* @__PURE__ */ jsx(CheckCircle2, { "aria-hidden": "true", className: "mt-0.5 h-4 w-4 shrink-0" }),
100
+ /* @__PURE__ */ jsx(CheckCircle2, { "aria-hidden": "true", className: "mt-0.5 size-4 shrink-0" }),
101
101
  /* @__PURE__ */ jsx("span", { children: message })
102
102
  ]
103
103
  }
@@ -3,7 +3,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import * as React from "react";
4
4
  import { Minus, Plus } from "lucide-react";
5
5
  import { cn } from "../../lib/utils";
6
- import { Button } from "../button";
6
+ import { Button } from "../button/button";
7
7
  function getNumericBound(bound) {
8
8
  if (bound === void 0) {
9
9
  return;
@@ -51,7 +51,7 @@ function StepButton({
51
51
  tabIndex: -1,
52
52
  type: "button",
53
53
  variant: "ghost",
54
- children: direction === "decrement" ? /* @__PURE__ */ jsx(Minus, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(Plus, { className: "h-4 w-4" })
54
+ children: direction === "decrement" ? /* @__PURE__ */ jsx(Minus, { className: "size-4" }) : /* @__PURE__ */ jsx(Plus, { className: "size-4" })
55
55
  }
56
56
  );
57
57
  }
@@ -2,6 +2,16 @@
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  import * as React from "react";
4
4
  import { cn } from "../../lib/utils";
5
+ const NUMBER_FORMATTER_CACHE = /* @__PURE__ */ new Map();
6
+ function getNumberTickerFormatter(locale, formatOptions) {
7
+ const key = `${locale ?? ""}|${formatOptions ? JSON.stringify(formatOptions) : ""}`;
8
+ let formatter = NUMBER_FORMATTER_CACHE.get(key);
9
+ if (!formatter) {
10
+ formatter = Intl.NumberFormat(locale, formatOptions);
11
+ NUMBER_FORMATTER_CACHE.set(key, formatter);
12
+ }
13
+ return formatter;
14
+ }
5
15
  const NumberTicker = React.forwardRef(
6
16
  ({
7
17
  className,
@@ -42,10 +52,7 @@ const NumberTicker = React.forwardRef(
42
52
  window.cancelAnimationFrame(animationFrame);
43
53
  };
44
54
  }, [delay, duration, from, value]);
45
- const formatter = React.useMemo(
46
- () => new Intl.NumberFormat(locale, formatOptions),
47
- [formatOptions, locale]
48
- );
55
+ const formatter = getNumberTickerFormatter(locale, formatOptions);
49
56
  return /* @__PURE__ */ jsx(
50
57
  "span",
51
58
  {
@@ -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 { Badge } from "../badge";
4
+ import { Badge } from "../badge/badge";
5
5
  import { Button } from "../button";
6
6
  const stateClasses = {
7
7
  blocked: "border-amber-500/30 bg-amber-500/10 text-amber-700 dark:text-amber-300",
@@ -59,7 +59,7 @@ const StatusDot = (props) => /* @__PURE__ */ jsxs(
59
59
  "span",
60
60
  {
61
61
  "aria-hidden": "true",
62
- className: cn("h-1.5 w-1.5 rounded-full", STATUS_DOT[props.status])
62
+ className: cn("size-1.5 rounded-full", STATUS_DOT[props.status])
63
63
  }
64
64
  ),
65
65
  STATUS_LABEL[props.status]
@@ -68,7 +68,7 @@ function BookSide({
68
68
  ] });
69
69
  }
70
70
  const OrderBook = React.forwardRef(
71
- ({ asks, bids, className, precision = 2, ...props }, reference) => {
71
+ ({ as: Heading = "h2", asks, bids, className, precision = 2, ...props }, reference) => {
72
72
  if (asks.length === 0 && bids.length === 0) {
73
73
  return null;
74
74
  }
@@ -90,7 +90,7 @@ const OrderBook = React.forwardRef(
90
90
  /* @__PURE__ */ jsxs("div", { className: "mb-4 flex flex-wrap items-start justify-between gap-3", children: [
91
91
  /* @__PURE__ */ jsxs("div", { children: [
92
92
  /* @__PURE__ */ jsx("p", { className: "text-xs font-medium uppercase tracking-[0.28em] text-muted-foreground", children: "Level II" }),
93
- /* @__PURE__ */ jsx("h2", { className: "text-lg font-semibold text-foreground", children: "Order book" })
93
+ /* @__PURE__ */ jsx(Heading, { className: "text-lg font-semibold text-foreground", children: "Order book" })
94
94
  ] }),
95
95
  /* @__PURE__ */ jsxs("div", { className: "rounded-full border border-border bg-background/70 px-3 py-1 text-sm text-muted-foreground tabular-nums", children: [
96
96
  "Spread ",
@@ -2,7 +2,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
3
  import { AlertCircle, ArrowRight, Inbox, ListTodo, Siren } from "lucide-react";
4
4
  import { cn } from "../../lib/utils";
5
- import { Button } from "../button";
5
+ import { Button } from "../button/button";
6
6
  const toneClassNames = {
7
7
  danger: "border-red-500/30 bg-red-500/8",
8
8
  default: "border-border/70 bg-background/80",
@@ -136,7 +136,7 @@ function EventMarker({
136
136
  {
137
137
  "aria-hidden": "true",
138
138
  className: cn(
139
- "h-3 w-3 rounded-full border-2 ring-2 ring-background",
139
+ "size-3 rounded-full border-2 ring-2 ring-background",
140
140
  palette.marker
141
141
  )
142
142
  }
@@ -159,7 +159,7 @@ function TrackRow({ endYear, startYear, track }) {
159
159
  const color = track.color ?? "neutral";
160
160
  const palette = COLOR_CLASSES[color];
161
161
  return /* @__PURE__ */ jsxs("div", { className: "relative flex items-stretch gap-3 border-t border-border first:border-t-0", children: [
162
- /* @__PURE__ */ jsxs("div", { className: "flex w-32 shrink-0 flex-col gap-1 border-r border-border bg-muted/20 px-3 py-3", children: [
162
+ /* @__PURE__ */ jsxs("div", { className: "flex w-32 shrink-0 flex-col gap-1 border-r border-border bg-muted/20 p-3", children: [
163
163
  /* @__PURE__ */ jsx(
164
164
  "span",
165
165
  {
@@ -33,7 +33,7 @@ const PasswordInput = React.forwardRef(
33
33
  setVisible((previous) => !previous);
34
34
  },
35
35
  type: "button",
36
- children: visible ? /* @__PURE__ */ jsx(EyeOff, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(Eye, { className: "h-4 w-4" })
36
+ children: visible ? /* @__PURE__ */ jsx(EyeOff, { className: "size-4" }) : /* @__PURE__ */ jsx(Eye, { className: "size-4" })
37
37
  }
38
38
  )
39
39
  ] });
@@ -46,13 +46,7 @@ const PlanBadge = React.forwardRef(
46
46
  ref: reference,
47
47
  ...props,
48
48
  children: [
49
- /* @__PURE__ */ jsx(
50
- "span",
51
- {
52
- "aria-hidden": "true",
53
- className: "h-1.5 w-1.5 rounded-full bg-current"
54
- }
55
- ),
49
+ /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "size-1.5 rounded-full bg-current" }),
56
50
  /* @__PURE__ */ jsx("span", { children: label ?? getPlanLabel(tier) }),
57
51
  state === "trial" ? /* @__PURE__ */ jsx("span", { className: "text-current/80", children: "Trial" }) : null,
58
52
  state === "legacy" ? /* @__PURE__ */ jsx("span", { className: "text-current/80", children: "Legacy" }) : null
@@ -40,7 +40,7 @@ const RowBody = (props) => {
40
40
  const Row = (props) => {
41
41
  const { policy } = props;
42
42
  if (policy.onToggle) {
43
- const handleClick = () => {
43
+ const handleTogglePolicy = () => {
44
44
  policy.onToggle?.();
45
45
  };
46
46
  return /* @__PURE__ */ jsx(
@@ -49,7 +49,7 @@ const Row = (props) => {
49
49
  className: "flex w-full items-center gap-2 rounded-md border border-transparent px-2 py-1.5 text-left transition-colors hover:border-border hover:bg-muted/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
50
50
  "data-policy-row": policy.id,
51
51
  "data-policy-status": policy.status,
52
- onClick: handleClick,
52
+ onClick: handleTogglePolicy,
53
53
  type: "button",
54
54
  children: /* @__PURE__ */ jsx(RowBody, { policy })
55
55
  }
@@ -20,7 +20,7 @@ const Avatar = (props) => {
20
20
  return /* @__PURE__ */ jsxs(
21
21
  "span",
22
22
  {
23
- className: "relative -ml-2 inline-flex h-7 w-7 items-center justify-center rounded-full border-2 border-background text-[11px] font-semibold text-white shadow-sm first:ml-0",
23
+ className: "relative -ml-2 inline-flex size-7 items-center justify-center rounded-full border-2 border-background text-[11px] font-semibold text-white shadow-sm first:ml-0",
24
24
  "data-presence-stack-status": status,
25
25
  "data-presence-stack-user": user.id,
26
26
  style: { backgroundColor: user.color ?? "var(--foreground)" },
@@ -32,7 +32,7 @@ const Avatar = (props) => {
32
32
  {
33
33
  "aria-hidden": "true",
34
34
  className: cn(
35
- "absolute -bottom-0.5 -right-0.5 h-2 w-2 rounded-full border border-background",
35
+ "absolute -bottom-0.5 -right-0.5 size-2 rounded-full border border-background",
36
36
  STATUS_DOT[status]
37
37
  ),
38
38
  "data-presence-stack-dot": true
@@ -50,7 +50,7 @@ const PresenceSyncIndicator = forwardRef((props, ref) => {
50
50
  "span",
51
51
  {
52
52
  "aria-hidden": "true",
53
- className: cn("h-1.5 w-1.5 rounded-full", STATE_DOT[state]),
53
+ className: cn("size-1.5 rounded-full", STATE_DOT[state]),
54
54
  "data-presence-sync-dot": true
55
55
  }
56
56
  ),
@@ -16,7 +16,7 @@ function FeatureIndicator({
16
16
  "span",
17
17
  {
18
18
  "aria-hidden": "true",
19
- className: "mt-0.5 inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-full bg-primary/15 text-[10px] font-semibold text-primary",
19
+ className: "mt-0.5 inline-flex size-4 shrink-0 items-center justify-center rounded-full bg-primary/15 text-[10px] font-semibold text-primary",
20
20
  children: "\u2713"
21
21
  }
22
22
  );
@@ -26,7 +26,7 @@ function FeatureIndicator({
26
26
  Check,
27
27
  {
28
28
  "aria-hidden": "true",
29
- className: "mt-0.5 h-4 w-4 shrink-0 text-primary"
29
+ className: "mt-0.5 size-4 shrink-0 text-primary"
30
30
  }
31
31
  );
32
32
  }
@@ -34,7 +34,7 @@ function FeatureIndicator({
34
34
  X,
35
35
  {
36
36
  "aria-hidden": "true",
37
- className: "mt-0.5 h-4 w-4 shrink-0 text-muted-foreground/60"
37
+ className: "mt-0.5 size-4 shrink-0 text-muted-foreground/60"
38
38
  }
39
39
  );
40
40
  }
@@ -39,10 +39,10 @@ function ProTip({
39
39
  {
40
40
  className: cn("my-6 rounded-lg border p-4", config.className, className),
41
41
  children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
42
- /* @__PURE__ */ jsx("div", { className: "flex h-8 w-8 items-center justify-center rounded-full bg-current/10 flex-shrink-0", children: icon ? /* @__PURE__ */ jsx("span", { className: "h-4 w-4", children: icon }) : /* @__PURE__ */ jsx(
42
+ /* @__PURE__ */ jsx("div", { className: "flex size-8 items-center justify-center rounded-full bg-current/10 flex-shrink-0", children: icon ? /* @__PURE__ */ jsx("span", { className: "size-4", children: icon }) : /* @__PURE__ */ jsx(
43
43
  "svg",
44
44
  {
45
- className: "h-4 w-4",
45
+ className: "size-4",
46
46
  fill: "none",
47
47
  stroke: "currentColor",
48
48
  viewBox: "0 0 24 24",
@@ -82,10 +82,10 @@ function CommonMistake({
82
82
  ),
83
83
  children: [
84
84
  /* @__PURE__ */ jsx("div", { className: "p-4", children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
85
- icon ? /* @__PURE__ */ jsx("span", { className: "h-5 w-5 text-red-500 flex-shrink-0 mt-0.5", children: icon }) : /* @__PURE__ */ jsx(
85
+ icon ? /* @__PURE__ */ jsx("span", { className: "size-5 text-red-500 flex-shrink-0 mt-0.5", children: icon }) : /* @__PURE__ */ jsx(
86
86
  "svg",
87
87
  {
88
- className: "h-5 w-5 text-red-500 flex-shrink-0 mt-0.5",
88
+ className: "size-5 text-red-500 flex-shrink-0 mt-0.5",
89
89
  fill: "none",
90
90
  stroke: "currentColor",
91
91
  viewBox: "0 0 24 24",
@@ -106,10 +106,10 @@ function CommonMistake({
106
106
  ] })
107
107
  ] }) }),
108
108
  fix ? /* @__PURE__ */ jsx("div", { className: "border-t border-red-500/30 bg-green-500/5 p-4", children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
109
- fixIcon ? /* @__PURE__ */ jsx("span", { className: "h-5 w-5 text-green-500 flex-shrink-0 mt-0.5", children: fixIcon }) : /* @__PURE__ */ jsx(
109
+ fixIcon ? /* @__PURE__ */ jsx("span", { className: "size-5 text-green-500 flex-shrink-0 mt-0.5", children: fixIcon }) : /* @__PURE__ */ jsx(
110
110
  "svg",
111
111
  {
112
- className: "h-5 w-5 text-green-500 flex-shrink-0 mt-0.5",
112
+ className: "size-5 text-green-500 flex-shrink-0 mt-0.5",
113
113
  fill: "none",
114
114
  stroke: "currentColor",
115
115
  viewBox: "0 0 24 24",
@@ -3,6 +3,7 @@ import Image from "next/image";
3
3
  import Link from "next/link";
4
4
  import { Button } from "../button/button";
5
5
  function ProfileSection({
6
+ as: Heading = "h3",
6
7
  compact = false,
7
8
  dict,
8
9
  imageAlt,
@@ -13,7 +14,7 @@ function ProfileSection({
13
14
  const showImage = !compact && Boolean(imageSource);
14
15
  const showSocialLinks = !compact && Boolean(socialLinks && socialLinks.length > 0);
15
16
  return /* @__PURE__ */ jsxs("div", { className: "text-center space-y-4", children: [
16
- showImage ? /* @__PURE__ */ jsx("div", { className: "relative w-24 h-24 mx-auto overflow-hidden rounded-md", children: /* @__PURE__ */ jsx(
17
+ showImage ? /* @__PURE__ */ jsx("div", { className: "relative size-24 mx-auto overflow-hidden rounded-md", children: /* @__PURE__ */ jsx(
17
18
  Image,
18
19
  {
19
20
  alt: displayImageAlt,
@@ -25,7 +26,7 @@ function ProfileSection({
25
26
  }
26
27
  ) }) : null,
27
28
  /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
28
- /* @__PURE__ */ jsx("h3", { className: `font-semibold ${compact ? "text-lg" : "text-xl"}`, children: dict.profile.name }),
29
+ /* @__PURE__ */ jsx(Heading, { className: `font-semibold ${compact ? "text-lg" : "text-xl"}`, children: dict.profile.name }),
29
30
  /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: compact ? dict.profile.tagline : `> ${dict.profile.tagline}` })
30
31
  ] }),
31
32
  showSocialLinks ? /* @__PURE__ */ jsx("div", { className: "flex flex-wrap justify-center items-center gap-2", children: socialLinks?.map((link) => /* @__PURE__ */ jsx(
@@ -2,7 +2,7 @@
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import { memo, useEffect, useState } from "react";
4
4
  import { useMounted } from "../../lib/use-mounted";
5
- import { Badge } from "../badge";
5
+ import { Badge } from "../badge/badge";
6
6
  import {
7
7
  Card,
8
8
  CardContent,
@@ -17,6 +17,7 @@ function DefaultLink({
17
17
  }) {
18
18
  return /* @__PURE__ */ jsx("a", { className, href, children });
19
19
  }
20
+ const EMPTY_PROGRESS_CARD_LIST = [];
20
21
  function ContentCardImpl({
21
22
  badgeLabel,
22
23
  badgeVariant = "default",
@@ -24,9 +25,9 @@ function ContentCardImpl({
24
25
  getProgress,
25
26
  href,
26
27
  linkComponent: LinkComponent = DefaultLink,
27
- metadata = [],
28
+ metadata = EMPTY_PROGRESS_CARD_LIST,
28
29
  progressLabel = "completed",
29
- tags = [],
30
+ tags = EMPTY_PROGRESS_CARD_LIST,
30
31
  title
31
32
  }) {
32
33
  const [progress, setProgress] = useState(null);
@@ -59,7 +60,7 @@ function ContentCardImpl({
59
60
  metadata.length > 0 ? /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2 text-xs text-muted-foreground", children: metadata.map((item, index) => /* @__PURE__ */ jsxs("span", { children: [
60
61
  index > 0 ? /* @__PURE__ */ jsx("span", { className: "mr-2", children: "\u2022" }) : null,
61
62
  item
62
- ] }, index)) }) : null,
63
+ ] }, item)) }) : null,
63
64
  tags.length > 0 ? /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1", children: tags.map((tag) => /* @__PURE__ */ jsx(Badge, { className: "text-xs", variant: "outline", children: tag }, tag)) }) : null
64
65
  ] })
65
66
  ] }) });
@@ -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,
@@ -10,7 +10,10 @@ import {
10
10
  CardHeader,
11
11
  CardTitle
12
12
  } from "../card";
13
- import { CHECKLIST_PROGRESS_EVENT } from "../checklist";
13
+ import {
14
+ CHECKLIST_PROGRESS_EVENT,
15
+ parseChecklistStorageValue
16
+ } from "../checklist";
14
17
  import { ProgressBar } from "../progress-bar";
15
18
  const ProgressTrackerContext = React.createContext(null);
16
19
  function clampPercentage(value) {
@@ -41,15 +44,13 @@ function readPersistedChecklistItems(persistKey) {
41
44
  try {
42
45
  const saved = localStorage.getItem(`checklist:${persistKey}`);
43
46
  if (!saved) return [];
44
- const parsed = JSON.parse(saved);
45
- return Array.isArray(parsed) ? parsed.filter((item) => typeof item === "string") : [];
47
+ return parseChecklistStorageValue(saved);
46
48
  } catch {
47
49
  return [];
48
50
  }
49
51
  }
50
52
  function areStringArraysEqual(left, right) {
51
- if (left.length !== right.length) return false;
52
- return left.every((value, index) => value === right[index]);
53
+ return left.length === right.length && left.every((value, index) => value === right[index]);
53
54
  }
54
55
  function getChecklistPersistKey(event) {
55
56
  if (!(event instanceof CustomEvent)) return null;
@@ -79,14 +80,16 @@ function useChecklistProgress(checklistItems = [], persistKey) {
79
80
  const [persistedIds, setPersistedIds] = React.useState(
80
81
  () => readPersistedChecklistItems(persistKey)
81
82
  );
83
+ const [trackedPersistKey, setTrackedPersistKey] = React.useState(persistKey);
82
84
  const setPersistedIdsIfChanged = React.useCallback((nextIds) => {
83
85
  setPersistedIds(
84
86
  (currentIds) => areStringArraysEqual(currentIds, nextIds) ? currentIds : nextIds
85
87
  );
86
88
  }, []);
87
- React.useEffect(() => {
89
+ if (trackedPersistKey !== persistKey) {
90
+ setTrackedPersistKey(persistKey);
88
91
  setPersistedIdsIfChanged(readPersistedChecklistItems(persistKey));
89
- }, [persistKey, setPersistedIdsIfChanged]);
92
+ }
90
93
  React.useEffect(() => {
91
94
  if (!persistKey || typeof window === "undefined") return;
92
95
  const sync = (event) => {
@@ -124,10 +127,12 @@ function useProgressTrackerContext() {
124
127
  }
125
128
  return context;
126
129
  }
130
+ const EMPTY_PROGRESS_TRACKER_MODULES = [];
131
+ const EMPTY_PROGRESS_TRACKER_SKILLS = [];
127
132
  function ProgressTrackerRoot({
128
133
  children,
129
134
  className,
130
- modules = [],
135
+ modules = EMPTY_PROGRESS_TRACKER_MODULES,
131
136
  overallProgress,
132
137
  streak = 0,
133
138
  title = "Learning progress",
@@ -160,7 +165,12 @@ function ProgressTrackerOverview({
160
165
  }) {
161
166
  const { modules, overallProgress, streak, title } = useProgressTrackerContext();
162
167
  const trackedPersistKeys = React.useMemo(
163
- () => modules.map((module) => module.persistKey).filter(Boolean),
168
+ () => modules.reduce((keys, module) => {
169
+ if (module.persistKey) {
170
+ keys.push(module.persistKey);
171
+ }
172
+ return keys;
173
+ }, []),
164
174
  [modules]
165
175
  );
166
176
  const [, forceChecklistRefresh] = React.useState(0);
@@ -226,7 +236,7 @@ function ProgressTrackerOverview({
226
236
  "span",
227
237
  {
228
238
  "aria-hidden": "true",
229
- className: "inline-flex h-2.5 w-2.5 rounded-full bg-primary"
239
+ className: "inline-flex size-2.5 rounded-full bg-primary"
230
240
  }
231
241
  ),
232
242
  /* @__PURE__ */ jsxs("span", { children: [
@@ -239,8 +249,8 @@ function ProgressTrackerOverview({
239
249
  ] }),
240
250
  /* @__PURE__ */ jsxs(CardContent, { className: "grid gap-6 lg:grid-cols-[auto,1fr] lg:items-center", children: [
241
251
  /* @__PURE__ */ jsxs("div", { className: "mx-auto flex flex-col items-center gap-3 text-center", children: [
242
- /* @__PURE__ */ jsxs("div", { className: "relative flex h-36 w-36 items-center justify-center", children: [
243
- /* @__PURE__ */ jsxs("svg", { className: "h-36 w-36 -rotate-90", viewBox: "0 0 120 120", children: [
252
+ /* @__PURE__ */ jsxs("div", { className: "relative flex size-36 items-center justify-center", children: [
253
+ /* @__PURE__ */ jsxs("svg", { className: "size-36 -rotate-90", viewBox: "0 0 120 120", children: [
244
254
  /* @__PURE__ */ jsx(
245
255
  "circle",
246
256
  {
@@ -352,7 +362,7 @@ function ProgressTrackerModule({
352
362
  lessons,
353
363
  persistKey,
354
364
  progress,
355
- skills = [],
365
+ skills = EMPTY_PROGRESS_TRACKER_SKILLS,
356
366
  status,
357
367
  timeSpent,
358
368
  title,
@@ -71,7 +71,7 @@ function FilterBar({
71
71
  Search,
72
72
  {
73
73
  "aria-hidden": "true",
74
- className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"
74
+ className: "absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground"
75
75
  }
76
76
  ),
77
77
  /* @__PURE__ */ jsx(
@@ -171,7 +171,7 @@ function CardActions({
171
171
  type: "button",
172
172
  variant: variableCount > 0 ? "outline" : "default",
173
173
  children: [
174
- /* @__PURE__ */ jsx(Sparkles, { "aria-hidden": "true", className: "mr-2 h-3.5 w-3.5" }),
174
+ /* @__PURE__ */ jsx(Sparkles, { "aria-hidden": "true", className: "mr-2 size-3.5" }),
175
175
  useLabel
176
176
  ]
177
177
  }
@@ -243,7 +243,7 @@ function VariableField({
243
243
  onValueChange,
244
244
  value
245
245
  }) {
246
- const handleChange = useCallback(
246
+ const handleVariableValueChange = useCallback(
247
247
  (event) => {
248
248
  onValueChange(name, event.target.value);
249
249
  },
@@ -255,7 +255,7 @@ function VariableField({
255
255
  Input,
256
256
  {
257
257
  id: fieldId,
258
- onChange: handleChange,
258
+ onChange: handleVariableValueChange,
259
259
  placeholder: `Value for ${name}`,
260
260
  value
261
261
  }