aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/design-system/src/components/input
diff options
context:
space:
mode:
authorJeremy Davis <jeremy.davis@sonarsource.com>2024-10-07 18:32:15 +0200
committersonartech <sonartech@sonarsource.com>2024-10-08 20:02:47 +0000
commitaef2ea10ecee8df9eadf3d3da4e63c06a9378b8b (patch)
tree840adef6a40df1e22a584f6e4a75b4cd77c1d814 /server/sonar-web/design-system/src/components/input
parentf49678493a80f08984b13f8003fca362fe081c9f (diff)
downloadsonarqube-aef2ea10ecee8df9eadf3d3da4e63c06a9378b8b.tar.gz
sonarqube-aef2ea10ecee8df9eadf3d3da4e63c06a9378b8b.zip
SONAR-22290 Fix focus indicator in legacy components
Diffstat (limited to 'server/sonar-web/design-system/src/components/input')
-rw-r--r--server/sonar-web/design-system/src/components/input/InputField.tsx5
-rw-r--r--server/sonar-web/design-system/src/components/input/InputSearch.tsx8
-rw-r--r--server/sonar-web/design-system/src/components/input/SearchSelectDropdownControl.tsx4
3 files changed, 12 insertions, 5 deletions
diff --git a/server/sonar-web/design-system/src/components/input/InputField.tsx b/server/sonar-web/design-system/src/components/input/InputField.tsx
index 2b6adb2bbff..5b3c9a04e5e 100644
--- a/server/sonar-web/design-system/src/components/input/InputField.tsx
+++ b/server/sonar-web/design-system/src/components/input/InputField.tsx
@@ -59,13 +59,13 @@ InputTextArea.displayName = 'InputTextArea';
const defaultStyle = (props: ThemedProps) => css`
--border: ${themeBorder('default', 'inputBorder')(props)};
--focusBorder: ${themeBorder('default', 'inputFocus')(props)};
- --focusOutline: ${themeBorder('focus', 'inputFocus')(props)};
+ --focusOutline: var(--echoes-focus-border-width-default) solid var(--echoes-color-focus-default);
`;
const dangerStyle = (props: ThemedProps) => css`
--border: ${themeBorder('default', 'inputDanger')(props)};
--focusBorder: ${themeBorder('default', 'inputDangerFocus')(props)};
- --focusOutline: ${themeBorder('focus', 'inputDangerFocus')(props)};
+ --focusOutline: var(--echoes-focus-border-width-default) solid var(--echoes-color-focus-default);
`;
const getInputVariant = (props: ThemedProps & { isInvalid?: boolean; isValid?: boolean }) => {
@@ -102,6 +102,7 @@ const baseStyle = (props: ThemedProps) => css`
&:focus-visible {
border: var(--focusBorder);
outline: var(--focusOutline);
+ outline-offset: var(--echoes-focus-border-offset-default);
}
&:disabled,
diff --git a/server/sonar-web/design-system/src/components/input/InputSearch.tsx b/server/sonar-web/design-system/src/components/input/InputSearch.tsx
index 9e9d5d76915..fd60b082ca5 100644
--- a/server/sonar-web/design-system/src/components/input/InputSearch.tsx
+++ b/server/sonar-web/design-system/src/components/input/InputSearch.tsx
@@ -226,7 +226,8 @@ export const StyledInputWrapper = styled.div`
&:focus,
&:active {
border: ${themeBorder('default', 'inputFocus')};
- outline: ${themeBorder('focus', 'inputFocus')};
+ outline: var(--echoes-focus-border-width-default) solid var(--echoes-color-focus-default);
+ outline-offset: var(--echoes-focus-border-offset-default);
}
&::-webkit-search-decoration,
@@ -251,6 +252,11 @@ export const StyledSearchIconWrapper = styled.div`
export const StyledInteractiveIcon = styled(InteractiveIcon)`
${tw`sw-absolute`}
${tw`sw-right-2`}
+
+ &:focus,
+ &:active {
+ outline: var(--echoes-focus-border-width-default) solid var(--echoes-color-focus-default);
+ }
`;
export const StyledNote = styled.span`
diff --git a/server/sonar-web/design-system/src/components/input/SearchSelectDropdownControl.tsx b/server/sonar-web/design-system/src/components/input/SearchSelectDropdownControl.tsx
index dbfcfb1854f..d5f40048bda 100644
--- a/server/sonar-web/design-system/src/components/input/SearchSelectDropdownControl.tsx
+++ b/server/sonar-web/design-system/src/components/input/SearchSelectDropdownControl.tsx
@@ -144,11 +144,11 @@ const StyledControl = styled.div`
&:focus-visible,
&:focus-within {
border: ${themeBorder('default', 'inputFocus')};
- outline: ${themeBorder('focus', 'inputFocus')};
+ outline: var(--echoes-focus-border-width-default) solid var(--echoes-color-focus-default);
&.is-discreet {
${tw`sw-rounded-1 sw-border-none`};
- outline: ${themeBorder('focus', 'discreetFocusBorder')};
+ outline: var(--echoes-focus-border-width-default) solid var(--echoes-color-focus-default);
}
}
`;