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

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 +55 -0
  2. package/dist/components/atoms/agent-activity/agent-activity.js +8 -1
  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 +15 -3
  6. package/dist/components/atoms/animated-text/animated-text.js +28 -7
  7. package/dist/components/atoms/animated-tooltip/animated-tooltip.js +10 -0
  8. package/dist/components/atoms/border-beam/border-beam.js +1 -4
  9. package/dist/components/atoms/bottom-activity-strip/bottom-activity-strip.js +2 -1
  10. package/dist/components/atoms/chain-of-thought/chain-of-thought.js +7 -1
  11. package/dist/components/atoms/comment-pin/comment-pin.js +7 -4
  12. package/dist/components/atoms/comparison/comparison.js +2 -2
  13. package/dist/components/atoms/curriculum/curriculum.js +6 -4
  14. package/dist/components/atoms/cursor/cursor.js +48 -9
  15. package/dist/components/atoms/dock/dock.js +75 -17
  16. package/dist/components/atoms/drawer/drawer.js +2 -0
  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 +1 -0
  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 +4 -2
  23. package/dist/components/atoms/liquid-glass/liquid-glass.js +1 -2
  24. package/dist/components/atoms/list-box/list-box.js +55 -4
  25. package/dist/components/atoms/live-cursor/live-cursor.js +9 -4
  26. package/dist/components/atoms/magnetic/magnetic.js +61 -14
  27. package/dist/components/atoms/magnetic-button/magnetic-button.js +61 -14
  28. package/dist/components/atoms/marquee/marquee.js +89 -30
  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 +11 -5
  33. package/dist/components/atoms/particles/particles.js +2 -2
  34. package/dist/components/atoms/playback-ghost/playback-ghost.js +12 -4
  35. package/dist/components/atoms/presence-stack/presence-stack.js +7 -2
  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 +7 -1
  39. package/dist/components/atoms/property-section/property-section.js +1 -1
  40. package/dist/components/atoms/qr-code/qr-code.js +27 -3
  41. package/dist/components/atoms/rating/rating.js +11 -0
  42. package/dist/components/atoms/reasoning/reasoning.js +16 -7
  43. package/dist/components/atoms/scramble-text/scramble-text.js +5 -11
  44. package/dist/components/atoms/scroll-area/scroll-area.js +55 -13
  45. package/dist/components/atoms/scroll-progress/scroll-progress.js +11 -2
  46. package/dist/components/atoms/search-field/search-field.js +2 -2
  47. package/dist/components/atoms/selection-halo/selection-halo.js +10 -2
  48. package/dist/components/atoms/selection-presence/selection-presence.js +3 -1
  49. package/dist/components/atoms/severity-badge/severity-badge.js +10 -10
  50. package/dist/components/atoms/shine-border/shine-border.js +1 -4
  51. package/dist/components/atoms/skeleton/skeleton.js +4 -1
  52. package/dist/components/atoms/slider/slider.js +12 -1
  53. package/dist/components/atoms/snap-guides/snap-guides.js +1 -0
  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 +2 -1
  57. package/dist/components/atoms/spinning-text/spinning-text.js +14 -12
  58. package/dist/components/atoms/spotlight-card/spotlight-card.js +35 -11
  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 +106 -11
  63. package/dist/components/atoms/text-reveal/text-reveal.js +32 -17
  64. package/dist/components/atoms/theme-switcher/theme-switcher.js +12 -1
  65. package/dist/components/atoms/thinking-block/thinking-block.js +9 -7
  66. package/dist/components/atoms/thread-bubble/thread-bubble.js +3 -1
  67. package/dist/components/atoms/tilt-card/tilt-card.js +63 -18
  68. package/dist/components/atoms/tldr-section/tldr-section.js +11 -6
  69. package/dist/components/atoms/toast/sonner-toast.js +4 -0
  70. package/dist/components/atoms/toast/toast.js +15 -16
  71. package/dist/components/atoms/toast/toaster.js +7 -1
  72. package/dist/components/atoms/typewriter/typewriter.js +2 -1
  73. package/dist/components/atoms/video-embed/video-embed.js +2 -0
  74. package/dist/components/atoms/view-switcher/view-switcher.js +54 -43
  75. package/dist/components/atoms/watchlist/watchlist.js +8 -7
  76. package/dist/components/atoms/workspace-switcher/workspace-switcher.js +39 -10
  77. package/dist/components/index.js +13 -5
  78. package/dist/components/molecules/ai-artifact/ai-artifact.js +5 -1
  79. package/dist/components/molecules/ai-chat-input/ai-chat-input.js +7 -1
  80. package/dist/components/molecules/ai-tool-call-display/ai-tool-call-display.js +1 -1
  81. package/dist/components/molecules/color-picker/color-picker.js +45 -36
  82. package/dist/components/molecules/command/command.js +33 -14
  83. package/dist/components/molecules/completion-dialog/completion-dialog.js +91 -132
  84. package/dist/components/molecules/content-intro/content-intro.js +1 -1
  85. package/dist/components/molecules/conversation-thread/conversation-thread.js +5 -4
  86. package/dist/components/molecules/copy-button/copy-button.js +4 -44
  87. package/dist/components/molecules/copy-button/use-copy-to-clipboard.js +42 -0
  88. package/dist/components/molecules/exercise/exercise.js +3 -3
  89. package/dist/components/molecules/file-upload/file-upload.js +28 -34
  90. package/dist/components/molecules/historical-figure-card/historical-figure-card.js +1 -1
  91. package/dist/components/molecules/inline-input/inline-input.js +4 -0
  92. package/dist/components/molecules/live-feed/live-feed.js +1 -1
  93. package/dist/components/molecules/newsletter-signup/newsletter-signup.js +8 -1
  94. package/dist/components/molecules/number-input/number-input.js +6 -0
  95. package/dist/components/molecules/pagination/pagination.js +44 -12
  96. package/dist/components/molecules/progress-card/progress-card.js +8 -6
  97. package/dist/components/molecules/search-bar/search-bar.js +9 -5
  98. package/dist/components/molecules/stat-card/stat-card.js +2 -2
  99. package/dist/components/molecules/ticker-tape/ticker-tape.js +38 -10
  100. package/dist/components/molecules/time-picker/time-picker.js +65 -26
  101. package/dist/components/molecules/tour/tour.js +14 -6
  102. package/dist/components/molecules/transaction-list/transaction-list.js +1 -1
  103. package/dist/components/molecules/tutorial-card/tutorial-card.js +8 -6
  104. package/dist/components/organisms/candlestick-chart/candlestick-chart.js +2 -2
  105. package/dist/components/organisms/canvas-view/canvas-view.js +10 -14
  106. package/dist/components/organisms/choropleth-map/choropleth-map.js +9 -2
  107. package/dist/components/organisms/chronological-timeline/chronological-timeline.js +2 -4
  108. package/dist/components/organisms/code-block/code-block.js +43 -16
  109. package/dist/components/organisms/code-playground/code-playground.js +9 -2
  110. package/dist/components/organisms/combobox/combobox.js +25 -7
  111. package/dist/components/organisms/data-table/data-table.js +8 -1
  112. package/dist/components/organisms/date-picker/date-picker.js +20 -8
  113. package/dist/components/organisms/date-range-picker/date-range-picker.js +20 -8
  114. package/dist/components/organisms/flow-diagram/flow-canvas.js +3 -0
  115. package/dist/components/organisms/flow-diagram/flow-controls.js +7 -1
  116. package/dist/components/organisms/flow-diagram/use-flow-diagram.js +25 -11
  117. package/dist/components/organisms/gantt-chart/gantt-chart.js +6 -2
  118. package/dist/components/organisms/geography-quiz-map/geography-quiz-map.js +43 -20
  119. package/dist/components/organisms/globe-3d/globe-3d.js +1 -1
  120. package/dist/components/organisms/historic-timeline/historic-timeline.js +1 -1
  121. package/dist/components/organisms/interactive-timeline/interactive-timeline.js +6 -6
  122. package/dist/components/organisms/map-2d/map-2d.js +2 -0
  123. package/dist/components/organisms/market-treemap/market-treemap.js +1 -1
  124. package/dist/components/organisms/model-selector/model-selector.js +57 -40
  125. package/dist/components/organisms/multi-select/multi-select.js +14 -1
  126. package/dist/components/organisms/parallel-timeline/parallel-timeline.js +2 -1
  127. package/dist/components/organisms/primary-source-viewer/primary-source-viewer.js +1 -1
  128. package/dist/components/organisms/run-timeline/run-timeline.js +2 -2
  129. package/dist/components/organisms/share-dialog/share-dialog.js +39 -25
  130. package/dist/components/organisms/slideshow/slideshow.js +13 -1
  131. package/dist/components/organisms/static-code/static-code-copy.js +1 -1
  132. package/dist/components/organisms/terminal/terminal.js +1 -1
  133. package/dist/components/organisms/tree-view/tree-view.js +41 -4
  134. package/dist/components/organisms/tutorial-mdx/tutorial-mdx.js +7 -6
  135. package/dist/index.d.ts +323 -71
  136. package/dist/index.js +10 -0
  137. package/dist/lib/focus-calendar-day.js +13 -0
  138. package/dist/lib/roving-focus.js +70 -0
  139. package/dist/lib/use-escape-key.js +6 -3
  140. package/dist/lib/use-return-focus.js +23 -0
  141. package/package.json +7 -4
  142. package/styles.css +29 -0
package/CHANGELOG.md CHANGED
@@ -10,12 +10,67 @@ 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.
13
65
 
14
66
  ### Fixed
15
67
 
16
68
  - Preserve nested scrolling, reduced-motion behavior and sidebar keyboard focus in the affected Web components.
17
69
  - Forward explicit tab accessibility relationships and label/keyboard handlers without changing default tab navigation.
18
70
  - 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)
19
74
 
20
75
  ## [0.3.0] - 2026-06-26
21
76
 
@@ -48,7 +48,14 @@ 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(Loader2, { "aria-hidden": "true", className: "size-4 animate-spin" }),
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
+ ),
52
59
  skipped: /* @__PURE__ */ jsx(MinusCircle, { "aria-hidden": "true", className: "size-4" })
53
60
  };
54
61
  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",
28
+ className: "ml-0.5 inline-block animate-pulse text-muted-foreground motion-reduce:animate-none",
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"
76
+ reducedMotion ? null : "animate-ping motion-reduce:animate-none"
77
77
  ),
78
78
  cx: size / 2,
79
79
  cy: size / 2,
@@ -1,6 +1,7 @@
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";
4
5
  import { cn } from "../../../lib/utils.js";
5
6
  function indicatorPosition(button) {
6
7
  if (button === null) {
@@ -12,7 +13,8 @@ function TabButton({
12
13
  active,
13
14
  label,
14
15
  onSelect,
15
- reference
16
+ reference,
17
+ tabStop
16
18
  }) {
17
19
  return /* @__PURE__ */ jsx(
18
20
  "button",
@@ -25,6 +27,7 @@ function TabButton({
25
27
  onClick: onSelect,
26
28
  ref: reference,
27
29
  role: "tab",
30
+ tabIndex: tabStop ? 0 : -1,
28
31
  type: "button",
29
32
  children: label
30
33
  }
@@ -33,6 +36,7 @@ function TabButton({
33
36
  const AnimatedTabs = ({
34
37
  className,
35
38
  defaultValue,
39
+ onKeyDown,
36
40
  onValueChange,
37
41
  ref,
38
42
  tabs,
@@ -51,6 +55,11 @@ const AnimatedTabs = ({
51
55
  setActive(value);
52
56
  onValueChange?.(value);
53
57
  };
58
+ const hasActiveTab = tabs.some((tab) => tab.value === active);
59
+ const handleKeyDown = (event) => {
60
+ onKeyDown?.(event);
61
+ moveRovingFocus(event, '[role="tab"]', { activate: true });
62
+ };
54
63
  return /* @__PURE__ */ jsxs(
55
64
  "div",
56
65
  {
@@ -58,8 +67,10 @@ const AnimatedTabs = ({
58
67
  "relative inline-flex items-center gap-1 rounded-lg border border-border bg-muted p-1",
59
68
  className
60
69
  ),
70
+ onKeyDown: handleKeyDown,
61
71
  ref,
62
72
  role: "tablist",
73
+ tabIndex: -1,
63
74
  ...props,
64
75
  children: [
65
76
  /* @__PURE__ */ jsx(
@@ -70,7 +81,7 @@ const AnimatedTabs = ({
70
81
  style: { left: indicator.left, width: indicator.width }
71
82
  }
72
83
  ),
73
- tabs.map((tab) => /* @__PURE__ */ jsx(
84
+ tabs.map((tab, index) => /* @__PURE__ */ jsx(
74
85
  TabButton,
75
86
  {
76
87
  active: tab.value === active,
@@ -84,7 +95,8 @@ const AnimatedTabs = ({
84
95
  } else {
85
96
  buttons.current.set(tab.value, node);
86
97
  }
87
- }
98
+ },
99
+ tabStop: tab.value === active || !hasActiveTab && index === 0
88
100
  },
89
101
  tab.value
90
102
  ))
@@ -91,12 +91,31 @@ 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
+ }
94
113
  function useRevealProgress(active, length, stagger) {
95
- const [progress, setProgress] = React.useState(() => active ? 0 : length);
114
+ const [progress, setProgress] = React.useState(() => active ? 0 : COMPLETE);
96
115
  const [revealKey, setRevealKey] = React.useState({ active, length, stagger });
97
116
  if (revealKey.active !== active || revealKey.length !== length || revealKey.stagger !== stagger) {
98
117
  setRevealKey({ active, length, stagger });
99
- setProgress(active ? 0 : length);
118
+ setProgress(active ? 0 : COMPLETE);
100
119
  }
101
120
  React.useEffect(() => {
102
121
  if (!active) {
@@ -187,13 +206,15 @@ function useAnimatedTextFrames({
187
206
  variant
188
207
  }) {
189
208
  const isOldSchool = variant !== "reveal";
209
+ const reducedMotion = usePrefersReducedMotion();
210
+ const animate = isOldSchool && !reducedMotion;
190
211
  const revealPlan = React.useMemo(
191
212
  () => isOldSchool ? buildRevealPlan(direction, segments.length, randomness) : Array.from({ length: segments.length }, (_, index) => index),
192
213
  [direction, isOldSchool, randomness, segments.length]
193
214
  );
194
- const progress = useRevealProgress(isOldSchool, segments.length, stagger);
215
+ const progress = useRevealProgress(animate, segments.length, stagger);
195
216
  const matrixFrame = useMatrixFrame({
196
- active: variant === "matrix" || variant === "decipher",
217
+ active: animate && (variant === "matrix" || variant === "decipher"),
197
218
  progress,
198
219
  randomCharacters,
199
220
  revealPlan,
@@ -224,7 +245,7 @@ function useAnimatedTextFrames({
224
245
  }
225
246
  function getSegmentClasses(variant, isRevealed) {
226
247
  if (variant === "reveal") {
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)]";
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";
228
249
  }
229
250
  if (variant === "matrix" || variant === "decipher") {
230
251
  return cn(
@@ -252,7 +273,7 @@ function AnimatedTextCursor({
252
273
  {
253
274
  "aria-hidden": "true",
254
275
  className: cn(
255
- "ml-0.5 inline-block whitespace-pre font-mono [animation:vllnt-terminal-cursor-blink_1s_steps(1,end)_infinite]",
276
+ "ml-0.5 inline-block whitespace-pre font-mono [animation:vllnt-terminal-cursor-blink_1s_steps(1,end)_infinite] motion-reduce:animate-none",
256
277
  cursorToneClass
257
278
  ),
258
279
  children: cursorChar
@@ -297,7 +318,6 @@ const AnimatedText = ({
297
318
  return /* @__PURE__ */ jsxs(
298
319
  "p",
299
320
  {
300
- "aria-label": text,
301
321
  className: cn(getContainerClasses(variant), className),
302
322
  ref,
303
323
  style: {
@@ -305,6 +325,7 @@ const AnimatedText = ({
305
325
  },
306
326
  ...props,
307
327
  children: [
328
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: text }),
308
329
  segmentFrames.map((segmentFrame) => /* @__PURE__ */ jsx(
309
330
  "span",
310
331
  {
@@ -1,6 +1,7 @@
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";
4
5
  import { cn } from "../../../lib/utils.js";
5
6
  function Tooltip({
6
7
  content,
@@ -27,6 +28,15 @@ const AnimatedTooltip = ({
27
28
  ...props
28
29
  }) => {
29
30
  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
+ });
30
40
  return /* @__PURE__ */ jsxs(
31
41
  "div",
32
42
  {
@@ -16,9 +16,6 @@ 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",
22
19
  background: `conic-gradient(from var(--vllnt-border-beam-angle, 90deg), transparent 0deg, transparent 220deg, ${colorFrom} 280deg, ${colorTo} 335deg, transparent 360deg)`,
23
20
  borderRadius: "inherit",
24
21
  boxSizing: "border-box",
@@ -34,7 +31,7 @@ const BorderBeam = ({
34
31
  {
35
32
  "aria-hidden": "true",
36
33
  className: cn(
37
- "pointer-events-none absolute inset-0 rounded-[inherit]",
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",
38
35
  className
39
36
  ),
40
37
  ref,
@@ -68,11 +68,12 @@ 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",
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",
72
72
  className
73
73
  ),
74
74
  "data-bottom-activity-strip": true,
75
75
  ref,
76
+ tabIndex: 0,
76
77
  ...rest,
77
78
  children: visible.length === 0 ? /* @__PURE__ */ jsx(
78
79
  "span",
@@ -29,7 +29,13 @@ function StepMarkerIcon({
29
29
  return /* @__PURE__ */ jsx(X, { className: "size-3.5" });
30
30
  }
31
31
  if (status === "active") {
32
- return /* @__PURE__ */ jsx(LoaderCircle, { className: "size-3.5 animate-spin" });
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
+ );
33
39
  }
34
40
  return /* @__PURE__ */ jsx("span", { children: index + 1 });
35
41
  }
@@ -22,7 +22,10 @@ const PinBody = (props) => {
22
22
  STATE_FILL[props.state]
23
23
  ),
24
24
  "data-comment-pin-body": true,
25
- style: useAccent ? { backgroundColor: props.accent, color: "white" } : void 0,
25
+ style: useAccent ? {
26
+ backgroundColor: `color-mix(in oklab, ${props.accent} 55%, oklch(0 0 0))`,
27
+ color: "white"
28
+ } : void 0,
26
29
  children: props.authorInitial ?? "\u2022"
27
30
  }
28
31
  ),
@@ -30,7 +33,7 @@ const PinBody = (props) => {
30
33
  "span",
31
34
  {
32
35
  "aria-hidden": "true",
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",
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",
34
37
  "data-comment-pin-unread": true,
35
38
  children: props.unread
36
39
  }
@@ -71,7 +74,7 @@ const CommentPin = ({
71
74
  return /* @__PURE__ */ jsx(
72
75
  "div",
73
76
  {
74
- "aria-label": ariaLabel,
77
+ "aria-label": onActivate ? void 0 : ariaLabel,
75
78
  className: cn(
76
79
  "absolute z-30 inline-flex -translate-x-1/2 -translate-y-1/2",
77
80
  className
@@ -79,7 +82,7 @@ const CommentPin = ({
79
82
  "data-comment-pin": true,
80
83
  "data-comment-pin-state": state,
81
84
  ref,
82
- role: "img",
85
+ role: onActivate ? void 0 : "img",
83
86
  style: { left: x, top: y },
84
87
  ...rest,
85
88
  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-700 dark:text-green-300",
14
+ headerClass: "bg-green-500/10 text-green-800 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-700 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-800 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,13 +99,15 @@ 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__ */ jsx(
102
+ prerequisitesLabel ? /* @__PURE__ */ jsxs(
103
103
  "span",
104
104
  {
105
- "aria-label": prerequisitesLabel,
106
105
  className: "flex items-center gap-1 text-xs text-muted-foreground",
107
106
  title: prerequisitesLabel,
108
- children: /* @__PURE__ */ jsx(Link2, { "aria-hidden": "true", className: "size-3" })
107
+ children: [
108
+ /* @__PURE__ */ jsx(Link2, { "aria-hidden": "true", className: "size-3" }),
109
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: prerequisitesLabel })
110
+ ]
109
111
  }
110
112
  ) : null,
111
113
  difficulty ? /* @__PURE__ */ jsx(
@@ -226,7 +228,7 @@ function CurriculumRoot({
226
228
  ] })
227
229
  ] })
228
230
  ] }),
229
- /* @__PURE__ */ jsx("div", { "aria-label": title, className: "divide-y", children })
231
+ /* @__PURE__ */ jsx("div", { "aria-label": title, className: "divide-y", role: "group", children })
230
232
  ]
231
233
  }
232
234
  ) });
@@ -2,21 +2,34 @@
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 usePointerPosition() {
6
- const [point, setPoint] = React.useState();
5
+ function usePointerFollower(follower, enabled) {
6
+ const [visible, setVisible] = React.useState(false);
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
+ };
11
20
  const onMove = (event) => {
12
- setPoint({ x: event.clientX, y: event.clientY });
21
+ point = { x: event.clientX, y: event.clientY };
22
+ frame ?? (frame = requestAnimationFrame(follow));
13
23
  };
14
24
  window.addEventListener("pointermove", onMove, { passive: true });
15
25
  return () => {
16
26
  window.removeEventListener("pointermove", onMove);
27
+ if (frame !== null) {
28
+ cancelAnimationFrame(frame);
29
+ }
17
30
  };
18
- }, []);
19
- return point;
31
+ }, [enabled, follower]);
32
+ return visible;
20
33
  }
21
34
  const Cursor = ({
22
35
  className,
@@ -25,20 +38,46 @@ const Cursor = ({
25
38
  style,
26
39
  ...props
27
40
  }) => {
28
- const point = usePointerPosition();
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
+ );
29
69
  return /* @__PURE__ */ jsx(
30
70
  "div",
31
71
  {
32
72
  "aria-hidden": "true",
33
73
  className: cn(
34
74
  "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",
35
- point ? "opacity-100" : "opacity-0",
75
+ visible ? "opacity-100" : "opacity-0",
36
76
  className
37
77
  ),
38
- ref,
78
+ ref: setReferences,
39
79
  style: {
40
80
  height: `${size}px`,
41
- transform: point ? `translate(${point.x}px, ${point.y}px) translate(-50%, -50%)` : void 0,
42
81
  width: `${size}px`,
43
82
  ...style
44
83
  },
@@ -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 DockPointerContext = React.createContext(null);
5
+ const DockMagnifierContext = React.createContext(null);
6
6
  function assignRef(ref, node) {
7
7
  if (typeof ref === "function") {
8
8
  ref(node);
@@ -35,14 +35,74 @@ 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
+ }
38
98
  const Dock = ({
39
99
  children,
40
100
  className,
41
101
  ref,
42
102
  ...props
43
103
  }) => {
44
- const [pointerX, setPointerX] = React.useState(null);
45
- return /* @__PURE__ */ jsx(DockPointerContext.Provider, { value: pointerX, children: /* @__PURE__ */ jsx(
104
+ const { magnifier, trackPointer } = useDockMagnifier();
105
+ return /* @__PURE__ */ jsx(DockMagnifierContext.Provider, { value: magnifier, children: /* @__PURE__ */ jsx(
46
106
  "div",
47
107
  {
48
108
  className: cn(
@@ -50,10 +110,10 @@ const Dock = ({
50
110
  className
51
111
  ),
52
112
  onPointerLeave: () => {
53
- setPointerX(null);
113
+ trackPointer(null);
54
114
  },
55
115
  onPointerMove: (event) => {
56
- setPointerX(event.clientX);
116
+ trackPointer(event.clientX);
57
117
  },
58
118
  ref,
59
119
  ...props,
@@ -62,14 +122,6 @@ const Dock = ({
62
122
  ) });
63
123
  };
64
124
  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
- }
73
125
  const DockIcon = ({
74
126
  children,
75
127
  className,
@@ -77,10 +129,16 @@ const DockIcon = ({
77
129
  style,
78
130
  ...props
79
131
  }) => {
80
- const pointerX = React.use(DockPointerContext);
81
- const reduced = usePrefersReducedMotion();
132
+ const magnifier = React.use(DockMagnifierContext);
82
133
  const reference = React.useRef(null);
83
- const scale = useDockScale(reference, pointerX, reduced);
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]);
84
142
  const setReferences = React.useCallback(
85
143
  (node) => {
86
144
  reference.current = node;
@@ -96,7 +154,7 @@ const DockIcon = ({
96
154
  className
97
155
  ),
98
156
  ref: setReferences,
99
- style: { transform: `scale(${scale})`, ...style },
157
+ style: { transform: "scale(1)", ...style },
100
158
  ...props,
101
159
  children
102
160
  }
@@ -3,11 +3,13 @@ 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,
6
7
  shouldScaleBackground = true,
7
8
  ...props
8
9
  }) => /* @__PURE__ */ jsx(
9
10
  DrawerPrimitive.Root,
10
11
  {
12
+ autoFocus,
11
13
  shouldScaleBackground,
12
14
  ...props
13
15
  }