-
Notifications
You must be signed in to change notification settings - Fork 407
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update * update * update * update * update * update * update * update * token pool upgradability * cct token decimals * cct - OZ Access control * update tasks * cct hardhat guides update 1 * EOA Foundry * update * update * changelog * changelog * update * Foundry Pool Rate Limites guide * update * rollback OZ change * update * Apply suggestions from code review Co-authored-by: Crystal Gomes <thedriftofwords@users.noreply.github.com> * update * Foundry - maxSupply fix * update * update --------- Co-authored-by: Karim <98668332+khadni@users.noreply.github.com> Co-authored-by: Crystal Gomes <thedriftofwords@users.noreply.github.com>
- Loading branch information
1 parent
7382360
commit c91c244
Showing
98 changed files
with
6,173 additions
and
1,400 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.24; | ||
|
||
// solhint-disable no-unused-import | ||
import {BurnMintERC677} from "@chainlink/contracts-ccip/src/v0.8/shared/token/ERC677/BurnMintERC677.sol"; |
144 changes: 144 additions & 0 deletions
144
src/components/CCIP/VersionSelector/VersionSelector.module.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
.versionSelector { | ||
--select-height: 2.5rem; | ||
--select-padding: 0.75rem; | ||
--border-radius: var(--border-radius-primary, 6px); | ||
|
||
margin: clamp(1rem, 2vw, 1.5rem) 0; | ||
padding: clamp(1rem, 2vw, 1.5rem); | ||
border-bottom: 1px solid var(--theme-divider); | ||
transition: all 0.2s ease; | ||
} | ||
|
||
.selectWrapper { | ||
display: flex; | ||
align-items: center; | ||
gap: 1rem; | ||
flex-wrap: wrap; | ||
} | ||
|
||
.label { | ||
font-weight: 600; | ||
font-size: clamp(0.875rem, 1.5vw, 1rem); | ||
color: var(--theme-text); | ||
white-space: nowrap; | ||
} | ||
|
||
.selectContainer { | ||
position: relative; | ||
min-width: 150px; | ||
flex: 1; | ||
max-width: 300px; | ||
} | ||
|
||
.select { | ||
appearance: none; | ||
width: 100%; | ||
height: var(--select-height); | ||
padding: 0 var(--select-padding); | ||
padding-right: calc(var(--select-padding) * 2.5); | ||
border: 2px solid var(--blue-600); | ||
border-radius: var(--border-radius); | ||
background: var(--theme-bg); | ||
color: var(--theme-text); | ||
font-size: clamp(0.875rem, 1.5vw, 1rem); | ||
cursor: pointer; | ||
transition: all 0.2s ease; | ||
} | ||
|
||
.select:hover { | ||
background-color: var(--blue-600); | ||
color: var(--white); | ||
} | ||
|
||
.select:focus { | ||
outline: none; | ||
border-color: var(--blue-600); | ||
box-shadow: 0 0 0 3px hsla(var(--color-blue), var(--theme-accent-opacity)); | ||
} | ||
|
||
.selectIcon { | ||
position: absolute; | ||
right: var(--select-padding); | ||
top: 50%; | ||
transform: translateY(-50%); | ||
width: 10px; | ||
height: 10px; | ||
border: 2px solid var(--theme-text); | ||
border-left: 0; | ||
border-top: 0; | ||
pointer-events: none; | ||
transform: translateY(-75%) rotate(45deg); | ||
} | ||
|
||
.warning { | ||
margin-top: 1rem; | ||
padding: clamp(0.75rem, 2vw, 1rem); | ||
background: #fff3cd; | ||
border: 1px solid #ffeeba; | ||
border-radius: var(--border-radius); | ||
display: flex; | ||
align-items: flex-start; | ||
gap: 0.75rem; | ||
animation: slideIn 0.3s ease; | ||
} | ||
|
||
.warningIcon { | ||
flex-shrink: 0; | ||
width: 20px; | ||
height: 20px; | ||
background: #856404; | ||
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2L1 21h22L12 2zm0 3.99L19.53 19H4.47L12 5.99zM11 16h2v2h-2zm0-6h2v4h-2z'/%3E%3C/svg%3E") | ||
center/contain no-repeat; | ||
} | ||
|
||
.warningText { | ||
margin: 0; | ||
font-size: clamp(0.813rem, 1.5vw, 0.938rem); | ||
line-height: 1.5; | ||
color: #856404; | ||
} | ||
|
||
.warningLink { | ||
color: #664d03; | ||
text-decoration: underline; | ||
font-weight: 500; | ||
transition: all 0.2s ease; | ||
} | ||
|
||
.warningLink:hover { | ||
color: #533d02; | ||
text-decoration: none; | ||
} | ||
|
||
/* Responsive adjustments */ | ||
@media (max-width: 480px) { | ||
.selectWrapper { | ||
flex-direction: column; | ||
align-items: flex-start; | ||
gap: 0.5rem; | ||
} | ||
|
||
.selectContainer { | ||
width: 100%; | ||
max-width: none; | ||
} | ||
} | ||
|
||
/* Animation */ | ||
@keyframes slideIn { | ||
from { | ||
opacity: 0; | ||
transform: translateY(-10px); | ||
} | ||
to { | ||
opacity: 1; | ||
transform: translateY(0); | ||
} | ||
} | ||
|
||
/* Focus visible polyfill */ | ||
.select:focus-visible { | ||
outline: none; | ||
border-color: var(--blue-600); | ||
box-shadow: 0 0 0 3px hsla(var(--color-blue), var(--theme-accent-opacity)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import { CCIP_VERSIONS, type CCIPVersion } from "@config/versions/ccip" | ||
import styles from "./VersionSelector.module.css" | ||
|
||
type VersionSelectorProps = { | ||
currentVersion: CCIPVersion | ||
currentPath: string | ||
} | ||
|
||
export const VersionSelector = ({ currentVersion, currentPath }: VersionSelectorProps): JSX.Element => { | ||
const pathAfterVersion = currentPath.split(currentVersion)[1] ?? "" | ||
|
||
const handleVersionChange = (newVersion: CCIPVersion): void => { | ||
const newPath = `/ccip/api-reference/${newVersion}${pathAfterVersion}` | ||
window.location.href = newPath | ||
} | ||
|
||
if (!CCIP_VERSIONS.ALL.includes(currentVersion)) { | ||
console.warn(`Invalid version ${currentVersion} provided to VersionSelector`) | ||
} | ||
|
||
return ( | ||
<div className={styles.versionSelector} role="region" aria-label="API Version Selector"> | ||
<div className={styles.selectWrapper}> | ||
<label htmlFor="version-select" className={styles.label}> | ||
API Version: | ||
</label> | ||
<div className={styles.selectContainer}> | ||
<select | ||
id="version-select" | ||
value={currentVersion} | ||
onChange={({ target: { value } }) => handleVersionChange(value as CCIPVersion)} | ||
className={styles.select} | ||
aria-label="Select API Version" | ||
> | ||
{CCIP_VERSIONS.ALL.map((version) => ( | ||
<option | ||
key={version} | ||
value={version} | ||
aria-label={`${version}${version === CCIP_VERSIONS.LATEST ? " - Latest Version" : ""}`} | ||
> | ||
{`${version}${version === CCIP_VERSIONS.LATEST ? " (Latest)" : ""}`} | ||
</option> | ||
))} | ||
</select> | ||
<span className={styles.selectIcon} aria-hidden="true" /> | ||
</div> | ||
</div> | ||
|
||
{currentVersion !== CCIP_VERSIONS.LATEST && ( | ||
<div className={styles.warning} role="alert" aria-live="polite"> | ||
<span className={styles.warningIcon} aria-hidden="true" /> | ||
<p className={styles.warningText}> | ||
You are viewing documentation for {currentVersion}.{" "} | ||
<a href={`/ccip/api-reference/${CCIP_VERSIONS.LATEST}${pathAfterVersion}`} className={styles.warningLink}> | ||
Switch to latest ({CCIP_VERSIONS.LATEST}) | ||
</a> | ||
</p> | ||
</div> | ||
)} | ||
</div> | ||
) | ||
} |
Oops, something went wrong.