Connect, collaborate, and grow with a community of TypeScript developers
fix: initial quick accessibility fixes (#1679)
Josh Goldberg ✨033329d2cf6a
diff --git a/apps/aot/src/components/CountdownTimer.tsx b/apps/aot/src/components/CountdownTimer.tsxindex 52dd9727..38b45579 100644--- a/apps/aot/src/components/CountdownTimer.tsx+++ b/apps/aot/src/components/CountdownTimer.tsx@@ -21,6 +21,10 @@ const useAotCountdown = () => {}const countdown = () => {+ if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) {+ return;+ }+const newRemainingTime = Math.max(0, releaseDate.getTime() - Date.now());setRemainingTime(newRemainingTime);diff --git a/apps/aot/src/components/landing/Snowfall.tsx b/apps/aot/src/components/landing/Snowfall.tsxindex ac480982..daab1b18 100644--- a/apps/aot/src/components/landing/Snowfall.tsx+++ b/apps/aot/src/components/landing/Snowfall.tsx@@ -163,7 +163,7 @@ export default function Snowfall() {}, []);return (- <div className="pointer-events-none fixed left-0 top-0 z-0 h-full w-full">+ <div className="pointer-events-none fixed left-0 top-0 z-0 h-full w-full motion-reduce:hidden"><canvas ref={canvasRef} className="h-full w-full" /></div>);diff --git a/apps/aot/src/components/navigation/index.tsx b/apps/aot/src/components/navigation/index.tsxindex c79627eb..4ad16cff 100644--- a/apps/aot/src/components/navigation/index.tsx+++ b/apps/aot/src/components/navigation/index.tsx@@ -35,7 +35,7 @@ export async function Navigation() {<NavLinksWithYear /><NavLink href="/about">About</NavLink><Link- className="donate-btn relative w-fit overflow-hidden rounded-full px-4 py-2 text-black/50 duration-300 hover:bg-[#eed15f] md:hidden dark:text-white/80 dark:hover:bg-[#bea74b44]"+ className="donate-btn relative w-fit overflow-hidden rounded-full px-4 py-2 text-black/60 duration-300 hover:bg-[#eed15f] md:hidden dark:text-white/80 dark:hover:bg-[#bea74b44]"href="/support">Support Us@@ -43,19 +43,22 @@ export async function Navigation() {<Separator className="md:hidden dark:bg-white/20" /><NavLinkhref={DISCORD_INVITE_LINK}- className="flex flex-row items-center gap-2 text-black/40 md:hidden dark:text-white/60"+ className="flex flex-row items-center gap-2 text-black/40 dark:text-white/60"+ linkClassName="md:hidden"><span>Join us on Discord</span> <Discord className="h-4 w-4" /></NavLink><NavLinkhref={TWITTER_LINK}- className="flex flex-row items-center gap-2 text-black/40 md:hidden dark:text-white/60"+ className="flex flex-row items-center gap-2 text-black/40 dark:text-white/60"+ linkClassName="md:hidden"><span>Follow us on </span> <NewTwitter className="h-3.5 w-3.5" /></NavLink><NavLinkhref={GITHUB_LINK}- className="flex flex-row items-center gap-2 text-black/40 md:hidden dark:text-white/60"+ className="flex flex-row items-center gap-2 text-black/40 dark:text-white/60"+ linkClassName="md:hidden"><span>Contribute on </span> <Github className="h-3.5 w-3.5" /></NavLink>diff --git a/apps/aot/src/components/navigation/logo.tsx b/apps/aot/src/components/navigation/logo.tsxindex 0a025284..dfa828f6 100644--- a/apps/aot/src/components/navigation/logo.tsx+++ b/apps/aot/src/components/navigation/logo.tsx@@ -1,6 +1,12 @@export default function Logo() {return (- <svg className="h-6" viewBox="0 0 569 123" fill="none" xmlns="http://www.w3.org/2000/svg">+ <svg+ aria-label="advent<TS>"+ className="h-6"+ viewBox="0 0 569 123"+ fill="none"+ xmlns="http://www.w3.org/2000/svg"+ ><pathd="M66.6155 84.616C66.6155 86.536 66.9035 87.976 67.4795 88.936C68.0555 89.832 69.0475 90.504 70.4555 90.952L67.9595 98.248C62.6475 97.608 59.1595 95.272 57.4955 91.24C55.6395 93.544 53.3035 95.304 50.4875 96.52C47.7355 97.672 44.6955 98.248 41.3675 98.248C36.2475 98.248 32.1835 96.808 29.1755 93.928C26.1675 91.048 24.6635 87.24 24.6635 82.504C24.6635 77.192 26.7435 73.096 30.9035 70.216C35.1275 67.336 41.0795 65.896 48.7595 65.896H55.9595V62.632C55.9595 59.432 54.9995 57.096 53.0795 55.624C51.1595 54.152 48.3755 53.416 44.7275 53.416C42.9355 53.416 40.8555 53.64 38.4875 54.088C36.1195 54.536 33.7195 55.176 31.2875 56.008L28.5995 48.424C34.6795 46.12 40.5995 44.968 46.3595 44.968C53.0795 44.968 58.1355 46.44 61.5275 49.384C64.9195 52.328 66.6155 56.52 66.6155 61.96V84.616ZM44.5355 90.376C46.7755 90.376 48.9195 89.8 50.9675 88.648C53.0795 87.496 54.7435 85.896 55.9595 83.848V72.616H50.0075C45.1435 72.616 41.5915 73.448 39.3515 75.112C37.1115 76.712 35.9915 79.048 35.9915 82.12C35.9915 84.808 36.6955 86.856 38.1035 88.264C39.5755 89.672 41.7195 90.376 44.5355 90.376ZM121.106 25.96V97H111.602L110.834 90.76C109.17 93.192 107.122 95.048 104.69 96.328C102.258 97.608 99.57 98.248 96.626 98.248C90.29 98.248 85.522 95.88 82.322 91.144C79.122 86.408 77.522 79.912 77.522 71.656C77.522 66.472 78.322 61.864 79.922 57.832C81.586 53.8 83.922 50.664 86.93 48.424C89.938 46.12 93.49 44.968 97.586 44.968C102.77 44.968 107.026 46.824 110.354 50.536V24.712L121.106 25.96ZM100.37 53.224C96.658 53.224 93.81 54.76 91.826 57.832C89.906 60.84 88.946 65.448 88.946 71.656C88.946 83.944 92.466 90.088 99.506 90.088C103.73 90.088 107.346 87.656 110.354 82.792V58.888C107.73 55.112 104.402 53.224 100.37 53.224ZM159.853 97H147.373L129.421 46.312H141.037L153.805 88.072L166.765 46.312H177.805L159.853 97ZM195.047 75.112C195.367 80.04 196.775 83.752 199.271 86.248C201.831 88.68 205.031 89.896 208.871 89.896C211.239 89.896 213.479 89.544 215.591 88.84C217.767 88.072 219.975 86.952 222.215 85.48L226.823 92.008C224.455 93.992 221.671 95.528 218.471 96.616C215.271 97.704 211.911 98.248 208.391 98.248C200.647 98.248 194.631 95.848 190.343 91.048C186.055 86.184 183.911 79.72 183.911 71.656C183.911 66.6 184.839 62.056 186.695 58.024C188.551 53.928 191.239 50.728 194.759 48.424C198.279 46.12 202.375 44.968 207.047 44.968C213.767 44.968 219.079 47.24 222.983 51.784C226.951 56.264 228.935 62.44 228.935 70.312C228.935 72.232 228.839 73.832 228.647 75.112H195.047ZM207.143 52.936C203.687 52.936 200.871 54.184 198.695 56.68C196.519 59.176 195.271 62.888 194.951 67.816H218.471C218.343 63.016 217.319 59.336 215.399 56.776C213.479 54.216 210.727 52.936 207.143 52.936ZM238.882 46.312H248.194L248.962 52.936C251.074 50.376 253.538 48.424 256.354 47.08C259.234 45.672 262.242 44.968 265.378 44.968C270.05 44.968 273.57 46.28 275.938 48.904C278.306 51.528 279.49 55.24 279.49 60.04V97H268.738V65.416C268.738 62.28 268.546 59.88 268.162 58.216C267.842 56.488 267.17 55.24 266.146 54.472C265.122 53.64 263.586 53.224 261.538 53.224C259.234 53.224 257.026 53.928 254.914 55.336C252.866 56.744 251.106 58.504 249.634 60.616V97H238.882V46.312ZM333.98 94.312C332.06 95.528 329.82 96.488 327.26 97.192C324.7 97.896 322.012 98.248 319.196 98.248C313.436 98.248 308.988 96.776 305.852 93.832C302.716 90.824 301.148 86.76 301.148 81.64V54.184H289.916V46.312H301.148V34.984L311.9 33.736V46.312H329.084L327.836 54.184H311.9V81.544C311.9 84.296 312.604 86.344 314.012 87.688C315.42 88.968 317.66 89.608 320.732 89.608C324.124 89.608 327.26 88.808 330.14 87.208L333.98 94.312Z"className="fill-emerald-500 dark:fill-emerald-400"diff --git a/apps/aot/src/components/navigation/nav-link.tsx b/apps/aot/src/components/navigation/nav-link.tsxindex 3c95e5f9..a5f058d0 100644--- a/apps/aot/src/components/navigation/nav-link.tsx+++ b/apps/aot/src/components/navigation/nav-link.tsx@@ -8,17 +8,19 @@ export function NavLink({href,children,className,+ linkClassName,}: {href: string;className?: string;children: React.ReactNode;+ linkClassName?: string;}) {const pathname = usePathname();return (- <Link href={href}>+ <Link className={linkClassName} href={href}><divclassName={clsx(- 'rounded-full px-4 text-black/50 transition-colors duration-300 hover:text-black dark:text-white/80 dark:hover:text-yellow-400',+ 'rounded-full px-4 text-black/60 transition-colors duration-300 hover:text-black dark:text-white/80 dark:hover:text-yellow-400',{'!text-black dark:!text-white': pathname === href,},diff --git a/packages/ui/src/components/button.tsx b/packages/ui/src/components/button.tsxindex c0971aa9..a164c249 100644--- a/packages/ui/src/components/button.tsx+++ b/packages/ui/src/components/button.tsx@@ -5,13 +5,13 @@ import { cva, type VariantProps } from 'class-variance-authority';import { cn } from '../cn';const buttonVariants = cva(- 'inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',+ 'inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',{variants: {variant: {default: 'bg-primary text-primary-foreground hover:bg-primary/90',destructive: 'bg-destructive text-destructive-foreground hover:bg-destructive/90',- outline: 'border border-input hover:bg-accent hover:text-accent-foreground',+ outline: 'border border-input hover:bg-accent hover:text-accent-foreground focus:outline-2',secondary:'bg-secondary text-secondary-foreground hover:bg-secondary/80 dark:bg-zinc-700 dark:hover:bg-zinc-900',ghost: 'hover:bg-accent hover:text-accent-foreground dark:hover:bg-zinc-900',diff --git a/packages/ui/src/components/year-selector.tsx b/packages/ui/src/components/year-selector.tsxindex 1300cb8f..dd432669 100644--- a/packages/ui/src/components/year-selector.tsx+++ b/packages/ui/src/components/year-selector.tsx@@ -30,7 +30,10 @@ export const YearSelector = (props: {}) => {return (<Select.Root value={props.selectedYear} onValueChange={props.setSelectedYear}>- <Select.Trigger className="flex items-center justify-end gap-1 rounded-full px-1.5 text-black/50 duration-300 hover:bg-black/10 hover:text-black dark:text-white/80 dark:hover:bg-white/10 dark:hover:text-white">+ <Select.Trigger+ className="flex items-center justify-end gap-1 rounded-full px-1.5 text-black/60 duration-300 hover:bg-black/10 hover:text-black dark:text-white/80 dark:hover:bg-white/10 dark:hover:text-white"+ title="Select year"+ ><Select.Value>{YEAR_TO_SELECT_ITEMS_MAP[props.selectedYear]?.(props.showLive)}</Select.Value>diff --git a/packages/ui/src/icons/github.tsx b/packages/ui/src/icons/github.tsxindex 60175563..c4bafff1 100644--- a/packages/ui/src/icons/github.tsx+++ b/packages/ui/src/icons/github.tsx@@ -1,6 +1,7 @@export function Github({ className }: { className?: string }) {return (<svg+ aria-label="GitHub"role="img"viewBox="0 0 24 24"xmlns="http://www.w3.org/2000/svg"