diff --git a/src/common-elements/headers.ts b/src/common-elements/headers.ts index 30b96593..50f0793b 100644 --- a/src/common-elements/headers.ts +++ b/src/common-elements/headers.ts @@ -13,14 +13,18 @@ export const headerCommonMixin = level => css` line-height: ${({ theme }) => theme.typography.headings.lineHeight}; `; -export const H1 = styled.h1` +export const H1 = styled.h1.attrs(props => ({ + tabIndex: props.tabIndex || '0', +}))` ${headerCommonMixin(1)}; color: ${({ theme }) => theme.colors.text.primary}; ${extensionsHook('H1')}; `; -export const H2 = styled.h2` +export const H2 = styled.h2.attrs(props => ({ + tabIndex: props.tabIndex || '0', +}))` ${headerCommonMixin(2)}; color: ${({ theme }) => theme.colors.text.primary}; margin: 0 0 20px; @@ -28,7 +32,9 @@ export const H2 = styled.h2` ${extensionsHook('H2')}; `; -export const H3 = styled.h2` +export const H3 = styled.h2.attrs(props => ({ + tabIndex: props.tabIndex || '0', +}))` ${headerCommonMixin(3)}; color: ${({ theme }) => theme.colors.text.primary}; diff --git a/src/components/__tests__/__snapshots__/SecurityRequirement.test.tsx.snap b/src/components/__tests__/__snapshots__/SecurityRequirement.test.tsx.snap index 9624647f..0ddeb76b 100644 --- a/src/components/__tests__/__snapshots__/SecurityRequirement.test.tsx.snap +++ b/src/components/__tests__/__snapshots__/SecurityRequirement.test.tsx.snap @@ -1,13 +1,13 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`SecurityRequirement should render SecurityDefs 1`] = ` -"

petstore_auth

Get access to data while protecting your account credentials. +"

petstore_auth

Get access to data while protecting your account credentials. OAuth2 is also a safer and more secure way to give you access.

Security Scheme Type: OAuth2
Flow type: implicit
Scopes:
  • write:pets -

    modify pets in your account

  • read:pets -

    read your pets

    -

GitLab_PersonalAccessToken

GitLab Personal Access Token description

-
Security Scheme Type: API Key
Header parameter name: PRIVATE-TOKEN

GitLab_OpenIdConnect

GitLab OpenIdConnect description

-
Security Scheme Type: OpenID Connect

basicAuth

Security Scheme Type: HTTP
HTTP Authorization Scheme: basic
" +

GitLab_PersonalAccessToken

GitLab Personal Access Token description

+
Security Scheme Type: API Key
Header parameter name: PRIVATE-TOKEN

GitLab_OpenIdConnect

GitLab OpenIdConnect description

+
Security Scheme Type: OpenID Connect

basicAuth

Security Scheme Type: HTTP
HTTP Authorization Scheme: basic
" `; exports[`SecurityRequirement should render authDefinition 1`] = `"

Authorizations:

(API Key: GitLab_PersonalAccessTokenOpenID Connect: GitLab_OpenIdConnectHTTP: basicAuth) OAuth2: petstore_auth
,"`;