Skip to content

Commit 97aa8cd

Browse files
committed
Code adjustments
1 parent 0d33641 commit 97aa8cd

File tree

8 files changed

+36
-25
lines changed

8 files changed

+36
-25
lines changed

src/components/Common/Badge.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ export interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
1313
}
1414

1515
const variantClasses: Record<NonNullable<BadgeProps["variant"]>, string> = {
16-
default: "bg-primary-light/80 backdrop-blur-xs !text-white rounded border border-primary/10",
17-
secondary: "bg-gray-200/70 backdrop-blur-xs text-black dark:bg-secondary/70 dark:text-black rounded border border-gray-300/10 dark:border-secondary/10",
18-
outline: "bg-stone-100/30 backdrop-blur-xs text-black rounded border border-black/70",
19-
success: "bg-green-300/80 backdrop-blur-xs text-green-950 rounded border border-green-400/10",
20-
warning: "bg-orange-300/80 backdrop-blur-xs text-orange-950 rounded border border-orange-400/10",
21-
destructive: "bg-red-300/80 bacdrop-blur-xs text-red-950 rounded border border-red-400/10",
16+
default: "bg-primary-light/80 backdrop-blur-xs text-white border border-primary/10 dark:text-black",
17+
secondary: "bg-gray-200/70 backdrop-blur-xs text-black dark:bg-secondary/70 dark:text-black border border-gray-300/10 dark:border-secondary/10",
18+
outline: "bg-stone-100/30 backdrop-blur-xs text-black border border-black/70",
19+
success: "bg-green-300/80 backdrop-blur-xs text-green-950 border border-green-400/10",
20+
warning: "bg-orange-300/80 backdrop-blur-xs text-orange-950 border border-orange-400/10",
21+
destructive: "bg-red-300/80 backdrop-blur-xs text-red-950 border border-red-400/10",
2222
}
2323

2424
const sizeClasses: Record<NonNullable<BadgeProps["size"]>, string> = {

src/components/Common/Button.tsx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,25 @@ import { IconName } from "@site/src/typescript/iconName";
55
import { Icon } from "./Icon";
66
import isInternalUrl from "@docusaurus/isInternalUrl";
77

8+
export type ButtonVariant =
9+
| "default"
10+
| "outline"
11+
| "ghost"
12+
| "destructive"
13+
| "secondary";
14+
15+
816
export interface ButtonProps
917
extends React.ButtonHTMLAttributes<HTMLButtonElement> {
1018
children: React.ReactNode;
1119
url?: string;
1220
className?: string;
13-
variant?: "default" | "outline" | "ghost" | "destructive" | "secondary";
21+
variant?: ButtonVariant;
1422
size?: "sm" | "md" | "lg";
1523
iconName?: IconName;
1624
}
1725

18-
const variantClasses: Record<NonNullable<ButtonProps["variant"]>, string> = {
26+
const variantClasses: Record<ButtonVariant, string> = {
1927
default: "bg-primary !text-white dark:!text-black hover:bg-primary-darker",
2028
secondary: "bg-gray-300 hover:bg-gray-400 dark:bg-secondary !text-black dark:hover:bg-secondary-darker",
2129
outline:
@@ -49,14 +57,14 @@ export default function Button({
4957
);
5058

5159
if (url) {
52-
const external = !isInternalUrl(url);
60+
const isExternal = !isInternalUrl(url);
5361
return (
5462
<Link
55-
{...(external ? { href: url } : { to: url })}
63+
{...(isExternal ? { href: url } : { to: url })}
5664
className={baseClasses}
5765
>
5866
{children} {iconName && <Icon icon={iconName} />}
59-
{external && <Icon icon="newtab" className="ml-2" size="xs"/>}
67+
{isExternal && <Icon icon="newtab" className="ml-2" size="xs"/>}
6068
</Link>
6169
);
6270
}

src/components/Common/CardWithImage.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { ReactNode } from "react";
22
import Heading from "@theme/Heading";
3-
import Button from "@site/src/components/Common/Button";
3+
import Button, { type ButtonVariant } from "@site/src/components/Common/Button";
44
import { Icon } from "@site/src/components/Common/Icon";
55
import { IconName } from "@site/src/typescript/iconName";
66
import Badge from "@site/src/components/Common/Badge";
@@ -12,7 +12,7 @@ export interface CardWithImageProps {
1212
imgSrc: string;
1313
imgAlt?: string;
1414
url?: string;
15-
buttonVariant?: "default" | "outline" | "ghost" | "destructive" | "secondary";
15+
buttonVariant?: ButtonVariant;
1616
ctaLabel?: string;
1717
iconName?: IconName;
1818
imgIcon?: IconName;
@@ -32,7 +32,7 @@ export default function CardWithImage({
3232
const hasImage = Boolean(imgSrc);
3333
return (
3434
<div className="card group flex flex-col overflow-hidden rounded-2xl border border-black/10 dark:border-white/10 bg-muted/40 p-4 transition-colors">
35-
<div className={`flex items-center justify-center rounded-xl mb-4 overflow-hidden relative h-[132.96px] ${hasImage ? "bg-black/40" : "bg-gradient-to-b from-[#204879] to-[#0F1425] to-[70%]"}`}>
35+
<div className={`flex items-center justify-center rounded-xl mb-4 overflow-hidden relative aspect-[79/24] ${hasImage ? "bg-black/40" : "bg-gradient-to-b from-[#204879] to-[#0F1425] to-[70%]"}`}>
3636
{hasImage ? (
3737
<img
3838
src={imgSrc}

src/components/Common/CardWithImageHorizontal.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { ReactNode } from "react";
22
import Heading from "@theme/Heading";
3-
import Button from "@site/src/components/Common/Button";
3+
import Button, { type ButtonVariant } from "@site/src/components/Common/Button";
44
import { IconName } from "@site/src/typescript/iconName";
55
import Badge from "@site/src/components/Common/Badge";
66
import isInternalUrl from "@docusaurus/isInternalUrl";
@@ -11,7 +11,7 @@ export interface CardWithImageHorizontalProps {
1111
imgSrc: string;
1212
imgAlt?: string;
1313
url?: string;
14-
buttonVariant?: "default" | "outline" | "ghost" | "destructive" | "secondary";
14+
buttonVariant?: ButtonVariant;
1515
ctaLabel?: string;
1616
iconName?: IconName;
1717
}
@@ -27,8 +27,8 @@ export default function CardWithImageHorizontal({
2727
iconName,
2828
}: CardWithImageHorizontalProps) {
2929
return (
30-
<div className="card group flex !flex-row items-center gap-4 overflow-hidden rounded-2xl border border-black/10 dark:border-white/10 bg-muted/40 p-4 transition-colors">
31-
<div className="basis-1/3 flex-shrink-0 overflow-hidden rounded-xl relative flex items-center">
30+
<div className="card group !grid [grid-template-columns:repeat(auto-fit,minmax(15rem,1fr))] items-center gap-4 overflow-hidden rounded-2xl border border-black/10 dark:border-white/10 bg-muted/40 p-4 transition-colors">
31+
<div className="aspect-[400/209] overflow-hidden rounded-xl relative flex items-center">
3232
<img
3333
src={imgSrc}
3434
alt={imgAlt}
@@ -40,17 +40,17 @@ export default function CardWithImageHorizontal({
4040
</Badge>
4141
)}
4242
</div>
43-
<div className="flex flex-col flex-1 min-w-0 justify-center items-start gap-1">
43+
<div className="flex flex-col min-w-0 justify-center gap-1">
4444
<Heading as="h4" className="!mb-1">
4545
{title}
4646
</Heading>
4747
<p className="!mb-3 text-sm">{description}</p>
4848
{url && (
49-
<Button variant={buttonVariant} size="sm" url={url} className="self-start">
49+
<Button variant={buttonVariant} url={url}>
5050
{ctaLabel}
5151
</Button>
5252
)}
5353
</div>
5454
</div>
5555
);
56-
}
56+
}

src/components/OneColGrid.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ export default function OneColGrid({
2626
className={clsx(
2727
"grid grid-cols-1",
2828
gapClasses[gap],
29-
equalHeight && "[&>*]:h-full",
3029
className,
3130
)}
3231
{...props}

src/components/ThreeColGrid.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ export default function ThreeColGrid({
2626
className={clsx(
2727
"grid [grid-template-columns:repeat(auto-fit,minmax(15rem,1fr))]",
2828
gapClasses[gap],
29-
equalHeight && "[&>*]:h-full",
3029
className,
3130
)}
3231
{...props}

src/components/TwoColGrid.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ export default function TwoColGrid({
2626
className={clsx(
2727
"grid grid-cols-1 sm:grid-cols-2",
2828
gapClasses[gap],
29-
equalHeight && "[&>*]:h-full",
3029
className,
3130
)}
3231
{...props}

templates/introduction.mdx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
---
2+
title: "AI Overview"
3+
hide_table_of_contents: true
4+
sidebar_label: AI Overview
5+
---
6+
17
import CardWithImage from '@site/src/components/Common/CardWithImage';
28
import CardWithImageHorizontal from '@site/src/components/Common/CardWithImageHorizontal';
39
import TwoColGrid from '@site/src/components/TwoColGrid';
@@ -23,7 +29,7 @@ RavenDB AI Integration can help to ship any AI-related scenarios, including:
2329
* **Workflow automation** - Trigger safe actions from AI insights (drafts, exports, updates)
2430
* **Knowledge management (RAG)** - Ask questions over policies, wikis, and PDFs; store answers + citations
2531
* **Personalization & recommendations** - Behavioral + semantic relevance for feeds, items, and knowledge
26-
* & many more..
32+
* & many more...
2733

2834
Inspire yourself with our articles & learn more:
2935

0 commit comments

Comments
 (0)