Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[autocomplete][docs] Fix focus state demo in Base UI #41104

Merged
merged 3 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -309,18 +309,18 @@ function Styles() {
color: ${isDarkMode ? cyan[100] : cyan[900]};
}

&.base--focused,
&.base--focusVisible {
&.Mui-focused,
&.Mui-focusVisible {
background-color: ${isDarkMode ? grey[800] : grey[100]};
color: ${isDarkMode ? grey[300] : grey[900]};
}

&.base--focusVisible {
&.Mui-focusVisible {
box-shadow: 0 0 0 3px ${isDarkMode ? cyan[500] : cyan[200]};
}

&[aria-selected=true].base--focused,
&[aria-selected=true].base--focusVisible {
&[aria-selected=true].Mui-focused,
&[aria-selected=true].Mui-focusVisible {
background-color: ${isDarkMode ? cyan[900] : cyan[100]};
color: ${isDarkMode ? cyan[100] : cyan[900]};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,18 +283,18 @@ function Styles() {
color: ${isDarkMode ? cyan[100] : cyan[900]};
}

&.base--focused,
&.base--focusVisible {
&.Mui-focused,
&.Mui-focusVisible {
background-color: ${isDarkMode ? grey[800] : grey[100]};
color: ${isDarkMode ? grey[300] : grey[900]};
}

&.base--focusVisible {
&.Mui-focusVisible {
box-shadow: 0 0 0 3px ${isDarkMode ? cyan[500] : cyan[200]};
}

&[aria-selected=true].base--focused,
&[aria-selected=true].base--focusVisible {
&[aria-selected=true].Mui-focused,
&[aria-selected=true].Mui-focusVisible {
background-color: ${isDarkMode ? cyan[900] : cyan[100]};
color: ${isDarkMode ? cyan[100] : cyan[900]};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,18 +237,18 @@ const StyledOption = styled('li')(
color: ${theme.palette.mode === 'dark' ? blue[100] : blue[900]};
}

&.base--focused,
&.base--focusVisible {
&.Mui-focused,
&.Mui-focusVisible {
background-color: ${theme.palette.mode === 'dark' ? grey[800] : grey[100]};
color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]};
}

&.base--focusVisible {
&.Mui-focusVisible {
box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[500] : blue[200]};
}

&[aria-selected=true].base--focused,
&[aria-selected=true].base--focusVisible {
&[aria-selected=true].Mui-focused,
&[aria-selected=true].Mui-focusVisible {
background-color: ${theme.palette.mode === 'dark' ? blue[900] : blue[100]};
color: ${theme.palette.mode === 'dark' ? blue[100] : blue[900]};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,18 +220,18 @@ const StyledOption = styled('li')(
color: ${theme.palette.mode === 'dark' ? blue[100] : blue[900]};
}

&.base--focused,
&.base--focusVisible {
&.Mui-focused,
&.Mui-focusVisible {
background-color: ${theme.palette.mode === 'dark' ? grey[800] : grey[100]};
color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]};
}

&.base--focusVisible {
&.Mui-focusVisible {
box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[500] : blue[200]};
}

&[aria-selected=true].base--focused,
&[aria-selected=true].base--focusVisible {
&[aria-selected=true].Mui-focused,
&[aria-selected=true].Mui-focusVisible {
background-color: ${theme.palette.mode === 'dark' ? blue[900] : blue[100]};
color: ${theme.palette.mode === 'dark' ? blue[100] : blue[900]};
}
Expand Down
10 changes: 5 additions & 5 deletions docs/data/base/components/autocomplete/ControlledStates.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,18 +171,18 @@ const Option = styled('li')(
color: ${theme.palette.mode === 'dark' ? blue[100] : blue[900]};
}

&.base--focused,
&.base--focusVisible {
&.Mui-focused,
&.Mui-focusVisible {
background-color: ${theme.palette.mode === 'dark' ? grey[800] : grey[100]};
color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]};
}

&.base--focusVisible {
&.Mui-focusVisible {
box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[500] : blue[200]};
}

&[aria-selected=true].base--focused,
&[aria-selected=true].base--focusVisible {
&[aria-selected=true].Mui-focused,
&[aria-selected=true].Mui-focusVisible {
background-color: ${theme.palette.mode === 'dark' ? blue[900] : blue[100]};
color: ${theme.palette.mode === 'dark' ? blue[100] : blue[900]};
}
Expand Down
10 changes: 5 additions & 5 deletions docs/data/base/components/autocomplete/ControlledStates.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,18 +171,18 @@ const Option = styled('li')(
color: ${theme.palette.mode === 'dark' ? blue[100] : blue[900]};
}

&.base--focused,
&.base--focusVisible {
&.Mui-focused,
&.Mui-focusVisible {
background-color: ${theme.palette.mode === 'dark' ? grey[800] : grey[100]};
color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]};
}

&.base--focusVisible {
&.Mui-focusVisible {
box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[500] : blue[200]};
}

&[aria-selected=true].base--focused,
&[aria-selected=true].base--focusVisible {
&[aria-selected=true].Mui-focused,
&[aria-selected=true].Mui-focusVisible {
background-color: ${theme.palette.mode === 'dark' ? blue[900] : blue[100]};
color: ${theme.palette.mode === 'dark' ? blue[100] : blue[900]};
}
Expand Down
10 changes: 5 additions & 5 deletions docs/data/base/components/autocomplete/UseAutocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,18 +160,18 @@ const Option = styled('li')(
color: ${theme.palette.mode === 'dark' ? blue[100] : blue[900]};
}

&.base--focused,
&.base--focusVisible {
&.Mui-focused,
&.Mui-focusVisible {
background-color: ${theme.palette.mode === 'dark' ? grey[800] : grey[100]};
color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]};
}

&.base--focusVisible {
&.Mui-focusVisible {
box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[500] : blue[200]};
}

&[aria-selected=true].base--focused,
&[aria-selected=true].base--focusVisible {
&[aria-selected=true].Mui-focused,
&[aria-selected=true].Mui-focusVisible {
background-color: ${theme.palette.mode === 'dark' ? blue[900] : blue[100]};
color: ${theme.palette.mode === 'dark' ? blue[100] : blue[900]};
}
Expand Down
10 changes: 5 additions & 5 deletions docs/data/base/components/autocomplete/UseAutocomplete.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,18 +162,18 @@ const Option = styled('li')(
color: ${theme.palette.mode === 'dark' ? blue[100] : blue[900]};
}

&.base--focused,
&.base--focusVisible {
&.Mui-focused,
&.Mui-focusVisible {
background-color: ${theme.palette.mode === 'dark' ? grey[800] : grey[100]};
color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]};
}

&.base--focusVisible {
&.Mui-focusVisible {
box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[500] : blue[200]};
}

&[aria-selected=true].base--focused,
&[aria-selected=true].base--focusVisible {
&[aria-selected=true].Mui-focused,
&[aria-selected=true].Mui-focusVisible {
background-color: ${theme.palette.mode === 'dark' ? blue[900] : blue[100]};
color: ${theme.palette.mode === 'dark' ? blue[100] : blue[900]};
}
Expand Down
10 changes: 5 additions & 5 deletions docs/data/base/components/autocomplete/UseAutocompletePopper.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,18 +184,18 @@ const Option = styled('li')(
color: ${theme.palette.mode === 'dark' ? blue[100] : blue[900]};
}

&.base--focused,
&.base--focusVisible {
&.Mui-focused,
&.Mui-focusVisible {
background-color: ${theme.palette.mode === 'dark' ? grey[800] : grey[100]};
color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]};
}

&.base--focusVisible {
&.Mui-focusVisible {
box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[500] : blue[200]};
}

&[aria-selected=true].base--focused,
&[aria-selected=true].base--focusVisible {
&[aria-selected=true].Mui-focused,
&[aria-selected=true].Mui-focusVisible {
background-color: ${theme.palette.mode === 'dark' ? blue[900] : blue[100]};
color: ${theme.palette.mode === 'dark' ? blue[100] : blue[900]};
}
Expand Down
10 changes: 5 additions & 5 deletions docs/data/base/components/autocomplete/UseAutocompletePopper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -192,18 +192,18 @@ const Option = styled('li')(
color: ${theme.palette.mode === 'dark' ? blue[100] : blue[900]};
}

&.base--focused,
&.base--focusVisible {
&.Mui-focused,
&.Mui-focusVisible {
background-color: ${theme.palette.mode === 'dark' ? grey[800] : grey[100]};
color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]};
}

&.base--focusVisible {
&.Mui-focusVisible {
box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[500] : blue[200]};
}

&[aria-selected=true].base--focused,
&[aria-selected=true].base--focusVisible {
&[aria-selected=true].Mui-focused,
&[aria-selected=true].Mui-focusVisible {
background-color: ${theme.palette.mode === 'dark' ? blue[900] : blue[100]};
color: ${theme.palette.mode === 'dark' ? blue[100] : blue[900]};
}
Expand Down
1 change: 1 addition & 0 deletions packages/mui-base/src/useAutocomplete/useAutocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export function useAutocomplete(props) {
const {
// eslint-disable-next-line @typescript-eslint/naming-convention
unstable_isActiveElementInListbox = defaultIsActiveElementInListbox,
// TODO should be using base class name by default
oliviertassinari marked this conversation as resolved.
Show resolved Hide resolved
// eslint-disable-next-line @typescript-eslint/naming-convention
unstable_classNamePrefix = 'Mui',
autoComplete = false,
Expand Down
Loading