@vllnt/ui 0.4.0-canary.sha4d4d033 → 0.4.0-canary.sha51bf862
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.
- package/CHANGELOG.md +117 -1
- package/README.md +62 -8
- package/dist/components/atoms/accordion/accordion.js +1 -0
- package/dist/components/atoms/agent-activity/agent-activity.js +8 -1
- package/dist/components/atoms/ai-streaming-text/ai-streaming-text.js +1 -1
- package/dist/components/atoms/alert-pulse/alert-pulse.js +1 -1
- package/dist/components/atoms/animated-tabs/animated-tabs.js +15 -3
- package/dist/components/atoms/animated-text/animated-text.js +28 -7
- package/dist/components/atoms/animated-tooltip/animated-tooltip.js +10 -0
- package/dist/components/atoms/border-beam/border-beam.js +1 -4
- package/dist/components/atoms/bottom-activity-strip/bottom-activity-strip.js +2 -1
- package/dist/components/atoms/breadcrumb/breadcrumb.js +1 -1
- package/dist/components/atoms/chain-of-thought/chain-of-thought.js +7 -1
- package/dist/components/atoms/checklist/checklist.js +4 -1
- package/dist/components/atoms/comment-pin/comment-pin.js +7 -4
- package/dist/components/atoms/comparison/comparison.js +40 -26
- package/dist/components/atoms/curriculum/curriculum.js +7 -5
- package/dist/components/atoms/cursor/cursor.js +48 -9
- package/dist/components/atoms/dock/dock.js +75 -17
- package/dist/components/atoms/drawer/drawer.js +2 -0
- package/dist/components/atoms/era-comparison/era-comparison.js +1 -1
- package/dist/components/atoms/follow-mode/follow-mode.js +6 -6
- package/dist/components/atoms/glass-progress/glass-progress.js +1 -0
- package/dist/components/atoms/handoff-beacon/handoff-beacon.js +1 -1
- package/dist/components/atoms/input-otp/input-otp.js +1 -1
- package/dist/components/atoms/key-concept/key-concept.js +4 -2
- package/dist/components/atoms/keyboard-shortcuts-help/keyboard-shortcuts-help.js +7 -2
- package/dist/components/atoms/learning-objectives/learning-objectives.js +24 -10
- package/dist/components/atoms/liquid-glass/liquid-glass.js +1 -2
- package/dist/components/atoms/list-box/list-box.js +55 -4
- package/dist/components/atoms/live-cursor/live-cursor.js +9 -4
- package/dist/components/atoms/magnetic/magnetic.js +61 -14
- package/dist/components/atoms/magnetic-button/magnetic-button.js +61 -14
- package/dist/components/atoms/marquee/marquee.js +89 -30
- package/dist/components/atoms/meteors/meteors.js +2 -2
- package/dist/components/atoms/object-handle/object-handle.js +1 -1
- package/dist/components/atoms/object-inspector/object-inspector.js +1 -1
- package/dist/components/atoms/order-book/order-book.js +13 -7
- package/dist/components/atoms/particles/particles.js +2 -2
- package/dist/components/atoms/playback-ghost/playback-ghost.js +12 -4
- package/dist/components/atoms/presence-stack/presence-stack.js +7 -2
- package/dist/components/atoms/presence-sync-indicator/presence-sync-indicator.js +2 -2
- package/dist/components/atoms/pro-tip/pro-tip.js +3 -0
- package/dist/components/atoms/progress-bar/progress-bar.js +2 -2
- package/dist/components/atoms/prompt-input/prompt-input.js +7 -1
- package/dist/components/atoms/property-section/property-section.js +1 -1
- package/dist/components/atoms/qr-code/qr-code.js +27 -3
- package/dist/components/atoms/quiz/quiz.js +2 -0
- package/dist/components/atoms/rating/rating.js +13 -2
- package/dist/components/atoms/reasoning/reasoning.js +16 -7
- package/dist/components/atoms/scramble-text/scramble-text.js +5 -11
- package/dist/components/atoms/scroll-area/scroll-area.js +55 -13
- package/dist/components/atoms/scroll-progress/scroll-progress.js +11 -2
- package/dist/components/atoms/search-field/search-field.js +2 -2
- package/dist/components/atoms/selection-halo/selection-halo.js +10 -2
- package/dist/components/atoms/selection-presence/selection-presence.js +3 -1
- package/dist/components/atoms/severity-badge/severity-badge.js +10 -10
- package/dist/components/atoms/shine-border/shine-border.js +1 -4
- package/dist/components/atoms/skeleton/skeleton.js +4 -1
- package/dist/components/atoms/slider/slider.js +12 -1
- package/dist/components/atoms/snap-guides/snap-guides.js +1 -0
- package/dist/components/atoms/sparkles/sparkles.js +2 -2
- package/dist/components/atoms/sparkline-grid/sparkline-grid.js +4 -4
- package/dist/components/atoms/spinner/spinner.js +2 -1
- package/dist/components/atoms/spinning-text/spinning-text.js +14 -12
- package/dist/components/atoms/spotlight-card/spotlight-card.js +35 -11
- package/dist/components/atoms/state-badge-overlay/state-badge-overlay.js +2 -2
- package/dist/components/atoms/status-indicator/status-indicator.js +1 -1
- package/dist/components/atoms/step-by-step/step-by-step.js +3 -1
- package/dist/components/atoms/stepper/stepper.js +1 -0
- package/dist/components/atoms/table-of-contents-panel/table-of-contents-panel.js +4 -0
- package/dist/components/atoms/tabs/tabs.js +106 -11
- package/dist/components/atoms/text-reveal/text-reveal.js +32 -17
- package/dist/components/atoms/theme-switcher/theme-switcher.js +12 -1
- package/dist/components/atoms/thinking-block/thinking-block.js +9 -7
- package/dist/components/atoms/thread-bubble/thread-bubble.js +3 -1
- package/dist/components/atoms/tilt-card/tilt-card.js +63 -18
- package/dist/components/atoms/tldr-section/tldr-section.js +11 -6
- package/dist/components/atoms/toast/sonner-toast.js +4 -0
- package/dist/components/atoms/toast/toast.js +15 -16
- package/dist/components/atoms/toast/toaster.js +7 -1
- package/dist/components/atoms/toolbar/toolbar.js +1 -0
- package/dist/components/atoms/typewriter/typewriter.js +2 -1
- package/dist/components/atoms/video-embed/video-embed.js +2 -0
- package/dist/components/atoms/view-switcher/view-switcher.js +54 -43
- package/dist/components/atoms/watchlist/watchlist.js +8 -7
- package/dist/components/atoms/workspace-switcher/workspace-switcher.js +39 -10
- package/dist/components/index.js +13 -5
- package/dist/components/molecules/ai-artifact/ai-artifact.js +5 -1
- package/dist/components/molecules/ai-chat-input/ai-chat-input.js +8 -1
- package/dist/components/molecules/ai-tool-call-display/ai-tool-call-display.js +1 -1
- package/dist/components/molecules/avatar-group/avatar-group.js +1 -1
- package/dist/components/molecules/color-picker/color-picker.js +47 -38
- package/dist/components/molecules/command/command.js +33 -14
- package/dist/components/molecules/completion-dialog/completion-dialog.js +91 -132
- package/dist/components/molecules/connector-edge/connector-edge.js +1 -0
- package/dist/components/molecules/content-intro/content-intro.js +3 -1
- package/dist/components/molecules/conversation-thread/conversation-thread.js +5 -4
- package/dist/components/molecules/copy-button/copy-button.js +4 -44
- package/dist/components/molecules/copy-button/use-copy-to-clipboard.js +42 -0
- package/dist/components/molecules/exercise/exercise.js +3 -3
- package/dist/components/molecules/file-upload/file-upload.js +43 -41
- package/dist/components/molecules/filter-bar/filter-bar.js +3 -3
- package/dist/components/molecules/historical-figure-card/historical-figure-card.js +1 -1
- package/dist/components/molecules/inline-input/inline-input.js +4 -0
- package/dist/components/molecules/live-feed/live-feed.js +1 -1
- package/dist/components/molecules/metric-gauge/metric-gauge.js +2 -2
- package/dist/components/molecules/newsletter-signup/newsletter-signup.js +8 -1
- package/dist/components/molecules/number-input/number-input.js +6 -0
- package/dist/components/molecules/object-card/object-card.js +5 -4
- package/dist/components/molecules/overview-board/overview-board.js +1 -0
- package/dist/components/molecules/pagination/pagination.js +44 -12
- package/dist/components/molecules/progress-card/progress-card.js +18 -8
- package/dist/components/molecules/progress-tracker/progress-tracker.js +40 -32
- package/dist/components/molecules/scope-selector/scope-selector.js +2 -2
- package/dist/components/molecules/search-bar/search-bar.js +15 -9
- package/dist/components/molecules/sidebar/sidebar.js +3 -3
- package/dist/components/molecules/stat-card/stat-card.js +2 -2
- package/dist/components/molecules/status-board/status-board.js +7 -1
- package/dist/components/molecules/ticker-tape/ticker-tape.js +40 -12
- package/dist/components/molecules/time-picker/time-picker.js +65 -26
- package/dist/components/molecules/tour/tour.js +14 -6
- package/dist/components/molecules/transaction-list/transaction-list.js +1 -1
- package/dist/components/molecules/tutorial-card/tutorial-card.js +8 -6
- package/dist/components/molecules/tutorial-filters/tutorial-filters.js +3 -3
- package/dist/components/molecules/zoom-hud/zoom-hud.js +1 -0
- package/dist/components/organisms/candlestick-chart/candlestick-chart.js +4 -4
- package/dist/components/organisms/canvas-view/canvas-view.js +10 -14
- package/dist/components/organisms/chart/bar-chart.js +1 -1
- package/dist/components/organisms/choropleth-map/choropleth-map.js +9 -2
- package/dist/components/organisms/chronological-timeline/chronological-timeline.js +2 -4
- package/dist/components/organisms/code-block/code-block.js +43 -16
- package/dist/components/organisms/code-playground/code-playground.js +9 -2
- package/dist/components/organisms/combobox/combobox.js +25 -7
- package/dist/components/organisms/data-table/data-table.js +39 -19
- package/dist/components/organisms/date-picker/date-picker.js +20 -8
- package/dist/components/organisms/date-range-picker/date-range-picker.js +20 -8
- package/dist/components/organisms/flow-diagram/flow-canvas.js +3 -0
- package/dist/components/organisms/flow-diagram/flow-controls.js +7 -1
- package/dist/components/organisms/flow-diagram/flow-fullscreen.js +5 -1
- package/dist/components/organisms/flow-diagram/use-flow-diagram.js +25 -11
- package/dist/components/organisms/gantt-chart/gantt-chart.js +6 -2
- package/dist/components/organisms/geography-quiz-map/geography-quiz-map.js +43 -20
- package/dist/components/organisms/globe-3d/globe-3d.js +1 -1
- package/dist/components/organisms/historic-timeline/historic-timeline.js +1 -1
- package/dist/components/organisms/interactive-timeline/interactive-timeline.js +6 -6
- package/dist/components/organisms/map-2d/map-2d.js +3 -0
- package/dist/components/organisms/market-treemap/market-treemap.js +9 -2
- package/dist/components/organisms/model-selector/model-selector.js +57 -40
- package/dist/components/organisms/multi-select/multi-select.js +14 -1
- package/dist/components/organisms/parallel-timeline/parallel-timeline.js +2 -1
- package/dist/components/organisms/primary-source-viewer/primary-source-viewer.js +1 -1
- package/dist/components/organisms/run-timeline/run-timeline.js +2 -2
- package/dist/components/organisms/share-dialog/share-dialog.js +39 -25
- package/dist/components/organisms/slideshow/slideshow.js +26 -11
- package/dist/components/organisms/static-code/static-code-copy.js +1 -1
- package/dist/components/organisms/terminal/terminal.js +5 -5
- package/dist/components/organisms/tree-view/tree-view.js +41 -4
- package/dist/components/organisms/tutorial-mdx/tutorial-mdx.js +7 -6
- package/dist/index.d.ts +1082 -798
- package/dist/index.js +14 -0
- package/dist/lib/focus-calendar-day.js +13 -0
- package/dist/lib/roving-focus.js +70 -0
- package/dist/lib/use-escape-key.js +6 -3
- package/dist/lib/use-event-callback.js +15 -0
- package/dist/lib/use-focus-containment.js +74 -0
- package/dist/lib/use-return-focus.js +23 -0
- package/dist/types/side-effect-imports.d.js +0 -0
- package/package.json +70 -70
- package/styles.css +29 -0
package/CHANGELOG.md
CHANGED
|
@@ -6,16 +6,132 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.4.0] - 2026-10-31
|
|
10
|
+
|
|
9
11
|
### Added
|
|
10
12
|
|
|
11
|
-
-
|
|
13
|
+
- **New hooks** - `useFocusContainment` (trap Tab inside a custom modal and
|
|
14
|
+
restore focus on close) and `useEventCallback` (stable callback that always
|
|
15
|
+
calls the latest closure). Registry items import them from `@vllnt/ui`.
|
|
16
|
+
- **Props types exported from the barrel** - `BreadcrumbProps`,
|
|
17
|
+
`CommandDialogProps`, `SheetContentProps`, `CarouselProps`, `CodeBlockProps`,
|
|
18
|
+
`MDXContentProps`, `SidebarProps`, `TableOfContentsProps`,
|
|
19
|
+
`CategoryFilterProps`, `SearchBarProps`, `ShareSectionProps`,
|
|
20
|
+
`SearchDialogProps`, `LangProviderProps`, `ThemeToggleProps`,
|
|
21
|
+
`ProfileSectionProps`, `TLDRSectionProps`, `AreaChartProps`, `BarChartProps`,
|
|
22
|
+
`LineChartProps` and `ThemePresetProviderProps`.
|
|
23
|
+
|
|
24
|
+
- Source-only React Native renderer and shared design contracts (`@vllnt/ui-core`, `@vllnt/ui-native`). They are experimental and not published with this release; installing `@vllnt/ui` is unchanged.
|
|
12
25
|
- Localized Native catalog discovery, dependency/capability comparison, and extensible React/React Native source tabs in a single component preview surface.
|
|
26
|
+
- **Accessibility gate** - the Storybook test-runner runs axe-core (WCAG 2.0,
|
|
27
|
+
2.1 and 2.2, levels A and AA) on every story in the light and dark theme and
|
|
28
|
+
fails on any violation. A story can turn a rule off only through
|
|
29
|
+
`parameters.a11y.config.rules` with a written `reason`. (#543)
|
|
30
|
+
- **Optional accessibility props** (English defaults, nothing required):
|
|
31
|
+
`popoverLabel` on Combobox, MultiSelect, DatePicker, DateRangePicker,
|
|
32
|
+
TimePicker and ColorPicker; `aria-label` / `aria-labelledby` /
|
|
33
|
+
`aria-describedby` / `id` on Combobox; `aria-label` / `aria-labelledby` on
|
|
34
|
+
InlineInput and ScrollArea; NumberInput `incrementLabel` / `decrementLabel`;
|
|
35
|
+
Marquee and TickerTape `pauseControl` + `labels`; TabsContent `tabIndex`;
|
|
36
|
+
GanttChartLabels `region`; CompletionDialog `modal`; Pagination `labels`;
|
|
37
|
+
AIArtifactLabels `content`; ModelSelector `listLabel`; DataTableFilter
|
|
38
|
+
`ariaLabel`; VideoEmbed `playLabel`. (#543)
|
|
39
|
+
- **New exports** - `moveRovingFocus` (+ `RovingFocusOptions`,
|
|
40
|
+
`RovingOrientation`), `useReturnFocus` (+ `ReturnFocusHandlers`),
|
|
41
|
+
`focusCalendarDay`, `CHECKLIST_PROGRESS_EVENT`, `parseChecklistStorageValue`,
|
|
42
|
+
`MarqueeLabels`, `TickerTapeLabels`, `PaginationLabels`. Registry items now
|
|
43
|
+
import these from `@vllnt/ui`, so installing them needs a `@vllnt/ui` release
|
|
44
|
+
that contains them (the registry pins `^0.3.0`, which does not).
|
|
45
|
+
`registry:integrity` now fails when a registry item imports a name that
|
|
46
|
+
`@vllnt/ui` does not export. (#543)
|
|
47
|
+
|
|
48
|
+
### Changed
|
|
49
|
+
|
|
50
|
+
- **Colour tokens meet WCAG AA** (#538). The default light theme uses a darker
|
|
51
|
+
`--muted-foreground`, `--destructive` and `--input`; in the dark theme
|
|
52
|
+
`--destructive` is lighter with a dark foreground and `--input` is lighter, so
|
|
53
|
+
input borders are easier to see in both. Presets adjust `--primary`,
|
|
54
|
+
`--destructive`, `--input` and `--ring` the same way. Visual snapshots change.
|
|
55
|
+
- **Font tokens on `:root`** - `styles.css` now defines `--font-sans`,
|
|
56
|
+
`--font-display` and `--font-mono` on `:root`. If your app sets variables
|
|
57
|
+
with these names, declare them later in the cascade or on `body` so yours win.
|
|
58
|
+
- **Lighter imports** (#541) - CodeBlock renders its code as plain text first
|
|
59
|
+
and highlights it once the Prism build loads on the client; TutorialMDX loads
|
|
60
|
+
the MDX compiler only for content with JSX, and FlowDiagram loads
|
|
61
|
+
`html-to-image` only when copied. Apps that use neither `toast` nor
|
|
62
|
+
`Toaster` no longer bundle sonner.
|
|
63
|
+
- **Smaller package** - the tarball has 361 files instead of 659: the
|
|
64
|
+
per-component re-export stubs and `dist/test-setup.js` are gone.
|
|
65
|
+
Only the `exports` entry points are public, so imports do not change.
|
|
66
|
+
|
|
67
|
+
- **Peer dependency ranges now match what the package needs.** `next` is
|
|
68
|
+
`>=15.0.0` (Next 14 peers React 18, which the React 19 build cannot use),
|
|
69
|
+
`tailwindcss` is `^3.4.0` (components use `size-*`, `text-balance` and
|
|
70
|
+
`has-[]`, and the preset and CSS are Tailwind v3 only), and `next-themes` is
|
|
71
|
+
now a required peer because the root entry imports it. `next` stays optional
|
|
72
|
+
in metadata, but the root entry still imports `next/link`, `next/image` and
|
|
73
|
+
`next/navigation`, so non-Next apps must alias them (see the README
|
|
74
|
+
workaround). `react` and `react-dom` stay `>=19.0.0`: SearchBar and Slideshow
|
|
75
|
+
no longer call React 19.2's `useEffectEvent`, so 19.0 and 19.1 work.
|
|
76
|
+
|
|
77
|
+
- **Accessibility behaviour changes** (#543):
|
|
78
|
+
- Drawer moves focus into its content on open (`autoFocus` now defaults to
|
|
79
|
+
`true`; pass `autoFocus={false}` for vaul's previous behaviour).
|
|
80
|
+
- CompletionDialog is built on the Radix dialog: it traps focus, closes on
|
|
81
|
+
Escape and returns focus to the opener. `modal` (default `true`) maps to
|
|
82
|
+
Radix `modal`; `modal={false}` leaves the page behind it interactive.
|
|
83
|
+
Shortcuts work only while focus is inside the dialog, an empty string turns
|
|
84
|
+
one off, and Enter no longer confirms from any focused element.
|
|
85
|
+
- Marquee and TickerTape show a 24px pause/play button by default
|
|
86
|
+
(`pauseControl={false}` hides it). It overlays the top-right corner of the
|
|
87
|
+
Marquee and the right edge of the TickerTape, and hides under reduced
|
|
88
|
+
motion, when nothing moves.
|
|
89
|
+
- Pagination renders a `nav` landmark of single links styled as buttons, with
|
|
90
|
+
`aria-current="page"` on the current page (it used to nest a button in each
|
|
91
|
+
link).
|
|
92
|
+
- CodeBlock syntax colours come from the `--vllnt-code-*` CSS variables
|
|
93
|
+
(OKLCH channels) instead of JS theme detection. The defaults reach 4.5:1 on
|
|
94
|
+
the background in light and dark mode for the default theme and every
|
|
95
|
+
preset; override the variables to restyle.
|
|
96
|
+
- CommandSeparator renders an `aria-hidden` divider.
|
|
97
|
+
- Under `prefers-reduced-motion`, components stop their own decorative
|
|
98
|
+
animation and AnimatedText shows its final text at once; loaders marked
|
|
99
|
+
`data-motion="essential"` keep spinning, slower. The stylesheet changes
|
|
100
|
+
motion only on library components, never on your own elements.
|
|
101
|
+
- TabsContent is a tab stop only when the panel holds no focusable element;
|
|
102
|
+
the ScrollArea viewport is a tab stop only while its content scrolls.
|
|
103
|
+
- TreeView supports Home / End, ArrowRight to the first child and ArrowLeft
|
|
104
|
+
to the parent, and keeps the active row in view.
|
|
13
105
|
|
|
14
106
|
### Fixed
|
|
15
107
|
|
|
108
|
+
- **Tailwind preset dependency** - `tailwindcss-animate`, which
|
|
109
|
+
`@vllnt/ui/tailwind-preset` imports, is now a runtime dependency. With 0.3.0
|
|
110
|
+
the preset failed to load unless the app installed it.
|
|
111
|
+
- **Duplicate React keys** - Terminal, FileUpload, AvatarGroup, Breadcrumb and
|
|
112
|
+
about 20 other list renderers no longer key rows by content or label alone,
|
|
113
|
+
so repeated or blank entries stop triggering duplicate-key errors. FileUpload
|
|
114
|
+
adds an identical file (same name, size and lastModified) once, so removal
|
|
115
|
+
removes one entry, and a selection that adds nothing new does not call
|
|
116
|
+
`onFilesChange`.
|
|
117
|
+
- **`"use client"` directives** - Toolbar, Stepper, AIChatInput, ObjectCard,
|
|
118
|
+
OverviewBoard and ZoomHUD use event handlers or browser globals and now carry
|
|
119
|
+
the directive. `check:use-client` also flags handler props and browser globals.
|
|
120
|
+
- **Focus in custom dialogs** - KeyboardShortcutsHelp, TableOfContentsPanel,
|
|
121
|
+
the FlowDiagram fullscreen view and the Slideshow contents panel keep Tab and
|
|
122
|
+
Shift+Tab inside the dialog and return focus to the opener on close.
|
|
123
|
+
- **DataTable** sortable headers expose `aria-sort`.
|
|
124
|
+
- **Contrast** - Rating stars and the green success icons in Checklist,
|
|
125
|
+
Curriculum and LearningObjectives reach 3:1 against the background in light
|
|
126
|
+
and dark themes.
|
|
127
|
+
- **Decorative inline `<svg>` icons** are hidden from assistive technology.
|
|
128
|
+
|
|
16
129
|
- Preserve nested scrolling, reduced-motion behavior and sidebar keyboard focus in the affected Web components.
|
|
17
130
|
- Forward explicit tab accessibility relationships and label/keyboard handlers without changing default tab navigation.
|
|
18
131
|
- Emit JSON-LD graph documents and localized Native discovery metadata without advertising unpublished npm packages.
|
|
132
|
+
- Accessible names, ARIA structure, APG keyboard patterns (tabs, radio groups,
|
|
133
|
+
listbox, tree, dialogs and focus return), reduced motion and hard-coded
|
|
134
|
+
palette contrast across the Web components flagged by the #535 audit. (#543)
|
|
19
135
|
|
|
20
136
|
## [0.3.0] - 2026-06-26
|
|
21
137
|
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @vllnt/ui
|
|
2
2
|
|
|
3
|
-
React component library —
|
|
3
|
+
React component library — 313 components built on Radix UI primitives, Tailwind CSS, and CVA.
|
|
4
4
|
|
|
5
5
|
See [CHANGELOG.md](./CHANGELOG.md) for release history.
|
|
6
6
|
|
|
@@ -15,15 +15,69 @@ pnpm add @vllnt/ui
|
|
|
15
15
|
Required:
|
|
16
16
|
|
|
17
17
|
```bash
|
|
18
|
-
pnpm add react react-dom tailwindcss
|
|
18
|
+
pnpm add react react-dom tailwindcss next-themes
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
`react` and `react-dom` >= 19.0.0, `tailwindcss` ^3.4.0, `next-themes` >= 0.4.0 (a React-only library; it works outside Next.js).
|
|
22
|
+
|
|
23
|
+
Next.js (>= 15.0.0) is an optional peer, but the root entry imports `next/link`, `next/image` and `next/navigation` at module level. Install `next` unless you alias those modules (below).
|
|
22
24
|
|
|
23
25
|
```bash
|
|
24
|
-
pnpm add next
|
|
26
|
+
pnpm add next
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
#### Without Next.js (workaround)
|
|
30
|
+
|
|
31
|
+
Importing anything from `@vllnt/ui` loads every component, including the ones that use `next/*`. In a bundler without Next.js (for example Vite), alias the three modules to small stubs. Verified to build with Vite 7; runtime behaviour of the stubbed components (`Breadcrumb`, `Pagination`, `Sidebar`, `SearchBar`, `NavbarSaas`, ...) is not guaranteed.
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
// vite.config.ts - workaround, not an officially supported setup
|
|
35
|
+
import { fileURLToPath } from "node:url";
|
|
36
|
+
import { defineConfig } from "vite";
|
|
37
|
+
|
|
38
|
+
const stub = (file: string) =>
|
|
39
|
+
fileURLToPath(new URL(`./next-stubs/${file}`, import.meta.url));
|
|
40
|
+
|
|
41
|
+
export default defineConfig({
|
|
42
|
+
resolve: {
|
|
43
|
+
alias: [
|
|
44
|
+
{ find: /^next\/link$/, replacement: stub("link.js") },
|
|
45
|
+
{ find: /^next\/image$/, replacement: stub("image.js") },
|
|
46
|
+
{ find: /^next\/navigation$/, replacement: stub("navigation.js") },
|
|
47
|
+
],
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Stub files (workaround for non-Next bundlers; place them in `next-stubs/`):
|
|
53
|
+
|
|
54
|
+
```jsx
|
|
55
|
+
// next-stubs/link.js
|
|
56
|
+
import { createElement } from "react";
|
|
57
|
+
export default function Link({ href, prefetch, replace, scroll, ...props }) {
|
|
58
|
+
return createElement("a", { href: typeof href === "string" ? href : href?.pathname, ...props });
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
```jsx
|
|
63
|
+
// next-stubs/image.js
|
|
64
|
+
import { createElement } from "react";
|
|
65
|
+
export default function Image({ src, alt = "", fill, priority, quality, placeholder, blurDataURL, loader, unoptimized, ...props }) {
|
|
66
|
+
return createElement("img", { src: typeof src === "string" ? src : src?.src, alt, ...props });
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
```js
|
|
71
|
+
// next-stubs/navigation.js
|
|
72
|
+
export const usePathname = () => "/";
|
|
73
|
+
export const useRouter = () => ({
|
|
74
|
+
push() {}, replace() {}, back() {}, forward() {}, refresh() {}, prefetch() {},
|
|
75
|
+
});
|
|
76
|
+
export const useSearchParams = () => new URLSearchParams();
|
|
25
77
|
```
|
|
26
78
|
|
|
79
|
+
Plain Node ESM import is not supported.
|
|
80
|
+
|
|
27
81
|
## Setup
|
|
28
82
|
|
|
29
83
|
### 1. Tailwind Preset
|
|
@@ -436,10 +490,10 @@ import type {
|
|
|
436
490
|
|
|
437
491
|
## Requirements
|
|
438
492
|
|
|
439
|
-
- React >=
|
|
440
|
-
- Tailwind CSS
|
|
441
|
-
-
|
|
442
|
-
-
|
|
493
|
+
- React >= 19.0.0
|
|
494
|
+
- Tailwind CSS ^3.4.0 (`size-*`, `text-balance` and `has-[...]` utilities need 3.4; Tailwind 4 is not supported)
|
|
495
|
+
- `next-themes` >= 0.4.0 (required peer)
|
|
496
|
+
- Next.js >= 15.0.0 (optional peer, but the root entry imports `next/*`; see Peer Dependencies for the no-Next workaround). Next 14 only supports React 18.
|
|
443
497
|
|
|
444
498
|
## License
|
|
445
499
|
|
|
@@ -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(
|
|
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
|
|
@@ -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 :
|
|
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 :
|
|
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(
|
|
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(
|
|
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
|
}
|
|
@@ -46,7 +46,8 @@ function ChecklistItemRow({
|
|
|
46
46
|
isChecked ? /* @__PURE__ */ jsx(
|
|
47
47
|
"svg",
|
|
48
48
|
{
|
|
49
|
-
|
|
49
|
+
"aria-hidden": "true",
|
|
50
|
+
className: "size-5 text-green-600 dark:text-green-500 flex-shrink-0 mt-0.5",
|
|
50
51
|
fill: "none",
|
|
51
52
|
stroke: "currentColor",
|
|
52
53
|
viewBox: "0 0 24 24",
|
|
@@ -63,6 +64,7 @@ function ChecklistItemRow({
|
|
|
63
64
|
) : /* @__PURE__ */ jsx(
|
|
64
65
|
"svg",
|
|
65
66
|
{
|
|
67
|
+
"aria-hidden": "true",
|
|
66
68
|
className: "size-5 text-muted-foreground flex-shrink-0 mt-0.5",
|
|
67
69
|
fill: "none",
|
|
68
70
|
stroke: "currentColor",
|
|
@@ -103,6 +105,7 @@ function ChecklistHeader({
|
|
|
103
105
|
/* @__PURE__ */ jsx(
|
|
104
106
|
"svg",
|
|
105
107
|
{
|
|
108
|
+
"aria-hidden": "true",
|
|
106
109
|
className: "size-5 text-primary",
|
|
107
110
|
fill: "none",
|
|
108
111
|
stroke: "currentColor",
|
|
@@ -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 ? {
|
|
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-
|
|
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(
|