@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,104 @@
1
+ "use client";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import {
4
+ forwardRef
5
+ } from "react";
6
+ import { cn } from "../../lib/utils";
7
+ const DEFAULT_LABELS = {
8
+ region: "Comment",
9
+ unreadSuffix: "unread"
10
+ };
11
+ const STATE_FILL = {
12
+ open: "bg-foreground text-background",
13
+ resolved: "bg-muted text-muted-foreground"
14
+ };
15
+ const PinBody = (props) => {
16
+ const showBadge = typeof props.unread === "number" && props.unread > 0;
17
+ const useAccent = props.accent && props.state === "open";
18
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
19
+ /* @__PURE__ */ jsx(
20
+ "span",
21
+ {
22
+ "aria-hidden": "true",
23
+ className: cn(
24
+ "flex h-7 w-7 items-center justify-center rounded-full border border-background text-[11px] font-semibold shadow-sm",
25
+ STATE_FILL[props.state]
26
+ ),
27
+ "data-comment-pin-body": true,
28
+ style: useAccent ? { backgroundColor: props.accent, color: "white" } : void 0,
29
+ children: props.authorInitial ?? "\u2022"
30
+ }
31
+ ),
32
+ showBadge ? /* @__PURE__ */ jsx(
33
+ "span",
34
+ {
35
+ "aria-hidden": "true",
36
+ className: "absolute -right-1 -top-1 inline-flex min-h-[14px] min-w-[14px] items-center justify-center rounded-full bg-red-500 px-1 text-[9px] font-medium text-white",
37
+ "data-comment-pin-unread": true,
38
+ children: props.unread
39
+ }
40
+ ) : null
41
+ ] });
42
+ };
43
+ const CommentPin = forwardRef(
44
+ (props, ref) => {
45
+ const {
46
+ authorInitial,
47
+ className,
48
+ color,
49
+ labels,
50
+ onActivate,
51
+ state = "open",
52
+ unread,
53
+ x,
54
+ y,
55
+ ...rest
56
+ } = props;
57
+ const resolvedLabels = { ...DEFAULT_LABELS, ...labels };
58
+ const showBadge = typeof unread === "number" && unread > 0;
59
+ const ariaLabel = showBadge ? `${resolvedLabels.region}, ${unread} ${resolvedLabels.unreadSuffix}` : resolvedLabels.region;
60
+ const handleClick = () => {
61
+ onActivate?.();
62
+ };
63
+ const body = /* @__PURE__ */ jsx(
64
+ PinBody,
65
+ {
66
+ accent: color,
67
+ authorInitial,
68
+ state,
69
+ unread
70
+ }
71
+ );
72
+ return /* @__PURE__ */ jsx(
73
+ "div",
74
+ {
75
+ "aria-label": ariaLabel,
76
+ className: cn(
77
+ "absolute z-30 inline-flex -translate-x-1/2 -translate-y-1/2",
78
+ className
79
+ ),
80
+ "data-comment-pin": true,
81
+ "data-comment-pin-state": state,
82
+ ref,
83
+ role: "img",
84
+ style: { left: x, top: y },
85
+ ...rest,
86
+ children: onActivate ? /* @__PURE__ */ jsx(
87
+ "button",
88
+ {
89
+ "aria-label": ariaLabel,
90
+ className: "relative inline-flex rounded-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
91
+ "data-comment-pin-trigger": true,
92
+ onClick: handleClick,
93
+ type: "button",
94
+ children: body
95
+ }
96
+ ) : /* @__PURE__ */ jsx("span", { className: "relative inline-flex", children: body })
97
+ }
98
+ );
99
+ }
100
+ );
101
+ CommentPin.displayName = "CommentPin";
102
+ export {
103
+ CommentPin
104
+ };
@@ -0,0 +1,6 @@
1
+ import {
2
+ CommentPin
3
+ } from "./comment-pin";
4
+ export {
5
+ CommentPin
6
+ };
@@ -0,0 +1,98 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { forwardRef, useId } from "react";
4
+ import { cn } from "../../lib/utils";
5
+ const DEFAULT_LABELS = {
6
+ region: "Context lens"
7
+ };
8
+ const clamp01 = (value) => {
9
+ if (value < 0) {
10
+ return 0;
11
+ }
12
+ if (value > 1) {
13
+ return 1;
14
+ }
15
+ return value;
16
+ };
17
+ const safeRadius = (value) => value < 0 ? 0 : value;
18
+ const ContextLens = forwardRef(
19
+ (props, ref) => {
20
+ const { className, focus, labels, opacity = 0.55, ...rest } = props;
21
+ const maskId = useId();
22
+ if (!focus) {
23
+ return null;
24
+ }
25
+ const resolvedLabels = { ...DEFAULT_LABELS, ...labels };
26
+ const inner = safeRadius(focus.inner);
27
+ const outer = safeRadius(Math.max(focus.outer, inner));
28
+ const fillOpacity = clamp01(opacity);
29
+ return /* @__PURE__ */ jsxs(
30
+ "svg",
31
+ {
32
+ "aria-hidden": "true",
33
+ "aria-label": resolvedLabels.region,
34
+ className: cn(
35
+ "pointer-events-none absolute inset-0 z-20 h-full w-full",
36
+ className
37
+ ),
38
+ "data-context-lens": true,
39
+ ref,
40
+ ...rest,
41
+ children: [
42
+ /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs(
43
+ "radialGradient",
44
+ {
45
+ cx: focus.cx,
46
+ cy: focus.cy,
47
+ "data-context-lens-gradient": true,
48
+ gradientUnits: "userSpaceOnUse",
49
+ id: maskId,
50
+ r: outer === 0 ? 1 : outer,
51
+ children: [
52
+ /* @__PURE__ */ jsx("stop", { offset: "0%", stopColor: "black", stopOpacity: 0 }),
53
+ /* @__PURE__ */ jsx(
54
+ "stop",
55
+ {
56
+ offset: outer === 0 ? "100%" : `${inner / outer * 100}%`,
57
+ stopColor: "black",
58
+ stopOpacity: 0
59
+ }
60
+ ),
61
+ /* @__PURE__ */ jsx("stop", { offset: "100%", stopColor: "black", stopOpacity: 1 })
62
+ ]
63
+ }
64
+ ) }),
65
+ /* @__PURE__ */ jsx(
66
+ "rect",
67
+ {
68
+ "data-context-lens-dim": true,
69
+ fill: "black",
70
+ fillOpacity,
71
+ height: "100%",
72
+ mask: `url(#${maskId}-mask)`,
73
+ width: "100%",
74
+ x: 0,
75
+ y: 0
76
+ }
77
+ ),
78
+ /* @__PURE__ */ jsxs("mask", { id: `${maskId}-mask`, children: [
79
+ /* @__PURE__ */ jsx("rect", { fill: "white", height: "100%", width: "100%", x: 0, y: 0 }),
80
+ /* @__PURE__ */ jsx(
81
+ "circle",
82
+ {
83
+ cx: focus.cx,
84
+ cy: focus.cy,
85
+ fill: `url(#${maskId})`,
86
+ r: outer
87
+ }
88
+ )
89
+ ] })
90
+ ]
91
+ }
92
+ );
93
+ }
94
+ );
95
+ ContextLens.displayName = "ContextLens";
96
+ export {
97
+ ContextLens
98
+ };
@@ -0,0 +1,6 @@
1
+ import {
2
+ ContextLens
3
+ } from "./context-lens";
4
+ export {
5
+ ContextLens
6
+ };
@@ -0,0 +1,189 @@
1
+ "use client";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import {
4
+ forwardRef,
5
+ useCallback,
6
+ useEffect,
7
+ useRef,
8
+ useState
9
+ } from "react";
10
+ import { Check, Copy } from "lucide-react";
11
+ import { cn } from "../../lib/utils";
12
+ import { Button } from "../button/button";
13
+ import {
14
+ Tooltip,
15
+ TooltipContent,
16
+ TooltipProvider,
17
+ TooltipTrigger
18
+ } from "../tooltip/tooltip";
19
+ const FALLBACK_TIMEOUT_MS = 2e3;
20
+ function useCopyToClipboard(options = {}) {
21
+ const { timeout = FALLBACK_TIMEOUT_MS } = options;
22
+ const [copied, setCopied] = useState(false);
23
+ const timerRef = useRef(void 0);
24
+ useEffect(() => {
25
+ return () => {
26
+ if (timerRef.current !== void 0) {
27
+ clearTimeout(timerRef.current);
28
+ }
29
+ };
30
+ }, []);
31
+ const reset = useCallback(() => {
32
+ if (timerRef.current !== void 0) clearTimeout(timerRef.current);
33
+ setCopied(false);
34
+ }, []);
35
+ const copy = useCallback(
36
+ async (value) => {
37
+ try {
38
+ if (typeof navigator === "undefined" || typeof navigator.clipboard?.writeText !== "function") {
39
+ return false;
40
+ }
41
+ await navigator.clipboard.writeText(value);
42
+ if (timerRef.current !== void 0) clearTimeout(timerRef.current);
43
+ setCopied(true);
44
+ timerRef.current = setTimeout(() => {
45
+ setCopied(false);
46
+ }, timeout);
47
+ return true;
48
+ } catch {
49
+ return false;
50
+ }
51
+ },
52
+ [timeout]
53
+ );
54
+ return { copied, copy, reset };
55
+ }
56
+ function CopyIcon({
57
+ className,
58
+ copied,
59
+ size
60
+ }) {
61
+ const Icon = copied ? Check : Copy;
62
+ const sizeClass = size === "xs" ? "h-3 w-3" : "h-4 w-4";
63
+ return /* @__PURE__ */ jsx(Icon, { "aria-hidden": "true", className: cn(sizeClass, className) });
64
+ }
65
+ const ButtonTrigger = forwardRef(
66
+ ({
67
+ accessibleLabel,
68
+ className,
69
+ copied,
70
+ copiedText,
71
+ iconClassName,
72
+ label = "Copy",
73
+ onClick: _onClick,
74
+ onClickHandler,
75
+ value: _value,
76
+ variant = "icon",
77
+ ...rest
78
+ }, ref) => {
79
+ if (variant === "button") {
80
+ return /* @__PURE__ */ jsxs(
81
+ Button,
82
+ {
83
+ "aria-label": accessibleLabel,
84
+ className: cn(className),
85
+ onClick: onClickHandler,
86
+ ref,
87
+ size: "sm",
88
+ type: "button",
89
+ variant: "outline",
90
+ ...rest,
91
+ children: [
92
+ /* @__PURE__ */ jsx(CopyIcon, { className: iconClassName, copied, size: "sm" }),
93
+ /* @__PURE__ */ jsx("span", { children: copied ? copiedText : label })
94
+ ]
95
+ }
96
+ );
97
+ }
98
+ if (variant === "inline") {
99
+ return /* @__PURE__ */ jsx(
100
+ Button,
101
+ {
102
+ "aria-label": accessibleLabel,
103
+ className: cn(
104
+ "h-6 w-6 align-middle text-muted-foreground hover:text-foreground",
105
+ className
106
+ ),
107
+ onClick: onClickHandler,
108
+ ref,
109
+ size: "icon",
110
+ type: "button",
111
+ variant: "ghost",
112
+ ...rest,
113
+ children: /* @__PURE__ */ jsx(CopyIcon, { className: iconClassName, copied, size: "xs" })
114
+ }
115
+ );
116
+ }
117
+ return /* @__PURE__ */ jsx(
118
+ Button,
119
+ {
120
+ "aria-label": accessibleLabel,
121
+ className: cn("h-8 w-8", className),
122
+ onClick: onClickHandler,
123
+ ref,
124
+ size: "icon",
125
+ type: "button",
126
+ variant: "ghost",
127
+ ...rest,
128
+ children: /* @__PURE__ */ jsx(CopyIcon, { className: iconClassName, copied, size: "sm" })
129
+ }
130
+ );
131
+ }
132
+ );
133
+ ButtonTrigger.displayName = "CopyButton.Trigger";
134
+ const CopyButton = forwardRef(
135
+ ({
136
+ "aria-label": ariaLabelOverride,
137
+ copiedLabel = "Copied!",
138
+ label = "Copy",
139
+ onClick,
140
+ showTooltip = true,
141
+ timeout = FALLBACK_TIMEOUT_MS,
142
+ value,
143
+ ...rest
144
+ }, ref) => {
145
+ const { copied, copy } = useCopyToClipboard({ timeout });
146
+ const handleClick = useCallback(
147
+ (event) => {
148
+ onClick?.(event);
149
+ if (event.defaultPrevented) return;
150
+ void copy(value);
151
+ },
152
+ [copy, onClick, value]
153
+ );
154
+ const accessibleLabel = ariaLabelOverride ?? (copied ? copiedLabel : label);
155
+ const tooltipText = copied ? copiedLabel : label;
156
+ const trigger = /* @__PURE__ */ jsx(
157
+ ButtonTrigger,
158
+ {
159
+ ...rest,
160
+ accessibleLabel,
161
+ copied,
162
+ copiedText: copiedLabel,
163
+ label,
164
+ onClickHandler: handleClick,
165
+ ref,
166
+ value
167
+ }
168
+ );
169
+ const liveRegion = /* @__PURE__ */ jsx("span", { "aria-live": "polite", className: "sr-only", role: "status", children: copied ? copiedLabel : "" });
170
+ if (!showTooltip) {
171
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
172
+ trigger,
173
+ liveRegion
174
+ ] });
175
+ }
176
+ return /* @__PURE__ */ jsxs(TooltipProvider, { delayDuration: 200, children: [
177
+ /* @__PURE__ */ jsxs(Tooltip, { children: [
178
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: trigger }),
179
+ /* @__PURE__ */ jsx(TooltipContent, { children: tooltipText })
180
+ ] }),
181
+ liveRegion
182
+ ] });
183
+ }
184
+ );
185
+ CopyButton.displayName = "CopyButton";
186
+ export {
187
+ CopyButton,
188
+ useCopyToClipboard
189
+ };
@@ -0,0 +1,8 @@
1
+ import {
2
+ CopyButton,
3
+ useCopyToClipboard
4
+ } from "./copy-button";
5
+ export {
6
+ CopyButton,
7
+ useCopyToClipboard
8
+ };
@@ -0,0 +1,111 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import {
3
+ forwardRef
4
+ } from "react";
5
+ import { cva } from "class-variance-authority";
6
+ import { cn } from "../../lib/utils";
7
+ const navVariants = cva("grid w-full gap-3 text-sm sm:grid-cols-2", {
8
+ defaultVariants: {
9
+ variant: "with-title"
10
+ },
11
+ variants: {
12
+ variant: {
13
+ compact: "",
14
+ "with-meta": "",
15
+ "with-title": ""
16
+ }
17
+ }
18
+ });
19
+ const itemVariants = cva(
20
+ "group flex flex-col gap-1 rounded-lg border border-border bg-background p-4 text-foreground transition-colors hover:border-foreground/30 hover:bg-accent/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
21
+ {
22
+ defaultVariants: {
23
+ side: "previous"
24
+ },
25
+ variants: {
26
+ side: {
27
+ next: "items-end text-right sm:col-start-2",
28
+ previous: "items-start text-left"
29
+ }
30
+ }
31
+ }
32
+ );
33
+ const DEFAULT_LABELS = {
34
+ navigation: "Document navigation",
35
+ next: "Newer",
36
+ previous: "Older"
37
+ };
38
+ function SiblingItem({
39
+ ariaLabel,
40
+ caption,
41
+ link,
42
+ side,
43
+ variant
44
+ }) {
45
+ const { anchorProps, href, meta, title } = link;
46
+ return /* @__PURE__ */ jsxs(
47
+ "a",
48
+ {
49
+ "aria-label": ariaLabel,
50
+ className: cn(itemVariants({ side })),
51
+ href,
52
+ ...anchorProps,
53
+ children: [
54
+ /* @__PURE__ */ jsx("span", { className: "text-xs font-medium uppercase tracking-wide text-muted-foreground", children: caption }),
55
+ variant === "compact" ? null : /* @__PURE__ */ jsx("span", { className: "line-clamp-2 text-sm font-semibold text-foreground group-hover:underline", children: title }),
56
+ variant === "with-meta" && meta ? /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: meta }) : null
57
+ ]
58
+ }
59
+ );
60
+ }
61
+ function buildAriaLabel(caption, link, variant) {
62
+ if (variant === "compact" || typeof link.title !== "string") {
63
+ return caption;
64
+ }
65
+ return `${caption}: ${link.title}`;
66
+ }
67
+ const DocumentSiblingNav = forwardRef(({ className, labels, next, previous, variant, ...rest }, ref) => {
68
+ if (!previous && !next) return null;
69
+ const resolvedVariant = variant ?? "with-title";
70
+ const resolvedLabels = { ...DEFAULT_LABELS, ...labels };
71
+ return /* @__PURE__ */ jsxs(
72
+ "nav",
73
+ {
74
+ "aria-label": resolvedLabels.navigation,
75
+ className: cn(navVariants({ variant: resolvedVariant }), className),
76
+ ref,
77
+ ...rest,
78
+ children: [
79
+ previous ? /* @__PURE__ */ jsx(
80
+ SiblingItem,
81
+ {
82
+ ariaLabel: buildAriaLabel(
83
+ resolvedLabels.previous,
84
+ previous,
85
+ resolvedVariant
86
+ ),
87
+ caption: resolvedLabels.previous,
88
+ link: previous,
89
+ side: "previous",
90
+ variant: resolvedVariant
91
+ }
92
+ ) : /* @__PURE__ */ jsx("span", { "aria-hidden": "true" }),
93
+ next ? /* @__PURE__ */ jsx(
94
+ SiblingItem,
95
+ {
96
+ ariaLabel: buildAriaLabel(resolvedLabels.next, next, resolvedVariant),
97
+ caption: resolvedLabels.next,
98
+ link: next,
99
+ side: "next",
100
+ variant: resolvedVariant
101
+ }
102
+ ) : /* @__PURE__ */ jsx("span", { "aria-hidden": "true" })
103
+ ]
104
+ }
105
+ );
106
+ });
107
+ DocumentSiblingNav.displayName = "DocumentSiblingNav";
108
+ export {
109
+ DocumentSiblingNav,
110
+ navVariants as documentSiblingNavVariants
111
+ };
@@ -0,0 +1,8 @@
1
+ import {
2
+ DocumentSiblingNav,
3
+ documentSiblingNavVariants
4
+ } from "./document-sibling-nav";
5
+ export {
6
+ DocumentSiblingNav,
7
+ documentSiblingNavVariants
8
+ };
@@ -0,0 +1,93 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import {
3
+ forwardRef
4
+ } from "react";
5
+ import { cva } from "class-variance-authority";
6
+ import { cn } from "../../lib/utils";
7
+ const emptyStateVariants = cva(
8
+ "flex flex-col items-center justify-center gap-3 text-center text-foreground",
9
+ {
10
+ defaultVariants: {
11
+ size: "md"
12
+ },
13
+ variants: {
14
+ size: {
15
+ lg: "px-6 py-16",
16
+ md: "px-4 py-10",
17
+ sm: "px-3 py-6"
18
+ }
19
+ }
20
+ }
21
+ );
22
+ const titleVariants = cva("font-semibold tracking-tight", {
23
+ defaultVariants: {
24
+ size: "md"
25
+ },
26
+ variants: {
27
+ size: {
28
+ lg: "text-xl",
29
+ md: "text-lg",
30
+ sm: "text-base"
31
+ }
32
+ }
33
+ });
34
+ const descriptionVariants = cva("max-w-prose text-muted-foreground", {
35
+ defaultVariants: {
36
+ size: "md"
37
+ },
38
+ variants: {
39
+ size: {
40
+ lg: "text-base",
41
+ md: "text-sm",
42
+ sm: "text-xs"
43
+ }
44
+ }
45
+ });
46
+ const iconVariants = cva(
47
+ "mb-1 flex items-center justify-center rounded-full bg-muted text-muted-foreground [&_svg]:h-1/2 [&_svg]:w-1/2",
48
+ {
49
+ defaultVariants: {
50
+ size: "md"
51
+ },
52
+ variants: {
53
+ size: {
54
+ lg: "h-16 w-16",
55
+ md: "h-12 w-12",
56
+ sm: "h-8 w-8"
57
+ }
58
+ }
59
+ }
60
+ );
61
+ const EmptyState = forwardRef(
62
+ ({
63
+ children,
64
+ className,
65
+ description,
66
+ icon,
67
+ role: roleOverride,
68
+ size,
69
+ title,
70
+ ...rest
71
+ }, ref) => {
72
+ return /* @__PURE__ */ jsxs(
73
+ "div",
74
+ {
75
+ className: cn(emptyStateVariants({ size }), className),
76
+ ref,
77
+ role: roleOverride ?? "status",
78
+ ...rest,
79
+ children: [
80
+ icon ? /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: cn(iconVariants({ size })), children: icon }) : null,
81
+ title ? /* @__PURE__ */ jsx("h3", { className: cn(titleVariants({ size })), children: title }) : null,
82
+ description ? /* @__PURE__ */ jsx("p", { className: cn(descriptionVariants({ size })), children: description }) : null,
83
+ children ? /* @__PURE__ */ jsx("div", { className: "mt-2 flex flex-wrap items-center justify-center gap-2", children }) : null
84
+ ]
85
+ }
86
+ );
87
+ }
88
+ );
89
+ EmptyState.displayName = "EmptyState";
90
+ export {
91
+ EmptyState,
92
+ emptyStateVariants
93
+ };
@@ -0,0 +1,8 @@
1
+ import {
2
+ EmptyState,
3
+ emptyStateVariants
4
+ } from "./empty-state";
5
+ export {
6
+ EmptyState,
7
+ emptyStateVariants
8
+ };