Skip to content

Connect, collaborate, and grow with a community of TypeScript developers

Feat/a11y focus and focus visible states (#388)

laureanraya40e2ebac477
diff --git a/apps/web/src/app/challenge/[id]/solutions/_components/solution-editor.tsx b/apps/web/src/app/challenge/[id]/solutions/_components/solution-editor.tsx
index 94fe0c62..9651b99f 100644
--- a/apps/web/src/app/challenge/[id]/solutions/_components/solution-editor.tsx
+++ b/apps/web/src/app/challenge/[id]/solutions/_components/solution-editor.tsx
@@ -98,7 +98,7 @@ export function SolutionEditor({ dismiss, challenge }: Props) {
<FormItem>
<FormControl>
<Input
- className="rounded-xl border-zinc-300 bg-zinc-100 focus-visible:ring-0 focus-visible:ring-offset-0 dark:border-zinc-700 dark:bg-zinc-900"
+ className="rounded-xl border-zinc-300 bg-zinc-100 focus-visible:ring-0 dark:border-zinc-700 dark:bg-zinc-900"
{...field}
placeholder="Enter a title for your solution."
/>
@@ -109,7 +109,7 @@ export function SolutionEditor({ dismiss, challenge }: Props) {
/>
</div>
<Button
- className="h-8 rounded-lg bg-white px-3 py-2 text-black hover:bg-zinc-200 focus-visible:bg-zinc-200 focus-visible:ring-offset-0 dark:bg-zinc-800 dark:text-zinc-300 dark:hover:bg-zinc-700 dark:focus-visible:bg-zinc-700"
+ className="h-8 rounded-lg bg-white px-3 py-2 text-black hover:bg-zinc-200 focus-visible:bg-zinc-200 dark:bg-zinc-800 dark:text-zinc-300 dark:hover:bg-zinc-700 dark:focus-visible:bg-zinc-700"
onClick={dismiss}
type="button"
>
diff --git a/apps/web/src/app/challenge/_components/comments/comment-input.tsx b/apps/web/src/app/challenge/_components/comments/comment-input.tsx
index 40271976..683ccb3e 100644
--- a/apps/web/src/app/challenge/_components/comments/comment-input.tsx
+++ b/apps/web/src/app/challenge/_components/comments/comment-input.tsx
@@ -50,7 +50,7 @@ export function CommentInput({ mode, onCancel, onChange, value, placeholder, onS
{commentMode === 'editor' && (
<Textarea
autoFocus
- className="resize-none border-0 px-3 py-2 focus-visible:ring-0 focus-visible:ring-offset-0 md:max-h-[calc(100vh_-_232px)]"
+ className="resize-none border-0 px-3 py-2 focus-visible:ring-0 md:max-h-[calc(100vh_-_232px)]"
onChange={(e) => onChange(e.target.value)}
onKeyDown={handleEnterKey}
placeholder={placeholder ?? 'Enter your comment here.'}
diff --git a/apps/web/src/app/challenge/_components/description/index.tsx b/apps/web/src/app/challenge/_components/description/index.tsx
index 3eaed45a..32a1dd7e 100644
--- a/apps/web/src/app/challenge/_components/description/index.tsx
+++ b/apps/web/src/app/challenge/_components/description/index.tsx
@@ -88,11 +88,14 @@ export function Description({ challenge }: Props) {
<div className="mt-3 flex items-center gap-3">
<DifficultyBadge difficulty={challenge.difficulty} />
<Dialog>
- <DialogTrigger>
+ <DialogTrigger tabIndex={-1}>
<Tooltip>
<TooltipTrigger asChild>
- <button className="group flex h-6 items-center rounded-full bg-zinc-200 px-3 dark:bg-zinc-700">
- <Share className="h-4 w-4 stroke-zinc-500 group-hover:stroke-zinc-600 dark:stroke-zinc-300 group-hover:dark:stroke-zinc-100" />
+ <button className="group flex h-6 items-center rounded-full bg-zinc-200 px-3 focus:outline-none focus-visible:ring-2 dark:bg-zinc-700">
+ <Share
+ className="h-4 w-4 stroke-zinc-500 group-hover:stroke-zinc-600 dark:stroke-zinc-300 group-hover:dark:stroke-zinc-100"
+ tabIndex={-1}
+ />
</button>
</TooltipTrigger>
<TooltipContent>
@@ -112,7 +115,7 @@ export function Description({ challenge }: Props) {
<Tooltip>
<TooltipTrigger asChild>
<button
- className="group flex h-6 items-center rounded-full bg-zinc-200 px-3 disabled:cursor-not-allowed disabled:bg-zinc-100 dark:bg-zinc-700 disabled:dark:bg-zinc-700/50"
+ className="group flex h-6 items-center rounded-full bg-zinc-200 px-3 focus:outline-none focus-visible:ring-2 disabled:cursor-not-allowed disabled:bg-zinc-100 dark:bg-zinc-700 disabled:dark:bg-zinc-700/50"
disabled={!session.data?.user.id}
onClick={() => {
let shouldBookmark = false;
diff --git a/apps/web/src/app/challenge/_components/fullscreen.tsx b/apps/web/src/app/challenge/_components/fullscreen.tsx
index c352adde..f9ebd8de 100644
--- a/apps/web/src/app/challenge/_components/fullscreen.tsx
+++ b/apps/web/src/app/challenge/_components/fullscreen.tsx
@@ -5,7 +5,7 @@ export function FullscreenButton() {
return (
<Tooltip>
<TooltipTrigger asChild>
- <button>
+ <button className="focus:outline-none focus-visible:ring-2">
<Maximize2 className="stroke-zinc-500 stroke-1 hover:stroke-zinc-400" size={20} />
</button>
</TooltipTrigger>
diff --git a/apps/web/src/app/challenge/_components/reset-editor-button.tsx b/apps/web/src/app/challenge/_components/reset-editor-button.tsx
index 90f61a64..2aeff3f8 100644
--- a/apps/web/src/app/challenge/_components/reset-editor-button.tsx
+++ b/apps/web/src/app/challenge/_components/reset-editor-button.tsx
@@ -5,7 +5,7 @@ export function ResetEditorButton() {
return (
<Tooltip>
<TooltipTrigger asChild>
- <button>
+ <button className="focus:outline-none focus-visible:ring-2">
<RotateCcw className="stroke-zinc-500 stroke-1 hover:stroke-zinc-400" size={20} />
</button>
</TooltipTrigger>
diff --git a/apps/web/src/app/challenge/_components/settings/settings-button.tsx b/apps/web/src/app/challenge/_components/settings/settings-button.tsx
index 2aaefc8b..7b75fc0c 100644
--- a/apps/web/src/app/challenge/_components/settings/settings-button.tsx
+++ b/apps/web/src/app/challenge/_components/settings/settings-button.tsx
@@ -14,10 +14,15 @@ import { SettingsForm } from './settings-form';
export function SettingsButton() {
return (
<Dialog>
- <DialogTrigger>
+ <DialogTrigger tabIndex={-1} className="focus:outline-none focus-visible:ring-0">
<Tooltip>
<TooltipTrigger asChild>
- <Settings className="stroke-zinc-500 stroke-1 hover:stroke-zinc-400" size={20} />
+ <button className="items-centerdark:bg-zinc-700 group flex focus:outline-none focus-visible:ring-2">
+ <Settings
+ className="stroke-zinc-500 stroke-1 hover:stroke-zinc-400 focus:outline-none focus-visible:ring-0"
+ size={20}
+ />
+ </button>
</TooltipTrigger>
<TooltipContent className="px-2 py-1">Settings</TooltipContent>
</Tooltip>
diff --git a/apps/web/src/app/challenge/_components/vote.tsx b/apps/web/src/app/challenge/_components/vote.tsx
index 311d17e6..36d2a1c7 100644
--- a/apps/web/src/app/challenge/_components/vote.tsx
+++ b/apps/web/src/app/challenge/_components/vote.tsx
@@ -40,7 +40,7 @@ export function Vote({
<Tooltip>
<TooltipTrigger asChild>
<button
- className="group flex h-6 items-center gap-1 rounded-full bg-zinc-200 pl-[0.675rem] pr-2 text-sm disabled:cursor-not-allowed disabled:bg-zinc-100 dark:bg-zinc-700 disabled:dark:bg-zinc-700/50"
+ className="group flex h-6 items-center gap-1 rounded-full bg-zinc-200 pl-[0.675rem] pr-2 text-sm focus:outline-none focus-visible:ring-2 disabled:cursor-not-allowed disabled:bg-zinc-100 dark:bg-zinc-700 disabled:dark:bg-zinc-700/50"
disabled={disabled}
onClick={() => {
let shouldIncrement = false;
diff --git a/apps/web/src/components/ReportDialog/index.tsx b/apps/web/src/components/ReportDialog/index.tsx
index a7a98222..b8d36536 100644
--- a/apps/web/src/components/ReportDialog/index.tsx
+++ b/apps/web/src/components/ReportDialog/index.tsx
@@ -103,7 +103,9 @@ export function ReportDialog({
}}
open={show}
>
- <DialogTrigger asChild={triggerAsChild}>{children}</DialogTrigger>
+ <DialogTrigger asChild={triggerAsChild} className="focus:outline-none focus-visible:ring-2">
+ {children}
+ </DialogTrigger>
<DialogContent>
<form
onSubmit={handleSubmit(async (e) => {
diff --git a/apps/web/src/components/landing/community/community.tsx b/apps/web/src/components/landing/community/community.tsx
index 3c7faba3..942449de 100644
--- a/apps/web/src/components/landing/community/community.tsx
+++ b/apps/web/src/components/landing/community/community.tsx
@@ -99,14 +99,14 @@ function Community() {
<div className="honeycomboverride mx-auto flex w-[18.25rem] flex-wrap gap-x-3 gap-y-1 sm:w-[23rem] xl:w-[27.75rem] xl:[&>*:nth-child(11n_+_1)]:ml-[2.375rem] [&>*:nth-child(7n_+_1)]:ml-[2.375rem] sm:[&>*:nth-child(7n_+_1)]:ml-0 sm:[&>*:nth-child(9n_+_1)]:ml-[2.375rem] xl:[&>*:nth-child(9n_+_1)]:ml-0">
{contributors.map((contributor) => (
<a
- className="group rounded-full duration-300 hover:scale-125 active:scale-105 active:duration-100"
+ className="group rounded-full duration-300 hover:scale-125 focus:outline-none focus:duration-0 focus-visible:ring-0 active:scale-105 active:duration-100"
href={contributor.html_url}
key={contributor.id}
rel="noopener"
target="_blank"
>
<Image
- className="honeycombchild h-16 w-16 rounded-3xl bg-cover duration-300 group-hover:rounded-[2rem] group-active:rounded-3xl group-active:duration-100"
+ className="honeycombchild h-16 w-16 rounded-3xl bg-cover duration-300 group-hover:rounded-[2rem] group-focus:outline-none group-focus:duration-0 group-focus-visible:ring-2 group-active:rounded-3xl group-active:duration-100"
src={contributor.avatar_url}
width={64}
height={64}
diff --git a/apps/web/src/components/landing/features.tsx b/apps/web/src/components/landing/features.tsx
index ee4549ee..4f29d75b 100644
--- a/apps/web/src/components/landing/features.tsx
+++ b/apps/web/src/components/landing/features.tsx
@@ -26,9 +26,9 @@ function Features() {
<section className="relative overflow-hidden" id="features">
<div className="container mb-[64px] grid items-center justify-center">
<div className="flex flex-col items-center justify-center gap-16">
- <div className="flex flex-col gap-3 px-4 text-center sm:px-0">
+ <div className="mt-1 flex flex-col gap-3 px-4 text-center sm:px-0">
<a
- className="mx-auto hidden rounded-full bg-gradient-to-r from-[#31bdc6] to-[#3178c6] p-[1px] brightness-90 contrast-150 dark:brightness-125 dark:contrast-100 sm:block"
+ className="mx-auto hidden rounded-full bg-gradient-to-r from-[#31bdc6] to-[#3178c6] p-[1px] brightness-90 contrast-150 focus:outline-none focus:ring-blue-600 focus-visible:ring-2 dark:brightness-125 dark:contrast-100 sm:block"
href="#features"
>
<div className="rounded-full bg-white/80 px-3 py-1 dark:bg-black/80">
diff --git a/apps/web/src/components/ui/carousel.tsx b/apps/web/src/components/ui/carousel.tsx
index b4f95504..7a0ed07f 100644
--- a/apps/web/src/components/ui/carousel.tsx
+++ b/apps/web/src/components/ui/carousel.tsx
@@ -73,13 +73,13 @@ export function Carousel({ children }: Props) {
>
{children}
<button
- className="absolute right-5 top-1/2 hidden -translate-y-1/2 rounded-[5rem] border border-neutral-400 bg-neutral-200/50 px-2 py-4 backdrop-blur-sm duration-300 active:scale-75 dark:border-neutral-600 dark:bg-neutral-700/50 sm:block"
+ className="absolute right-5 top-1/2 hidden -translate-y-1/2 rounded-[5rem] border border-neutral-400 bg-neutral-200/50 px-2 py-4 backdrop-blur-sm duration-300 focus:outline-none focus-visible:ring-2 active:scale-75 dark:border-neutral-600 dark:bg-neutral-700/50 sm:block"
id="slideRight"
>
<ChevronRight className="h-4 w-4 stroke-[3]" />
</button>
<button
- className="absolute left-5 top-1/2 hidden -translate-y-1/2 rounded-[5rem] border border-neutral-400 bg-neutral-200/50 px-2 py-4 backdrop-blur-sm duration-300 active:scale-75 dark:border-neutral-600 dark:bg-neutral-700/50 sm:block"
+ className="absolute left-5 top-1/2 hidden -translate-y-1/2 rounded-[5rem] border border-neutral-400 bg-neutral-200/50 px-2 py-4 backdrop-blur-sm duration-300 focus:outline-none focus-visible:ring-2 active:scale-75 dark:border-neutral-600 dark:bg-neutral-700/50 sm:block"
id="slideLeft"
>
<ChevronRight className="h-4 w-4 rotate-180 transform stroke-[3]" />
diff --git a/apps/web/src/components/ui/navigation.tsx b/apps/web/src/components/ui/navigation.tsx
index 1823388c..d10a10e7 100644
--- a/apps/web/src/components/ui/navigation.tsx
+++ b/apps/web/src/components/ui/navigation.tsx
@@ -40,7 +40,10 @@ export function Navigation() {
>
<div className="flex w-full items-center justify-between">
<div className="relative flex items-center gap-3">
- <a className="flex items-center space-x-2 duration-300" href="/">
+ <a
+ className="flex items-center space-x-2 focus:outline-none focus-visible:ring-2"
+ href="/"
+ >
<svg
className="h-8 w-8 rounded-md bg-[#3178C6] p-[2px]"
viewBox="0 0 512 512"
@@ -75,17 +78,16 @@ export function Navigation() {
hero
</span>
</a>
-
{featureFlags?.exploreButton ? (
- <Link href="/explore">
- <div className="hover:text-foreground text-foreground/80 ml-4 transition-colors">
+ <Link href="/explore" className="ml-4">
+ <div className="hover:text-foreground text-foreground/80 transition-colors">
Explore
</div>
</Link>
) : null}
{featureFlags?.tracksButton ? (
- <Link href="/tracks">
- <div className="hover:text-foreground text-foreground/80 ml-4 transition-colors">
+ <Link href="/tracks" className="ml-4">
+ <div className="hover:text-foreground text-foreground/80 transition-colors">
Tracks
</div>
</Link>
@@ -115,7 +117,7 @@ function ThemeButton() {
<>
{mounted ? (
<button
- className="focus:bg-accent rounded-lg p-2 duration-300 focus:outline-none"
+ className="focus:bg-accent rounded-lg p-2 duration-300 focus:outline-none focus-visible:ring-2"
onClick={() => {
setTheme(resolvedTheme === 'dark' ? 'light' : 'dark');
}}
@@ -157,7 +159,7 @@ function LoginButton() {
return session ? (
<DropdownMenu>
<DropdownMenuTrigger asChild>
- <button className="focus:bg-accent rounded-lg p-2 duration-300 focus:outline-none">
+ <button className="focus:bg-accent rounded-lg p-2 duration-300 focus:outline-none focus-visible:ring-2">
<User className="h-5 w-5" />
</button>
</DropdownMenuTrigger>
diff --git a/apps/web/src/components/user/dashboard/index.tsx b/apps/web/src/components/user/dashboard/index.tsx
index d45f63fb..4b119190 100644
--- a/apps/web/src/components/user/dashboard/index.tsx
+++ b/apps/web/src/components/user/dashboard/index.tsx
@@ -89,7 +89,7 @@ export default async function Dashboard({ user }: Props) {
</div>
<div>
{session?.user.id === user.id && (
- <Link href="/settings">
+ <Link href="/settings" className="focus:outline-none focus-visible:outline-none">
<Button variant="outline">Edit Profile</Button>
</Link>
)}
diff --git a/apps/web/src/components/wizard/Steps.tsx b/apps/web/src/components/wizard/Steps.tsx
index 027f493a..9cadb98f 100644
--- a/apps/web/src/components/wizard/Steps.tsx
+++ b/apps/web/src/components/wizard/Steps.tsx
@@ -30,7 +30,7 @@ export function Steps<T extends Step>({ steps, current, onChange }: Props<T>) {
>
<div
className={clsx(
- 'group flex w-full cursor-pointer items-center',
+ 'group flex w-full cursor-pointer items-center focus:outline-none focus-visible:ring-2',
(isFuture || isCurrent) && 'pointer-events-none',
)}
onClick={() => onChange(stepIdx)}
diff --git a/apps/web/src/styles/globals.css b/apps/web/src/styles/globals.css
index db329a50..c00fcf8b 100644
--- a/apps/web/src/styles/globals.css
+++ b/apps/web/src/styles/globals.css
@@ -383,3 +383,11 @@ main {
transform: translateY(0px);
}
}
+
+* {
+ @apply focus:ring-blue-600 group-focus:ring-blue-600;
+}
+
+a {
+ @apply focus:outline-none focus-visible:ring-2;
+}
diff --git a/packages/ui/src/components/badge.tsx b/packages/ui/src/components/badge.tsx
index 53a1e039..3ceab79f 100644
--- a/packages/ui/src/components/badge.tsx
+++ b/packages/ui/src/components/badge.tsx
@@ -5,7 +5,7 @@ import { cva, type VariantProps } from 'class-variance-authority';
import { cn } from '../cn';
const badgeVariants = cva(
- 'inline-flex items-center border rounded-full px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2',
+ 'inline-flex items-center border rounded-full px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-0',
{
variants: {
variant: {
diff --git a/packages/ui/src/components/button.tsx b/packages/ui/src/components/button.tsx
index 929e443d..4cc51c67 100644
--- a/packages/ui/src/components/button.tsx
+++ b/packages/ui/src/components/button.tsx
@@ -5,7 +5,7 @@ import { cva, type VariantProps } from 'class-variance-authority';
import { cn } from '../cn';
const buttonVariants = cva(
- 'inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none ring-offset-background',
+ 'inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50 disabled:pointer-events-none ring-offset-background',
{
variants: {
variant: {
diff --git a/packages/ui/src/components/checkbox.tsx b/packages/ui/src/components/checkbox.tsx
index 113f899e..356659c8 100644
--- a/packages/ui/src/components/checkbox.tsx
+++ b/packages/ui/src/components/checkbox.tsx
@@ -11,7 +11,7 @@ const Checkbox = React.forwardRef<
>(({ className, ...props }, ref) => (
<CheckboxPrimitive.Root
className={cn(
- 'border-primary ring-offset-background focus-visible:ring-ring data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground peer h-4 w-4 shrink-0 rounded-sm border focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50',
+ 'border-primary ring-offset-background focus-visible:ring-ring data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground peer h-4 w-4 shrink-0 rounded-sm border focus-visible:outline-none focus-visible:ring-2 disabled:cursor-not-allowed disabled:opacity-50',
className,
)}
ref={ref}
diff --git a/packages/ui/src/components/dialog.tsx b/packages/ui/src/components/dialog.tsx
index fa8e2cce..3dca5ac2 100644
--- a/packages/ui/src/components/dialog.tsx
+++ b/packages/ui/src/components/dialog.tsx
@@ -49,7 +49,7 @@ const DialogContent = React.forwardRef<
>
{children}
{displayX ? (
- <DialogPrimitive.Close className="ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute right-6 top-6 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:pointer-events-none">
+ <DialogPrimitive.Close className="ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute right-6 top-6 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-offset-0 disabled:pointer-events-none">
<X className="h-4 w-4" />
<span className="sr-only">Close</span>
</DialogPrimitive.Close>
diff --git a/packages/ui/src/components/input.tsx b/packages/ui/src/components/input.tsx
index 5de98e69..16c94688 100644
--- a/packages/ui/src/components/input.tsx
+++ b/packages/ui/src/components/input.tsx
@@ -9,7 +9,7 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(
return (
<input
className={cn(
- 'border-input ring-offset-background placeholder:text-muted-foreground focus-visible:ring-ring flex h-10 w-full rounded-md border bg-transparent px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50',
+ 'border-input ring-offset-background placeholder:text-muted-foreground focus-visible:ring-ring flex h-10 w-full rounded-md border bg-transparent px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:outline-none focus-visible:ring-2 disabled:cursor-not-allowed disabled:opacity-50',
className,
)}
ref={ref}
diff --git a/packages/ui/src/components/select.tsx b/packages/ui/src/components/select.tsx
index 5783dbc9..3d136621 100644
--- a/packages/ui/src/components/select.tsx
+++ b/packages/ui/src/components/select.tsx
@@ -17,7 +17,7 @@ const SelectTrigger = React.forwardRef<
>(({ className, children, ...props }, ref) => (
<SelectPrimitive.Trigger
className={cn(
- 'border-input ring-offset-background placeholder:text-muted-foreground focus:ring-ring flex h-10 w-full items-center justify-between rounded-md border bg-transparent px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50',
+ 'border-input ring-offset-background placeholder:text-muted-foreground focus:ring-ring flex h-10 w-full items-center justify-between rounded-md border bg-transparent px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50',
className,
)}
ref={ref}
diff --git a/packages/ui/src/components/tabs.tsx b/packages/ui/src/components/tabs.tsx
index e40d5ec3..c1780cbd 100644
--- a/packages/ui/src/components/tabs.tsx
+++ b/packages/ui/src/components/tabs.tsx
@@ -27,7 +27,7 @@ const TabsTrigger = React.forwardRef<
>(({ className, ...props }, ref) => (
<TabsPrimitive.Trigger
className={cn(
- 'ring-offset-background focus-visible:ring-ring data-[state=active]:bg-background data-[state=active]:text-foreground inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm',
+ 'ring-offset-background focus-visible:ring-ring data-[state=active]:bg-background data-[state=active]:text-foreground inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium transition-all focus-visible:outline-none focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm',
className,
)}
ref={ref}
@@ -42,7 +42,7 @@ const TabsContent = React.forwardRef<
>(({ className, ...props }, ref) => (
<TabsPrimitive.Content
className={cn(
- 'ring-offset-background focus-visible:ring-ring mt-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2',
+ 'ring-offset-background focus-visible:ring-ring mt-2 focus-visible:outline-none focus-visible:ring-2',
className,
)}
ref={ref}
diff --git a/packages/ui/src/components/textarea.tsx b/packages/ui/src/components/textarea.tsx
index ea26d889..60dbd31f 100644
--- a/packages/ui/src/components/textarea.tsx
+++ b/packages/ui/src/components/textarea.tsx
@@ -8,7 +8,7 @@ const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
return (
<textarea
className={cn(
- 'border-input ring-offset-background placeholder:text-muted-foreground focus-visible:ring-ring flex min-h-[80px] w-full rounded-md border bg-transparent px-3 py-2 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50',
+ 'border-input ring-offset-background placeholder:text-muted-foreground focus-visible:ring-ring flex min-h-[80px] w-full rounded-md border bg-transparent px-3 py-2 text-sm focus-visible:outline-none focus-visible:ring-2 disabled:cursor-not-allowed disabled:opacity-50',
className,
)}
ref={ref}
diff --git a/packages/ui/src/components/toast.tsx b/packages/ui/src/components/toast.tsx
index 3159c804..38b275dc 100644
--- a/packages/ui/src/components/toast.tsx
+++ b/packages/ui/src/components/toast.tsx
@@ -59,7 +59,7 @@ const ToastAction = React.forwardRef<
>(({ className, ...props }, ref) => (
<ToastPrimitives.Action
className={cn(
- 'ring-offset-background hover:bg-secondary focus:ring-ring group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50',
+ 'ring-offset-background hover:bg-secondary focus:ring-ring group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-0 disabled:pointer-events-none disabled:opacity-50',
className,
)}
ref={ref}
diff --git a/packages/ui/src/components/toggle.tsx b/packages/ui/src/components/toggle.tsx
index fc870d2a..9e608ec3 100644
--- a/packages/ui/src/components/toggle.tsx
+++ b/packages/ui/src/components/toggle.tsx
@@ -7,7 +7,7 @@ import * as React from 'react';
import { cn } from '../cn';
const toggleVariants = cva(
- 'inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-zinc-600/30 data-[state=on]:text-accent-foreground',
+ 'inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-zinc-600/30 data-[state=on]:text-accent-foreground',
{
variants: {
variant: {
diff --git a/packages/ui/src/components/user-badge.tsx b/packages/ui/src/components/user-badge.tsx
index 0578294b..1e5810cf 100644
--- a/packages/ui/src/components/user-badge.tsx
+++ b/packages/ui/src/components/user-badge.tsx
@@ -13,7 +13,7 @@ function UserBadge(props: UserBadgeProps) {
return (
<Tooltip>
<TooltipTrigger asChild>
- <Link href={`/@${props.username}`}>
+ <Link href={`/@${props.username}`} className="focus:outline-none focus-visible:ring-0">
<Button
className="-ml-[0.33rem] flex h-auto w-fit items-center rounded-full bg-transparent py-1 pl-[0.33rem] pr-2 text-xs font-bold text-neutral-700 hover:bg-black/10 dark:text-white dark:hover:bg-white/20"
size="sm"