chore: next 13

This commit is contained in:
iCrawl
2022-11-25 14:29:32 +01:00
parent d0c82561b8
commit 33a82b7bce
20 changed files with 252 additions and 223 deletions

View File

@@ -7,10 +7,13 @@ export function HyperlinkedText({ tokens }: { tokens: TokenDocumentation[] }) {
{tokens.map((token, idx) => {
if (token.path) {
return (
<Link href={token.path} key={idx} prefetch={false}>
<a className="text-blurple focus:ring-width-2 focus:ring-blurple rounded outline-0 focus:ring">
{token.text}
</a>
<Link
className="text-blurple focus:ring-width-2 focus:ring-blurple rounded outline-0 focus:ring"
href={token.path}
key={idx}
prefetch={false}
>
{token.text}
</Link>
);
}

View File

@@ -5,10 +5,12 @@ export function InheritanceText({ data }: { data: InheritanceData }) {
return (
<span className="font-semibold">
Inherited from{' '}
<Link href={data.path} prefetch={false}>
<a className="text-blurple focus:ring-width-2 focus:ring-blurple rounded font-mono outline-0 focus:ring">
{data.parentName}
</a>
<Link
className="text-blurple focus:ring-width-2 focus:ring-blurple rounded font-mono outline-0 focus:ring"
href={data.path}
prefetch={false}
>
{data.parentName}
</Link>
</span>
);

View File

@@ -82,23 +82,24 @@ export function SidebarItems({
.map((group, idx) => (
<Section icon={resolveIcon(group)} key={idx} title={group}>
{groupItems[group].map((member, index) => (
<Link href={member.path} key={index} prefetch={false}>
<a
className={`dark:border-dark-100 border-light-800 focus:ring-width-2 focus:ring-blurple ml-5 flex flex-col border-l p-[5px] pl-6 outline-0 focus:rounded focus:border-0 focus:ring ${
asPath === member.path
? 'bg-blurple text-white'
: 'dark:hover:bg-dark-200 dark:active:bg-dark-100 hover:bg-light-700 active:bg-light-800'
}`}
onClick={() => setOpened(false)}
title={member.name}
>
<div className="flex flex-row place-items-center gap-2 lg:text-sm">
<span className="truncate">{member.name}</span>
{member.overloadIndex && member.overloadIndex > 1 ? (
<span className="text-xs">{member.overloadIndex}</span>
) : null}
</div>
</a>
<Link
className={`dark:border-dark-100 border-light-800 focus:ring-width-2 focus:ring-blurple ml-5 flex flex-col border-l p-[5px] pl-6 outline-0 focus:rounded focus:border-0 focus:ring ${
asPath === member.path
? 'bg-blurple text-white'
: 'dark:hover:bg-dark-200 dark:active:bg-dark-100 hover:bg-light-700 active:bg-light-800'
}`}
href={member.path}
key={index}
onClick={() => setOpened(false)}
prefetch={false}
title={member.name}
>
<div className="flex flex-row place-items-center gap-2 lg:text-sm">
<span className="truncate">{member.name}</span>
{member.overloadIndex && member.overloadIndex > 1 ? (
<span className="text-xs">{member.overloadIndex}</span>
) : null}
</div>
</Link>
))}
</Section>

View File

@@ -1,7 +1,7 @@
import type { getMembers, ApiClassJSON, ApiInterfaceJSON } from '@discordjs/api-extractor-utils';
import { Button } from 'ariakit/button';
import { Menu, MenuButton, MenuItem, useMenuState } from 'ariakit/menu';
import Image from 'next/future/image';
import Image from 'next/image';
import Link from 'next/link';
import type { MDXRemoteSerializeResult } from 'next-mdx-remote';
import { useTheme } from 'next-themes';
@@ -89,7 +89,6 @@ export function SidebarLayout({
...PACKAGES.map((pkg) => (
<Link href={`/docs/packages/${pkg}/main`} key={pkg} passHref prefetch={false}>
<MenuItem
as="a"
className="hover:bg-light-700 active:bg-light-800 dark:bg-dark-600 dark:hover:bg-dark-500 dark:active:bg-dark-400 focus:ring-width-2 focus:ring-blurple my-0.5 rounded bg-white p-3 text-sm outline-0 focus:ring"
onClick={() => packageMenu.setOpen(false)}
state={packageMenu}
@@ -109,7 +108,6 @@ export function SidebarLayout({
?.map((item) => (
<Link href={`/docs/packages/${packageName}/${item}`} key={item} passHref prefetch={false}>
<MenuItem
as="a"
className="hover:bg-light-700 active:bg-light-800 dark:bg-dark-600 dark:hover:bg-dark-500 dark:active:bg-dark-400 focus:ring-width-2 focus:ring-blurple my-0.5 rounded bg-white p-3 text-sm outline-0 focus:ring"
onClick={() => versionMenu.setOpen(false)}
state={versionMenu}
@@ -129,8 +127,13 @@ export function SidebarLayout({
.split('/')
.slice(1)
.map((path, idx, original) => (
<Link href={`/${original.slice(0, idx + 1).join('/')}`} key={idx} prefetch={false}>
<a className="focus:ring-width-2 focus:ring-blurple rounded outline-0 hover:underline focus:ring">{path}</a>
<Link
className="focus:ring-width-2 focus:ring-blurple rounded outline-0 hover:underline focus:ring"
href={`/${original.slice(0, idx + 1).join('/')}`}
key={idx}
prefetch={false}
>
{path}
</Link>
)),
[asPathWithoutContainerKey],

View File

@@ -38,20 +38,26 @@ export function TSDoc({ node }: { node: AnyDocNodeJSON }): JSX.Element {
if (codeDestination) {
return (
<Link href={codeDestination.path} key={idx} prefetch={false}>
<a className="text-blurple focus:ring-width-2 focus:ring-blurple rounded font-mono outline-0 focus:ring">
{text ?? codeDestination.name}
</a>
<Link
className="text-blurple focus:ring-width-2 focus:ring-blurple rounded font-mono outline-0 focus:ring"
href={codeDestination.path}
key={idx}
prefetch={false}
>
{text ?? codeDestination.name}
</Link>
);
}
if (urlDestination) {
return (
<Link href={urlDestination} key={idx} prefetch={false}>
<a className="text-blurple focus:ring-width-2 focus:ring-blurple rounded font-mono outline-0 focus:ring">
{text ?? urlDestination}
</a>
<Link
className="text-blurple focus:ring-width-2 focus:ring-blurple rounded font-mono outline-0 focus:ring"
href={urlDestination}
key={idx}
prefetch={false}
>
{text ?? urlDestination}
</Link>
);
}