@vllnt/ui 0.1.4 → 0.1.6
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 +65 -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 +235 -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 +123 -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 +109 -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 +171 -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 +141 -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 +633 -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 +140 -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 +68 -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 +120 -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 +442 -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 +172 -0
- package/dist/components/thinking-block/index.js +4 -0
- package/dist/components/thinking-block/thinking-block.js +52 -0
- package/dist/components/tldr-section/index.js +4 -0
- package/dist/components/tldr-section/tldr-section.js +92 -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 +75 -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/index.js +12 -8556
- package/dist/lib/types.js +11 -0
- package/dist/lib/use-debounce.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 +1 -1
- package/dist/chunk-XRV5RSYH.js +0 -569
- package/dist/flow-diagram-N3EHM6VB.js +0 -2
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Command as CommandPrimitive } from "cmdk";
|
|
5
|
+
import { Search } from "lucide-react";
|
|
6
|
+
import { cn } from "../../lib/utils";
|
|
7
|
+
import { Dialog, DialogContent, DialogTitle } from "../dialog/dialog";
|
|
8
|
+
const Command = React.forwardRef(({ className, ...props }, reference) => /* @__PURE__ */ jsx(
|
|
9
|
+
CommandPrimitive,
|
|
10
|
+
{
|
|
11
|
+
className: cn(
|
|
12
|
+
"flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
|
|
13
|
+
className
|
|
14
|
+
),
|
|
15
|
+
ref: reference,
|
|
16
|
+
...props
|
|
17
|
+
}
|
|
18
|
+
));
|
|
19
|
+
Command.displayName = CommandPrimitive.displayName;
|
|
20
|
+
const CommandDialog = ({ children, ...props }) => {
|
|
21
|
+
return /* @__PURE__ */ jsx(Dialog, { ...props, children: /* @__PURE__ */ jsxs(DialogContent, { className: "overflow-hidden p-0 shadow-lg", children: [
|
|
22
|
+
/* @__PURE__ */ jsx(DialogTitle, { className: "sr-only", children: "Command Menu" }),
|
|
23
|
+
/* @__PURE__ */ jsx(Command, { className: "[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5", children })
|
|
24
|
+
] }) });
|
|
25
|
+
};
|
|
26
|
+
const CommandInput = React.forwardRef(({ className, ...props }, reference) => (
|
|
27
|
+
// eslint-disable-next-line react/no-unknown-property
|
|
28
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [
|
|
29
|
+
/* @__PURE__ */ jsx(Search, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
|
|
30
|
+
/* @__PURE__ */ jsx(
|
|
31
|
+
CommandPrimitive.Input,
|
|
32
|
+
{
|
|
33
|
+
className: cn(
|
|
34
|
+
"flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
|
|
35
|
+
className
|
|
36
|
+
),
|
|
37
|
+
ref: reference,
|
|
38
|
+
...props
|
|
39
|
+
}
|
|
40
|
+
)
|
|
41
|
+
] })
|
|
42
|
+
));
|
|
43
|
+
CommandInput.displayName = CommandPrimitive.Input.displayName;
|
|
44
|
+
const CommandList = React.forwardRef(({ className, ...props }, reference) => /* @__PURE__ */ jsx(
|
|
45
|
+
CommandPrimitive.List,
|
|
46
|
+
{
|
|
47
|
+
className: cn("max-h-[300px] overflow-y-auto overflow-x-hidden", className),
|
|
48
|
+
ref: reference,
|
|
49
|
+
...props
|
|
50
|
+
}
|
|
51
|
+
));
|
|
52
|
+
CommandList.displayName = CommandPrimitive.List.displayName;
|
|
53
|
+
const CommandEmpty = React.forwardRef((props, reference) => /* @__PURE__ */ jsx(
|
|
54
|
+
CommandPrimitive.Empty,
|
|
55
|
+
{
|
|
56
|
+
className: "py-6 text-center text-sm",
|
|
57
|
+
ref: reference,
|
|
58
|
+
...props
|
|
59
|
+
}
|
|
60
|
+
));
|
|
61
|
+
CommandEmpty.displayName = CommandPrimitive.Empty.displayName;
|
|
62
|
+
const CommandGroup = React.forwardRef(({ className, ...props }, reference) => /* @__PURE__ */ jsx(
|
|
63
|
+
CommandPrimitive.Group,
|
|
64
|
+
{
|
|
65
|
+
className: cn(
|
|
66
|
+
"overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
|
|
67
|
+
className
|
|
68
|
+
),
|
|
69
|
+
ref: reference,
|
|
70
|
+
...props
|
|
71
|
+
}
|
|
72
|
+
));
|
|
73
|
+
CommandGroup.displayName = CommandPrimitive.Group.displayName;
|
|
74
|
+
const CommandSeparator = React.forwardRef(({ className, ...props }, reference) => /* @__PURE__ */ jsx(
|
|
75
|
+
CommandPrimitive.Separator,
|
|
76
|
+
{
|
|
77
|
+
className: cn("-mx-1 h-px bg-border", className),
|
|
78
|
+
ref: reference,
|
|
79
|
+
...props
|
|
80
|
+
}
|
|
81
|
+
));
|
|
82
|
+
CommandSeparator.displayName = CommandPrimitive.Separator.displayName;
|
|
83
|
+
const CommandItem = React.forwardRef(({ className, disabled, ...props }, reference) => /* @__PURE__ */ jsx(
|
|
84
|
+
CommandPrimitive.Item,
|
|
85
|
+
{
|
|
86
|
+
className: cn(
|
|
87
|
+
"relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:opacity-50",
|
|
88
|
+
disabled && "pointer-events-none",
|
|
89
|
+
className
|
|
90
|
+
),
|
|
91
|
+
disabled,
|
|
92
|
+
ref: reference,
|
|
93
|
+
...props
|
|
94
|
+
}
|
|
95
|
+
));
|
|
96
|
+
CommandItem.displayName = CommandPrimitive.Item.displayName;
|
|
97
|
+
const CommandShortcut = ({
|
|
98
|
+
className,
|
|
99
|
+
...props
|
|
100
|
+
}) => {
|
|
101
|
+
return /* @__PURE__ */ jsx(
|
|
102
|
+
"span",
|
|
103
|
+
{
|
|
104
|
+
className: cn(
|
|
105
|
+
"ml-auto text-xs tracking-widest text-muted-foreground",
|
|
106
|
+
className
|
|
107
|
+
),
|
|
108
|
+
...props
|
|
109
|
+
}
|
|
110
|
+
);
|
|
111
|
+
};
|
|
112
|
+
CommandShortcut.displayName = "CommandShortcut";
|
|
113
|
+
export {
|
|
114
|
+
Command,
|
|
115
|
+
CommandDialog,
|
|
116
|
+
CommandEmpty,
|
|
117
|
+
CommandGroup,
|
|
118
|
+
CommandInput,
|
|
119
|
+
CommandItem,
|
|
120
|
+
CommandList,
|
|
121
|
+
CommandSeparator,
|
|
122
|
+
CommandShortcut
|
|
123
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Command,
|
|
3
|
+
CommandDialog,
|
|
4
|
+
CommandEmpty,
|
|
5
|
+
CommandGroup,
|
|
6
|
+
CommandInput,
|
|
7
|
+
CommandItem,
|
|
8
|
+
CommandList,
|
|
9
|
+
CommandSeparator,
|
|
10
|
+
CommandShortcut
|
|
11
|
+
} from "./command";
|
|
12
|
+
export {
|
|
13
|
+
Command,
|
|
14
|
+
CommandDialog,
|
|
15
|
+
CommandEmpty,
|
|
16
|
+
CommandGroup,
|
|
17
|
+
CommandInput,
|
|
18
|
+
CommandItem,
|
|
19
|
+
CommandList,
|
|
20
|
+
CommandSeparator,
|
|
21
|
+
CommandShortcut
|
|
22
|
+
};
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { ArrowRight, Check, Minus, X } from "lucide-react";
|
|
4
|
+
import { cn } from "../../lib/utils";
|
|
5
|
+
const variantConfig = {
|
|
6
|
+
bad: {
|
|
7
|
+
className: "border-red-500/30 bg-red-500/5",
|
|
8
|
+
headerClass: "bg-red-500/10 text-red-700 dark:text-red-300",
|
|
9
|
+
icon: X,
|
|
10
|
+
iconClass: "text-red-500"
|
|
11
|
+
},
|
|
12
|
+
good: {
|
|
13
|
+
className: "border-green-500/30 bg-green-500/5",
|
|
14
|
+
headerClass: "bg-green-500/10 text-green-700 dark:text-green-300",
|
|
15
|
+
icon: Check,
|
|
16
|
+
iconClass: "text-green-500"
|
|
17
|
+
},
|
|
18
|
+
neutral: {
|
|
19
|
+
className: "border-border bg-muted/30",
|
|
20
|
+
headerClass: "bg-muted text-muted-foreground",
|
|
21
|
+
icon: Minus,
|
|
22
|
+
iconClass: "text-muted-foreground"
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
function Comparison({ after, before, title }) {
|
|
26
|
+
const beforeConfig = variantConfig[before.variant || "bad"];
|
|
27
|
+
const afterConfig = variantConfig[after.variant || "good"];
|
|
28
|
+
const BeforeIcon = beforeConfig.icon;
|
|
29
|
+
const AfterIcon = afterConfig.icon;
|
|
30
|
+
return /* @__PURE__ */ jsxs("div", { className: "my-6", children: [
|
|
31
|
+
title ? /* @__PURE__ */ jsx("h4", { className: "font-semibold mb-3", children: title }) : null,
|
|
32
|
+
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
33
|
+
/* @__PURE__ */ jsxs("div", { className: cn("rounded-lg border", beforeConfig.className), children: [
|
|
34
|
+
/* @__PURE__ */ jsx(
|
|
35
|
+
"div",
|
|
36
|
+
{
|
|
37
|
+
className: cn(
|
|
38
|
+
"px-4 py-2 rounded-t-lg font-medium text-sm",
|
|
39
|
+
beforeConfig.headerClass
|
|
40
|
+
),
|
|
41
|
+
children: before.title
|
|
42
|
+
}
|
|
43
|
+
),
|
|
44
|
+
/* @__PURE__ */ jsx("ul", { className: "p-4 space-y-2", children: before.items.map((item, index) => /* @__PURE__ */ jsxs("li", { className: "flex items-start gap-2 text-sm", children: [
|
|
45
|
+
/* @__PURE__ */ jsx(
|
|
46
|
+
BeforeIcon,
|
|
47
|
+
{
|
|
48
|
+
className: cn(
|
|
49
|
+
"h-4 w-4 mt-0.5 flex-shrink-0",
|
|
50
|
+
beforeConfig.iconClass
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
),
|
|
54
|
+
/* @__PURE__ */ jsx("span", { children: item })
|
|
55
|
+
] }, index)) })
|
|
56
|
+
] }),
|
|
57
|
+
/* @__PURE__ */ jsxs("div", { className: cn("rounded-lg border", afterConfig.className), children: [
|
|
58
|
+
/* @__PURE__ */ jsx(
|
|
59
|
+
"div",
|
|
60
|
+
{
|
|
61
|
+
className: cn(
|
|
62
|
+
"px-4 py-2 rounded-t-lg font-medium text-sm",
|
|
63
|
+
afterConfig.headerClass
|
|
64
|
+
),
|
|
65
|
+
children: after.title
|
|
66
|
+
}
|
|
67
|
+
),
|
|
68
|
+
/* @__PURE__ */ jsx("ul", { className: "p-4 space-y-2", children: after.items.map((item, index) => /* @__PURE__ */ jsxs("li", { className: "flex items-start gap-2 text-sm", children: [
|
|
69
|
+
/* @__PURE__ */ jsx(
|
|
70
|
+
AfterIcon,
|
|
71
|
+
{
|
|
72
|
+
className: cn(
|
|
73
|
+
"h-4 w-4 mt-0.5 flex-shrink-0",
|
|
74
|
+
afterConfig.iconClass
|
|
75
|
+
)
|
|
76
|
+
}
|
|
77
|
+
),
|
|
78
|
+
/* @__PURE__ */ jsx("span", { children: item })
|
|
79
|
+
] }, index)) })
|
|
80
|
+
] })
|
|
81
|
+
] })
|
|
82
|
+
] });
|
|
83
|
+
}
|
|
84
|
+
function BeforeAfter({ after, before, title }) {
|
|
85
|
+
return /* @__PURE__ */ jsxs("div", { className: "my-6", children: [
|
|
86
|
+
title ? /* @__PURE__ */ jsx("h4", { className: "font-semibold mb-3", children: title }) : null,
|
|
87
|
+
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-[1fr_auto_1fr] gap-4 items-start", children: [
|
|
88
|
+
/* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-red-500/30 bg-red-500/5 overflow-hidden", children: [
|
|
89
|
+
/* @__PURE__ */ jsxs("div", { className: "px-4 py-2 bg-red-500/10 text-red-700 dark:text-red-300 font-medium text-sm flex items-center gap-2", children: [
|
|
90
|
+
/* @__PURE__ */ jsx(X, { className: "h-4 w-4" }),
|
|
91
|
+
"Before"
|
|
92
|
+
] }),
|
|
93
|
+
/* @__PURE__ */ jsx("div", { className: "p-4 text-sm [&>pre]:my-0", children: before })
|
|
94
|
+
] }),
|
|
95
|
+
/* @__PURE__ */ jsx("div", { className: "hidden md:flex items-center justify-center h-full", children: /* @__PURE__ */ jsx(ArrowRight, { className: "h-6 w-6 text-muted-foreground" }) }),
|
|
96
|
+
/* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-green-500/30 bg-green-500/5 overflow-hidden", children: [
|
|
97
|
+
/* @__PURE__ */ jsxs("div", { className: "px-4 py-2 bg-green-500/10 text-green-700 dark:text-green-300 font-medium text-sm flex items-center gap-2", children: [
|
|
98
|
+
/* @__PURE__ */ jsx(Check, { className: "h-4 w-4" }),
|
|
99
|
+
"After"
|
|
100
|
+
] }),
|
|
101
|
+
/* @__PURE__ */ jsx("div", { className: "p-4 text-sm [&>pre]:my-0", children: after })
|
|
102
|
+
] })
|
|
103
|
+
] })
|
|
104
|
+
] });
|
|
105
|
+
}
|
|
106
|
+
export {
|
|
107
|
+
BeforeAfter,
|
|
108
|
+
Comparison
|
|
109
|
+
};
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { memo, useCallback, useEffect, useRef } from "react";
|
|
4
|
+
import { cn } from "../../lib/utils";
|
|
5
|
+
import { Button } from "../button";
|
|
6
|
+
function DialogContent({
|
|
7
|
+
cancelLabel = "Skip",
|
|
8
|
+
cancelShortcut = "S",
|
|
9
|
+
className,
|
|
10
|
+
closeIcon,
|
|
11
|
+
confirmLabel = "Done",
|
|
12
|
+
confirmShortcut = "D",
|
|
13
|
+
description,
|
|
14
|
+
onCancel,
|
|
15
|
+
onClose,
|
|
16
|
+
onConfirm,
|
|
17
|
+
title
|
|
18
|
+
}) {
|
|
19
|
+
const confirmButtonRef = useRef(null);
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
confirmButtonRef.current?.focus();
|
|
22
|
+
}, []);
|
|
23
|
+
return /* @__PURE__ */ jsxs(
|
|
24
|
+
"div",
|
|
25
|
+
{
|
|
26
|
+
className: cn(
|
|
27
|
+
"relative z-10 w-full max-w-md mx-4 p-6 bg-background border border-border rounded-lg shadow-lg",
|
|
28
|
+
"animate-in fade-in-0 zoom-in-95 duration-200",
|
|
29
|
+
className
|
|
30
|
+
),
|
|
31
|
+
children: [
|
|
32
|
+
/* @__PURE__ */ jsx(
|
|
33
|
+
"button",
|
|
34
|
+
{
|
|
35
|
+
"aria-label": "Close",
|
|
36
|
+
className: "absolute right-4 top-4 rounded-sm opacity-70 hover:opacity-100 transition-opacity",
|
|
37
|
+
onClick: onClose,
|
|
38
|
+
type: "button",
|
|
39
|
+
children: closeIcon ?? /* @__PURE__ */ jsx(
|
|
40
|
+
"svg",
|
|
41
|
+
{
|
|
42
|
+
className: "h-4 w-4",
|
|
43
|
+
fill: "none",
|
|
44
|
+
stroke: "currentColor",
|
|
45
|
+
viewBox: "0 0 24 24",
|
|
46
|
+
children: /* @__PURE__ */ jsx(
|
|
47
|
+
"path",
|
|
48
|
+
{
|
|
49
|
+
d: "M6 18L18 6M6 6l12 12",
|
|
50
|
+
strokeLinecap: "round",
|
|
51
|
+
strokeLinejoin: "round",
|
|
52
|
+
strokeWidth: 2
|
|
53
|
+
}
|
|
54
|
+
)
|
|
55
|
+
}
|
|
56
|
+
)
|
|
57
|
+
}
|
|
58
|
+
),
|
|
59
|
+
/* @__PURE__ */ jsxs("div", { className: "mb-4", children: [
|
|
60
|
+
/* @__PURE__ */ jsx("h2", { className: "text-lg font-semibold", id: "completion-dialog-title", children: title }),
|
|
61
|
+
description ? /* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground mt-1.5", children: description }) : null
|
|
62
|
+
] }),
|
|
63
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-row gap-2", children: [
|
|
64
|
+
/* @__PURE__ */ jsxs(Button, { className: "flex-1 gap-2", onClick: onCancel, variant: "outline", children: [
|
|
65
|
+
/* @__PURE__ */ jsx("span", { children: cancelLabel }),
|
|
66
|
+
cancelShortcut ? /* @__PURE__ */ jsx("kbd", { className: "hidden md:inline-flex px-1.5 py-0.5 text-[10px] font-mono bg-muted rounded", children: cancelShortcut }) : null
|
|
67
|
+
] }),
|
|
68
|
+
/* @__PURE__ */ jsxs(
|
|
69
|
+
Button,
|
|
70
|
+
{
|
|
71
|
+
className: "flex-1 gap-2",
|
|
72
|
+
onClick: onConfirm,
|
|
73
|
+
ref: confirmButtonRef,
|
|
74
|
+
children: [
|
|
75
|
+
/* @__PURE__ */ jsx("span", { children: confirmLabel }),
|
|
76
|
+
confirmShortcut ? /* @__PURE__ */ jsx("kbd", { className: "hidden md:inline-flex px-1.5 py-0.5 text-[10px] font-mono bg-primary-foreground/20 rounded", children: confirmShortcut }) : null
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
)
|
|
80
|
+
] })
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
function CompletionDialogImpl({
|
|
86
|
+
cancelLabel,
|
|
87
|
+
cancelShortcut = "S",
|
|
88
|
+
className,
|
|
89
|
+
closeIcon,
|
|
90
|
+
confirmLabel,
|
|
91
|
+
confirmShortcut = "D",
|
|
92
|
+
description,
|
|
93
|
+
isOpen,
|
|
94
|
+
onCancel,
|
|
95
|
+
onClose,
|
|
96
|
+
onConfirm,
|
|
97
|
+
title
|
|
98
|
+
}) {
|
|
99
|
+
const handleKeyDown = useCallback(
|
|
100
|
+
(event) => {
|
|
101
|
+
if (!isOpen) return;
|
|
102
|
+
if (event.key === "Escape") {
|
|
103
|
+
event.preventDefault();
|
|
104
|
+
event.stopPropagation();
|
|
105
|
+
onClose();
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
if (event.key === "Enter" || event.key.toLowerCase() === confirmShortcut.toLowerCase()) {
|
|
109
|
+
event.preventDefault();
|
|
110
|
+
event.stopPropagation();
|
|
111
|
+
onConfirm();
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
if (event.key.toLowerCase() === cancelShortcut.toLowerCase()) {
|
|
115
|
+
event.preventDefault();
|
|
116
|
+
event.stopPropagation();
|
|
117
|
+
onCancel();
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
[isOpen, onClose, onConfirm, onCancel, confirmShortcut, cancelShortcut]
|
|
121
|
+
);
|
|
122
|
+
useEffect(() => {
|
|
123
|
+
if (!isOpen) return;
|
|
124
|
+
document.addEventListener("keydown", handleKeyDown, true);
|
|
125
|
+
return () => {
|
|
126
|
+
document.removeEventListener("keydown", handleKeyDown, true);
|
|
127
|
+
};
|
|
128
|
+
}, [isOpen, handleKeyDown]);
|
|
129
|
+
if (!isOpen) return null;
|
|
130
|
+
return /* @__PURE__ */ jsxs(
|
|
131
|
+
"div",
|
|
132
|
+
{
|
|
133
|
+
"aria-labelledby": "completion-dialog-title",
|
|
134
|
+
"aria-modal": "true",
|
|
135
|
+
className: "absolute inset-0 z-[100] flex items-center justify-center",
|
|
136
|
+
role: "dialog",
|
|
137
|
+
children: [
|
|
138
|
+
/* @__PURE__ */ jsx(
|
|
139
|
+
"div",
|
|
140
|
+
{
|
|
141
|
+
"aria-hidden": "true",
|
|
142
|
+
className: cn(
|
|
143
|
+
"absolute inset-0 bg-background/80 backdrop-blur-sm",
|
|
144
|
+
"animate-in fade-in-0 duration-200"
|
|
145
|
+
),
|
|
146
|
+
onClick: onClose
|
|
147
|
+
}
|
|
148
|
+
),
|
|
149
|
+
/* @__PURE__ */ jsx(
|
|
150
|
+
DialogContent,
|
|
151
|
+
{
|
|
152
|
+
cancelLabel,
|
|
153
|
+
cancelShortcut,
|
|
154
|
+
className,
|
|
155
|
+
closeIcon,
|
|
156
|
+
confirmLabel,
|
|
157
|
+
confirmShortcut,
|
|
158
|
+
description,
|
|
159
|
+
onCancel,
|
|
160
|
+
onClose,
|
|
161
|
+
onConfirm,
|
|
162
|
+
title
|
|
163
|
+
}
|
|
164
|
+
)
|
|
165
|
+
]
|
|
166
|
+
}
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
const CompletionDialog = memo(CompletionDialogImpl);
|
|
170
|
+
CompletionDialog.displayName = "CompletionDialog";
|
|
171
|
+
export {
|
|
172
|
+
CompletionDialog
|
|
173
|
+
};
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { memo, useCallback, useEffect } from "react";
|
|
4
|
+
import { cn } from "../../lib/utils";
|
|
5
|
+
import { Button } from "../button";
|
|
6
|
+
const DEFAULT_LABELS = {
|
|
7
|
+
continueLabel: "Continue Tutorial",
|
|
8
|
+
startLabel: "Start Tutorial",
|
|
9
|
+
tableOfContentsLabel: "Table of Contents"
|
|
10
|
+
};
|
|
11
|
+
function ContentIntroImpl({
|
|
12
|
+
additionalContent,
|
|
13
|
+
completedSections,
|
|
14
|
+
estimatedTime,
|
|
15
|
+
isLoading = false,
|
|
16
|
+
labels = {},
|
|
17
|
+
onGoToSection,
|
|
18
|
+
onStart,
|
|
19
|
+
renderIntroContent,
|
|
20
|
+
sections,
|
|
21
|
+
title
|
|
22
|
+
}) {
|
|
23
|
+
const mergedLabels = { ...DEFAULT_LABELS, ...labels };
|
|
24
|
+
const hasProgress = completedSections.size > 0;
|
|
25
|
+
const handleKeyDown = useCallback(
|
|
26
|
+
(event) => {
|
|
27
|
+
if (event.key === "Enter") {
|
|
28
|
+
event.preventDefault();
|
|
29
|
+
onStart();
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
[onStart]
|
|
33
|
+
);
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
36
|
+
return () => {
|
|
37
|
+
document.removeEventListener("keydown", handleKeyDown);
|
|
38
|
+
};
|
|
39
|
+
}, [handleKeyDown]);
|
|
40
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
41
|
+
/* @__PURE__ */ jsxs("div", { className: "animate-in fade-in-0 duration-500 pb-24", children: [
|
|
42
|
+
/* @__PURE__ */ jsxs("section", { className: "py-6", children: [
|
|
43
|
+
/* @__PURE__ */ jsx("h2", { className: "text-2xl md:text-3xl font-bold mb-6", children: title }),
|
|
44
|
+
/* @__PURE__ */ jsx("div", { className: cn("max-w-none", "[&_h2:first-of-type]:hidden"), children: renderIntroContent() })
|
|
45
|
+
] }),
|
|
46
|
+
/* @__PURE__ */ jsxs("section", { className: "mt-8 py-6 border-t border-border", children: [
|
|
47
|
+
/* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold mb-4", children: mergedLabels.tableOfContentsLabel }),
|
|
48
|
+
/* @__PURE__ */ jsx("ol", { className: "space-y-2", children: sections.map((section, index) => {
|
|
49
|
+
const isCompleted = !isLoading && completedSections.has(section.id);
|
|
50
|
+
return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(
|
|
51
|
+
"button",
|
|
52
|
+
{
|
|
53
|
+
className: "w-full flex items-center gap-3 p-2 -m-2 rounded-lg hover:bg-muted/50 transition-colors text-left",
|
|
54
|
+
onClick: () => {
|
|
55
|
+
onGoToSection(index);
|
|
56
|
+
},
|
|
57
|
+
type: "button",
|
|
58
|
+
children: [
|
|
59
|
+
/* @__PURE__ */ jsx(
|
|
60
|
+
"span",
|
|
61
|
+
{
|
|
62
|
+
className: cn(
|
|
63
|
+
"flex-shrink-0 w-6 h-6 rounded-full flex items-center justify-center text-xs font-medium tabular-nums transition-colors",
|
|
64
|
+
isLoading && "animate-pulse bg-muted",
|
|
65
|
+
!isLoading && isCompleted && "bg-foreground text-background",
|
|
66
|
+
!isLoading && !isCompleted && "bg-muted"
|
|
67
|
+
),
|
|
68
|
+
children: isCompleted ? /* @__PURE__ */ jsx(
|
|
69
|
+
"svg",
|
|
70
|
+
{
|
|
71
|
+
className: "h-3 w-3",
|
|
72
|
+
fill: "none",
|
|
73
|
+
stroke: "currentColor",
|
|
74
|
+
viewBox: "0 0 24 24",
|
|
75
|
+
children: /* @__PURE__ */ jsx(
|
|
76
|
+
"path",
|
|
77
|
+
{
|
|
78
|
+
d: "M5 13l4 4L19 7",
|
|
79
|
+
strokeLinecap: "round",
|
|
80
|
+
strokeLinejoin: "round",
|
|
81
|
+
strokeWidth: 2
|
|
82
|
+
}
|
|
83
|
+
)
|
|
84
|
+
}
|
|
85
|
+
) : index + 1
|
|
86
|
+
}
|
|
87
|
+
),
|
|
88
|
+
/* @__PURE__ */ jsx(
|
|
89
|
+
"span",
|
|
90
|
+
{
|
|
91
|
+
className: cn(
|
|
92
|
+
"text-sm",
|
|
93
|
+
isCompleted && "line-through text-muted-foreground"
|
|
94
|
+
),
|
|
95
|
+
children: section.title
|
|
96
|
+
}
|
|
97
|
+
)
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
) }, `${section.id}-${index}`);
|
|
101
|
+
}) })
|
|
102
|
+
] }),
|
|
103
|
+
additionalContent
|
|
104
|
+
] }),
|
|
105
|
+
/* @__PURE__ */ jsx("div", { className: "fixed bottom-0 left-0 right-0 z-50 border-t border-border bg-background/80 backdrop-blur-sm safe-bottom", children: /* @__PURE__ */ jsx("div", { className: "mx-auto max-w-3xl px-4 py-4", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-4", children: [
|
|
106
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground hidden sm:block", children: hasProgress ? `${completedSections.size}/${sections.length} completed` : `${sections.length} sections \xB7 ${estimatedTime}` }),
|
|
107
|
+
/* @__PURE__ */ jsxs(
|
|
108
|
+
Button,
|
|
109
|
+
{
|
|
110
|
+
className: "flex-1 sm:flex-none px-8 py-6 text-lg font-medium gap-2",
|
|
111
|
+
onClick: onStart,
|
|
112
|
+
size: "lg",
|
|
113
|
+
children: [
|
|
114
|
+
/* @__PURE__ */ jsx(
|
|
115
|
+
"svg",
|
|
116
|
+
{
|
|
117
|
+
className: "h-5 w-5",
|
|
118
|
+
fill: "none",
|
|
119
|
+
stroke: "currentColor",
|
|
120
|
+
viewBox: "0 0 24 24",
|
|
121
|
+
children: /* @__PURE__ */ jsx(
|
|
122
|
+
"path",
|
|
123
|
+
{
|
|
124
|
+
d: "M5 3l14 9-14 9V3z",
|
|
125
|
+
strokeLinecap: "round",
|
|
126
|
+
strokeLinejoin: "round",
|
|
127
|
+
strokeWidth: 2
|
|
128
|
+
}
|
|
129
|
+
)
|
|
130
|
+
}
|
|
131
|
+
),
|
|
132
|
+
/* @__PURE__ */ jsx("span", { children: hasProgress ? mergedLabels.continueLabel : mergedLabels.startLabel }),
|
|
133
|
+
/* @__PURE__ */ jsx("kbd", { className: "hidden md:inline-flex ml-1 px-1.5 py-0.5 text-xs font-mono bg-primary-foreground/20 rounded", children: "\u21B5" })
|
|
134
|
+
]
|
|
135
|
+
}
|
|
136
|
+
)
|
|
137
|
+
] }) }) })
|
|
138
|
+
] });
|
|
139
|
+
}
|
|
140
|
+
const ContentIntro = memo(ContentIntroImpl);
|
|
141
|
+
ContentIntro.displayName = "ContentIntro";
|
|
142
|
+
export {
|
|
143
|
+
ContentIntro
|
|
144
|
+
};
|