Skip to content

Commit 1189576

Browse files
authored
docs: new Callout component (#7279)
1 parent 2cc443c commit 1189576

File tree

2 files changed

+79
-2
lines changed
  • packages/web/docs/src
    • app/product-updates/(posts)/2025-11-17-hive-gateway-rust-query-planner
    • components

2 files changed

+79
-2
lines changed

packages/web/docs/src/app/product-updates/(posts)/2025-11-17-hive-gateway-rust-query-planner/page.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ date: 2025-11-17
77
authors: [enisdenjo]
88
---
99

10-
import { Callout } from '@theguild/components'
10+
import { Callout } from '#components/callout'
1111

1212
We're thrilled to announce the integration of our
1313
[Rust Query Planner into Hive Gateway](/docs/gateway/other-features/rust-query-planner), bringing
@@ -48,7 +48,7 @@ ecosystem. All your existing plugins, integrations, and tools continue to work s
4848
Envelop and Yoga plugins to custom Gateway plugins. You get the best of both worlds: Rust's
4949
performance under the hood with JavaScript's flexibility on top.
5050

51-
<Callout type="warning" emoji="⚠️">
51+
<Callout type="warning">
5252

5353
While the Rust Query Planner delivers a lot, it currently doesn't support a handfull of Hive Gateway
5454
features. We're hard at work to achieve full compatibility soon! Check out the
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
import { cn } from '../lib/utils';
2+
3+
type CalloutType = 'note' | 'tip' | 'warning' | 'critical' | 'info' | 'success';
4+
5+
interface CalloutProps {
6+
type: CalloutType;
7+
children: React.ReactNode;
8+
title?: string;
9+
}
10+
11+
const calloutConfig: Record<
12+
CalloutType,
13+
{
14+
title: string;
15+
bgColor: string;
16+
borderColor: string;
17+
titleColor: string;
18+
}
19+
> = {
20+
note: {
21+
title: 'Note',
22+
bgColor: 'bg-blue-950/30',
23+
borderColor: 'border-blue-400',
24+
titleColor: 'text-blue-400',
25+
},
26+
tip: {
27+
title: 'Tip',
28+
bgColor: 'bg-purple-950/30',
29+
borderColor: 'border-purple-400',
30+
titleColor: 'text-purple-400',
31+
},
32+
warning: {
33+
title: 'Warning',
34+
bgColor: 'bg-yellow-950/30',
35+
borderColor: 'border-yellow-400',
36+
titleColor: 'text-yellow-400',
37+
},
38+
critical: {
39+
title: 'critical',
40+
bgColor: 'bg-red-950/30',
41+
borderColor: 'border-red-400',
42+
titleColor: 'text-red-400',
43+
},
44+
info: {
45+
title: 'Info',
46+
bgColor: 'bg-cyan-950/30',
47+
borderColor: 'border-cyan-400',
48+
titleColor: 'text-cyan-400',
49+
},
50+
success: {
51+
title: 'Success',
52+
bgColor: 'bg-green-950/30',
53+
borderColor: 'border-green-400',
54+
titleColor: 'text-green-400',
55+
},
56+
};
57+
58+
export function Callout({ type, children, title }: CalloutProps) {
59+
const config = calloutConfig[type];
60+
61+
return (
62+
<div className={cn(config.bgColor, config.borderColor, 'mt-6 border-l-2 p-4')}>
63+
<div className="min-w-0 flex-1 text-white">
64+
<div
65+
className={cn('mb-2 font-mono text-sm font-medium uppercase', config.titleColor)}
66+
style={{
67+
letterSpacing: '0.05em',
68+
}}
69+
>
70+
{title ?? config.title}
71+
</div>
72+
{/* I used [&_*]:!leading-[inherit] to override line-height forced by nextra */}
73+
<div className={cn('[&_*]:!leading-[inherit]')}>{children}</div>
74+
</div>
75+
</div>
76+
);
77+
}

0 commit comments

Comments
 (0)