@vllnt/ui 0.3.0-canary.00b20d6 → 0.3.0-canary.0572c35
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/activity-heatmap/activity-heatmap.js +6 -1
- package/dist/components/ai-sidebar/ai-sidebar.js +14 -5
- package/dist/components/code-block/code-block.js +7 -4
- package/dist/components/code-playground/code-playground.js +8 -4
- package/dist/components/countdown-timer/countdown-timer.js +26 -2
- package/dist/components/flow-diagram/flow-fullscreen.js +13 -3
- package/dist/components/flow-diagram/use-flow-diagram.js +18 -7
- package/dist/components/index.js +0 -263
- package/dist/components/keyboard-shortcuts-help/keyboard-shortcuts-help.js +18 -7
- package/dist/components/live-feed/live-feed.js +26 -2
- package/dist/components/market-treemap/market-treemap.js +3 -2
- package/dist/components/share-dialog/share-dialog.js +8 -6
- package/dist/components/slideshow/slideshow.js +6 -2
- package/dist/components/sparkline-grid/sparkline-grid.js +3 -2
- package/dist/components/table-of-contents-panel/table-of-contents-panel.js +18 -7
- package/dist/components/terminal/terminal.js +15 -7
- package/dist/components/ticker-tape/ticker-tape.js +4 -1
- package/dist/components/watchlist/watchlist.js +4 -1
- package/dist/components/world-clock-bar/world-clock-bar.js +26 -1
- package/dist/index.d.ts +3664 -5488
- package/dist/index.js +0 -9
- package/package.json +2 -4
- package/styles.css +0 -57
- package/dist/components/animated-beam/animated-beam.js +0 -158
- package/dist/components/animated-beam/index.js +0 -4
- package/dist/components/animated-grid-pattern/animated-grid-pattern.js +0 -74
- package/dist/components/animated-grid-pattern/index.js +0 -6
- package/dist/components/animated-list/animated-list.js +0 -32
- package/dist/components/animated-list/index.js +0 -4
- package/dist/components/animated-tabs/animated-tabs.js +0 -95
- package/dist/components/animated-tabs/index.js +0 -6
- package/dist/components/animated-testimonials/animated-testimonials.js +0 -91
- package/dist/components/animated-testimonials/index.js +0 -6
- package/dist/components/animated-tooltip/animated-tooltip.js +0 -51
- package/dist/components/animated-tooltip/index.js +0 -6
- package/dist/components/bento-grid/bento-grid.js +0 -41
- package/dist/components/bento-grid/index.js +0 -8
- package/dist/components/blur-reveal/blur-reveal.js +0 -78
- package/dist/components/blur-reveal/index.js +0 -4
- package/dist/components/button-group/button-group.js +0 -35
- package/dist/components/button-group/index.js +0 -8
- package/dist/components/card-flip/card-flip.js +0 -78
- package/dist/components/card-flip/index.js +0 -4
- package/dist/components/checkbox-group/checkbox-group.js +0 -92
- package/dist/components/checkbox-group/index.js +0 -8
- package/dist/components/color-picker/color-picker.js +0 -134
- package/dist/components/color-picker/index.js +0 -4
- package/dist/components/contribution-graph/contribution-graph.js +0 -120
- package/dist/components/contribution-graph/index.js +0 -6
- package/dist/components/cursor/cursor.js +0 -48
- package/dist/components/cursor/index.js +0 -4
- package/dist/components/date-field/date-field.js +0 -37
- package/dist/components/date-field/index.js +0 -4
- package/dist/components/date-range-picker/date-range-picker.js +0 -74
- package/dist/components/date-range-picker/index.js +0 -6
- package/dist/components/dock/dock.js +0 -102
- package/dist/components/dock/index.js +0 -5
- package/dist/components/dot-pattern/dot-pattern.js +0 -31
- package/dist/components/dot-pattern/index.js +0 -4
- package/dist/components/expandable-cards/expandable-cards.js +0 -56
- package/dist/components/expandable-cards/index.js +0 -6
- package/dist/components/field/field.js +0 -121
- package/dist/components/field/index.js +0 -16
- package/dist/components/fieldset/fieldset.js +0 -47
- package/dist/components/fieldset/index.js +0 -10
- package/dist/components/floating-navbar/floating-navbar.js +0 -62
- package/dist/components/floating-navbar/index.js +0 -4
- package/dist/components/gauge-chart/gauge-chart.js +0 -134
- package/dist/components/gauge-chart/index.js +0 -4
- package/dist/components/glass-card/glass-card.js +0 -23
- package/dist/components/glass-card/index.js +0 -4
- package/dist/components/glass-progress/glass-progress.js +0 -35
- package/dist/components/glass-progress/index.js +0 -4
- package/dist/components/grid/grid.js +0 -94
- package/dist/components/grid/index.js +0 -4
- package/dist/components/input-group/index.js +0 -14
- package/dist/components/input-group/input-group.js +0 -65
- package/dist/components/item/index.js +0 -18
- package/dist/components/item/item.js +0 -103
- package/dist/components/link/index.js +0 -5
- package/dist/components/link/link.js +0 -55
- package/dist/components/liquid-glass/index.js +0 -4
- package/dist/components/liquid-glass/liquid-glass.js +0 -37
- package/dist/components/list-box/index.js +0 -8
- package/dist/components/list-box/list-box.js +0 -127
- package/dist/components/magnetic/index.js +0 -4
- package/dist/components/magnetic/magnetic.js +0 -58
- package/dist/components/magnetic-button/index.js +0 -4
- package/dist/components/magnetic-button/magnetic-button.js +0 -57
- package/dist/components/meteors/index.js +0 -4
- package/dist/components/meteors/meteors.js +0 -59
- package/dist/components/meter/index.js +0 -5
- package/dist/components/meter/meter.js +0 -78
- package/dist/components/native-select/index.js +0 -4
- package/dist/components/native-select/native-select.js +0 -25
- package/dist/components/panel/index.js +0 -16
- package/dist/components/panel/panel.js +0 -81
- package/dist/components/particles/index.js +0 -4
- package/dist/components/particles/particles.js +0 -49
- package/dist/components/phone-input/index.js +0 -6
- package/dist/components/phone-input/phone-input.js +0 -64
- package/dist/components/pie-chart/index.js +0 -4
- package/dist/components/pie-chart/pie-chart.js +0 -132
- package/dist/components/progressive-blur/index.js +0 -6
- package/dist/components/progressive-blur/progressive-blur.js +0 -44
- package/dist/components/qr-code/index.js +0 -4
- package/dist/components/qr-code/qr-code.js +0 -51
- package/dist/components/radar-chart/index.js +0 -6
- package/dist/components/radar-chart/radar-chart.js +0 -181
- package/dist/components/range-calendar/index.js +0 -4
- package/dist/components/range-calendar/range-calendar.js +0 -35
- package/dist/components/reveal-text/index.js +0 -6
- package/dist/components/reveal-text/reveal-text.js +0 -88
- package/dist/components/sankey-chart/index.js +0 -6
- package/dist/components/sankey-chart/sankey-chart.js +0 -257
- package/dist/components/scramble-text/index.js +0 -4
- package/dist/components/scramble-text/scramble-text.js +0 -77
- package/dist/components/scroll-progress/index.js +0 -4
- package/dist/components/scroll-progress/scroll-progress.js +0 -45
- package/dist/components/search-field/index.js +0 -4
- package/dist/components/search-field/search-field.js +0 -68
- package/dist/components/shimmer-button/index.js +0 -4
- package/dist/components/shimmer-button/shimmer-button.js +0 -36
- package/dist/components/shimmer-text/index.js +0 -4
- package/dist/components/shimmer-text/shimmer-text.js +0 -36
- package/dist/components/shine-border/index.js +0 -4
- package/dist/components/shine-border/shine-border.js +0 -34
- package/dist/components/shiny-button/index.js +0 -4
- package/dist/components/shiny-button/shiny-button.js +0 -35
- package/dist/components/sparkles/index.js +0 -4
- package/dist/components/sparkles/sparkles.js +0 -47
- package/dist/components/spinning-text/index.js +0 -4
- package/dist/components/spinning-text/spinning-text.js +0 -60
- package/dist/components/spotlight-card/index.js +0 -4
- package/dist/components/spotlight-card/spotlight-card.js +0 -48
- package/dist/components/tag-group/index.js +0 -8
- package/dist/components/tag-group/tag-group.js +0 -124
- package/dist/components/text-animate/index.js +0 -6
- package/dist/components/text-animate/text-animate.js +0 -130
- package/dist/components/text-field/index.js +0 -4
- package/dist/components/text-field/text-field.js +0 -60
- package/dist/components/text-reveal/index.js +0 -4
- package/dist/components/text-reveal/text-reveal.js +0 -87
- package/dist/components/text-shimmer/index.js +0 -4
- package/dist/components/text-shimmer/text-shimmer.js +0 -29
- package/dist/components/tilt-card/index.js +0 -4
- package/dist/components/tilt-card/tilt-card.js +0 -65
- package/dist/components/time-field/index.js +0 -4
- package/dist/components/time-field/time-field.js +0 -37
- package/dist/components/time-picker/index.js +0 -4
- package/dist/components/time-picker/time-picker.js +0 -114
- package/dist/components/toolbar/index.js +0 -8
- package/dist/components/toolbar/toolbar.js +0 -83
- package/dist/components/typewriter/index.js +0 -4
- package/dist/components/typewriter/typewriter.js +0 -66
- package/dist/components/typography/index.js +0 -26
- package/dist/components/typography/typography.js +0 -150
- package/dist/lib/format.js +0 -14
- package/dist/lib/use-body-scroll-lock.js +0 -30
- package/dist/lib/use-escape-key.js +0 -24
- package/dist/lib/use-live-date.js +0 -26
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import { normalizeDate } from "../../lib/format";
|
|
4
3
|
import { cn } from "../../lib/utils";
|
|
5
4
|
const WEEKDAY_LABELS = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
|
|
6
5
|
const VISIBLE_DAY_LABELS = /* @__PURE__ */ new Set(["Mon", "Wed", "Fri"]);
|
|
@@ -11,6 +10,12 @@ const LEVEL_CLASS_NAMES = [
|
|
|
11
10
|
"bg-emerald-500/65",
|
|
12
11
|
"bg-emerald-500"
|
|
13
12
|
];
|
|
13
|
+
function normalizeDate(input) {
|
|
14
|
+
if (input instanceof Date) {
|
|
15
|
+
return new Date(input.getTime());
|
|
16
|
+
}
|
|
17
|
+
return new Date(input);
|
|
18
|
+
}
|
|
14
19
|
function toUtcDate(date) {
|
|
15
20
|
return new Date(
|
|
16
21
|
Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate())
|
|
@@ -5,11 +5,11 @@ import {
|
|
|
5
5
|
forwardRef,
|
|
6
6
|
useCallback,
|
|
7
7
|
useContext,
|
|
8
|
+
useEffect,
|
|
8
9
|
useMemo,
|
|
9
10
|
useState
|
|
10
11
|
} from "react";
|
|
11
12
|
import { Bot, MessageSquarePlus, X } from "lucide-react";
|
|
12
|
-
import { useEscapeKey } from "../../lib/use-escape-key";
|
|
13
13
|
import { cn } from "../../lib/utils";
|
|
14
14
|
import { Button } from "../button/button";
|
|
15
15
|
const DEFAULT_WIDTH = 400;
|
|
@@ -96,14 +96,23 @@ function AISidebarProvider({
|
|
|
96
96
|
);
|
|
97
97
|
return /* @__PURE__ */ jsx(AISidebarContext.Provider, { value, children });
|
|
98
98
|
}
|
|
99
|
+
function useEscapeToClose(enabled, isOpen, onClose) {
|
|
100
|
+
useEffect(() => {
|
|
101
|
+
if (!enabled || !isOpen) return;
|
|
102
|
+
const handler = (event) => {
|
|
103
|
+
if (event.key === "Escape") onClose();
|
|
104
|
+
};
|
|
105
|
+
document.addEventListener("keydown", handler);
|
|
106
|
+
return () => {
|
|
107
|
+
document.removeEventListener("keydown", handler);
|
|
108
|
+
};
|
|
109
|
+
}, [enabled, isOpen, onClose]);
|
|
110
|
+
}
|
|
99
111
|
const AISidebar = forwardRef(
|
|
100
112
|
(props, ref) => {
|
|
101
113
|
const { children, className, closeOnEscape = true, ...rest } = props;
|
|
102
114
|
const { close, labels, openState, position, width } = useAISidebar();
|
|
103
|
-
|
|
104
|
-
enabled: closeOnEscape && openState,
|
|
105
|
-
target: "document"
|
|
106
|
-
});
|
|
115
|
+
useEscapeToClose(closeOnEscape, openState, close);
|
|
107
116
|
return /* @__PURE__ */ jsx(
|
|
108
117
|
"aside",
|
|
109
118
|
{
|
|
@@ -9,7 +9,6 @@ import { Check, Copy } from "lucide-react";
|
|
|
9
9
|
import { useTheme } from "next-themes";
|
|
10
10
|
import { cn } from "../../lib/utils";
|
|
11
11
|
import { Button } from "../button/button";
|
|
12
|
-
import { useCopyToClipboard } from "../copy-button/copy-button";
|
|
13
12
|
function extractTextFromChildren(node) {
|
|
14
13
|
if (typeof node === "string") {
|
|
15
14
|
return node;
|
|
@@ -36,7 +35,7 @@ function CodeBlock({
|
|
|
36
35
|
language = "typescript",
|
|
37
36
|
showLanguage = false
|
|
38
37
|
}) {
|
|
39
|
-
const
|
|
38
|
+
const [copied, setCopied] = useState(false);
|
|
40
39
|
const [highlighter, setHighlighter] = useState(
|
|
41
40
|
null
|
|
42
41
|
);
|
|
@@ -78,8 +77,12 @@ function CodeBlock({
|
|
|
78
77
|
element.removeEventListener("wheel", onWheel);
|
|
79
78
|
};
|
|
80
79
|
}, []);
|
|
81
|
-
const handleCopy = () => {
|
|
82
|
-
|
|
80
|
+
const handleCopy = async () => {
|
|
81
|
+
await navigator.clipboard.writeText(code);
|
|
82
|
+
setCopied(true);
|
|
83
|
+
setTimeout(() => {
|
|
84
|
+
setCopied(false);
|
|
85
|
+
}, 2e3);
|
|
83
86
|
};
|
|
84
87
|
const SyntaxHighlighter = highlighter?.SyntaxHighlighter;
|
|
85
88
|
const codeStyle = isDark ? highlighter?.oneDark : highlighter?.oneLight;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useState } from "react";
|
|
3
4
|
import { Check, Code, Copy, FileCode } from "lucide-react";
|
|
4
5
|
import { cn } from "../../lib/utils";
|
|
5
6
|
import { Button } from "../button/button";
|
|
6
|
-
import { useCopyToClipboard } from "../copy-button/copy-button";
|
|
7
7
|
function CodeLine({ highlightLines, line, lineNumber }) {
|
|
8
8
|
const isHighlighted = highlightLines.includes(lineNumber);
|
|
9
9
|
return /* @__PURE__ */ jsxs("div", { className: cn("flex", isHighlighted && "bg-primary/10 -mx-4 px-4"), children: [
|
|
@@ -25,11 +25,15 @@ function CodePlayground({
|
|
|
25
25
|
showLineNumbers = false,
|
|
26
26
|
title
|
|
27
27
|
}) {
|
|
28
|
-
const
|
|
28
|
+
const [copied, setCopied] = useState(false);
|
|
29
29
|
const code = extractCode(children);
|
|
30
30
|
const lines = code.split("\n");
|
|
31
|
-
const handleCopy = () => {
|
|
32
|
-
|
|
31
|
+
const handleCopy = async () => {
|
|
32
|
+
await navigator.clipboard.writeText(code);
|
|
33
|
+
setCopied(true);
|
|
34
|
+
setTimeout(() => {
|
|
35
|
+
setCopied(false);
|
|
36
|
+
}, 2e3);
|
|
33
37
|
};
|
|
34
38
|
return /* @__PURE__ */ jsxs("div", { className: "my-6 rounded-lg border bg-card overflow-hidden", children: [
|
|
35
39
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-4 py-3 border-b bg-muted/30", children: [
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import { normalizeDate } from "../../lib/format";
|
|
5
|
-
import { useLiveDate } from "../../lib/use-live-date";
|
|
6
4
|
import { cn } from "../../lib/utils";
|
|
7
5
|
import { Badge } from "../badge/badge";
|
|
8
6
|
import {
|
|
@@ -12,6 +10,32 @@ import {
|
|
|
12
10
|
CardHeader,
|
|
13
11
|
CardTitle
|
|
14
12
|
} from "../card/card";
|
|
13
|
+
function normalizeDate(input) {
|
|
14
|
+
if (input instanceof Date) {
|
|
15
|
+
return new Date(input.getTime());
|
|
16
|
+
}
|
|
17
|
+
return new Date(input);
|
|
18
|
+
}
|
|
19
|
+
function useLiveDate(now, tickMs) {
|
|
20
|
+
const fixedNow = React.useMemo(
|
|
21
|
+
() => now ? normalizeDate(now) : void 0,
|
|
22
|
+
[now]
|
|
23
|
+
);
|
|
24
|
+
const [liveNow, setLiveNow] = React.useState(fixedNow ?? /* @__PURE__ */ new Date());
|
|
25
|
+
React.useEffect(() => {
|
|
26
|
+
if (fixedNow) {
|
|
27
|
+
setLiveNow(fixedNow);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const interval = window.setInterval(() => {
|
|
31
|
+
setLiveNow(/* @__PURE__ */ new Date());
|
|
32
|
+
}, tickMs);
|
|
33
|
+
return () => {
|
|
34
|
+
window.clearInterval(interval);
|
|
35
|
+
};
|
|
36
|
+
}, [fixedNow, tickMs]);
|
|
37
|
+
return liveNow;
|
|
38
|
+
}
|
|
15
39
|
function getRemainingMs(deadline, now) {
|
|
16
40
|
return deadline.getTime() - now.getTime();
|
|
17
41
|
}
|
|
@@ -1,16 +1,26 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { memo } from "react";
|
|
3
|
+
import { memo, useEffect } from "react";
|
|
4
4
|
import { X } from "lucide-react";
|
|
5
5
|
import { createPortal } from "react-dom";
|
|
6
|
-
import { useEscapeKey } from "../../lib/use-escape-key";
|
|
7
6
|
import { cn } from "../../lib/utils";
|
|
8
7
|
const FlowFullscreen = memo(function FlowFullscreen2({
|
|
9
8
|
children,
|
|
10
9
|
isOpen,
|
|
11
10
|
onClose
|
|
12
11
|
}) {
|
|
13
|
-
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
if (!isOpen) return;
|
|
14
|
+
const handleKeyDown = (e) => {
|
|
15
|
+
if (e.key === "Escape") {
|
|
16
|
+
onClose();
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
20
|
+
return () => {
|
|
21
|
+
document.removeEventListener("keydown", handleKeyDown);
|
|
22
|
+
};
|
|
23
|
+
}, [isOpen, onClose]);
|
|
14
24
|
if (!isOpen) return null;
|
|
15
25
|
if (typeof document === "undefined") return null;
|
|
16
26
|
return createPortal(
|
|
@@ -6,8 +6,6 @@ import {
|
|
|
6
6
|
useReactFlow
|
|
7
7
|
} from "@xyflow/react";
|
|
8
8
|
import { toPng } from "html-to-image";
|
|
9
|
-
import { useBodyScrollLock } from "../../lib/use-body-scroll-lock";
|
|
10
|
-
import { useEscapeKey } from "../../lib/use-escape-key";
|
|
11
9
|
const MIN_ZOOM = 0.1;
|
|
12
10
|
const MAX_ZOOM = 2;
|
|
13
11
|
const ZOOM_STEP = 0.2;
|
|
@@ -46,11 +44,24 @@ function useFullscreenState(allowFullscreen) {
|
|
|
46
44
|
const closeFullscreen = useCallback(() => {
|
|
47
45
|
setIsFullscreen(false);
|
|
48
46
|
}, []);
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
if (!isFullscreen) return;
|
|
49
|
+
const handleKeyDown = (e) => {
|
|
50
|
+
if (e.key === "Escape") {
|
|
51
|
+
closeFullscreen();
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
55
|
+
return () => {
|
|
56
|
+
document.removeEventListener("keydown", handleKeyDown);
|
|
57
|
+
};
|
|
58
|
+
}, [isFullscreen, closeFullscreen]);
|
|
59
|
+
useEffect(() => {
|
|
60
|
+
document.body.style.overflow = isFullscreen ? "hidden" : "";
|
|
61
|
+
return () => {
|
|
62
|
+
document.body.style.overflow = "";
|
|
63
|
+
};
|
|
64
|
+
}, [isFullscreen]);
|
|
54
65
|
return { closeFullscreen, isFullscreen, toggleFullscreen };
|
|
55
66
|
}
|
|
56
67
|
const IMAGE_WIDTH = 1024;
|