@vllnt/ui 0.1.4 → 0.1.7-canary.2c4792f
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/accordion/accordion.js +172 -0
- package/dist/components/accordion/index.js +12 -0
- package/dist/components/alert/alert.js +53 -0
- package/dist/components/alert/index.js +7 -0
- package/dist/components/alert-dialog/alert-dialog.js +117 -0
- package/dist/components/alert-dialog/index.js +26 -0
- package/dist/components/aspect-ratio/aspect-ratio.js +6 -0
- package/dist/components/aspect-ratio/index.js +4 -0
- package/dist/components/avatar/avatar.js +43 -0
- package/dist/components/avatar/index.js +6 -0
- package/dist/components/badge/badge.js +26 -0
- package/dist/components/badge/index.js +5 -0
- package/dist/components/blog-card/blog-card.js +50 -0
- package/dist/components/blog-card/index.js +5 -0
- package/dist/components/breadcrumb/breadcrumb.js +61 -0
- package/dist/components/breadcrumb/index.js +4 -0
- package/dist/components/button/button.js +48 -0
- package/dist/components/button/index.js +5 -0
- package/dist/components/calendar/calendar.js +71 -0
- package/dist/components/calendar/index.js +4 -0
- package/dist/components/callout/callout.js +59 -0
- package/dist/components/callout/index.js +4 -0
- package/dist/components/card/card.js +64 -0
- package/dist/components/card/index.js +16 -0
- package/dist/components/carousel/carousel.js +239 -0
- package/dist/components/carousel/index.js +14 -0
- package/dist/components/category-filter/category-filter.js +34 -0
- package/dist/components/category-filter/index.js +4 -0
- package/dist/components/chart/area-chart.js +99 -0
- package/dist/components/chart/bar-chart.js +80 -0
- package/dist/components/chart/index.js +3 -0
- package/dist/components/chart/line-chart.js +97 -0
- package/dist/components/checkbox/checkbox.js +28 -0
- package/dist/components/checkbox/index.js +4 -0
- package/dist/components/checklist/checklist.js +181 -0
- package/dist/components/checklist/index.js +6 -0
- package/dist/components/code-block/code-block.js +126 -0
- package/dist/components/code-block/index.js +4 -0
- package/dist/components/code-playground/code-playground.js +86 -0
- package/dist/components/code-playground/index.js +8 -0
- package/dist/components/collapsible/collapsible.js +10 -0
- package/dist/components/collapsible/index.js +10 -0
- package/dist/components/command/command.js +123 -0
- package/dist/components/command/index.js +22 -0
- package/dist/components/comparison/comparison.js +121 -0
- package/dist/components/comparison/index.js +8 -0
- package/dist/components/completion-dialog/completion-dialog.js +173 -0
- package/dist/components/completion-dialog/index.js +6 -0
- package/dist/components/content-intro/content-intro.js +144 -0
- package/dist/components/content-intro/index.js +6 -0
- package/dist/components/context-menu/context-menu.js +154 -0
- package/dist/components/context-menu/index.js +34 -0
- package/dist/components/cookie-consent/cookie-consent.js +175 -0
- package/dist/components/cookie-consent/index.js +8 -0
- package/dist/components/dialog/dialog.js +105 -0
- package/dist/components/dialog/index.js +24 -0
- package/dist/components/drawer/drawer.js +102 -0
- package/dist/components/drawer/index.js +24 -0
- package/dist/components/dropdown-menu/dropdown-menu.js +151 -0
- package/dist/components/dropdown-menu/index.js +34 -0
- package/dist/components/exercise/exercise.js +112 -0
- package/dist/components/exercise/index.js +4 -0
- package/dist/components/faq/faq.js +56 -0
- package/dist/components/faq/index.js +5 -0
- package/dist/components/filter-bar/filter-bar.js +244 -0
- package/dist/components/filter-bar/index.js +6 -0
- package/dist/components/floating-action-button/floating-action-button.js +35 -0
- package/dist/components/floating-action-button/index.js +6 -0
- package/dist/components/flow-diagram/flow-canvas.js +109 -0
- package/dist/components/flow-diagram/flow-controls.js +140 -0
- package/dist/components/flow-diagram/flow-diagram.js +114 -0
- package/dist/components/flow-diagram/flow-error-boundary.js +63 -0
- package/dist/components/flow-diagram/flow-fullscreen.js +58 -0
- package/dist/components/flow-diagram/index.js +12 -0
- package/dist/components/flow-diagram/types.js +0 -0
- package/dist/components/flow-diagram/use-flow-diagram.js +146 -0
- package/dist/components/horizontal-scroll-row/horizontal-scroll-row.js +66 -0
- package/dist/components/horizontal-scroll-row/index.js +6 -0
- package/dist/components/hover-card/hover-card.js +26 -0
- package/dist/components/hover-card/index.js +6 -0
- package/dist/components/index.js +641 -0
- package/dist/components/inline-input/index.js +4 -0
- package/dist/components/inline-input/inline-input.js +42 -0
- package/dist/components/input/index.js +4 -0
- package/dist/components/input/input.js +23 -0
- package/dist/components/input-otp/index.js +12 -0
- package/dist/components/input-otp/input-otp.js +54 -0
- package/dist/components/key-concept/index.js +8 -0
- package/dist/components/key-concept/key-concept.js +79 -0
- package/dist/components/keyboard-shortcuts-help/index.js +6 -0
- package/dist/components/keyboard-shortcuts-help/keyboard-shortcuts-help.js +121 -0
- package/dist/components/label/index.js +4 -0
- package/dist/components/label/label.js +21 -0
- package/dist/components/lang-provider/index.js +4 -0
- package/dist/components/lang-provider/lang-provider.js +18 -0
- package/dist/components/learning-objectives/index.js +10 -0
- package/dist/components/learning-objectives/learning-objectives.js +76 -0
- package/dist/components/mdx-content/index.js +4 -0
- package/dist/components/mdx-content/mdx-content.js +151 -0
- package/dist/components/menubar/index.js +36 -0
- package/dist/components/menubar/menubar.js +183 -0
- package/dist/components/model-selector/index.js +6 -0
- package/dist/components/model-selector/model-selector.js +374 -0
- package/dist/components/navbar-saas/index.js +6 -0
- package/dist/components/navbar-saas/navbar-saas.js +68 -0
- package/dist/components/navbar-saas/use-mobile.js +19 -0
- package/dist/components/navigation-menu/index.js +22 -0
- package/dist/components/navigation-menu/navigation-menu.js +108 -0
- package/dist/components/pagination/index.js +4 -0
- package/dist/components/pagination/pagination.js +44 -0
- package/dist/components/popover/index.js +12 -0
- package/dist/components/popover/popover.js +28 -0
- package/dist/components/pro-tip/index.js +8 -0
- package/dist/components/pro-tip/pro-tip.js +139 -0
- package/dist/components/profile-section/index.js +4 -0
- package/dist/components/profile-section/profile-section.js +45 -0
- package/dist/components/progress-bar/index.js +4 -0
- package/dist/components/progress-bar/progress-bar.js +56 -0
- package/dist/components/progress-card/index.js +6 -0
- package/dist/components/progress-card/progress-card.js +71 -0
- package/dist/components/quiz/index.js +4 -0
- package/dist/components/quiz/quiz.js +210 -0
- package/dist/components/radio-group/index.js +5 -0
- package/dist/components/radio-group/radio-group.js +36 -0
- package/dist/components/resizable/index.js +10 -0
- package/dist/components/resizable/resizable.js +39 -0
- package/dist/components/scroll-area/index.js +5 -0
- package/dist/components/scroll-area/scroll-area.js +39 -0
- package/dist/components/search-bar/index.js +4 -0
- package/dist/components/search-bar/search-bar.js +122 -0
- package/dist/components/search-dialog/index.js +4 -0
- package/dist/components/search-dialog/search-dialog.js +102 -0
- package/dist/components/select/index.js +24 -0
- package/dist/components/select/select.js +125 -0
- package/dist/components/separator/index.js +4 -0
- package/dist/components/separator/separator.js +25 -0
- package/dist/components/share-dialog/index.js +6 -0
- package/dist/components/share-dialog/share-dialog.js +121 -0
- package/dist/components/share-section/index.js +6 -0
- package/dist/components/share-section/share-section.js +57 -0
- package/dist/components/sheet/index.js +24 -0
- package/dist/components/sheet/sheet.js +116 -0
- package/dist/components/sidebar/index.js +4 -0
- package/dist/components/sidebar/sidebar.js +188 -0
- package/dist/components/sidebar-provider/index.js +5 -0
- package/dist/components/sidebar-provider/sidebar-provider.js +25 -0
- package/dist/components/sidebar-toggle/index.js +4 -0
- package/dist/components/sidebar-toggle/sidebar-toggle.js +36 -0
- package/dist/components/skeleton/index.js +4 -0
- package/dist/components/skeleton/skeleton.js +17 -0
- package/dist/components/slider/index.js +4 -0
- package/dist/components/slider/slider.js +24 -0
- package/dist/components/slideshow/index.js +6 -0
- package/dist/components/slideshow/slideshow.js +440 -0
- package/dist/components/social-fab/index.js +6 -0
- package/dist/components/social-fab/social-fab.js +211 -0
- package/dist/components/social-fab/use-social-fab.js +111 -0
- package/dist/components/spinner/index.js +4 -0
- package/dist/components/spinner/spinner.js +23 -0
- package/dist/components/step-by-step/index.js +8 -0
- package/dist/components/step-by-step/step-by-step.js +194 -0
- package/dist/components/step-navigation/index.js +4 -0
- package/dist/components/step-navigation/step-navigation.js +119 -0
- package/dist/components/switch/index.js +4 -0
- package/dist/components/switch/switch.js +28 -0
- package/dist/components/table/index.js +20 -0
- package/dist/components/table/table.js +87 -0
- package/dist/components/table-of-contents/index.js +4 -0
- package/dist/components/table-of-contents/table-of-contents.js +71 -0
- package/dist/components/table-of-contents-panel/index.js +6 -0
- package/dist/components/table-of-contents-panel/table-of-contents-panel.js +202 -0
- package/dist/components/tabs/index.js +12 -0
- package/dist/components/tabs/tabs.js +84 -0
- package/dist/components/terminal/index.js +8 -0
- package/dist/components/terminal/terminal.js +119 -0
- package/dist/components/textarea/index.js +4 -0
- package/dist/components/textarea/textarea.js +22 -0
- package/dist/components/theme-provider/index.js +4 -0
- package/dist/components/theme-provider/theme-provider.js +11 -0
- package/dist/components/theme-toggle/index.js +4 -0
- package/dist/components/theme-toggle/theme-toggle.js +170 -0
- package/dist/components/thinking-block/index.js +4 -0
- package/dist/components/thinking-block/thinking-block.js +56 -0
- package/dist/components/tldr-section/index.js +4 -0
- package/dist/components/tldr-section/tldr-section.js +101 -0
- package/dist/components/toast/index.js +18 -0
- package/dist/components/toast/toast.js +84 -0
- package/dist/components/toast/toaster.js +38 -0
- package/dist/components/toggle/index.js +5 -0
- package/dist/components/toggle/toggle.js +39 -0
- package/dist/components/toggle-group/index.js +5 -0
- package/dist/components/toggle-group/toggle-group.js +46 -0
- package/dist/components/tooltip/index.js +12 -0
- package/dist/components/tooltip/tooltip.js +27 -0
- package/dist/components/truncated-text/index.js +4 -0
- package/dist/components/truncated-text/truncated-text.js +25 -0
- package/dist/components/tutorial-card/index.js +6 -0
- package/dist/components/tutorial-card/tutorial-card.js +78 -0
- package/dist/components/tutorial-complete/index.js +6 -0
- package/dist/components/tutorial-complete/tutorial-complete.js +134 -0
- package/dist/components/tutorial-filters/index.js +6 -0
- package/dist/components/tutorial-filters/tutorial-filters.js +205 -0
- package/dist/components/tutorial-intro-content/index.js +6 -0
- package/dist/components/tutorial-intro-content/tutorial-intro-content.js +141 -0
- package/dist/components/tutorial-mdx/index.js +8 -0
- package/dist/components/tutorial-mdx/tutorial-mdx.js +219 -0
- package/dist/components/video-embed/index.js +4 -0
- package/dist/components/video-embed/video-embed.js +77 -0
- package/dist/components/view-switcher/index.js +6 -0
- package/dist/components/view-switcher/view-switcher.js +92 -0
- package/dist/index.d.ts +44 -2
- package/dist/index.js +14 -8556
- package/dist/lib/types.js +11 -0
- package/dist/lib/use-debounce.js +17 -0
- package/dist/lib/use-horizontal-scroll.js +60 -0
- package/dist/lib/use-mounted.js +17 -0
- package/dist/lib/utils.js +8 -0
- package/dist/tailwind-preset.d.ts +5 -0
- package/dist/tailwind-preset.js +9 -10
- package/dist/types/content.js +0 -0
- package/dist/types/index.js +0 -0
- package/package.json +42 -23
- package/LICENSE +0 -21
- package/dist/chunk-XRV5RSYH.js +0 -569
- package/dist/flow-diagram-N3EHM6VB.js +0 -2
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import {
|
|
4
|
+
ThemeProvider as NextThemesProvider
|
|
5
|
+
} from "next-themes";
|
|
6
|
+
function ThemeProvider({ children, ...props }) {
|
|
7
|
+
return /* @__PURE__ */ jsx(NextThemesProvider, { ...props, children });
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
ThemeProvider
|
|
11
|
+
};
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useCallback, useRef, useState } from "react";
|
|
4
|
+
import { useTheme } from "next-themes";
|
|
5
|
+
import { useMounted } from "../../lib/use-mounted";
|
|
6
|
+
import { Button } from "../button/button";
|
|
7
|
+
import {
|
|
8
|
+
DropdownMenu,
|
|
9
|
+
DropdownMenuContent,
|
|
10
|
+
DropdownMenuItem,
|
|
11
|
+
DropdownMenuTrigger
|
|
12
|
+
} from "../dropdown-menu/dropdown-menu";
|
|
13
|
+
function ThemeButton({
|
|
14
|
+
ariaLabel,
|
|
15
|
+
children,
|
|
16
|
+
icon,
|
|
17
|
+
...props
|
|
18
|
+
}) {
|
|
19
|
+
return /* @__PURE__ */ jsxs(
|
|
20
|
+
Button,
|
|
21
|
+
{
|
|
22
|
+
"aria-label": ariaLabel,
|
|
23
|
+
className: "bg-background text-foreground border border-gray-300 dark:border-gray-600 hover:border-gray-400 dark:hover:border-gray-500 transition-colors",
|
|
24
|
+
size: "icon",
|
|
25
|
+
variant: "outline",
|
|
26
|
+
...props,
|
|
27
|
+
children: [
|
|
28
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-mono", children: icon }),
|
|
29
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: ariaLabel }),
|
|
30
|
+
children
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
function ThemeMenuItem({
|
|
36
|
+
icon,
|
|
37
|
+
label,
|
|
38
|
+
onClick
|
|
39
|
+
}) {
|
|
40
|
+
return /* @__PURE__ */ jsxs(
|
|
41
|
+
DropdownMenuItem,
|
|
42
|
+
{
|
|
43
|
+
className: "hover:bg-accent cursor-pointer",
|
|
44
|
+
onClick,
|
|
45
|
+
children: [
|
|
46
|
+
icon,
|
|
47
|
+
" ",
|
|
48
|
+
label
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
function ThemeToggle({ dict }) {
|
|
54
|
+
const { setTheme, theme } = useTheme();
|
|
55
|
+
const mounted = useMounted();
|
|
56
|
+
const [open, setOpen] = useState(false);
|
|
57
|
+
const closeTimerReference = useRef(null);
|
|
58
|
+
const isHoveringOverMenuAreaReference = useRef(false);
|
|
59
|
+
const clearCloseTimer = useCallback(() => {
|
|
60
|
+
if (closeTimerReference.current !== null) {
|
|
61
|
+
window.clearTimeout(closeTimerReference.current);
|
|
62
|
+
closeTimerReference.current = null;
|
|
63
|
+
}
|
|
64
|
+
}, []);
|
|
65
|
+
const scheduleClose = useCallback(() => {
|
|
66
|
+
clearCloseTimer();
|
|
67
|
+
closeTimerReference.current = window.setTimeout(() => {
|
|
68
|
+
setOpen(false);
|
|
69
|
+
}, 250);
|
|
70
|
+
}, [clearCloseTimer]);
|
|
71
|
+
const handleOpenChange = useCallback((nextOpen) => {
|
|
72
|
+
if (!nextOpen && isHoveringOverMenuAreaReference.current) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
setOpen(nextOpen);
|
|
76
|
+
}, []);
|
|
77
|
+
const getThemeIcon = useCallback(() => {
|
|
78
|
+
if (!mounted) return "\u2600";
|
|
79
|
+
switch (theme) {
|
|
80
|
+
case "light":
|
|
81
|
+
return "\u2600";
|
|
82
|
+
case "dark":
|
|
83
|
+
return "\u263E";
|
|
84
|
+
case "system":
|
|
85
|
+
return "\u2699";
|
|
86
|
+
case void 0:
|
|
87
|
+
return "\u2699";
|
|
88
|
+
default:
|
|
89
|
+
return "\u2699";
|
|
90
|
+
}
|
|
91
|
+
}, [theme, mounted]);
|
|
92
|
+
const themeIcon = getThemeIcon();
|
|
93
|
+
const handleThemeChange = useCallback(
|
|
94
|
+
(newTheme) => {
|
|
95
|
+
setTheme(newTheme);
|
|
96
|
+
},
|
|
97
|
+
[setTheme]
|
|
98
|
+
);
|
|
99
|
+
if (!mounted) {
|
|
100
|
+
return /* @__PURE__ */ jsx(ThemeButton, { ariaLabel: dict.theme.toggle_theme, icon: "\u2600" });
|
|
101
|
+
}
|
|
102
|
+
return /* @__PURE__ */ jsxs(DropdownMenu, { modal: false, onOpenChange: handleOpenChange, open, children: [
|
|
103
|
+
/* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
104
|
+
ThemeButton,
|
|
105
|
+
{
|
|
106
|
+
ariaLabel: dict.theme.toggle_theme,
|
|
107
|
+
icon: themeIcon,
|
|
108
|
+
onMouseEnter: () => {
|
|
109
|
+
isHoveringOverMenuAreaReference.current = true;
|
|
110
|
+
clearCloseTimer();
|
|
111
|
+
setOpen(true);
|
|
112
|
+
},
|
|
113
|
+
onMouseLeave: () => {
|
|
114
|
+
isHoveringOverMenuAreaReference.current = false;
|
|
115
|
+
scheduleClose();
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
) }),
|
|
119
|
+
/* @__PURE__ */ jsxs(
|
|
120
|
+
DropdownMenuContent,
|
|
121
|
+
{
|
|
122
|
+
align: "end",
|
|
123
|
+
className: "bg-background border border-gray-300 dark:border-gray-600",
|
|
124
|
+
onMouseEnter: () => {
|
|
125
|
+
isHoveringOverMenuAreaReference.current = true;
|
|
126
|
+
clearCloseTimer();
|
|
127
|
+
},
|
|
128
|
+
onMouseLeave: () => {
|
|
129
|
+
isHoveringOverMenuAreaReference.current = false;
|
|
130
|
+
scheduleClose();
|
|
131
|
+
},
|
|
132
|
+
children: [
|
|
133
|
+
/* @__PURE__ */ jsx(
|
|
134
|
+
ThemeMenuItem,
|
|
135
|
+
{
|
|
136
|
+
icon: "\u2600",
|
|
137
|
+
label: dict.theme.light,
|
|
138
|
+
onClick: () => {
|
|
139
|
+
handleThemeChange("light");
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
),
|
|
143
|
+
/* @__PURE__ */ jsx(
|
|
144
|
+
ThemeMenuItem,
|
|
145
|
+
{
|
|
146
|
+
icon: "\u263E",
|
|
147
|
+
label: dict.theme.dark,
|
|
148
|
+
onClick: () => {
|
|
149
|
+
handleThemeChange("dark");
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
),
|
|
153
|
+
/* @__PURE__ */ jsx(
|
|
154
|
+
ThemeMenuItem,
|
|
155
|
+
{
|
|
156
|
+
icon: "\u2699",
|
|
157
|
+
label: dict.theme.system,
|
|
158
|
+
onClick: () => {
|
|
159
|
+
handleThemeChange("system");
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
)
|
|
163
|
+
]
|
|
164
|
+
}
|
|
165
|
+
)
|
|
166
|
+
] });
|
|
167
|
+
}
|
|
168
|
+
export {
|
|
169
|
+
ThemeToggle
|
|
170
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useCallback, useEffect, useId, useState } from "react";
|
|
4
|
+
import { ChevronDown, ChevronRight } from "lucide-react";
|
|
5
|
+
import { cn } from "../../lib/utils";
|
|
6
|
+
function ThinkingBlock({
|
|
7
|
+
className,
|
|
8
|
+
isStreaming = false,
|
|
9
|
+
thinking
|
|
10
|
+
}) {
|
|
11
|
+
const [isExpanded, setIsExpanded] = useState(isStreaming);
|
|
12
|
+
const contentId = useId();
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
if (isStreaming) {
|
|
15
|
+
requestAnimationFrame(() => {
|
|
16
|
+
setIsExpanded(true);
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}, [isStreaming]);
|
|
20
|
+
const toggleExpanded = useCallback(() => {
|
|
21
|
+
setIsExpanded((previous) => !previous);
|
|
22
|
+
}, []);
|
|
23
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("mb-2", className), children: [
|
|
24
|
+
/* @__PURE__ */ jsxs(
|
|
25
|
+
"button",
|
|
26
|
+
{
|
|
27
|
+
"aria-controls": contentId,
|
|
28
|
+
"aria-expanded": isExpanded,
|
|
29
|
+
className: "flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",
|
|
30
|
+
onClick: toggleExpanded,
|
|
31
|
+
type: "button",
|
|
32
|
+
children: [
|
|
33
|
+
isExpanded ? /* @__PURE__ */ jsx(ChevronDown, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx(ChevronRight, { className: "h-3 w-3" }),
|
|
34
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
35
|
+
"Thinking",
|
|
36
|
+
isStreaming ? /* @__PURE__ */ jsx("span", { className: "ml-1 animate-pulse", children: "..." }) : null
|
|
37
|
+
] })
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
),
|
|
41
|
+
isExpanded ? /* @__PURE__ */ jsxs(
|
|
42
|
+
"div",
|
|
43
|
+
{
|
|
44
|
+
className: "mt-2 p-3 bg-muted/50 rounded text-xs text-muted-foreground whitespace-pre-wrap border-l-2 border-muted-foreground/30 max-h-48 overflow-y-auto",
|
|
45
|
+
id: contentId,
|
|
46
|
+
children: [
|
|
47
|
+
thinking,
|
|
48
|
+
isStreaming ? /* @__PURE__ */ jsx("span", { className: "animate-pulse", children: "|" }) : null
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
) : null
|
|
52
|
+
] });
|
|
53
|
+
}
|
|
54
|
+
export {
|
|
55
|
+
ThinkingBlock
|
|
56
|
+
};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useRef, useState } from "react";
|
|
4
|
+
function TLDRSection({ children, label }) {
|
|
5
|
+
const [isExpanded, setIsExpanded] = useState(false);
|
|
6
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
7
|
+
const [hasBeenOpened, setHasBeenOpened] = useState(false);
|
|
8
|
+
const timerReference = useRef(null);
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
if (isExpanded && !hasBeenOpened) {
|
|
11
|
+
if (timerReference.current) {
|
|
12
|
+
clearTimeout(timerReference.current);
|
|
13
|
+
}
|
|
14
|
+
const rafId = requestAnimationFrame(() => {
|
|
15
|
+
setIsLoading(true);
|
|
16
|
+
setHasBeenOpened(true);
|
|
17
|
+
});
|
|
18
|
+
timerReference.current = setTimeout(() => {
|
|
19
|
+
setIsLoading(false);
|
|
20
|
+
timerReference.current = null;
|
|
21
|
+
}, 800);
|
|
22
|
+
return () => {
|
|
23
|
+
cancelAnimationFrame(rafId);
|
|
24
|
+
if (timerReference.current) {
|
|
25
|
+
clearTimeout(timerReference.current);
|
|
26
|
+
timerReference.current = null;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
return () => {
|
|
31
|
+
if (timerReference.current) {
|
|
32
|
+
clearTimeout(timerReference.current);
|
|
33
|
+
timerReference.current = null;
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
}, [isExpanded]);
|
|
37
|
+
return /* @__PURE__ */ jsxs("div", { className: "my-8 rounded-lg border border-border bg-muted/30 overflow-hidden", children: [
|
|
38
|
+
/* @__PURE__ */ jsxs(
|
|
39
|
+
"button",
|
|
40
|
+
{
|
|
41
|
+
className: "flex items-center justify-between w-full px-4 py-3 hover:bg-muted/50 transition-colors",
|
|
42
|
+
onClick: () => {
|
|
43
|
+
setIsExpanded(!isExpanded);
|
|
44
|
+
},
|
|
45
|
+
type: "button",
|
|
46
|
+
children: [
|
|
47
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
48
|
+
/* @__PURE__ */ jsx(
|
|
49
|
+
"svg",
|
|
50
|
+
{
|
|
51
|
+
className: "w-5 h-5 text-muted-foreground",
|
|
52
|
+
fill: "none",
|
|
53
|
+
stroke: "currentColor",
|
|
54
|
+
strokeWidth: "2",
|
|
55
|
+
viewBox: "0 0 24 24",
|
|
56
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
57
|
+
children: /* @__PURE__ */ jsx(
|
|
58
|
+
"path",
|
|
59
|
+
{
|
|
60
|
+
d: "M4 6h16M4 12h16M4 18h16",
|
|
61
|
+
strokeLinecap: "round",
|
|
62
|
+
strokeLinejoin: "round"
|
|
63
|
+
}
|
|
64
|
+
)
|
|
65
|
+
}
|
|
66
|
+
),
|
|
67
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium text-foreground", children: label })
|
|
68
|
+
] }),
|
|
69
|
+
/* @__PURE__ */ jsx(
|
|
70
|
+
"svg",
|
|
71
|
+
{
|
|
72
|
+
className: `w-4 h-4 text-muted-foreground transition-transform ${isExpanded ? "rotate-180" : ""}`,
|
|
73
|
+
fill: "none",
|
|
74
|
+
stroke: "currentColor",
|
|
75
|
+
strokeWidth: "2",
|
|
76
|
+
viewBox: "0 0 24 24",
|
|
77
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
78
|
+
children: /* @__PURE__ */ jsx(
|
|
79
|
+
"path",
|
|
80
|
+
{
|
|
81
|
+
d: "M19 9l-7 7-7-7",
|
|
82
|
+
strokeLinecap: "round",
|
|
83
|
+
strokeLinejoin: "round"
|
|
84
|
+
}
|
|
85
|
+
)
|
|
86
|
+
}
|
|
87
|
+
)
|
|
88
|
+
]
|
|
89
|
+
}
|
|
90
|
+
),
|
|
91
|
+
isExpanded ? /* @__PURE__ */ jsx("div", { className: "px-4 pb-4 pt-2 border-t border-border", children: isLoading ? /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
|
|
92
|
+
/* @__PURE__ */ jsx("div", { className: "relative h-4 bg-muted/50 rounded overflow-hidden", children: /* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-gradient-to-r from-transparent via-amber-400/40 to-transparent animate-shimmer" }) }),
|
|
93
|
+
/* @__PURE__ */ jsx("div", { className: "relative h-4 bg-muted/50 rounded overflow-hidden w-5/6", children: /* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-gradient-to-r from-transparent via-amber-400/40 to-transparent animate-shimmer" }) }),
|
|
94
|
+
/* @__PURE__ */ jsx("div", { className: "relative h-4 bg-muted/50 rounded overflow-hidden w-4/5", children: /* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-gradient-to-r from-transparent via-amber-400/40 to-transparent animate-shimmer" }) }),
|
|
95
|
+
/* @__PURE__ */ jsx("div", { className: "relative h-4 bg-muted/50 rounded overflow-hidden w-3/4", children: /* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-gradient-to-r from-transparent via-amber-400/40 to-transparent animate-shimmer" }) })
|
|
96
|
+
] }) : /* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground leading-relaxed", children }) }) : null
|
|
97
|
+
] });
|
|
98
|
+
}
|
|
99
|
+
export {
|
|
100
|
+
TLDRSection
|
|
101
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Toast,
|
|
3
|
+
ToastAction,
|
|
4
|
+
ToastClose,
|
|
5
|
+
ToastDescription,
|
|
6
|
+
ToastTitle
|
|
7
|
+
} from "./toast";
|
|
8
|
+
import { Toaster } from "./toaster";
|
|
9
|
+
import { toast } from "sonner";
|
|
10
|
+
export {
|
|
11
|
+
Toast,
|
|
12
|
+
ToastAction,
|
|
13
|
+
ToastClose,
|
|
14
|
+
ToastDescription,
|
|
15
|
+
ToastTitle,
|
|
16
|
+
Toaster,
|
|
17
|
+
toast
|
|
18
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
import { cn } from "../../lib/utils";
|
|
6
|
+
const toastVariants = cva(
|
|
7
|
+
"group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",
|
|
8
|
+
{
|
|
9
|
+
defaultVariants: {
|
|
10
|
+
variant: "default"
|
|
11
|
+
},
|
|
12
|
+
variants: {
|
|
13
|
+
variant: {
|
|
14
|
+
default: "border bg-background text-foreground",
|
|
15
|
+
destructive: "destructive border-destructive bg-destructive text-destructive-foreground"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
const Toast = React.forwardRef(({ className, variant, ...props }, reference) => /* @__PURE__ */ jsx(
|
|
21
|
+
"div",
|
|
22
|
+
{
|
|
23
|
+
className: cn(toastVariants({ variant }), className),
|
|
24
|
+
ref: reference,
|
|
25
|
+
...props
|
|
26
|
+
}
|
|
27
|
+
));
|
|
28
|
+
Toast.displayName = "Toast";
|
|
29
|
+
const ToastAction = React.forwardRef(({ altText, className, ...props }, reference) => /* @__PURE__ */ jsx(
|
|
30
|
+
"button",
|
|
31
|
+
{
|
|
32
|
+
className: cn(
|
|
33
|
+
"inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",
|
|
34
|
+
className
|
|
35
|
+
),
|
|
36
|
+
ref: reference,
|
|
37
|
+
type: "button",
|
|
38
|
+
...props
|
|
39
|
+
}
|
|
40
|
+
));
|
|
41
|
+
ToastAction.displayName = "ToastAction";
|
|
42
|
+
const ToastClose = React.forwardRef(({ className, ...props }, reference) => /* @__PURE__ */ jsxs(
|
|
43
|
+
"button",
|
|
44
|
+
{
|
|
45
|
+
className: cn(
|
|
46
|
+
"absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",
|
|
47
|
+
className
|
|
48
|
+
),
|
|
49
|
+
"data-toast-close": "true",
|
|
50
|
+
ref: reference,
|
|
51
|
+
type: "button",
|
|
52
|
+
...props,
|
|
53
|
+
children: [
|
|
54
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" }),
|
|
55
|
+
"\u2715"
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
));
|
|
59
|
+
ToastClose.displayName = "ToastClose";
|
|
60
|
+
const ToastTitle = React.forwardRef(({ className, ...props }, reference) => /* @__PURE__ */ jsx(
|
|
61
|
+
"div",
|
|
62
|
+
{
|
|
63
|
+
className: cn("text-sm font-semibold", className),
|
|
64
|
+
ref: reference,
|
|
65
|
+
...props
|
|
66
|
+
}
|
|
67
|
+
));
|
|
68
|
+
ToastTitle.displayName = "ToastTitle";
|
|
69
|
+
const ToastDescription = React.forwardRef(({ className, ...props }, reference) => /* @__PURE__ */ jsx(
|
|
70
|
+
"div",
|
|
71
|
+
{
|
|
72
|
+
className: cn("text-sm opacity-90", className),
|
|
73
|
+
ref: reference,
|
|
74
|
+
...props
|
|
75
|
+
}
|
|
76
|
+
));
|
|
77
|
+
ToastDescription.displayName = "ToastDescription";
|
|
78
|
+
export {
|
|
79
|
+
Toast,
|
|
80
|
+
ToastAction,
|
|
81
|
+
ToastClose,
|
|
82
|
+
ToastDescription,
|
|
83
|
+
ToastTitle
|
|
84
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import {
|
|
4
|
+
CircleCheckIcon,
|
|
5
|
+
InfoIcon,
|
|
6
|
+
Loader2Icon,
|
|
7
|
+
OctagonXIcon,
|
|
8
|
+
TriangleAlertIcon
|
|
9
|
+
} from "lucide-react";
|
|
10
|
+
import { useTheme } from "next-themes";
|
|
11
|
+
import { Toaster as Sonner } from "sonner";
|
|
12
|
+
const Toaster = ({ ...props }) => {
|
|
13
|
+
const { theme = "system" } = useTheme();
|
|
14
|
+
return /* @__PURE__ */ jsx(
|
|
15
|
+
Sonner,
|
|
16
|
+
{
|
|
17
|
+
className: "toaster group",
|
|
18
|
+
icons: {
|
|
19
|
+
error: /* @__PURE__ */ jsx(OctagonXIcon, { className: "size-4" }),
|
|
20
|
+
info: /* @__PURE__ */ jsx(InfoIcon, { className: "size-4" }),
|
|
21
|
+
loading: /* @__PURE__ */ jsx(Loader2Icon, { className: "size-4 animate-spin" }),
|
|
22
|
+
success: /* @__PURE__ */ jsx(CircleCheckIcon, { className: "size-4" }),
|
|
23
|
+
warning: /* @__PURE__ */ jsx(TriangleAlertIcon, { className: "size-4" })
|
|
24
|
+
},
|
|
25
|
+
style: {
|
|
26
|
+
"--border-radius": "var(--radius)",
|
|
27
|
+
"--normal-bg": "var(--popover)",
|
|
28
|
+
"--normal-border": "var(--border)",
|
|
29
|
+
"--normal-text": "var(--popover-foreground)"
|
|
30
|
+
},
|
|
31
|
+
theme,
|
|
32
|
+
...props
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
export {
|
|
37
|
+
Toaster
|
|
38
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
import * as TogglePrimitive from "@radix-ui/react-toggle";
|
|
5
|
+
import { cva } from "class-variance-authority";
|
|
6
|
+
import { cn } from "../../lib/utils";
|
|
7
|
+
const toggleVariants = cva(
|
|
8
|
+
"inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
9
|
+
{
|
|
10
|
+
defaultVariants: {
|
|
11
|
+
size: "default",
|
|
12
|
+
variant: "default"
|
|
13
|
+
},
|
|
14
|
+
variants: {
|
|
15
|
+
size: {
|
|
16
|
+
default: "h-10 px-3 min-w-10",
|
|
17
|
+
lg: "h-11 px-5 min-w-11",
|
|
18
|
+
sm: "h-9 px-2.5 min-w-9"
|
|
19
|
+
},
|
|
20
|
+
variant: {
|
|
21
|
+
default: "bg-transparent",
|
|
22
|
+
outline: "border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
const Toggle = forwardRef(({ className, size, variant, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
28
|
+
TogglePrimitive.Root,
|
|
29
|
+
{
|
|
30
|
+
className: cn(toggleVariants({ className, size, variant })),
|
|
31
|
+
ref,
|
|
32
|
+
...props
|
|
33
|
+
}
|
|
34
|
+
));
|
|
35
|
+
Toggle.displayName = TogglePrimitive.Root.displayName;
|
|
36
|
+
export {
|
|
37
|
+
Toggle,
|
|
38
|
+
toggleVariants
|
|
39
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { createContext, forwardRef, useContext, useMemo } from "react";
|
|
4
|
+
import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
|
|
5
|
+
import { cn } from "../../lib/utils";
|
|
6
|
+
import { toggleVariants } from "../toggle/toggle";
|
|
7
|
+
const ToggleGroupContext = createContext({
|
|
8
|
+
size: "default",
|
|
9
|
+
variant: "default"
|
|
10
|
+
});
|
|
11
|
+
const ToggleGroup = forwardRef(({ children, className, size, variant, ...props }, ref) => {
|
|
12
|
+
const contextValue = useMemo(() => ({ size, variant }), [size, variant]);
|
|
13
|
+
return /* @__PURE__ */ jsx(
|
|
14
|
+
ToggleGroupPrimitive.Root,
|
|
15
|
+
{
|
|
16
|
+
className: cn("flex items-center justify-center gap-1", className),
|
|
17
|
+
ref,
|
|
18
|
+
...props,
|
|
19
|
+
children: /* @__PURE__ */ jsx(ToggleGroupContext.Provider, { value: contextValue, children })
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
});
|
|
23
|
+
ToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName;
|
|
24
|
+
const ToggleGroupItem = forwardRef(({ children, className, size, variant, ...props }, ref) => {
|
|
25
|
+
const context = useContext(ToggleGroupContext);
|
|
26
|
+
return /* @__PURE__ */ jsx(
|
|
27
|
+
ToggleGroupPrimitive.Item,
|
|
28
|
+
{
|
|
29
|
+
className: cn(
|
|
30
|
+
toggleVariants({
|
|
31
|
+
size: context.size ?? size,
|
|
32
|
+
variant: context.variant ?? variant
|
|
33
|
+
}),
|
|
34
|
+
className
|
|
35
|
+
),
|
|
36
|
+
ref,
|
|
37
|
+
...props,
|
|
38
|
+
children
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
});
|
|
42
|
+
ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;
|
|
43
|
+
export {
|
|
44
|
+
ToggleGroup,
|
|
45
|
+
ToggleGroupItem
|
|
46
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
5
|
+
import { cn } from "../../lib/utils";
|
|
6
|
+
const TooltipProvider = TooltipPrimitive.Provider;
|
|
7
|
+
const Tooltip = TooltipPrimitive.Root;
|
|
8
|
+
const TooltipTrigger = TooltipPrimitive.Trigger;
|
|
9
|
+
const TooltipContent = forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
10
|
+
TooltipPrimitive.Content,
|
|
11
|
+
{
|
|
12
|
+
className: cn(
|
|
13
|
+
"z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
14
|
+
className
|
|
15
|
+
),
|
|
16
|
+
ref,
|
|
17
|
+
sideOffset,
|
|
18
|
+
...props
|
|
19
|
+
}
|
|
20
|
+
) }));
|
|
21
|
+
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
22
|
+
export {
|
|
23
|
+
Tooltip,
|
|
24
|
+
TooltipContent,
|
|
25
|
+
TooltipProvider,
|
|
26
|
+
TooltipTrigger
|
|
27
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../lib/utils";
|
|
3
|
+
function TruncatedText({
|
|
4
|
+
children,
|
|
5
|
+
className,
|
|
6
|
+
maxWidth = "calc(100vw - 220px)"
|
|
7
|
+
}) {
|
|
8
|
+
return /* @__PURE__ */ jsx(
|
|
9
|
+
"span",
|
|
10
|
+
{
|
|
11
|
+
className: cn(
|
|
12
|
+
"inline-block align-middle overflow-hidden text-ellipsis whitespace-nowrap sm:max-w-none sm:overflow-visible",
|
|
13
|
+
className
|
|
14
|
+
),
|
|
15
|
+
style: {
|
|
16
|
+
maxWidth
|
|
17
|
+
},
|
|
18
|
+
title: children,
|
|
19
|
+
children
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
TruncatedText
|
|
25
|
+
};
|