@vllnt/ui 0.2.1-canary.25c4600 → 0.2.1-canary.2ff6ef3
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 -2
- package/dist/components/activity-heatmap/activity-heatmap.js +1 -2
- package/dist/components/ai-artifact/ai-artifact.js +8 -8
- package/dist/components/ai-sidebar/ai-sidebar.js +4 -4
- package/dist/components/blog-card/blog-card.js +1 -3
- package/dist/components/bottom-activity-strip/bottom-activity-strip.js +2 -2
- package/dist/components/candlestick-chart/candlestick-chart.js +1 -2
- package/dist/components/checklist/checklist.js +1 -4
- package/dist/components/chronological-timeline/chronological-timeline.js +2 -2
- package/dist/components/code-playground/code-playground.js +1 -2
- package/dist/components/comment-pin/comment-pin.js +2 -2
- package/dist/components/comparison/comparison.js +1 -2
- package/dist/components/completion-dialog/completion-dialog.js +1 -4
- package/dist/components/content-intro/content-intro.js +3 -5
- package/dist/components/exercise/exercise.js +2 -10
- package/dist/components/faq/faq.js +2 -6
- package/dist/components/floating-toolbar/floating-toolbar.js +2 -2
- package/dist/components/horizontal-scroll-row/horizontal-scroll-row.js +1 -2
- package/dist/components/interactive-timeline/interactive-timeline.js +2 -2
- package/dist/components/jarvis-dock/jarvis-dock.js +2 -2
- package/dist/components/key-concept/key-concept.js +1 -2
- package/dist/components/keyboard-shortcuts-help/keyboard-shortcuts-help.js +1 -2
- package/dist/components/knowledge-check/knowledge-check.js +2 -2
- package/dist/components/learning-objectives/learning-objectives.js +1 -2
- package/dist/components/map-timeline/map-timeline.js +4 -4
- package/dist/components/market-treemap/market-treemap.js +2 -2
- package/dist/components/navbar-saas/navbar-saas.js +0 -1
- package/dist/components/order-book/order-book.js +2 -2
- package/dist/components/policy-delivery-panel/policy-delivery-panel.js +2 -2
- package/dist/components/profile-section/profile-section.js +1 -2
- package/dist/components/prompt-templates/prompt-templates.js +2 -2
- package/dist/components/quiz/quiz.js +2 -3
- package/dist/components/relationship-inspector/relationship-inspector.js +2 -2
- package/dist/components/routing-assignment-panel/routing-assignment-panel.js +2 -2
- package/dist/components/run-timeline/run-timeline.js +2 -2
- package/dist/components/share-dialog/share-dialog.js +2 -2
- package/dist/components/share-section/share-section.js +1 -2
- package/dist/components/sidebar/sidebar.js +17 -18
- package/dist/components/slideshow/slideshow.js +1 -2
- package/dist/components/social-fab/social-fab.js +6 -6
- package/dist/components/status-board/status-board.js +1 -2
- package/dist/components/step-by-step/step-by-step.js +1 -2
- package/dist/components/table-of-contents/table-of-contents.js +2 -5
- package/dist/components/table-of-contents-panel/table-of-contents-panel.js +1 -3
- package/dist/components/timeline-scrubber/timeline-scrubber.js +2 -2
- package/dist/components/tutorial-complete/tutorial-complete.js +4 -6
- package/dist/components/tutorial-filters/tutorial-filters.js +1 -1
- package/dist/components/viewport-bookmarks/viewport-bookmarks.js +2 -2
- package/dist/components/watchlist/watchlist.js +1 -2
- package/dist/components/world-breadcrumbs/world-breadcrumbs.js +2 -2
- package/dist/components/world-clock-bar/world-clock-bar.js +1 -2
- package/dist/index.d.ts +24 -95
- package/package.json +1 -1
|
@@ -40,7 +40,7 @@ const RowBody = (props) => {
|
|
|
40
40
|
const Row = (props) => {
|
|
41
41
|
const { policy } = props;
|
|
42
42
|
if (policy.onToggle) {
|
|
43
|
-
const
|
|
43
|
+
const handleClick = () => {
|
|
44
44
|
policy.onToggle?.();
|
|
45
45
|
};
|
|
46
46
|
return /* @__PURE__ */ jsx(
|
|
@@ -49,7 +49,7 @@ const Row = (props) => {
|
|
|
49
49
|
className: "flex w-full items-center gap-2 rounded-md border border-transparent px-2 py-1.5 text-left transition-colors hover:border-border hover:bg-muted/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
50
50
|
"data-policy-row": policy.id,
|
|
51
51
|
"data-policy-status": policy.status,
|
|
52
|
-
onClick:
|
|
52
|
+
onClick: handleClick,
|
|
53
53
|
type: "button",
|
|
54
54
|
children: /* @__PURE__ */ jsx(RowBody, { policy })
|
|
55
55
|
}
|
|
@@ -3,7 +3,6 @@ import Image from "next/image";
|
|
|
3
3
|
import Link from "next/link";
|
|
4
4
|
import { Button } from "../button/button";
|
|
5
5
|
function ProfileSection({
|
|
6
|
-
as: Heading = "h3",
|
|
7
6
|
compact = false,
|
|
8
7
|
dict,
|
|
9
8
|
imageAlt,
|
|
@@ -26,7 +25,7 @@ function ProfileSection({
|
|
|
26
25
|
}
|
|
27
26
|
) }) : null,
|
|
28
27
|
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
29
|
-
/* @__PURE__ */ jsx(
|
|
28
|
+
/* @__PURE__ */ jsx("h3", { className: `font-semibold ${compact ? "text-lg" : "text-xl"}`, children: dict.profile.name }),
|
|
30
29
|
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: compact ? dict.profile.tagline : `> ${dict.profile.tagline}` })
|
|
31
30
|
] }),
|
|
32
31
|
showSocialLinks ? /* @__PURE__ */ jsx("div", { className: "flex flex-wrap justify-center items-center gap-2", children: socialLinks?.map((link) => /* @__PURE__ */ jsx(
|
|
@@ -243,7 +243,7 @@ function VariableField({
|
|
|
243
243
|
onValueChange,
|
|
244
244
|
value
|
|
245
245
|
}) {
|
|
246
|
-
const
|
|
246
|
+
const handleChange = useCallback(
|
|
247
247
|
(event) => {
|
|
248
248
|
onValueChange(name, event.target.value);
|
|
249
249
|
},
|
|
@@ -255,7 +255,7 @@ function VariableField({
|
|
|
255
255
|
Input,
|
|
256
256
|
{
|
|
257
257
|
id: fieldId,
|
|
258
|
-
onChange:
|
|
258
|
+
onChange: handleChange,
|
|
259
259
|
placeholder: `Value for ${name}`,
|
|
260
260
|
value
|
|
261
261
|
}
|
|
@@ -118,7 +118,6 @@ function QuizResult({
|
|
|
118
118
|
);
|
|
119
119
|
}
|
|
120
120
|
function Quiz({
|
|
121
|
-
as: Heading = "h4",
|
|
122
121
|
className,
|
|
123
122
|
explanation,
|
|
124
123
|
hint,
|
|
@@ -160,7 +159,7 @@ function Quiz({
|
|
|
160
159
|
)
|
|
161
160
|
}
|
|
162
161
|
),
|
|
163
|
-
/* @__PURE__ */ jsx(
|
|
162
|
+
/* @__PURE__ */ jsx("h4", { className: "font-semibold text-foreground", children: question })
|
|
164
163
|
] }),
|
|
165
164
|
/* @__PURE__ */ jsx("div", { className: "space-y-2 mb-4", children: options.map((opt, index) => /* @__PURE__ */ jsx(
|
|
166
165
|
QuizOptionButton,
|
|
@@ -173,7 +172,7 @@ function Quiz({
|
|
|
173
172
|
selectedIndex,
|
|
174
173
|
submitted
|
|
175
174
|
},
|
|
176
|
-
`quiz-option-${
|
|
175
|
+
typeof opt === "string" ? opt : `quiz-option-${String(opt)}`
|
|
177
176
|
)) }),
|
|
178
177
|
hint && !submitted ? /* @__PURE__ */ jsx(
|
|
179
178
|
QuizHint,
|
|
@@ -28,7 +28,7 @@ const RowBody = (props) => {
|
|
|
28
28
|
const Row = (props) => {
|
|
29
29
|
const { edge } = props;
|
|
30
30
|
if (edge.onActivate) {
|
|
31
|
-
const
|
|
31
|
+
const handleClick = () => {
|
|
32
32
|
edge.onActivate?.();
|
|
33
33
|
};
|
|
34
34
|
return /* @__PURE__ */ jsx(
|
|
@@ -37,7 +37,7 @@ const Row = (props) => {
|
|
|
37
37
|
className: "flex w-full items-center gap-2 rounded-md border border-transparent px-2 py-1.5 text-left transition-colors hover:border-border hover:bg-muted/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
38
38
|
"data-relationship-direction": edge.direction,
|
|
39
39
|
"data-relationship-row": true,
|
|
40
|
-
onClick:
|
|
40
|
+
onClick: handleClick,
|
|
41
41
|
type: "button",
|
|
42
42
|
children: /* @__PURE__ */ jsx(RowBody, { edge })
|
|
43
43
|
}
|
|
@@ -63,7 +63,7 @@ const RowBody = (props) => {
|
|
|
63
63
|
const Row = (props) => {
|
|
64
64
|
const { assignment } = props;
|
|
65
65
|
if (assignment.onActivate) {
|
|
66
|
-
const
|
|
66
|
+
const handleClick = () => {
|
|
67
67
|
assignment.onActivate?.();
|
|
68
68
|
};
|
|
69
69
|
return /* @__PURE__ */ jsx(
|
|
@@ -72,7 +72,7 @@ const Row = (props) => {
|
|
|
72
72
|
className: "flex w-full items-center gap-2 rounded-md border border-transparent px-2 py-1.5 text-left transition-colors hover:border-border hover:bg-muted/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
73
73
|
"data-routing-assignment": assignment.id,
|
|
74
74
|
"data-routing-role": assignment.role,
|
|
75
|
-
onClick:
|
|
75
|
+
onClick: handleClick,
|
|
76
76
|
type: "button",
|
|
77
77
|
children: /* @__PURE__ */ jsx(RowBody, { assignment })
|
|
78
78
|
}
|
|
@@ -63,7 +63,7 @@ const PhaseBar = (props) => {
|
|
|
63
63
|
};
|
|
64
64
|
const ariaLabel = `${STATE_LABEL[state]} ${phase.start} \u2192 ${phase.end}`;
|
|
65
65
|
if (phase.onActivate) {
|
|
66
|
-
const
|
|
66
|
+
const handleClick = () => {
|
|
67
67
|
phase.onActivate?.();
|
|
68
68
|
};
|
|
69
69
|
return /* @__PURE__ */ jsx(
|
|
@@ -76,7 +76,7 @@ const PhaseBar = (props) => {
|
|
|
76
76
|
),
|
|
77
77
|
"data-run-phase": phase.id,
|
|
78
78
|
"data-run-phase-state": state,
|
|
79
|
-
onClick:
|
|
79
|
+
onClick: handleClick,
|
|
80
80
|
style: sharedStyle,
|
|
81
81
|
type: "button",
|
|
82
82
|
children: phase.label
|
|
@@ -13,7 +13,7 @@ function PlatformButton({
|
|
|
13
13
|
onClick,
|
|
14
14
|
platform
|
|
15
15
|
}) {
|
|
16
|
-
const
|
|
16
|
+
const handleClick = () => {
|
|
17
17
|
onClick(platform.key);
|
|
18
18
|
};
|
|
19
19
|
return /* @__PURE__ */ jsx(
|
|
@@ -26,7 +26,7 @@ function PlatformButton({
|
|
|
26
26
|
"hover:bg-accent hover:text-accent-foreground",
|
|
27
27
|
"focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2"
|
|
28
28
|
),
|
|
29
|
-
onClick:
|
|
29
|
+
onClick: handleClick,
|
|
30
30
|
type: "button",
|
|
31
31
|
children: platform.label
|
|
32
32
|
}
|
|
@@ -26,7 +26,6 @@ function buildShareUrl(platform, url, title) {
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
function ShareSection({
|
|
29
|
-
as: Heading = "h3",
|
|
30
29
|
buildUrl: buildUrlFunction = buildShareUrl,
|
|
31
30
|
platforms = defaultPlatforms,
|
|
32
31
|
shareOn,
|
|
@@ -35,7 +34,7 @@ function ShareSection({
|
|
|
35
34
|
url
|
|
36
35
|
}) {
|
|
37
36
|
return /* @__PURE__ */ jsxs("div", { className: "border-t border-border pt-6 mt-8", children: [
|
|
38
|
-
/* @__PURE__ */ jsx(
|
|
37
|
+
/* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold mb-4", children: shareTitle }),
|
|
39
38
|
/* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-3", children: platforms.map((platform) => /* @__PURE__ */ jsxs(
|
|
40
39
|
"a",
|
|
41
40
|
{
|
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useEffect, useRef, useState
|
|
3
|
+
import { useEffect, useRef, useState } from "react";
|
|
4
4
|
import { ChevronDown } from "lucide-react";
|
|
5
5
|
import Link from "next/link";
|
|
6
6
|
import { usePathname } from "next/navigation";
|
|
7
7
|
import { cn } from "../../lib/utils";
|
|
8
8
|
import { useSidebar } from "../sidebar-provider";
|
|
9
|
-
const getMobileSnapshot = () => typeof window === "undefined" ? false : window.innerWidth < 1024;
|
|
10
|
-
const getServerMobileSnapshot = () => false;
|
|
11
|
-
const subscribeToViewportResize = (onStoreChange) => {
|
|
12
|
-
window.addEventListener("resize", onStoreChange);
|
|
13
|
-
return () => {
|
|
14
|
-
window.removeEventListener("resize", onStoreChange);
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
9
|
function useMobile(setOpen) {
|
|
18
|
-
const isMobile =
|
|
19
|
-
subscribeToViewportResize,
|
|
20
|
-
getMobileSnapshot,
|
|
21
|
-
getServerMobileSnapshot
|
|
22
|
-
);
|
|
10
|
+
const [isMobile, setIsMobile] = useState(false);
|
|
23
11
|
useEffect(() => {
|
|
24
|
-
|
|
25
|
-
|
|
12
|
+
const checkMobile = () => {
|
|
13
|
+
const mobile = window.innerWidth < 1024;
|
|
14
|
+
setIsMobile(mobile);
|
|
15
|
+
if (mobile) {
|
|
16
|
+
setOpen(false);
|
|
17
|
+
} else {
|
|
18
|
+
setOpen(true);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
checkMobile();
|
|
22
|
+
window.addEventListener("resize", checkMobile);
|
|
23
|
+
return () => {
|
|
24
|
+
window.removeEventListener("resize", checkMobile);
|
|
25
|
+
};
|
|
26
|
+
}, [setOpen]);
|
|
26
27
|
return isMobile;
|
|
27
28
|
}
|
|
28
29
|
function useScrollFade(containerReference) {
|
|
@@ -87,7 +88,6 @@ function CollapsibleSection({
|
|
|
87
88
|
"grid transition-all duration-200 ease-in-out",
|
|
88
89
|
isOpen ? "grid-rows-[1fr] opacity-100" : "grid-rows-[0fr] opacity-0"
|
|
89
90
|
),
|
|
90
|
-
hidden: !isOpen,
|
|
91
91
|
children: /* @__PURE__ */ jsx("div", { className: "overflow-hidden", children })
|
|
92
92
|
}
|
|
93
93
|
)
|
|
@@ -106,7 +106,6 @@ function Sidebar({ sections }) {
|
|
|
106
106
|
"div",
|
|
107
107
|
{
|
|
108
108
|
className: "fixed inset-0 bg-black/50 z-40 lg:hidden",
|
|
109
|
-
"data-testid": "sidebar-overlay",
|
|
110
109
|
onClick: () => {
|
|
111
110
|
setOpen(false);
|
|
112
111
|
},
|
|
@@ -17,7 +17,6 @@ const DEFAULT_LABELS = {
|
|
|
17
17
|
};
|
|
18
18
|
const EMPTY_SLIDESHOW_LABELS = {};
|
|
19
19
|
function SlideshowImpl({
|
|
20
|
-
as: SectionsHeading = "h3",
|
|
21
20
|
completedSections,
|
|
22
21
|
completionDialogTitle = "Mark section as complete?",
|
|
23
22
|
currentIndex,
|
|
@@ -250,7 +249,7 @@ function SlideshowImpl({
|
|
|
250
249
|
role: "dialog",
|
|
251
250
|
children: [
|
|
252
251
|
/* @__PURE__ */ jsxs("div", { className: "sticky top-0 flex items-center justify-between px-4 py-3 border-b border-border bg-background", children: [
|
|
253
|
-
/* @__PURE__ */ jsx(
|
|
252
|
+
/* @__PURE__ */ jsx("h3", { className: "font-semibold", children: mergedLabels.sectionsLabel }),
|
|
254
253
|
/* @__PURE__ */ jsx(
|
|
255
254
|
"button",
|
|
256
255
|
{
|
|
@@ -8,14 +8,14 @@ function ShareMenu({
|
|
|
8
8
|
platforms
|
|
9
9
|
}) {
|
|
10
10
|
return /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-0.5 rounded-md border border-gray-300 bg-background p-1.5 shadow-md dark:border-gray-600", children: platforms.map((p) => {
|
|
11
|
-
const
|
|
11
|
+
const handleClick = () => {
|
|
12
12
|
onPlatformSelect(p.key);
|
|
13
13
|
};
|
|
14
14
|
return /* @__PURE__ */ jsx(
|
|
15
15
|
"button",
|
|
16
16
|
{
|
|
17
17
|
className: "rounded px-3 py-1.5 text-left text-sm text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",
|
|
18
|
-
onClick:
|
|
18
|
+
onClick: handleClick,
|
|
19
19
|
type: "button",
|
|
20
20
|
children: p.label
|
|
21
21
|
},
|
|
@@ -24,12 +24,12 @@ function ShareMenu({
|
|
|
24
24
|
}) });
|
|
25
25
|
}
|
|
26
26
|
function ActionButton({ action }) {
|
|
27
|
-
const
|
|
27
|
+
const handleClick = action.onClick;
|
|
28
28
|
return /* @__PURE__ */ jsx(
|
|
29
29
|
"button",
|
|
30
30
|
{
|
|
31
31
|
className: "rounded px-3 py-1.5 text-left text-sm transition-colors hover:bg-accent",
|
|
32
|
-
onClick:
|
|
32
|
+
onClick: handleClick,
|
|
33
33
|
type: "button",
|
|
34
34
|
children: action.label
|
|
35
35
|
}
|
|
@@ -69,7 +69,7 @@ function MainFabButton({
|
|
|
69
69
|
mainText,
|
|
70
70
|
onToggle
|
|
71
71
|
}) {
|
|
72
|
-
const
|
|
72
|
+
const handleClick = onToggle;
|
|
73
73
|
return /* @__PURE__ */ jsx(
|
|
74
74
|
"button",
|
|
75
75
|
{
|
|
@@ -81,7 +81,7 @@ function MainFabButton({
|
|
|
81
81
|
"transition-all duration-200 ease-out",
|
|
82
82
|
"hover:-translate-y-0.5 hover:border-gray-400 hover:shadow-md dark:hover:border-gray-500"
|
|
83
83
|
),
|
|
84
|
-
onClick:
|
|
84
|
+
onClick: handleClick,
|
|
85
85
|
type: "button",
|
|
86
86
|
children: /* @__PURE__ */ jsx("span", { className: "text-sm font-mono", children: isMobile && isExpanded ? "\u2715" : mainText })
|
|
87
87
|
}
|
|
@@ -113,7 +113,6 @@ function StatusBoardCard({ item }) {
|
|
|
113
113
|
}
|
|
114
114
|
const StatusBoard = React.forwardRef(
|
|
115
115
|
({
|
|
116
|
-
as: Heading = "h2",
|
|
117
116
|
className,
|
|
118
117
|
columns = 3,
|
|
119
118
|
description,
|
|
@@ -124,7 +123,7 @@ const StatusBoard = React.forwardRef(
|
|
|
124
123
|
return /* @__PURE__ */ jsxs("div", { className: cn("space-y-4", className), ref, ...props, children: [
|
|
125
124
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between", children: [
|
|
126
125
|
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
127
|
-
/* @__PURE__ */ jsx(
|
|
126
|
+
/* @__PURE__ */ jsx("h2", { className: "text-lg font-semibold tracking-tight", children: title }),
|
|
128
127
|
description ? /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: description }) : null
|
|
129
128
|
] }),
|
|
130
129
|
/* @__PURE__ */ jsx(StatusBoardSummary, { items })
|
|
@@ -93,7 +93,6 @@ function InteractiveStep({
|
|
|
93
93
|
] });
|
|
94
94
|
}
|
|
95
95
|
function StepByStep({
|
|
96
|
-
as: Heading = "h3",
|
|
97
96
|
children,
|
|
98
97
|
className,
|
|
99
98
|
interactive = false,
|
|
@@ -128,7 +127,7 @@ function StepByStep({
|
|
|
128
127
|
)
|
|
129
128
|
}
|
|
130
129
|
),
|
|
131
|
-
/* @__PURE__ */ jsx(
|
|
130
|
+
/* @__PURE__ */ jsx("h3", { className: "font-semibold text-lg", children: title })
|
|
132
131
|
] }) : null,
|
|
133
132
|
/* @__PURE__ */ jsx("div", { className: "space-y-0", children: steps.map((step, index) => {
|
|
134
133
|
const stepElement = step;
|
|
@@ -41,16 +41,13 @@ function useActiveSection(sections) {
|
|
|
41
41
|
}, [sections]);
|
|
42
42
|
return activeSection;
|
|
43
43
|
}
|
|
44
|
-
function TableOfContents({
|
|
45
|
-
as: Heading = "h3",
|
|
46
|
-
sections
|
|
47
|
-
}) {
|
|
44
|
+
function TableOfContents({ sections }) {
|
|
48
45
|
const activeSection = useActiveSection(sections);
|
|
49
46
|
if (sections.length === 0) {
|
|
50
47
|
return null;
|
|
51
48
|
}
|
|
52
49
|
return /* @__PURE__ */ jsx("aside", { className: "hidden xl:block", children: /* @__PURE__ */ jsx("div", { className: "sticky top-8", children: /* @__PURE__ */ jsxs("div", { className: "border-l-2 border-border pl-4", children: [
|
|
53
|
-
/* @__PURE__ */ jsx(
|
|
50
|
+
/* @__PURE__ */ jsx("h3", { className: "text-sm font-semibold mb-4 text-muted-foreground uppercase tracking-wider", children: "On This Page" }),
|
|
54
51
|
/* @__PURE__ */ jsx("nav", { className: "space-y-2", children: sections.map((section) => /* @__PURE__ */ jsx(
|
|
55
52
|
"button",
|
|
56
53
|
{
|
|
@@ -3,7 +3,6 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { memo, useEffect, useRef } from "react";
|
|
4
4
|
import { cn } from "../../lib/utils";
|
|
5
5
|
function TableOfContentsPanelImpl({
|
|
6
|
-
as: Heading = "h2",
|
|
7
6
|
className,
|
|
8
7
|
closeIcon,
|
|
9
8
|
completedSections,
|
|
@@ -56,7 +55,6 @@ function TableOfContentsPanelImpl({
|
|
|
56
55
|
{
|
|
57
56
|
"aria-hidden": "true",
|
|
58
57
|
className: "absolute inset-0 bg-black/50 backdrop-blur-sm",
|
|
59
|
-
"data-testid": "toc-backdrop",
|
|
60
58
|
onClick: onClose
|
|
61
59
|
}
|
|
62
60
|
),
|
|
@@ -70,7 +68,7 @@ function TableOfContentsPanelImpl({
|
|
|
70
68
|
ref: panelRef,
|
|
71
69
|
children: /* @__PURE__ */ jsxs("div", { className: "flex h-full flex-col", children: [
|
|
72
70
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between border-b border-border px-4 py-3", children: [
|
|
73
|
-
/* @__PURE__ */ jsx(
|
|
71
|
+
/* @__PURE__ */ jsx("h2", { className: "text-lg font-semibold", id: "toc-title", children: title }),
|
|
74
72
|
/* @__PURE__ */ jsx(
|
|
75
73
|
"button",
|
|
76
74
|
{
|
|
@@ -125,7 +125,7 @@ const TimelineScrubber = forwardRef((props, ref) => {
|
|
|
125
125
|
const span = safeEnd - start;
|
|
126
126
|
const clamped = clamp(value, start, safeEnd);
|
|
127
127
|
const ratio = clamp((clamped - start) / span, 0, 1);
|
|
128
|
-
const
|
|
128
|
+
const handleChange = (event) => {
|
|
129
129
|
onValueChange(clamp(Number(event.target.value), start, safeEnd));
|
|
130
130
|
};
|
|
131
131
|
return /* @__PURE__ */ jsxs(
|
|
@@ -158,7 +158,7 @@ const TimelineScrubber = forwardRef((props, ref) => {
|
|
|
158
158
|
inputId,
|
|
159
159
|
max: safeEnd,
|
|
160
160
|
min: start,
|
|
161
|
-
onChange:
|
|
161
|
+
onChange: handleChange,
|
|
162
162
|
ratio,
|
|
163
163
|
scrubberId: inputId,
|
|
164
164
|
span,
|
|
@@ -22,11 +22,9 @@ function TutorialCompleteImpl({
|
|
|
22
22
|
onRestart,
|
|
23
23
|
profile,
|
|
24
24
|
relatedContent,
|
|
25
|
-
sectionLabelAs: SectionHeading = "h3",
|
|
26
25
|
sections,
|
|
27
26
|
shareUrl,
|
|
28
|
-
title
|
|
29
|
-
titleAs: TitleHeading = "h2"
|
|
27
|
+
title
|
|
30
28
|
}) {
|
|
31
29
|
const isFullyComplete = completionPercent === 100;
|
|
32
30
|
return /* @__PURE__ */ jsxs("div", { children: [
|
|
@@ -43,7 +41,7 @@ function TutorialCompleteImpl({
|
|
|
43
41
|
)
|
|
44
42
|
}
|
|
45
43
|
),
|
|
46
|
-
/* @__PURE__ */ jsx(
|
|
44
|
+
/* @__PURE__ */ jsx("h2", { className: "text-3xl font-semibold mb-2", children: isFullyComplete ? labels.tutorialComplete : labels.tutorialFinished }),
|
|
47
45
|
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground mb-6", children: isFullyComplete ? `${labels.youveCompletedAll} "${title}"` : `${labels.youveFinishedWith} "${title}" (${completionPercent}%)` }),
|
|
48
46
|
/* @__PURE__ */ jsxs(Button, { className: "gap-2", onClick: onRestart, variant: "outline", children: [
|
|
49
47
|
/* @__PURE__ */ jsx(RotateCcw, { className: "size-4" }),
|
|
@@ -51,7 +49,7 @@ function TutorialCompleteImpl({
|
|
|
51
49
|
] })
|
|
52
50
|
] }),
|
|
53
51
|
/* @__PURE__ */ jsxs("div", { className: "max-w-2xl mx-auto mt-8", children: [
|
|
54
|
-
/* @__PURE__ */ jsx(
|
|
52
|
+
/* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold mb-4", children: labels.reviewSections }),
|
|
55
53
|
/* @__PURE__ */ jsx("div", { className: "space-y-2", children: sections.map((section, index) => {
|
|
56
54
|
const isCompleted = completedSections.has(section.id);
|
|
57
55
|
return /* @__PURE__ */ jsxs(
|
|
@@ -79,7 +77,7 @@ function TutorialCompleteImpl({
|
|
|
79
77
|
}) })
|
|
80
78
|
] }),
|
|
81
79
|
relatedContent.length > 0 ? /* @__PURE__ */ jsxs("div", { className: "max-w-2xl mx-auto mt-12", children: [
|
|
82
|
-
/* @__PURE__ */ jsx(
|
|
80
|
+
/* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold mb-4", children: labels.relatedContent }),
|
|
83
81
|
/* @__PURE__ */ jsx("div", { className: "space-y-2", children: relatedContent.map((item) => /* @__PURE__ */ jsxs(
|
|
84
82
|
LinkComponent,
|
|
85
83
|
{
|
|
@@ -74,7 +74,7 @@ function TagFilter({
|
|
|
74
74
|
}
|
|
75
75
|
) : null
|
|
76
76
|
] }),
|
|
77
|
-
/* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2",
|
|
77
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2", children: tags.map((tag) => {
|
|
78
78
|
const isActive = currentTags.includes(tag);
|
|
79
79
|
return /* @__PURE__ */ jsx(
|
|
80
80
|
Badge,
|
|
@@ -10,7 +10,7 @@ const DEFAULT_LABELS = {
|
|
|
10
10
|
};
|
|
11
11
|
const Row = (props) => {
|
|
12
12
|
const { active, bookmark, onSelect } = props;
|
|
13
|
-
const
|
|
13
|
+
const handleClick = () => {
|
|
14
14
|
onSelect?.(bookmark.id);
|
|
15
15
|
};
|
|
16
16
|
const rowClass = "flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs transition-colors";
|
|
@@ -27,7 +27,7 @@ const Row = (props) => {
|
|
|
27
27
|
),
|
|
28
28
|
"data-viewport-bookmark": bookmark.id,
|
|
29
29
|
"data-viewport-bookmark-active": active,
|
|
30
|
-
onClick:
|
|
30
|
+
onClick: handleClick,
|
|
31
31
|
type: "button",
|
|
32
32
|
children: /* @__PURE__ */ jsx(RowBody, { bookmark })
|
|
33
33
|
}
|
|
@@ -58,7 +58,6 @@ function WatchlistRow({ item }) {
|
|
|
58
58
|
}
|
|
59
59
|
const Watchlist = React.forwardRef(
|
|
60
60
|
({
|
|
61
|
-
as: Heading = "h2",
|
|
62
61
|
className,
|
|
63
62
|
eyebrow = "Tracked symbols",
|
|
64
63
|
items,
|
|
@@ -84,7 +83,7 @@ const Watchlist = React.forwardRef(
|
|
|
84
83
|
/* @__PURE__ */ jsxs("header", { className: "mb-3 flex flex-wrap items-start justify-between gap-3", children: [
|
|
85
84
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
86
85
|
/* @__PURE__ */ jsx("p", { className: "text-xs font-medium uppercase tracking-[0.28em] text-muted-foreground", children: eyebrow }),
|
|
87
|
-
/* @__PURE__ */ jsx(
|
|
86
|
+
/* @__PURE__ */ jsx("h2", { className: "text-lg font-semibold text-foreground", children: title })
|
|
88
87
|
] }),
|
|
89
88
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
|
|
90
89
|
/* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1 rounded-full border border-emerald-500/30 bg-emerald-500/10 px-2 py-1 text-emerald-600 dark:text-emerald-400", children: [
|
|
@@ -19,7 +19,7 @@ const DEFAULT_LABELS = {
|
|
|
19
19
|
const Crumb = (props) => {
|
|
20
20
|
const { crumb, isLast, onSelect } = props;
|
|
21
21
|
const glyph = crumb.kind ? KIND_GLYPH[crumb.kind] : null;
|
|
22
|
-
const
|
|
22
|
+
const handleClick = () => {
|
|
23
23
|
onSelect?.(crumb.id);
|
|
24
24
|
};
|
|
25
25
|
const text = /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1", children: [
|
|
@@ -47,7 +47,7 @@ const Crumb = (props) => {
|
|
|
47
47
|
className: "inline-flex items-center rounded-sm text-xs text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
48
48
|
"data-world-breadcrumb": crumb.id,
|
|
49
49
|
"data-world-breadcrumb-active": "false",
|
|
50
|
-
onClick:
|
|
50
|
+
onClick: handleClick,
|
|
51
51
|
type: "button",
|
|
52
52
|
children: text
|
|
53
53
|
}
|
|
@@ -83,7 +83,6 @@ function WorldClockCard({
|
|
|
83
83
|
}
|
|
84
84
|
const WorldClockBar = React.forwardRef(
|
|
85
85
|
({
|
|
86
|
-
as: Heading = "h2",
|
|
87
86
|
className,
|
|
88
87
|
now,
|
|
89
88
|
showDate = true,
|
|
@@ -96,7 +95,7 @@ const WorldClockBar = React.forwardRef(
|
|
|
96
95
|
return /* @__PURE__ */ jsxs("div", { className: cn("space-y-3", className), ref, ...props, children: [
|
|
97
96
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-3", children: [
|
|
98
97
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
99
|
-
/* @__PURE__ */ jsx(
|
|
98
|
+
/* @__PURE__ */ jsx("h2", { className: "text-lg font-semibold tracking-tight", children: title }),
|
|
100
99
|
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: "Synchronized time across distributed teams and regions." })
|
|
101
100
|
] }),
|
|
102
101
|
/* @__PURE__ */ jsxs(Badge, { variant: "outline", children: [
|