-
-
Notifications
You must be signed in to change notification settings - Fork 253
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Conflicts: # docs/pages/docs/environments/actions-metadata-route-handlers.mdx # docs/pages/docs/routing/navigation.mdx # pnpm-lock.yaml
- Loading branch information
Showing
55 changed files
with
7,576 additions
and
7,221 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import {Button as HeadlessButton} from '@headlessui/react'; | ||
import type {ButtonProps} from '@headlessui/react'; | ||
import clsx from 'clsx'; | ||
import type {ReactElement} from 'react'; | ||
|
||
export default function Button({ | ||
className, | ||
variant = 'default', | ||
...props | ||
}: ButtonProps & { | ||
variant?: 'outline' | 'default'; | ||
}): ReactElement { | ||
return ( | ||
<HeadlessButton | ||
className={(args) => | ||
clsx( | ||
'transition', | ||
args.focus && 'nextra-focusable', | ||
variant === 'outline' && [ | ||
'border border-gray-300 dark:border-neutral-700', | ||
'rounded-md p-1.5' | ||
], | ||
typeof className === 'function' ? className(args) : className | ||
) | ||
} | ||
{...props} | ||
/> | ||
); | ||
} |
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,50 @@ | ||
import type {ComponentProps, ReactElement} from 'react'; | ||
import {useCallback, useEffect, useState} from 'react'; | ||
import Button from './Button'; | ||
import CheckIcon from './icons/CheckIcon'; | ||
import CopyIcon from './icons/CopyIcon'; | ||
|
||
export default function CopyToClipboard({ | ||
getValue, | ||
...props | ||
}: ComponentProps<typeof Button> & { | ||
getValue(): string; | ||
}): ReactElement { | ||
const [isCopied, setCopied] = useState(false); | ||
|
||
useEffect(() => { | ||
if (!isCopied) return; | ||
const timerId = setTimeout(() => { | ||
setCopied(false); | ||
}, 2000); | ||
|
||
return () => { | ||
clearTimeout(timerId); | ||
}; | ||
}, [isCopied]); | ||
|
||
const handleClick = useCallback(async () => { | ||
setCopied(true); | ||
if (!navigator?.clipboard) { | ||
console.error('Access to clipboard rejected!'); | ||
} | ||
try { | ||
await navigator.clipboard.writeText(getValue()); | ||
} catch { | ||
console.error('Failed to copy!'); | ||
} | ||
}, [getValue]); | ||
|
||
const IconToUse = isCopied ? CheckIcon : CopyIcon; | ||
|
||
return ( | ||
<Button | ||
onClick={handleClick} | ||
title="Copy code" | ||
variant="outline" | ||
{...props} | ||
> | ||
<IconToUse className="nextra-copy-icon" height="16" /> | ||
</Button> | ||
); | ||
} |
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,31 @@ | ||
@keyframes pulsate { | ||
0% { | ||
opacity: 0; | ||
} | ||
50% { | ||
opacity: 1; | ||
} | ||
100% { | ||
opacity: 0; | ||
} | ||
} | ||
|
||
.dot1 { | ||
animation: pulsate 4s infinite; | ||
} | ||
|
||
.dot2 { | ||
animation: pulsate 4s infinite 1s; | ||
} | ||
|
||
.dot3 { | ||
animation: pulsate 4s infinite 4s; | ||
} | ||
|
||
.dot4 { | ||
animation: pulsate 4s infinite 3s; | ||
} | ||
|
||
.dot5 { | ||
animation: pulsate 4s infinite 2s; | ||
} |
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,89 @@ | ||
import styles from './GetStartedBackground.module.css'; | ||
|
||
export default function GetStartedBackground() { | ||
const size = 530; | ||
const radius = 2; | ||
const className = | ||
'absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 w-screen'; | ||
const patternSize = 19; | ||
|
||
return ( | ||
<> | ||
<svg | ||
className={className} | ||
height={size} | ||
viewBox="0 0 500 500" | ||
width={size} | ||
xmlns="http://www.w3.org/2000/svg" | ||
> | ||
<defs> | ||
<pattern | ||
height={patternSize} | ||
id="dots" | ||
patternUnits="userSpaceOnUse" | ||
width={patternSize} | ||
> | ||
<circle cx="3" cy="3" fill="#D0D3E2" r={radius} /> | ||
</pattern> | ||
<radialGradient cx="50%" cy="50%" id="fade-out" r="50%"> | ||
<stop offset="0%" stopColor="white" stopOpacity="1" /> | ||
<stop offset="100%" stopColor="white" stopOpacity="0" /> | ||
</radialGradient> | ||
<mask id="fade-mask"> | ||
<rect fill="url(#fade-out)" height="500" width="500" /> | ||
</mask> | ||
</defs> | ||
<rect | ||
clipPath="url(#circle-clip)" | ||
fill="url(#dots)" | ||
height="500" | ||
mask="url(#fade-mask)" | ||
width="500" | ||
/> | ||
</svg> | ||
<svg | ||
className={className} | ||
height={size} | ||
viewBox="0 0 500 500" | ||
width={size} | ||
xmlns="http://www.w3.org/2000/svg" | ||
> | ||
<circle | ||
className={styles.dot1} | ||
cx="99" | ||
cy="155" | ||
fill="#7b42f6" | ||
r={radius} | ||
/> | ||
<circle | ||
className={styles.dot2} | ||
cx="193" | ||
cy="193" | ||
fill="#0284c7" | ||
r={radius} | ||
/> | ||
<circle | ||
className={styles.dot3} | ||
cx="307" | ||
cy="98" | ||
fill="#1E293C" | ||
r={radius} | ||
/> | ||
<circle | ||
className={styles.dot4} | ||
cx="250" | ||
cy="345" | ||
fill="#5c9eff" | ||
r={radius} | ||
/> | ||
<circle | ||
className={styles.dot5} | ||
cx="402" | ||
cy="250" | ||
fill="#7b42f6" | ||
r={radius} | ||
/> | ||
</svg> | ||
</> | ||
); | ||
} |
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
Oops, something went wrong.