From c1d5922acbe7060c0ea779ccf314e9f0e6b91bb3 Mon Sep 17 00:00:00 2001 From: Free Date: Sat, 29 Apr 2023 22:30:14 +0000 Subject: [PATCH] keyboard accessibility (#9725) Reviewed-on: https://codeberg.org/calckey/calckey/pulls/9725 Co-authored-by: Free Co-committed-by: Free --- package.json | 2 + packages/client/src/components/MkButton.vue | 3 +- packages/client/src/components/MkCwButton.vue | 18 +- .../src/components/MkDriveFileThumbnail.vue | 7 +- .../client/src/components/MkEmojiPicker.vue | 278 ++++++------- .../client/src/components/MkLaunchPad.vue | 2 +- .../client/src/components/MkMediaImage.vue | 4 + .../client/src/components/MkMenu.child.vue | 21 +- packages/client/src/components/MkMenu.vue | 378 +++++++++--------- packages/client/src/components/MkModal.vue | 86 ++-- .../src/components/MkModalPageWindow.vue | 1 + .../client/src/components/MkModalWindow.vue | 95 ++--- packages/client/src/components/MkNote.vue | 8 +- .../client/src/components/MkNotePreview.vue | 2 +- packages/client/src/components/MkNoteSub.vue | 4 +- .../client/src/components/MkPopupMenu.vue | 2 + .../src/components/MkPostFormAttaches.vue | 1 - .../src/components/MkSubNoteContent.vue | 27 +- .../client/src/components/MkSuperMenu.vue | 5 +- .../src/components/MkUserSelectDialog.vue | 2 + .../client/src/components/MkUsersTooltip.vue | 2 +- packages/client/src/components/MkWidgets.vue | 2 +- .../client/src/components/form/folder.vue | 4 +- packages/client/src/components/form/radio.vue | 3 + .../client/src/components/form/switch.vue | 3 + .../src/components/global/MkPageHeader.vue | 2 + .../src/components/global/RouterView.vue | 3 + packages/client/src/directives/focus.ts | 3 + packages/client/src/directives/index.ts | 2 + packages/client/src/directives/tooltip.ts | 33 +- packages/client/src/pages/admin/_header_.vue | 6 +- .../src/pages/admin/overview.moderators.vue | 2 +- packages/client/src/pages/follow-requests.vue | 1 + .../client/src/pages/settings/accounts.vue | 8 +- packages/client/src/style.scss | 4 - .../src/ui/_common_/navbar-for-mobile.vue | 1 + packages/client/src/ui/_common_/navbar.vue | 21 +- packages/client/src/ui/classic.header.vue | 1 + packages/client/src/ui/classic.sidebar.vue | 4 +- packages/client/src/ui/classic.vue | 2 + pnpm-lock.yaml | 41 +- 41 files changed, 601 insertions(+), 493 deletions(-) create mode 100644 packages/client/src/directives/focus.ts diff --git a/package.json b/package.json index 63b5f1dcd..0b681f6d5 100644 --- a/package.json +++ b/package.json @@ -40,6 +40,8 @@ "@bull-board/ui": "^4.10.2", "@napi-rs/cli": "^2.15.0", "@tensorflow/tfjs": "^3.21.0", + "focus-trap": "^7.2.0", + "focus-trap-vue": "^4.0.1", "js-yaml": "4.1.0", "seedrandom": "^3.0.5" }, diff --git a/packages/client/src/components/MkButton.vue b/packages/client/src/components/MkButton.vue index 5f1a5bdb7..feac281d9 100644 --- a/packages/client/src/components/MkButton.vue +++ b/packages/client/src/components/MkButton.vue @@ -195,8 +195,7 @@ function onMousedown(evt: MouseEvent): void { } &:focus-visible { - outline: solid 2px var(--focus); - outline-offset: 2px; + outline: auto; } &.inline { diff --git a/packages/client/src/components/MkCwButton.vue b/packages/client/src/components/MkCwButton.vue index 659cb1fbb..1f6340510 100644 --- a/packages/client/src/components/MkCwButton.vue +++ b/packages/client/src/components/MkCwButton.vue @@ -1,5 +1,6 @@