@vllnt/ui 0.4.0-canary.sha3c8ee66 → 0.4.0-canary.sha4d4d033
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 +0 -55
- package/dist/components/atoms/agent-activity/agent-activity.js +1 -8
- package/dist/components/atoms/ai-streaming-text/ai-streaming-text.js +1 -1
- package/dist/components/atoms/alert-pulse/alert-pulse.js +1 -1
- package/dist/components/atoms/animated-tabs/animated-tabs.js +3 -15
- package/dist/components/atoms/animated-text/animated-text.js +7 -28
- package/dist/components/atoms/animated-tooltip/animated-tooltip.js +0 -10
- package/dist/components/atoms/border-beam/border-beam.js +4 -1
- package/dist/components/atoms/bottom-activity-strip/bottom-activity-strip.js +1 -2
- package/dist/components/atoms/chain-of-thought/chain-of-thought.js +1 -7
- package/dist/components/atoms/comment-pin/comment-pin.js +4 -7
- package/dist/components/atoms/comparison/comparison.js +2 -2
- package/dist/components/atoms/curriculum/curriculum.js +4 -6
- package/dist/components/atoms/cursor/cursor.js +9 -48
- package/dist/components/atoms/dock/dock.js +17 -75
- package/dist/components/atoms/drawer/drawer.js +0 -2
- package/dist/components/atoms/era-comparison/era-comparison.js +1 -1
- package/dist/components/atoms/follow-mode/follow-mode.js +6 -6
- package/dist/components/atoms/glass-progress/glass-progress.js +0 -1
- package/dist/components/atoms/handoff-beacon/handoff-beacon.js +1 -1
- package/dist/components/atoms/input-otp/input-otp.js +1 -1
- package/dist/components/atoms/key-concept/key-concept.js +2 -4
- package/dist/components/atoms/liquid-glass/liquid-glass.js +2 -1
- package/dist/components/atoms/list-box/list-box.js +4 -55
- package/dist/components/atoms/live-cursor/live-cursor.js +4 -9
- package/dist/components/atoms/magnetic/magnetic.js +14 -61
- package/dist/components/atoms/magnetic-button/magnetic-button.js +14 -61
- package/dist/components/atoms/marquee/marquee.js +30 -89
- package/dist/components/atoms/meteors/meteors.js +2 -2
- package/dist/components/atoms/object-handle/object-handle.js +1 -1
- package/dist/components/atoms/object-inspector/object-inspector.js +1 -1
- package/dist/components/atoms/order-book/order-book.js +5 -11
- package/dist/components/atoms/particles/particles.js +2 -2
- package/dist/components/atoms/playback-ghost/playback-ghost.js +4 -12
- package/dist/components/atoms/presence-stack/presence-stack.js +2 -7
- package/dist/components/atoms/presence-sync-indicator/presence-sync-indicator.js +2 -2
- package/dist/components/atoms/progress-bar/progress-bar.js +2 -2
- package/dist/components/atoms/prompt-input/prompt-input.js +1 -7
- package/dist/components/atoms/property-section/property-section.js +1 -1
- package/dist/components/atoms/qr-code/qr-code.js +3 -27
- package/dist/components/atoms/rating/rating.js +0 -11
- package/dist/components/atoms/reasoning/reasoning.js +7 -16
- package/dist/components/atoms/scramble-text/scramble-text.js +11 -5
- package/dist/components/atoms/scroll-area/scroll-area.js +13 -55
- package/dist/components/atoms/scroll-progress/scroll-progress.js +2 -11
- package/dist/components/atoms/search-field/search-field.js +2 -2
- package/dist/components/atoms/selection-halo/selection-halo.js +2 -10
- package/dist/components/atoms/selection-presence/selection-presence.js +1 -3
- package/dist/components/atoms/severity-badge/severity-badge.js +10 -10
- package/dist/components/atoms/shine-border/shine-border.js +4 -1
- package/dist/components/atoms/skeleton/skeleton.js +1 -4
- package/dist/components/atoms/slider/slider.js +1 -12
- package/dist/components/atoms/snap-guides/snap-guides.js +0 -1
- package/dist/components/atoms/sparkles/sparkles.js +2 -2
- package/dist/components/atoms/sparkline-grid/sparkline-grid.js +2 -2
- package/dist/components/atoms/spinner/spinner.js +1 -2
- package/dist/components/atoms/spinning-text/spinning-text.js +12 -14
- package/dist/components/atoms/spotlight-card/spotlight-card.js +11 -35
- package/dist/components/atoms/state-badge-overlay/state-badge-overlay.js +2 -2
- package/dist/components/atoms/status-indicator/status-indicator.js +1 -1
- package/dist/components/atoms/step-by-step/step-by-step.js +1 -1
- package/dist/components/atoms/tabs/tabs.js +11 -106
- package/dist/components/atoms/text-reveal/text-reveal.js +17 -32
- package/dist/components/atoms/theme-switcher/theme-switcher.js +1 -12
- package/dist/components/atoms/thinking-block/thinking-block.js +7 -9
- package/dist/components/atoms/thread-bubble/thread-bubble.js +1 -3
- package/dist/components/atoms/tilt-card/tilt-card.js +18 -63
- package/dist/components/atoms/tldr-section/tldr-section.js +6 -11
- package/dist/components/atoms/toast/toast.js +16 -15
- package/dist/components/atoms/toast/toaster.js +1 -7
- package/dist/components/atoms/typewriter/typewriter.js +1 -2
- package/dist/components/atoms/video-embed/video-embed.js +0 -2
- package/dist/components/atoms/view-switcher/view-switcher.js +43 -54
- package/dist/components/atoms/watchlist/watchlist.js +7 -8
- package/dist/components/atoms/workspace-switcher/workspace-switcher.js +10 -39
- package/dist/components/index.js +5 -13
- package/dist/components/molecules/ai-artifact/ai-artifact.js +1 -5
- package/dist/components/molecules/ai-chat-input/ai-chat-input.js +1 -7
- package/dist/components/molecules/ai-tool-call-display/ai-tool-call-display.js +1 -1
- package/dist/components/molecules/color-picker/color-picker.js +36 -45
- package/dist/components/molecules/command/command.js +14 -33
- package/dist/components/molecules/completion-dialog/completion-dialog.js +132 -91
- package/dist/components/molecules/content-intro/content-intro.js +1 -1
- package/dist/components/molecules/conversation-thread/conversation-thread.js +4 -5
- package/dist/components/molecules/copy-button/copy-button.js +44 -4
- package/dist/components/molecules/exercise/exercise.js +3 -3
- package/dist/components/molecules/file-upload/file-upload.js +34 -28
- package/dist/components/molecules/historical-figure-card/historical-figure-card.js +1 -1
- package/dist/components/molecules/inline-input/inline-input.js +0 -4
- package/dist/components/molecules/live-feed/live-feed.js +1 -1
- package/dist/components/molecules/newsletter-signup/newsletter-signup.js +1 -8
- package/dist/components/molecules/number-input/number-input.js +0 -6
- package/dist/components/molecules/pagination/pagination.js +12 -44
- package/dist/components/molecules/progress-card/progress-card.js +6 -8
- package/dist/components/molecules/search-bar/search-bar.js +5 -9
- package/dist/components/molecules/stat-card/stat-card.js +2 -2
- package/dist/components/molecules/ticker-tape/ticker-tape.js +10 -38
- package/dist/components/molecules/time-picker/time-picker.js +26 -65
- package/dist/components/molecules/tour/tour.js +6 -14
- package/dist/components/molecules/transaction-list/transaction-list.js +1 -1
- package/dist/components/molecules/tutorial-card/tutorial-card.js +6 -8
- package/dist/components/organisms/candlestick-chart/candlestick-chart.js +2 -2
- package/dist/components/organisms/canvas-view/canvas-view.js +14 -10
- package/dist/components/organisms/choropleth-map/choropleth-map.js +2 -9
- package/dist/components/organisms/chronological-timeline/chronological-timeline.js +4 -2
- package/dist/components/organisms/code-block/code-block.js +16 -43
- package/dist/components/organisms/code-playground/code-playground.js +2 -9
- package/dist/components/organisms/combobox/combobox.js +7 -25
- package/dist/components/organisms/data-table/data-table.js +1 -8
- package/dist/components/organisms/date-picker/date-picker.js +8 -20
- package/dist/components/organisms/date-range-picker/date-range-picker.js +8 -20
- package/dist/components/organisms/flow-diagram/flow-canvas.js +0 -3
- package/dist/components/organisms/flow-diagram/flow-controls.js +1 -7
- package/dist/components/organisms/flow-diagram/use-flow-diagram.js +11 -25
- package/dist/components/organisms/gantt-chart/gantt-chart.js +2 -6
- package/dist/components/organisms/geography-quiz-map/geography-quiz-map.js +20 -43
- package/dist/components/organisms/globe-3d/globe-3d.js +1 -1
- package/dist/components/organisms/historic-timeline/historic-timeline.js +1 -1
- package/dist/components/organisms/interactive-timeline/interactive-timeline.js +6 -6
- package/dist/components/organisms/map-2d/map-2d.js +0 -2
- package/dist/components/organisms/market-treemap/market-treemap.js +1 -1
- package/dist/components/organisms/model-selector/model-selector.js +40 -57
- package/dist/components/organisms/multi-select/multi-select.js +1 -14
- package/dist/components/organisms/parallel-timeline/parallel-timeline.js +1 -2
- package/dist/components/organisms/primary-source-viewer/primary-source-viewer.js +1 -1
- package/dist/components/organisms/run-timeline/run-timeline.js +2 -2
- package/dist/components/organisms/share-dialog/share-dialog.js +25 -39
- package/dist/components/organisms/slideshow/slideshow.js +1 -13
- package/dist/components/organisms/static-code/static-code-copy.js +1 -1
- package/dist/components/organisms/terminal/terminal.js +1 -1
- package/dist/components/organisms/tree-view/tree-view.js +4 -41
- package/dist/components/organisms/tutorial-mdx/tutorial-mdx.js +6 -7
- package/dist/index.d.ts +71 -323
- package/dist/index.js +0 -10
- package/dist/lib/use-escape-key.js +3 -6
- package/package.json +2 -5
- package/styles.css +0 -29
- package/dist/components/atoms/toast/sonner-toast.js +0 -4
- package/dist/components/molecules/copy-button/use-copy-to-clipboard.js +0 -42
- package/dist/lib/focus-calendar-day.js +0 -13
- package/dist/lib/roving-focus.js +0 -70
- package/dist/lib/use-return-focus.js +0 -23
|
@@ -16,7 +16,7 @@ function assignRef(ref, node) {
|
|
|
16
16
|
const ERA_PALETTE = {
|
|
17
17
|
amber: {
|
|
18
18
|
accent: "bg-amber-500",
|
|
19
|
-
chip: "bg-amber-500/15 text-amber-
|
|
19
|
+
chip: "bg-amber-500/15 text-amber-700 dark:text-amber-300"
|
|
20
20
|
},
|
|
21
21
|
blue: {
|
|
22
22
|
accent: "bg-blue-500",
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { cn } from "../../../lib/utils.js";
|
|
4
4
|
const PALETTE = {
|
|
5
|
-
amber: { chip: "bg-amber-
|
|
6
|
-
blue: { chip: "bg-blue-
|
|
7
|
-
emerald: { chip: "bg-emerald-
|
|
8
|
-
purple: { chip: "bg-purple-
|
|
9
|
-
red: { chip: "bg-red-
|
|
10
|
-
rose: { chip: "bg-rose-
|
|
5
|
+
amber: { chip: "bg-amber-500 text-white", ring: "ring-amber-500" },
|
|
6
|
+
blue: { chip: "bg-blue-500 text-white", ring: "ring-blue-500" },
|
|
7
|
+
emerald: { chip: "bg-emerald-500 text-white", ring: "ring-emerald-500" },
|
|
8
|
+
purple: { chip: "bg-purple-500 text-white", ring: "ring-purple-500" },
|
|
9
|
+
red: { chip: "bg-red-500 text-white", ring: "ring-red-500" },
|
|
10
|
+
rose: { chip: "bg-rose-500 text-white", ring: "ring-rose-500" }
|
|
11
11
|
};
|
|
12
12
|
const DEFAULT_LABELS = {
|
|
13
13
|
region: "Follow mode",
|
|
@@ -4,7 +4,7 @@ import { cn } from "../../../lib/utils.js";
|
|
|
4
4
|
const LEVEL_RING = {
|
|
5
5
|
info: "ring-blue-500",
|
|
6
6
|
request: "ring-amber-500",
|
|
7
|
-
urgent: "ring-red-500 animate-pulse
|
|
7
|
+
urgent: "ring-red-500 animate-pulse"
|
|
8
8
|
};
|
|
9
9
|
const LEVEL_DOT = {
|
|
10
10
|
info: "bg-blue-500",
|
|
@@ -52,7 +52,7 @@ const InputOTPSlot = ({
|
|
|
52
52
|
...props,
|
|
53
53
|
children: [
|
|
54
54
|
char,
|
|
55
|
-
hasFakeCaret ? /* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsx("div", { className: "h-4 w-px animate-caret-blink bg-foreground duration-1000
|
|
55
|
+
hasFakeCaret ? /* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsx("div", { className: "h-4 w-px animate-caret-blink bg-foreground duration-1000" }) }) : null
|
|
56
56
|
]
|
|
57
57
|
}
|
|
58
58
|
);
|
|
@@ -19,7 +19,6 @@ function KeyConcept({
|
|
|
19
19
|
icon ? /* @__PURE__ */ jsx("span", { className: "size-5 text-primary flex-shrink-0 mt-0.5", children: icon }) : /* @__PURE__ */ jsx(
|
|
20
20
|
"svg",
|
|
21
21
|
{
|
|
22
|
-
"aria-hidden": "true",
|
|
23
22
|
className: "size-5 text-primary flex-shrink-0 mt-0.5",
|
|
24
23
|
fill: "none",
|
|
25
24
|
stroke: "currentColor",
|
|
@@ -35,7 +34,7 @@ function KeyConcept({
|
|
|
35
34
|
)
|
|
36
35
|
}
|
|
37
36
|
),
|
|
38
|
-
/* @__PURE__ */ jsxs("
|
|
37
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
39
38
|
/* @__PURE__ */ jsx("dt", { className: "font-bold text-foreground mb-1", children: term }),
|
|
40
39
|
/* @__PURE__ */ jsx("dd", { className: "text-sm text-muted-foreground [&>p]:mb-0", children })
|
|
41
40
|
] })
|
|
@@ -55,7 +54,6 @@ function Glossary({
|
|
|
55
54
|
icon ? /* @__PURE__ */ jsx("span", { className: "size-4", children: icon }) : /* @__PURE__ */ jsx(
|
|
56
55
|
"svg",
|
|
57
56
|
{
|
|
58
|
-
"aria-hidden": "true",
|
|
59
57
|
className: "size-4",
|
|
60
58
|
fill: "none",
|
|
61
59
|
stroke: "currentColor",
|
|
@@ -73,7 +71,7 @@ function Glossary({
|
|
|
73
71
|
),
|
|
74
72
|
title
|
|
75
73
|
] }),
|
|
76
|
-
/* @__PURE__ */ jsx("
|
|
74
|
+
/* @__PURE__ */ jsx("dl", { className: "space-y-2", children })
|
|
77
75
|
] });
|
|
78
76
|
}
|
|
79
77
|
export {
|
|
@@ -20,8 +20,9 @@ const LiquidGlass = ({
|
|
|
20
20
|
"span",
|
|
21
21
|
{
|
|
22
22
|
"aria-hidden": "true",
|
|
23
|
-
className: "pointer-events-none absolute inset-0
|
|
23
|
+
className: "pointer-events-none absolute inset-0 motion-reduce:animate-none",
|
|
24
24
|
style: {
|
|
25
|
+
animation: "vllnt-liquid-shift 8s ease-in-out infinite",
|
|
25
26
|
background: "linear-gradient(120deg, transparent, oklch(var(--primary) / 0.18), transparent, oklch(var(--accent) / 0.18), transparent)",
|
|
26
27
|
backgroundSize: "200% 200%"
|
|
27
28
|
}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { Check } from "lucide-react";
|
|
5
|
-
import { moveRovingFocus } from "../../../lib/roving-focus.js";
|
|
6
5
|
import { cn } from "../../../lib/utils.js";
|
|
7
6
|
const ListBoxContext = React.createContext(null);
|
|
8
7
|
function useListBoxContext() {
|
|
@@ -35,39 +34,6 @@ function useListBoxSelection({
|
|
|
35
34
|
};
|
|
36
35
|
return { select, selectedValues };
|
|
37
36
|
}
|
|
38
|
-
const OPTION_SELECTOR = '[role="option"]';
|
|
39
|
-
function enabledOptionValues(root) {
|
|
40
|
-
return [...root.querySelectorAll(OPTION_SELECTOR)].filter((option) => option.getAttribute("aria-disabled") !== "true").map((option) => option.dataset.value ?? "");
|
|
41
|
-
}
|
|
42
|
-
function useRovingTabStop(selectedValues, children) {
|
|
43
|
-
const rootRef = React.useRef(null);
|
|
44
|
-
const [tabStop, setTabStop] = React.useState();
|
|
45
|
-
React.useLayoutEffect(() => {
|
|
46
|
-
const root = rootRef.current;
|
|
47
|
-
if (!root) return;
|
|
48
|
-
const values = enabledOptionValues(root);
|
|
49
|
-
const focusInside = root.contains(document.activeElement);
|
|
50
|
-
if (focusInside && tabStop !== void 0 && values.includes(tabStop)) {
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
const preferred = values.find((entry) => selectedValues.includes(entry)) ?? values[0];
|
|
54
|
-
if (preferred !== tabStop) setTabStop(preferred);
|
|
55
|
-
}, [children, selectedValues, tabStop]);
|
|
56
|
-
return { rootRef, setTabStop, tabStop };
|
|
57
|
-
}
|
|
58
|
-
function assignRef(ref, node) {
|
|
59
|
-
if (typeof ref === "function") {
|
|
60
|
-
ref(node);
|
|
61
|
-
} else if (ref) {
|
|
62
|
-
ref.current = node;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
function handleListKeyDown(event) {
|
|
66
|
-
moveRovingFocus(event, OPTION_SELECTOR, {
|
|
67
|
-
loop: false,
|
|
68
|
-
orientation: "vertical"
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
37
|
const ListBox = ({
|
|
72
38
|
children,
|
|
73
39
|
className,
|
|
@@ -85,20 +51,9 @@ const ListBox = ({
|
|
|
85
51
|
selectionMode,
|
|
86
52
|
value
|
|
87
53
|
});
|
|
88
|
-
const { rootRef, setTabStop, tabStop } = useRovingTabStop(
|
|
89
|
-
selectedValues,
|
|
90
|
-
children
|
|
91
|
-
);
|
|
92
54
|
const context = React.useMemo(
|
|
93
|
-
() => ({ disabled, select, selectedValues
|
|
94
|
-
[disabled, select, selectedValues
|
|
95
|
-
);
|
|
96
|
-
const setReferences = React.useCallback(
|
|
97
|
-
(node) => {
|
|
98
|
-
rootRef.current = node;
|
|
99
|
-
assignRef(ref, node);
|
|
100
|
-
},
|
|
101
|
-
[ref, rootRef]
|
|
55
|
+
() => ({ disabled, select, selectedValues }),
|
|
56
|
+
[disabled, select, selectedValues]
|
|
102
57
|
);
|
|
103
58
|
return /* @__PURE__ */ jsx(ListBoxContext.Provider, { value: context, children: /* @__PURE__ */ jsx(
|
|
104
59
|
"div",
|
|
@@ -109,10 +64,8 @@ const ListBox = ({
|
|
|
109
64
|
"flex flex-col gap-0.5 rounded-md border border-input bg-background p-1",
|
|
110
65
|
className
|
|
111
66
|
),
|
|
112
|
-
|
|
113
|
-
ref: setReferences,
|
|
67
|
+
ref,
|
|
114
68
|
role: "listbox",
|
|
115
|
-
tabIndex: -1,
|
|
116
69
|
children
|
|
117
70
|
}
|
|
118
71
|
) });
|
|
@@ -150,15 +103,11 @@ const ListBoxItem = ({
|
|
|
150
103
|
isDisabled && "pointer-events-none opacity-50",
|
|
151
104
|
className
|
|
152
105
|
),
|
|
153
|
-
"data-value": value,
|
|
154
106
|
onClick: activate,
|
|
155
|
-
onFocus: () => {
|
|
156
|
-
group.setTabStop(value);
|
|
157
|
-
},
|
|
158
107
|
onKeyDown: handleKeyDown,
|
|
159
108
|
ref,
|
|
160
109
|
role: "option",
|
|
161
|
-
tabIndex:
|
|
110
|
+
tabIndex: isDisabled ? -1 : 0,
|
|
162
111
|
children: [
|
|
163
112
|
/* @__PURE__ */ jsx(
|
|
164
113
|
Check,
|
|
@@ -10,7 +10,7 @@ const LiveCursor = ({
|
|
|
10
10
|
}) => {
|
|
11
11
|
const { className, color, labels, name, status, x, y, ...rest } = props;
|
|
12
12
|
const resolvedLabels = { ...DEFAULT_LABELS, ...labels };
|
|
13
|
-
const resolvedColor = color ?? "
|
|
13
|
+
const resolvedColor = color ?? "var(--foreground)";
|
|
14
14
|
return /* @__PURE__ */ jsxs(
|
|
15
15
|
"div",
|
|
16
16
|
{
|
|
@@ -41,17 +41,12 @@ const LiveCursor = ({
|
|
|
41
41
|
name === null || name === void 0 ? null : /* @__PURE__ */ jsxs(
|
|
42
42
|
"span",
|
|
43
43
|
{
|
|
44
|
-
className:
|
|
45
|
-
"ml-2 mt-2 inline-flex flex-col rounded-md px-1.5 py-0.5 text-[10px] font-medium shadow-sm",
|
|
46
|
-
color ? "text-white" : "bg-foreground text-background"
|
|
47
|
-
),
|
|
44
|
+
className: "ml-2 mt-2 inline-flex flex-col rounded-md px-1.5 py-0.5 text-[10px] font-medium text-white shadow-sm",
|
|
48
45
|
"data-live-cursor-chip": true,
|
|
49
|
-
style:
|
|
50
|
-
backgroundColor: `color-mix(in oklab, ${color} 55%, oklch(0 0 0))`
|
|
51
|
-
} : void 0,
|
|
46
|
+
style: { backgroundColor: resolvedColor },
|
|
52
47
|
children: [
|
|
53
48
|
/* @__PURE__ */ jsx("span", { children: name }),
|
|
54
|
-
status ? /* @__PURE__ */ jsx("span", { className: "text-[9px]", "data-live-cursor-status": true, children: status }) : null
|
|
49
|
+
status ? /* @__PURE__ */ jsx("span", { className: "text-[9px] opacity-80", "data-live-cursor-status": true, children: status }) : null
|
|
55
50
|
]
|
|
56
51
|
}
|
|
57
52
|
)
|
|
@@ -20,56 +20,6 @@ function usePrefersReducedMotion() {
|
|
|
20
20
|
}, []);
|
|
21
21
|
return reduced;
|
|
22
22
|
}
|
|
23
|
-
function usePointerTransform({
|
|
24
|
-
compute,
|
|
25
|
-
enabled,
|
|
26
|
-
keepTransform
|
|
27
|
-
}) {
|
|
28
|
-
const element = React.useRef(null);
|
|
29
|
-
const pointer = React.useRef({ x: 0, y: 0 });
|
|
30
|
-
const frame = React.useRef(null);
|
|
31
|
-
React.useEffect(() => {
|
|
32
|
-
return () => {
|
|
33
|
-
if (frame.current !== null) {
|
|
34
|
-
cancelAnimationFrame(frame.current);
|
|
35
|
-
frame.current = null;
|
|
36
|
-
}
|
|
37
|
-
element.current = null;
|
|
38
|
-
};
|
|
39
|
-
}, []);
|
|
40
|
-
const writeTransform = (target, transform) => {
|
|
41
|
-
if (target && !keepTransform) {
|
|
42
|
-
target.style.transform = transform;
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
const applyFrame = () => {
|
|
46
|
-
frame.current = null;
|
|
47
|
-
const target = element.current;
|
|
48
|
-
if (target) {
|
|
49
|
-
writeTransform(
|
|
50
|
-
target,
|
|
51
|
-
compute(pointer.current, target.getBoundingClientRect())
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
return {
|
|
56
|
-
handlePointerLeave: (event) => {
|
|
57
|
-
if (frame.current !== null) {
|
|
58
|
-
cancelAnimationFrame(frame.current);
|
|
59
|
-
frame.current = null;
|
|
60
|
-
}
|
|
61
|
-
writeTransform(event.currentTarget, "");
|
|
62
|
-
},
|
|
63
|
-
handlePointerMove: (event) => {
|
|
64
|
-
if (!enabled) {
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
element.current = event.currentTarget;
|
|
68
|
-
pointer.current = { x: event.clientX, y: event.clientY };
|
|
69
|
-
frame.current ?? (frame.current = requestAnimationFrame(applyFrame));
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
23
|
const Magnetic = ({
|
|
74
24
|
children,
|
|
75
25
|
className,
|
|
@@ -79,15 +29,16 @@ const Magnetic = ({
|
|
|
79
29
|
...props
|
|
80
30
|
}) => {
|
|
81
31
|
const reduced = usePrefersReducedMotion();
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
32
|
+
const [transform, setTransform] = React.useState();
|
|
33
|
+
const handlePointerMove = (event) => {
|
|
34
|
+
if (reduced) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
const bounds = event.currentTarget.getBoundingClientRect();
|
|
38
|
+
const offsetX = (event.clientX - bounds.left - bounds.width / 2) * strength;
|
|
39
|
+
const offsetY = (event.clientY - bounds.top - bounds.height / 2) * strength;
|
|
40
|
+
setTransform(`translate(${offsetX}px, ${offsetY}px)`);
|
|
41
|
+
};
|
|
91
42
|
return /* @__PURE__ */ jsx(
|
|
92
43
|
"div",
|
|
93
44
|
{
|
|
@@ -95,10 +46,12 @@ const Magnetic = ({
|
|
|
95
46
|
"transition-transform duration-200 ease-out will-change-transform",
|
|
96
47
|
className
|
|
97
48
|
),
|
|
98
|
-
onPointerLeave:
|
|
49
|
+
onPointerLeave: () => {
|
|
50
|
+
setTransform(void 0);
|
|
51
|
+
},
|
|
99
52
|
onPointerMove: handlePointerMove,
|
|
100
53
|
ref,
|
|
101
|
-
style,
|
|
54
|
+
style: { transform, ...style },
|
|
102
55
|
...props,
|
|
103
56
|
children
|
|
104
57
|
}
|
|
@@ -20,56 +20,6 @@ function usePrefersReducedMotion() {
|
|
|
20
20
|
}, []);
|
|
21
21
|
return reduced;
|
|
22
22
|
}
|
|
23
|
-
function usePointerTransform({
|
|
24
|
-
compute,
|
|
25
|
-
enabled,
|
|
26
|
-
keepTransform
|
|
27
|
-
}) {
|
|
28
|
-
const element = React.useRef(null);
|
|
29
|
-
const pointer = React.useRef({ x: 0, y: 0 });
|
|
30
|
-
const frame = React.useRef(null);
|
|
31
|
-
React.useEffect(() => {
|
|
32
|
-
return () => {
|
|
33
|
-
if (frame.current !== null) {
|
|
34
|
-
cancelAnimationFrame(frame.current);
|
|
35
|
-
frame.current = null;
|
|
36
|
-
}
|
|
37
|
-
element.current = null;
|
|
38
|
-
};
|
|
39
|
-
}, []);
|
|
40
|
-
const writeTransform = (target, transform) => {
|
|
41
|
-
if (target && !keepTransform) {
|
|
42
|
-
target.style.transform = transform;
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
const applyFrame = () => {
|
|
46
|
-
frame.current = null;
|
|
47
|
-
const target = element.current;
|
|
48
|
-
if (target) {
|
|
49
|
-
writeTransform(
|
|
50
|
-
target,
|
|
51
|
-
compute(pointer.current, target.getBoundingClientRect())
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
return {
|
|
56
|
-
handlePointerLeave: (event) => {
|
|
57
|
-
if (frame.current !== null) {
|
|
58
|
-
cancelAnimationFrame(frame.current);
|
|
59
|
-
frame.current = null;
|
|
60
|
-
}
|
|
61
|
-
writeTransform(event.currentTarget, "");
|
|
62
|
-
},
|
|
63
|
-
handlePointerMove: (event) => {
|
|
64
|
-
if (!enabled) {
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
element.current = event.currentTarget;
|
|
68
|
-
pointer.current = { x: event.clientX, y: event.clientY };
|
|
69
|
-
frame.current ?? (frame.current = requestAnimationFrame(applyFrame));
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
23
|
const MagneticButton = ({
|
|
74
24
|
children,
|
|
75
25
|
className,
|
|
@@ -79,15 +29,16 @@ const MagneticButton = ({
|
|
|
79
29
|
...props
|
|
80
30
|
}) => {
|
|
81
31
|
const reduced = usePrefersReducedMotion();
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
32
|
+
const [transform, setTransform] = React.useState();
|
|
33
|
+
const handlePointerMove = (event) => {
|
|
34
|
+
if (reduced) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
const bounds = event.currentTarget.getBoundingClientRect();
|
|
38
|
+
const offsetX = (event.clientX - bounds.left - bounds.width / 2) * strength;
|
|
39
|
+
const offsetY = (event.clientY - bounds.top - bounds.height / 2) * strength;
|
|
40
|
+
setTransform(`translate(${offsetX}px, ${offsetY}px)`);
|
|
41
|
+
};
|
|
91
42
|
return /* @__PURE__ */ jsx(
|
|
92
43
|
"button",
|
|
93
44
|
{
|
|
@@ -95,10 +46,12 @@ const MagneticButton = ({
|
|
|
95
46
|
"transition-transform duration-200 ease-out will-change-transform",
|
|
96
47
|
className
|
|
97
48
|
),
|
|
98
|
-
onPointerLeave:
|
|
49
|
+
onPointerLeave: () => {
|
|
50
|
+
setTransform(void 0);
|
|
51
|
+
},
|
|
99
52
|
onPointerMove: handlePointerMove,
|
|
100
53
|
ref,
|
|
101
|
-
style,
|
|
54
|
+
style: { transform, ...style },
|
|
102
55
|
type: "button",
|
|
103
56
|
...props,
|
|
104
57
|
children
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
2
|
import * as React from "react";
|
|
4
|
-
import { Pause, Play } from "lucide-react";
|
|
5
3
|
import { cn } from "../../../lib/utils.js";
|
|
6
4
|
function getGapValue(gap) {
|
|
7
5
|
return typeof gap === "number" ? `${gap}px` : gap;
|
|
@@ -29,62 +27,12 @@ function getDuration(duration, speed) {
|
|
|
29
27
|
return 32;
|
|
30
28
|
}
|
|
31
29
|
}
|
|
32
|
-
function PauseToggle({ labels, onToggle, paused }) {
|
|
33
|
-
return /* @__PURE__ */ jsx(
|
|
34
|
-
"button",
|
|
35
|
-
{
|
|
36
|
-
"aria-label": paused ? labels.play : labels.pause,
|
|
37
|
-
className: "absolute right-1 top-1 z-10 inline-flex size-6 items-center justify-center rounded-md border border-border bg-background/90 text-foreground shadow-sm hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring motion-reduce:hidden",
|
|
38
|
-
onClick: onToggle,
|
|
39
|
-
type: "button",
|
|
40
|
-
children: paused ? /* @__PURE__ */ jsx(Play, { "aria-hidden": "true", className: "size-3" }) : /* @__PURE__ */ jsx(Pause, { "aria-hidden": "true", className: "size-3" })
|
|
41
|
-
}
|
|
42
|
-
);
|
|
43
|
-
}
|
|
44
|
-
function MarqueeTrack({
|
|
45
|
-
gap,
|
|
46
|
-
items,
|
|
47
|
-
paused,
|
|
48
|
-
pauseOnHover,
|
|
49
|
-
style,
|
|
50
|
-
vertical
|
|
51
|
-
}) {
|
|
52
|
-
return /* @__PURE__ */ jsx(
|
|
53
|
-
"div",
|
|
54
|
-
{
|
|
55
|
-
className: cn(
|
|
56
|
-
"flex shrink-0 will-change-transform [animation-iteration-count:infinite] [animation-timing-function:linear] focus-within:[animation-play-state:paused] motion-reduce:animate-none motion-reduce:transform-none",
|
|
57
|
-
vertical ? "[animation-name:vllnt-marquee-y]" : "[animation-name:vllnt-marquee-x]",
|
|
58
|
-
pauseOnHover && "group-hover:[animation-play-state:paused]",
|
|
59
|
-
paused && "[animation-play-state:paused]",
|
|
60
|
-
vertical ? "min-h-full flex-col" : "min-w-full flex-row"
|
|
61
|
-
),
|
|
62
|
-
"data-marquee-track": "",
|
|
63
|
-
style,
|
|
64
|
-
children: [0, 1].map((groupIndex) => /* @__PURE__ */ jsx(
|
|
65
|
-
"div",
|
|
66
|
-
{
|
|
67
|
-
"aria-hidden": groupIndex === 1,
|
|
68
|
-
className: cn(
|
|
69
|
-
"flex shrink-0",
|
|
70
|
-
vertical ? "flex-col items-stretch" : "flex-row items-center"
|
|
71
|
-
),
|
|
72
|
-
style: { gap },
|
|
73
|
-
children: items
|
|
74
|
-
},
|
|
75
|
-
groupIndex
|
|
76
|
-
))
|
|
77
|
-
}
|
|
78
|
-
);
|
|
79
|
-
}
|
|
80
30
|
const Marquee = ({
|
|
81
31
|
children,
|
|
82
32
|
className,
|
|
83
33
|
duration,
|
|
84
34
|
fade = true,
|
|
85
35
|
gap = "1rem",
|
|
86
|
-
labels,
|
|
87
|
-
pauseControl = true,
|
|
88
36
|
pauseOnHover = false,
|
|
89
37
|
ref,
|
|
90
38
|
repeat = 1,
|
|
@@ -94,16 +42,18 @@ const Marquee = ({
|
|
|
94
42
|
vertical = false,
|
|
95
43
|
...props
|
|
96
44
|
}) => {
|
|
97
|
-
const [paused, setPaused] = React.useState(false);
|
|
98
45
|
const resolvedGap = getGapValue(gap);
|
|
99
46
|
const resolvedDuration = getDuration(duration, speed);
|
|
100
47
|
const trackItems = getTrackItems(children, repeat);
|
|
101
48
|
const animationStyle = {
|
|
102
49
|
animationDirection: reverse ? "reverse" : "normal",
|
|
103
|
-
animationDuration: `${resolvedDuration
|
|
50
|
+
animationDuration: `${resolvedDuration}s`,
|
|
51
|
+
animationIterationCount: "infinite",
|
|
52
|
+
animationName: vertical ? "vllnt-marquee-y" : "vllnt-marquee-x",
|
|
53
|
+
animationTimingFunction: "linear"
|
|
104
54
|
};
|
|
105
55
|
const maskImage = getMaskImage(vertical);
|
|
106
|
-
return /* @__PURE__ */
|
|
56
|
+
return /* @__PURE__ */ jsx(
|
|
107
57
|
"div",
|
|
108
58
|
{
|
|
109
59
|
className: cn(
|
|
@@ -112,41 +62,32 @@ const Marquee = ({
|
|
|
112
62
|
className
|
|
113
63
|
),
|
|
114
64
|
ref,
|
|
115
|
-
style,
|
|
65
|
+
style: fade ? { ...style, maskImage, WebkitMaskImage: maskImage } : style,
|
|
116
66
|
...props,
|
|
117
|
-
children:
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
67
|
+
children: /* @__PURE__ */ jsx(
|
|
68
|
+
"div",
|
|
69
|
+
{
|
|
70
|
+
className: cn(
|
|
71
|
+
"flex shrink-0 will-change-transform motion-reduce:animate-none motion-reduce:transform-none",
|
|
72
|
+
pauseOnHover && "group-hover:[animation-play-state:paused]",
|
|
73
|
+
vertical ? "min-h-full flex-col" : "min-w-full flex-row"
|
|
74
|
+
),
|
|
75
|
+
style: animationStyle,
|
|
76
|
+
children: [0, 1].map((groupIndex) => /* @__PURE__ */ jsx(
|
|
77
|
+
"div",
|
|
78
|
+
{
|
|
79
|
+
"aria-hidden": groupIndex === 1,
|
|
80
|
+
className: cn(
|
|
81
|
+
"flex shrink-0",
|
|
82
|
+
vertical ? "flex-col items-stretch" : "flex-row items-center"
|
|
83
|
+
),
|
|
84
|
+
style: { gap: resolvedGap },
|
|
85
|
+
children: trackItems
|
|
124
86
|
},
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
"div",
|
|
130
|
-
{
|
|
131
|
-
className: cn(
|
|
132
|
-
"flex min-h-0 min-w-0 flex-1 overflow-hidden",
|
|
133
|
-
vertical ? "flex-col" : "flex-row"
|
|
134
|
-
),
|
|
135
|
-
style: fade ? { maskImage, WebkitMaskImage: maskImage } : void 0,
|
|
136
|
-
children: /* @__PURE__ */ jsx(
|
|
137
|
-
MarqueeTrack,
|
|
138
|
-
{
|
|
139
|
-
gap: resolvedGap,
|
|
140
|
-
items: trackItems,
|
|
141
|
-
paused,
|
|
142
|
-
pauseOnHover,
|
|
143
|
-
style: animationStyle,
|
|
144
|
-
vertical
|
|
145
|
-
}
|
|
146
|
-
)
|
|
147
|
-
}
|
|
148
|
-
)
|
|
149
|
-
]
|
|
87
|
+
groupIndex
|
|
88
|
+
))
|
|
89
|
+
}
|
|
90
|
+
)
|
|
150
91
|
}
|
|
151
92
|
);
|
|
152
93
|
};
|
|
@@ -13,8 +13,8 @@ function createMeteors(count) {
|
|
|
13
13
|
function meteorStyle(meteor) {
|
|
14
14
|
return {
|
|
15
15
|
"--vllnt-meteor-angle": "215deg",
|
|
16
|
+
animation: `vllnt-meteor ${meteor.duration}s linear infinite`,
|
|
16
17
|
animationDelay: `${meteor.delay}s`,
|
|
17
|
-
animationDuration: `${meteor.duration}s`,
|
|
18
18
|
left: `${meteor.left}%`,
|
|
19
19
|
top: `${meteor.top}%`
|
|
20
20
|
};
|
|
@@ -39,7 +39,7 @@ const Meteors = ({
|
|
|
39
39
|
children: meteors.map((meteor, index) => /* @__PURE__ */ jsx(
|
|
40
40
|
"span",
|
|
41
41
|
{
|
|
42
|
-
className: "absolute h-0.5 w-0.5 rounded-full bg-muted-foreground
|
|
42
|
+
className: "absolute h-0.5 w-0.5 rounded-full bg-muted-foreground motion-reduce:animate-none",
|
|
43
43
|
style: meteorStyle(meteor),
|
|
44
44
|
children: /* @__PURE__ */ jsx(
|
|
45
45
|
"span",
|
|
@@ -31,7 +31,7 @@ const ObjectHandle = ({
|
|
|
31
31
|
}
|
|
32
32
|
),
|
|
33
33
|
/* @__PURE__ */ jsx("span", { children: label }),
|
|
34
|
-
hint ? /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: hint }) : null
|
|
34
|
+
hint ? /* @__PURE__ */ jsx("span", { className: "text-muted-foreground/80", children: hint }) : null
|
|
35
35
|
]
|
|
36
36
|
}
|
|
37
37
|
);
|
|
@@ -22,7 +22,7 @@ const STATUS_DOT = {
|
|
|
22
22
|
failed: "bg-red-500",
|
|
23
23
|
idle: "bg-muted-foreground",
|
|
24
24
|
queued: "bg-amber-500",
|
|
25
|
-
running: "bg-blue-500 animate-pulse
|
|
25
|
+
running: "bg-blue-500 animate-pulse"
|
|
26
26
|
};
|
|
27
27
|
const STATUS_LABEL = {
|
|
28
28
|
complete: "Complete",
|
|
@@ -10,17 +10,11 @@ function withCumulativeTotal(levels) {
|
|
|
10
10
|
};
|
|
11
11
|
});
|
|
12
12
|
}
|
|
13
|
-
const numberFormatters = /* @__PURE__ */ new Map();
|
|
14
13
|
function formatNumber(value, precision = 2) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
minimumFractionDigits: precision
|
|
20
|
-
});
|
|
21
|
-
numberFormatters.set(precision, formatter);
|
|
22
|
-
}
|
|
23
|
-
return formatter.format(value);
|
|
14
|
+
return value.toLocaleString(void 0, {
|
|
15
|
+
maximumFractionDigits: precision,
|
|
16
|
+
minimumFractionDigits: precision
|
|
17
|
+
});
|
|
24
18
|
}
|
|
25
19
|
function BookSide({
|
|
26
20
|
accent,
|
|
@@ -30,7 +24,7 @@ function BookSide({
|
|
|
30
24
|
}) {
|
|
31
25
|
const maxTotal = Math.max(...levels.map((level) => level.total ?? 0), 1);
|
|
32
26
|
const barClassName = accent === "ask" ? "bg-rose-500/12 border-rose-500/15" : "bg-emerald-500/12 border-emerald-500/15";
|
|
33
|
-
const priceClassName = accent === "ask" ? "text-rose-
|
|
27
|
+
const priceClassName = accent === "ask" ? "text-rose-600 dark:text-rose-400" : "text-emerald-600 dark:text-emerald-400";
|
|
34
28
|
return /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
35
29
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
36
30
|
/* @__PURE__ */ jsx("h3", { className: "text-sm font-semibold uppercase tracking-[0.24em] text-muted-foreground", children: title }),
|
|
@@ -31,10 +31,10 @@ const Particles = ({
|
|
|
31
31
|
children: particles.map((particle, index) => /* @__PURE__ */ jsx(
|
|
32
32
|
"span",
|
|
33
33
|
{
|
|
34
|
-
className: "absolute rounded-full bg-foreground/30
|
|
34
|
+
className: "absolute rounded-full bg-foreground/30 motion-reduce:animate-none",
|
|
35
35
|
style: {
|
|
36
|
+
animation: `vllnt-particle-float ${particle.duration}s linear infinite`,
|
|
36
37
|
animationDelay: `${particle.delay}s`,
|
|
37
|
-
animationDuration: `${particle.duration}s`,
|
|
38
38
|
height: `${particle.size}px`,
|
|
39
39
|
left: `${particle.left}%`,
|
|
40
40
|
top: `${particle.top}%`,
|