From 87f4c7b71b9cd41d68a8f26cf84503e5d2b32f63 Mon Sep 17 00:00:00 2001 From: Tobias Barsnes Date: Sun, 12 Jan 2025 00:42:05 +0100 Subject: [PATCH] refactor: better focus-visible a11y (#1017) * refactor: better focus-visible a11y * style: fix tree leaf width * style: input focus ring size * refactor: focus a11y on project pages * fix: project-environment import statement * style: `ring-border` on input * refactor: use ring border --------- Co-authored-by: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> --- .../dashboard/docker/logs/docker-logs-id.tsx | 2 +- .../dashboard/docker/show/show-containers.tsx | 2 +- .../dashboard/project/add-template.tsx | 8 ++++---- .../components/dashboard/projects/show.tsx | 12 ++++++++---- .../dashboard/settings/profile/profile-form.tsx | 4 ++-- apps/dokploy/components/layouts/navbar.tsx | 15 ++++++++++----- .../components/layouts/navigation-tabs.tsx | 10 +++++++--- apps/dokploy/components/ui/button.tsx | 4 ++-- apps/dokploy/components/ui/file-tree.tsx | 13 +++++++------ apps/dokploy/components/ui/input.tsx | 2 +- apps/dokploy/components/ui/select.tsx | 2 +- apps/dokploy/components/ui/tabs.tsx | 3 ++- apps/dokploy/components/ui/textarea.tsx | 2 +- apps/dokploy/components/ui/tooltip.tsx | 16 ++++++++++++++-- .../pages/dashboard/project/[projectId].tsx | 7 +++---- 15 files changed, 64 insertions(+), 38 deletions(-) diff --git a/apps/dokploy/components/dashboard/docker/logs/docker-logs-id.tsx b/apps/dokploy/components/dashboard/docker/logs/docker-logs-id.tsx index 1fd8cea48..b638991cf 100644 --- a/apps/dokploy/components/dashboard/docker/logs/docker-logs-id.tsx +++ b/apps/dokploy/components/dashboard/docker/logs/docker-logs-id.tsx @@ -226,7 +226,7 @@ export const DockerLogsId: React.FC = ({ return (
-
+
diff --git a/apps/dokploy/components/dashboard/docker/show/show-containers.tsx b/apps/dokploy/components/dashboard/docker/show/show-containers.tsx index e55e6271f..128009ebf 100644 --- a/apps/dokploy/components/dashboard/docker/show/show-containers.tsx +++ b/apps/dokploy/components/dashboard/docker/show/show-containers.tsx @@ -72,7 +72,7 @@ export const ShowContainers = ({ serverId }: Props) => { return (
-
+
{ href={template.links.github} target="_blank" className={ - "text-sm text-muted-foreground p-3 rounded-full hover:bg-border items-center flex transition-colors" + "text-sm text-muted-foreground p-3 rounded-full hover:bg-border items-center flex transition-colors focus-visible:ring-ring focus-visible:ring-2 focus-visible:outline-none" } > @@ -236,7 +236,7 @@ export const AddTemplate = ({ projectId }: Props) => { href={template.links.website} target="_blank" className={ - "text-sm text-muted-foreground p-3 rounded-full hover:bg-border items-center flex transition-colors" + "text-sm text-muted-foreground p-3 rounded-full hover:bg-border items-center flex transition-colors focus-visible:ring-ring focus-visible:ring-2 focus-visible:outline-none" } > @@ -247,7 +247,7 @@ export const AddTemplate = ({ projectId }: Props) => { href={template.links.docs} target="_blank" className={ - "text-sm text-muted-foreground p-3 rounded-full hover:bg-border items-center flex transition-colors" + "text-sm text-muted-foreground p-3 rounded-full hover:bg-border items-center flex transition-colors focus-visible:ring-ring focus-visible:ring-2 focus-visible:outline-none" } > @@ -257,7 +257,7 @@ export const AddTemplate = ({ projectId }: Props) => { href={`https://github.com/Dokploy/dokploy/tree/canary/apps/dokploy/templates/${template.id}`} target="_blank" className={ - "text-sm text-muted-foreground p-3 rounded-full hover:bg-border items-center flex transition-colors" + "text-sm text-muted-foreground p-3 rounded-full hover:bg-border items-center flex transition-colors focus-visible:ring-ring focus-visible:ring-2 focus-visible:outline-none" } > diff --git a/apps/dokploy/components/dashboard/projects/show.tsx b/apps/dokploy/components/dashboard/projects/show.tsx index 592621835..be85d6f10 100644 --- a/apps/dokploy/components/dashboard/projects/show.tsx +++ b/apps/dokploy/components/dashboard/projects/show.tsx @@ -126,13 +126,16 @@ export const ShowProjects = () => { return (
- + {flattedDomains.length > 1 ? ( ); }); diff --git a/apps/dokploy/components/ui/input.tsx b/apps/dokploy/components/ui/input.tsx index 8fe7ab282..18b713af5 100644 --- a/apps/dokploy/components/ui/input.tsx +++ b/apps/dokploy/components/ui/input.tsx @@ -14,7 +14,7 @@ const Input = React.forwardRef( type={type} className={cn( // bg-gray - "flex h-10 w-full rounded-md bg-input px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", + "flex h-10 w-full rounded-md bg-input px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border disabled:cursor-not-allowed disabled:opacity-50", className, )} ref={ref} diff --git a/apps/dokploy/components/ui/select.tsx b/apps/dokploy/components/ui/select.tsx index e9e5b35b5..cbf47dca8 100644 --- a/apps/dokploy/components/ui/select.tsx +++ b/apps/dokploy/components/ui/select.tsx @@ -17,7 +17,7 @@ const SelectTrigger = React.forwardRef< span]:line-clamp-1", + "flex h-10 w-full items-center justify-between rounded-md border border-input bg-input px-3 py-2 text-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1", className, )} {...props} diff --git a/apps/dokploy/components/ui/tabs.tsx b/apps/dokploy/components/ui/tabs.tsx index e54c215ab..ffbbaed19 100644 --- a/apps/dokploy/components/ui/tabs.tsx +++ b/apps/dokploy/components/ui/tabs.tsx @@ -38,13 +38,14 @@ TabsTrigger.displayName = TabsPrimitive.Trigger.displayName; const TabsContent = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( +>(({ className, tabIndex, ...props }, ref) => ( )); diff --git a/apps/dokploy/components/ui/textarea.tsx b/apps/dokploy/components/ui/textarea.tsx index 5b434e4ae..41561953d 100644 --- a/apps/dokploy/components/ui/textarea.tsx +++ b/apps/dokploy/components/ui/textarea.tsx @@ -10,7 +10,7 @@ const Textarea = React.forwardRef( return (