@vllnt/ui 0.4.0-canary.sha3c8ee66 → 0.4.0-canary.sha4d4d033

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 (142) hide show
  1. package/CHANGELOG.md +0 -55
  2. package/dist/components/atoms/agent-activity/agent-activity.js +1 -8
  3. package/dist/components/atoms/ai-streaming-text/ai-streaming-text.js +1 -1
  4. package/dist/components/atoms/alert-pulse/alert-pulse.js +1 -1
  5. package/dist/components/atoms/animated-tabs/animated-tabs.js +3 -15
  6. package/dist/components/atoms/animated-text/animated-text.js +7 -28
  7. package/dist/components/atoms/animated-tooltip/animated-tooltip.js +0 -10
  8. package/dist/components/atoms/border-beam/border-beam.js +4 -1
  9. package/dist/components/atoms/bottom-activity-strip/bottom-activity-strip.js +1 -2
  10. package/dist/components/atoms/chain-of-thought/chain-of-thought.js +1 -7
  11. package/dist/components/atoms/comment-pin/comment-pin.js +4 -7
  12. package/dist/components/atoms/comparison/comparison.js +2 -2
  13. package/dist/components/atoms/curriculum/curriculum.js +4 -6
  14. package/dist/components/atoms/cursor/cursor.js +9 -48
  15. package/dist/components/atoms/dock/dock.js +17 -75
  16. package/dist/components/atoms/drawer/drawer.js +0 -2
  17. package/dist/components/atoms/era-comparison/era-comparison.js +1 -1
  18. package/dist/components/atoms/follow-mode/follow-mode.js +6 -6
  19. package/dist/components/atoms/glass-progress/glass-progress.js +0 -1
  20. package/dist/components/atoms/handoff-beacon/handoff-beacon.js +1 -1
  21. package/dist/components/atoms/input-otp/input-otp.js +1 -1
  22. package/dist/components/atoms/key-concept/key-concept.js +2 -4
  23. package/dist/components/atoms/liquid-glass/liquid-glass.js +2 -1
  24. package/dist/components/atoms/list-box/list-box.js +4 -55
  25. package/dist/components/atoms/live-cursor/live-cursor.js +4 -9
  26. package/dist/components/atoms/magnetic/magnetic.js +14 -61
  27. package/dist/components/atoms/magnetic-button/magnetic-button.js +14 -61
  28. package/dist/components/atoms/marquee/marquee.js +30 -89
  29. package/dist/components/atoms/meteors/meteors.js +2 -2
  30. package/dist/components/atoms/object-handle/object-handle.js +1 -1
  31. package/dist/components/atoms/object-inspector/object-inspector.js +1 -1
  32. package/dist/components/atoms/order-book/order-book.js +5 -11
  33. package/dist/components/atoms/particles/particles.js +2 -2
  34. package/dist/components/atoms/playback-ghost/playback-ghost.js +4 -12
  35. package/dist/components/atoms/presence-stack/presence-stack.js +2 -7
  36. package/dist/components/atoms/presence-sync-indicator/presence-sync-indicator.js +2 -2
  37. package/dist/components/atoms/progress-bar/progress-bar.js +2 -2
  38. package/dist/components/atoms/prompt-input/prompt-input.js +1 -7
  39. package/dist/components/atoms/property-section/property-section.js +1 -1
  40. package/dist/components/atoms/qr-code/qr-code.js +3 -27
  41. package/dist/components/atoms/rating/rating.js +0 -11
  42. package/dist/components/atoms/reasoning/reasoning.js +7 -16
  43. package/dist/components/atoms/scramble-text/scramble-text.js +11 -5
  44. package/dist/components/atoms/scroll-area/scroll-area.js +13 -55
  45. package/dist/components/atoms/scroll-progress/scroll-progress.js +2 -11
  46. package/dist/components/atoms/search-field/search-field.js +2 -2
  47. package/dist/components/atoms/selection-halo/selection-halo.js +2 -10
  48. package/dist/components/atoms/selection-presence/selection-presence.js +1 -3
  49. package/dist/components/atoms/severity-badge/severity-badge.js +10 -10
  50. package/dist/components/atoms/shine-border/shine-border.js +4 -1
  51. package/dist/components/atoms/skeleton/skeleton.js +1 -4
  52. package/dist/components/atoms/slider/slider.js +1 -12
  53. package/dist/components/atoms/snap-guides/snap-guides.js +0 -1
  54. package/dist/components/atoms/sparkles/sparkles.js +2 -2
  55. package/dist/components/atoms/sparkline-grid/sparkline-grid.js +2 -2
  56. package/dist/components/atoms/spinner/spinner.js +1 -2
  57. package/dist/components/atoms/spinning-text/spinning-text.js +12 -14
  58. package/dist/components/atoms/spotlight-card/spotlight-card.js +11 -35
  59. package/dist/components/atoms/state-badge-overlay/state-badge-overlay.js +2 -2
  60. package/dist/components/atoms/status-indicator/status-indicator.js +1 -1
  61. package/dist/components/atoms/step-by-step/step-by-step.js +1 -1
  62. package/dist/components/atoms/tabs/tabs.js +11 -106
  63. package/dist/components/atoms/text-reveal/text-reveal.js +17 -32
  64. package/dist/components/atoms/theme-switcher/theme-switcher.js +1 -12
  65. package/dist/components/atoms/thinking-block/thinking-block.js +7 -9
  66. package/dist/components/atoms/thread-bubble/thread-bubble.js +1 -3
  67. package/dist/components/atoms/tilt-card/tilt-card.js +18 -63
  68. package/dist/components/atoms/tldr-section/tldr-section.js +6 -11
  69. package/dist/components/atoms/toast/toast.js +16 -15
  70. package/dist/components/atoms/toast/toaster.js +1 -7
  71. package/dist/components/atoms/typewriter/typewriter.js +1 -2
  72. package/dist/components/atoms/video-embed/video-embed.js +0 -2
  73. package/dist/components/atoms/view-switcher/view-switcher.js +43 -54
  74. package/dist/components/atoms/watchlist/watchlist.js +7 -8
  75. package/dist/components/atoms/workspace-switcher/workspace-switcher.js +10 -39
  76. package/dist/components/index.js +5 -13
  77. package/dist/components/molecules/ai-artifact/ai-artifact.js +1 -5
  78. package/dist/components/molecules/ai-chat-input/ai-chat-input.js +1 -7
  79. package/dist/components/molecules/ai-tool-call-display/ai-tool-call-display.js +1 -1
  80. package/dist/components/molecules/color-picker/color-picker.js +36 -45
  81. package/dist/components/molecules/command/command.js +14 -33
  82. package/dist/components/molecules/completion-dialog/completion-dialog.js +132 -91
  83. package/dist/components/molecules/content-intro/content-intro.js +1 -1
  84. package/dist/components/molecules/conversation-thread/conversation-thread.js +4 -5
  85. package/dist/components/molecules/copy-button/copy-button.js +44 -4
  86. package/dist/components/molecules/exercise/exercise.js +3 -3
  87. package/dist/components/molecules/file-upload/file-upload.js +34 -28
  88. package/dist/components/molecules/historical-figure-card/historical-figure-card.js +1 -1
  89. package/dist/components/molecules/inline-input/inline-input.js +0 -4
  90. package/dist/components/molecules/live-feed/live-feed.js +1 -1
  91. package/dist/components/molecules/newsletter-signup/newsletter-signup.js +1 -8
  92. package/dist/components/molecules/number-input/number-input.js +0 -6
  93. package/dist/components/molecules/pagination/pagination.js +12 -44
  94. package/dist/components/molecules/progress-card/progress-card.js +6 -8
  95. package/dist/components/molecules/search-bar/search-bar.js +5 -9
  96. package/dist/components/molecules/stat-card/stat-card.js +2 -2
  97. package/dist/components/molecules/ticker-tape/ticker-tape.js +10 -38
  98. package/dist/components/molecules/time-picker/time-picker.js +26 -65
  99. package/dist/components/molecules/tour/tour.js +6 -14
  100. package/dist/components/molecules/transaction-list/transaction-list.js +1 -1
  101. package/dist/components/molecules/tutorial-card/tutorial-card.js +6 -8
  102. package/dist/components/organisms/candlestick-chart/candlestick-chart.js +2 -2
  103. package/dist/components/organisms/canvas-view/canvas-view.js +14 -10
  104. package/dist/components/organisms/choropleth-map/choropleth-map.js +2 -9
  105. package/dist/components/organisms/chronological-timeline/chronological-timeline.js +4 -2
  106. package/dist/components/organisms/code-block/code-block.js +16 -43
  107. package/dist/components/organisms/code-playground/code-playground.js +2 -9
  108. package/dist/components/organisms/combobox/combobox.js +7 -25
  109. package/dist/components/organisms/data-table/data-table.js +1 -8
  110. package/dist/components/organisms/date-picker/date-picker.js +8 -20
  111. package/dist/components/organisms/date-range-picker/date-range-picker.js +8 -20
  112. package/dist/components/organisms/flow-diagram/flow-canvas.js +0 -3
  113. package/dist/components/organisms/flow-diagram/flow-controls.js +1 -7
  114. package/dist/components/organisms/flow-diagram/use-flow-diagram.js +11 -25
  115. package/dist/components/organisms/gantt-chart/gantt-chart.js +2 -6
  116. package/dist/components/organisms/geography-quiz-map/geography-quiz-map.js +20 -43
  117. package/dist/components/organisms/globe-3d/globe-3d.js +1 -1
  118. package/dist/components/organisms/historic-timeline/historic-timeline.js +1 -1
  119. package/dist/components/organisms/interactive-timeline/interactive-timeline.js +6 -6
  120. package/dist/components/organisms/map-2d/map-2d.js +0 -2
  121. package/dist/components/organisms/market-treemap/market-treemap.js +1 -1
  122. package/dist/components/organisms/model-selector/model-selector.js +40 -57
  123. package/dist/components/organisms/multi-select/multi-select.js +1 -14
  124. package/dist/components/organisms/parallel-timeline/parallel-timeline.js +1 -2
  125. package/dist/components/organisms/primary-source-viewer/primary-source-viewer.js +1 -1
  126. package/dist/components/organisms/run-timeline/run-timeline.js +2 -2
  127. package/dist/components/organisms/share-dialog/share-dialog.js +25 -39
  128. package/dist/components/organisms/slideshow/slideshow.js +1 -13
  129. package/dist/components/organisms/static-code/static-code-copy.js +1 -1
  130. package/dist/components/organisms/terminal/terminal.js +1 -1
  131. package/dist/components/organisms/tree-view/tree-view.js +4 -41
  132. package/dist/components/organisms/tutorial-mdx/tutorial-mdx.js +6 -7
  133. package/dist/index.d.ts +71 -323
  134. package/dist/index.js +0 -10
  135. package/dist/lib/use-escape-key.js +3 -6
  136. package/package.json +2 -5
  137. package/styles.css +0 -29
  138. package/dist/components/atoms/toast/sonner-toast.js +0 -4
  139. package/dist/components/molecules/copy-button/use-copy-to-clipboard.js +0 -42
  140. package/dist/lib/focus-calendar-day.js +0 -13
  141. package/dist/lib/roving-focus.js +0 -70
  142. package/dist/lib/use-return-focus.js +0 -23
package/CHANGELOG.md CHANGED
@@ -10,67 +10,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
10
10
 
11
11
  - Source-only React Native renderer and shared design contracts for the 0.4.0 canary track; stable Web installation remains unchanged.
12
12
  - Localized Native catalog discovery, dependency/capability comparison, and extensible React/React Native source tabs in a single component preview surface.
13
- - **Accessibility gate** - the Storybook test-runner runs axe-core (WCAG 2.0,
14
- 2.1 and 2.2, levels A and AA) on every story in the light and dark theme and
15
- fails on any violation. A story can turn a rule off only through
16
- `parameters.a11y.config.rules` with a written `reason`. (#543)
17
- - **Optional accessibility props** (English defaults, nothing required):
18
- `popoverLabel` on Combobox, MultiSelect, DatePicker, DateRangePicker,
19
- TimePicker and ColorPicker; `aria-label` / `aria-labelledby` /
20
- `aria-describedby` / `id` on Combobox; `aria-label` / `aria-labelledby` on
21
- InlineInput and ScrollArea; NumberInput `incrementLabel` / `decrementLabel`;
22
- Marquee and TickerTape `pauseControl` + `labels`; TabsContent `tabIndex`;
23
- GanttChartLabels `region`; CompletionDialog `modal`; Pagination `labels`;
24
- AIArtifactLabels `content`; ModelSelector `listLabel`; DataTableFilter
25
- `ariaLabel`; VideoEmbed `playLabel`. (#543)
26
- - **New exports** - `moveRovingFocus` (+ `RovingFocusOptions`,
27
- `RovingOrientation`), `useReturnFocus` (+ `ReturnFocusHandlers`),
28
- `focusCalendarDay`, `CHECKLIST_PROGRESS_EVENT`, `parseChecklistStorageValue`,
29
- `MarqueeLabels`, `TickerTapeLabels`, `PaginationLabels`. Registry items now
30
- import these from `@vllnt/ui`, so installing them needs a `@vllnt/ui` release
31
- that contains them (the registry pins `^0.3.0`, which does not).
32
- `registry:integrity` now fails when a registry item imports a name that
33
- `@vllnt/ui` does not export. (#543)
34
-
35
- ### Changed
36
-
37
- - **Accessibility behaviour changes** (#543):
38
- - Drawer moves focus into its content on open (`autoFocus` now defaults to
39
- `true`; pass `autoFocus={false}` for vaul's previous behaviour).
40
- - CompletionDialog is built on the Radix dialog: it traps focus, closes on
41
- Escape and returns focus to the opener. `modal` (default `true`) maps to
42
- Radix `modal`; `modal={false}` leaves the page behind it interactive.
43
- Shortcuts work only while focus is inside the dialog, an empty string turns
44
- one off, and Enter no longer confirms from any focused element.
45
- - Marquee and TickerTape show a 24px pause/play button by default
46
- (`pauseControl={false}` hides it). It overlays the top-right corner of the
47
- Marquee and the right edge of the TickerTape, and hides under reduced
48
- motion, when nothing moves.
49
- - Pagination renders a `nav` landmark of single links styled as buttons, with
50
- `aria-current="page"` on the current page (it used to nest a button in each
51
- link).
52
- - CodeBlock syntax colours come from the `--vllnt-code-*` CSS variables
53
- (OKLCH channels) instead of JS theme detection. The defaults reach 4.5:1 on
54
- the background in light and dark mode for the default theme and every
55
- preset; override the variables to restyle.
56
- - CommandSeparator renders an `aria-hidden` divider.
57
- - Under `prefers-reduced-motion`, components stop their own decorative
58
- animation and AnimatedText shows its final text at once; loaders marked
59
- `data-motion="essential"` keep spinning, slower. The stylesheet changes
60
- motion only on library components, never on your own elements.
61
- - TabsContent is a tab stop only when the panel holds no focusable element;
62
- the ScrollArea viewport is a tab stop only while its content scrolls.
63
- - TreeView supports Home / End, ArrowRight to the first child and ArrowLeft
64
- to the parent, and keeps the active row in view.
65
13
 
66
14
  ### Fixed
67
15
 
68
16
  - Preserve nested scrolling, reduced-motion behavior and sidebar keyboard focus in the affected Web components.
69
17
  - Forward explicit tab accessibility relationships and label/keyboard handlers without changing default tab navigation.
70
18
  - Emit JSON-LD graph documents and localized Native discovery metadata without advertising unpublished npm packages.
71
- - Accessible names, ARIA structure, APG keyboard patterns (tabs, radio groups,
72
- listbox, tree, dialogs and focus return), reduced motion and hard-coded
73
- palette contrast across the Web components flagged by the #535 audit. (#543)
74
19
 
75
20
  ## [0.3.0] - 2026-06-26
76
21
 
@@ -48,14 +48,7 @@ const DEFAULT_STATUS_ICON = {
48
48
  completed: /* @__PURE__ */ jsx(CheckCircle2, { "aria-hidden": "true", className: "size-4" }),
49
49
  error: /* @__PURE__ */ jsx(AlertTriangle, { "aria-hidden": "true", className: "size-4" }),
50
50
  pending: /* @__PURE__ */ jsx(Circle, { "aria-hidden": "true", className: "size-4" }),
51
- running: /* @__PURE__ */ jsx(
52
- Loader2,
53
- {
54
- "aria-hidden": "true",
55
- className: "size-4 animate-spin motion-reduce:[animation-duration:1.5s]",
56
- "data-motion": "essential"
57
- }
58
- ),
51
+ running: /* @__PURE__ */ jsx(Loader2, { "aria-hidden": "true", className: "size-4 animate-spin" }),
59
52
  skipped: /* @__PURE__ */ jsx(MinusCircle, { "aria-hidden": "true", className: "size-4" })
60
53
  };
61
54
  const StepContext = createContext({ status: "pending" });
@@ -25,7 +25,7 @@ const AIStreamingText = ({
25
25
  "span",
26
26
  {
27
27
  "aria-hidden": "true",
28
- className: "ml-0.5 inline-block animate-pulse text-muted-foreground motion-reduce:animate-none",
28
+ className: "ml-0.5 inline-block animate-pulse text-muted-foreground",
29
29
  children: cursor
30
30
  }
31
31
  ) : null
@@ -73,7 +73,7 @@ const AlertPulse = ({
73
73
  "origin-center",
74
74
  SEVERITY_STROKE[severity],
75
75
  SEVERITY_FILL[severity],
76
- reducedMotion ? null : "animate-ping motion-reduce:animate-none"
76
+ reducedMotion ? null : "animate-ping"
77
77
  ),
78
78
  cx: size / 2,
79
79
  cy: size / 2,
@@ -1,7 +1,6 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import * as React from "react";
4
- import { moveRovingFocus } from "../../../lib/roving-focus.js";
5
4
  import { cn } from "../../../lib/utils.js";
6
5
  function indicatorPosition(button) {
7
6
  if (button === null) {
@@ -13,8 +12,7 @@ function TabButton({
13
12
  active,
14
13
  label,
15
14
  onSelect,
16
- reference,
17
- tabStop
15
+ reference
18
16
  }) {
19
17
  return /* @__PURE__ */ jsx(
20
18
  "button",
@@ -27,7 +25,6 @@ function TabButton({
27
25
  onClick: onSelect,
28
26
  ref: reference,
29
27
  role: "tab",
30
- tabIndex: tabStop ? 0 : -1,
31
28
  type: "button",
32
29
  children: label
33
30
  }
@@ -36,7 +33,6 @@ function TabButton({
36
33
  const AnimatedTabs = ({
37
34
  className,
38
35
  defaultValue,
39
- onKeyDown,
40
36
  onValueChange,
41
37
  ref,
42
38
  tabs,
@@ -55,11 +51,6 @@ const AnimatedTabs = ({
55
51
  setActive(value);
56
52
  onValueChange?.(value);
57
53
  };
58
- const hasActiveTab = tabs.some((tab) => tab.value === active);
59
- const handleKeyDown = (event) => {
60
- onKeyDown?.(event);
61
- moveRovingFocus(event, '[role="tab"]', { activate: true });
62
- };
63
54
  return /* @__PURE__ */ jsxs(
64
55
  "div",
65
56
  {
@@ -67,10 +58,8 @@ const AnimatedTabs = ({
67
58
  "relative inline-flex items-center gap-1 rounded-lg border border-border bg-muted p-1",
68
59
  className
69
60
  ),
70
- onKeyDown: handleKeyDown,
71
61
  ref,
72
62
  role: "tablist",
73
- tabIndex: -1,
74
63
  ...props,
75
64
  children: [
76
65
  /* @__PURE__ */ jsx(
@@ -81,7 +70,7 @@ const AnimatedTabs = ({
81
70
  style: { left: indicator.left, width: indicator.width }
82
71
  }
83
72
  ),
84
- tabs.map((tab, index) => /* @__PURE__ */ jsx(
73
+ tabs.map((tab) => /* @__PURE__ */ jsx(
85
74
  TabButton,
86
75
  {
87
76
  active: tab.value === active,
@@ -95,8 +84,7 @@ const AnimatedTabs = ({
95
84
  } else {
96
85
  buttons.current.set(tab.value, node);
97
86
  }
98
- },
99
- tabStop: tab.value === active || !hasActiveTab && index === 0
87
+ }
100
88
  },
101
89
  tab.value
102
90
  ))
@@ -91,31 +91,12 @@ function buildRevealPlan(direction, length, randomness) {
91
91
  });
92
92
  return revealPlan;
93
93
  }
94
- const REDUCED_MOTION_QUERY = "(prefers-reduced-motion: reduce)";
95
- const COMPLETE = Number.POSITIVE_INFINITY;
96
- function subscribeReducedMotion(onChange) {
97
- const query = typeof window.matchMedia === "function" ? window.matchMedia(REDUCED_MOTION_QUERY) : void 0;
98
- query?.addEventListener("change", onChange);
99
- return () => {
100
- query?.removeEventListener("change", onChange);
101
- };
102
- }
103
- function getReducedMotion() {
104
- return typeof window.matchMedia === "function" && window.matchMedia(REDUCED_MOTION_QUERY).matches;
105
- }
106
- function usePrefersReducedMotion() {
107
- return React.useSyncExternalStore(
108
- subscribeReducedMotion,
109
- getReducedMotion,
110
- () => false
111
- );
112
- }
113
94
  function useRevealProgress(active, length, stagger) {
114
- const [progress, setProgress] = React.useState(() => active ? 0 : COMPLETE);
95
+ const [progress, setProgress] = React.useState(() => active ? 0 : length);
115
96
  const [revealKey, setRevealKey] = React.useState({ active, length, stagger });
116
97
  if (revealKey.active !== active || revealKey.length !== length || revealKey.stagger !== stagger) {
117
98
  setRevealKey({ active, length, stagger });
118
- setProgress(active ? 0 : COMPLETE);
99
+ setProgress(active ? 0 : length);
119
100
  }
120
101
  React.useEffect(() => {
121
102
  if (!active) {
@@ -206,15 +187,13 @@ function useAnimatedTextFrames({
206
187
  variant
207
188
  }) {
208
189
  const isOldSchool = variant !== "reveal";
209
- const reducedMotion = usePrefersReducedMotion();
210
- const animate = isOldSchool && !reducedMotion;
211
190
  const revealPlan = React.useMemo(
212
191
  () => isOldSchool ? buildRevealPlan(direction, segments.length, randomness) : Array.from({ length: segments.length }, (_, index) => index),
213
192
  [direction, isOldSchool, randomness, segments.length]
214
193
  );
215
- const progress = useRevealProgress(animate, segments.length, stagger);
194
+ const progress = useRevealProgress(isOldSchool, segments.length, stagger);
216
195
  const matrixFrame = useMatrixFrame({
217
- active: animate && (variant === "matrix" || variant === "decipher"),
196
+ active: variant === "matrix" || variant === "decipher",
218
197
  progress,
219
198
  randomCharacters,
220
199
  revealPlan,
@@ -245,7 +224,7 @@ function useAnimatedTextFrames({
245
224
  }
246
225
  function getSegmentClasses(variant, isRevealed) {
247
226
  if (variant === "reveal") {
248
- return "inline-block whitespace-pre opacity-0 [animation-duration:var(--vllnt-animated-text-duration)] [animation-fill-mode:forwards] [animation-name:vllnt-animated-text-reveal] [animation-timing-function:cubic-bezier(0.16,1,0.3,1)] motion-reduce:animate-none motion-reduce:opacity-100";
227
+ return "inline-block whitespace-pre opacity-0 [animation-duration:var(--vllnt-animated-text-duration)] [animation-fill-mode:forwards] [animation-name:vllnt-animated-text-reveal] [animation-timing-function:cubic-bezier(0.16,1,0.3,1)]";
249
228
  }
250
229
  if (variant === "matrix" || variant === "decipher") {
251
230
  return cn(
@@ -273,7 +252,7 @@ function AnimatedTextCursor({
273
252
  {
274
253
  "aria-hidden": "true",
275
254
  className: cn(
276
- "ml-0.5 inline-block whitespace-pre font-mono [animation:vllnt-terminal-cursor-blink_1s_steps(1,end)_infinite] motion-reduce:animate-none",
255
+ "ml-0.5 inline-block whitespace-pre font-mono [animation:vllnt-terminal-cursor-blink_1s_steps(1,end)_infinite]",
277
256
  cursorToneClass
278
257
  ),
279
258
  children: cursorChar
@@ -318,6 +297,7 @@ const AnimatedText = ({
318
297
  return /* @__PURE__ */ jsxs(
319
298
  "p",
320
299
  {
300
+ "aria-label": text,
321
301
  className: cn(getContainerClasses(variant), className),
322
302
  ref,
323
303
  style: {
@@ -325,7 +305,6 @@ const AnimatedText = ({
325
305
  },
326
306
  ...props,
327
307
  children: [
328
- /* @__PURE__ */ jsx("span", { className: "sr-only", children: text }),
329
308
  segmentFrames.map((segmentFrame) => /* @__PURE__ */ jsx(
330
309
  "span",
331
310
  {
@@ -1,7 +1,6 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import * as React from "react";
4
- import { useEscapeKey } from "../../../lib/use-escape-key.js";
5
4
  import { cn } from "../../../lib/utils.js";
6
5
  function Tooltip({
7
6
  content,
@@ -28,15 +27,6 @@ const AnimatedTooltip = ({
28
27
  ...props
29
28
  }) => {
30
29
  const [open, setOpen] = React.useState(false);
31
- const close = React.useCallback(() => {
32
- setOpen(false);
33
- }, []);
34
- useEscapeKey(close, {
35
- capture: true,
36
- enabled: open,
37
- preventDefault: true,
38
- stopPropagation: true
39
- });
40
30
  return /* @__PURE__ */ jsxs(
41
31
  "div",
42
32
  {
@@ -16,6 +16,9 @@ const BorderBeam = ({
16
16
  animationDelay: `${delay}s`,
17
17
  animationDirection: reverse ? "reverse" : "normal",
18
18
  animationDuration: `${duration}s`,
19
+ animationIterationCount: "infinite",
20
+ animationName: "vllnt-border-beam-angle",
21
+ animationTimingFunction: "linear",
19
22
  background: `conic-gradient(from var(--vllnt-border-beam-angle, 90deg), transparent 0deg, transparent 220deg, ${colorFrom} 280deg, ${colorTo} 335deg, transparent 360deg)`,
20
23
  borderRadius: "inherit",
21
24
  boxSizing: "border-box",
@@ -31,7 +34,7 @@ const BorderBeam = ({
31
34
  {
32
35
  "aria-hidden": "true",
33
36
  className: cn(
34
- "pointer-events-none absolute inset-0 rounded-[inherit] [animation-name:vllnt-border-beam-angle] [animation-iteration-count:infinite] [animation-timing-function:linear] motion-reduce:animate-none",
37
+ "pointer-events-none absolute inset-0 rounded-[inherit]",
35
38
  className
36
39
  ),
37
40
  ref,
@@ -68,12 +68,11 @@ const BottomActivityStrip = ({
68
68
  {
69
69
  "aria-label": resolvedLabels.region,
70
70
  className: cn(
71
- "flex w-full items-center gap-2 overflow-x-auto rounded-md border border-border bg-background/90 px-2 py-1 text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
71
+ "flex w-full items-center gap-2 overflow-x-auto rounded-md border border-border bg-background/90 px-2 py-1 text-foreground",
72
72
  className
73
73
  ),
74
74
  "data-bottom-activity-strip": true,
75
75
  ref,
76
- tabIndex: 0,
77
76
  ...rest,
78
77
  children: visible.length === 0 ? /* @__PURE__ */ jsx(
79
78
  "span",
@@ -29,13 +29,7 @@ function StepMarkerIcon({
29
29
  return /* @__PURE__ */ jsx(X, { className: "size-3.5" });
30
30
  }
31
31
  if (status === "active") {
32
- return /* @__PURE__ */ jsx(
33
- LoaderCircle,
34
- {
35
- className: "size-3.5 animate-spin motion-reduce:[animation-duration:1.5s]",
36
- "data-motion": "essential"
37
- }
38
- );
32
+ return /* @__PURE__ */ jsx(LoaderCircle, { className: "size-3.5 animate-spin" });
39
33
  }
40
34
  return /* @__PURE__ */ jsx("span", { children: index + 1 });
41
35
  }
@@ -22,10 +22,7 @@ const PinBody = (props) => {
22
22
  STATE_FILL[props.state]
23
23
  ),
24
24
  "data-comment-pin-body": true,
25
- style: useAccent ? {
26
- backgroundColor: `color-mix(in oklab, ${props.accent} 55%, oklch(0 0 0))`,
27
- color: "white"
28
- } : void 0,
25
+ style: useAccent ? { backgroundColor: props.accent, color: "white" } : void 0,
29
26
  children: props.authorInitial ?? "\u2022"
30
27
  }
31
28
  ),
@@ -33,7 +30,7 @@ const PinBody = (props) => {
33
30
  "span",
34
31
  {
35
32
  "aria-hidden": "true",
36
- className: "absolute -right-1 -top-1 inline-flex min-h-[14px] min-w-[14px] items-center justify-center rounded-full bg-red-700 px-1 text-[9px] font-medium text-white",
33
+ className: "absolute -right-1 -top-1 inline-flex min-h-[14px] min-w-[14px] items-center justify-center rounded-full bg-red-500 px-1 text-[9px] font-medium text-white",
37
34
  "data-comment-pin-unread": true,
38
35
  children: props.unread
39
36
  }
@@ -74,7 +71,7 @@ const CommentPin = ({
74
71
  return /* @__PURE__ */ jsx(
75
72
  "div",
76
73
  {
77
- "aria-label": onActivate ? void 0 : ariaLabel,
74
+ "aria-label": ariaLabel,
78
75
  className: cn(
79
76
  "absolute z-30 inline-flex -translate-x-1/2 -translate-y-1/2",
80
77
  className
@@ -82,7 +79,7 @@ const CommentPin = ({
82
79
  "data-comment-pin": true,
83
80
  "data-comment-pin-state": state,
84
81
  ref,
85
- role: onActivate ? void 0 : "img",
82
+ role: "img",
86
83
  style: { left: x, top: y },
87
84
  ...rest,
88
85
  children: onActivate ? /* @__PURE__ */ jsx(
@@ -11,7 +11,7 @@ const variantConfig = {
11
11
  },
12
12
  good: {
13
13
  className: "border-green-500/30 bg-green-500/5",
14
- headerClass: "bg-green-500/10 text-green-800 dark:text-green-300",
14
+ headerClass: "bg-green-500/10 text-green-700 dark:text-green-300",
15
15
  icon: Check,
16
16
  iconClass: "text-green-500"
17
17
  },
@@ -107,7 +107,7 @@ function BeforeAfter({ after, before, title }) {
107
107
  ] }),
108
108
  /* @__PURE__ */ jsx("div", { className: "hidden md:flex items-center justify-center h-full", children: /* @__PURE__ */ jsx(ArrowRight, { className: "size-6 text-muted-foreground" }) }),
109
109
  /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-green-500/30 bg-green-500/5 overflow-hidden", children: [
110
- /* @__PURE__ */ jsxs("div", { className: "px-4 py-2 bg-green-500/10 text-green-800 dark:text-green-300 font-medium text-sm flex items-center gap-2", children: [
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: [
111
111
  /* @__PURE__ */ jsx(Check, { className: "size-4" }),
112
112
  "After"
113
113
  ] }),
@@ -99,15 +99,13 @@ function LessonMeta({
99
99
  }) {
100
100
  const prerequisitesLabel = prerequisites?.length ? `Requires: ${prerequisites.join(", ")}` : null;
101
101
  return /* @__PURE__ */ jsxs("div", { className: "flex flex-shrink-0 items-center gap-2", children: [
102
- prerequisitesLabel ? /* @__PURE__ */ jsxs(
102
+ prerequisitesLabel ? /* @__PURE__ */ jsx(
103
103
  "span",
104
104
  {
105
+ "aria-label": prerequisitesLabel,
105
106
  className: "flex items-center gap-1 text-xs text-muted-foreground",
106
107
  title: prerequisitesLabel,
107
- children: [
108
- /* @__PURE__ */ jsx(Link2, { "aria-hidden": "true", className: "size-3" }),
109
- /* @__PURE__ */ jsx("span", { className: "sr-only", children: prerequisitesLabel })
110
- ]
108
+ children: /* @__PURE__ */ jsx(Link2, { "aria-hidden": "true", className: "size-3" })
111
109
  }
112
110
  ) : null,
113
111
  difficulty ? /* @__PURE__ */ jsx(
@@ -228,7 +226,7 @@ function CurriculumRoot({
228
226
  ] })
229
227
  ] })
230
228
  ] }),
231
- /* @__PURE__ */ jsx("div", { "aria-label": title, className: "divide-y", role: "group", children })
229
+ /* @__PURE__ */ jsx("div", { "aria-label": title, className: "divide-y", children })
232
230
  ]
233
231
  }
234
232
  ) });
@@ -2,34 +2,21 @@
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  import * as React from "react";
4
4
  import { cn } from "../../../lib/utils.js";
5
- function usePointerFollower(follower, enabled) {
6
- const [visible, setVisible] = React.useState(false);
5
+ function usePointerPosition() {
6
+ const [point, setPoint] = React.useState();
7
7
  React.useEffect(() => {
8
8
  if (typeof window === "undefined") {
9
9
  return;
10
10
  }
11
- let frame = null;
12
- let point = { x: 0, y: 0 };
13
- const follow = () => {
14
- frame = null;
15
- setVisible(true);
16
- if (enabled && follower.current) {
17
- follower.current.style.transform = `translate(${point.x}px, ${point.y}px) translate(-50%, -50%)`;
18
- }
19
- };
20
11
  const onMove = (event) => {
21
- point = { x: event.clientX, y: event.clientY };
22
- frame ?? (frame = requestAnimationFrame(follow));
12
+ setPoint({ x: event.clientX, y: event.clientY });
23
13
  };
24
14
  window.addEventListener("pointermove", onMove, { passive: true });
25
15
  return () => {
26
16
  window.removeEventListener("pointermove", onMove);
27
- if (frame !== null) {
28
- cancelAnimationFrame(frame);
29
- }
30
17
  };
31
- }, [enabled, follower]);
32
- return visible;
18
+ }, []);
19
+ return point;
33
20
  }
34
21
  const Cursor = ({
35
22
  className,
@@ -38,46 +25,20 @@ const Cursor = ({
38
25
  style,
39
26
  ...props
40
27
  }) => {
41
- const follower = React.useRef(null);
42
- const visible = usePointerFollower(follower, style?.transform === void 0);
43
- const setReferences = React.useCallback(
44
- (node) => {
45
- follower.current = node;
46
- if (typeof ref === "function") {
47
- const cleanup = ref(node);
48
- return () => {
49
- follower.current = null;
50
- if (typeof cleanup === "function") {
51
- cleanup();
52
- } else {
53
- ref(null);
54
- }
55
- };
56
- }
57
- if (ref) {
58
- ref.current = node;
59
- }
60
- return () => {
61
- follower.current = null;
62
- if (ref) {
63
- ref.current = null;
64
- }
65
- };
66
- },
67
- [ref]
68
- );
28
+ const point = usePointerPosition();
69
29
  return /* @__PURE__ */ jsx(
70
30
  "div",
71
31
  {
72
32
  "aria-hidden": "true",
73
33
  className: cn(
74
34
  "pointer-events-none fixed left-0 top-0 z-50 -translate-x-1/2 -translate-y-1/2 rounded-full border border-foreground bg-foreground/20 backdrop-invert transition-transform duration-100 ease-out motion-reduce:transition-none",
75
- visible ? "opacity-100" : "opacity-0",
35
+ point ? "opacity-100" : "opacity-0",
76
36
  className
77
37
  ),
78
- ref: setReferences,
38
+ ref,
79
39
  style: {
80
40
  height: `${size}px`,
41
+ transform: point ? `translate(${point.x}px, ${point.y}px) translate(-50%, -50%)` : void 0,
81
42
  width: `${size}px`,
82
43
  ...style
83
44
  },
@@ -2,7 +2,7 @@
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  import * as React from "react";
4
4
  import { cn } from "../../../lib/utils.js";
5
- const DockMagnifierContext = React.createContext(null);
5
+ const DockPointerContext = React.createContext(null);
6
6
  function assignRef(ref, node) {
7
7
  if (typeof ref === "function") {
8
8
  ref(node);
@@ -35,74 +35,14 @@ function magnify(distance) {
35
35
  const clamped = Math.min(Math.abs(distance), range);
36
36
  return 1 + 0.5 * (1 - clamped / range);
37
37
  }
38
- function iconScale(icon, pointerX) {
39
- if (pointerX === null) {
40
- return 1;
41
- }
42
- const bounds = icon.getBoundingClientRect();
43
- return magnify(pointerX - (bounds.left + bounds.width / 2));
44
- }
45
- function useDockMagnifier() {
46
- const reduced = usePrefersReducedMotion();
47
- const [icons] = React.useState(() => /* @__PURE__ */ new Set());
48
- const pointerX = React.useRef(null);
49
- const reducedReference = React.useRef(reduced);
50
- const frame = React.useRef(null);
51
- const scheduleUpdate = React.useCallback(() => {
52
- if (frame.current !== null) {
53
- return;
54
- }
55
- frame.current = requestAnimationFrame(() => {
56
- frame.current = null;
57
- const x = reducedReference.current ? null : pointerX.current;
58
- const targets = [...icons];
59
- const scales = targets.map((icon) => iconScale(icon, x));
60
- targets.forEach((icon, index) => {
61
- icon.style.transform = `scale(${scales[index] ?? 1})`;
62
- });
63
- });
64
- }, [icons]);
65
- React.useEffect(() => {
66
- reducedReference.current = reduced;
67
- scheduleUpdate();
68
- }, [reduced, scheduleUpdate]);
69
- React.useEffect(() => {
70
- return () => {
71
- if (frame.current !== null) {
72
- cancelAnimationFrame(frame.current);
73
- frame.current = null;
74
- }
75
- };
76
- }, []);
77
- const magnifier = React.useMemo(
78
- () => ({
79
- register: (icon) => {
80
- icons.add(icon);
81
- scheduleUpdate();
82
- return () => {
83
- icons.delete(icon);
84
- };
85
- }
86
- }),
87
- [icons, scheduleUpdate]
88
- );
89
- const trackPointer = React.useCallback(
90
- (nextPointerX) => {
91
- pointerX.current = nextPointerX;
92
- scheduleUpdate();
93
- },
94
- [scheduleUpdate]
95
- );
96
- return { magnifier, trackPointer };
97
- }
98
38
  const Dock = ({
99
39
  children,
100
40
  className,
101
41
  ref,
102
42
  ...props
103
43
  }) => {
104
- const { magnifier, trackPointer } = useDockMagnifier();
105
- return /* @__PURE__ */ jsx(DockMagnifierContext.Provider, { value: magnifier, children: /* @__PURE__ */ jsx(
44
+ const [pointerX, setPointerX] = React.useState(null);
45
+ return /* @__PURE__ */ jsx(DockPointerContext.Provider, { value: pointerX, children: /* @__PURE__ */ jsx(
106
46
  "div",
107
47
  {
108
48
  className: cn(
@@ -110,10 +50,10 @@ const Dock = ({
110
50
  className
111
51
  ),
112
52
  onPointerLeave: () => {
113
- trackPointer(null);
53
+ setPointerX(null);
114
54
  },
115
55
  onPointerMove: (event) => {
116
- trackPointer(event.clientX);
56
+ setPointerX(event.clientX);
117
57
  },
118
58
  ref,
119
59
  ...props,
@@ -122,6 +62,14 @@ const Dock = ({
122
62
  ) });
123
63
  };
124
64
  Dock.displayName = "Dock";
65
+ function useDockScale(reference, pointerX, reduced) {
66
+ if (reduced || pointerX === null || reference.current === null) {
67
+ return 1;
68
+ }
69
+ const bounds = reference.current.getBoundingClientRect();
70
+ const center = bounds.left + bounds.width / 2;
71
+ return magnify(pointerX - center);
72
+ }
125
73
  const DockIcon = ({
126
74
  children,
127
75
  className,
@@ -129,16 +77,10 @@ const DockIcon = ({
129
77
  style,
130
78
  ...props
131
79
  }) => {
132
- const magnifier = React.use(DockMagnifierContext);
80
+ const pointerX = React.use(DockPointerContext);
81
+ const reduced = usePrefersReducedMotion();
133
82
  const reference = React.useRef(null);
134
- const hasCustomTransform = style?.transform !== void 0;
135
- React.useEffect(() => {
136
- const icon = reference.current;
137
- if (!magnifier || !icon || hasCustomTransform) {
138
- return;
139
- }
140
- return magnifier.register(icon);
141
- }, [hasCustomTransform, magnifier]);
83
+ const scale = useDockScale(reference, pointerX, reduced);
142
84
  const setReferences = React.useCallback(
143
85
  (node) => {
144
86
  reference.current = node;
@@ -154,7 +96,7 @@ const DockIcon = ({
154
96
  className
155
97
  ),
156
98
  ref: setReferences,
157
- style: { transform: "scale(1)", ...style },
99
+ style: { transform: `scale(${scale})`, ...style },
158
100
  ...props,
159
101
  children
160
102
  }
@@ -3,13 +3,11 @@ import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import { Drawer as DrawerPrimitive } from "vaul";
4
4
  import { cn } from "../../../lib/utils.js";
5
5
  const Drawer = ({
6
- autoFocus = true,
7
6
  shouldScaleBackground = true,
8
7
  ...props
9
8
  }) => /* @__PURE__ */ jsx(
10
9
  DrawerPrimitive.Root,
11
10
  {
12
- autoFocus,
13
11
  shouldScaleBackground,
14
12
  ...props
15
13
  }