Skip to content

Commit a6d6bf4

Browse files
committed
Add CCIP TON
1 parent b38a4f3 commit a6d6bf4

File tree

27 files changed

+3998
-867
lines changed

27 files changed

+3998
-867
lines changed

package-lock.json

Lines changed: 175 additions & 859 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
.card {
2+
display: flex;
3+
align-items: center;
4+
gap: var(--space-3x);
5+
padding: var(--space-4x);
6+
min-height: 96px;
7+
border-radius: 10px;
8+
border: 1px solid var(--color-border-primary);
9+
background: var(--color-background-primary);
10+
color: var(--color-text-primary);
11+
text-decoration: none;
12+
transition:
13+
background-color 0.2s ease,
14+
border-color 0.2s ease,
15+
box-shadow 0.2s ease,
16+
transform 0.2s ease;
17+
}
18+
19+
.card:hover {
20+
background: var(--theme-bg-hover);
21+
border-color: var(--gray-300);
22+
box-shadow:
23+
0 2px 6px rgba(0, 0, 0, 0.06),
24+
0 6px 20px rgba(0, 0, 0, 0.04);
25+
transform: translateY(-1px);
26+
}
27+
28+
.card:focus-visible {
29+
outline: 2px solid var(--theme-accent);
30+
outline-offset: 2px;
31+
}
32+
33+
.icon {
34+
flex-shrink: 0;
35+
width: 44px;
36+
height: 44px;
37+
border-radius: 999px;
38+
border: 1px solid var(--gray-200);
39+
background: var(--gray-50);
40+
display: flex;
41+
align-items: center;
42+
justify-content: center;
43+
}
44+
45+
.icon > :global(svg),
46+
.icon > :global(img) {
47+
width: 22px;
48+
height: 22px;
49+
display: block;
50+
}
51+
52+
.icon > :global(img) {
53+
border-radius: 999px;
54+
}
55+
56+
.content {
57+
flex: 1;
58+
min-width: 0;
59+
display: flex;
60+
flex-direction: column;
61+
gap: var(--space-1x);
62+
}
63+
64+
.title {
65+
font-size: 16px;
66+
font-weight: var(--font-weight-medium);
67+
color: var(--color-text-heading);
68+
line-height: 1.4;
69+
padding-bottom: 1px;
70+
white-space: nowrap;
71+
overflow: hidden;
72+
text-overflow: ellipsis;
73+
}
74+
75+
.description {
76+
font-size: 14px;
77+
color: var(--color-text-secondary);
78+
line-height: 1.4;
79+
padding-bottom: 1px;
80+
}
81+
82+
.arrow {
83+
flex-shrink: 0;
84+
color: var(--color-text-secondary);
85+
transition:
86+
transform 0.15s ease,
87+
color 0.15s ease;
88+
}
89+
90+
.card:hover .arrow,
91+
.card:focus-visible .arrow {
92+
transform: translateX(3px);
93+
color: var(--color-text-primary);
94+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import type { ReactNode } from "react"
2+
import styles from "./GitHubCard.module.css"
3+
import { clsx } from "~/lib/clsx/clsx.ts"
4+
import { cardIcons, type CardIconName } from "./icons/index.js"
5+
6+
type GitHubCardProps = {
7+
title: string
8+
href: string
9+
icon?: ReactNode
10+
iconName?: CardIconName | string
11+
children?: ReactNode
12+
className?: string
13+
} & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, "href" | "className">
14+
15+
export function GitHubCard({ title, href, icon, iconName, children, className, ...props }: GitHubCardProps) {
16+
const iconFromName = iconName ? cardIcons[iconName as CardIconName] : undefined
17+
const resolvedIcon = icon ?? (iconFromName ? <img src={iconFromName.src} alt="" aria-hidden="true" /> : null)
18+
19+
return (
20+
<a href={href} className={clsx(styles.card, className)} {...props}>
21+
{resolvedIcon ? <span className={styles.icon}>{resolvedIcon}</span> : null}
22+
<span className={styles.content}>
23+
<span className={styles.title} title={title}>
24+
{title}
25+
</span>
26+
{children ? <span className={styles.description}>{children}</span> : null}
27+
</span>
28+
<span className={styles.arrow} aria-hidden="true">
29+
30+
</span>
31+
</a>
32+
)
33+
}
Lines changed: 2 additions & 0 deletions
Loading
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import githubSvgCard from "./github-svg-card.svg"
2+
3+
export const cardIcons = {
4+
"github-svg-card": githubSvgCard,
5+
} as const
6+
7+
export type CardIconName = keyof typeof cardIcons
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export { GitHubCard } from "./GitHubCard.tsx"
2+
export { cardIcons } from "./icons/index.js"
3+
export type { CardIconName } from "./icons/index.js"

src/components/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ export { default as SideBySideCode } from "./SideBySideCode/SideBySideCode.astro
2222
export { default as CodeHighlightBlock } from "./CodeHighlightBlock/CodeHighlightBlock.astro"
2323
export { default as CodeHighlightBlockMulti } from "./CodeHighlightBlockMulti/CodeHighlightBlockMulti.astro"
2424
export { Callout } from "./Callout/Callout.tsx"
25+
export { GitHubCard } from "./github-card/index.ts"

src/config/chainTypes.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ export const CHAIN_TYPE_CONFIGS: Record<ChainType, ChainTypeConfig> = {
8484

8585
/**
8686
* Chain types supported in CCIP
87-
* Currently: EVM, Solana, Aptos
87+
* Currently: EVM, Solana, Aptos, TON
8888
*/
89-
export const CCIP_SUPPORTED_CHAINS: ChainType[] = ["evm", "solana", "aptos"]
89+
export const CCIP_SUPPORTED_CHAINS: ChainType[] = ["evm", "solana", "aptos", "ton"]
9090

9191
/**
9292
* Sections that support chain type filtering (OPT-IN)

src/config/sidebar/__tests__/__snapshots__/ccip-dynamic.test.ts.snap

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,73 @@ exports[`CCIP Sidebar Configuration Snapshot should match the expected sidebar s
694694
"title": "Cross-Chain Token (CCT)",
695695
"url": "ccip/tutorials/aptos/cross-chain-tokens",
696696
},
697+
{
698+
"chainTypes": [
699+
"ton",
700+
],
701+
"title": "Implement CCIP Receiver",
702+
"url": "ccip/tutorials/ton/receivers",
703+
},
704+
{
705+
"chainTypes": [
706+
"ton",
707+
],
708+
"children": [
709+
{
710+
"chainTypes": [
711+
"ton",
712+
],
713+
"title": "Build CCIP Messages",
714+
"url": "ccip/tutorials/ton/source/build-messages",
715+
},
716+
{
717+
"chainTypes": [
718+
"ton",
719+
],
720+
"title": "Prerequisites",
721+
"url": "ccip/tutorials/ton/source/prerequisites",
722+
},
723+
{
724+
"chainTypes": [
725+
"ton",
726+
],
727+
"title": "Arbitrary Messaging",
728+
"url": "ccip/tutorials/ton/source/arbitrary-messaging",
729+
},
730+
],
731+
"title": "Source",
732+
"url": "ccip/tutorials/ton/source",
733+
},
734+
{
735+
"chainTypes": [
736+
"ton",
737+
],
738+
"children": [
739+
{
740+
"chainTypes": [
741+
"ton",
742+
],
743+
"title": "Build CCIP Messages",
744+
"url": "ccip/tutorials/ton/destination/build-messages",
745+
},
746+
{
747+
"chainTypes": [
748+
"ton",
749+
],
750+
"title": "Prerequisites",
751+
"url": "ccip/tutorials/ton/destination/prerequisites",
752+
},
753+
{
754+
"chainTypes": [
755+
"ton",
756+
],
757+
"title": "Arbitrary Messaging",
758+
"url": "ccip/tutorials/ton/destination/arbitrary-messaging",
759+
},
760+
],
761+
"title": "Destination",
762+
"url": "ccip/tutorials/ton/destination",
763+
},
697764
],
698765
"section": "Tutorials",
699766
},

0 commit comments

Comments
 (0)