From 9b9310d572298f8918aea1626a47e6c746e6abad Mon Sep 17 00:00:00 2001 From: Dima K Date: Wed, 3 Jul 2024 13:43:37 -0700 Subject: [PATCH 1/5] Add focus state styling for tabbable fields via Plugin --- ppr-ui/src/assets/styles/accessibility.scss | 20 ++++++ ppr-ui/src/assets/styles/base.scss | 1 + ppr-ui/src/assets/styles/theme.scss | 3 + ppr-ui/src/components/common/AccountInfo.vue | 1 + .../common/RegistrationsWrapper.vue | 1 + .../components/dashboard/DashboardTabs.vue | 30 ++++----- .../mhrRegistration/MhrStatusCorrection.vue | 1 + .../YourHome/HomeCertification.vue | 1 + .../YourHome/ManufacturedYearInput.vue | 3 +- .../src/components/tables/SearchHistory.vue | 3 +- ppr-ui/src/main.ts | 2 + ppr-ui/src/plugins/tabFocus.ts | 64 +++++++++++++++++++ 12 files changed, 113 insertions(+), 17 deletions(-) create mode 100644 ppr-ui/src/assets/styles/accessibility.scss create mode 100644 ppr-ui/src/plugins/tabFocus.ts diff --git a/ppr-ui/src/assets/styles/accessibility.scss b/ppr-ui/src/assets/styles/accessibility.scss new file mode 100644 index 000000000..d74ef3ca0 --- /dev/null +++ b/ppr-ui/src/assets/styles/accessibility.scss @@ -0,0 +1,20 @@ +.v-btn:after { + content: none; +} + +a:focus-visible, +.v-radio.v-selection-control--focus-visible, +.v-btn:focus-visible, +.tab-focused .v-field { + outline: 2px solid $focus-outline; + outline-offset: 2px; +} + +.v-checkbox-btn.v-selection-control--focus-visible .v-selection-control__wrapper { + outline: 2px solid $focus-outline; + border-radius: 50%; +} + +.v-icon:focus-visible { + outline-color: $focus-outline; +} \ No newline at end of file diff --git a/ppr-ui/src/assets/styles/base.scss b/ppr-ui/src/assets/styles/base.scss index a9c80ce6f..6a5e76be5 100644 --- a/ppr-ui/src/assets/styles/base.scss +++ b/ppr-ui/src/assets/styles/base.scss @@ -1,4 +1,5 @@ @import 'theme.scss'; +@import 'accessibility.scss'; @font-face { font-family: 'BCSans'; diff --git a/ppr-ui/src/assets/styles/theme.scss b/ppr-ui/src/assets/styles/theme.scss index c494a600e..abf6f1e53 100644 --- a/ppr-ui/src/assets/styles/theme.scss +++ b/ppr-ui/src/assets/styles/theme.scss @@ -80,3 +80,6 @@ $app-orange: #f8661a; // same as the Vuetify theme caution // Sizes for Fonts $px-14: 0.8750rem; $px-16: 1.0000rem; + +// Accessibility +$focus-outline: #003366; diff --git a/ppr-ui/src/components/common/AccountInfo.vue b/ppr-ui/src/components/common/AccountInfo.vue index 801de6169..9322f33bf 100644 --- a/ppr-ui/src/components/common/AccountInfo.vue +++ b/ppr-ui/src/components/common/AccountInfo.vue @@ -14,6 +14,7 @@ class="mt-n1" color="primary" v-bind="props" + tabindex="0" > mdi-information-outline diff --git a/ppr-ui/src/components/common/RegistrationsWrapper.vue b/ppr-ui/src/components/common/RegistrationsWrapper.vue index af65f4f2a..d1c20df9c 100644 --- a/ppr-ui/src/components/common/RegistrationsWrapper.vue +++ b/ppr-ui/src/components/common/RegistrationsWrapper.vue @@ -80,6 +80,7 @@ color="primary" v-bind="props" class="mt-n1" + tabindex="0" > mdi-information-outline diff --git a/ppr-ui/src/components/dashboard/DashboardTabs.vue b/ppr-ui/src/components/dashboard/DashboardTabs.vue index 4bc43000f..c7f208ee6 100644 --- a/ppr-ui/src/components/dashboard/DashboardTabs.vue +++ b/ppr-ui/src/components/dashboard/DashboardTabs.vue @@ -5,17 +5,16 @@ @import '@/assets/styles/theme.scss'; + +.ppr-mhr-tabs { + height: 68px; + display: block; + overflow: visible; +} + .tab { min-height: 64px !important; background-color: $BCgovBlue5; @@ -158,6 +164,7 @@ export default defineComponent({ letter-spacing: 0; text-transform: none !important; border-radius: 4px 4px 0 0!important; + margin: 5px 4px; // margin to make space for outline a11y &:hover:not(.v-tab--selected) { background-color: $primary-blue } @@ -167,13 +174,6 @@ export default defineComponent({ color: $gray9; pointer-events: none; } -.upper-border { - border-top-left-radius: 4px; - border-top-right-radius: 4px; - min-height: 58px; - max-height: 58px; - margin: 0 2.5px; -} .v-window { min-height: 400px } diff --git a/ppr-ui/src/components/mhrRegistration/MhrStatusCorrection.vue b/ppr-ui/src/components/mhrRegistration/MhrStatusCorrection.vue index 05691ec19..64e4660f5 100644 --- a/ppr-ui/src/components/mhrRegistration/MhrStatusCorrection.vue +++ b/ppr-ui/src/components/mhrRegistration/MhrStatusCorrection.vue @@ -19,6 +19,7 @@ color="primary" v-bind="props" class="mr-1" + tabindex="0" > mdi-information-outline diff --git a/ppr-ui/src/components/mhrRegistration/YourHome/HomeCertification.vue b/ppr-ui/src/components/mhrRegistration/YourHome/HomeCertification.vue index 476647125..c7d2c0234 100644 --- a/ppr-ui/src/components/mhrRegistration/YourHome/HomeCertification.vue +++ b/ppr-ui/src/components/mhrRegistration/YourHome/HomeCertification.vue @@ -172,6 +172,7 @@ color="primary" v-bind="props" data-test-id="no-certification-tooltip" + tabindex="0" > mdi-information-outline diff --git a/ppr-ui/src/components/mhrRegistration/YourHome/ManufacturedYearInput.vue b/ppr-ui/src/components/mhrRegistration/YourHome/ManufacturedYearInput.vue index ceda2c535..a4b0292bb 100644 --- a/ppr-ui/src/components/mhrRegistration/YourHome/ManufacturedYearInput.vue +++ b/ppr-ui/src/components/mhrRegistration/YourHome/ManufacturedYearInput.vue @@ -48,9 +48,10 @@ >