Skip to content
Open
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
192 changes: 73 additions & 119 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions public/images/language-icons/tolk.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
94 changes: 94 additions & 0 deletions src/components/github-card/GitHubCard.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
.card {
display: flex;
align-items: center;
gap: var(--space-3x);
padding: var(--space-4x);
min-height: 96px;
border-radius: 10px;
border: 1px solid var(--color-border-primary);
background: var(--color-background-primary);
color: var(--color-text-primary);
text-decoration: none;
transition:
background-color 0.2s ease,
border-color 0.2s ease,
box-shadow 0.2s ease,
transform 0.2s ease;
}

.card:hover {
background: var(--theme-bg-hover);
border-color: var(--gray-300);
box-shadow:
0 2px 6px rgba(0, 0, 0, 0.06),
0 6px 20px rgba(0, 0, 0, 0.04);
transform: translateY(-1px);
}

.card:focus-visible {
outline: 2px solid var(--theme-accent);
outline-offset: 2px;
}

.icon {
flex-shrink: 0;
width: 44px;
height: 44px;
border-radius: 999px;
border: 1px solid var(--gray-200);
background: var(--gray-50);
display: flex;
align-items: center;
justify-content: center;
}

.icon > :global(svg),
.icon > :global(img) {
width: 22px;
height: 22px;
display: block;
}

.icon > :global(img) {
border-radius: 999px;
}

.content {
flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
gap: var(--space-1x);
}

.title {
font-size: 16px;
font-weight: var(--font-weight-medium);
color: var(--color-text-heading);
line-height: 1.4;
padding-bottom: 1px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}

.description {
font-size: 14px;
color: var(--color-text-secondary);
line-height: 1.4;
padding-bottom: 1px;
}

.arrow {
flex-shrink: 0;
color: var(--color-text-secondary);
transition:
transform 0.15s ease,
color 0.15s ease;
}

.card:hover .arrow,
.card:focus-visible .arrow {
transform: translateX(3px);
color: var(--color-text-primary);
}
33 changes: 33 additions & 0 deletions src/components/github-card/GitHubCard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import type { ReactNode } from "react"
import styles from "./GitHubCard.module.css"
import { clsx } from "~/lib/clsx/clsx.ts"
import { cardIcons, type CardIconName } from "./icons/index.js"

type GitHubCardProps = {
title: string
href: string
icon?: ReactNode
iconName?: CardIconName | string
children?: ReactNode
className?: string
} & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, "href" | "className">

export function GitHubCard({ title, href, icon, iconName, children, className, ...props }: GitHubCardProps) {
const iconFromName = iconName ? cardIcons[iconName as CardIconName] : undefined
const resolvedIcon = icon ?? (iconFromName ? <img src={iconFromName.src} alt="" aria-hidden="true" /> : null)

return (
<a href={href} className={clsx(styles.card, className)} {...props}>
{resolvedIcon ? <span className={styles.icon}>{resolvedIcon}</span> : null}
<span className={styles.content}>
<span className={styles.title} title={title}>
{title}
</span>
{children ? <span className={styles.description}>{children}</span> : null}
</span>
<span className={styles.arrow} aria-hidden="true">
</span>
</a>
)
}
2 changes: 2 additions & 0 deletions src/components/github-card/icons/github-svg-card.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions src/components/github-card/icons/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import githubSvgCard from "./github-svg-card.svg"

export const cardIcons = {
"github-svg-card": githubSvgCard,
} as const

export type CardIconName = keyof typeof cardIcons
3 changes: 3 additions & 0 deletions src/components/github-card/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export { GitHubCard } from "./GitHubCard.tsx"
export { cardIcons } from "./icons/index.js"
export type { CardIconName } from "./icons/index.js"
1 change: 1 addition & 0 deletions src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ export { default as SideBySideCode } from "./SideBySideCode/SideBySideCode.astro
export { default as CodeHighlightBlock } from "./CodeHighlightBlock/CodeHighlightBlock.astro"
export { default as CodeHighlightBlockMulti } from "./CodeHighlightBlockMulti/CodeHighlightBlockMulti.astro"
export { Callout } from "./Callout/Callout.tsx"
export { GitHubCard } from "./github-card/index.ts"
4 changes: 2 additions & 2 deletions src/config/chainTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ export const CHAIN_TYPE_CONFIGS: Record<ChainType, ChainTypeConfig> = {

/**
* Chain types supported in CCIP
* Currently: EVM, Solana, Aptos
* Currently: EVM, Solana, Aptos, TON
*/
export const CCIP_SUPPORTED_CHAINS: ChainType[] = ["evm", "solana", "aptos"]
export const CCIP_SUPPORTED_CHAINS: ChainType[] = ["evm", "solana", "aptos", "ton"]

/**
* Sections that support chain type filtering (OPT-IN)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,73 @@ exports[`CCIP Sidebar Configuration Snapshot should match the expected sidebar s
"title": "Cross-Chain Token (CCT)",
"url": "ccip/tutorials/aptos/cross-chain-tokens",
},
{
"chainTypes": [
"ton",
],
"title": "Implement CCIP Receiver",
"url": "ccip/tutorials/ton/receivers",
},
{
"chainTypes": [
"ton",
],
"children": [
{
"chainTypes": [
"ton",
],
"title": "Build CCIP Messages",
"url": "ccip/tutorials/ton/source/build-messages",
},
{
"chainTypes": [
"ton",
],
"title": "Prerequisites",
"url": "ccip/tutorials/ton/source/prerequisites",
},
{
"chainTypes": [
"ton",
],
"title": "Arbitrary Messaging",
"url": "ccip/tutorials/ton/source/arbitrary-messaging",
},
],
"title": "Source",
"url": "ccip/tutorials/ton/source",
},
{
"chainTypes": [
"ton",
],
"children": [
{
"chainTypes": [
"ton",
],
"title": "Build CCIP Messages",
"url": "ccip/tutorials/ton/destination/build-messages",
},
{
"chainTypes": [
"ton",
],
"title": "Prerequisites",
"url": "ccip/tutorials/ton/destination/prerequisites",
},
{
"chainTypes": [
"ton",
],
"title": "Arbitrary Messaging",
"url": "ccip/tutorials/ton/destination/arbitrary-messaging",
},
],
"title": "Destination",
"url": "ccip/tutorials/ton/destination",
},
],
"section": "Tutorials",
},
Expand Down
4 changes: 2 additions & 2 deletions src/config/sidebar/__tests__/ccip-dynamic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe("CCIP Sidebar Configuration", () => {
if (item.chainTypes !== undefined) {
expect(Array.isArray(item.chainTypes)).toBe(true)
item.chainTypes.forEach((chainType: ChainType) => {
expect(["evm", "solana", "aptos"]).toContain(chainType)
expect(["evm", "solana", "aptos", "ton"]).toContain(chainType)
})
}
}
Expand All @@ -56,7 +56,7 @@ describe("CCIP Sidebar Configuration", () => {
})

it("should only contain valid chainTypes", () => {
const validChainTypes = ["evm", "solana", "aptos"]
const validChainTypes = ["evm", "solana", "aptos", "ton"]

const checkChainTypes = (item: SectionContent) => {
if (item.chainTypes) {
Expand Down
94 changes: 94 additions & 0 deletions src/config/sidebar/ccip-dynamic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@
import evmCcipV151Contents from "./ccip/api-reference/evm/v1_5_1.json" with { type: "json" }
import evmCcipV160Contents from "./ccip/api-reference/evm/v1_6_0.json" with { type: "json" }
import evmCcipV161Contents from "./ccip/api-reference/evm/v1_6_1.json" with { type: "json" }
import evmCcipV162Contents from "./ccip/api-reference/evm/v1_6_2.json" with { type: "json" }

Check warning on line 20 in src/config/sidebar/ccip-dynamic.ts

View workflow job for this annotation

GitHub Actions / eslint

'evmCcipV162Contents' is defined but never used

Check warning on line 20 in src/config/sidebar/ccip-dynamic.ts

View workflow job for this annotation

GitHub Actions / eslint

'evmCcipV162Contents' is defined but never used
import evmCcipV163Contents from "./ccip/api-reference/evm/v1_6_3.json" with { type: "json" }

Check warning on line 21 in src/config/sidebar/ccip-dynamic.ts

View workflow job for this annotation

GitHub Actions / eslint

'evmCcipV163Contents' is defined but never used

Check warning on line 21 in src/config/sidebar/ccip-dynamic.ts

View workflow job for this annotation

GitHub Actions / eslint

'evmCcipV163Contents' is defined but never used
import aptosCcipV160Contents from "./ccip/api-reference/aptos/v1_6_0.json" with { type: "json" }
import svmCcipV160Contents from "./ccip/api-reference/svm/v1_6_0.json" with { type: "json" }
import tonCcipV160Contents from "./ccip/api-reference/ton/v1_6_0.json" with { type: "json" }

Check warning on line 24 in src/config/sidebar/ccip-dynamic.ts

View workflow job for this annotation

GitHub Actions / eslint

'tonCcipV160Contents' is defined but never used

Check warning on line 24 in src/config/sidebar/ccip-dynamic.ts

View workflow job for this annotation

GitHub Actions / eslint

'tonCcipV160Contents' is defined but never used

/**
* CCIP Sidebar Content with Chain Type Annotations
Expand Down Expand Up @@ -80,6 +81,11 @@
url: "ccip/service-limits/aptos",
chainTypes: ["aptos"],
},
// {
// title: "Service Limits",
// url: "ccip/service-limits/ton",
// chainTypes: ["ton"],
// },
{
title: "Service Responsibility",
url: "ccip/service-responsibility",
Expand Down Expand Up @@ -319,6 +325,11 @@
url: "ccip/concepts/best-practices/aptos",
chainTypes: ["aptos"],
},
// {
// title: "Best Practices",
// url: "ccip/concepts/best-practices/ton",
// chainTypes: ["ton"],
// },
],
},
{
Expand Down Expand Up @@ -577,6 +588,75 @@
url: "ccip/tutorials/aptos/cross-chain-tokens",
chainTypes: ["aptos"],
},
{
title: "Implement CCIP Receiver",
url: "ccip/tutorials/ton/receivers",
chainTypes: ["ton"],
},
{
title: "Source",
url: "ccip/tutorials/ton/source",
chainTypes: ["ton"],
children: [
{
title: "Build CCIP Messages",
url: "ccip/tutorials/ton/source/build-messages",
chainTypes: ["ton"],
},
{
title: "Prerequisites",
url: "ccip/tutorials/ton/source/prerequisites",
chainTypes: ["ton"],
},
// {
// title: "Token Transfers",
// url: "ccip/tutorials/ton/source/token-transfers",
// chainTypes: ["ton"],
// },
{
title: "Arbitrary Messaging",
url: "ccip/tutorials/ton/source/arbitrary-messaging",
chainTypes: ["ton"],
},
],
},
{
title: "Destination",
url: "ccip/tutorials/ton/destination",
chainTypes: ["ton"],
children: [
{
title: "Build CCIP Messages",
url: "ccip/tutorials/ton/destination/build-messages",
chainTypes: ["ton"],
},
{
title: "Prerequisites",
url: "ccip/tutorials/ton/destination/prerequisites",
chainTypes: ["ton"],
},
// {
// title: "Token Transfers",
// url: "ccip/tutorials/ton/destination/token-transfers",
// chainTypes: ["ton"],
// },
{
title: "Arbitrary Messaging",
url: "ccip/tutorials/ton/destination/arbitrary-messaging",
chainTypes: ["ton"],
},
// {
// title: "Programmable Token Transfers",
// url: "ccip/tutorials/ton/destination/programmable-token-transfers",
// chainTypes: ["ton"],
// },
],
},
// {
// title: "Cross-Chain Token (CCT)",
// url: "ccip/tutorials/ton/cross-chain-tokens",
// chainTypes: ["ton"],
// },
],
},
{
Expand Down Expand Up @@ -689,6 +769,20 @@
},
],
},
// {
// title: "TON Modules Interface",
// url: "ccip/api-reference/ton",
// chainTypes: ["ton"],
// children: [
// {
// title: "v1.6.0",
// url: "ccip/api-reference/ton/v1.6.0",
// isCollapsible: true,
// chainTypes: ["ton"],
// children: tonCcipV160Contents,
// },
// ],
// },
{
title: "CCIP API, SDK & CLI",
url: "https://docs.chain.link/ccip/tools",
Expand Down
Loading
Loading