@vllnt/ui 0.2.1-canary.0aaaad2 → 0.2.1-canary.25c4600
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 +2 -0
- package/dist/components/activity-heatmap/activity-heatmap.js +2 -1
- 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 +3 -1
- package/dist/components/bottom-activity-strip/bottom-activity-strip.js +2 -2
- package/dist/components/candlestick-chart/candlestick-chart.js +2 -1
- package/dist/components/checklist/checklist.js +4 -1
- package/dist/components/chronological-timeline/chronological-timeline.js +2 -2
- package/dist/components/code-playground/code-playground.js +2 -1
- package/dist/components/comment-pin/comment-pin.js +2 -2
- package/dist/components/comparison/comparison.js +2 -1
- package/dist/components/completion-dialog/completion-dialog.js +4 -1
- package/dist/components/content-intro/content-intro.js +5 -3
- package/dist/components/exercise/exercise.js +10 -2
- package/dist/components/faq/faq.js +6 -2
- package/dist/components/floating-toolbar/floating-toolbar.js +2 -2
- package/dist/components/horizontal-scroll-row/horizontal-scroll-row.js +2 -1
- 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 +2 -1
- package/dist/components/keyboard-shortcuts-help/keyboard-shortcuts-help.js +2 -1
- package/dist/components/knowledge-check/knowledge-check.js +2 -2
- package/dist/components/learning-objectives/learning-objectives.js +2 -1
- package/dist/components/map-timeline/map-timeline.js +4 -4
- package/dist/components/market-treemap/market-treemap.js +2 -2
- package/dist/components/mdx-content/mdx-content.js +3 -3
- package/dist/components/navbar-saas/navbar-saas.js +1 -0
- 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 +2 -1
- package/dist/components/prompt-templates/prompt-templates.js +2 -2
- package/dist/components/quiz/quiz.js +3 -2
- 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 +2 -1
- package/dist/components/sidebar/sidebar.js +18 -17
- package/dist/components/slideshow/slideshow.js +2 -1
- package/dist/components/social-fab/social-fab.js +6 -6
- package/dist/components/status-board/status-board.js +2 -1
- package/dist/components/step-by-step/step-by-step.js +2 -1
- package/dist/components/table-of-contents/table-of-contents.js +5 -2
- package/dist/components/table-of-contents-panel/table-of-contents-panel.js +3 -1
- package/dist/components/timeline-scrubber/timeline-scrubber.js +2 -2
- package/dist/components/tutorial-complete/tutorial-complete.js +6 -4
- package/dist/components/tutorial-filters/tutorial-filters.js +1 -1
- package/dist/components/tutorial-intro-content/tutorial-intro-content.js +4 -4
- package/dist/components/tutorial-mdx/tutorial-mdx.js +4 -4
- package/dist/components/viewport-bookmarks/viewport-bookmarks.js +2 -2
- package/dist/components/watchlist/watchlist.js +2 -1
- package/dist/components/world-breadcrumbs/world-breadcrumbs.js +2 -2
- package/dist/components/world-clock-bar/world-clock-bar.js +2 -1
- package/dist/index.d.ts +95 -24
- package/package.json +2 -2
|
@@ -68,7 +68,7 @@ function BookSide({
|
|
|
68
68
|
] });
|
|
69
69
|
}
|
|
70
70
|
const OrderBook = React.forwardRef(
|
|
71
|
-
({ asks, bids, className, precision = 2, ...props }, reference) => {
|
|
71
|
+
({ as: Heading = "h2", asks, bids, className, precision = 2, ...props }, reference) => {
|
|
72
72
|
if (asks.length === 0 && bids.length === 0) {
|
|
73
73
|
return null;
|
|
74
74
|
}
|
|
@@ -90,7 +90,7 @@ const OrderBook = React.forwardRef(
|
|
|
90
90
|
/* @__PURE__ */ jsxs("div", { className: "mb-4 flex flex-wrap items-start justify-between gap-3", children: [
|
|
91
91
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
92
92
|
/* @__PURE__ */ jsx("p", { className: "text-xs font-medium uppercase tracking-[0.28em] text-muted-foreground", children: "Level II" }),
|
|
93
|
-
/* @__PURE__ */ jsx(
|
|
93
|
+
/* @__PURE__ */ jsx(Heading, { className: "text-lg font-semibold text-foreground", children: "Order book" })
|
|
94
94
|
] }),
|
|
95
95
|
/* @__PURE__ */ jsxs("div", { className: "rounded-full border border-border bg-background/70 px-3 py-1 text-sm text-muted-foreground tabular-nums", children: [
|
|
96
96
|
"Spread ",
|
|
@@ -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 handleTogglePolicy = () => {
|
|
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: handleTogglePolicy,
|
|
53
53
|
type: "button",
|
|
54
54
|
children: /* @__PURE__ */ jsx(RowBody, { policy })
|
|
55
55
|
}
|
|
@@ -3,6 +3,7 @@ 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",
|
|
6
7
|
compact = false,
|
|
7
8
|
dict,
|
|
8
9
|
imageAlt,
|
|
@@ -25,7 +26,7 @@ function ProfileSection({
|
|
|
25
26
|
}
|
|
26
27
|
) }) : null,
|
|
27
28
|
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
28
|
-
/* @__PURE__ */ jsx(
|
|
29
|
+
/* @__PURE__ */ jsx(Heading, { className: `font-semibold ${compact ? "text-lg" : "text-xl"}`, children: dict.profile.name }),
|
|
29
30
|
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: compact ? dict.profile.tagline : `> ${dict.profile.tagline}` })
|
|
30
31
|
] }),
|
|
31
32
|
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 handleVariableValueChange = 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: handleVariableValueChange,
|
|
259
259
|
placeholder: `Value for ${name}`,
|
|
260
260
|
value
|
|
261
261
|
}
|
|
@@ -118,6 +118,7 @@ function QuizResult({
|
|
|
118
118
|
);
|
|
119
119
|
}
|
|
120
120
|
function Quiz({
|
|
121
|
+
as: Heading = "h4",
|
|
121
122
|
className,
|
|
122
123
|
explanation,
|
|
123
124
|
hint,
|
|
@@ -159,7 +160,7 @@ function Quiz({
|
|
|
159
160
|
)
|
|
160
161
|
}
|
|
161
162
|
),
|
|
162
|
-
/* @__PURE__ */ jsx(
|
|
163
|
+
/* @__PURE__ */ jsx(Heading, { className: "font-semibold text-foreground", children: question })
|
|
163
164
|
] }),
|
|
164
165
|
/* @__PURE__ */ jsx("div", { className: "space-y-2 mb-4", children: options.map((opt, index) => /* @__PURE__ */ jsx(
|
|
165
166
|
QuizOptionButton,
|
|
@@ -172,7 +173,7 @@ function Quiz({
|
|
|
172
173
|
selectedIndex,
|
|
173
174
|
submitted
|
|
174
175
|
},
|
|
175
|
-
|
|
176
|
+
`quiz-option-${index}-${opt.label}`
|
|
176
177
|
)) }),
|
|
177
178
|
hint && !submitted ? /* @__PURE__ */ jsx(
|
|
178
179
|
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 handleActivateRelationship = () => {
|
|
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: handleActivateRelationship,
|
|
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 handleActivateAssignment = () => {
|
|
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: handleActivateAssignment,
|
|
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 handleActivatePhase = () => {
|
|
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: handleActivatePhase,
|
|
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 handleSelectPlatform = () => {
|
|
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: handleSelectPlatform,
|
|
30
30
|
type: "button",
|
|
31
31
|
children: platform.label
|
|
32
32
|
}
|
|
@@ -26,6 +26,7 @@ function buildShareUrl(platform, url, title) {
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
function ShareSection({
|
|
29
|
+
as: Heading = "h3",
|
|
29
30
|
buildUrl: buildUrlFunction = buildShareUrl,
|
|
30
31
|
platforms = defaultPlatforms,
|
|
31
32
|
shareOn,
|
|
@@ -34,7 +35,7 @@ function ShareSection({
|
|
|
34
35
|
url
|
|
35
36
|
}) {
|
|
36
37
|
return /* @__PURE__ */ jsxs("div", { className: "border-t border-border pt-6 mt-8", children: [
|
|
37
|
-
/* @__PURE__ */ jsx(
|
|
38
|
+
/* @__PURE__ */ jsx(Heading, { className: "text-lg font-semibold mb-4", children: shareTitle }),
|
|
38
39
|
/* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-3", children: platforms.map((platform) => /* @__PURE__ */ jsxs(
|
|
39
40
|
"a",
|
|
40
41
|
{
|
|
@@ -1,29 +1,28 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useEffect, useRef, useState } from "react";
|
|
3
|
+
import { useEffect, useRef, useState, useSyncExternalStore } 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
|
+
};
|
|
9
17
|
function useMobile(setOpen) {
|
|
10
|
-
const
|
|
18
|
+
const isMobile = useSyncExternalStore(
|
|
19
|
+
subscribeToViewportResize,
|
|
20
|
+
getMobileSnapshot,
|
|
21
|
+
getServerMobileSnapshot
|
|
22
|
+
);
|
|
11
23
|
useEffect(() => {
|
|
12
|
-
|
|
13
|
-
|
|
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]);
|
|
24
|
+
setOpen(!isMobile);
|
|
25
|
+
}, [isMobile, setOpen]);
|
|
27
26
|
return isMobile;
|
|
28
27
|
}
|
|
29
28
|
function useScrollFade(containerReference) {
|
|
@@ -88,6 +87,7 @@ function CollapsibleSection({
|
|
|
88
87
|
"grid transition-all duration-200 ease-in-out",
|
|
89
88
|
isOpen ? "grid-rows-[1fr] opacity-100" : "grid-rows-[0fr] opacity-0"
|
|
90
89
|
),
|
|
90
|
+
hidden: !isOpen,
|
|
91
91
|
children: /* @__PURE__ */ jsx("div", { className: "overflow-hidden", children })
|
|
92
92
|
}
|
|
93
93
|
)
|
|
@@ -106,6 +106,7 @@ 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",
|
|
109
110
|
onClick: () => {
|
|
110
111
|
setOpen(false);
|
|
111
112
|
},
|
|
@@ -17,6 +17,7 @@ const DEFAULT_LABELS = {
|
|
|
17
17
|
};
|
|
18
18
|
const EMPTY_SLIDESHOW_LABELS = {};
|
|
19
19
|
function SlideshowImpl({
|
|
20
|
+
as: SectionsHeading = "h3",
|
|
20
21
|
completedSections,
|
|
21
22
|
completionDialogTitle = "Mark section as complete?",
|
|
22
23
|
currentIndex,
|
|
@@ -249,7 +250,7 @@ function SlideshowImpl({
|
|
|
249
250
|
role: "dialog",
|
|
250
251
|
children: [
|
|
251
252
|
/* @__PURE__ */ jsxs("div", { className: "sticky top-0 flex items-center justify-between px-4 py-3 border-b border-border bg-background", children: [
|
|
252
|
-
/* @__PURE__ */ jsx(
|
|
253
|
+
/* @__PURE__ */ jsx(SectionsHeading, { className: "font-semibold", children: mergedLabels.sectionsLabel }),
|
|
253
254
|
/* @__PURE__ */ jsx(
|
|
254
255
|
"button",
|
|
255
256
|
{
|
|
@@ -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 handleSelectSharePlatform = () => {
|
|
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: handleSelectSharePlatform,
|
|
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 handleRunAction = 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: handleRunAction,
|
|
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 handleToggleSharePanel = 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: handleToggleSharePanel,
|
|
85
85
|
type: "button",
|
|
86
86
|
children: /* @__PURE__ */ jsx("span", { className: "text-sm font-mono", children: isMobile && isExpanded ? "\u2715" : mainText })
|
|
87
87
|
}
|
|
@@ -113,6 +113,7 @@ function StatusBoardCard({ item }) {
|
|
|
113
113
|
}
|
|
114
114
|
const StatusBoard = React.forwardRef(
|
|
115
115
|
({
|
|
116
|
+
as: Heading = "h2",
|
|
116
117
|
className,
|
|
117
118
|
columns = 3,
|
|
118
119
|
description,
|
|
@@ -123,7 +124,7 @@ const StatusBoard = React.forwardRef(
|
|
|
123
124
|
return /* @__PURE__ */ jsxs("div", { className: cn("space-y-4", className), ref, ...props, children: [
|
|
124
125
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between", children: [
|
|
125
126
|
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
126
|
-
/* @__PURE__ */ jsx(
|
|
127
|
+
/* @__PURE__ */ jsx(Heading, { className: "text-lg font-semibold tracking-tight", children: title }),
|
|
127
128
|
description ? /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: description }) : null
|
|
128
129
|
] }),
|
|
129
130
|
/* @__PURE__ */ jsx(StatusBoardSummary, { items })
|
|
@@ -93,6 +93,7 @@ function InteractiveStep({
|
|
|
93
93
|
] });
|
|
94
94
|
}
|
|
95
95
|
function StepByStep({
|
|
96
|
+
as: Heading = "h3",
|
|
96
97
|
children,
|
|
97
98
|
className,
|
|
98
99
|
interactive = false,
|
|
@@ -127,7 +128,7 @@ function StepByStep({
|
|
|
127
128
|
)
|
|
128
129
|
}
|
|
129
130
|
),
|
|
130
|
-
/* @__PURE__ */ jsx(
|
|
131
|
+
/* @__PURE__ */ jsx(Heading, { className: "font-semibold text-lg", children: title })
|
|
131
132
|
] }) : null,
|
|
132
133
|
/* @__PURE__ */ jsx("div", { className: "space-y-0", children: steps.map((step, index) => {
|
|
133
134
|
const stepElement = step;
|
|
@@ -41,13 +41,16 @@ function useActiveSection(sections) {
|
|
|
41
41
|
}, [sections]);
|
|
42
42
|
return activeSection;
|
|
43
43
|
}
|
|
44
|
-
function TableOfContents({
|
|
44
|
+
function TableOfContents({
|
|
45
|
+
as: Heading = "h3",
|
|
46
|
+
sections
|
|
47
|
+
}) {
|
|
45
48
|
const activeSection = useActiveSection(sections);
|
|
46
49
|
if (sections.length === 0) {
|
|
47
50
|
return null;
|
|
48
51
|
}
|
|
49
52
|
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: [
|
|
50
|
-
/* @__PURE__ */ jsx(
|
|
53
|
+
/* @__PURE__ */ jsx(Heading, { className: "text-sm font-semibold mb-4 text-muted-foreground uppercase tracking-wider", children: "On This Page" }),
|
|
51
54
|
/* @__PURE__ */ jsx("nav", { className: "space-y-2", children: sections.map((section) => /* @__PURE__ */ jsx(
|
|
52
55
|
"button",
|
|
53
56
|
{
|
|
@@ -3,6 +3,7 @@ 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",
|
|
6
7
|
className,
|
|
7
8
|
closeIcon,
|
|
8
9
|
completedSections,
|
|
@@ -55,6 +56,7 @@ function TableOfContentsPanelImpl({
|
|
|
55
56
|
{
|
|
56
57
|
"aria-hidden": "true",
|
|
57
58
|
className: "absolute inset-0 bg-black/50 backdrop-blur-sm",
|
|
59
|
+
"data-testid": "toc-backdrop",
|
|
58
60
|
onClick: onClose
|
|
59
61
|
}
|
|
60
62
|
),
|
|
@@ -68,7 +70,7 @@ function TableOfContentsPanelImpl({
|
|
|
68
70
|
ref: panelRef,
|
|
69
71
|
children: /* @__PURE__ */ jsxs("div", { className: "flex h-full flex-col", children: [
|
|
70
72
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between border-b border-border px-4 py-3", children: [
|
|
71
|
-
/* @__PURE__ */ jsx(
|
|
73
|
+
/* @__PURE__ */ jsx(Heading, { className: "text-lg font-semibold", id: "toc-title", children: title }),
|
|
72
74
|
/* @__PURE__ */ jsx(
|
|
73
75
|
"button",
|
|
74
76
|
{
|
|
@@ -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 handleScrubberValueChange = (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: handleScrubberValueChange,
|
|
162
162
|
ratio,
|
|
163
163
|
scrubberId: inputId,
|
|
164
164
|
span,
|
|
@@ -22,9 +22,11 @@ function TutorialCompleteImpl({
|
|
|
22
22
|
onRestart,
|
|
23
23
|
profile,
|
|
24
24
|
relatedContent,
|
|
25
|
+
sectionLabelAs: SectionHeading = "h3",
|
|
25
26
|
sections,
|
|
26
27
|
shareUrl,
|
|
27
|
-
title
|
|
28
|
+
title,
|
|
29
|
+
titleAs: TitleHeading = "h2"
|
|
28
30
|
}) {
|
|
29
31
|
const isFullyComplete = completionPercent === 100;
|
|
30
32
|
return /* @__PURE__ */ jsxs("div", { children: [
|
|
@@ -41,7 +43,7 @@ function TutorialCompleteImpl({
|
|
|
41
43
|
)
|
|
42
44
|
}
|
|
43
45
|
),
|
|
44
|
-
/* @__PURE__ */ jsx(
|
|
46
|
+
/* @__PURE__ */ jsx(TitleHeading, { className: "text-3xl font-semibold mb-2", children: isFullyComplete ? labels.tutorialComplete : labels.tutorialFinished }),
|
|
45
47
|
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground mb-6", children: isFullyComplete ? `${labels.youveCompletedAll} "${title}"` : `${labels.youveFinishedWith} "${title}" (${completionPercent}%)` }),
|
|
46
48
|
/* @__PURE__ */ jsxs(Button, { className: "gap-2", onClick: onRestart, variant: "outline", children: [
|
|
47
49
|
/* @__PURE__ */ jsx(RotateCcw, { className: "size-4" }),
|
|
@@ -49,7 +51,7 @@ function TutorialCompleteImpl({
|
|
|
49
51
|
] })
|
|
50
52
|
] }),
|
|
51
53
|
/* @__PURE__ */ jsxs("div", { className: "max-w-2xl mx-auto mt-8", children: [
|
|
52
|
-
/* @__PURE__ */ jsx(
|
|
54
|
+
/* @__PURE__ */ jsx(SectionHeading, { className: "text-lg font-semibold mb-4", children: labels.reviewSections }),
|
|
53
55
|
/* @__PURE__ */ jsx("div", { className: "space-y-2", children: sections.map((section, index) => {
|
|
54
56
|
const isCompleted = completedSections.has(section.id);
|
|
55
57
|
return /* @__PURE__ */ jsxs(
|
|
@@ -77,7 +79,7 @@ function TutorialCompleteImpl({
|
|
|
77
79
|
}) })
|
|
78
80
|
] }),
|
|
79
81
|
relatedContent.length > 0 ? /* @__PURE__ */ jsxs("div", { className: "max-w-2xl mx-auto mt-12", children: [
|
|
80
|
-
/* @__PURE__ */ jsx(
|
|
82
|
+
/* @__PURE__ */ jsx(SectionHeading, { className: "text-lg font-semibold mb-4", children: labels.relatedContent }),
|
|
81
83
|
/* @__PURE__ */ jsx("div", { className: "space-y-2", children: relatedContent.map((item) => /* @__PURE__ */ jsxs(
|
|
82
84
|
LinkComponent,
|
|
83
85
|
{
|
|
@@ -74,7 +74,7 @@ function TagFilter({
|
|
|
74
74
|
}
|
|
75
75
|
) : null
|
|
76
76
|
] }),
|
|
77
|
-
/* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2", children: tags.map((tag) => {
|
|
77
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2", "data-testid": "tag-filter-list", children: tags.map((tag) => {
|
|
78
78
|
const isActive = currentTags.includes(tag);
|
|
79
79
|
return /* @__PURE__ */ jsx(
|
|
80
80
|
Badge,
|
|
@@ -47,15 +47,15 @@ const serverMarkdownComponents = {
|
|
|
47
47
|
h1: ({
|
|
48
48
|
children,
|
|
49
49
|
...props
|
|
50
|
-
}) => /* @__PURE__ */ jsx("h1", { className: "text-2xl font-
|
|
50
|
+
}) => /* @__PURE__ */ jsx("h1", { className: "text-2xl font-semibold mt-8 mb-4", ...props, children }),
|
|
51
51
|
h2: ({
|
|
52
52
|
children,
|
|
53
53
|
...props
|
|
54
|
-
}) => /* @__PURE__ */ jsx("h2", { className: "text-xl font-
|
|
54
|
+
}) => /* @__PURE__ */ jsx("h2", { className: "text-xl font-semibold mt-6 mb-3", ...props, children }),
|
|
55
55
|
h3: ({
|
|
56
56
|
children,
|
|
57
57
|
...props
|
|
58
|
-
}) => /* @__PURE__ */ jsx("h3", { className: "text-lg font-
|
|
58
|
+
}) => /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold mt-4 mb-2", ...props, children }),
|
|
59
59
|
hr: (props) => /* @__PURE__ */ jsx("hr", { className: "my-8 border-border", ...props }),
|
|
60
60
|
li: ({
|
|
61
61
|
children,
|
|
@@ -132,7 +132,7 @@ function TutorialIntroContent({
|
|
|
132
132
|
}) {
|
|
133
133
|
const markdownContent = stripMDXComponents(content);
|
|
134
134
|
return /* @__PURE__ */ jsxs("section", { className: cn("py-6", className), children: [
|
|
135
|
-
/* @__PURE__ */ jsx("h2", { className: "text-2xl md:text-3xl font-
|
|
135
|
+
/* @__PURE__ */ jsx("h2", { className: "text-2xl md:text-3xl font-semibold mb-6", children: title }),
|
|
136
136
|
/* @__PURE__ */ jsx("div", { className: "max-w-none [&_h2:first-of-type]:hidden", children: /* @__PURE__ */ jsx(ReactMarkdown, { components: serverMarkdownComponents, children: markdownContent }) })
|
|
137
137
|
] });
|
|
138
138
|
}
|
|
@@ -114,10 +114,10 @@ const markdownComponents = {
|
|
|
114
114
|
}
|
|
115
115
|
);
|
|
116
116
|
},
|
|
117
|
-
h1: ({ children, ...props }) => /* @__PURE__ */ jsx("h1", { className: "text-2xl font-
|
|
118
|
-
h2: ({ children, ...props }) => /* @__PURE__ */ jsx("h2", { className: "text-xl font-
|
|
119
|
-
h3: ({ children, ...props }) => /* @__PURE__ */ jsx("h3", { className: "text-lg font-
|
|
120
|
-
h4: ({ children, ...props }) => /* @__PURE__ */ jsx("h4", { className: "text-base font-
|
|
117
|
+
h1: ({ children, ...props }) => /* @__PURE__ */ jsx("h1", { className: "text-2xl font-semibold mt-8 mb-4", ...props, children }),
|
|
118
|
+
h2: ({ children, ...props }) => /* @__PURE__ */ jsx("h2", { className: "text-xl font-semibold mt-6 mb-3", ...props, children }),
|
|
119
|
+
h3: ({ children, ...props }) => /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold mt-4 mb-2", ...props, children }),
|
|
120
|
+
h4: ({ children, ...props }) => /* @__PURE__ */ jsx("h4", { className: "text-base font-semibold mt-3 mb-2", ...props, children }),
|
|
121
121
|
hr: ({ ...props }) => /* @__PURE__ */ jsx("hr", { className: "my-8 border-border", ...props }),
|
|
122
122
|
li: ({ children, ...props }) => /* @__PURE__ */ jsx(
|
|
123
123
|
"li",
|
|
@@ -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 handleSelectBookmark = () => {
|
|
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: handleSelectBookmark,
|
|
31
31
|
type: "button",
|
|
32
32
|
children: /* @__PURE__ */ jsx(RowBody, { bookmark })
|
|
33
33
|
}
|
|
@@ -58,6 +58,7 @@ function WatchlistRow({ item }) {
|
|
|
58
58
|
}
|
|
59
59
|
const Watchlist = React.forwardRef(
|
|
60
60
|
({
|
|
61
|
+
as: Heading = "h2",
|
|
61
62
|
className,
|
|
62
63
|
eyebrow = "Tracked symbols",
|
|
63
64
|
items,
|
|
@@ -83,7 +84,7 @@ const Watchlist = React.forwardRef(
|
|
|
83
84
|
/* @__PURE__ */ jsxs("header", { className: "mb-3 flex flex-wrap items-start justify-between gap-3", children: [
|
|
84
85
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
85
86
|
/* @__PURE__ */ jsx("p", { className: "text-xs font-medium uppercase tracking-[0.28em] text-muted-foreground", children: eyebrow }),
|
|
86
|
-
/* @__PURE__ */ jsx(
|
|
87
|
+
/* @__PURE__ */ jsx(Heading, { className: "text-lg font-semibold text-foreground", children: title })
|
|
87
88
|
] }),
|
|
88
89
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
|
|
89
90
|
/* @__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 handleSelectCrumb = () => {
|
|
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: handleSelectCrumb,
|
|
51
51
|
type: "button",
|
|
52
52
|
children: text
|
|
53
53
|
}
|
|
@@ -83,6 +83,7 @@ function WorldClockCard({
|
|
|
83
83
|
}
|
|
84
84
|
const WorldClockBar = React.forwardRef(
|
|
85
85
|
({
|
|
86
|
+
as: Heading = "h2",
|
|
86
87
|
className,
|
|
87
88
|
now,
|
|
88
89
|
showDate = true,
|
|
@@ -95,7 +96,7 @@ const WorldClockBar = React.forwardRef(
|
|
|
95
96
|
return /* @__PURE__ */ jsxs("div", { className: cn("space-y-3", className), ref, ...props, children: [
|
|
96
97
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-3", children: [
|
|
97
98
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
98
|
-
/* @__PURE__ */ jsx(
|
|
99
|
+
/* @__PURE__ */ jsx(Heading, { className: "text-lg font-semibold tracking-tight", children: title }),
|
|
99
100
|
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: "Synchronized time across distributed teams and regions." })
|
|
100
101
|
] }),
|
|
101
102
|
/* @__PURE__ */ jsxs(Badge, { variant: "outline", children: [
|