Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion frontend/packages/components/src/code.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ export function CodeGroup({ children, className }: CodeGroupProps) {
{Children.map(children, (child) => {
const idx = getChildIdx(child);
return (
<TabsTrigger key={idx} value={idx}>
<TabsTrigger
key={idx}
value={idx}
className="data-[state=active]:!text-white"
>
{child.props.title ||
languageNames[
child.props.language || "bash"
Expand Down
52 changes: 23 additions & 29 deletions frontend/packages/components/src/mdx/code.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ export function CodeGroup({ children, className }: CodeGroupProps) {
return (
<div
className={cn(
"code-group group my-4 rounded-md border pt-2",
"code-group group my-4 rounded-md border",
className,
)}
data-code-group
>
<Tabs defaultValue={getChildIdx(children[0])}>
<div className="flex gap-1 border-b pr-2">
<Tabs defaultValue={getChildIdx(children[0])}>
<div className="flex gap-1 border-b pr-2">
<ScrollArea
className="w-full"
viewportProps={{ className: "[&>div]:!table" }}
Expand All @@ -71,7 +71,11 @@ export function CodeGroup({ children, className }: CodeGroupProps) {
{Children.map(children, (child) => {
const idx = getChildIdx(child);
return (
<TabsTrigger key={idx} value={idx}>
<TabsTrigger
key={idx}
value={idx}
className="data-[state=active]:!text-white"
>
{child.props.title ||
child.props.meta ||
languageNames[
Expand All @@ -83,20 +87,6 @@ export function CodeGroup({ children, className }: CodeGroupProps) {
})}
</TabsList>
</ScrollArea>
<WithTooltip
trigger={
<CopyCodeTrigger>
<Button
size="icon-sm"
className="text-foreground"
variant="ghost"
>
<Icon icon={faCopy} />
</Button>
</CopyCodeTrigger>
}
content="Copy code"
/>
</div>
{Children.map(children, (child) => {
const idx = getChildIdx(child);
Expand Down Expand Up @@ -128,12 +118,14 @@ export const pre = ({
title,
isInGroup,
}: PreProps) => {
const showHeader = !isInGroup || !!file;
const showCopyButton = !isInGroup;
return (
<div
className="not-prose my-4 rounded-md border group-[.code-group]:my-0 group-[.code-group]:-mt-2 group-[.code-group]:border-none"
data-code-group
>
{!file && isInGroup ? null : (
{showHeader && (
<div className="text-foreground flex items-center justify-between gap-2 border-b p-2 text-xs">
<div className="text-muted-foreground flex items-center gap-1">
{file ? (
Expand All @@ -147,16 +139,18 @@ export const pre = ({
</Badge>
)}
</div>
<WithTooltip
trigger={
<CopyCodeTrigger>
<Button size="icon-sm" variant="ghost">
<Icon icon={faCopy} />
</Button>
</CopyCodeTrigger>
}
content="Copy code"
/>
{showCopyButton ? (
<WithTooltip
trigger={
<CopyCodeTrigger>
<Button size="icon-sm" variant="ghost">
<Icon icon={faCopy} />
</Button>
</CopyCodeTrigger>
}
content="Copy code"
/>
) : null}
</div>
)}
<div className="bg-background text-wrap p-2 text-sm">
Expand Down
6 changes: 5 additions & 1 deletion frontend/packages/components/src/mdx/tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ export const Tabs = ({ children }: { children: React.ReactElement }) => {
<ScrollArea>
<RivetTabsList>
{titles.map((title) => (
<RivetTabsTrigger key={title} value={title}>
<RivetTabsTrigger
key={title}
value={title}
className="data-[state=active]:!text-white"
>
{title}
</RivetTabsTrigger>
))}
Expand Down
2 changes: 1 addition & 1 deletion frontend/packages/components/src/ui/tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const TabsTrigger = React.forwardRef<
<TabsPrimitive.Trigger
ref={ref}
className={cn(
"inline-flex items-center justify-center whitespace-nowrap py-1 text-sm ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 relative h-9 rounded-none border-b-2 border-b-transparent bg-transparent px-4 pb-3 pt-2 font-semibold text-muted-foreground shadow-none transition-none data-[state=active]:border-b-primary data-[state=active]:text-foreground data-[state=active]:shadow-none",
"relative inline-flex h-auto min-h-[2.75rem] items-center justify-center whitespace-nowrap rounded-none border-b-2 border-b-transparent bg-transparent px-4 py-2.5 text-sm font-semibold text-muted-foreground shadow-none transition-none ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:border-b-primary data-[state=active]:text-foreground data-[state=active]:shadow-none",
className,
)}
{...props}
Expand Down
6 changes: 5 additions & 1 deletion frontend/src/components/code.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ export function CodeGroup({ children, className }: CodeGroupProps) {
{Children.map(children, (child) => {
const idx = getChildIdx(child);
return (
<TabsTrigger key={idx} value={idx}>
<TabsTrigger
key={idx}
value={idx}
className="data-[state=active]:!text-white"
>
{child.props.title ||
languageNames[
child.props.language || "bash"
Expand Down
52 changes: 23 additions & 29 deletions frontend/src/components/mdx/code.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ export function CodeGroup({ children, className }: CodeGroupProps) {
return (
<div
className={cn(
"code-group group my-4 rounded-md border pt-2",
"code-group group my-4 rounded-md border",
className,
)}
data-code-group
>
<Tabs defaultValue={getChildIdx(children[0])}>
<div className="flex gap-1 border-b pr-2">
<Tabs defaultValue={getChildIdx(children[0])}>
<div className="flex gap-1 border-b pr-2">
<ScrollArea
className="w-full"
viewportProps={{ className: "[&>div]:!table" }}
Expand All @@ -63,7 +63,11 @@ export function CodeGroup({ children, className }: CodeGroupProps) {
{Children.map(children, (child) => {
const idx = getChildIdx(child);
return (
<TabsTrigger key={idx} value={idx}>
<TabsTrigger
key={idx}
value={idx}
className="data-[state=active]:!text-white"
>
{child.props.title ||
languageNames[
child.props.language
Expand All @@ -74,20 +78,6 @@ export function CodeGroup({ children, className }: CodeGroupProps) {
})}
</TabsList>
</ScrollArea>
<WithTooltip
trigger={
<CopyCodeTrigger>
<Button
size="icon-sm"
className="text-foreground"
variant="ghost"
>
<Icon icon={faCopy} />
</Button>
</CopyCodeTrigger>
}
content="Copy code"
/>
</div>
{Children.map(children, (child) => {
const idx = getChildIdx(child);
Expand Down Expand Up @@ -119,12 +109,14 @@ export const pre = ({
title,
isInGroup,
}: PreProps) => {
const showHeader = !isInGroup || !!file;
const showCopyButton = !isInGroup;
return (
<div
className="not-prose my-4 rounded-md border group-[.code-group]:my-0 group-[.code-group]:-mt-2 group-[.code-group]:border-none"
data-code-group
>
{!file && isInGroup ? null : (
{showHeader && (
<div className="text-foreground flex items-center justify-between gap-2 border-b p-2 text-xs">
<div className="text-muted-foreground flex items-center gap-1">
{file ? (
Expand All @@ -138,16 +130,18 @@ export const pre = ({
</Badge>
)}
</div>
<WithTooltip
trigger={
<CopyCodeTrigger>
<Button size="icon-sm" variant="ghost">
<Icon icon={faCopy} />
</Button>
</CopyCodeTrigger>
}
content="Copy code"
/>
{showCopyButton ? (
<WithTooltip
trigger={
<CopyCodeTrigger>
<Button size="icon-sm" variant="ghost">
<Icon icon={faCopy} />
</Button>
</CopyCodeTrigger>
}
content="Copy code"
/>
) : null}
</div>
)}
<div className="bg-background text-wrap p-2 text-sm">
Expand Down
6 changes: 5 additions & 1 deletion frontend/src/components/mdx/tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ export const Tabs = ({ children }: { children: React.ReactElement }) => {
<ScrollArea>
<RivetTabsList>
{titles.map((title) => (
<RivetTabsTrigger key={title} value={title}>
<RivetTabsTrigger
key={title}
value={title}
className="data-[state=active]:!text-white"
>
{title}
</RivetTabsTrigger>
))}
Expand Down
2 changes: 1 addition & 1 deletion site/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Rivet Site

[rivet.gg](https://rivet.gg)
[rivet.dev](https://rivet.dev)

## Project structure

Expand Down
2 changes: 1 addition & 1 deletion site/linkinator.config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"recurse": true,
"markdown": true,
"skip": "https://hub.rivet.gg,https://twitter.com,https://www.cloudflare.com,https://cloudflare.com,https://github.com,https://support.cloudflare.com,http://localhost,https://tanks.rivet.game",
"skip": "https://dashboard.rivet.dev,https://twitter.com,https://www.cloudflare.com,https://cloudflare.com,https://github.com,https://support.cloudflare.com,http://localhost,https://tanks.rivet.game",
"format": "json"
}
2 changes: 1 addition & 1 deletion site/next-sitemap.config.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading