@vllnt/ui 0.2.1-canary.e1bc2b3 → 0.2.1-canary.ee942df

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 (137) hide show
  1. package/dist/components/agent-activity/agent-activity.js +311 -0
  2. package/dist/components/agent-activity/index.js +18 -0
  3. package/dist/components/ai-artifact/ai-artifact.js +422 -0
  4. package/dist/components/ai-artifact/index.js +24 -0
  5. package/dist/components/ai-sidebar/ai-sidebar.js +254 -0
  6. package/dist/components/ai-sidebar/index.js +22 -0
  7. package/dist/components/alert-pulse/alert-pulse.js +93 -0
  8. package/dist/components/alert-pulse/index.js +6 -0
  9. package/dist/components/auto-reload/auto-reload.js +367 -0
  10. package/dist/components/auto-reload/index.js +6 -0
  11. package/dist/components/banner/banner.js +155 -0
  12. package/dist/components/banner/index.js +10 -0
  13. package/dist/components/bottom-activity-strip/bottom-activity-strip.js +91 -0
  14. package/dist/components/bottom-activity-strip/index.js +6 -0
  15. package/dist/components/choropleth-map/choropleth-map.js +373 -0
  16. package/dist/components/choropleth-map/index.js +10 -0
  17. package/dist/components/chronological-timeline/chronological-timeline.js +337 -0
  18. package/dist/components/chronological-timeline/index.js +8 -0
  19. package/dist/components/civilization-card/civilization-card.js +258 -0
  20. package/dist/components/civilization-card/index.js +8 -0
  21. package/dist/components/comment-pin/comment-pin.js +104 -0
  22. package/dist/components/comment-pin/index.js +6 -0
  23. package/dist/components/context-lens/context-lens.js +98 -0
  24. package/dist/components/context-lens/index.js +6 -0
  25. package/dist/components/copy-button/copy-button.js +189 -0
  26. package/dist/components/copy-button/index.js +8 -0
  27. package/dist/components/document-sibling-nav/document-sibling-nav.js +111 -0
  28. package/dist/components/document-sibling-nav/index.js +8 -0
  29. package/dist/components/empty-state/empty-state.js +93 -0
  30. package/dist/components/empty-state/index.js +8 -0
  31. package/dist/components/era-comparison/era-comparison.js +198 -0
  32. package/dist/components/era-comparison/index.js +16 -0
  33. package/dist/components/floating-toolbar/floating-toolbar.js +66 -0
  34. package/dist/components/floating-toolbar/index.js +6 -0
  35. package/dist/components/follow-mode/follow-mode.js +89 -0
  36. package/dist/components/follow-mode/index.js +6 -0
  37. package/dist/components/gantt-chart/gantt-chart.js +331 -0
  38. package/dist/components/gantt-chart/index.js +6 -0
  39. package/dist/components/geography-quiz-map/geography-quiz-map.js +343 -0
  40. package/dist/components/geography-quiz-map/index.js +12 -0
  41. package/dist/components/globe-3d/globe-3d.js +417 -0
  42. package/dist/components/globe-3d/index.js +10 -0
  43. package/dist/components/handoff-beacon/handoff-beacon.js +78 -0
  44. package/dist/components/handoff-beacon/index.js +6 -0
  45. package/dist/components/heat-map-overlay/heat-map-overlay.js +215 -0
  46. package/dist/components/heat-map-overlay/index.js +6 -0
  47. package/dist/components/heat-overlay/heat-overlay.js +92 -0
  48. package/dist/components/heat-overlay/index.js +6 -0
  49. package/dist/components/historic-timeline/historic-timeline.js +342 -0
  50. package/dist/components/historic-timeline/index.js +6 -0
  51. package/dist/components/historical-figure-card/historical-figure-card.js +273 -0
  52. package/dist/components/historical-figure-card/index.js +6 -0
  53. package/dist/components/index.js +432 -1
  54. package/dist/components/infinite-plane/index.js +6 -0
  55. package/dist/components/infinite-plane/infinite-plane.js +75 -0
  56. package/dist/components/interactive-timeline/index.js +16 -0
  57. package/dist/components/interactive-timeline/interactive-timeline.js +708 -0
  58. package/dist/components/jarvis-dock/index.js +6 -0
  59. package/dist/components/jarvis-dock/jarvis-dock.js +98 -0
  60. package/dist/components/kbd/index.js +5 -0
  61. package/dist/components/kbd/kbd.js +117 -0
  62. package/dist/components/knowledge-check/index.js +6 -0
  63. package/dist/components/knowledge-check/knowledge-check.js +448 -0
  64. package/dist/components/live-cursor/index.js +6 -0
  65. package/dist/components/live-cursor/live-cursor.js +62 -0
  66. package/dist/components/map-2d/index.js +20 -0
  67. package/dist/components/map-2d/map-2d.js +455 -0
  68. package/dist/components/map-timeline/index.js +16 -0
  69. package/dist/components/map-timeline/map-timeline.js +506 -0
  70. package/dist/components/metric-cluster/index.js +6 -0
  71. package/dist/components/metric-cluster/metric-cluster.js +96 -0
  72. package/dist/components/model-comparison/index.js +12 -0
  73. package/dist/components/model-comparison/model-comparison.js +211 -0
  74. package/dist/components/multi-select-lasso/index.js +6 -0
  75. package/dist/components/multi-select-lasso/multi-select-lasso.js +76 -0
  76. package/dist/components/newsletter-signup/index.js +8 -0
  77. package/dist/components/newsletter-signup/newsletter-signup.js +269 -0
  78. package/dist/components/object-inspector/index.js +6 -0
  79. package/dist/components/object-inspector/object-inspector.js +136 -0
  80. package/dist/components/parallel-timeline/index.js +6 -0
  81. package/dist/components/parallel-timeline/parallel-timeline.js +251 -0
  82. package/dist/components/playback-ghost/index.js +6 -0
  83. package/dist/components/playback-ghost/playback-ghost.js +83 -0
  84. package/dist/components/policy-delivery-panel/index.js +6 -0
  85. package/dist/components/policy-delivery-panel/policy-delivery-panel.js +99 -0
  86. package/dist/components/presence-stack/index.js +6 -0
  87. package/dist/components/presence-stack/presence-stack.js +108 -0
  88. package/dist/components/presence-sync-indicator/index.js +6 -0
  89. package/dist/components/presence-sync-indicator/presence-sync-indicator.js +73 -0
  90. package/dist/components/pricing-table/index.js +8 -0
  91. package/dist/components/pricing-table/pricing-table.js +247 -0
  92. package/dist/components/primary-source-viewer/index.js +26 -0
  93. package/dist/components/primary-source-viewer/primary-source-viewer.js +439 -0
  94. package/dist/components/prompt-templates/index.js +6 -0
  95. package/dist/components/prompt-templates/prompt-templates.js +403 -0
  96. package/dist/components/property-section/index.js +6 -0
  97. package/dist/components/property-section/property-section.js +101 -0
  98. package/dist/components/relationship-inspector/index.js +6 -0
  99. package/dist/components/relationship-inspector/relationship-inspector.js +102 -0
  100. package/dist/components/route-map/index.js +6 -0
  101. package/dist/components/route-map/route-map.js +339 -0
  102. package/dist/components/routing-assignment-panel/index.js +6 -0
  103. package/dist/components/routing-assignment-panel/routing-assignment-panel.js +122 -0
  104. package/dist/components/run-timeline/index.js +6 -0
  105. package/dist/components/run-timeline/run-timeline.js +221 -0
  106. package/dist/components/runtime-overview-panel/index.js +6 -0
  107. package/dist/components/runtime-overview-panel/runtime-overview-panel.js +89 -0
  108. package/dist/components/selection-halo/index.js +6 -0
  109. package/dist/components/selection-halo/selection-halo.js +72 -0
  110. package/dist/components/selection-presence/index.js +6 -0
  111. package/dist/components/selection-presence/selection-presence.js +50 -0
  112. package/dist/components/snap-guides/index.js +6 -0
  113. package/dist/components/snap-guides/snap-guides.js +45 -0
  114. package/dist/components/state-badge-overlay/index.js +6 -0
  115. package/dist/components/state-badge-overlay/state-badge-overlay.js +90 -0
  116. package/dist/components/sticky-metric/index.js +6 -0
  117. package/dist/components/sticky-metric/sticky-metric.js +83 -0
  118. package/dist/components/story-map/index.js +8 -0
  119. package/dist/components/story-map/story-map.js +414 -0
  120. package/dist/components/thread-bubble/index.js +6 -0
  121. package/dist/components/thread-bubble/thread-bubble.js +85 -0
  122. package/dist/components/threshold-ring/index.js +6 -0
  123. package/dist/components/threshold-ring/threshold-ring.js +160 -0
  124. package/dist/components/timeline/index.js +12 -0
  125. package/dist/components/timeline/timeline.js +239 -0
  126. package/dist/components/timeline-scrubber/index.js +6 -0
  127. package/dist/components/timeline-scrubber/timeline-scrubber.js +179 -0
  128. package/dist/components/transaction-list/index.js +14 -0
  129. package/dist/components/transaction-list/transaction-list.js +226 -0
  130. package/dist/components/tree-view/index.js +6 -0
  131. package/dist/components/tree-view/tree-view.js +298 -0
  132. package/dist/components/viewport-bookmarks/index.js +6 -0
  133. package/dist/components/viewport-bookmarks/viewport-bookmarks.js +116 -0
  134. package/dist/components/world-breadcrumbs/index.js +6 -0
  135. package/dist/components/world-breadcrumbs/world-breadcrumbs.js +114 -0
  136. package/dist/index.d.ts +7135 -141
  137. package/package.json +1 -1
@@ -0,0 +1,273 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import {
4
+ forwardRef,
5
+ useCallback,
6
+ useState
7
+ } from "react";
8
+ import { ChevronDown, User } from "lucide-react";
9
+ import { cn } from "../../lib/utils";
10
+ import { Avatar, AvatarFallback, AvatarImage } from "../avatar/avatar";
11
+ import { Badge } from "../badge/badge";
12
+ const FALLBACK_LIFESPAN_MIN_YEAR = 1500;
13
+ const FALLBACK_LIFESPAN_SPAN_YEARS = 100;
14
+ const DEFAULT_LABELS = {
15
+ collapseBio: "Hide biography",
16
+ connections: "Connections",
17
+ expandBio: "Read biography",
18
+ fields: "Fields",
19
+ lifespan: "Lifespan",
20
+ works: "Notable works"
21
+ };
22
+ function formatYear(year) {
23
+ if (year === void 0) return void 0;
24
+ if (year < 0) return `${Math.abs(year).toString()} BC`;
25
+ return year.toString();
26
+ }
27
+ function getInitials(name) {
28
+ if (typeof name !== "string") return "";
29
+ const parts = name.trim().split(/\s+/).slice(0, 2);
30
+ return parts.map((part) => part.charAt(0).toUpperCase()).join("").slice(0, 2);
31
+ }
32
+ function LifespanBar({
33
+ birthYear,
34
+ deathYear,
35
+ label
36
+ }) {
37
+ if (birthYear === void 0 || deathYear === void 0) return null;
38
+ if (deathYear <= birthYear) return null;
39
+ const span = deathYear - birthYear;
40
+ const min = Math.min(birthYear, FALLBACK_LIFESPAN_MIN_YEAR);
41
+ const range = Math.max(deathYear, min + FALLBACK_LIFESPAN_SPAN_YEARS) - min || 1;
42
+ const start = (birthYear - min) / range * 100;
43
+ const width = span / range * 100;
44
+ return /* @__PURE__ */ jsx(
45
+ "div",
46
+ {
47
+ "aria-label": `${label}: ${formatYear(birthYear) ?? ""} \u2013 ${formatYear(deathYear) ?? ""}`,
48
+ className: "relative mt-2 h-1.5 w-full rounded-full bg-muted",
49
+ role: "img",
50
+ children: /* @__PURE__ */ jsx(
51
+ "span",
52
+ {
53
+ className: "absolute h-full rounded-full bg-primary",
54
+ style: { left: `${start.toString()}%`, width: `${width.toString()}%` }
55
+ }
56
+ )
57
+ }
58
+ );
59
+ }
60
+ function LifeEventLine({ caption, event }) {
61
+ if (!event) return null;
62
+ const year = formatYear(event.year);
63
+ if (year === void 0 && !event.place) return null;
64
+ return /* @__PURE__ */ jsxs("p", { className: "text-xs text-muted-foreground", children: [
65
+ /* @__PURE__ */ jsx("span", { className: "font-semibold text-foreground", children: caption }),
66
+ " ",
67
+ year ?? "Unknown",
68
+ event.place ? /* @__PURE__ */ jsxs("span", { children: [
69
+ " \xB7 ",
70
+ event.place
71
+ ] }) : null
72
+ ] });
73
+ }
74
+ function FigureChips({ heading, items }) {
75
+ if (items.length === 0) return null;
76
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
77
+ /* @__PURE__ */ jsx("h4", { className: "text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: heading }),
78
+ /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1.5", children: items.map((item, index) => /* @__PURE__ */ jsx(Badge, { variant: "secondary", children: item }, `chip-${index.toString()}`)) })
79
+ ] });
80
+ }
81
+ function FigureWorksList({ heading, items }) {
82
+ if (items.length === 0) return null;
83
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
84
+ /* @__PURE__ */ jsx("h4", { className: "text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: heading }),
85
+ /* @__PURE__ */ jsx("ul", { className: "flex flex-col gap-1 text-sm text-foreground", children: items.map((item, index) => /* @__PURE__ */ jsx("li", { className: "leading-tight", children: item }, `work-${index.toString()}`)) })
86
+ ] });
87
+ }
88
+ function FigureConnections({
89
+ heading,
90
+ items
91
+ }) {
92
+ if (items.length === 0) return null;
93
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
94
+ /* @__PURE__ */ jsx("h4", { className: "text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: heading }),
95
+ /* @__PURE__ */ jsx("ul", { className: "flex flex-col gap-1.5 text-sm", children: items.map((connection, index) => {
96
+ const labelNode = connection.href ? /* @__PURE__ */ jsx(
97
+ "a",
98
+ {
99
+ className: "font-medium text-foreground underline-offset-4 hover:underline",
100
+ href: connection.href,
101
+ children: connection.name
102
+ }
103
+ ) : /* @__PURE__ */ jsx("span", { className: "font-medium text-foreground", children: connection.name });
104
+ return /* @__PURE__ */ jsxs(
105
+ "li",
106
+ {
107
+ className: "flex items-baseline justify-between gap-3",
108
+ children: [
109
+ labelNode,
110
+ /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: connection.relation })
111
+ ]
112
+ },
113
+ `connection-${index.toString()}`
114
+ );
115
+ }) })
116
+ ] });
117
+ }
118
+ function FigureQuote({ quote }) {
119
+ return /* @__PURE__ */ jsxs("blockquote", { className: "border-l-2 border-primary/40 pl-3 text-sm italic text-muted-foreground", children: [
120
+ "\u201C",
121
+ quote.text,
122
+ "\u201D",
123
+ quote.source ? /* @__PURE__ */ jsxs("footer", { className: "mt-1 text-xs not-italic text-muted-foreground/80", children: [
124
+ "\u2014 ",
125
+ quote.source
126
+ ] }) : null
127
+ ] });
128
+ }
129
+ function FigureBio({
130
+ biography,
131
+ collapseLabel,
132
+ expandLabel
133
+ }) {
134
+ const [open, setOpen] = useState(false);
135
+ const handleToggle = useCallback(() => {
136
+ setOpen((value) => !value);
137
+ }, []);
138
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
139
+ /* @__PURE__ */ jsxs(
140
+ "button",
141
+ {
142
+ "aria-expanded": open,
143
+ className: "inline-flex w-fit items-center gap-1 text-sm font-medium text-primary underline-offset-4 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
144
+ onClick: handleToggle,
145
+ type: "button",
146
+ children: [
147
+ open ? collapseLabel : expandLabel,
148
+ /* @__PURE__ */ jsx(
149
+ ChevronDown,
150
+ {
151
+ "aria-hidden": "true",
152
+ className: cn(
153
+ "h-4 w-4 transition-transform",
154
+ open ? "rotate-180" : "rotate-0"
155
+ )
156
+ }
157
+ )
158
+ ]
159
+ }
160
+ ),
161
+ open ? /* @__PURE__ */ jsx("div", { className: "text-sm leading-relaxed text-foreground", children: biography }) : null
162
+ ] });
163
+ }
164
+ function FigureHeader({
165
+ era,
166
+ name,
167
+ portrait,
168
+ title
169
+ }) {
170
+ const initials = getInitials(name);
171
+ const altName = typeof name === "string" ? name : void 0;
172
+ return /* @__PURE__ */ jsxs("header", { className: "flex items-start gap-4", children: [
173
+ /* @__PURE__ */ jsxs(Avatar, { className: "h-14 w-14 shrink-0 ring-2 ring-border", children: [
174
+ portrait ? /* @__PURE__ */ jsx(AvatarImage, { alt: altName, src: portrait }) : null,
175
+ /* @__PURE__ */ jsx(AvatarFallback, { className: "text-sm", children: initials || /* @__PURE__ */ jsx(User, { "aria-hidden": "true", className: "h-5 w-5" }) })
176
+ ] }),
177
+ /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
178
+ /* @__PURE__ */ jsx("h3", { className: "text-base font-semibold leading-tight tracking-tight", children: name }),
179
+ title ? /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: title }) : null,
180
+ era ? /* @__PURE__ */ jsx(Badge, { className: "self-start", variant: "outline", children: era }) : null
181
+ ] })
182
+ ] });
183
+ }
184
+ function FigureLifeBlock({
185
+ birth,
186
+ death,
187
+ lifespanLabel
188
+ }) {
189
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
190
+ /* @__PURE__ */ jsx(LifeEventLine, { caption: "Born", event: birth }),
191
+ /* @__PURE__ */ jsx(LifeEventLine, { caption: "Died", event: death }),
192
+ /* @__PURE__ */ jsx(
193
+ LifespanBar,
194
+ {
195
+ birthYear: birth?.year,
196
+ deathYear: death?.year,
197
+ label: lifespanLabel
198
+ }
199
+ )
200
+ ] });
201
+ }
202
+ const HistoricalFigureCard = forwardRef((props, ref) => {
203
+ const {
204
+ biography,
205
+ birth,
206
+ className,
207
+ connections,
208
+ death,
209
+ era,
210
+ fields,
211
+ labels,
212
+ name,
213
+ portrait,
214
+ profileHref,
215
+ quote,
216
+ title,
217
+ works,
218
+ ...rest
219
+ } = props;
220
+ const resolvedLabels = { ...DEFAULT_LABELS, ...labels };
221
+ return /* @__PURE__ */ jsxs(
222
+ "article",
223
+ {
224
+ className: cn(
225
+ "flex flex-col gap-4 rounded-2xl border bg-background p-5 text-foreground shadow-sm",
226
+ className
227
+ ),
228
+ ref,
229
+ ...rest,
230
+ children: [
231
+ /* @__PURE__ */ jsx(FigureHeader, { era, name, portrait, title }),
232
+ /* @__PURE__ */ jsx(
233
+ FigureLifeBlock,
234
+ {
235
+ birth,
236
+ death,
237
+ lifespanLabel: resolvedLabels.lifespan
238
+ }
239
+ ),
240
+ fields && fields.length > 0 ? /* @__PURE__ */ jsx(FigureChips, { heading: resolvedLabels.fields, items: fields }) : null,
241
+ works && works.length > 0 ? /* @__PURE__ */ jsx(FigureWorksList, { heading: resolvedLabels.works, items: works }) : null,
242
+ quote ? /* @__PURE__ */ jsx(FigureQuote, { quote }) : null,
243
+ connections && connections.length > 0 ? /* @__PURE__ */ jsx(
244
+ FigureConnections,
245
+ {
246
+ heading: resolvedLabels.connections,
247
+ items: connections
248
+ }
249
+ ) : null,
250
+ biography ? /* @__PURE__ */ jsx(
251
+ FigureBio,
252
+ {
253
+ biography,
254
+ collapseLabel: resolvedLabels.collapseBio,
255
+ expandLabel: resolvedLabels.expandBio
256
+ }
257
+ ) : null,
258
+ profileHref ? /* @__PURE__ */ jsx(
259
+ "a",
260
+ {
261
+ className: "text-sm font-medium text-primary underline-offset-4 hover:underline",
262
+ href: profileHref,
263
+ children: "View full profile \u2192"
264
+ }
265
+ ) : null
266
+ ]
267
+ }
268
+ );
269
+ });
270
+ HistoricalFigureCard.displayName = "HistoricalFigureCard";
271
+ export {
272
+ HistoricalFigureCard
273
+ };
@@ -0,0 +1,6 @@
1
+ import {
2
+ HistoricalFigureCard
3
+ } from "./historical-figure-card";
4
+ export {
5
+ HistoricalFigureCard
6
+ };