@vllnt/ui 0.2.0 → 0.2.1-canary.0aaaad2
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 +46 -1
- package/README.md +27 -12
- package/dist/components/accordion/accordion.js +2 -2
- package/dist/components/activity-heatmap/activity-heatmap.js +15 -13
- package/dist/components/activity-log/activity-log.js +6 -5
- package/dist/components/agent-activity/agent-activity.js +311 -0
- package/dist/components/agent-activity/index.js +18 -0
- package/dist/components/ai-artifact/ai-artifact.js +422 -0
- package/dist/components/ai-artifact/index.js +24 -0
- package/dist/components/ai-chat-input/ai-chat-input.js +2 -2
- package/dist/components/ai-message-bubble/ai-message-bubble.js +1 -1
- package/dist/components/ai-sidebar/ai-sidebar.js +254 -0
- package/dist/components/ai-sidebar/index.js +22 -0
- package/dist/components/ai-source-citation/ai-source-citation.js +2 -2
- package/dist/components/ai-tool-call-display/ai-tool-call-display.js +4 -4
- package/dist/components/alert-pulse/alert-pulse.js +93 -0
- package/dist/components/alert-pulse/index.js +6 -0
- package/dist/components/anchor-port/anchor-port.js +51 -0
- package/dist/components/anchor-port/index.js +4 -0
- package/dist/components/animated-text/animated-text.js +2 -4
- package/dist/components/auto-reload/auto-reload.js +377 -0
- package/dist/components/auto-reload/index.js +6 -0
- package/dist/components/avatar/avatar.js +1 -1
- package/dist/components/avatar-group/avatar-group.js +4 -4
- package/dist/components/banner/banner.js +155 -0
- package/dist/components/banner/index.js +10 -0
- package/dist/components/bottom-activity-strip/bottom-activity-strip.js +91 -0
- package/dist/components/bottom-activity-strip/index.js +6 -0
- package/dist/components/bottom-bar/bottom-bar.js +25 -0
- package/dist/components/bottom-bar/index.js +4 -0
- package/dist/components/breadcrumb/breadcrumb.js +33 -26
- package/dist/components/button/button.js +1 -1
- package/dist/components/calendar/calendar.js +6 -6
- package/dist/components/callout/callout.js +1 -1
- package/dist/components/candlestick-chart/candlestick-chart.js +1 -1
- package/dist/components/canvas-shell/canvas-foundation-demo.js +183 -0
- package/dist/components/canvas-shell/canvas-shell-route-config.js +0 -0
- package/dist/components/canvas-shell/canvas-shell.js +261 -0
- package/dist/components/canvas-shell/index.js +4 -0
- package/dist/components/canvas-view/canvas-view.js +461 -0
- package/dist/components/canvas-view/index.js +6 -0
- package/dist/components/carousel/carousel.js +4 -4
- package/dist/components/chart/area-chart.js +1 -0
- package/dist/components/chart/line-chart.js +1 -0
- package/dist/components/chat-dock-section/chat-dock-section.js +56 -0
- package/dist/components/chat-dock-section/index.js +6 -0
- package/dist/components/checkbox/checkbox.js +2 -2
- package/dist/components/checklist/checklist.js +10 -3
- package/dist/components/checklist/index.js +3 -1
- package/dist/components/choropleth-map/choropleth-map.js +373 -0
- package/dist/components/choropleth-map/index.js +10 -0
- package/dist/components/chronological-timeline/chronological-timeline.js +338 -0
- package/dist/components/chronological-timeline/index.js +8 -0
- package/dist/components/civilization-card/civilization-card.js +258 -0
- package/dist/components/civilization-card/index.js +8 -0
- package/dist/components/code-block/code-block.js +2 -2
- package/dist/components/code-playground/code-playground.js +8 -7
- package/dist/components/combobox/combobox.js +46 -22
- package/dist/components/command/command.js +1 -1
- package/dist/components/comment-pin/comment-pin.js +104 -0
- package/dist/components/comment-pin/index.js +6 -0
- package/dist/components/comparison/comparison.js +9 -9
- package/dist/components/completion-dialog/completion-dialog.js +1 -1
- package/dist/components/connector-edge/connector-edge.js +66 -0
- package/dist/components/connector-edge/index.js +6 -0
- package/dist/components/content-intro/content-intro.js +7 -6
- package/dist/components/context-lens/context-lens.js +98 -0
- package/dist/components/context-lens/index.js +6 -0
- package/dist/components/context-menu/context-menu.js +4 -4
- package/dist/components/conversation-thread/conversation-thread.js +348 -0
- package/dist/components/conversation-thread/index.js +20 -0
- package/dist/components/cookie-consent/cookie-consent.js +1 -1
- package/dist/components/copy-button/copy-button.js +189 -0
- package/dist/components/copy-button/index.js +8 -0
- package/dist/components/countdown-timer/countdown-timer.js +8 -7
- package/dist/components/credit-badge/credit-badge.js +1 -7
- package/dist/components/curriculum/curriculum.js +349 -0
- package/dist/components/curriculum/index.js +10 -0
- package/dist/components/data-list/data-list.js +2 -1
- package/dist/components/data-table/data-table.js +5 -4
- package/dist/components/date-picker/date-picker.js +1 -1
- package/dist/components/dialog/dialog.js +1 -1
- package/dist/components/document-sibling-nav/document-sibling-nav.js +111 -0
- package/dist/components/document-sibling-nav/index.js +8 -0
- package/dist/components/dropdown-menu/dropdown-menu.js +3 -3
- package/dist/components/edge-label/edge-label.js +26 -0
- package/dist/components/edge-label/index.js +4 -0
- package/dist/components/empty-state/empty-state.js +93 -0
- package/dist/components/empty-state/index.js +8 -0
- package/dist/components/era-comparison/era-comparison.js +198 -0
- package/dist/components/era-comparison/index.js +16 -0
- package/dist/components/exercise/exercise.js +4 -4
- package/dist/components/faq/faq.js +2 -2
- package/dist/components/file-upload/file-upload.js +3 -3
- package/dist/components/filter-bar/filter-bar.js +2 -1
- package/dist/components/flashcard/flashcard.js +1 -1
- package/dist/components/floating-action-button/floating-action-button.js +1 -1
- package/dist/components/floating-toolbar/floating-toolbar.js +66 -0
- package/dist/components/floating-toolbar/index.js +6 -0
- package/dist/components/flow-diagram/flow-controls.js +9 -9
- package/dist/components/flow-diagram/flow-error-boundary.js +2 -2
- package/dist/components/flow-diagram/flow-fullscreen.js +2 -2
- package/dist/components/follow-mode/follow-mode.js +89 -0
- package/dist/components/follow-mode/index.js +6 -0
- package/dist/components/form/form.js +432 -0
- package/dist/components/form/index.js +20 -0
- package/dist/components/gantt-chart/gantt-chart.js +333 -0
- package/dist/components/gantt-chart/index.js +6 -0
- package/dist/components/geography-quiz-map/geography-quiz-map.js +343 -0
- package/dist/components/geography-quiz-map/index.js +12 -0
- package/dist/components/glass-panel/glass-panel.js +21 -0
- package/dist/components/glass-panel/index.js +4 -0
- package/dist/components/globe-3d/globe-3d.js +417 -0
- package/dist/components/globe-3d/index.js +10 -0
- package/dist/components/group-hull/group-hull.js +29 -0
- package/dist/components/group-hull/index.js +4 -0
- package/dist/components/handoff-beacon/handoff-beacon.js +78 -0
- package/dist/components/handoff-beacon/index.js +6 -0
- package/dist/components/heat-map-overlay/heat-map-overlay.js +215 -0
- package/dist/components/heat-map-overlay/index.js +6 -0
- package/dist/components/heat-overlay/heat-overlay.js +92 -0
- package/dist/components/heat-overlay/index.js +6 -0
- package/dist/components/historic-timeline/historic-timeline.js +342 -0
- package/dist/components/historic-timeline/index.js +6 -0
- package/dist/components/historical-figure-card/historical-figure-card.js +270 -0
- package/dist/components/historical-figure-card/index.js +6 -0
- package/dist/components/horizontal-scroll-row/horizontal-scroll-row.js +4 -4
- package/dist/components/index.js +568 -1
- package/dist/components/infinite-plane/index.js +6 -0
- package/dist/components/infinite-plane/infinite-plane.js +75 -0
- package/dist/components/input-otp/input-otp.js +1 -1
- package/dist/components/interactive-timeline/index.js +16 -0
- package/dist/components/interactive-timeline/interactive-timeline.js +708 -0
- package/dist/components/jarvis-dock/index.js +6 -0
- package/dist/components/jarvis-dock/jarvis-dock.js +98 -0
- package/dist/components/kbd/index.js +5 -0
- package/dist/components/kbd/kbd.js +117 -0
- package/dist/components/key-concept/key-concept.js +4 -4
- package/dist/components/keyboard-shortcuts-help/keyboard-shortcuts-help.js +2 -2
- package/dist/components/knowledge-check/index.js +6 -0
- package/dist/components/knowledge-check/knowledge-check.js +448 -0
- package/dist/components/learning-objectives/learning-objectives.js +12 -12
- package/dist/components/left-rail/index.js +4 -0
- package/dist/components/left-rail/left-rail.js +25 -0
- package/dist/components/live-cursor/index.js +6 -0
- package/dist/components/live-cursor/live-cursor.js +62 -0
- package/dist/components/live-feed/live-feed.js +15 -13
- package/dist/components/map-2d/index.js +20 -0
- package/dist/components/map-2d/map-2d.js +455 -0
- package/dist/components/map-timeline/index.js +16 -0
- package/dist/components/map-timeline/map-timeline.js +506 -0
- package/dist/components/market-treemap/market-treemap.js +1 -1
- package/dist/components/mdx-content/mdx-content.js +2 -1
- package/dist/components/menubar/menubar.js +4 -4
- package/dist/components/metric-cluster/index.js +6 -0
- package/dist/components/metric-cluster/metric-cluster.js +96 -0
- package/dist/components/metric-gauge/metric-gauge.js +1 -1
- package/dist/components/mini-map-panel/index.js +6 -0
- package/dist/components/mini-map-panel/mini-map-panel.js +74 -0
- package/dist/components/model-comparison/index.js +12 -0
- package/dist/components/model-comparison/model-comparison.js +211 -0
- package/dist/components/model-selector/model-selector.js +2 -2
- package/dist/components/multi-select/index.js +6 -0
- package/dist/components/multi-select/multi-select.js +258 -0
- package/dist/components/multi-select-lasso/index.js +6 -0
- package/dist/components/multi-select-lasso/multi-select-lasso.js +76 -0
- package/dist/components/navbar-saas/navbar-saas.js +3 -2
- package/dist/components/navigation-menu/navigation-menu.js +2 -2
- package/dist/components/newsletter-signup/index.js +8 -0
- package/dist/components/newsletter-signup/newsletter-signup.js +269 -0
- package/dist/components/number-input/number-input.js +1 -1
- package/dist/components/number-ticker/number-ticker.js +11 -4
- package/dist/components/object-card/index.js +6 -0
- package/dist/components/object-card/object-card.js +126 -0
- package/dist/components/object-handle/index.js +4 -0
- package/dist/components/object-handle/object-handle.js +38 -0
- package/dist/components/object-inspector/index.js +6 -0
- package/dist/components/object-inspector/object-inspector.js +136 -0
- package/dist/components/overview-board/index.js +8 -0
- package/dist/components/overview-board/overview-board.js +127 -0
- package/dist/components/parallel-timeline/index.js +6 -0
- package/dist/components/parallel-timeline/parallel-timeline.js +251 -0
- package/dist/components/password-input/password-input.js +1 -1
- package/dist/components/plan-badge/plan-badge.js +1 -7
- package/dist/components/playback-ghost/index.js +6 -0
- package/dist/components/playback-ghost/playback-ghost.js +83 -0
- package/dist/components/policy-delivery-panel/index.js +6 -0
- package/dist/components/policy-delivery-panel/policy-delivery-panel.js +99 -0
- package/dist/components/presence-stack/index.js +6 -0
- package/dist/components/presence-stack/presence-stack.js +108 -0
- package/dist/components/presence-sync-indicator/index.js +6 -0
- package/dist/components/presence-sync-indicator/presence-sync-indicator.js +73 -0
- package/dist/components/pricing-table/index.js +8 -0
- package/dist/components/pricing-table/pricing-table.js +247 -0
- package/dist/components/primary-source-viewer/index.js +26 -0
- package/dist/components/primary-source-viewer/primary-source-viewer.js +439 -0
- package/dist/components/pro-tip/pro-tip.js +6 -6
- package/dist/components/profile-section/profile-section.js +1 -1
- package/dist/components/progress-card/progress-card.js +4 -3
- package/dist/components/progress-tracker/index.js +20 -0
- package/dist/components/progress-tracker/progress-tracker.js +529 -0
- package/dist/components/prompt-templates/index.js +6 -0
- package/dist/components/prompt-templates/prompt-templates.js +403 -0
- package/dist/components/property-section/index.js +6 -0
- package/dist/components/property-section/property-section.js +101 -0
- package/dist/components/quiz/quiz.js +5 -5
- package/dist/components/radio-group/radio-group.js +2 -2
- package/dist/components/rating/rating.js +3 -3
- package/dist/components/relationship-inspector/index.js +6 -0
- package/dist/components/relationship-inspector/relationship-inspector.js +102 -0
- package/dist/components/resizable/resizable.js +1 -1
- package/dist/components/right-dock/index.js +4 -0
- package/dist/components/right-dock/right-dock.js +28 -0
- package/dist/components/route-map/index.js +6 -0
- package/dist/components/route-map/route-map.js +339 -0
- package/dist/components/routing-assignment-panel/index.js +6 -0
- package/dist/components/routing-assignment-panel/routing-assignment-panel.js +122 -0
- package/dist/components/run-timeline/index.js +6 -0
- package/dist/components/run-timeline/run-timeline.js +221 -0
- package/dist/components/runtime-overview-panel/index.js +6 -0
- package/dist/components/runtime-overview-panel/runtime-overview-panel.js +89 -0
- package/dist/components/scope-selector/scope-selector.js +7 -7
- package/dist/components/search-bar/search-bar.js +24 -2
- package/dist/components/search-dialog/search-dialog.js +1 -1
- package/dist/components/segmented-control/index.js +12 -0
- package/dist/components/segmented-control/segmented-control.js +61 -0
- package/dist/components/select/select.js +5 -5
- package/dist/components/selection-halo/index.js +6 -0
- package/dist/components/selection-halo/selection-halo.js +72 -0
- package/dist/components/selection-presence/index.js +6 -0
- package/dist/components/selection-presence/selection-presence.js +50 -0
- package/dist/components/severity-badge/severity-badge.js +2 -2
- package/dist/components/sheet/sheet.js +1 -1
- package/dist/components/sidebar/sidebar.js +1 -1
- package/dist/components/sidebar-toggle/sidebar-toggle.js +2 -2
- package/dist/components/slider/slider.js +1 -1
- package/dist/components/slideshow/slideshow.js +12 -11
- package/dist/components/snap-guides/index.js +6 -0
- package/dist/components/snap-guides/snap-guides.js +45 -0
- package/dist/components/social-fab/social-fab.js +2 -1
- package/dist/components/sparkline-grid/sparkline-grid.js +1 -1
- package/dist/components/spinner/spinner.js +3 -3
- package/dist/components/spinner/unicode-spinner.js +1 -0
- package/dist/components/stat-card/stat-card.js +3 -3
- package/dist/components/state-badge-overlay/index.js +6 -0
- package/dist/components/state-badge-overlay/state-badge-overlay.js +90 -0
- package/dist/components/status-board/status-board.js +1 -1
- package/dist/components/status-indicator/status-indicator.js +3 -3
- package/dist/components/step-by-step/step-by-step.js +8 -7
- package/dist/components/step-navigation/step-navigation.js +2 -2
- package/dist/components/stepper/stepper.js +3 -3
- package/dist/components/sticky-metric/index.js +6 -0
- package/dist/components/sticky-metric/sticky-metric.js +83 -0
- package/dist/components/story-map/index.js +8 -0
- package/dist/components/story-map/story-map.js +414 -0
- package/dist/components/subscription-card/subscription-card.js +1 -1
- package/dist/components/switch/switch.js +1 -1
- package/dist/components/table-of-contents-panel/table-of-contents-panel.js +5 -5
- package/dist/components/tags-input/index.js +4 -0
- package/dist/components/tags-input/tags-input.js +178 -0
- package/dist/components/terminal/terminal.js +48 -34
- package/dist/components/thinking-block/thinking-block.js +1 -1
- package/dist/components/thread-bubble/index.js +6 -0
- package/dist/components/thread-bubble/thread-bubble.js +85 -0
- package/dist/components/threshold-ring/index.js +6 -0
- package/dist/components/threshold-ring/threshold-ring.js +160 -0
- package/dist/components/ticker-tape/ticker-tape.js +3 -3
- package/dist/components/timeline/index.js +12 -0
- package/dist/components/timeline/timeline.js +239 -0
- package/dist/components/timeline-scrubber/index.js +6 -0
- package/dist/components/timeline-scrubber/timeline-scrubber.js +179 -0
- package/dist/components/tldr-section/tldr-section.js +2 -2
- package/dist/components/top-bar/index.js +4 -0
- package/dist/components/top-bar/top-bar.js +31 -0
- package/dist/components/tour/tour.js +1 -1
- package/dist/components/transaction-list/index.js +14 -0
- package/dist/components/transaction-list/transaction-list.js +247 -0
- package/dist/components/tree-view/index.js +6 -0
- package/dist/components/tree-view/tree-view.js +298 -0
- package/dist/components/tutorial-complete/tutorial-complete.js +8 -8
- package/dist/components/usage-breakdown/usage-breakdown.js +10 -5
- package/dist/components/video-embed/video-embed.js +2 -2
- package/dist/components/viewport-bookmarks/index.js +6 -0
- package/dist/components/viewport-bookmarks/viewport-bookmarks.js +116 -0
- package/dist/components/wallet-card/wallet-card.js +1 -1
- package/dist/components/watchlist/watchlist.js +5 -5
- package/dist/components/workspace-switcher/index.js +6 -0
- package/dist/components/workspace-switcher/workspace-switcher.js +61 -0
- package/dist/components/world-breadcrumbs/index.js +6 -0
- package/dist/components/world-breadcrumbs/world-breadcrumbs.js +114 -0
- package/dist/components/world-clock-bar/world-clock-bar.js +32 -12
- package/dist/components/zoom-hud/index.js +4 -0
- package/dist/components/zoom-hud/zoom-hud.js +61 -0
- package/dist/index.d.ts +7907 -226
- package/dist/index.js +3 -1
- package/package.json +9 -5
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import {
|
|
4
|
+
createContext,
|
|
5
|
+
forwardRef,
|
|
6
|
+
useCallback,
|
|
7
|
+
useContext,
|
|
8
|
+
useEffect,
|
|
9
|
+
useId,
|
|
10
|
+
useMemo,
|
|
11
|
+
useRef,
|
|
12
|
+
useState
|
|
13
|
+
} from "react";
|
|
14
|
+
import { cn } from "../../lib/utils";
|
|
15
|
+
const ChronoContext = createContext(null);
|
|
16
|
+
function useChronoContext() {
|
|
17
|
+
const ctx = useContext(ChronoContext);
|
|
18
|
+
if (!ctx) {
|
|
19
|
+
throw new Error("ChronoEvent used outside ChronologicalTimeline.");
|
|
20
|
+
}
|
|
21
|
+
return ctx;
|
|
22
|
+
}
|
|
23
|
+
function ImageMedia({ media }) {
|
|
24
|
+
return /* @__PURE__ */ jsxs("figure", { className: "overflow-hidden rounded-xl border bg-muted", children: [
|
|
25
|
+
/* @__PURE__ */ jsx(
|
|
26
|
+
"img",
|
|
27
|
+
{
|
|
28
|
+
alt: media.alt,
|
|
29
|
+
className: "aspect-video w-full object-cover",
|
|
30
|
+
loading: "lazy",
|
|
31
|
+
src: media.src
|
|
32
|
+
}
|
|
33
|
+
),
|
|
34
|
+
media.caption || media.credit ? /* @__PURE__ */ jsxs("figcaption", { className: "border-t bg-background px-3 py-2 text-xs text-muted-foreground", children: [
|
|
35
|
+
media.caption ? /* @__PURE__ */ jsx("span", { className: "block", children: media.caption }) : null,
|
|
36
|
+
media.credit ? /* @__PURE__ */ jsx("span", { className: "block italic", children: media.credit }) : null
|
|
37
|
+
] }) : null
|
|
38
|
+
] });
|
|
39
|
+
}
|
|
40
|
+
function VideoMedia({ media }) {
|
|
41
|
+
const iframeTitle = media.title || "Embedded timeline video";
|
|
42
|
+
return /* @__PURE__ */ jsxs("figure", { className: "overflow-hidden rounded-xl border bg-muted", children: [
|
|
43
|
+
/* @__PURE__ */ jsx("div", { className: "aspect-video w-full", children: /* @__PURE__ */ jsx(
|
|
44
|
+
"iframe",
|
|
45
|
+
{
|
|
46
|
+
allow: "accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture",
|
|
47
|
+
allowFullScreen: true,
|
|
48
|
+
className: "h-full w-full",
|
|
49
|
+
src: media.src,
|
|
50
|
+
title: iframeTitle
|
|
51
|
+
}
|
|
52
|
+
) }),
|
|
53
|
+
media.caption || media.credit ? /* @__PURE__ */ jsxs("figcaption", { className: "border-t bg-background px-3 py-2 text-xs text-muted-foreground", children: [
|
|
54
|
+
media.caption ? /* @__PURE__ */ jsx("span", { className: "block", children: media.caption }) : null,
|
|
55
|
+
media.credit ? /* @__PURE__ */ jsx("span", { className: "block italic", children: media.credit }) : null
|
|
56
|
+
] }) : null
|
|
57
|
+
] });
|
|
58
|
+
}
|
|
59
|
+
function AudioMedia({ media }) {
|
|
60
|
+
return /* @__PURE__ */ jsxs("figure", { className: "overflow-hidden rounded-xl border bg-muted p-3", children: [
|
|
61
|
+
/* @__PURE__ */ jsx(
|
|
62
|
+
"audio",
|
|
63
|
+
{
|
|
64
|
+
"aria-label": media.alt,
|
|
65
|
+
className: "w-full",
|
|
66
|
+
controls: true,
|
|
67
|
+
preload: "metadata",
|
|
68
|
+
src: media.src,
|
|
69
|
+
children: /* @__PURE__ */ jsx("track", { kind: "captions" })
|
|
70
|
+
}
|
|
71
|
+
),
|
|
72
|
+
media.caption || media.credit ? /* @__PURE__ */ jsxs("figcaption", { className: "pt-2 text-xs text-muted-foreground", children: [
|
|
73
|
+
media.caption ? /* @__PURE__ */ jsx("span", { className: "block", children: media.caption }) : null,
|
|
74
|
+
media.credit ? /* @__PURE__ */ jsx("span", { className: "block italic", children: media.credit }) : null
|
|
75
|
+
] }) : null
|
|
76
|
+
] });
|
|
77
|
+
}
|
|
78
|
+
function Media({ media }) {
|
|
79
|
+
if (media.type === "image") return /* @__PURE__ */ jsx(ImageMedia, { media });
|
|
80
|
+
if (media.type === "video") return /* @__PURE__ */ jsx(VideoMedia, { media });
|
|
81
|
+
return /* @__PURE__ */ jsx(AudioMedia, { media });
|
|
82
|
+
}
|
|
83
|
+
function DateColumn({ date }) {
|
|
84
|
+
return /* @__PURE__ */ jsx("div", { className: "hidden items-start justify-end pr-4 text-right text-xs font-semibold uppercase tracking-wide text-muted-foreground md:flex md:group-[[data-side='right']]:order-3 md:group-[[data-side='right']]:justify-start md:group-[[data-side='right']]:pl-4 md:group-[[data-side='right']]:text-left", children: /* @__PURE__ */ jsx("time", { className: "pt-2", children: date }) });
|
|
85
|
+
}
|
|
86
|
+
function RailColumn({ featured }) {
|
|
87
|
+
return /* @__PURE__ */ jsxs(
|
|
88
|
+
"div",
|
|
89
|
+
{
|
|
90
|
+
"aria-hidden": "true",
|
|
91
|
+
className: "relative hidden md:flex md:w-6 md:items-start md:justify-center",
|
|
92
|
+
children: [
|
|
93
|
+
/* @__PURE__ */ jsx("span", { className: "absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-border" }),
|
|
94
|
+
/* @__PURE__ */ jsx(
|
|
95
|
+
"span",
|
|
96
|
+
{
|
|
97
|
+
className: cn(
|
|
98
|
+
"relative z-10 mt-3 block size-3 rounded-full border-2 border-background bg-primary",
|
|
99
|
+
featured ? "size-4" : ""
|
|
100
|
+
)
|
|
101
|
+
}
|
|
102
|
+
)
|
|
103
|
+
]
|
|
104
|
+
}
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
function EventCard({
|
|
108
|
+
children,
|
|
109
|
+
date,
|
|
110
|
+
eventId,
|
|
111
|
+
featured,
|
|
112
|
+
media,
|
|
113
|
+
subtitle,
|
|
114
|
+
title
|
|
115
|
+
}) {
|
|
116
|
+
return /* @__PURE__ */ jsxs(
|
|
117
|
+
"div",
|
|
118
|
+
{
|
|
119
|
+
className: cn(
|
|
120
|
+
"rounded-2xl border bg-background p-5 shadow-sm md:group-[[data-side='right']]:order-1",
|
|
121
|
+
featured ? "ring-1 ring-primary/30" : ""
|
|
122
|
+
),
|
|
123
|
+
children: [
|
|
124
|
+
/* @__PURE__ */ jsxs("header", { className: "mb-3 flex flex-col gap-1", children: [
|
|
125
|
+
/* @__PURE__ */ jsx("time", { className: "text-xs font-semibold uppercase tracking-wide text-muted-foreground md:hidden", children: date }),
|
|
126
|
+
/* @__PURE__ */ jsx(
|
|
127
|
+
"h3",
|
|
128
|
+
{
|
|
129
|
+
className: cn(
|
|
130
|
+
"font-semibold text-foreground",
|
|
131
|
+
featured ? "text-xl" : "text-lg"
|
|
132
|
+
),
|
|
133
|
+
id: `${eventId}-title`,
|
|
134
|
+
children: title
|
|
135
|
+
}
|
|
136
|
+
),
|
|
137
|
+
subtitle ? /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: subtitle }) : null
|
|
138
|
+
] }),
|
|
139
|
+
media ? /* @__PURE__ */ jsx("div", { className: "mb-3", children: /* @__PURE__ */ jsx(Media, { media }) }) : null,
|
|
140
|
+
children ? /* @__PURE__ */ jsx("div", { className: "space-y-2 text-sm leading-relaxed text-foreground [&_blockquote]:my-3 [&_blockquote]:border-l-2 [&_blockquote]:border-primary [&_blockquote]:pl-3 [&_blockquote]:italic [&_blockquote]:text-muted-foreground", children }) : null
|
|
141
|
+
]
|
|
142
|
+
}
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
const ChronoEvent = forwardRef(
|
|
146
|
+
(props, forwardedRef) => {
|
|
147
|
+
const {
|
|
148
|
+
children,
|
|
149
|
+
className,
|
|
150
|
+
date,
|
|
151
|
+
featured = false,
|
|
152
|
+
id,
|
|
153
|
+
media,
|
|
154
|
+
subtitle,
|
|
155
|
+
title,
|
|
156
|
+
...rest
|
|
157
|
+
} = props;
|
|
158
|
+
const generatedId = useId();
|
|
159
|
+
const eventId = id ?? generatedId;
|
|
160
|
+
const ref = useRef(null);
|
|
161
|
+
const { registerEvent, setActiveId } = useChronoContext();
|
|
162
|
+
const refCallback = useCallback(
|
|
163
|
+
(node) => {
|
|
164
|
+
ref.current = node;
|
|
165
|
+
registerEvent(eventId, node);
|
|
166
|
+
if (typeof forwardedRef === "function") forwardedRef(node);
|
|
167
|
+
else if (forwardedRef) forwardedRef.current = node;
|
|
168
|
+
},
|
|
169
|
+
[eventId, forwardedRef, registerEvent]
|
|
170
|
+
);
|
|
171
|
+
const handleFocus = useCallback(() => {
|
|
172
|
+
setActiveId(eventId);
|
|
173
|
+
}, [eventId, setActiveId]);
|
|
174
|
+
return /* @__PURE__ */ jsxs(
|
|
175
|
+
"article",
|
|
176
|
+
{
|
|
177
|
+
"aria-labelledby": `${eventId}-title`,
|
|
178
|
+
className: cn(
|
|
179
|
+
"group relative grid gap-4 py-6 md:grid-cols-[1fr_auto_1fr] md:gap-8",
|
|
180
|
+
className
|
|
181
|
+
),
|
|
182
|
+
"data-event-id": eventId,
|
|
183
|
+
"data-featured": featured ? "true" : void 0,
|
|
184
|
+
id: eventId,
|
|
185
|
+
onFocus: handleFocus,
|
|
186
|
+
ref: refCallback,
|
|
187
|
+
...rest,
|
|
188
|
+
children: [
|
|
189
|
+
/* @__PURE__ */ jsx(DateColumn, { date }),
|
|
190
|
+
/* @__PURE__ */ jsx(RailColumn, { featured }),
|
|
191
|
+
/* @__PURE__ */ jsx(
|
|
192
|
+
EventCard,
|
|
193
|
+
{
|
|
194
|
+
date,
|
|
195
|
+
eventId,
|
|
196
|
+
featured,
|
|
197
|
+
media,
|
|
198
|
+
subtitle,
|
|
199
|
+
title,
|
|
200
|
+
children
|
|
201
|
+
}
|
|
202
|
+
)
|
|
203
|
+
]
|
|
204
|
+
}
|
|
205
|
+
);
|
|
206
|
+
}
|
|
207
|
+
);
|
|
208
|
+
ChronoEvent.displayName = "ChronoEvent";
|
|
209
|
+
function ProgressStrip({
|
|
210
|
+
activeId,
|
|
211
|
+
ids,
|
|
212
|
+
label
|
|
213
|
+
}) {
|
|
214
|
+
if (ids.length === 0) return null;
|
|
215
|
+
const activeIndex = activeId ? ids.indexOf(activeId) : -1;
|
|
216
|
+
const ratio = activeIndex < 0 ? 0 : (activeIndex + 1) / ids.length;
|
|
217
|
+
return /* @__PURE__ */ jsx(
|
|
218
|
+
"div",
|
|
219
|
+
{
|
|
220
|
+
"aria-label": label,
|
|
221
|
+
"aria-valuemax": 100,
|
|
222
|
+
"aria-valuemin": 0,
|
|
223
|
+
"aria-valuenow": Math.round(ratio * 100),
|
|
224
|
+
className: "sticky top-0 z-10 h-1 w-full bg-border",
|
|
225
|
+
role: "progressbar",
|
|
226
|
+
children: /* @__PURE__ */ jsx(
|
|
227
|
+
"span",
|
|
228
|
+
{
|
|
229
|
+
className: "block h-full bg-primary transition-[width] duration-200",
|
|
230
|
+
style: { width: `${(ratio * 100).toString()}%` }
|
|
231
|
+
}
|
|
232
|
+
)
|
|
233
|
+
}
|
|
234
|
+
);
|
|
235
|
+
}
|
|
236
|
+
function useChronoActiveTracker() {
|
|
237
|
+
const eventsRef = useRef(/* @__PURE__ */ new Map());
|
|
238
|
+
const [ids, setIds] = useState([]);
|
|
239
|
+
const [activeId, setActiveId] = useState();
|
|
240
|
+
const registerEvent = useCallback((id, node) => {
|
|
241
|
+
const map = eventsRef.current;
|
|
242
|
+
if (node) map.set(id, node);
|
|
243
|
+
else map.delete(id);
|
|
244
|
+
setIds([...map.keys()]);
|
|
245
|
+
}, []);
|
|
246
|
+
useEffect(() => {
|
|
247
|
+
if (typeof IntersectionObserver === "undefined") return;
|
|
248
|
+
const observer = new IntersectionObserver(
|
|
249
|
+
(entries) => {
|
|
250
|
+
const visible = entries.filter((entry) => entry.isIntersecting).sort((a, b) => a.boundingClientRect.top - b.boundingClientRect.top);
|
|
251
|
+
const first = visible[0];
|
|
252
|
+
if (first) {
|
|
253
|
+
const target = first.target;
|
|
254
|
+
if (target instanceof HTMLElement) {
|
|
255
|
+
const eventId = target.dataset.eventId;
|
|
256
|
+
if (eventId) setActiveId(eventId);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
{ rootMargin: "-30% 0px -50% 0px", threshold: 0.1 }
|
|
261
|
+
);
|
|
262
|
+
[...eventsRef.current.values()].forEach((node) => {
|
|
263
|
+
observer.observe(node);
|
|
264
|
+
});
|
|
265
|
+
return () => {
|
|
266
|
+
observer.disconnect();
|
|
267
|
+
};
|
|
268
|
+
}, [ids]);
|
|
269
|
+
return { activeId, ids, registerEvent, setActiveId };
|
|
270
|
+
}
|
|
271
|
+
function EventList({ activeId, children }) {
|
|
272
|
+
if (!Array.isArray(children)) {
|
|
273
|
+
return /* @__PURE__ */ jsx("ol", { className: "relative flex flex-col px-4 pb-6 md:px-6", children });
|
|
274
|
+
}
|
|
275
|
+
return /* @__PURE__ */ jsx("ol", { className: "relative flex flex-col px-4 pb-6 md:px-6", children: children.map((child, index) => /* @__PURE__ */ jsx(
|
|
276
|
+
"li",
|
|
277
|
+
{
|
|
278
|
+
className: "block list-none",
|
|
279
|
+
"data-active": isReactElementWithEventId(child, activeId) ? "true" : void 0,
|
|
280
|
+
"data-side": index % 2 === 0 ? "left" : "right",
|
|
281
|
+
children: child
|
|
282
|
+
},
|
|
283
|
+
getChildKey(child, index)
|
|
284
|
+
)) });
|
|
285
|
+
}
|
|
286
|
+
const ChronologicalTimeline = forwardRef((props, ref) => {
|
|
287
|
+
const {
|
|
288
|
+
children,
|
|
289
|
+
className,
|
|
290
|
+
progressLabel = "Timeline progress",
|
|
291
|
+
title,
|
|
292
|
+
...rest
|
|
293
|
+
} = props;
|
|
294
|
+
const titleId = useId();
|
|
295
|
+
const { activeId, ids, registerEvent, setActiveId } = useChronoActiveTracker();
|
|
296
|
+
const ctx = useMemo(
|
|
297
|
+
() => ({ registerEvent, setActiveId, titleId }),
|
|
298
|
+
[registerEvent, setActiveId, titleId]
|
|
299
|
+
);
|
|
300
|
+
return /* @__PURE__ */ jsx(ChronoContext.Provider, { value: ctx, children: /* @__PURE__ */ jsxs(
|
|
301
|
+
"section",
|
|
302
|
+
{
|
|
303
|
+
"aria-labelledby": title ? titleId : void 0,
|
|
304
|
+
className: cn(
|
|
305
|
+
"relative mx-auto flex w-full max-w-4xl flex-col overflow-hidden rounded-2xl border bg-background text-foreground",
|
|
306
|
+
className
|
|
307
|
+
),
|
|
308
|
+
ref,
|
|
309
|
+
...rest,
|
|
310
|
+
children: [
|
|
311
|
+
/* @__PURE__ */ jsx(ProgressStrip, { activeId, ids, label: progressLabel }),
|
|
312
|
+
title ? /* @__PURE__ */ jsx("header", { className: "p-6", children: /* @__PURE__ */ jsx("h2", { className: "text-2xl font-semibold tracking-tight", id: titleId, children: title }) }) : null,
|
|
313
|
+
/* @__PURE__ */ jsx(EventList, { activeId, children })
|
|
314
|
+
]
|
|
315
|
+
}
|
|
316
|
+
) });
|
|
317
|
+
});
|
|
318
|
+
ChronologicalTimeline.displayName = "ChronologicalTimeline";
|
|
319
|
+
function isReactElementWithEventId(child, activeId) {
|
|
320
|
+
if (!activeId) return false;
|
|
321
|
+
if (typeof child !== "object" || child === null) return false;
|
|
322
|
+
if (!("props" in child)) return false;
|
|
323
|
+
const props = child.props;
|
|
324
|
+
if (typeof props !== "object" || props === null) return false;
|
|
325
|
+
const id = props.id;
|
|
326
|
+
return typeof id === "string" && id === activeId;
|
|
327
|
+
}
|
|
328
|
+
function getChildKey(child, fallback) {
|
|
329
|
+
if (typeof child !== "object" || child === null) return fallback;
|
|
330
|
+
if (!("key" in child)) return fallback;
|
|
331
|
+
const key = child.key;
|
|
332
|
+
if (typeof key === "string" || typeof key === "number") return key;
|
|
333
|
+
return fallback;
|
|
334
|
+
}
|
|
335
|
+
export {
|
|
336
|
+
ChronoEvent,
|
|
337
|
+
ChronologicalTimeline
|
|
338
|
+
};
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import {
|
|
3
|
+
forwardRef
|
|
4
|
+
} from "react";
|
|
5
|
+
import { Globe } from "lucide-react";
|
|
6
|
+
import { cn } from "../../lib/utils";
|
|
7
|
+
import { Badge } from "../badge/badge";
|
|
8
|
+
const CIVILIZATION_COLOR_VARIANTS = {
|
|
9
|
+
amber: {
|
|
10
|
+
gradient: "from-amber-500/20 to-amber-700/40",
|
|
11
|
+
ring: "ring-amber-500/30"
|
|
12
|
+
},
|
|
13
|
+
blue: {
|
|
14
|
+
gradient: "from-blue-500/20 to-blue-700/40",
|
|
15
|
+
ring: "ring-blue-500/30"
|
|
16
|
+
},
|
|
17
|
+
emerald: {
|
|
18
|
+
gradient: "from-emerald-500/20 to-emerald-700/40",
|
|
19
|
+
ring: "ring-emerald-500/30"
|
|
20
|
+
},
|
|
21
|
+
neutral: {
|
|
22
|
+
gradient: "from-muted to-muted-foreground/10",
|
|
23
|
+
ring: "ring-border"
|
|
24
|
+
},
|
|
25
|
+
purple: {
|
|
26
|
+
gradient: "from-purple-500/20 to-purple-700/40",
|
|
27
|
+
ring: "ring-purple-500/30"
|
|
28
|
+
},
|
|
29
|
+
red: {
|
|
30
|
+
gradient: "from-red-500/20 to-red-700/40",
|
|
31
|
+
ring: "ring-red-500/30"
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
const DEFAULT_LABELS = {
|
|
35
|
+
achievements: "Achievements",
|
|
36
|
+
capital: "Capital",
|
|
37
|
+
duration: "Duration",
|
|
38
|
+
leaders: "Notable leaders",
|
|
39
|
+
peakPopulation: "Peak population",
|
|
40
|
+
timeline: "Era timeline"
|
|
41
|
+
};
|
|
42
|
+
function formatEraYear(year) {
|
|
43
|
+
if (year < 0) return `${Math.abs(year).toString()} BCE`;
|
|
44
|
+
return `${year.toString()} CE`;
|
|
45
|
+
}
|
|
46
|
+
function formatEra(era) {
|
|
47
|
+
const start = formatEraYear(era.start);
|
|
48
|
+
if (era.end === void 0) return `${start} \u2013 present`;
|
|
49
|
+
return `${start} \u2013 ${formatEraYear(era.end)}`;
|
|
50
|
+
}
|
|
51
|
+
function getDuration(era) {
|
|
52
|
+
if (!era) return void 0;
|
|
53
|
+
const end = era.end ?? (/* @__PURE__ */ new Date()).getFullYear();
|
|
54
|
+
const years = end - era.start;
|
|
55
|
+
if (years <= 0) return void 0;
|
|
56
|
+
return `${years.toString()} years`;
|
|
57
|
+
}
|
|
58
|
+
function CivilizationHero({ color, image, imageAlt }) {
|
|
59
|
+
const palette = CIVILIZATION_COLOR_VARIANTS[color];
|
|
60
|
+
return /* @__PURE__ */ jsx(
|
|
61
|
+
"div",
|
|
62
|
+
{
|
|
63
|
+
className: cn(
|
|
64
|
+
"relative h-32 w-full overflow-hidden rounded-t-2xl bg-gradient-to-br",
|
|
65
|
+
palette.gradient
|
|
66
|
+
),
|
|
67
|
+
children: image ? /* @__PURE__ */ jsx(
|
|
68
|
+
"img",
|
|
69
|
+
{
|
|
70
|
+
alt: imageAlt ?? "",
|
|
71
|
+
className: "h-full w-full object-cover mix-blend-multiply",
|
|
72
|
+
src: image
|
|
73
|
+
}
|
|
74
|
+
) : /* @__PURE__ */ jsx("div", { className: "flex h-full w-full items-center justify-center text-muted-foreground/50", children: /* @__PURE__ */ jsx(Globe, { "aria-hidden": "true", className: "size-12" }) })
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
function EraTimeline({ era, label }) {
|
|
79
|
+
const eraLabel = formatEra(era);
|
|
80
|
+
return /* @__PURE__ */ jsxs(
|
|
81
|
+
"div",
|
|
82
|
+
{
|
|
83
|
+
"aria-label": `${label}: ${eraLabel}`,
|
|
84
|
+
className: "flex flex-col gap-1",
|
|
85
|
+
role: "img",
|
|
86
|
+
children: [
|
|
87
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs font-medium uppercase tracking-wide text-muted-foreground", children: eraLabel }),
|
|
88
|
+
/* @__PURE__ */ jsx("div", { className: "h-1.5 w-full rounded-full bg-muted", children: /* @__PURE__ */ jsx("span", { className: "block h-full w-2/3 rounded-full bg-primary" }) })
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
function CivilizationStats({
|
|
94
|
+
capital,
|
|
95
|
+
capitalCaption,
|
|
96
|
+
durationCaption,
|
|
97
|
+
durationValue,
|
|
98
|
+
peakCaption,
|
|
99
|
+
peakPopulation
|
|
100
|
+
}) {
|
|
101
|
+
const items = [];
|
|
102
|
+
if (capital) items.push({ caption: capitalCaption, value: capital });
|
|
103
|
+
if (peakPopulation) {
|
|
104
|
+
items.push({ caption: peakCaption, value: peakPopulation });
|
|
105
|
+
}
|
|
106
|
+
if (durationValue) {
|
|
107
|
+
items.push({ caption: durationCaption, value: durationValue });
|
|
108
|
+
}
|
|
109
|
+
if (items.length === 0) return null;
|
|
110
|
+
return /* @__PURE__ */ jsx("dl", { className: "grid grid-cols-2 gap-x-3 gap-y-2 text-sm", children: items.map((item) => /* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
|
|
111
|
+
/* @__PURE__ */ jsx("dt", { className: "text-xs font-medium uppercase tracking-wide text-muted-foreground", children: item.caption }),
|
|
112
|
+
/* @__PURE__ */ jsx("dd", { className: "font-medium text-foreground", children: item.value })
|
|
113
|
+
] }, item.caption)) });
|
|
114
|
+
}
|
|
115
|
+
function CivilizationListBlock({
|
|
116
|
+
heading,
|
|
117
|
+
items,
|
|
118
|
+
variant
|
|
119
|
+
}) {
|
|
120
|
+
if (items.length === 0) return null;
|
|
121
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
122
|
+
/* @__PURE__ */ jsx("h4", { className: "text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: heading }),
|
|
123
|
+
variant === "badge" ? /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1.5", children: items.map((item, index) => /* @__PURE__ */ jsx(Badge, { variant: "secondary", children: item }, `${heading}-${index.toString()}`)) }) : /* @__PURE__ */ jsx("ul", { className: "flex flex-col gap-1 text-sm text-foreground", children: items.map((item, index) => /* @__PURE__ */ jsx(
|
|
124
|
+
"li",
|
|
125
|
+
{
|
|
126
|
+
className: "leading-tight",
|
|
127
|
+
children: item
|
|
128
|
+
},
|
|
129
|
+
`${heading}-${index.toString()}`
|
|
130
|
+
)) })
|
|
131
|
+
] });
|
|
132
|
+
}
|
|
133
|
+
function CivilizationBody({
|
|
134
|
+
achievements,
|
|
135
|
+
actionHref,
|
|
136
|
+
capital,
|
|
137
|
+
era,
|
|
138
|
+
labels,
|
|
139
|
+
leaders,
|
|
140
|
+
name,
|
|
141
|
+
peakPopulation,
|
|
142
|
+
region
|
|
143
|
+
}) {
|
|
144
|
+
const durationValue = getDuration(era);
|
|
145
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4 p-5", children: [
|
|
146
|
+
/* @__PURE__ */ jsxs("header", { className: "flex flex-col gap-1", children: [
|
|
147
|
+
/* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold leading-tight tracking-tight", children: name }),
|
|
148
|
+
region ? /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: region }) : null
|
|
149
|
+
] }),
|
|
150
|
+
era ? /* @__PURE__ */ jsx(EraTimeline, { era, label: labels.timeline }) : null,
|
|
151
|
+
/* @__PURE__ */ jsx(
|
|
152
|
+
CivilizationStats,
|
|
153
|
+
{
|
|
154
|
+
capital,
|
|
155
|
+
capitalCaption: labels.capital,
|
|
156
|
+
durationCaption: labels.duration,
|
|
157
|
+
durationValue,
|
|
158
|
+
peakCaption: labels.peakPopulation,
|
|
159
|
+
peakPopulation
|
|
160
|
+
}
|
|
161
|
+
),
|
|
162
|
+
achievements && achievements.length > 0 ? /* @__PURE__ */ jsx(
|
|
163
|
+
CivilizationListBlock,
|
|
164
|
+
{
|
|
165
|
+
heading: labels.achievements,
|
|
166
|
+
items: achievements,
|
|
167
|
+
variant: "badge"
|
|
168
|
+
}
|
|
169
|
+
) : null,
|
|
170
|
+
leaders && leaders.length > 0 ? /* @__PURE__ */ jsx(
|
|
171
|
+
CivilizationListBlock,
|
|
172
|
+
{
|
|
173
|
+
heading: labels.leaders,
|
|
174
|
+
items: leaders,
|
|
175
|
+
variant: "list"
|
|
176
|
+
}
|
|
177
|
+
) : null,
|
|
178
|
+
actionHref ? /* @__PURE__ */ jsx(
|
|
179
|
+
"a",
|
|
180
|
+
{
|
|
181
|
+
className: "text-sm font-medium text-primary underline-offset-4 hover:underline",
|
|
182
|
+
href: actionHref,
|
|
183
|
+
children: "Explore \u2192"
|
|
184
|
+
}
|
|
185
|
+
) : null
|
|
186
|
+
] });
|
|
187
|
+
}
|
|
188
|
+
const CivilizationCard = forwardRef(
|
|
189
|
+
(props, ref) => {
|
|
190
|
+
const {
|
|
191
|
+
achievements,
|
|
192
|
+
actionHref,
|
|
193
|
+
capital,
|
|
194
|
+
className,
|
|
195
|
+
color = "neutral",
|
|
196
|
+
era,
|
|
197
|
+
image,
|
|
198
|
+
labels,
|
|
199
|
+
leaders,
|
|
200
|
+
name,
|
|
201
|
+
peakPopulation,
|
|
202
|
+
region,
|
|
203
|
+
...rest
|
|
204
|
+
} = props;
|
|
205
|
+
const resolvedLabels = { ...DEFAULT_LABELS, ...labels };
|
|
206
|
+
const palette = CIVILIZATION_COLOR_VARIANTS[color];
|
|
207
|
+
const altName = typeof name === "string" ? name : void 0;
|
|
208
|
+
return /* @__PURE__ */ jsxs(
|
|
209
|
+
"article",
|
|
210
|
+
{
|
|
211
|
+
className: cn(
|
|
212
|
+
"flex flex-col overflow-hidden rounded-2xl border bg-background text-foreground shadow-sm ring-1",
|
|
213
|
+
palette.ring,
|
|
214
|
+
className
|
|
215
|
+
),
|
|
216
|
+
ref,
|
|
217
|
+
...rest,
|
|
218
|
+
children: [
|
|
219
|
+
/* @__PURE__ */ jsx(CivilizationHero, { color, image, imageAlt: altName }),
|
|
220
|
+
/* @__PURE__ */ jsx(
|
|
221
|
+
CivilizationBody,
|
|
222
|
+
{
|
|
223
|
+
achievements,
|
|
224
|
+
actionHref,
|
|
225
|
+
capital,
|
|
226
|
+
era,
|
|
227
|
+
labels: resolvedLabels,
|
|
228
|
+
leaders,
|
|
229
|
+
name,
|
|
230
|
+
peakPopulation,
|
|
231
|
+
region
|
|
232
|
+
}
|
|
233
|
+
)
|
|
234
|
+
]
|
|
235
|
+
}
|
|
236
|
+
);
|
|
237
|
+
}
|
|
238
|
+
);
|
|
239
|
+
CivilizationCard.displayName = "CivilizationCard";
|
|
240
|
+
const CivilizationComparison = forwardRef(({ children, className, ...rest }, ref) => {
|
|
241
|
+
return /* @__PURE__ */ jsx(
|
|
242
|
+
"div",
|
|
243
|
+
{
|
|
244
|
+
className: cn(
|
|
245
|
+
"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3",
|
|
246
|
+
className
|
|
247
|
+
),
|
|
248
|
+
ref,
|
|
249
|
+
...rest,
|
|
250
|
+
children
|
|
251
|
+
}
|
|
252
|
+
);
|
|
253
|
+
});
|
|
254
|
+
CivilizationComparison.displayName = "CivilizationComparison";
|
|
255
|
+
export {
|
|
256
|
+
CivilizationCard,
|
|
257
|
+
CivilizationComparison
|
|
258
|
+
};
|
|
@@ -107,11 +107,11 @@ function CodeBlock({
|
|
|
107
107
|
/* @__PURE__ */ jsx(
|
|
108
108
|
Button,
|
|
109
109
|
{
|
|
110
|
-
className: "
|
|
110
|
+
className: "size-8",
|
|
111
111
|
onClick: handleCopy,
|
|
112
112
|
size: "icon",
|
|
113
113
|
variant: "ghost",
|
|
114
|
-
children: copied ? /* @__PURE__ */ jsx(Check, { className: "
|
|
114
|
+
children: copied ? /* @__PURE__ */ jsx(Check, { className: "size-3" }) : /* @__PURE__ */ jsx(Copy, { className: "size-3" })
|
|
115
115
|
}
|
|
116
116
|
)
|
|
117
117
|
] })
|
|
@@ -11,11 +11,12 @@ function CodeLine({ highlightLines, line, lineNumber }) {
|
|
|
11
11
|
/* @__PURE__ */ jsx("span", { children: line })
|
|
12
12
|
] });
|
|
13
13
|
}
|
|
14
|
+
const EMPTY_HIGHLIGHT_LINES = [];
|
|
14
15
|
function CodePlayground({
|
|
15
16
|
children,
|
|
16
17
|
description,
|
|
17
18
|
filename,
|
|
18
|
-
highlightLines =
|
|
19
|
+
highlightLines = EMPTY_HIGHLIGHT_LINES,
|
|
19
20
|
language = "typescript",
|
|
20
21
|
showLineNumbers = false,
|
|
21
22
|
title
|
|
@@ -33,7 +34,7 @@ function CodePlayground({
|
|
|
33
34
|
return /* @__PURE__ */ jsxs("div", { className: "my-6 rounded-lg border bg-card overflow-hidden", children: [
|
|
34
35
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-4 py-3 border-b bg-muted/30", children: [
|
|
35
36
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
36
|
-
/* @__PURE__ */ jsx("div", { className: "flex
|
|
37
|
+
/* @__PURE__ */ jsx("div", { className: "flex size-8 items-center justify-center rounded bg-primary/10", children: /* @__PURE__ */ jsx(Code, { className: "size-4 text-primary" }) }),
|
|
37
38
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
38
39
|
/* @__PURE__ */ jsx("h4", { className: "font-semibold text-sm", children: title }),
|
|
39
40
|
description ? /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: description }) : null
|
|
@@ -41,17 +42,17 @@ function CodePlayground({
|
|
|
41
42
|
] }),
|
|
42
43
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
43
44
|
filename ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
|
|
44
|
-
/* @__PURE__ */ jsx(FileCode, { className: "
|
|
45
|
+
/* @__PURE__ */ jsx(FileCode, { className: "size-3" }),
|
|
45
46
|
/* @__PURE__ */ jsx("span", { className: "font-mono", children: filename })
|
|
46
47
|
] }) : null,
|
|
47
48
|
/* @__PURE__ */ jsx(
|
|
48
49
|
Button,
|
|
49
50
|
{
|
|
50
|
-
className: "
|
|
51
|
+
className: "size-8",
|
|
51
52
|
onClick: handleCopy,
|
|
52
53
|
size: "icon",
|
|
53
54
|
variant: "ghost",
|
|
54
|
-
children: copied ? /* @__PURE__ */ jsx(Check, { className: "
|
|
55
|
+
children: copied ? /* @__PURE__ */ jsx(Check, { className: "size-3" }) : /* @__PURE__ */ jsx(Copy, { className: "size-3" })
|
|
55
56
|
}
|
|
56
57
|
)
|
|
57
58
|
] })
|
|
@@ -63,7 +64,7 @@ function CodePlayground({
|
|
|
63
64
|
line,
|
|
64
65
|
lineNumber: index + 1
|
|
65
66
|
},
|
|
66
|
-
index
|
|
67
|
+
`${line}-${index + 1}`
|
|
67
68
|
)) }) : /* @__PURE__ */ jsx("code", { children: code }) }) }),
|
|
68
69
|
/* @__PURE__ */ jsx("div", { className: "px-4 py-2 border-t bg-muted/30", children: /* @__PURE__ */ jsx("span", { className: "text-xs font-mono text-muted-foreground uppercase tracking-wider", children: language }) })
|
|
69
70
|
] });
|
|
@@ -74,7 +75,7 @@ function FileTree({
|
|
|
74
75
|
}) {
|
|
75
76
|
return /* @__PURE__ */ jsxs("div", { className: "my-6 rounded-lg border bg-card overflow-hidden", children: [
|
|
76
77
|
/* @__PURE__ */ jsx("div", { className: "px-4 py-2 border-b bg-muted/30", children: /* @__PURE__ */ jsxs("h4", { className: "font-semibold text-sm flex items-center gap-2", children: [
|
|
77
|
-
/* @__PURE__ */ jsx(FileCode, { className: "
|
|
78
|
+
/* @__PURE__ */ jsx(FileCode, { className: "size-4" }),
|
|
78
79
|
title
|
|
79
80
|
] }) }),
|
|
80
81
|
/* @__PURE__ */ jsx("div", { className: "p-4 font-mono text-sm [&>ul]:m-0 [&>ul]:list-none [&_ul]:ml-4 [&_ul]:list-none [&_li]:text-muted-foreground", children })
|