@vllnt/ui 0.2.0-canary.4abf494 → 0.2.1-canary.06f0e84
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 +46 -1
- package/README.md +27 -12
- package/dist/components/activity-log/activity-log.js +1 -0
- package/dist/components/agent-activity/agent-activity.js +311 -0
- package/dist/components/agent-activity/index.js +18 -0
- package/dist/components/ai-artifact/ai-artifact.js +422 -0
- package/dist/components/ai-artifact/index.js +24 -0
- package/dist/components/ai-sidebar/ai-sidebar.js +254 -0
- package/dist/components/ai-sidebar/index.js +22 -0
- package/dist/components/alert-pulse/alert-pulse.js +93 -0
- package/dist/components/alert-pulse/index.js +6 -0
- package/dist/components/anchor-port/anchor-port.js +51 -0
- package/dist/components/anchor-port/index.js +4 -0
- package/dist/components/animated-text/animated-text.js +1 -0
- package/dist/components/auto-reload/auto-reload.js +367 -0
- package/dist/components/auto-reload/index.js +6 -0
- package/dist/components/banner/banner.js +155 -0
- package/dist/components/banner/index.js +10 -0
- package/dist/components/bottom-activity-strip/bottom-activity-strip.js +91 -0
- package/dist/components/bottom-activity-strip/index.js +6 -0
- package/dist/components/bottom-bar/bottom-bar.js +25 -0
- package/dist/components/bottom-bar/index.js +4 -0
- package/dist/components/canvas-shell/canvas-foundation-demo.js +183 -0
- package/dist/components/canvas-shell/canvas-shell-route-config.js +0 -0
- package/dist/components/canvas-shell/canvas-shell.js +261 -0
- package/dist/components/canvas-shell/index.js +4 -0
- package/dist/components/canvas-view/canvas-view.js +461 -0
- package/dist/components/canvas-view/index.js +6 -0
- package/dist/components/chart/area-chart.js +1 -0
- package/dist/components/chart/line-chart.js +1 -0
- package/dist/components/chat-dock-section/chat-dock-section.js +56 -0
- package/dist/components/chat-dock-section/index.js +6 -0
- package/dist/components/checklist/checklist.js +7 -0
- package/dist/components/checklist/index.js +3 -1
- package/dist/components/choropleth-map/choropleth-map.js +373 -0
- package/dist/components/choropleth-map/index.js +10 -0
- package/dist/components/chronological-timeline/chronological-timeline.js +337 -0
- package/dist/components/chronological-timeline/index.js +8 -0
- package/dist/components/civilization-card/civilization-card.js +258 -0
- package/dist/components/civilization-card/index.js +8 -0
- package/dist/components/combobox/combobox.js +44 -20
- package/dist/components/comment-pin/comment-pin.js +104 -0
- package/dist/components/comment-pin/index.js +6 -0
- package/dist/components/connector-edge/connector-edge.js +66 -0
- package/dist/components/connector-edge/index.js +6 -0
- package/dist/components/context-lens/context-lens.js +98 -0
- package/dist/components/context-lens/index.js +6 -0
- package/dist/components/conversation-thread/conversation-thread.js +348 -0
- package/dist/components/conversation-thread/index.js +20 -0
- package/dist/components/copy-button/copy-button.js +189 -0
- package/dist/components/copy-button/index.js +8 -0
- package/dist/components/curriculum/curriculum.js +349 -0
- package/dist/components/curriculum/index.js +10 -0
- package/dist/components/data-list/data-list.js +1 -0
- package/dist/components/document-sibling-nav/document-sibling-nav.js +111 -0
- package/dist/components/document-sibling-nav/index.js +8 -0
- package/dist/components/edge-label/edge-label.js +26 -0
- package/dist/components/edge-label/index.js +4 -0
- package/dist/components/empty-state/empty-state.js +93 -0
- package/dist/components/empty-state/index.js +8 -0
- package/dist/components/era-comparison/era-comparison.js +198 -0
- package/dist/components/era-comparison/index.js +16 -0
- package/dist/components/floating-toolbar/floating-toolbar.js +66 -0
- package/dist/components/floating-toolbar/index.js +6 -0
- package/dist/components/follow-mode/follow-mode.js +89 -0
- package/dist/components/follow-mode/index.js +6 -0
- package/dist/components/form/form.js +432 -0
- package/dist/components/form/index.js +20 -0
- package/dist/components/gantt-chart/gantt-chart.js +331 -0
- package/dist/components/gantt-chart/index.js +6 -0
- package/dist/components/geography-quiz-map/geography-quiz-map.js +343 -0
- package/dist/components/geography-quiz-map/index.js +12 -0
- package/dist/components/glass-panel/glass-panel.js +21 -0
- package/dist/components/glass-panel/index.js +4 -0
- package/dist/components/globe-3d/globe-3d.js +417 -0
- package/dist/components/globe-3d/index.js +10 -0
- package/dist/components/group-hull/group-hull.js +29 -0
- package/dist/components/group-hull/index.js +4 -0
- package/dist/components/handoff-beacon/handoff-beacon.js +78 -0
- package/dist/components/handoff-beacon/index.js +6 -0
- package/dist/components/heat-map-overlay/heat-map-overlay.js +215 -0
- package/dist/components/heat-map-overlay/index.js +6 -0
- package/dist/components/heat-overlay/heat-overlay.js +92 -0
- package/dist/components/heat-overlay/index.js +6 -0
- package/dist/components/historic-timeline/historic-timeline.js +342 -0
- package/dist/components/historic-timeline/index.js +6 -0
- package/dist/components/historical-figure-card/historical-figure-card.js +273 -0
- package/dist/components/historical-figure-card/index.js +6 -0
- package/dist/components/index.js +568 -1
- package/dist/components/infinite-plane/index.js +6 -0
- package/dist/components/infinite-plane/infinite-plane.js +75 -0
- package/dist/components/interactive-timeline/index.js +16 -0
- package/dist/components/interactive-timeline/interactive-timeline.js +708 -0
- package/dist/components/jarvis-dock/index.js +6 -0
- package/dist/components/jarvis-dock/jarvis-dock.js +98 -0
- package/dist/components/kbd/index.js +5 -0
- package/dist/components/kbd/kbd.js +117 -0
- package/dist/components/knowledge-check/index.js +6 -0
- package/dist/components/knowledge-check/knowledge-check.js +448 -0
- package/dist/components/left-rail/index.js +4 -0
- package/dist/components/left-rail/left-rail.js +25 -0
- package/dist/components/live-cursor/index.js +6 -0
- package/dist/components/live-cursor/live-cursor.js +62 -0
- package/dist/components/map-2d/index.js +20 -0
- package/dist/components/map-2d/map-2d.js +455 -0
- package/dist/components/map-timeline/index.js +16 -0
- package/dist/components/map-timeline/map-timeline.js +506 -0
- package/dist/components/metric-cluster/index.js +6 -0
- package/dist/components/metric-cluster/metric-cluster.js +96 -0
- package/dist/components/mini-map-panel/index.js +6 -0
- package/dist/components/mini-map-panel/mini-map-panel.js +74 -0
- package/dist/components/model-comparison/index.js +12 -0
- package/dist/components/model-comparison/model-comparison.js +211 -0
- package/dist/components/multi-select/index.js +6 -0
- package/dist/components/multi-select/multi-select.js +258 -0
- package/dist/components/multi-select-lasso/index.js +6 -0
- package/dist/components/multi-select-lasso/multi-select-lasso.js +76 -0
- package/dist/components/newsletter-signup/index.js +8 -0
- package/dist/components/newsletter-signup/newsletter-signup.js +269 -0
- package/dist/components/object-card/index.js +6 -0
- package/dist/components/object-card/object-card.js +126 -0
- package/dist/components/object-handle/index.js +4 -0
- package/dist/components/object-handle/object-handle.js +38 -0
- package/dist/components/object-inspector/index.js +6 -0
- package/dist/components/object-inspector/object-inspector.js +136 -0
- package/dist/components/overview-board/index.js +8 -0
- package/dist/components/overview-board/overview-board.js +127 -0
- package/dist/components/parallel-timeline/index.js +6 -0
- package/dist/components/parallel-timeline/parallel-timeline.js +251 -0
- package/dist/components/playback-ghost/index.js +6 -0
- package/dist/components/playback-ghost/playback-ghost.js +83 -0
- package/dist/components/policy-delivery-panel/index.js +6 -0
- package/dist/components/policy-delivery-panel/policy-delivery-panel.js +99 -0
- package/dist/components/presence-stack/index.js +6 -0
- package/dist/components/presence-stack/presence-stack.js +108 -0
- package/dist/components/presence-sync-indicator/index.js +6 -0
- package/dist/components/presence-sync-indicator/presence-sync-indicator.js +73 -0
- package/dist/components/pricing-table/index.js +8 -0
- package/dist/components/pricing-table/pricing-table.js +247 -0
- package/dist/components/primary-source-viewer/index.js +26 -0
- package/dist/components/primary-source-viewer/primary-source-viewer.js +439 -0
- package/dist/components/progress-tracker/index.js +20 -0
- package/dist/components/progress-tracker/progress-tracker.js +527 -0
- package/dist/components/prompt-templates/index.js +6 -0
- package/dist/components/prompt-templates/prompt-templates.js +403 -0
- package/dist/components/property-section/index.js +6 -0
- package/dist/components/property-section/property-section.js +101 -0
- package/dist/components/relationship-inspector/index.js +6 -0
- package/dist/components/relationship-inspector/relationship-inspector.js +102 -0
- package/dist/components/right-dock/index.js +4 -0
- package/dist/components/right-dock/right-dock.js +28 -0
- package/dist/components/route-map/index.js +6 -0
- package/dist/components/route-map/route-map.js +339 -0
- package/dist/components/routing-assignment-panel/index.js +6 -0
- package/dist/components/routing-assignment-panel/routing-assignment-panel.js +122 -0
- package/dist/components/run-timeline/index.js +6 -0
- package/dist/components/run-timeline/run-timeline.js +221 -0
- package/dist/components/runtime-overview-panel/index.js +6 -0
- package/dist/components/runtime-overview-panel/runtime-overview-panel.js +89 -0
- package/dist/components/segmented-control/index.js +12 -0
- package/dist/components/segmented-control/segmented-control.js +61 -0
- package/dist/components/selection-halo/index.js +6 -0
- package/dist/components/selection-halo/selection-halo.js +72 -0
- package/dist/components/selection-presence/index.js +6 -0
- package/dist/components/selection-presence/selection-presence.js +50 -0
- package/dist/components/snap-guides/index.js +6 -0
- package/dist/components/snap-guides/snap-guides.js +45 -0
- package/dist/components/spinner/unicode-spinner.js +1 -0
- package/dist/components/state-badge-overlay/index.js +6 -0
- package/dist/components/state-badge-overlay/state-badge-overlay.js +90 -0
- package/dist/components/sticky-metric/index.js +6 -0
- package/dist/components/sticky-metric/sticky-metric.js +83 -0
- package/dist/components/story-map/index.js +8 -0
- package/dist/components/story-map/story-map.js +414 -0
- package/dist/components/tags-input/index.js +4 -0
- package/dist/components/tags-input/tags-input.js +178 -0
- package/dist/components/thread-bubble/index.js +6 -0
- package/dist/components/thread-bubble/thread-bubble.js +85 -0
- package/dist/components/threshold-ring/index.js +6 -0
- package/dist/components/threshold-ring/threshold-ring.js +160 -0
- package/dist/components/timeline/index.js +12 -0
- package/dist/components/timeline/timeline.js +239 -0
- package/dist/components/timeline-scrubber/index.js +6 -0
- package/dist/components/timeline-scrubber/timeline-scrubber.js +179 -0
- package/dist/components/top-bar/index.js +4 -0
- package/dist/components/top-bar/top-bar.js +31 -0
- package/dist/components/transaction-list/index.js +14 -0
- package/dist/components/transaction-list/transaction-list.js +226 -0
- package/dist/components/tree-view/index.js +6 -0
- package/dist/components/tree-view/tree-view.js +298 -0
- package/dist/components/usage-breakdown/usage-breakdown.js +1 -0
- package/dist/components/viewport-bookmarks/index.js +6 -0
- package/dist/components/viewport-bookmarks/viewport-bookmarks.js +116 -0
- package/dist/components/workspace-switcher/index.js +6 -0
- package/dist/components/workspace-switcher/workspace-switcher.js +61 -0
- package/dist/components/world-breadcrumbs/index.js +6 -0
- package/dist/components/world-breadcrumbs/world-breadcrumbs.js +114 -0
- package/dist/components/zoom-hud/index.js +4 -0
- package/dist/components/zoom-hud/zoom-hud.js +61 -0
- package/dist/index.d.ts +7906 -225
- package/dist/index.js +3 -1
- package/package.json +9 -5
package/CHANGELOG.md
CHANGED
|
@@ -4,11 +4,55 @@ All notable changes to `@vllnt/ui` are documented in this file.
|
|
|
4
4
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
+
## [Unreleased]
|
|
8
|
+
|
|
9
|
+
> Target version: **`0.3.0`** — canary only; not yet published. See [ROADMAP.md](../../ROADMAP.md) for shipping criteria.
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- **Hooks + utility primitives** — `CopyButton` (+ `useCopyToClipboard` hook), `Banner` + `BannerAction`, `Kbd`, `EmptyState`, `DocumentSiblingNav`.
|
|
14
|
+
- **Pricing + identity cards** — `PricingTable` + `PricingPlan`, `HistoricalFigureCard`, `CivilizationCard` (+ `CivilizationComparison`).
|
|
15
|
+
- **Newsletter** — `NewsletterSignup` (state-machine driven submit flow).
|
|
16
|
+
- **AI compound families** — `ModelComparison` (+ `Column`, `Meta`, `Vote`), `PromptTemplates`, `AgentActivity`, `AISidebar`, `AIArtifact`.
|
|
17
|
+
- **Era / financial** — `EraComparison`, `TransactionList`.
|
|
18
|
+
- **Forms** — `Form`, `MultiSelect`, `SegmentedControl`, `TagsInput`, `AutoReload`.
|
|
19
|
+
- **Educational** — `KnowledgeCheck` (inline question runner).
|
|
20
|
+
- **Charts + timelines** — `GanttChart`, `ParallelTimeline`, `Timeline` + `TimelineItem`, `HistoricTimeline`, `InteractiveTimeline`, `ChronologicalTimeline`, `TreeView`.
|
|
21
|
+
- **Document + reading** — `PrimarySourceViewer` compound family.
|
|
22
|
+
- **Maps + geography** — `Map2D`, `ChoroplethMap`, `RouteMap`, `HeatMapOverlay`, `GeographyQuizMap`, `MapTimeline`, `StoryMap`, `Globe3D`.
|
|
23
|
+
- **Canvas foundation** — `CanvasShell`, `CanvasView`, `InfinitePlane`, `ViewportBookmarks`, `WorldBreadcrumbs`, `TopBar`, `LeftRail`, `RightDock`, `ZoomHud`, `MiniMapPanel`, `WorkspaceSwitcher`.
|
|
24
|
+
- **Canvas selection + manipulation** — `SelectionHalo`, `SnapGuides`, `FloatingToolbar`, `MultiSelectLasso`, `FollowMode`, `HandoffBeacon`.
|
|
25
|
+
- **Canvas spatial objects** — `ObjectCard`, `ObjectHandle`, `AnchorPort`, `ConnectorEdge`, `EdgeLabel`, `GroupHull`.
|
|
26
|
+
- **Canvas collaboration primitives** — `LiveCursor`, `CommentPin`, `PresenceSyncIndicator`, `PresenceStack`, `SelectionPresence`, `ThreadBubble`.
|
|
27
|
+
- **Inspector + dock panels** — `PropertySection`, `ObjectInspector`, `RelationshipInspector`, `RuntimeOverviewPanel`, `RoutingAssignmentPanel`, `PolicyDeliveryPanel`.
|
|
28
|
+
- **Runtime overlays** — `AlertPulse`, `ThresholdRing`, `StickyMetric`, `HeatOverlay`, `StateBadgeOverlay`, `MetricCluster`, `JarvisDock`, `ContextLens`.
|
|
29
|
+
- **Time navigation** — `TimelineScrubber`, `PlaybackGhost`, `BottomActivityStrip`, `RunTimeline`.
|
|
30
|
+
- Total component count: **225** (up from 140).
|
|
31
|
+
|
|
32
|
+
### Changed
|
|
33
|
+
|
|
34
|
+
- Registry installs use a **hybrid CLI strategy** — leaf component source is inlined, sibling registry items resolve via `@vllnt/ui` to keep installs minimal and dedupe shared primitives.
|
|
35
|
+
|
|
36
|
+
### Notes
|
|
37
|
+
|
|
38
|
+
- `ROADMAP.md` added at repo root tracking 50 open issues across 8 phases gating the `0.3.0` cut.
|
|
39
|
+
- `0.3.0` requires the codebase-health gate (`react-doctor` CI + 0 errors), the agent-first surface (`/llms.txt`, `/mcp`, sitemap, JSON-LD), and the rebuilt landing page before shipping.
|
|
40
|
+
|
|
41
|
+
## [0.2.1] - 2026-04-21
|
|
42
|
+
|
|
43
|
+
### Fixed
|
|
44
|
+
|
|
45
|
+
- **Public API:** `ProgressCard` now re-exported from `@vllnt/ui` — it shipped in `0.2.0`'s tarball but was missing from the barrel, so `import { ProgressCard } from "@vllnt/ui"` resolved to `undefined`.
|
|
46
|
+
|
|
47
|
+
### Docs
|
|
48
|
+
|
|
49
|
+
- Correct casing for the AI family (`AIChatInput`, `AIMessageBubble`, `AISourceCitation`, `AIStreamingText`, `AIToolCallDisplay`) and `SocialFAB` across README, package README, CHANGELOG, and `llms-full.txt`.
|
|
50
|
+
|
|
7
51
|
## [0.2.0] - 2026-04-21
|
|
8
52
|
|
|
9
53
|
### Added
|
|
10
54
|
|
|
11
|
-
- **AI family** — `
|
|
55
|
+
- **AI family** — `AIChatInput`, `AIMessageBubble`, `AISourceCitation`, `AIStreamingText`, `AIToolCallDisplay`, `ThinkingBlock`, `ModelSelector`.
|
|
12
56
|
- **Financial family** — `CandlestickChart`, `MarketTreemap`, `OrderBook`, `TickerTape`, `SparklineGrid`, `WalletCard`, `Watchlist`.
|
|
13
57
|
- **Ops / Status family** — `StatusBoard`, `StatusIndicator`, `LiveFeed`, `WorldClockBar`, `SeverityBadge`, `RoleBadge`, `ScopeSelector`.
|
|
14
58
|
- **Billing & Plans family** — `SubscriptionCard`, `PlanBadge`, `CreditBadge`, `UsageBreakdown`.
|
|
@@ -96,6 +140,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
|
96
140
|
|
|
97
141
|
- Initial public publish to the public npm registry.
|
|
98
142
|
|
|
143
|
+
[0.2.1]: https://github.com/vllnt/ui/releases/tag/v0.2.1
|
|
99
144
|
[0.2.0]: https://github.com/vllnt/ui/releases/tag/v0.2.0
|
|
100
145
|
[0.1.11]: https://github.com/vllnt/ui/releases/tag/v0.1.11
|
|
101
146
|
[0.1.10]: https://github.com/vllnt/ui/releases/tag/v0.1.10
|
package/README.md
CHANGED
|
@@ -218,7 +218,7 @@ import {
|
|
|
218
218
|
| `Alert` | `{ Alert, AlertTitle, AlertDescription, alertVariants }` | Static alert banner |
|
|
219
219
|
| `Badge` | `{ Badge, badgeVariants }` | Inline status label. Variants: default, secondary, destructive, outline |
|
|
220
220
|
| `Skeleton` | `{ Skeleton }` | Loading placeholder |
|
|
221
|
-
| `Spinner` | `{ Spinner }` |
|
|
221
|
+
| `Spinner` | `{ Spinner, UnicodeSpinner }` | Styled spinner + ASCII-art `UnicodeSpinner` for terminals / code blocks |
|
|
222
222
|
|
|
223
223
|
### Navigation
|
|
224
224
|
|
|
@@ -242,7 +242,7 @@ import {
|
|
|
242
242
|
| `BarChart` | `{ BarChart }` | Chart component |
|
|
243
243
|
| `LineChart` | `{ LineChart }` | Chart component |
|
|
244
244
|
| `CodeBlock` | `{ CodeBlock }` | Syntax-highlighted code via `react-syntax-highlighter` |
|
|
245
|
-
| `FlowDiagram` | `{ FlowDiagram }` | Flow diagram via `@xyflow/react` |
|
|
245
|
+
| `FlowDiagram` | `{ FlowDiagram, FlowControls, FlowFullscreen, FlowErrorBoundary, useFlowDiagram }` | Flow diagram via `@xyflow/react`. Extras: custom controls, fullscreen wrapper, error boundary, and the `useFlowDiagram` hook for imperative access. |
|
|
246
246
|
| `TableOfContents` | `{ TableOfContents }` | Page table of contents |
|
|
247
247
|
|
|
248
248
|
### App Components
|
|
@@ -276,7 +276,10 @@ import {
|
|
|
276
276
|
| `Flashcard` | `{ Flashcard }` | Flip-card for spaced repetition |
|
|
277
277
|
| `Stepper` | `{ Stepper }` | Linear progress stepper |
|
|
278
278
|
| `Tour` | `{ Tour }` | Guided product tour |
|
|
279
|
-
| `Annotation` | `{ Annotation }` | Inline annotation
|
|
279
|
+
| `Annotation` | `{ Annotation, Highlight }` | Inline annotation block + inline `Highlight` span for in-prose emphasis |
|
|
280
|
+
| `LearningObjectives` | `{ LearningObjectives, Prerequisites, Summary }` | Objectives list plus companion `Prerequisites` and `Summary` blocks |
|
|
281
|
+
| `KeyConcept` | `{ KeyConcept, Glossary }` | Concept callout + `Glossary` term list |
|
|
282
|
+
| `Comparison` | `{ Comparison, BeforeAfter }` | Side-by-side compare block + `BeforeAfter` slider |
|
|
280
283
|
| `CompletionDialog` | `{ CompletionDialog }` | End-of-flow celebration dialog |
|
|
281
284
|
| `TruncatedText` | `{ TruncatedText }` | Expand-on-overflow text block |
|
|
282
285
|
| `TableOfContentsPanel` | `{ TableOfContentsPanel }` | Sidebar TOC panel |
|
|
@@ -286,11 +289,11 @@ import {
|
|
|
286
289
|
|
|
287
290
|
| Component | Import | Notes |
|
|
288
291
|
|-----------|--------|-------|
|
|
289
|
-
| `
|
|
290
|
-
| `
|
|
291
|
-
| `
|
|
292
|
-
| `
|
|
293
|
-
| `
|
|
292
|
+
| `AIChatInput` | `{ AIChatInput }` | Chat composer with submit + attachments |
|
|
293
|
+
| `AIMessageBubble` | `{ AIMessageBubble }` | User/assistant message bubble |
|
|
294
|
+
| `AIStreamingText` | `{ AIStreamingText }` | Token-stream renderer |
|
|
295
|
+
| `AIToolCallDisplay` | `{ AIToolCallDisplay }` | Tool-use invocation render |
|
|
296
|
+
| `AISourceCitation` | `{ AISourceCitation }` | Inline citation reference |
|
|
294
297
|
| `ModelSelector` | `{ ModelSelector }` | Model picker (provider-agnostic) |
|
|
295
298
|
|
|
296
299
|
### Financial
|
|
@@ -334,7 +337,7 @@ import {
|
|
|
334
337
|
| `BorderBeam` | `{ BorderBeam }` | Animated gradient border |
|
|
335
338
|
| `Marquee` | `{ Marquee }` | Infinite scroll marquee |
|
|
336
339
|
| `NumberTicker` | `{ NumberTicker }` | Animated number counter |
|
|
337
|
-
| `Spinner` | `{ Spinner }` |
|
|
340
|
+
| `Spinner` | `{ Spinner, UnicodeSpinner }` | Styled spinner + ASCII-art `UnicodeSpinner` for terminals / code blocks |
|
|
338
341
|
|
|
339
342
|
### Form Additions
|
|
340
343
|
|
|
@@ -371,7 +374,7 @@ import {
|
|
|
371
374
|
| `CountdownTimer` | `{ CountdownTimer }` | Event countdown |
|
|
372
375
|
| `AvatarGroup` | `{ AvatarGroup }` | Stacked avatar group |
|
|
373
376
|
| `FloatingActionButton` | `{ FloatingActionButton }` | Anchored FAB |
|
|
374
|
-
| `
|
|
377
|
+
| `SocialFAB` | `{ SocialFab }` | Social-links FAB |
|
|
375
378
|
| `KeyboardShortcutsHelp` | `{ KeyboardShortcutsHelp }` | Cmd-? shortcut dialog |
|
|
376
379
|
| `ShareDialog` | `{ ShareDialog }` | Shareable-link dialog |
|
|
377
380
|
| `HorizontalScrollRow` | `{ HorizontalScrollRow }` | Scroll-snap row |
|
|
@@ -386,10 +389,22 @@ import { cn } from "@vllnt/ui";
|
|
|
386
389
|
<div className={cn("p-4 bg-primary", isActive && "bg-accent", className)} />
|
|
387
390
|
```
|
|
388
391
|
|
|
392
|
+
### Hooks
|
|
393
|
+
|
|
394
|
+
| Hook | Purpose |
|
|
395
|
+
|------|---------|
|
|
396
|
+
| `useDebounce(value, delayMs)` | Returns the value after `delayMs` of idle — ideal for search inputs. |
|
|
397
|
+
| `useHorizontalScroll(ref)` | Drives the behavior used by `HorizontalScrollRow` — wheel → horizontal scroll, scroll-snap helpers. |
|
|
398
|
+
| `useMobile(breakpoint?)` | Boolean for "viewport is below breakpoint" (default `768`). SSR-safe. |
|
|
399
|
+
| `useSidebar()` | Reads `SidebarProvider` state — `{ open, setOpen, toggle }`. Throws outside a provider. |
|
|
400
|
+
| `useFlowDiagram(options)` | Imperative controller for `FlowDiagram` — fit view, zoom, export to PNG. |
|
|
401
|
+
| `useSocialFab()` | Drives the open/close state of `SocialFab`. |
|
|
402
|
+
|
|
389
403
|
```tsx
|
|
390
|
-
import { useDebounce } from "@vllnt/ui";
|
|
404
|
+
import { useDebounce, useMobile } from "@vllnt/ui";
|
|
391
405
|
|
|
392
|
-
const
|
|
406
|
+
const query = useDebounce(input, 300);
|
|
407
|
+
const isMobile = useMobile();
|
|
393
408
|
```
|
|
394
409
|
|
|
395
410
|
## Types
|
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import {
|
|
4
|
+
createContext,
|
|
5
|
+
forwardRef,
|
|
6
|
+
useCallback,
|
|
7
|
+
useContext,
|
|
8
|
+
useId,
|
|
9
|
+
useMemo,
|
|
10
|
+
useState
|
|
11
|
+
} from "react";
|
|
12
|
+
import {
|
|
13
|
+
AlertTriangle,
|
|
14
|
+
CheckCircle2,
|
|
15
|
+
ChevronDown,
|
|
16
|
+
Circle,
|
|
17
|
+
Loader2,
|
|
18
|
+
MinusCircle
|
|
19
|
+
} from "lucide-react";
|
|
20
|
+
import { cn } from "../../lib/utils";
|
|
21
|
+
const STATUS_CLASSES = {
|
|
22
|
+
completed: {
|
|
23
|
+
iconClass: "text-emerald-600 dark:text-emerald-400",
|
|
24
|
+
ringClass: "ring-emerald-500/30",
|
|
25
|
+
rowClass: "border-border bg-background"
|
|
26
|
+
},
|
|
27
|
+
error: {
|
|
28
|
+
iconClass: "text-destructive",
|
|
29
|
+
ringClass: "ring-destructive/40",
|
|
30
|
+
rowClass: "border-destructive/40 bg-destructive/5"
|
|
31
|
+
},
|
|
32
|
+
pending: {
|
|
33
|
+
iconClass: "text-muted-foreground",
|
|
34
|
+
ringClass: "ring-border",
|
|
35
|
+
rowClass: "border-border bg-muted/20 text-muted-foreground"
|
|
36
|
+
},
|
|
37
|
+
running: {
|
|
38
|
+
iconClass: "text-primary",
|
|
39
|
+
ringClass: "ring-primary/30",
|
|
40
|
+
rowClass: "border-primary/30 bg-primary/5"
|
|
41
|
+
},
|
|
42
|
+
skipped: {
|
|
43
|
+
iconClass: "text-muted-foreground/60",
|
|
44
|
+
ringClass: "ring-border",
|
|
45
|
+
rowClass: "border-border bg-background text-muted-foreground/80"
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
const DEFAULT_STATUS_ICON = {
|
|
49
|
+
completed: /* @__PURE__ */ jsx(CheckCircle2, { "aria-hidden": "true", className: "h-4 w-4" }),
|
|
50
|
+
error: /* @__PURE__ */ jsx(AlertTriangle, { "aria-hidden": "true", className: "h-4 w-4" }),
|
|
51
|
+
pending: /* @__PURE__ */ jsx(Circle, { "aria-hidden": "true", className: "h-4 w-4" }),
|
|
52
|
+
running: /* @__PURE__ */ jsx(Loader2, { "aria-hidden": "true", className: "h-4 w-4 animate-spin" }),
|
|
53
|
+
skipped: /* @__PURE__ */ jsx(MinusCircle, { "aria-hidden": "true", className: "h-4 w-4" })
|
|
54
|
+
};
|
|
55
|
+
const StepContext = createContext({ status: "pending" });
|
|
56
|
+
const DEFAULT_LABELS = {
|
|
57
|
+
activity: "Activity",
|
|
58
|
+
collapse: "Hide details",
|
|
59
|
+
elapsed: "Elapsed",
|
|
60
|
+
expand: "Show details"
|
|
61
|
+
};
|
|
62
|
+
const ACTIVITY_LIVE_REGION_ROLE = {
|
|
63
|
+
completed: "status",
|
|
64
|
+
error: "status",
|
|
65
|
+
idle: "status",
|
|
66
|
+
running: "log"
|
|
67
|
+
};
|
|
68
|
+
const AgentActivity = forwardRef(
|
|
69
|
+
(props, ref) => {
|
|
70
|
+
const {
|
|
71
|
+
children,
|
|
72
|
+
className,
|
|
73
|
+
elapsed,
|
|
74
|
+
labels,
|
|
75
|
+
status = "idle",
|
|
76
|
+
...rest
|
|
77
|
+
} = props;
|
|
78
|
+
const resolvedLabels = { ...DEFAULT_LABELS, ...labels };
|
|
79
|
+
return /* @__PURE__ */ jsxs(
|
|
80
|
+
"section",
|
|
81
|
+
{
|
|
82
|
+
"aria-live": status === "running" ? "polite" : "off",
|
|
83
|
+
className: cn(
|
|
84
|
+
"flex flex-col gap-3 rounded-2xl border bg-background p-4",
|
|
85
|
+
className
|
|
86
|
+
),
|
|
87
|
+
"data-status": status,
|
|
88
|
+
ref,
|
|
89
|
+
role: ACTIVITY_LIVE_REGION_ROLE[status],
|
|
90
|
+
...rest,
|
|
91
|
+
children: [
|
|
92
|
+
/* @__PURE__ */ jsxs("header", { className: "flex items-center justify-between gap-3", children: [
|
|
93
|
+
/* @__PURE__ */ jsx("h3", { className: "text-sm font-semibold tracking-tight text-foreground", children: resolvedLabels.activity }),
|
|
94
|
+
elapsed ? /* @__PURE__ */ jsx(
|
|
95
|
+
"span",
|
|
96
|
+
{
|
|
97
|
+
"aria-label": resolvedLabels.elapsed,
|
|
98
|
+
className: "text-xs font-mono text-muted-foreground",
|
|
99
|
+
children: elapsed
|
|
100
|
+
}
|
|
101
|
+
) : null
|
|
102
|
+
] }),
|
|
103
|
+
/* @__PURE__ */ jsx("ol", { className: "flex flex-col gap-2", children })
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
);
|
|
109
|
+
AgentActivity.displayName = "AgentActivity";
|
|
110
|
+
function getDisplayName(value) {
|
|
111
|
+
if (value !== null && (typeof value === "object" || typeof value === "function") && "displayName" in value && typeof value.displayName === "string") {
|
|
112
|
+
return value.displayName;
|
|
113
|
+
}
|
|
114
|
+
return void 0;
|
|
115
|
+
}
|
|
116
|
+
function isAgentStepDetailElement(child) {
|
|
117
|
+
if (child === null || typeof child !== "object") return false;
|
|
118
|
+
if (!("type" in child)) return false;
|
|
119
|
+
return getDisplayName(child.type) === "AgentStepDetail";
|
|
120
|
+
}
|
|
121
|
+
function splitChildren(children) {
|
|
122
|
+
const items = Array.isArray(children) ? children : [children];
|
|
123
|
+
return items.reduce(
|
|
124
|
+
(split, child) => {
|
|
125
|
+
if (isAgentStepDetailElement(child)) {
|
|
126
|
+
split.body.push(child);
|
|
127
|
+
} else {
|
|
128
|
+
split.header.push(child);
|
|
129
|
+
}
|
|
130
|
+
return split;
|
|
131
|
+
},
|
|
132
|
+
{ body: [], header: [] }
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
function StepRow({
|
|
136
|
+
detailsId,
|
|
137
|
+
hasDetails,
|
|
138
|
+
header,
|
|
139
|
+
icon,
|
|
140
|
+
iconClass,
|
|
141
|
+
labels,
|
|
142
|
+
onToggle,
|
|
143
|
+
open
|
|
144
|
+
}) {
|
|
145
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3 px-3 py-2", children: [
|
|
146
|
+
/* @__PURE__ */ jsx(
|
|
147
|
+
"span",
|
|
148
|
+
{
|
|
149
|
+
"aria-hidden": "true",
|
|
150
|
+
className: cn(
|
|
151
|
+
"mt-0.5 inline-flex h-5 w-5 shrink-0 items-center justify-center",
|
|
152
|
+
iconClass
|
|
153
|
+
),
|
|
154
|
+
children: icon
|
|
155
|
+
}
|
|
156
|
+
),
|
|
157
|
+
/* @__PURE__ */ jsx("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: header }),
|
|
158
|
+
hasDetails ? /* @__PURE__ */ jsx(
|
|
159
|
+
"button",
|
|
160
|
+
{
|
|
161
|
+
"aria-controls": detailsId,
|
|
162
|
+
"aria-expanded": open,
|
|
163
|
+
"aria-label": open ? labels.collapse : labels.expand,
|
|
164
|
+
className: "ml-auto inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-foreground/10 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
165
|
+
onClick: onToggle,
|
|
166
|
+
type: "button",
|
|
167
|
+
children: /* @__PURE__ */ jsx(
|
|
168
|
+
ChevronDown,
|
|
169
|
+
{
|
|
170
|
+
"aria-hidden": "true",
|
|
171
|
+
className: cn(
|
|
172
|
+
"h-4 w-4 transition-transform",
|
|
173
|
+
open ? "rotate-180" : "rotate-0"
|
|
174
|
+
)
|
|
175
|
+
}
|
|
176
|
+
)
|
|
177
|
+
}
|
|
178
|
+
) : null
|
|
179
|
+
] });
|
|
180
|
+
}
|
|
181
|
+
const AgentStep = forwardRef(
|
|
182
|
+
(props, ref) => {
|
|
183
|
+
const {
|
|
184
|
+
children,
|
|
185
|
+
className,
|
|
186
|
+
defaultOpen = true,
|
|
187
|
+
icon,
|
|
188
|
+
status,
|
|
189
|
+
...rest
|
|
190
|
+
} = props;
|
|
191
|
+
const split = useMemo(() => splitChildren(children), [children]);
|
|
192
|
+
const palette = STATUS_CLASSES[status];
|
|
193
|
+
const hasDetails = split.body.length > 0;
|
|
194
|
+
const [open, setOpen] = useState(defaultOpen);
|
|
195
|
+
const detailsId = useId();
|
|
196
|
+
const handleToggle = useCallback(() => {
|
|
197
|
+
setOpen((value) => !value);
|
|
198
|
+
}, []);
|
|
199
|
+
const contextValue = useMemo(
|
|
200
|
+
() => ({ status }),
|
|
201
|
+
[status]
|
|
202
|
+
);
|
|
203
|
+
const resolvedIcon = icon ?? DEFAULT_STATUS_ICON[status];
|
|
204
|
+
return /* @__PURE__ */ jsx(
|
|
205
|
+
"li",
|
|
206
|
+
{
|
|
207
|
+
className: cn(
|
|
208
|
+
"rounded-xl border ring-1",
|
|
209
|
+
palette.rowClass,
|
|
210
|
+
palette.ringClass,
|
|
211
|
+
className
|
|
212
|
+
),
|
|
213
|
+
"data-status": status,
|
|
214
|
+
ref,
|
|
215
|
+
...rest,
|
|
216
|
+
children: /* @__PURE__ */ jsxs(StepContext.Provider, { value: contextValue, children: [
|
|
217
|
+
/* @__PURE__ */ jsx(
|
|
218
|
+
StepRow,
|
|
219
|
+
{
|
|
220
|
+
detailsId,
|
|
221
|
+
hasDetails,
|
|
222
|
+
header: split.header,
|
|
223
|
+
icon: resolvedIcon,
|
|
224
|
+
iconClass: palette.iconClass,
|
|
225
|
+
labels: DEFAULT_LABELS,
|
|
226
|
+
onToggle: handleToggle,
|
|
227
|
+
open
|
|
228
|
+
}
|
|
229
|
+
),
|
|
230
|
+
hasDetails && open ? /* @__PURE__ */ jsx(
|
|
231
|
+
"div",
|
|
232
|
+
{
|
|
233
|
+
className: "border-t border-border/60 px-3 py-2 text-xs",
|
|
234
|
+
id: detailsId,
|
|
235
|
+
children: /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-2 pl-8", children: split.body })
|
|
236
|
+
}
|
|
237
|
+
) : null
|
|
238
|
+
] })
|
|
239
|
+
}
|
|
240
|
+
);
|
|
241
|
+
}
|
|
242
|
+
);
|
|
243
|
+
AgentStep.displayName = "AgentStep";
|
|
244
|
+
const AgentStepTitle = forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ jsx(
|
|
245
|
+
"p",
|
|
246
|
+
{
|
|
247
|
+
className: cn(
|
|
248
|
+
"text-sm font-medium leading-tight text-foreground",
|
|
249
|
+
className
|
|
250
|
+
),
|
|
251
|
+
ref,
|
|
252
|
+
...rest
|
|
253
|
+
}
|
|
254
|
+
));
|
|
255
|
+
AgentStepTitle.displayName = "AgentStepTitle";
|
|
256
|
+
const AgentStepDuration = forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ jsx(
|
|
257
|
+
"span",
|
|
258
|
+
{
|
|
259
|
+
className: cn("font-mono text-xs text-muted-foreground", className),
|
|
260
|
+
ref,
|
|
261
|
+
...rest
|
|
262
|
+
}
|
|
263
|
+
));
|
|
264
|
+
AgentStepDuration.displayName = "AgentStepDuration";
|
|
265
|
+
const AgentStepProgress = forwardRef(({ className, label = "Step progress", value, ...rest }, ref) => {
|
|
266
|
+
const clamped = Math.max(0, Math.min(100, value));
|
|
267
|
+
return /* @__PURE__ */ jsx(
|
|
268
|
+
"div",
|
|
269
|
+
{
|
|
270
|
+
"aria-label": label,
|
|
271
|
+
"aria-valuemax": 100,
|
|
272
|
+
"aria-valuemin": 0,
|
|
273
|
+
"aria-valuenow": clamped,
|
|
274
|
+
className: cn("h-1.5 w-full rounded-full bg-muted", className),
|
|
275
|
+
ref,
|
|
276
|
+
role: "progressbar",
|
|
277
|
+
...rest,
|
|
278
|
+
children: /* @__PURE__ */ jsx(
|
|
279
|
+
"span",
|
|
280
|
+
{
|
|
281
|
+
className: "block h-full rounded-full bg-primary transition-[width]",
|
|
282
|
+
style: { width: `${clamped.toString()}%` }
|
|
283
|
+
}
|
|
284
|
+
)
|
|
285
|
+
}
|
|
286
|
+
);
|
|
287
|
+
});
|
|
288
|
+
AgentStepProgress.displayName = "AgentStepProgress";
|
|
289
|
+
const AgentStepDetail = forwardRef(
|
|
290
|
+
({ className, ...rest }, ref) => /* @__PURE__ */ jsx(
|
|
291
|
+
"div",
|
|
292
|
+
{
|
|
293
|
+
className: cn("text-xs text-muted-foreground", className),
|
|
294
|
+
ref,
|
|
295
|
+
...rest
|
|
296
|
+
}
|
|
297
|
+
)
|
|
298
|
+
);
|
|
299
|
+
AgentStepDetail.displayName = "AgentStepDetail";
|
|
300
|
+
function useAgentStepStatus() {
|
|
301
|
+
return useContext(StepContext).status;
|
|
302
|
+
}
|
|
303
|
+
export {
|
|
304
|
+
AgentActivity,
|
|
305
|
+
AgentStep,
|
|
306
|
+
AgentStepDetail,
|
|
307
|
+
AgentStepDuration,
|
|
308
|
+
AgentStepProgress,
|
|
309
|
+
AgentStepTitle,
|
|
310
|
+
useAgentStepStatus
|
|
311
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AgentActivity,
|
|
3
|
+
AgentStep,
|
|
4
|
+
AgentStepDetail,
|
|
5
|
+
AgentStepDuration,
|
|
6
|
+
AgentStepProgress,
|
|
7
|
+
AgentStepTitle,
|
|
8
|
+
useAgentStepStatus
|
|
9
|
+
} from "./agent-activity";
|
|
10
|
+
export {
|
|
11
|
+
AgentActivity,
|
|
12
|
+
AgentStep,
|
|
13
|
+
AgentStepDetail,
|
|
14
|
+
AgentStepDuration,
|
|
15
|
+
AgentStepProgress,
|
|
16
|
+
AgentStepTitle,
|
|
17
|
+
useAgentStepStatus
|
|
18
|
+
};
|