diff --git a/docs/src/modules/components/prism-okaidia.css b/docs/src/modules/components/prism-okaidia.css index cfa88db339e2a2..230c99474da750 100644 --- a/docs/src/modules/components/prism-okaidia.css +++ b/docs/src/modules/components/prism-okaidia.css @@ -145,3 +145,8 @@ pre[class*="language-"] { .token.deleted { color: rgb(252, 146, 158); } + +.token.boolean, +.token.number { + color: #b78eff; +} diff --git a/docs/src/pages/components/autocomplete/Asynchronous.js b/docs/src/pages/components/autocomplete/Asynchronous.js index 7740658b7ba8ec..191fb07914c2ac 100644 --- a/docs/src/pages/components/autocomplete/Asynchronous.js +++ b/docs/src/pages/components/autocomplete/Asynchronous.js @@ -46,6 +46,7 @@ export default function Asynchronous() { return ( { diff --git a/docs/src/pages/components/autocomplete/Asynchronous.tsx b/docs/src/pages/components/autocomplete/Asynchronous.tsx index e6c3ef888a7305..acd8730746721c 100644 --- a/docs/src/pages/components/autocomplete/Asynchronous.tsx +++ b/docs/src/pages/components/autocomplete/Asynchronous.tsx @@ -50,6 +50,7 @@ export default function Asynchronous() { return ( { diff --git a/docs/src/pages/components/autocomplete/CheckboxesTags.js b/docs/src/pages/components/autocomplete/CheckboxesTags.js index 609bbeb6c49770..81f00eb8c8e78a 100644 --- a/docs/src/pages/components/autocomplete/CheckboxesTags.js +++ b/docs/src/pages/components/autocomplete/CheckboxesTags.js @@ -14,6 +14,7 @@ export default function CheckboxesTags() { return ( option.title} diff --git a/docs/src/pages/components/autocomplete/CheckboxesTags.tsx b/docs/src/pages/components/autocomplete/CheckboxesTags.tsx index 094d2d0ae4e009..b70923c9c7b5d9 100644 --- a/docs/src/pages/components/autocomplete/CheckboxesTags.tsx +++ b/docs/src/pages/components/autocomplete/CheckboxesTags.tsx @@ -14,6 +14,7 @@ export default function CheckboxesTags() { return ( option.title} diff --git a/docs/src/pages/components/autocomplete/ComboBox.js b/docs/src/pages/components/autocomplete/ComboBox.js index 148045412699c8..eb607b0311571b 100644 --- a/docs/src/pages/components/autocomplete/ComboBox.js +++ b/docs/src/pages/components/autocomplete/ComboBox.js @@ -6,6 +6,7 @@ import Autocomplete from '@material-ui/lab/Autocomplete'; export default function ComboBox() { return ( option.title} style={{ width: 300 }} diff --git a/docs/src/pages/components/autocomplete/ComboBox.tsx b/docs/src/pages/components/autocomplete/ComboBox.tsx index 7c124fc5a21248..530aaf5653718a 100644 --- a/docs/src/pages/components/autocomplete/ComboBox.tsx +++ b/docs/src/pages/components/autocomplete/ComboBox.tsx @@ -6,6 +6,7 @@ import Autocomplete from '@material-ui/lab/Autocomplete'; export default function ComboBox() { return ( option.title} style={{ width: 300 }} diff --git a/docs/src/pages/components/autocomplete/CountrySelect.js b/docs/src/pages/components/autocomplete/CountrySelect.js index 7e676a3e25c38e..0aac96dd73bb17 100644 --- a/docs/src/pages/components/autocomplete/CountrySelect.js +++ b/docs/src/pages/components/autocomplete/CountrySelect.js @@ -27,6 +27,7 @@ export default function CountrySelect() { return ( option === timeSlots[0] || option === timeSlots[2]} style={{ width: 300 }} diff --git a/docs/src/pages/components/autocomplete/DisabledOptions.tsx b/docs/src/pages/components/autocomplete/DisabledOptions.tsx index 006a13f9cf1241..ad90d5c6501a4a 100644 --- a/docs/src/pages/components/autocomplete/DisabledOptions.tsx +++ b/docs/src/pages/components/autocomplete/DisabledOptions.tsx @@ -6,6 +6,7 @@ import Autocomplete from '@material-ui/lab/Autocomplete'; export default function DisabledOptions() { return ( option === timeSlots[0] || option === timeSlots[2]} style={{ width: 300 }} diff --git a/docs/src/pages/components/autocomplete/Filter.js b/docs/src/pages/components/autocomplete/Filter.js index 46e76bf744cae5..2c3c5d6f5d595d 100644 --- a/docs/src/pages/components/autocomplete/Filter.js +++ b/docs/src/pages/components/autocomplete/Filter.js @@ -11,6 +11,7 @@ const filterOptions = createFilterOptions({ export default function Filter() { return ( option.title} filterOptions={filterOptions} diff --git a/docs/src/pages/components/autocomplete/Filter.tsx b/docs/src/pages/components/autocomplete/Filter.tsx index 49a973b0b7160e..5e00d3e8af8d62 100644 --- a/docs/src/pages/components/autocomplete/Filter.tsx +++ b/docs/src/pages/components/autocomplete/Filter.tsx @@ -11,6 +11,7 @@ const filterOptions = createFilterOptions({ export default function Filter() { return ( option.title} filterOptions={filterOptions} diff --git a/docs/src/pages/components/autocomplete/FixedTags.js b/docs/src/pages/components/autocomplete/FixedTags.js index a4f36edd557489..3039b4801afc52 100644 --- a/docs/src/pages/components/autocomplete/FixedTags.js +++ b/docs/src/pages/components/autocomplete/FixedTags.js @@ -8,6 +8,7 @@ export default function FixedTags() { return ( option.title} defaultValue={[top100Films[6], top100Films[13]]} diff --git a/docs/src/pages/components/autocomplete/FixedTags.tsx b/docs/src/pages/components/autocomplete/FixedTags.tsx index 55734b2d2aa989..d655dc23f56606 100644 --- a/docs/src/pages/components/autocomplete/FixedTags.tsx +++ b/docs/src/pages/components/autocomplete/FixedTags.tsx @@ -8,6 +8,7 @@ export default function FixedTags() { return ( option.title} defaultValue={[top100Films[6], top100Films[13]]} diff --git a/docs/src/pages/components/autocomplete/FreeSolo.js b/docs/src/pages/components/autocomplete/FreeSolo.js index d7a32bd5daafba..eca97faea0a224 100644 --- a/docs/src/pages/components/autocomplete/FreeSolo.js +++ b/docs/src/pages/components/autocomplete/FreeSolo.js @@ -7,6 +7,7 @@ export default function FreeSolo() { return (
option.title)} renderInput={params => ( @@ -15,6 +16,7 @@ export default function FreeSolo() { /> option.title)} renderInput={params => ( diff --git a/docs/src/pages/components/autocomplete/FreeSolo.tsx b/docs/src/pages/components/autocomplete/FreeSolo.tsx index d7a32bd5daafba..eca97faea0a224 100644 --- a/docs/src/pages/components/autocomplete/FreeSolo.tsx +++ b/docs/src/pages/components/autocomplete/FreeSolo.tsx @@ -7,6 +7,7 @@ export default function FreeSolo() { return (
option.title)} renderInput={params => ( @@ -15,6 +16,7 @@ export default function FreeSolo() { /> option.title)} renderInput={params => ( diff --git a/docs/src/pages/components/autocomplete/GoogleMaps.js b/docs/src/pages/components/autocomplete/GoogleMaps.js index 1e88c3aaaf4bb3..1ef5d1156428ec 100644 --- a/docs/src/pages/components/autocomplete/GoogleMaps.js +++ b/docs/src/pages/components/autocomplete/GoogleMaps.js @@ -87,6 +87,7 @@ export default function GoogleMaps() { return ( option.description} filterOptions={x => x} diff --git a/docs/src/pages/components/autocomplete/GoogleMaps.tsx b/docs/src/pages/components/autocomplete/GoogleMaps.tsx index 063303e7dfbc72..96593ab0e23fd1 100644 --- a/docs/src/pages/components/autocomplete/GoogleMaps.tsx +++ b/docs/src/pages/components/autocomplete/GoogleMaps.tsx @@ -99,6 +99,7 @@ export default function GoogleMaps() { return ( option.description} filterOptions={x => x} diff --git a/docs/src/pages/components/autocomplete/Grouped.js b/docs/src/pages/components/autocomplete/Grouped.js index 646328e2cf7602..cf233d53353b0f 100644 --- a/docs/src/pages/components/autocomplete/Grouped.js +++ b/docs/src/pages/components/autocomplete/Grouped.js @@ -14,6 +14,7 @@ export default function Grouped() { return ( -b.firstLetter.localeCompare(a.firstLetter))} groupBy={option => option.firstLetter} getOptionLabel={option => option.title} diff --git a/docs/src/pages/components/autocomplete/Grouped.tsx b/docs/src/pages/components/autocomplete/Grouped.tsx index bbe6f4e4ef64b4..41294950f531bf 100644 --- a/docs/src/pages/components/autocomplete/Grouped.tsx +++ b/docs/src/pages/components/autocomplete/Grouped.tsx @@ -14,6 +14,7 @@ export default function Grouped() { return ( -b.firstLetter.localeCompare(a.firstLetter))} groupBy={(option: FilmOptionType) => option.firstLetter} getOptionLabel={(option: FilmOptionType) => option.title} diff --git a/docs/src/pages/components/autocomplete/Highlights.js b/docs/src/pages/components/autocomplete/Highlights.js index 72118e30b7b1b4..a886cd6ecc3f4e 100644 --- a/docs/src/pages/components/autocomplete/Highlights.js +++ b/docs/src/pages/components/autocomplete/Highlights.js @@ -8,6 +8,7 @@ import match from 'autosuggest-highlight/match'; export default function Highlights() { return ( option.title} diff --git a/docs/src/pages/components/autocomplete/Highlights.tsx b/docs/src/pages/components/autocomplete/Highlights.tsx index 4c0dbfb8e84676..47d56b32419ec6 100644 --- a/docs/src/pages/components/autocomplete/Highlights.tsx +++ b/docs/src/pages/components/autocomplete/Highlights.tsx @@ -8,6 +8,7 @@ import match from 'autosuggest-highlight/match'; export default function Highlights() { return ( option.title} diff --git a/docs/src/pages/components/autocomplete/Playground.js b/docs/src/pages/components/autocomplete/Playground.js index e4b2595fc41f66..66a39f1b0be2cd 100644 --- a/docs/src/pages/components/autocomplete/Playground.js +++ b/docs/src/pages/components/autocomplete/Playground.js @@ -19,11 +19,13 @@ export default function Playground() {
} /> ( @@ -31,6 +33,7 @@ export default function Playground() { /> ( @@ -38,6 +41,7 @@ export default function Playground() { /> ( @@ -45,6 +49,7 @@ export default function Playground() { /> ( @@ -52,10 +57,12 @@ export default function Playground() { /> } /> { setValue(newValue); @@ -66,6 +73,7 @@ export default function Playground() { /> ( @@ -74,6 +82,7 @@ export default function Playground() { /> ( @@ -81,6 +90,7 @@ export default function Playground() { /> ( @@ -88,6 +98,7 @@ export default function Playground() { /> ( @@ -95,6 +106,7 @@ export default function Playground() { /> ( @@ -102,11 +114,13 @@ export default function Playground() { /> } /> ( diff --git a/docs/src/pages/components/autocomplete/Playground.tsx b/docs/src/pages/components/autocomplete/Playground.tsx index a8b898119f2eb3..84c10ad8768126 100644 --- a/docs/src/pages/components/autocomplete/Playground.tsx +++ b/docs/src/pages/components/autocomplete/Playground.tsx @@ -17,11 +17,13 @@ export default function Playground() {
} /> ( @@ -29,6 +31,7 @@ export default function Playground() { /> ( @@ -36,6 +39,7 @@ export default function Playground() { /> ( @@ -43,6 +47,7 @@ export default function Playground() { /> ( @@ -50,10 +55,12 @@ export default function Playground() { /> } /> { setValue(newValue); @@ -64,6 +71,7 @@ export default function Playground() { /> ( @@ -72,6 +80,7 @@ export default function Playground() { /> ( @@ -79,6 +88,7 @@ export default function Playground() { /> ( @@ -86,6 +96,7 @@ export default function Playground() { /> ( @@ -93,6 +104,7 @@ export default function Playground() { /> ( @@ -100,11 +112,13 @@ export default function Playground() { /> } /> ( diff --git a/docs/src/pages/components/autocomplete/Tags.js b/docs/src/pages/components/autocomplete/Tags.js index 022e4a2b367936..eb63f556616887 100644 --- a/docs/src/pages/components/autocomplete/Tags.js +++ b/docs/src/pages/components/autocomplete/Tags.js @@ -9,6 +9,7 @@ export default function Tags() {
option.title} defaultValue={[top100Films[13]]} @@ -25,6 +26,7 @@ export default function Tags() { /> option.title} defaultValue={[top100Films[13]]} @@ -42,6 +44,7 @@ export default function Tags() { /> option.title)} defaultValue={[top100Films[13].title]} freeSolo diff --git a/docs/src/pages/components/autocomplete/Tags.tsx b/docs/src/pages/components/autocomplete/Tags.tsx index 4f40a7e11cc12c..aaf05e16bab42b 100644 --- a/docs/src/pages/components/autocomplete/Tags.tsx +++ b/docs/src/pages/components/autocomplete/Tags.tsx @@ -9,6 +9,7 @@ export default function Tags() {
option.title} defaultValue={[top100Films[13]]} @@ -25,6 +26,7 @@ export default function Tags() { /> option.title} defaultValue={[top100Films[13]]} @@ -42,6 +44,7 @@ export default function Tags() { /> option.title)} defaultValue={[top100Films[13].title]} freeSolo diff --git a/docs/src/pages/components/autocomplete/UseAutocomplete.js b/docs/src/pages/components/autocomplete/UseAutocomplete.js index d71b91556972ba..14f82a5d2f6fbe 100644 --- a/docs/src/pages/components/autocomplete/UseAutocomplete.js +++ b/docs/src/pages/components/autocomplete/UseAutocomplete.js @@ -43,6 +43,7 @@ export default function UseAutocomplete() { getOptionProps, groupedOptions, } = useAutocomplete({ + id: 'use-autocomplete-demo', options: top100Films, getOptionLabel: option => option.title, }); diff --git a/docs/src/pages/components/autocomplete/UseAutocomplete.tsx b/docs/src/pages/components/autocomplete/UseAutocomplete.tsx index 726da2a8b96baf..c7bfa1a01e3335 100644 --- a/docs/src/pages/components/autocomplete/UseAutocomplete.tsx +++ b/docs/src/pages/components/autocomplete/UseAutocomplete.tsx @@ -45,6 +45,7 @@ export default function UseAutocomplete() { getOptionProps, groupedOptions, } = useAutocomplete({ + id: 'use-autocomplete-demo', options: top100Films, getOptionLabel: option => option.title, }); diff --git a/docs/src/pages/components/autocomplete/Virtualize.js b/docs/src/pages/components/autocomplete/Virtualize.js index d5a96a0cb14305..fc5661a87b8b13 100644 --- a/docs/src/pages/components/autocomplete/Virtualize.js +++ b/docs/src/pages/components/autocomplete/Virtualize.js @@ -75,6 +75,7 @@ export default function Virtualize() { return ( {renderInput({ + id, disabled, InputLabelProps: getInputLabelProps(), InputProps: { @@ -301,6 +303,7 @@ const Autocomplete = React.forwardRef(function Autocomplete(props, ref) { {disableClearable || disabled ? null : ( ({ id: `${id}-label`, + htmlFor: id, }), getInputProps: () => ({ id, @@ -732,11 +733,11 @@ export default function useAutocomplete(props) { // only have an opinion about this when closed 'aria-activedescendant': popupOpen ? undefined : null, 'aria-autocomplete': autoComplete ? 'both' : 'list', - 'aria-controls': `${id}-popup`, - // autoComplete: 'off', // Disable browser's suggestion that might overlap with the popup. - autoComplete: 'disabled', // disable autocomplete and autofill + 'aria-controls': popupOpen ? `${id}-popup` : null, + // Disable browser's suggestion that might overlap with the popup. + // (autocomplete and autofill) + autoComplete: 'disabled', ref: inputRef, - autoCorrect: 'off', autoCapitalize: 'none', spellCheck: 'false', }),