@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.
- 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/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/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/comment-pin/comment-pin.js +104 -0
- package/dist/components/comment-pin/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/copy-button/copy-button.js +189 -0
- package/dist/components/copy-button/index.js +8 -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/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/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/globe-3d/globe-3d.js +417 -0
- package/dist/components/globe-3d/index.js +10 -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 +432 -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/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/model-comparison/index.js +12 -0
- package/dist/components/model-comparison/model-comparison.js +211 -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-inspector/index.js +6 -0
- package/dist/components/object-inspector/object-inspector.js +136 -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/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/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/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/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/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/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/viewport-bookmarks/index.js +6 -0
- package/dist/components/viewport-bookmarks/viewport-bookmarks.js +116 -0
- package/dist/components/world-breadcrumbs/index.js +6 -0
- package/dist/components/world-breadcrumbs/world-breadcrumbs.js +114 -0
- package/dist/index.d.ts +7135 -141
- package/package.json +1 -1
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import {
|
|
4
|
+
forwardRef
|
|
5
|
+
} from "react";
|
|
6
|
+
import { cn } from "../../lib/utils";
|
|
7
|
+
const KIND_LABEL = {
|
|
8
|
+
agent: "Agent",
|
|
9
|
+
artifact: "Artifact",
|
|
10
|
+
input: "Input",
|
|
11
|
+
output: "Output",
|
|
12
|
+
run: "Run",
|
|
13
|
+
task: "Task"
|
|
14
|
+
};
|
|
15
|
+
const KIND_GLYPH = {
|
|
16
|
+
agent: "\u25C7",
|
|
17
|
+
artifact: "\u25CC",
|
|
18
|
+
input: "\u2198",
|
|
19
|
+
output: "\u2197",
|
|
20
|
+
run: "\u25B6",
|
|
21
|
+
task: "\u25A2"
|
|
22
|
+
};
|
|
23
|
+
const STATUS_DOT = {
|
|
24
|
+
complete: "bg-emerald-500",
|
|
25
|
+
failed: "bg-red-500",
|
|
26
|
+
idle: "bg-muted-foreground",
|
|
27
|
+
queued: "bg-amber-500",
|
|
28
|
+
running: "bg-blue-500 animate-pulse"
|
|
29
|
+
};
|
|
30
|
+
const STATUS_LABEL = {
|
|
31
|
+
complete: "Complete",
|
|
32
|
+
failed: "Failed",
|
|
33
|
+
idle: "Idle",
|
|
34
|
+
queued: "Queued",
|
|
35
|
+
running: "Running"
|
|
36
|
+
};
|
|
37
|
+
const DEFAULT_LABELS = {
|
|
38
|
+
empty: "No selection",
|
|
39
|
+
region: "Object inspector"
|
|
40
|
+
};
|
|
41
|
+
const KindChip = (props) => /* @__PURE__ */ jsxs(
|
|
42
|
+
"span",
|
|
43
|
+
{
|
|
44
|
+
"aria-label": KIND_LABEL[props.kind],
|
|
45
|
+
className: "inline-flex items-center gap-1 rounded-full border border-border bg-background px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide text-muted-foreground",
|
|
46
|
+
children: [
|
|
47
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: KIND_GLYPH[props.kind] }),
|
|
48
|
+
KIND_LABEL[props.kind]
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
const StatusDot = (props) => /* @__PURE__ */ jsxs(
|
|
53
|
+
"span",
|
|
54
|
+
{
|
|
55
|
+
"aria-label": `Status ${STATUS_LABEL[props.status]}`,
|
|
56
|
+
className: "inline-flex items-center gap-1 text-[10px] font-medium uppercase tracking-wide text-muted-foreground",
|
|
57
|
+
children: [
|
|
58
|
+
/* @__PURE__ */ jsx(
|
|
59
|
+
"span",
|
|
60
|
+
{
|
|
61
|
+
"aria-hidden": "true",
|
|
62
|
+
className: cn("h-1.5 w-1.5 rounded-full", STATUS_DOT[props.status])
|
|
63
|
+
}
|
|
64
|
+
),
|
|
65
|
+
STATUS_LABEL[props.status]
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
const Header = (props) => /* @__PURE__ */ jsxs("header", { className: "flex flex-col gap-2", children: [
|
|
70
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2", children: [
|
|
71
|
+
/* @__PURE__ */ jsx(KindChip, { kind: props.kind }),
|
|
72
|
+
/* @__PURE__ */ jsx(StatusDot, { status: props.status })
|
|
73
|
+
] }),
|
|
74
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-0.5", children: [
|
|
75
|
+
/* @__PURE__ */ jsx("h3", { className: "truncate text-sm font-semibold text-foreground", children: props.title }),
|
|
76
|
+
props.subtitle ? /* @__PURE__ */ jsx("p", { className: "truncate text-xs text-muted-foreground", children: props.subtitle }) : null
|
|
77
|
+
] })
|
|
78
|
+
] });
|
|
79
|
+
const ObjectInspector = forwardRef(
|
|
80
|
+
(props, ref) => {
|
|
81
|
+
const {
|
|
82
|
+
children,
|
|
83
|
+
className,
|
|
84
|
+
kind,
|
|
85
|
+
labels,
|
|
86
|
+
status = "idle",
|
|
87
|
+
subtitle,
|
|
88
|
+
title,
|
|
89
|
+
...rest
|
|
90
|
+
} = props;
|
|
91
|
+
const resolvedLabels = { ...DEFAULT_LABELS, ...labels };
|
|
92
|
+
if (!kind || !title) {
|
|
93
|
+
return /* @__PURE__ */ jsxs(
|
|
94
|
+
"section",
|
|
95
|
+
{
|
|
96
|
+
"aria-label": resolvedLabels.region,
|
|
97
|
+
className: cn(
|
|
98
|
+
"flex w-full flex-col items-center justify-center gap-1 rounded-2xl border bg-background p-6 text-center text-xs text-muted-foreground",
|
|
99
|
+
className
|
|
100
|
+
),
|
|
101
|
+
"data-object-inspector": true,
|
|
102
|
+
"data-object-state": "empty",
|
|
103
|
+
ref,
|
|
104
|
+
...rest,
|
|
105
|
+
children: [
|
|
106
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "text-lg", children: "\u25C7" }),
|
|
107
|
+
/* @__PURE__ */ jsx("span", { children: resolvedLabels.empty })
|
|
108
|
+
]
|
|
109
|
+
}
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
return /* @__PURE__ */ jsxs(
|
|
113
|
+
"section",
|
|
114
|
+
{
|
|
115
|
+
"aria-label": resolvedLabels.region,
|
|
116
|
+
className: cn(
|
|
117
|
+
"flex w-full flex-col gap-3 rounded-2xl border bg-background p-3 text-foreground",
|
|
118
|
+
className
|
|
119
|
+
),
|
|
120
|
+
"data-object-inspector": true,
|
|
121
|
+
"data-object-kind": kind,
|
|
122
|
+
"data-object-status": status,
|
|
123
|
+
ref,
|
|
124
|
+
...rest,
|
|
125
|
+
children: [
|
|
126
|
+
/* @__PURE__ */ jsx(Header, { kind, status, subtitle, title }),
|
|
127
|
+
children ? /* @__PURE__ */ jsx("div", { className: "space-y-2", children }) : null
|
|
128
|
+
]
|
|
129
|
+
}
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
);
|
|
133
|
+
ObjectInspector.displayName = "ObjectInspector";
|
|
134
|
+
export {
|
|
135
|
+
ObjectInspector
|
|
136
|
+
};
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import {
|
|
4
|
+
forwardRef,
|
|
5
|
+
useMemo
|
|
6
|
+
} from "react";
|
|
7
|
+
import { cn } from "../../lib/utils";
|
|
8
|
+
const DEFAULT_TICK_COUNT = 8;
|
|
9
|
+
const COLOR_CLASSES = {
|
|
10
|
+
amber: {
|
|
11
|
+
accent: "bg-amber-500",
|
|
12
|
+
chip: "bg-amber-500/15 text-amber-700 dark:text-amber-300",
|
|
13
|
+
marker: "border-amber-500 bg-amber-500"
|
|
14
|
+
},
|
|
15
|
+
blue: {
|
|
16
|
+
accent: "bg-blue-500",
|
|
17
|
+
chip: "bg-blue-500/15 text-blue-700 dark:text-blue-300",
|
|
18
|
+
marker: "border-blue-500 bg-blue-500"
|
|
19
|
+
},
|
|
20
|
+
emerald: {
|
|
21
|
+
accent: "bg-emerald-500",
|
|
22
|
+
chip: "bg-emerald-500/15 text-emerald-700 dark:text-emerald-300",
|
|
23
|
+
marker: "border-emerald-500 bg-emerald-500"
|
|
24
|
+
},
|
|
25
|
+
neutral: {
|
|
26
|
+
accent: "bg-muted-foreground/40",
|
|
27
|
+
chip: "bg-muted text-muted-foreground",
|
|
28
|
+
marker: "border-muted-foreground bg-muted-foreground"
|
|
29
|
+
},
|
|
30
|
+
purple: {
|
|
31
|
+
accent: "bg-purple-500",
|
|
32
|
+
chip: "bg-purple-500/15 text-purple-700 dark:text-purple-300",
|
|
33
|
+
marker: "border-purple-500 bg-purple-500"
|
|
34
|
+
},
|
|
35
|
+
red: {
|
|
36
|
+
accent: "bg-red-500",
|
|
37
|
+
chip: "bg-red-500/15 text-red-700 dark:text-red-300",
|
|
38
|
+
marker: "border-red-500 bg-red-500"
|
|
39
|
+
},
|
|
40
|
+
rose: {
|
|
41
|
+
accent: "bg-rose-500",
|
|
42
|
+
chip: "bg-rose-500/15 text-rose-700 dark:text-rose-300",
|
|
43
|
+
marker: "border-rose-500 bg-rose-500"
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
const DEFAULT_LABELS = {
|
|
47
|
+
region: "Parallel timeline"
|
|
48
|
+
};
|
|
49
|
+
function clamp(value, min, max) {
|
|
50
|
+
return Math.min(Math.max(value, min), max);
|
|
51
|
+
}
|
|
52
|
+
function formatYear(year) {
|
|
53
|
+
if (year < 0) return `${Math.abs(year).toString()} BCE`;
|
|
54
|
+
return `${year.toString()} CE`;
|
|
55
|
+
}
|
|
56
|
+
function yearToPercent(year, start, end) {
|
|
57
|
+
const span = end - start;
|
|
58
|
+
if (span <= 0) return 0;
|
|
59
|
+
return clamp((year - start) / span * 100, 0, 100);
|
|
60
|
+
}
|
|
61
|
+
function buildTicks(start, end, count) {
|
|
62
|
+
const safeCount = Math.max(2, count);
|
|
63
|
+
const span = end - start;
|
|
64
|
+
if (span <= 0) return [];
|
|
65
|
+
const step = span / (safeCount - 1);
|
|
66
|
+
return Array.from({ length: safeCount }).map((_, index) => {
|
|
67
|
+
const year = Math.round(start + step * index);
|
|
68
|
+
return {
|
|
69
|
+
label: formatYear(year),
|
|
70
|
+
offset: yearToPercent(year, start, end)
|
|
71
|
+
};
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
function Axis({ ticks }) {
|
|
75
|
+
return /* @__PURE__ */ jsx(
|
|
76
|
+
"div",
|
|
77
|
+
{
|
|
78
|
+
"aria-hidden": "true",
|
|
79
|
+
className: "relative h-7 border-b border-border text-[10px] font-medium uppercase tracking-wide text-muted-foreground",
|
|
80
|
+
children: ticks.map((tick) => /* @__PURE__ */ jsx(
|
|
81
|
+
"span",
|
|
82
|
+
{
|
|
83
|
+
className: "absolute top-1 -translate-x-1/2",
|
|
84
|
+
style: { left: `${tick.offset.toString()}%` },
|
|
85
|
+
children: tick.label
|
|
86
|
+
},
|
|
87
|
+
tick.label
|
|
88
|
+
))
|
|
89
|
+
}
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
function EraBands({ endYear, eras, startYear }) {
|
|
93
|
+
if (eras.length === 0) return null;
|
|
94
|
+
return /* @__PURE__ */ jsx("div", { "aria-hidden": "true", className: "pointer-events-none absolute inset-0", children: eras.map((era) => {
|
|
95
|
+
const left = yearToPercent(era.start, startYear, endYear);
|
|
96
|
+
const right = yearToPercent(era.end, startYear, endYear);
|
|
97
|
+
const width = Math.max(0, right - left);
|
|
98
|
+
if (width <= 0) return null;
|
|
99
|
+
const palette = COLOR_CLASSES[era.color ?? "neutral"];
|
|
100
|
+
return /* @__PURE__ */ jsx(
|
|
101
|
+
"div",
|
|
102
|
+
{
|
|
103
|
+
className: cn("absolute inset-y-0", palette.chip),
|
|
104
|
+
"data-era-id": era.id,
|
|
105
|
+
style: {
|
|
106
|
+
left: `${left.toString()}%`,
|
|
107
|
+
width: `${width.toString()}%`
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
era.id
|
|
111
|
+
);
|
|
112
|
+
}) });
|
|
113
|
+
}
|
|
114
|
+
function EventMarker({
|
|
115
|
+
color,
|
|
116
|
+
endYear,
|
|
117
|
+
event,
|
|
118
|
+
startYear
|
|
119
|
+
}) {
|
|
120
|
+
if (event.year < startYear || event.year > endYear) return null;
|
|
121
|
+
const left = yearToPercent(event.year, startYear, endYear);
|
|
122
|
+
const palette = COLOR_CLASSES[color];
|
|
123
|
+
const titleText = typeof event.title === "string" ? event.title : "";
|
|
124
|
+
const ariaLabel = titleText ? `${titleText}, ${formatYear(event.year)}` : void 0;
|
|
125
|
+
return /* @__PURE__ */ jsxs(
|
|
126
|
+
"div",
|
|
127
|
+
{
|
|
128
|
+
"aria-label": ariaLabel,
|
|
129
|
+
className: "absolute top-1/2 z-10 -translate-x-1/2 -translate-y-1/2",
|
|
130
|
+
"data-event-id": event.id,
|
|
131
|
+
"data-event-year": event.year,
|
|
132
|
+
style: { left: `${left.toString()}%` },
|
|
133
|
+
children: [
|
|
134
|
+
/* @__PURE__ */ jsx(
|
|
135
|
+
"div",
|
|
136
|
+
{
|
|
137
|
+
"aria-hidden": "true",
|
|
138
|
+
className: cn(
|
|
139
|
+
"h-3 w-3 rounded-full border-2 ring-2 ring-background",
|
|
140
|
+
palette.marker
|
|
141
|
+
)
|
|
142
|
+
}
|
|
143
|
+
),
|
|
144
|
+
/* @__PURE__ */ jsxs("div", { className: "absolute left-1/2 top-4 w-40 -translate-x-1/2 text-center", children: [
|
|
145
|
+
/* @__PURE__ */ jsx("p", { className: "truncate text-xs font-medium text-foreground", children: event.title }),
|
|
146
|
+
/* @__PURE__ */ jsxs("p", { className: "truncate text-[10px] text-muted-foreground", children: [
|
|
147
|
+
formatYear(event.year),
|
|
148
|
+
event.meta ? /* @__PURE__ */ jsxs("span", { children: [
|
|
149
|
+
" \xB7 ",
|
|
150
|
+
event.meta
|
|
151
|
+
] }) : null
|
|
152
|
+
] })
|
|
153
|
+
] })
|
|
154
|
+
]
|
|
155
|
+
}
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
function TrackRow({ endYear, startYear, track }) {
|
|
159
|
+
const color = track.color ?? "neutral";
|
|
160
|
+
const palette = COLOR_CLASSES[color];
|
|
161
|
+
return /* @__PURE__ */ jsxs("div", { className: "relative flex items-stretch gap-3 border-t border-border first:border-t-0", children: [
|
|
162
|
+
/* @__PURE__ */ jsxs("div", { className: "flex w-32 shrink-0 flex-col gap-1 border-r border-border bg-muted/20 px-3 py-3", children: [
|
|
163
|
+
/* @__PURE__ */ jsx(
|
|
164
|
+
"span",
|
|
165
|
+
{
|
|
166
|
+
"aria-hidden": "true",
|
|
167
|
+
className: cn("h-1 w-8 rounded-full", palette.accent)
|
|
168
|
+
}
|
|
169
|
+
),
|
|
170
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-semibold tracking-tight text-foreground", children: track.name }),
|
|
171
|
+
track.region ? /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: track.region }) : null
|
|
172
|
+
] }),
|
|
173
|
+
/* @__PURE__ */ jsxs(
|
|
174
|
+
"div",
|
|
175
|
+
{
|
|
176
|
+
"aria-label": typeof track.name === "string" ? track.name : void 0,
|
|
177
|
+
className: "relative h-16 min-w-0 flex-1",
|
|
178
|
+
"data-track-id": track.id,
|
|
179
|
+
children: [
|
|
180
|
+
/* @__PURE__ */ jsx("div", { className: "absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-border" }),
|
|
181
|
+
track.events.map((event) => /* @__PURE__ */ jsx(
|
|
182
|
+
EventMarker,
|
|
183
|
+
{
|
|
184
|
+
color,
|
|
185
|
+
endYear,
|
|
186
|
+
event,
|
|
187
|
+
startYear
|
|
188
|
+
},
|
|
189
|
+
event.id
|
|
190
|
+
))
|
|
191
|
+
]
|
|
192
|
+
}
|
|
193
|
+
)
|
|
194
|
+
] });
|
|
195
|
+
}
|
|
196
|
+
const ParallelTimeline = forwardRef(
|
|
197
|
+
(props, ref) => {
|
|
198
|
+
const {
|
|
199
|
+
className,
|
|
200
|
+
endYear,
|
|
201
|
+
eras = [],
|
|
202
|
+
labels,
|
|
203
|
+
startYear,
|
|
204
|
+
tickCount = DEFAULT_TICK_COUNT,
|
|
205
|
+
tracks,
|
|
206
|
+
...rest
|
|
207
|
+
} = props;
|
|
208
|
+
const resolvedLabels = useMemo(
|
|
209
|
+
() => ({ ...DEFAULT_LABELS, ...labels }),
|
|
210
|
+
[labels]
|
|
211
|
+
);
|
|
212
|
+
const ticks = useMemo(
|
|
213
|
+
() => buildTicks(startYear, endYear, tickCount),
|
|
214
|
+
[endYear, startYear, tickCount]
|
|
215
|
+
);
|
|
216
|
+
return /* @__PURE__ */ jsxs(
|
|
217
|
+
"section",
|
|
218
|
+
{
|
|
219
|
+
"aria-label": resolvedLabels.region,
|
|
220
|
+
className: cn(
|
|
221
|
+
"flex w-full flex-col overflow-x-auto rounded-2xl border bg-background text-foreground",
|
|
222
|
+
className
|
|
223
|
+
),
|
|
224
|
+
ref,
|
|
225
|
+
...rest,
|
|
226
|
+
children: [
|
|
227
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-stretch gap-3 border-b border-border", children: [
|
|
228
|
+
/* @__PURE__ */ jsx("div", { "aria-hidden": "true", className: "w-32 shrink-0" }),
|
|
229
|
+
/* @__PURE__ */ jsx(Axis, { ticks })
|
|
230
|
+
] }),
|
|
231
|
+
/* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
232
|
+
/* @__PURE__ */ jsx(EraBands, { endYear, eras, startYear }),
|
|
233
|
+
tracks.map((track) => /* @__PURE__ */ jsx(
|
|
234
|
+
TrackRow,
|
|
235
|
+
{
|
|
236
|
+
endYear,
|
|
237
|
+
startYear,
|
|
238
|
+
track
|
|
239
|
+
},
|
|
240
|
+
track.id
|
|
241
|
+
))
|
|
242
|
+
] })
|
|
243
|
+
]
|
|
244
|
+
}
|
|
245
|
+
);
|
|
246
|
+
}
|
|
247
|
+
);
|
|
248
|
+
ParallelTimeline.displayName = "ParallelTimeline";
|
|
249
|
+
export {
|
|
250
|
+
ParallelTimeline
|
|
251
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import {
|
|
4
|
+
forwardRef
|
|
5
|
+
} from "react";
|
|
6
|
+
import { cn } from "../../lib/utils";
|
|
7
|
+
const KIND_GLYPH = {
|
|
8
|
+
agent: "\u25C7",
|
|
9
|
+
artifact: "\u25CC",
|
|
10
|
+
input: "\u2198",
|
|
11
|
+
output: "\u2197",
|
|
12
|
+
run: "\u25B6",
|
|
13
|
+
task: "\u25A2"
|
|
14
|
+
};
|
|
15
|
+
const KIND_LABEL = {
|
|
16
|
+
agent: "Agent",
|
|
17
|
+
artifact: "Artifact",
|
|
18
|
+
input: "Input",
|
|
19
|
+
output: "Output",
|
|
20
|
+
run: "Run",
|
|
21
|
+
task: "Task"
|
|
22
|
+
};
|
|
23
|
+
const DEFAULT_LABELS = {
|
|
24
|
+
region: "Playback ghost"
|
|
25
|
+
};
|
|
26
|
+
const clamp01 = (v) => {
|
|
27
|
+
if (v < 0) {
|
|
28
|
+
return 0;
|
|
29
|
+
}
|
|
30
|
+
if (v > 1) {
|
|
31
|
+
return 1;
|
|
32
|
+
}
|
|
33
|
+
return v;
|
|
34
|
+
};
|
|
35
|
+
const PlaybackGhost = forwardRef(
|
|
36
|
+
(props, ref) => {
|
|
37
|
+
const {
|
|
38
|
+
className,
|
|
39
|
+
kind,
|
|
40
|
+
label,
|
|
41
|
+
labels,
|
|
42
|
+
opacity = 0.4,
|
|
43
|
+
size = 40,
|
|
44
|
+
x,
|
|
45
|
+
y,
|
|
46
|
+
...rest
|
|
47
|
+
} = props;
|
|
48
|
+
const resolvedLabels = { ...DEFAULT_LABELS, ...labels };
|
|
49
|
+
const safeOpacity = clamp01(opacity);
|
|
50
|
+
const safeSize = size < 16 ? 16 : size;
|
|
51
|
+
const ariaLabel = kind ? `${resolvedLabels.region}: ${KIND_LABEL[kind]}` : resolvedLabels.region;
|
|
52
|
+
return /* @__PURE__ */ jsxs(
|
|
53
|
+
"div",
|
|
54
|
+
{
|
|
55
|
+
"aria-label": ariaLabel,
|
|
56
|
+
className: cn(
|
|
57
|
+
"pointer-events-none absolute z-10 inline-flex -translate-x-1/2 -translate-y-1/2 items-center justify-center gap-1.5 rounded-md border border-dashed border-border/70 bg-background/40 px-2 py-1 text-xs text-foreground backdrop-blur-sm",
|
|
58
|
+
className
|
|
59
|
+
),
|
|
60
|
+
"data-playback-ghost": true,
|
|
61
|
+
"data-playback-kind": kind ?? "unknown",
|
|
62
|
+
ref,
|
|
63
|
+
role: "img",
|
|
64
|
+
style: {
|
|
65
|
+
left: x,
|
|
66
|
+
minHeight: safeSize,
|
|
67
|
+
minWidth: safeSize,
|
|
68
|
+
opacity: safeOpacity,
|
|
69
|
+
top: y
|
|
70
|
+
},
|
|
71
|
+
...rest,
|
|
72
|
+
children: [
|
|
73
|
+
kind ? /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "text-muted-foreground", children: KIND_GLYPH[kind] }) : null,
|
|
74
|
+
label ? /* @__PURE__ */ jsx("span", { className: "truncate", "data-playback-ghost-label": true, children: label }) : null
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
PlaybackGhost.displayName = "PlaybackGhost";
|
|
81
|
+
export {
|
|
82
|
+
PlaybackGhost
|
|
83
|
+
};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import {
|
|
4
|
+
forwardRef
|
|
5
|
+
} from "react";
|
|
6
|
+
import { cn } from "../../lib/utils";
|
|
7
|
+
const STATUS_LABEL = {
|
|
8
|
+
advisory: "Advisory",
|
|
9
|
+
disabled: "Disabled",
|
|
10
|
+
enforced: "Enforced"
|
|
11
|
+
};
|
|
12
|
+
const STATUS_TONE = {
|
|
13
|
+
advisory: "border-amber-500/40 bg-amber-500/10 text-amber-700 dark:text-amber-300",
|
|
14
|
+
disabled: "border-border bg-muted/40 text-muted-foreground",
|
|
15
|
+
enforced: "border-emerald-500/40 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300"
|
|
16
|
+
};
|
|
17
|
+
const DEFAULT_LABELS = {
|
|
18
|
+
empty: "No policies",
|
|
19
|
+
region: "Policy delivery"
|
|
20
|
+
};
|
|
21
|
+
const RowBody = (props) => {
|
|
22
|
+
const { policy } = props;
|
|
23
|
+
return /* @__PURE__ */ jsxs("span", { className: "flex flex-1 flex-col gap-0.5 text-left", children: [
|
|
24
|
+
/* @__PURE__ */ jsxs("span", { className: "flex items-center justify-between gap-2", children: [
|
|
25
|
+
/* @__PURE__ */ jsx("span", { className: "truncate text-xs font-medium text-foreground", children: policy.name }),
|
|
26
|
+
/* @__PURE__ */ jsx(
|
|
27
|
+
"span",
|
|
28
|
+
{
|
|
29
|
+
className: cn(
|
|
30
|
+
"rounded-full border px-1.5 py-0.5 text-[10px] uppercase tracking-wide",
|
|
31
|
+
STATUS_TONE[policy.status]
|
|
32
|
+
),
|
|
33
|
+
children: STATUS_LABEL[policy.status]
|
|
34
|
+
}
|
|
35
|
+
)
|
|
36
|
+
] }),
|
|
37
|
+
policy.description ? /* @__PURE__ */ jsx("span", { className: "truncate text-[10px] text-muted-foreground", children: policy.description }) : null
|
|
38
|
+
] });
|
|
39
|
+
};
|
|
40
|
+
const Row = (props) => {
|
|
41
|
+
const { policy } = props;
|
|
42
|
+
if (policy.onToggle) {
|
|
43
|
+
const handleClick = () => {
|
|
44
|
+
policy.onToggle?.();
|
|
45
|
+
};
|
|
46
|
+
return /* @__PURE__ */ jsx(
|
|
47
|
+
"button",
|
|
48
|
+
{
|
|
49
|
+
className: "flex w-full items-center gap-2 rounded-md border border-transparent px-2 py-1.5 text-left transition-colors hover:border-border hover:bg-muted/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
50
|
+
"data-policy-row": policy.id,
|
|
51
|
+
"data-policy-status": policy.status,
|
|
52
|
+
onClick: handleClick,
|
|
53
|
+
type: "button",
|
|
54
|
+
children: /* @__PURE__ */ jsx(RowBody, { policy })
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
return /* @__PURE__ */ jsx(
|
|
59
|
+
"div",
|
|
60
|
+
{
|
|
61
|
+
className: "flex w-full items-center gap-2 rounded-md px-2 py-1.5",
|
|
62
|
+
"data-policy-row": policy.id,
|
|
63
|
+
"data-policy-status": policy.status,
|
|
64
|
+
children: /* @__PURE__ */ jsx(RowBody, { policy })
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
};
|
|
68
|
+
const PolicyDeliveryPanel = forwardRef((props, ref) => {
|
|
69
|
+
const { className, labels, policies, title = "Policies", ...rest } = props;
|
|
70
|
+
const resolvedLabels = { ...DEFAULT_LABELS, ...labels };
|
|
71
|
+
return /* @__PURE__ */ jsxs(
|
|
72
|
+
"section",
|
|
73
|
+
{
|
|
74
|
+
"aria-label": resolvedLabels.region,
|
|
75
|
+
className: cn(
|
|
76
|
+
"flex w-full flex-col gap-2 rounded-lg border bg-background p-3 text-foreground",
|
|
77
|
+
className
|
|
78
|
+
),
|
|
79
|
+
"data-policy-delivery-panel": true,
|
|
80
|
+
ref,
|
|
81
|
+
...rest,
|
|
82
|
+
children: [
|
|
83
|
+
/* @__PURE__ */ jsx("header", { children: /* @__PURE__ */ jsx("h3", { className: "text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: title }) }),
|
|
84
|
+
policies.length === 0 ? /* @__PURE__ */ jsx(
|
|
85
|
+
"p",
|
|
86
|
+
{
|
|
87
|
+
className: "px-2 py-3 text-center text-xs text-muted-foreground",
|
|
88
|
+
"data-policy-state": "empty",
|
|
89
|
+
children: resolvedLabels.empty
|
|
90
|
+
}
|
|
91
|
+
) : /* @__PURE__ */ jsx("ul", { className: "space-y-0.5", children: policies.map((policy) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Row, { policy }) }, policy.id)) })
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
);
|
|
95
|
+
});
|
|
96
|
+
PolicyDeliveryPanel.displayName = "PolicyDeliveryPanel";
|
|
97
|
+
export {
|
|
98
|
+
PolicyDeliveryPanel
|
|
99
|
+
};
|