@vllnt/ui 0.2.1-canary.e1bc2b3 → 0.2.1-canary.e62eaf0
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 +36 -0
- package/dist/components/accordion/accordion.js +2 -2
- package/dist/components/activity-heatmap/activity-heatmap.js +17 -14
- package/dist/components/activity-log/activity-log.js +5 -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/animated-text/animated-text.js +1 -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/blog-card/blog-card.js +3 -1
- 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/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 +3 -2
- package/dist/components/canvas-shell/canvas-foundation-demo.js +4 -4
- package/dist/components/carousel/carousel.js +18 -10
- package/dist/components/chat-dock-section/chat-dock-section.js +1 -1
- package/dist/components/checkbox/checkbox.js +2 -2
- package/dist/components/checklist/checklist.js +38 -10
- package/dist/components/checklist/index.js +8 -2
- 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 +10 -8
- 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 +11 -10
- package/dist/components/completion-dialog/completion-dialog.js +19 -11
- package/dist/components/content-intro/content-intro.js +24 -20
- 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 +8 -8
- 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 +10 -10
- package/dist/components/data-list/data-list.js +1 -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/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 +14 -6
- package/dist/components/faq/faq.js +8 -4
- package/dist/components/file-upload/file-upload.js +3 -3
- package/dist/components/filter-bar/filter-bar.js +8 -7
- 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/gantt-chart/gantt-chart.js +334 -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/globe-3d/globe-3d.js +429 -0
- package/dist/components/globe-3d/index.js +10 -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 +6 -5
- package/dist/components/index.js +432 -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 +711 -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 +6 -5
- package/dist/components/keyboard-shortcuts-help/keyboard-shortcuts-help.js +4 -3
- 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 +14 -13
- 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 +16 -14
- 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 +3 -3
- package/dist/components/mdx-content/mdx-content.js +8 -7
- 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/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/multi-select.js +3 -3
- 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 +4 -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-inspector/index.js +6 -0
- package/dist/components/object-inspector/object-inspector.js +136 -0
- package/dist/components/order-book/order-book.js +2 -2
- 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 +3 -2
- package/dist/components/progress-card/progress-card.js +4 -3
- package/dist/components/progress-tracker/progress-tracker.js +19 -11
- 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 +7 -6
- 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/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 +483 -50
- 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/share-dialog/share-dialog.js +2 -2
- package/dist/components/share-section/share-section.js +2 -1
- package/dist/components/sheet/sheet.js +1 -1
- package/dist/components/sidebar/sidebar.js +20 -19
- package/dist/components/sidebar-toggle/sidebar-toggle.js +2 -2
- package/dist/components/slider/slider.js +1 -1
- package/dist/components/slideshow/slideshow.js +14 -12
- 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 +12 -11
- package/dist/components/sparkline-grid/sparkline-grid.js +1 -1
- package/dist/components/spinner/spinner.js +4 -4
- package/dist/components/stat-card/stat-card.js +4 -4
- 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 +13 -6
- package/dist/components/status-indicator/status-indicator.js +3 -3
- package/dist/components/step-by-step/step-by-step.js +10 -8
- 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/table-of-contents.js +5 -2
- package/dist/components/table-of-contents-panel/table-of-contents-panel.js +8 -6
- package/dist/components/tags-input/tags-input.js +12 -4
- package/dist/components/terminal/terminal.js +58 -36
- package/dist/components/theme-toggle/theme-toggle.js +2 -2
- package/dist/components/thinking-block/thinking-block.js +3 -3
- 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 +11 -9
- 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 +15 -13
- package/dist/components/tutorial-filters/tutorial-filters.js +1 -1
- package/dist/components/tutorial-intro-content/tutorial-intro-content.js +5 -5
- package/dist/components/tutorial-mdx/tutorial-mdx.js +5 -5
- package/dist/components/usage-breakdown/usage-breakdown.js +9 -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 +7 -6
- 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 +34 -13
- package/dist/index.d.ts +7336 -256
- package/dist/index.js +3 -1
- package/package.json +4 -4
|
@@ -64,7 +64,7 @@ function SubscriptionDetails({
|
|
|
64
64
|
/* @__PURE__ */ jsx("p", { className: "text-xs uppercase tracking-[0.18em] text-muted-foreground", children: "Monthly total" }),
|
|
65
65
|
/* @__PURE__ */ jsx("p", { className: "mt-2 text-3xl font-semibold tracking-tight", children: priceLabel })
|
|
66
66
|
] }),
|
|
67
|
-
/* @__PURE__ */ jsxs("div", { className: "space-y-3 rounded-lg border border-border/70 bg-muted/20
|
|
67
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-3 rounded-lg border border-border/70 bg-muted/20 p-4", children: [
|
|
68
68
|
/* @__PURE__ */ jsx(DetailRow, { label: "Renewal", value: renewalLabel }),
|
|
69
69
|
seatsLabel ? /* @__PURE__ */ jsx(DetailRow, { label: "Seats", value: seatsLabel }) : null,
|
|
70
70
|
usageLabel ? /* @__PURE__ */ jsx(DetailRow, { label: "Usage", value: usageLabel }) : null
|
|
@@ -16,7 +16,7 @@ const Switch = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
16
16
|
SwitchPrimitives.Thumb,
|
|
17
17
|
{
|
|
18
18
|
className: cn(
|
|
19
|
-
"pointer-events-none block
|
|
19
|
+
"pointer-events-none block size-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0"
|
|
20
20
|
)
|
|
21
21
|
}
|
|
22
22
|
)
|
|
@@ -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,19 +70,19 @@ 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
|
{
|
|
75
77
|
"aria-label": "Close table of contents",
|
|
76
|
-
className: "flex
|
|
78
|
+
className: "flex size-8 items-center justify-center rounded-md hover:bg-muted",
|
|
77
79
|
onClick: onClose,
|
|
78
80
|
ref: closeButtonRef,
|
|
79
81
|
type: "button",
|
|
80
82
|
children: closeIcon ?? /* @__PURE__ */ jsx(
|
|
81
83
|
"svg",
|
|
82
84
|
{
|
|
83
|
-
className: "
|
|
85
|
+
className: "size-5",
|
|
84
86
|
fill: "none",
|
|
85
87
|
stroke: "currentColor",
|
|
86
88
|
viewBox: "0 0 24 24",
|
|
@@ -143,13 +145,13 @@ function TableOfContentsPanelImpl({
|
|
|
143
145
|
"span",
|
|
144
146
|
{
|
|
145
147
|
className: cn(
|
|
146
|
-
"flex
|
|
148
|
+
"flex size-5 shrink-0 items-center justify-center rounded-full border",
|
|
147
149
|
isCompleted ? "border-primary bg-primary text-primary-foreground" : "border-muted-foreground"
|
|
148
150
|
),
|
|
149
151
|
children: isCompleted ? /* @__PURE__ */ jsx(
|
|
150
152
|
"svg",
|
|
151
153
|
{
|
|
152
|
-
className: "
|
|
154
|
+
className: "size-3",
|
|
153
155
|
fill: "none",
|
|
154
156
|
stroke: "currentColor",
|
|
155
157
|
viewBox: "0 0 24 24",
|
|
@@ -175,7 +177,7 @@ function TableOfContentsPanelImpl({
|
|
|
175
177
|
)
|
|
176
178
|
]
|
|
177
179
|
}
|
|
178
|
-
) },
|
|
180
|
+
) }, section.id);
|
|
179
181
|
}) })
|
|
180
182
|
}
|
|
181
183
|
),
|
|
@@ -7,9 +7,17 @@ function normalizeTag(tag) {
|
|
|
7
7
|
return tag.trim();
|
|
8
8
|
}
|
|
9
9
|
function getNormalizedTags(tags) {
|
|
10
|
-
return tags.
|
|
11
|
-
(
|
|
12
|
-
|
|
10
|
+
return tags.reduce(
|
|
11
|
+
(state, tag) => {
|
|
12
|
+
const normalizedTag = normalizeTag(tag);
|
|
13
|
+
if (normalizedTag.length > 0 && !state.seen.has(normalizedTag)) {
|
|
14
|
+
state.seen.add(normalizedTag);
|
|
15
|
+
state.tags.push(normalizedTag);
|
|
16
|
+
}
|
|
17
|
+
return state;
|
|
18
|
+
},
|
|
19
|
+
{ seen: /* @__PURE__ */ new Set(), tags: [] }
|
|
20
|
+
).tags;
|
|
13
21
|
}
|
|
14
22
|
function shouldAddTagFromKey(key) {
|
|
15
23
|
return key === "Enter" || key === ",";
|
|
@@ -103,7 +111,7 @@ function TagList({ disabled, onRemove, tags }) {
|
|
|
103
111
|
onRemove(tag);
|
|
104
112
|
},
|
|
105
113
|
type: "button",
|
|
106
|
-
children: /* @__PURE__ */ jsx(X, { className: "
|
|
114
|
+
children: /* @__PURE__ */ jsx(X, { className: "size-3.5" })
|
|
107
115
|
}
|
|
108
116
|
)
|
|
109
117
|
]
|
|
@@ -3,13 +3,21 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { useState } from "react";
|
|
4
4
|
import { Check, Copy, Terminal as TerminalIcon } from "lucide-react";
|
|
5
5
|
import { Button } from "../button";
|
|
6
|
+
function getCommandContents(lines) {
|
|
7
|
+
return lines.reduce((commands, line) => {
|
|
8
|
+
if (line.type === "command") {
|
|
9
|
+
commands.push(line.content);
|
|
10
|
+
}
|
|
11
|
+
return commands;
|
|
12
|
+
}, []);
|
|
13
|
+
}
|
|
6
14
|
function Terminal({
|
|
7
15
|
copyable = true,
|
|
8
16
|
lines,
|
|
9
17
|
title = "Terminal"
|
|
10
18
|
}) {
|
|
11
19
|
const [copied, setCopied] = useState(false);
|
|
12
|
-
const commands = lines
|
|
20
|
+
const commands = getCommandContents(lines);
|
|
13
21
|
const handleCopy = async () => {
|
|
14
22
|
await navigator.clipboard.writeText(commands.join("\n"));
|
|
15
23
|
setCopied(true);
|
|
@@ -20,35 +28,42 @@ function Terminal({
|
|
|
20
28
|
return /* @__PURE__ */ jsxs("div", { className: "my-6 rounded-lg border bg-zinc-950 dark:bg-zinc-900 overflow-hidden", children: [
|
|
21
29
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-4 py-2 bg-zinc-900 dark:bg-zinc-800 border-b border-zinc-800", children: [
|
|
22
30
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
23
|
-
/* @__PURE__ */ jsx(TerminalIcon, { className: "
|
|
31
|
+
/* @__PURE__ */ jsx(TerminalIcon, { className: "size-4 text-zinc-400" }),
|
|
24
32
|
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium text-zinc-300", children: title })
|
|
25
33
|
] }),
|
|
26
34
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
27
|
-
/* @__PURE__ */ jsx("div", { className: "
|
|
28
|
-
/* @__PURE__ */ jsx("div", { className: "
|
|
29
|
-
/* @__PURE__ */ jsx("div", { className: "
|
|
35
|
+
/* @__PURE__ */ jsx("div", { className: "size-3 rounded-full bg-red-500" }),
|
|
36
|
+
/* @__PURE__ */ jsx("div", { className: "size-3 rounded-full bg-yellow-500" }),
|
|
37
|
+
/* @__PURE__ */ jsx("div", { className: "size-3 rounded-full bg-green-500" })
|
|
30
38
|
] })
|
|
31
39
|
] }),
|
|
32
40
|
/* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
33
|
-
/* @__PURE__ */ jsx("div", { className: "p-4 font-mono text-sm space-y-1 overflow-x-auto", children: lines.map((line
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
/* @__PURE__ */ jsx("div", { className: "p-4 font-mono text-sm space-y-1 overflow-x-auto", children: lines.map((line) => /* @__PURE__ */ jsxs(
|
|
42
|
+
"div",
|
|
43
|
+
{
|
|
44
|
+
className: "flex items-start",
|
|
45
|
+
children: [
|
|
46
|
+
line.type === "command" && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
47
|
+
/* @__PURE__ */ jsx("span", { className: "text-green-400 mr-2 select-none", children: "$" }),
|
|
48
|
+
/* @__PURE__ */ jsx("span", { className: "text-zinc-100", children: line.content })
|
|
49
|
+
] }),
|
|
50
|
+
line.type === "output" && /* @__PURE__ */ jsx("span", { className: "text-zinc-400", children: line.content }),
|
|
51
|
+
line.type === "comment" && /* @__PURE__ */ jsxs("span", { className: "text-zinc-600 italic", children: [
|
|
52
|
+
"# ",
|
|
53
|
+
line.content
|
|
54
|
+
] })
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
`${line.type}-${line.content}`
|
|
58
|
+
)) }),
|
|
44
59
|
copyable && commands.length > 0 ? /* @__PURE__ */ jsx(
|
|
45
60
|
Button,
|
|
46
61
|
{
|
|
47
|
-
className: "absolute top-2 right-2
|
|
62
|
+
className: "absolute top-2 right-2 size-8 bg-zinc-800 hover:bg-zinc-700 text-zinc-300",
|
|
48
63
|
onClick: handleCopy,
|
|
49
64
|
size: "icon",
|
|
50
65
|
variant: "ghost",
|
|
51
|
-
children: copied ? /* @__PURE__ */ jsx(Check, { className: "
|
|
66
|
+
children: copied ? /* @__PURE__ */ jsx(Check, { className: "size-3" }) : /* @__PURE__ */ jsx(Copy, { className: "size-3" })
|
|
52
67
|
}
|
|
53
68
|
) : null
|
|
54
69
|
] })
|
|
@@ -68,7 +83,7 @@ function SimpleTerminal({
|
|
|
68
83
|
}
|
|
69
84
|
return { content: line, type: "output" };
|
|
70
85
|
});
|
|
71
|
-
const commands = lines
|
|
86
|
+
const commands = getCommandContents(lines);
|
|
72
87
|
const handleCopy = async () => {
|
|
73
88
|
await navigator.clipboard.writeText(commands.join("\n"));
|
|
74
89
|
setCopied(true);
|
|
@@ -79,35 +94,42 @@ function SimpleTerminal({
|
|
|
79
94
|
return /* @__PURE__ */ jsxs("div", { className: "my-6 rounded-lg border bg-zinc-950 dark:bg-zinc-900 overflow-hidden", children: [
|
|
80
95
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-4 py-2 bg-zinc-900 dark:bg-zinc-800 border-b border-zinc-800", children: [
|
|
81
96
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
82
|
-
/* @__PURE__ */ jsx(TerminalIcon, { className: "
|
|
97
|
+
/* @__PURE__ */ jsx(TerminalIcon, { className: "size-4 text-zinc-400" }),
|
|
83
98
|
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium text-zinc-300", children: title })
|
|
84
99
|
] }),
|
|
85
100
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
86
|
-
/* @__PURE__ */ jsx("div", { className: "
|
|
87
|
-
/* @__PURE__ */ jsx("div", { className: "
|
|
88
|
-
/* @__PURE__ */ jsx("div", { className: "
|
|
101
|
+
/* @__PURE__ */ jsx("div", { className: "size-3 rounded-full bg-red-500" }),
|
|
102
|
+
/* @__PURE__ */ jsx("div", { className: "size-3 rounded-full bg-yellow-500" }),
|
|
103
|
+
/* @__PURE__ */ jsx("div", { className: "size-3 rounded-full bg-green-500" })
|
|
89
104
|
] })
|
|
90
105
|
] }),
|
|
91
106
|
/* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
92
|
-
/* @__PURE__ */ jsx("div", { className: "p-4 font-mono text-sm space-y-1 overflow-x-auto", children: lines.map((line
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
107
|
+
/* @__PURE__ */ jsx("div", { className: "p-4 font-mono text-sm space-y-1 overflow-x-auto", children: lines.map((line) => /* @__PURE__ */ jsxs(
|
|
108
|
+
"div",
|
|
109
|
+
{
|
|
110
|
+
className: "flex items-start",
|
|
111
|
+
children: [
|
|
112
|
+
line.type === "command" && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
113
|
+
/* @__PURE__ */ jsx("span", { className: "text-green-400 mr-2 select-none", children: "$" }),
|
|
114
|
+
/* @__PURE__ */ jsx("span", { className: "text-zinc-100", children: line.content })
|
|
115
|
+
] }),
|
|
116
|
+
line.type === "output" && /* @__PURE__ */ jsx("span", { className: "text-zinc-400", children: line.content }),
|
|
117
|
+
line.type === "comment" && /* @__PURE__ */ jsxs("span", { className: "text-zinc-600 italic", children: [
|
|
118
|
+
"# ",
|
|
119
|
+
line.content
|
|
120
|
+
] })
|
|
121
|
+
]
|
|
122
|
+
},
|
|
123
|
+
`${line.type}-${line.content}`
|
|
124
|
+
)) }),
|
|
103
125
|
commands.length > 0 && /* @__PURE__ */ jsx(
|
|
104
126
|
Button,
|
|
105
127
|
{
|
|
106
|
-
className: "absolute top-2 right-2
|
|
128
|
+
className: "absolute top-2 right-2 size-8 bg-zinc-800 hover:bg-zinc-700 text-zinc-300",
|
|
107
129
|
onClick: handleCopy,
|
|
108
130
|
size: "icon",
|
|
109
131
|
variant: "ghost",
|
|
110
|
-
children: copied ? /* @__PURE__ */ jsx(Check, { className: "
|
|
132
|
+
children: copied ? /* @__PURE__ */ jsx(Check, { className: "size-3" }) : /* @__PURE__ */ jsx(Copy, { className: "size-3" })
|
|
111
133
|
}
|
|
112
134
|
)
|
|
113
135
|
] })
|
|
@@ -20,7 +20,7 @@ function ThemeButton({
|
|
|
20
20
|
Button,
|
|
21
21
|
{
|
|
22
22
|
"aria-label": ariaLabel,
|
|
23
|
-
className: "bg-background text-foreground border border-
|
|
23
|
+
className: "bg-background text-foreground border border-zinc-300 dark:border-zinc-600 hover:border-zinc-400 dark:hover:border-zinc-500 transition-colors",
|
|
24
24
|
size: "icon",
|
|
25
25
|
variant: "outline",
|
|
26
26
|
...props,
|
|
@@ -120,7 +120,7 @@ function ThemeToggle({ dict }) {
|
|
|
120
120
|
DropdownMenuContent,
|
|
121
121
|
{
|
|
122
122
|
align: "end",
|
|
123
|
-
className: "bg-background border border-
|
|
123
|
+
className: "bg-background border border-zinc-300 dark:border-zinc-600",
|
|
124
124
|
onMouseEnter: () => {
|
|
125
125
|
isHoveringOverMenuAreaReference.current = true;
|
|
126
126
|
clearCloseTimer();
|
|
@@ -30,10 +30,10 @@ function ThinkingBlock({
|
|
|
30
30
|
onClick: toggleExpanded,
|
|
31
31
|
type: "button",
|
|
32
32
|
children: [
|
|
33
|
-
isExpanded ? /* @__PURE__ */ jsx(ChevronDown, { className: "
|
|
33
|
+
isExpanded ? /* @__PURE__ */ jsx(ChevronDown, { className: "size-3" }) : /* @__PURE__ */ jsx(ChevronRight, { className: "size-3" }),
|
|
34
34
|
/* @__PURE__ */ jsxs("span", { children: [
|
|
35
35
|
"Thinking",
|
|
36
|
-
isStreaming ? /* @__PURE__ */ jsx("span", { className: "ml-1 animate-pulse", children: "
|
|
36
|
+
isStreaming ? /* @__PURE__ */ jsx("span", { className: "ml-1 animate-pulse", children: "\u2026" }) : null
|
|
37
37
|
] })
|
|
38
38
|
]
|
|
39
39
|
}
|
|
@@ -41,7 +41,7 @@ function ThinkingBlock({
|
|
|
41
41
|
isExpanded ? /* @__PURE__ */ jsxs(
|
|
42
42
|
"div",
|
|
43
43
|
{
|
|
44
|
-
className: "mt-2 p-3 bg-muted/50 rounded text-xs text-muted-foreground whitespace-pre-wrap border-l
|
|
44
|
+
className: "mt-2 p-3 bg-muted/50 rounded text-xs text-muted-foreground whitespace-pre-wrap border-l border-muted-foreground/30 max-h-48 overflow-y-auto",
|
|
45
45
|
id: contentId,
|
|
46
46
|
children: [
|
|
47
47
|
thinking,
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import {
|
|
4
|
+
forwardRef
|
|
5
|
+
} from "react";
|
|
6
|
+
import { cn } from "../../lib/utils";
|
|
7
|
+
const DEFAULT_LABELS = {
|
|
8
|
+
empty: "No replies yet",
|
|
9
|
+
region: "Comment thread"
|
|
10
|
+
};
|
|
11
|
+
const Message = (props) => {
|
|
12
|
+
const { message } = props;
|
|
13
|
+
return /* @__PURE__ */ jsxs("li", { className: "space-y-0.5", "data-thread-bubble-message": message.id, children: [
|
|
14
|
+
/* @__PURE__ */ jsxs("header", { className: "flex items-baseline justify-between gap-2 text-[10px]", children: [
|
|
15
|
+
/* @__PURE__ */ jsx(
|
|
16
|
+
"span",
|
|
17
|
+
{
|
|
18
|
+
className: "font-semibold",
|
|
19
|
+
"data-thread-bubble-author": true,
|
|
20
|
+
style: message.authorColor ? { color: message.authorColor } : void 0,
|
|
21
|
+
children: message.author
|
|
22
|
+
}
|
|
23
|
+
),
|
|
24
|
+
message.ts ? /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", "data-thread-bubble-ts": true, children: message.ts }) : null
|
|
25
|
+
] }),
|
|
26
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-foreground", "data-thread-bubble-body": true, children: message.body })
|
|
27
|
+
] });
|
|
28
|
+
};
|
|
29
|
+
const ThreadBubble = forwardRef(
|
|
30
|
+
(props, ref) => {
|
|
31
|
+
const { className, footer, labels, messages, onResolve, title, ...rest } = props;
|
|
32
|
+
const resolvedLabels = { ...DEFAULT_LABELS, ...labels };
|
|
33
|
+
const handleResolve = () => {
|
|
34
|
+
onResolve?.();
|
|
35
|
+
};
|
|
36
|
+
return /* @__PURE__ */ jsxs(
|
|
37
|
+
"section",
|
|
38
|
+
{
|
|
39
|
+
"aria-label": resolvedLabels.region,
|
|
40
|
+
className: cn(
|
|
41
|
+
"flex w-72 flex-col gap-2 rounded-lg border border-border bg-background p-3 text-foreground shadow-md",
|
|
42
|
+
className
|
|
43
|
+
),
|
|
44
|
+
"data-thread-bubble": true,
|
|
45
|
+
ref,
|
|
46
|
+
...rest,
|
|
47
|
+
children: [
|
|
48
|
+
title || onResolve ? /* @__PURE__ */ jsxs("header", { className: "flex items-center justify-between gap-2 text-[11px] uppercase tracking-wide text-muted-foreground", children: [
|
|
49
|
+
title ? /* @__PURE__ */ jsx("span", { className: "truncate font-semibold", "data-thread-bubble-title": true, children: title }) : /* @__PURE__ */ jsx("span", { "aria-hidden": "true" }),
|
|
50
|
+
onResolve ? /* @__PURE__ */ jsx(
|
|
51
|
+
"button",
|
|
52
|
+
{
|
|
53
|
+
className: "rounded-full border border-border px-2 py-0.5 text-[10px] font-medium text-muted-foreground transition-colors hover:bg-muted/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
54
|
+
"data-thread-bubble-resolve": true,
|
|
55
|
+
onClick: handleResolve,
|
|
56
|
+
type: "button",
|
|
57
|
+
children: "Resolve"
|
|
58
|
+
}
|
|
59
|
+
) : null
|
|
60
|
+
] }) : null,
|
|
61
|
+
messages.length === 0 ? /* @__PURE__ */ jsx(
|
|
62
|
+
"p",
|
|
63
|
+
{
|
|
64
|
+
className: "px-1 py-2 text-center text-[11px] text-muted-foreground",
|
|
65
|
+
"data-thread-bubble-state": "empty",
|
|
66
|
+
children: resolvedLabels.empty
|
|
67
|
+
}
|
|
68
|
+
) : /* @__PURE__ */ jsx("ul", { className: "space-y-2 overflow-y-auto", "data-thread-bubble-list": true, children: messages.map((message) => /* @__PURE__ */ jsx(Message, { message }, message.id)) }),
|
|
69
|
+
footer ? /* @__PURE__ */ jsx(
|
|
70
|
+
"footer",
|
|
71
|
+
{
|
|
72
|
+
className: "border-t border-border pt-2",
|
|
73
|
+
"data-thread-bubble-footer": true,
|
|
74
|
+
children: footer
|
|
75
|
+
}
|
|
76
|
+
) : null
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
);
|
|
82
|
+
ThreadBubble.displayName = "ThreadBubble";
|
|
83
|
+
export {
|
|
84
|
+
ThreadBubble
|
|
85
|
+
};
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import {
|
|
4
|
+
forwardRef
|
|
5
|
+
} from "react";
|
|
6
|
+
import { cn } from "../../lib/utils";
|
|
7
|
+
const TONE_STROKE = {
|
|
8
|
+
danger: "stroke-red-500",
|
|
9
|
+
neutral: "stroke-foreground",
|
|
10
|
+
success: "stroke-emerald-500",
|
|
11
|
+
warn: "stroke-amber-500"
|
|
12
|
+
};
|
|
13
|
+
const DEFAULT_LABELS = {
|
|
14
|
+
region: "Threshold ring"
|
|
15
|
+
};
|
|
16
|
+
const clamp = (v, min, max) => {
|
|
17
|
+
if (v < min) {
|
|
18
|
+
return min;
|
|
19
|
+
}
|
|
20
|
+
if (v > max) {
|
|
21
|
+
return max;
|
|
22
|
+
}
|
|
23
|
+
return v;
|
|
24
|
+
};
|
|
25
|
+
const polar = (input) => {
|
|
26
|
+
const rad = (input.angle - 90) * (Math.PI / 180);
|
|
27
|
+
return {
|
|
28
|
+
x: input.cx + input.r * Math.cos(rad),
|
|
29
|
+
y: input.cy + input.r * Math.sin(rad)
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
const computeGeometry = (input) => {
|
|
33
|
+
const safeMax = input.max <= 0 ? 1 : input.max;
|
|
34
|
+
const ratio = clamp(input.value / safeMax, 0, 1);
|
|
35
|
+
const cx = input.size / 2;
|
|
36
|
+
const cy = input.size / 2;
|
|
37
|
+
const r = (input.size - input.stroke) / 2;
|
|
38
|
+
const circumference = 2 * Math.PI * r;
|
|
39
|
+
const tickAngle = input.threshold === void 0 ? null : clamp(input.threshold / safeMax, 0, 1) * 360;
|
|
40
|
+
return {
|
|
41
|
+
circumference,
|
|
42
|
+
cx,
|
|
43
|
+
cy,
|
|
44
|
+
r,
|
|
45
|
+
ratio,
|
|
46
|
+
size: input.size,
|
|
47
|
+
stroke: input.stroke,
|
|
48
|
+
tickAngle
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
const Tick = (props) => {
|
|
52
|
+
const { geom } = props;
|
|
53
|
+
if (geom.tickAngle === null) {
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
const inner = polar({
|
|
57
|
+
angle: geom.tickAngle,
|
|
58
|
+
cx: geom.cx,
|
|
59
|
+
cy: geom.cy,
|
|
60
|
+
r: geom.r - geom.stroke / 2
|
|
61
|
+
});
|
|
62
|
+
const outer = polar({
|
|
63
|
+
angle: geom.tickAngle,
|
|
64
|
+
cx: geom.cx,
|
|
65
|
+
cy: geom.cy,
|
|
66
|
+
r: geom.r + geom.stroke / 2
|
|
67
|
+
});
|
|
68
|
+
return /* @__PURE__ */ jsx(
|
|
69
|
+
"line",
|
|
70
|
+
{
|
|
71
|
+
className: "stroke-foreground/80",
|
|
72
|
+
"data-threshold-ring-tick": true,
|
|
73
|
+
strokeLinecap: "round",
|
|
74
|
+
strokeWidth: 2,
|
|
75
|
+
x1: inner.x,
|
|
76
|
+
x2: outer.x,
|
|
77
|
+
y1: inner.y,
|
|
78
|
+
y2: outer.y
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
};
|
|
82
|
+
const ThresholdRing = forwardRef(
|
|
83
|
+
(props, ref) => {
|
|
84
|
+
const {
|
|
85
|
+
centerLabel,
|
|
86
|
+
className,
|
|
87
|
+
labels,
|
|
88
|
+
max = 1,
|
|
89
|
+
size = 64,
|
|
90
|
+
stroke = 6,
|
|
91
|
+
threshold,
|
|
92
|
+
tone = "neutral",
|
|
93
|
+
value,
|
|
94
|
+
...rest
|
|
95
|
+
} = props;
|
|
96
|
+
const resolvedLabels = { ...DEFAULT_LABELS, ...labels };
|
|
97
|
+
const geom = computeGeometry({ max, size, stroke, threshold, value });
|
|
98
|
+
const dash = `${geom.ratio * geom.circumference} ${geom.circumference}`;
|
|
99
|
+
return /* @__PURE__ */ jsxs(
|
|
100
|
+
"svg",
|
|
101
|
+
{
|
|
102
|
+
"aria-label": resolvedLabels.region,
|
|
103
|
+
className: cn("inline-block", className),
|
|
104
|
+
"data-threshold-ring": true,
|
|
105
|
+
"data-threshold-tone": tone,
|
|
106
|
+
height: geom.size,
|
|
107
|
+
ref,
|
|
108
|
+
role: "img",
|
|
109
|
+
viewBox: `0 0 ${geom.size} ${geom.size}`,
|
|
110
|
+
width: geom.size,
|
|
111
|
+
...rest,
|
|
112
|
+
children: [
|
|
113
|
+
/* @__PURE__ */ jsx(
|
|
114
|
+
"circle",
|
|
115
|
+
{
|
|
116
|
+
className: "stroke-muted",
|
|
117
|
+
cx: geom.cx,
|
|
118
|
+
cy: geom.cy,
|
|
119
|
+
fill: "none",
|
|
120
|
+
r: geom.r,
|
|
121
|
+
strokeWidth: geom.stroke
|
|
122
|
+
}
|
|
123
|
+
),
|
|
124
|
+
/* @__PURE__ */ jsx(
|
|
125
|
+
"circle",
|
|
126
|
+
{
|
|
127
|
+
className: cn("transition-all duration-300", TONE_STROKE[tone]),
|
|
128
|
+
cx: geom.cx,
|
|
129
|
+
cy: geom.cy,
|
|
130
|
+
"data-threshold-ring-arc": true,
|
|
131
|
+
fill: "none",
|
|
132
|
+
r: geom.r,
|
|
133
|
+
strokeDasharray: dash,
|
|
134
|
+
strokeLinecap: "round",
|
|
135
|
+
strokeWidth: geom.stroke,
|
|
136
|
+
transform: `rotate(-90 ${geom.cx} ${geom.cy})`
|
|
137
|
+
}
|
|
138
|
+
),
|
|
139
|
+
/* @__PURE__ */ jsx(Tick, { geom }),
|
|
140
|
+
centerLabel ? /* @__PURE__ */ jsx(
|
|
141
|
+
"text",
|
|
142
|
+
{
|
|
143
|
+
className: "fill-foreground text-[10px] font-semibold",
|
|
144
|
+
"data-threshold-ring-label": true,
|
|
145
|
+
dominantBaseline: "central",
|
|
146
|
+
textAnchor: "middle",
|
|
147
|
+
x: geom.cx,
|
|
148
|
+
y: geom.cy,
|
|
149
|
+
children: centerLabel
|
|
150
|
+
}
|
|
151
|
+
) : null
|
|
152
|
+
]
|
|
153
|
+
}
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
);
|
|
157
|
+
ThresholdRing.displayName = "ThresholdRing";
|
|
158
|
+
export {
|
|
159
|
+
ThresholdRing
|
|
160
|
+
};
|
|
@@ -22,7 +22,7 @@ function formatChange(change) {
|
|
|
22
22
|
return `${sign}${change.toFixed(2)}%`;
|
|
23
23
|
}
|
|
24
24
|
function TickerTapeRow({ items }) {
|
|
25
|
-
return /* @__PURE__ */ jsx("div", { className: "flex min-w-max items-center gap-3
|
|
25
|
+
return /* @__PURE__ */ jsx("div", { className: "flex min-w-max items-center gap-3 p-3", children: items.map((item) => {
|
|
26
26
|
const isPositive = item.change >= 0;
|
|
27
27
|
const TrendIcon = isPositive ? ArrowUpRight : ArrowDownRight;
|
|
28
28
|
return /* @__PURE__ */ jsxs(
|
|
@@ -43,13 +43,13 @@ function TickerTapeRow({ items }) {
|
|
|
43
43
|
),
|
|
44
44
|
variant: "outline",
|
|
45
45
|
children: [
|
|
46
|
-
/* @__PURE__ */ jsx(TrendIcon, { className: "
|
|
46
|
+
/* @__PURE__ */ jsx(TrendIcon, { className: "size-3" }),
|
|
47
47
|
formatChange(item.change)
|
|
48
48
|
]
|
|
49
49
|
}
|
|
50
50
|
),
|
|
51
51
|
item.volume ? /* @__PURE__ */ jsxs("span", { className: "hidden items-center text-xs text-muted-foreground sm:inline-flex", children: [
|
|
52
|
-
/* @__PURE__ */ jsx(Dot, { className: "
|
|
52
|
+
/* @__PURE__ */ jsx(Dot, { className: "size-3.5" }),
|
|
53
53
|
item.volume
|
|
54
54
|
] }) : null
|
|
55
55
|
]
|