Repository: downshift-js/downshift Branch: master Commit: f1862ed0633a Files: 231 Total size: 1.1 MB Directory structure: gitextract_fp6r61rc/ ├── .all-contributorsrc ├── .flowconfig ├── .gitattributes ├── .github/ │ ├── ISSUE_TEMPLATE.md │ ├── PULL_REQUEST_TEMPLATE.md │ └── workflows/ │ └── validate.yml ├── .gitignore ├── .npmrc ├── .nvmrc ├── .prettierignore ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── babel.config.js ├── cypress/ │ ├── .eslintrc │ ├── e2e/ │ │ ├── combobox.cy.js │ │ ├── useCombobox.cy.js │ │ ├── useMultipleCombobox.cy.js │ │ ├── useMultipleSelect.cy.js │ │ ├── useSelect.cy.js │ │ └── useTagGroup.cy.js │ ├── fixtures/ │ │ └── example.json │ ├── plugins/ │ │ └── index.js │ └── support/ │ └── e2e.js ├── cypress.config.js ├── docusaurus/ │ ├── pages/ │ │ ├── combobox.js │ │ ├── index.js │ │ ├── useCombobox.js │ │ ├── useMultipleCombobox.js │ │ ├── useMultipleSelect.js │ │ ├── useSelect.js │ │ ├── useTagGroup.css │ │ ├── useTagGroup.tsx │ │ ├── useTagGroupCombobox.css │ │ └── useTagGroupCombobox.tsx │ ├── plugins/ │ │ └── webpack5polyfills.js │ ├── tsconfig.json │ └── utils.ts ├── docusaurus.config.js ├── flow-typed/ │ └── npm/ │ └── downshift_v2.x.x.js.flow ├── jest.config.js ├── netlify.toml ├── other/ │ ├── MAINTAINING.md │ ├── TYPESCRIPT_USAGE.md │ ├── USERS.md │ ├── manual-releases.md │ ├── misc-tests/ │ │ ├── __tests__/ │ │ │ ├── build.js │ │ │ └── preact.js │ │ └── jest.config.js │ ├── react-native/ │ │ ├── .babelrc │ │ ├── __tests__/ │ │ │ ├── __snapshots__/ │ │ │ │ └── render-tests.js.snap │ │ │ ├── onBlur-tests.js │ │ │ ├── onChange-tests.js │ │ │ └── render-tests.js │ │ └── jest.config.js │ └── ssr/ │ ├── __tests__/ │ │ └── index.js │ └── jest.config.js ├── package.json ├── prettier.config.js ├── rollup.config.js ├── src/ │ ├── __mocks__/ │ │ ├── set-a11y-status.js │ │ └── utils.js │ ├── __tests__/ │ │ ├── .eslintrc │ │ ├── __snapshots__/ │ │ │ ├── downshift.aria.js.snap │ │ │ ├── downshift.get-item-props.js.snap │ │ │ ├── downshift.get-menu-props.js.snap │ │ │ ├── downshift.get-root-props.js.snap │ │ │ ├── downshift.misc.js.snap │ │ │ └── set-a11y-status.js.snap │ │ ├── downshift.aria.js │ │ ├── downshift.focus-restoration.js │ │ ├── downshift.get-button-props.js │ │ ├── downshift.get-input-props.js │ │ ├── downshift.get-item-props.js │ │ ├── downshift.get-label-props.js │ │ ├── downshift.get-menu-props.js │ │ ├── downshift.get-root-props.js │ │ ├── downshift.lifecycle.js │ │ ├── downshift.misc-with-utils-mocked.js │ │ ├── downshift.misc.js │ │ ├── downshift.props.js │ │ ├── portal-support.js │ │ ├── set-a11y-status.js │ │ ├── utils.call-all-event-handlers.js │ │ ├── utils.get-a11y-status-message.js │ │ ├── utils.get-highlighted-index.js │ │ ├── utils.handle-refs.js │ │ ├── utils.pick-state.js │ │ ├── utils.reset-id-counter.js │ │ ├── utils.reset-id-counter.r18.js │ │ └── utils.scroll-into-view.js │ ├── downshift.js │ ├── hooks/ │ │ ├── MIGRATION_V7.md │ │ ├── MIGRATION_V8.md │ │ ├── MIGRATION_V9.md │ │ ├── README.md │ │ ├── __tests__/ │ │ │ ├── __snapshots__/ │ │ │ │ └── utils.test.js.snap │ │ │ └── utils.test.js │ │ ├── index.ts │ │ ├── reducer.js │ │ ├── testUtils.js │ │ ├── useCombobox/ │ │ │ ├── README.md │ │ │ ├── __tests__/ │ │ │ │ ├── __snapshots__/ │ │ │ │ │ └── getInputProps.test.js.snap │ │ │ │ ├── getInputProps.test.js │ │ │ │ ├── getItemProps.test.js │ │ │ │ ├── getLabelProps.test.js │ │ │ │ ├── getMenuProps.test.js │ │ │ │ ├── getToggleButtonProps.test.js │ │ │ │ ├── memo.test.js │ │ │ │ ├── props.test.js │ │ │ │ ├── returnProps.test.js │ │ │ │ └── utils.test.js │ │ │ ├── index.js │ │ │ ├── reducer.js │ │ │ ├── stateChangeTypes.js │ │ │ ├── testUtils.js │ │ │ └── utils.js │ │ ├── useMultipleSelection/ │ │ │ ├── MIGRATION_GUIDE.md │ │ │ ├── README.md │ │ │ ├── __tests__/ │ │ │ │ ├── getDropdownProps.test.js │ │ │ │ ├── getSelectedItemProps.test.js │ │ │ │ ├── memo.test.js │ │ │ │ ├── props.test.js │ │ │ │ ├── returnProps.test.js │ │ │ │ └── utils.test.js │ │ │ ├── index.js │ │ │ ├── reducer.js │ │ │ ├── stateChangeTypes.js │ │ │ ├── testUtils.js │ │ │ └── utils.js │ │ ├── useSelect/ │ │ │ ├── README.md │ │ │ ├── __tests__/ │ │ │ │ ├── __snapshots__/ │ │ │ │ │ └── getToggleButtonProps.test.js.snap │ │ │ │ ├── getItemProps.test.js │ │ │ │ ├── getLabelProps.test.js │ │ │ │ ├── getMenuProps.test.js │ │ │ │ ├── getToggleButtonProps.test.js │ │ │ │ ├── memo.test.js │ │ │ │ ├── props.test.js │ │ │ │ ├── returnProps.test.js │ │ │ │ └── utils.test.ts │ │ │ ├── index.js │ │ │ ├── reducer.js │ │ │ ├── stateChangeTypes.js │ │ │ ├── testUtils.js │ │ │ └── utils/ │ │ │ ├── defaultProps.ts │ │ │ ├── getItemIndexByCharacterKey.ts │ │ │ ├── index.ts │ │ │ └── propTypes.ts │ │ ├── useTagGroup/ │ │ │ ├── README.md │ │ │ ├── __tests__/ │ │ │ │ ├── getTagGroupProps.test.ts │ │ │ │ ├── getTagProps.test.ts │ │ │ │ ├── getTagRemoveProps.test.ts │ │ │ │ ├── props.test.ts │ │ │ │ ├── reducer.test.ts │ │ │ │ ├── returnProps.test.ts │ │ │ │ └── utils/ │ │ │ │ ├── defaultIds.ts │ │ │ │ ├── defaultProps.ts │ │ │ │ ├── index.ts │ │ │ │ ├── renderTagGroup.tsx │ │ │ │ └── renderUseTagGroup.ts │ │ │ ├── index.ts │ │ │ ├── index.types.ts │ │ │ ├── reducer.ts │ │ │ ├── stateChangeTypes.ts │ │ │ └── utils/ │ │ │ ├── __tests__/ │ │ │ │ ├── useAccessibleDescription.test.ts │ │ │ │ ├── useElementIds.legacy.test.ts │ │ │ │ └── useElementIds.r18.test.ts │ │ │ ├── getInitialState.ts │ │ │ ├── getMergedProps.ts │ │ │ ├── index.ts │ │ │ ├── isStateEqual.ts │ │ │ ├── useAccessibleDescription.ts │ │ │ ├── useElementIds.ts │ │ │ └── useRovingTagFocus.ts │ │ ├── utils-ts/ │ │ │ ├── __tests__/ │ │ │ │ └── getItemAndIndex.test.ts │ │ │ ├── callOnChangeProps.ts │ │ │ ├── capitalizeString.ts │ │ │ ├── getDefaultValue.ts │ │ │ ├── getInitialValue.ts │ │ │ ├── getItemAndIndex.ts │ │ │ ├── index.ts │ │ │ ├── propTypes.ts │ │ │ ├── stateReducer.ts │ │ │ ├── useA11yMessageStatus.ts │ │ │ ├── useControlledReducer.ts │ │ │ ├── useEnhancedReducer.ts │ │ │ └── useIsInitialMount.ts │ │ ├── utils.dropdown/ │ │ │ ├── __tests__/ │ │ │ │ ├── useElementIds.legacy.test.ts │ │ │ │ └── useElementIds.r18.test.ts │ │ │ ├── defaultProps.ts │ │ │ ├── defaultStateValues.ts │ │ │ ├── index.ts │ │ │ ├── propTypes.ts │ │ │ └── useElementIds.ts │ │ └── utils.js │ ├── index.ts │ ├── is.macro.d.ts │ ├── is.macro.js │ ├── productionEnum.macro.d.ts │ ├── productionEnum.macro.js │ ├── stateChangeTypes.js │ ├── utils-ts/ │ │ ├── __tests__/ │ │ │ ├── getState.test.ts │ │ │ └── handleRefs.test.ts │ │ ├── callAllEventHandlers.ts │ │ ├── debounce.ts │ │ ├── generateId.ts │ │ ├── getState.ts │ │ ├── handleRefs.ts │ │ ├── index.ts │ │ ├── noop.ts │ │ ├── scrollIntoView.ts │ │ ├── setA11yStatus.ts │ │ ├── useLatestRef.ts │ │ └── validatePropTypes.ts │ └── utils.js ├── test/ │ ├── basic.test.js │ ├── basic.test.tsx │ ├── custom.test.js │ ├── custom.test.tsx │ ├── downshift.test.tsx │ ├── setup.ts │ ├── tsconfig.json │ ├── useCombobox.test.tsx │ ├── useMultipleSelect.test.tsx │ └── useSelect.test.tsx ├── tsconfig.json ├── tsconfig.preact.json └── typings/ ├── index.d.ts └── index.legacy.d.ts ================================================ FILE CONTENTS ================================================ ================================================ FILE: .all-contributorsrc ================================================ { "projectName": "downshift", "projectOwner": "downshift-js", "repoType": "github", "files": [ "README.md" ], "imageSize": 100, "commit": false, "contributors": [ { "login": "kentcdodds", "name": "Kent C. Dodds", "avatar_url": "https://avatars.githubusercontent.com/u/1500684?v=3", "profile": "https://kentcdodds.com", "contributions": [ "code", "doc", "infra", "test", "review", "blog", "bug", "example", "ideas", "talk" ] }, { "login": "ryanflorence", "name": "Ryan Florence", "avatar_url": "https://avatars0.githubusercontent.com/u/100200?v=4", "profile": "http://twitter.com/ryanflorence", "contributions": [ "ideas" ] }, { "login": "jaredly", "name": "Jared Forsyth", "avatar_url": "https://avatars3.githubusercontent.com/u/112170?v=4", "profile": "http://jaredforsyth.com", "contributions": [ "ideas", "doc" ] }, { "login": "jtmthf", "name": "Jack Moore", "avatar_url": "https://avatars1.githubusercontent.com/u/8162598?v=4", "profile": "https://github.com/jtmthf", "contributions": [ "example" ] }, { "login": "souporserious", "name": "Travis Arnold", "avatar_url": "https://avatars1.githubusercontent.com/u/2762082?v=4", "profile": "https://souporserious.com/", "contributions": [ "code", "doc" ] }, { "login": "marcysutton", "name": "Marcy Sutton", "avatar_url": "https://avatars0.githubusercontent.com/u/1045233?v=4", "profile": "http://marcysutton.com", "contributions": [ "bug", "ideas" ] }, { "login": "tizmagik", "name": "Jeremy Gayed", "avatar_url": "https://avatars2.githubusercontent.com/u/244704?v=4", "profile": "http://www.jeremygayed.com", "contributions": [ "example" ] }, { "login": "Haroenv", "name": "Haroen Viaene", "avatar_url": "https://avatars3.githubusercontent.com/u/6270048?v=4", "profile": "https://haroen.me", "contributions": [ "example" ] }, { "login": "rezof", "name": "monssef", "avatar_url": "https://avatars2.githubusercontent.com/u/15073300?v=4", "profile": "https://github.com/rezof", "contributions": [ "example" ] }, { "login": "FezVrasta", "name": "Federico Zivolo", "avatar_url": "https://avatars2.githubusercontent.com/u/5382443?v=4", "profile": "https://fezvrasta.github.io", "contributions": [ "doc" ] }, { "login": "divyenduz", "name": "Divyendu Singh", "avatar_url": "https://avatars3.githubusercontent.com/u/746482?v=4", "profile": "https://divyendusingh.com", "contributions": [ "example", "code", "doc", "test" ] }, { "login": "salmanmanekia", "name": "Muhammad Salman", "avatar_url": "https://avatars1.githubusercontent.com/u/841955?v=4", "profile": "https://github.com/salmanmanekia", "contributions": [ "code" ] }, { "login": "psicotropicos", "name": "João Alberto", "avatar_url": "https://avatars3.githubusercontent.com/u/10820159?v=4", "profile": "https://twitter.com/psicotropidev", "contributions": [ "code" ] }, { "login": "bernard-lin", "name": "Bernard Lin", "avatar_url": "https://avatars0.githubusercontent.com/u/16327281?v=4", "profile": "https://github.com/bernard-lin", "contributions": [ "code", "doc" ] }, { "login": "geoffdavis92", "name": "Geoff Davis", "avatar_url": "https://avatars1.githubusercontent.com/u/7330124?v=4", "profile": "https://geoffdavis.info", "contributions": [ "example" ] }, { "login": "reznord", "name": "Anup", "avatar_url": "https://avatars0.githubusercontent.com/u/3415488?v=4", "profile": "https://github.com/reznord", "contributions": [ "doc" ] }, { "login": "ferdinandsalis", "name": "Ferdinand Salis", "avatar_url": "https://avatars0.githubusercontent.com/u/340520?v=4", "profile": "http://ferdinandsalis.com", "contributions": [ "bug", "code" ] }, { "login": "tkh44", "name": "Kye Hohenberger", "avatar_url": "https://avatars2.githubusercontent.com/u/662750?v=4", "profile": "https://github.com/tkh44", "contributions": [ "bug" ] }, { "login": "jgoux", "name": "Julien Goux", "avatar_url": "https://avatars0.githubusercontent.com/u/1443499?v=4", "profile": "https://github.com/jgoux", "contributions": [ "bug", "code", "test" ] }, { "login": "jseminck", "name": "Joachim Seminck", "avatar_url": "https://avatars2.githubusercontent.com/u/9586897?v=4", "profile": "https://github.com/jseminck", "contributions": [ "code" ] }, { "login": "the-simian", "name": "Jesse Harlin", "avatar_url": "https://avatars3.githubusercontent.com/u/954596?v=4", "profile": "http://jesseharlin.net/", "contributions": [ "bug", "example" ] }, { "login": "pbomb", "name": "Matt Parrish", "avatar_url": "https://avatars0.githubusercontent.com/u/1402095?v=4", "profile": "https://github.com/pbomb", "contributions": [ "tool", "review" ] }, { "login": "thomhos", "name": "thom", "avatar_url": "https://avatars1.githubusercontent.com/u/11661846?v=4", "profile": "http://thom.kr", "contributions": [ "code" ] }, { "login": "vutran", "name": "Vu Tran", "avatar_url": "https://avatars2.githubusercontent.com/u/1088312?v=4", "profile": "http://twitter.com/tranvu", "contributions": [ "code" ] }, { "login": "codiemullins", "name": "Codie Mullins", "avatar_url": "https://avatars1.githubusercontent.com/u/74193?v=4", "profile": "https://github.com/codiemullins", "contributions": [ "code", "example" ] }, { "login": "morajabi", "name": "Mohammad Rajabifard", "avatar_url": "https://avatars3.githubusercontent.com/u/12202757?v=4", "profile": "https://morajabi.me", "contributions": [ "doc", "ideas" ] }, { "login": "tansongyang", "name": "Frank Tan", "avatar_url": "https://avatars3.githubusercontent.com/u/9488719?v=4", "profile": "https://github.com/tansongyang", "contributions": [ "code" ] }, { "login": "srph", "name": "Kier Borromeo", "avatar_url": "https://avatars3.githubusercontent.com/u/5093058?v=4", "profile": "https://kierb.com", "contributions": [ "example" ] }, { "login": "paul-veevers", "name": "Paul Veevers", "avatar_url": "https://avatars1.githubusercontent.com/u/8969456?v=4", "profile": "https://github.com/paul-veevers", "contributions": [ "code" ] }, { "login": "Ronolibert", "name": "Ron Cruz", "avatar_url": "https://avatars2.githubusercontent.com/u/13622298?v=4", "profile": "https://github.com/Ronolibert", "contributions": [ "doc" ] }, { "login": "rickMcGavin", "name": "Rick McGavin", "avatar_url": "https://avatars1.githubusercontent.com/u/13605633?v=4", "profile": "http://rickmcgavin.github.io", "contributions": [ "doc" ] }, { "login": "vejersele", "name": "Jelle Versele", "avatar_url": "https://avatars0.githubusercontent.com/u/869669?v=4", "profile": "http://twitter.com/vejersele", "contributions": [ "example" ] }, { "login": "brentertz", "name": "Brent Ertz", "avatar_url": "https://avatars1.githubusercontent.com/u/202773?v=4", "profile": "https://github.com/brentertz", "contributions": [ "ideas" ] }, { "login": "Dajust", "name": "Justice Mba ", "avatar_url": "https://avatars3.githubusercontent.com/u/8015514?v=4", "profile": "https://github.com/Dajust", "contributions": [ "code", "doc", "ideas" ] }, { "login": "ellismarkf", "name": "Mark Ellis", "avatar_url": "https://avatars2.githubusercontent.com/u/3925281?v=4", "profile": "http://mfellis.com", "contributions": [ "ideas" ] }, { "login": "usandfriends", "name": "us͡an̸df͘rien͜ds͠", "avatar_url": "https://avatars1.githubusercontent.com/u/3241922?v=4", "profile": "http://ronak.io/", "contributions": [ "bug", "code", "test" ] }, { "login": "robin-drexler", "name": "Robin Drexler", "avatar_url": "https://avatars0.githubusercontent.com/u/474248?v=4", "profile": "https://www.robin-drexler.com/", "contributions": [ "bug", "code" ] }, { "login": "arturoromeroslc", "name": "Arturo Romero", "avatar_url": "https://avatars0.githubusercontent.com/u/7406639?v=4", "profile": "http://arturoromero.info/", "contributions": [ "example" ] }, { "login": "yp", "name": "yp", "avatar_url": "https://avatars1.githubusercontent.com/u/275483?v=4", "profile": "http://algolab.eu/pirola", "contributions": [ "bug", "code", "test" ] }, { "login": "ifyoumakeit", "name": "Dave Garwacke", "avatar_url": "https://avatars0.githubusercontent.com/u/3998604?v=4", "profile": "http://www.warbyparker.com", "contributions": [ "doc" ] }, { "login": "Drapegnik", "name": "Ivan Pazhitnykh", "avatar_url": "https://avatars3.githubusercontent.com/u/11758660?v=4", "profile": "http://linkedin.com/in/drapegnik", "contributions": [ "code", "test" ] }, { "login": "Rendez", "name": "Luis Merino", "avatar_url": "https://avatars0.githubusercontent.com/u/61776?v=4", "profile": "https://github.com/Rendez", "contributions": [ "doc" ] }, { "login": "arahansen", "name": "Andrew Hansen", "avatar_url": "https://avatars0.githubusercontent.com/u/8746094?v=4", "profile": "http://twitter.com/arahansen", "contributions": [ "code", "test", "ideas" ] }, { "login": "Jwhiles", "name": "John Whiles", "avatar_url": "https://avatars3.githubusercontent.com/u/20307225?v=4", "profile": "http://www.johnwhiles.com", "contributions": [ "code" ] }, { "login": "wKovacs64", "name": "Justin Hall", "avatar_url": "https://avatars1.githubusercontent.com/u/1288694?v=4", "profile": "https://github.com/wKovacs64", "contributions": [ "infra" ] }, { "login": "petetnt", "name": "Pete Nykänen", "avatar_url": "https://avatars2.githubusercontent.com/u/7641760?v=4", "profile": "https://twitter.com/pete_tnt", "contributions": [ "review" ] }, { "login": "jaredpalmer", "name": "Jared Palmer", "avatar_url": "https://avatars2.githubusercontent.com/u/4060187?v=4", "profile": "http://jaredpalmer.com", "contributions": [ "code" ] }, { "login": "philipyoungg", "name": "Philip Young", "avatar_url": "https://avatars3.githubusercontent.com/u/11477718?v=4", "profile": "http://www.philipyoungg.com", "contributions": [ "code", "test", "ideas" ] }, { "login": "alexandernanberg", "name": "Alexander Nanberg", "avatar_url": "https://avatars3.githubusercontent.com/u/8997319?v=4", "profile": "https://alexandernanberg.com", "contributions": [ "doc", "code" ] }, { "login": "httpete-ire", "name": "Pete Redmond", "avatar_url": "https://avatars2.githubusercontent.com/u/1556430?v=4", "profile": "https://httpete.com", "contributions": [ "bug" ] }, { "login": "Zashy", "name": "Nick Lavin", "avatar_url": "https://avatars2.githubusercontent.com/u/1706342?v=4", "profile": "https://github.com/Zashy", "contributions": [ "bug", "code", "test" ] }, { "login": "jlongster", "name": "James Long", "avatar_url": "https://avatars2.githubusercontent.com/u/17031?v=4", "profile": "http://jlongster.com", "contributions": [ "bug", "code" ] }, { "login": "cycomachead", "name": "Michael Ball", "avatar_url": "https://avatars0.githubusercontent.com/u/1505907?v=4", "profile": "http://michaelball.co", "contributions": [ "bug", "code", "test" ] }, { "login": "Julienng", "name": "CAVALEIRO Julien", "avatar_url": "https://avatars0.githubusercontent.com/u/8990614?v=4", "profile": "https://github.com/Julienng", "contributions": [ "example" ] }, { "login": "kimgronqvist", "name": "Kim Grönqvist", "avatar_url": "https://avatars1.githubusercontent.com/u/3421067?v=4", "profile": "http://www.kimgronqvist.se", "contributions": [ "code", "test" ] }, { "login": "tiansijie", "name": "Sijie", "avatar_url": "https://avatars2.githubusercontent.com/u/3675602?v=4", "profile": "http://sijietian.com", "contributions": [ "bug", "code" ] }, { "login": "donysukardi", "name": "Dony Sukardi", "avatar_url": "https://avatars0.githubusercontent.com/u/410792?v=4", "profile": "http://dsds.io", "contributions": [ "example", "question", "code", "test" ] }, { "login": "dmmulroy", "name": "Dillon Mulroy", "avatar_url": "https://avatars1.githubusercontent.com/u/2755722?v=4", "profile": "https://dillonmulroy.com", "contributions": [ "doc" ] }, { "login": "curtiswilkinson", "name": "Curtis Tate Wilkinson", "avatar_url": "https://avatars3.githubusercontent.com/u/12440573?v=4", "profile": "https://twitter.com/curtytate", "contributions": [ "code" ] }, { "login": "brikou", "name": "Brice BERNARD", "avatar_url": "https://avatars3.githubusercontent.com/u/383212?v=4", "profile": "https://github.com/brikou", "contributions": [ "bug", "code" ] }, { "login": "xutopia", "name": "Tony Xu", "avatar_url": "https://avatars3.githubusercontent.com/u/14304503?v=4", "profile": "https://github.com/xutopia", "contributions": [ "code" ] }, { "login": "newyork-anthonyng", "name": "Anthony Ng", "avatar_url": "https://avatars1.githubusercontent.com/u/14035529?v=4", "profile": "http://anthonyng.me", "contributions": [ "doc" ] }, { "login": "notruth", "name": "S S", "avatar_url": "https://avatars2.githubusercontent.com/u/11996139?v=4", "profile": "https://github.com/notruth", "contributions": [ "question", "code", "doc", "ideas", "test" ] }, { "login": "austintackaberry", "name": "Austin Tackaberry", "avatar_url": "https://avatars0.githubusercontent.com/u/29493001?v=4", "profile": "http://austintackaberry.co", "contributions": [ "question", "code", "doc", "bug", "example", "ideas", "review", "test" ] }, { "login": "jduthon", "name": "Jean Duthon", "avatar_url": "https://avatars3.githubusercontent.com/u/4168055?v=4", "profile": "https://github.com/jduthon", "contributions": [ "bug", "code" ] }, { "login": "Antontelesh", "name": "Anton Telesh", "avatar_url": "https://avatars3.githubusercontent.com/u/3889580?v=4", "profile": "http://antontelesh.github.io", "contributions": [ "bug", "code" ] }, { "login": "ericedem", "name": "Eric Edem", "avatar_url": "https://avatars3.githubusercontent.com/u/1060669?v=4", "profile": "https://github.com/ericedem", "contributions": [ "code", "doc", "ideas", "test" ] }, { "login": "indiesquidge", "name": "Austin Wood", "avatar_url": "https://avatars3.githubusercontent.com/u/3409645?v=4", "profile": "https://github.com/indiesquidge", "contributions": [ "question", "doc", "review" ] }, { "login": "mmmurray", "name": "Mark Murray", "avatar_url": "https://avatars3.githubusercontent.com/u/14275790?v=4", "profile": "https://github.com/mmmurray", "contributions": [ "infra" ] }, { "login": "gsimone", "name": "Gianmarco", "avatar_url": "https://avatars0.githubusercontent.com/u/1862172?v=4", "profile": "https://github.com/gsimone", "contributions": [ "bug", "code" ] }, { "login": "pastr", "name": "Emmanuel Pastor", "avatar_url": "https://avatars2.githubusercontent.com/u/6838136?v=4", "profile": "https://github.com/pastr", "contributions": [ "example" ] }, { "login": "dalehurwitz", "name": "dalehurwitz", "avatar_url": "https://avatars2.githubusercontent.com/u/10345034?v=4", "profile": "https://github.com/dalehurwitz", "contributions": [ "code" ] }, { "login": "blobor", "name": "Bogdan Lobor", "avatar_url": "https://avatars1.githubusercontent.com/u/4813007?v=4", "profile": "https://github.com/blobor", "contributions": [ "bug", "code" ] }, { "login": "infiniteluke", "name": "Luke Herrington", "avatar_url": "https://avatars0.githubusercontent.com/u/1127238?v=4", "profile": "https://github.com/infiniteluke", "contributions": [ "example" ] }, { "login": "drobannx", "name": "Brandon Clemons", "avatar_url": "https://avatars2.githubusercontent.com/u/6361167?v=4", "profile": "https://github.com/drobannx", "contributions": [ "code" ] }, { "login": "aMollusk", "name": "Kieran", "avatar_url": "https://avatars0.githubusercontent.com/u/10591587?v=4", "profile": "https://github.com/aMollusk", "contributions": [ "code" ] }, { "login": "Brushedoctopus", "name": "Brushedoctopus", "avatar_url": "https://avatars3.githubusercontent.com/u/11570627?v=4", "profile": "https://github.com/Brushedoctopus", "contributions": [ "bug", "code" ] }, { "login": "cameronprattedwards", "name": "Cameron Edwards", "avatar_url": "https://avatars3.githubusercontent.com/u/5456216?v=4", "profile": "http://cameronpedwards.com", "contributions": [ "code", "test" ] }, { "login": "stereobooster", "name": "stereobooster", "avatar_url": "https://avatars2.githubusercontent.com/u/179534?v=4", "profile": "https://github.com/stereobooster", "contributions": [ "code", "test" ] }, { "login": "1Copenut", "name": "Trevor Pierce", "avatar_url": "https://avatars0.githubusercontent.com/u/934879?v=4", "profile": "https://github.com/1Copenut", "contributions": [ "review" ] }, { "login": "franklixuefei", "name": "Xuefei Li", "avatar_url": "https://avatars1.githubusercontent.com/u/1334982?v=4", "profile": "http://xuefei-frank.com", "contributions": [ "code" ] }, { "login": "alfredringstad", "name": "Alfred Ringstad", "avatar_url": "https://avatars0.githubusercontent.com/u/7252803?v=4", "profile": "https://hyperlab.se", "contributions": [ "code" ] }, { "login": "dovidweisz", "name": "D[oa]vid Weisz", "avatar_url": "https://avatars0.githubusercontent.com/u/6895497?v=4", "profile": "https://github.com/dovidweisz", "contributions": [ "code" ] }, { "login": "RoystonS", "name": "Royston Shufflebotham", "avatar_url": "https://avatars0.githubusercontent.com/u/19773?v=4", "profile": "https://github.com/RoystonS", "contributions": [ "bug", "code" ] }, { "login": "MichaelDeBoey", "name": "Michaël De Boey", "avatar_url": "https://avatars3.githubusercontent.com/u/6643991?v=4", "profile": "http://michaeldeboey.be", "contributions": [ "code" ] }, { "login": "EricHenry", "name": "Henry", "avatar_url": "https://avatars3.githubusercontent.com/u/4412771?v=4", "profile": "https://github.com/EricHenry", "contributions": [ "code" ] }, { "login": "green-arrow", "name": "Andrew Walton", "avatar_url": "https://avatars3.githubusercontent.com/u/2180127?v=4", "profile": "http://www.greenarrow.me", "contributions": [ "bug", "code", "test" ] }, { "login": "arthurdenner", "name": "Arthur Denner", "avatar_url": "https://avatars0.githubusercontent.com/u/13774309?v=4", "profile": "https://github.com/arthurdenner", "contributions": [ "code" ] }, { "login": "stipsan", "name": "Cody Olsen", "avatar_url": "https://avatars2.githubusercontent.com/u/81981?v=4", "profile": "http://twitter.com/stipsan", "contributions": [ "code" ] }, { "login": "TLadd", "name": "Thomas Ladd", "avatar_url": "https://avatars0.githubusercontent.com/u/5084492?v=4", "profile": "https://github.com/TLadd", "contributions": [ "code" ] }, { "login": "lixualinta", "name": "lixualinta", "avatar_url": "https://avatars3.githubusercontent.com/u/34634369?v=4", "profile": "https://github.com/lixualinta", "contributions": [ "code" ] }, { "login": "JCofman", "name": "Jacob Cofman", "avatar_url": "https://avatars2.githubusercontent.com/u/2118956?v=4", "profile": "https://twitter.com/JCofman", "contributions": [ "code" ] }, { "login": "jf248", "name": "Joshua Freedman", "avatar_url": "https://avatars3.githubusercontent.com/u/19275184?v=4", "profile": "https://github.com/jf248", "contributions": [ "code" ] }, { "login": "AmyScript", "name": "Amy", "avatar_url": "https://avatars1.githubusercontent.com/u/24494020?v=4", "profile": "https://github.com/AmyScript", "contributions": [ "example" ] }, { "login": "roginfarrer", "name": "Rogin Farrer", "avatar_url": "https://avatars1.githubusercontent.com/u/9063669?v=4", "profile": "http://twitter.com/roginfarrer", "contributions": [ "code" ] }, { "login": "rifler", "name": "Dmitrii Kanatnikov", "avatar_url": "https://avatars3.githubusercontent.com/u/871583", "profile": "https://github.com/rifler", "contributions": [ "code" ] }, { "login": "dallonf", "name": "Dallon Feldner", "avatar_url": "https://avatars2.githubusercontent.com/u/346300?v=4", "profile": "https://github.com/dallonf", "contributions": [ "bug", "code" ] }, { "login": "samuelfullerthomas", "name": "Samuel Fuller Thomas", "avatar_url": "https://avatars2.githubusercontent.com/u/10165959?v=4", "profile": "https://samuelfullerthomas.com", "contributions": [ "code" ] }, { "login": "audiolion", "name": "Ryan Castner", "avatar_url": "https://avatars1.githubusercontent.com/u/2430381?v=4", "profile": "http://audiolion.github.io", "contributions": [ "code" ] }, { "login": "silviuavram", "name": "Silviu Alexandru Avram", "avatar_url": "https://avatars2.githubusercontent.com/u/11275392?v=4", "profile": "https://github.com/silviuavram", "contributions": [ "bug", "code", "test" ] }, { "login": "akronb", "name": "Anton Volkov", "avatar_url": "https://avatars1.githubusercontent.com/u/15676655?v=4", "profile": "https://github.com/akronb", "contributions": [ "code", "test" ] }, { "login": "keeganstreet", "name": "Keegan Street", "avatar_url": "https://avatars3.githubusercontent.com/u/513363?v=4", "profile": "http://keegan.st", "contributions": [ "bug", "code" ] }, { "login": "mdugue", "name": "Manuel Dugué", "avatar_url": "https://avatars1.githubusercontent.com/u/894149?v=4", "profile": "http://manueldugue.de", "contributions": [ "code" ] }, { "login": "mkaradeniz", "name": "Max Karadeniz", "avatar_url": "https://avatars2.githubusercontent.com/u/12477983?v=4", "profile": "https://github.com/mkaradeniz", "contributions": [ "code" ] }, { "login": "GonchuB", "name": "Gonzalo Beviglia", "avatar_url": "https://avatars3.githubusercontent.com/u/857221?v=4", "profile": "https://medium.com/@gonchub", "contributions": [ "bug", "code", "review" ] }, { "login": "kilrain", "name": "Brian Kilrain", "avatar_url": "https://avatars2.githubusercontent.com/u/47700687?v=4", "profile": "https://github.com/kilrain", "contributions": [ "bug", "code", "test", "doc" ] }, { "login": "rincedd", "name": "Gerd Zschaler", "avatar_url": "https://avatars0.githubusercontent.com/u/321265?v=4", "profile": "http://www.gzschaler.de", "contributions": [ "code", "bug" ] }, { "login": "gaskar", "name": "Karen Gasparyan", "avatar_url": "https://avatars1.githubusercontent.com/u/491166?v=4", "profile": "https://github.com/gaskar", "contributions": [ "code" ] }, { "login": "kserjey", "name": "Sergey Korchinskiy", "avatar_url": "https://avatars1.githubusercontent.com/u/19753880?v=4", "profile": "https://github.com/kserjey", "contributions": [ "bug", "code", "test" ] }, { "login": "edygar", "name": "Edygar Oliveira", "avatar_url": "https://avatars.githubusercontent.com/u/566280?v=3", "profile": "https://github.com/edygar", "contributions": [ "code", "bug" ] }, { "login": "epeicher", "name": "epeicher", "avatar_url": "https://avatars1.githubusercontent.com/u/3519124?v=4", "profile": "https://github.com/epeicher", "contributions": [ "bug" ] }, { "login": "francoischalifour", "name": "François Chalifour", "avatar_url": "https://avatars3.githubusercontent.com/u/6137112?v=4", "profile": "https://francoischalifour.com", "contributions": [ "code", "test", "platform" ] }, { "login": "maxmalov", "name": "Maxim Malov", "avatar_url": "https://avatars2.githubusercontent.com/u/284129?v=4", "profile": "https://github.com/maxmalov", "contributions": [ "bug", "code" ] }, { "login": "epiqueras", "name": "Enrique Piqueras", "avatar_url": "https://avatars2.githubusercontent.com/u/19157096?v=4", "profile": "https://epiqueras.github.io", "contributions": [ "ideas" ] }, { "login": "layershifter", "name": "Oleksandr Fediashov", "avatar_url": "https://avatars0.githubusercontent.com/u/14183168?v=4", "profile": "https://twitter.com/layershifter", "contributions": [ "code", "infra", "ideas" ] }, { "login": "saitonakamura", "name": "Mikhail Bashurov", "avatar_url": "https://avatars1.githubusercontent.com/u/1552189?v=4", "profile": "https://github.com/saitonakamura", "contributions": [ "code", "bug" ] }, { "login": "jgodi", "name": "Joshua Godi", "avatar_url": "https://avatars1.githubusercontent.com/u/870799?v=4", "profile": "http://www.joshuagodi.com", "contributions": [ "code" ] }, { "login": "lukyth", "name": "Kanitkorn Sujautra", "avatar_url": "https://avatars3.githubusercontent.com/u/7040242?v=4", "profile": "https://github.com/lukyth", "contributions": [ "bug", "code" ] }, { "login": "jorgemoya", "name": "Jorge Moya", "avatar_url": "https://avatars3.githubusercontent.com/u/196129?v=4", "profile": "https://github.com/jorgemoya", "contributions": [ "code", "bug" ] }, { "login": "KubaJastrz", "name": "Jakub Jastrzębski", "avatar_url": "https://avatars0.githubusercontent.com/u/6443113?v=4", "profile": "https://kubajastrz.com", "contributions": [ "code" ] }, { "login": "mufasa71", "name": "Shukhrat Mukimov", "avatar_url": "https://avatars1.githubusercontent.com/u/626420?v=4", "profile": "https://github.com/mufasa71", "contributions": [ "code" ] }, { "login": "jhonnymoreira", "name": "Jhonny Moreira", "avatar_url": "https://avatars0.githubusercontent.com/u/2177742?v=4", "profile": "http://jhonnymoreira.dev", "contributions": [ "code" ] }, { "login": "stefanprobst", "name": "stefanprobst", "avatar_url": "https://avatars0.githubusercontent.com/u/20753323?v=4", "profile": "https://github.com/stefanprobst", "contributions": [ "code", "test" ] }, { "login": "louisaspicer", "name": "Louisa Spicer", "avatar_url": "https://avatars1.githubusercontent.com/u/20270031?v=4", "profile": "https://github.com/louisaspicer", "contributions": [ "code", "bug" ] }, { "login": "neet", "name": "Ryō Igarashi", "avatar_url": "https://avatars2.githubusercontent.com/u/19276905?v=4", "profile": "https://neet.love", "contributions": [ "bug", "code" ] }, { "login": "rlue", "name": "Ryan Lue", "avatar_url": "https://avatars2.githubusercontent.com/u/12194123?v=4", "profile": "http://ryanlue.com/", "contributions": [ "doc" ] }, { "login": "mattleonowicz", "name": "Mateusz Leonowicz", "avatar_url": "https://avatars3.githubusercontent.com/u/9438872?v=4", "profile": "https://github.com/mattleonowicz", "contributions": [ "code" ] }, { "login": "atomicpages", "name": "Dennis Thompson", "avatar_url": "https://avatars2.githubusercontent.com/u/1824291?v=4", "profile": "https://github.com/atomicpages", "contributions": [ "test" ] }, { "login": "mayicodefuture", "name": "Maksym Boytsov", "avatar_url": "https://avatars1.githubusercontent.com/u/32408893?v=4", "profile": "https://mayicodefuture.live", "contributions": [ "code" ] }, { "login": "IwalkAlone", "name": "Sergey Skrynnikov", "avatar_url": "https://avatars1.githubusercontent.com/u/5685800?v=4", "profile": "http://dataart.com", "contributions": [ "code", "test" ] }, { "login": "vvo", "name": "Vincent Voyer", "avatar_url": "https://avatars0.githubusercontent.com/u/123822?v=4", "profile": "https://www.linkedin.com/in/vvoyer", "contributions": [ "doc" ] }, { "login": "limejoe", "name": "limejoe", "avatar_url": "https://avatars2.githubusercontent.com/u/7977551?v=4", "profile": "https://github.com/limejoe", "contributions": [ "code", "bug" ] }, { "login": "k88manish", "name": "Manish Kumar", "avatar_url": "https://avatars2.githubusercontent.com/u/19614770?v=4", "profile": "https://github.com/k88manish", "contributions": [ "code" ] }, { "login": "fcrezza", "name": "Anang Fachreza", "avatar_url": "https://avatars2.githubusercontent.com/u/48123020?v=4", "profile": "https://github.com/fcrezza", "contributions": [ "doc", "example" ] }, { "login": "ndeom", "name": "Nick Deom", "avatar_url": "https://avatars2.githubusercontent.com/u/56491159?v=4", "profile": "http://nickdeom.com", "contributions": [ "code", "bug" ] }, { "login": "clementgarbay", "name": "Clément Garbay", "avatar_url": "https://avatars3.githubusercontent.com/u/12433625?v=4", "profile": "https://github.com/clementgarbay", "contributions": [ "code" ] }, { "login": "KaiminHuang", "name": "Kaimin Huang", "avatar_url": "https://avatars.githubusercontent.com/u/5600404?v=4", "profile": "https://github.com/KaiminHuang", "contributions": [ "code", "bug" ] }, { "login": "davewelling", "name": "David Welling", "avatar_url": "https://avatars.githubusercontent.com/u/1242456?v=4", "profile": "http://theredcircuit.com", "contributions": [ "code", "bug", "ideas", "research" ] }, { "login": "chandrasekhar1996", "name": "chandrasekhar1996", "avatar_url": "https://avatars.githubusercontent.com/u/33996892?v=4", "profile": "https://github.com/chandrasekhar1996", "contributions": [ "bug", "code" ] }, { "login": "drewbrend", "name": "Brendan Drew", "avatar_url": "https://avatars.githubusercontent.com/u/5375799?v=4", "profile": "https://github.com/drewbrend", "contributions": [ "code" ] }, { "login": "jeanpan", "name": "Jean Pan", "avatar_url": "https://avatars.githubusercontent.com/u/1307026?v=4", "profile": "https://github.com/jeanpan", "contributions": [ "code" ] }, { "login": "tjenkinson", "name": "Tom Jenkinson", "avatar_url": "https://avatars.githubusercontent.com/u/3259993?v=4", "profile": "https://tjenkinson.me", "contributions": [ "infra" ] }, { "login": "aliceHendicott", "name": "Alice Hendicott", "avatar_url": "https://avatars.githubusercontent.com/u/40346716?v=4", "profile": "https://github.com/aliceHendicott", "contributions": [ "code", "bug" ] }, { "login": "zmdavis", "name": "Zach Davis", "avatar_url": "https://avatars.githubusercontent.com/u/25305144?v=4", "profile": "https://github.com/zmdavis", "contributions": [ "code", "bug" ] } ], "repoHost": "https://github.com", "contributorsPerLine": 7, "skipCi": true, "commitConvention": "angular", "commitType": "docs" } ================================================ FILE: .flowconfig ================================================ [ignore] .*/node_modules/ [include] ./test [libs] [lints] all=error [options] ================================================ FILE: .gitattributes ================================================ * text=auto *.js text eol=lf ================================================ FILE: .github/ISSUE_TEMPLATE.md ================================================ - `downshift` version: - `node` version: - `npm` (or `yarn`) version: **Relevant code or config** ```javascript ``` **What you did**: **What happened**: **Reproduction repository**: **Problem description**: **Suggested solution**: ================================================ FILE: .github/PULL_REQUEST_TEMPLATE.md ================================================ # Pull Request ## What ## Why ## How ## Changes ## Checklist - [ ] Documentation - [ ] Tests - [ ] TypeScript Types - [ ] Ready to be merged ================================================ FILE: .github/workflows/validate.yml ================================================ name: validate on: push: branches: - '+([0-9])?(.{+([0-9]),x}).x' - 'master' - 'next' - 'next-major' - 'beta' - 'alpha' - '!all-contributors/**' pull_request: {} jobs: main: # ignore all-contributors PRs if: ${{ !contains(github.head_ref, 'all-contributors') }} strategy: matrix: node: [20, 22, 24] runs-on: ubuntu-latest steps: - name: 🛑 Cancel Previous Runs uses: styfle/cancel-workflow-action@0.12.1 with: access_token: ${{ secrets.GITHUB_TOKEN }} - name: ⬇️ Checkout repo uses: actions/checkout@v5 - name: Increase watchers run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p - name: ⎔ Setup node uses: actions/setup-node@v5 with: node-version: ${{ matrix.node }} - name: 📥 Download deps uses: bahmutov/npm-install@v1 with: useLockFile: false - name: ▶️ Run validate script run: npm run validate env: FORCE_COLOR: true - name: ⬆️ Upload coverage report uses: codecov/codecov-action@v5 env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} release: needs: main runs-on: ubuntu-latest if: ${{ github.repository == 'downshift-js/downshift' && contains('refs/heads/master,refs/heads/beta,refs/heads/next,refs/heads/alpha', github.ref) && github.event_name == 'push' }} steps: - name: 🛑 Cancel Previous Runs uses: styfle/cancel-workflow-action@0.12.1 with: access_token: ${{ secrets.GITHUB_TOKEN }} - name: ⬇️ Checkout repo uses: actions/checkout@v5 - name: ⎔ Setup node uses: actions/setup-node@v5 with: node-version: 24 - name: 📥 Download deps uses: bahmutov/npm-install@v1 with: useLockFile: false - name: 🏗 Run build script run: npm run build - name: 🚀 Release uses: cycjimmy/semantic-release-action@v6 with: semantic_version: 24 branches: | [ '+([0-9])?(.{+([0-9]),x}).x', 'master', 'next', 'next-major', {name: 'beta', prerelease: true}, {name: 'alpha', prerelease: true} ] env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} ================================================ FILE: .gitignore ================================================ node_modules coverage dist .opt-in .opt-out .DS_Store .next .eslintcache preact/ cypress/videos cypress/screenshots # these cause more harm than good # when working with contributors package-lock.json yarn.lock flow-coverage/ # Production /build # Generated files .docusaurus .cache-loader # Misc .env.local .env.development.local .env.test.local .env.production.local npm-debug.log* # IDE settings .idea ================================================ FILE: .npmrc ================================================ registry=https://registry.npmjs.org/ package-lock=false ================================================ FILE: .nvmrc ================================================ 16.14.0 ================================================ FILE: .prettierignore ================================================ node_modules/ coverage/ dist/ preact/ package-lock.json package.json ================================================ FILE: CHANGELOG.md ================================================ # CHANGELOG The changelog is automatically updated using [semantic-release](https://github.com/semantic-release/semantic-release). You can see it on the [releases page](../../releases). ================================================ FILE: CODE_OF_CONDUCT.md ================================================ # Contributor Covenant Code of Conduct **Table of Contents** - [Our Pledge](#our-pledge) - [Our Standards](#our-standards) - [Our Responsibilities](#our-responsibilities) - [Scope](#scope) - [Enforcement](#enforcement) - [Attribution](#attribution) ## Our Pledge In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. ## Our Standards Examples of behavior that contributes to creating a positive environment include: - Using welcoming and inclusive language - Being respectful of differing viewpoints and experiences - Gracefully accepting constructive criticism - Focusing on what is best for the community - Showing empathy towards other community members Examples of unacceptable behavior by participants include: - The use of sexualized language or imagery and unwelcome sexual attention or advances - Trolling, insulting/derogatory comments, and personal or political attacks - Public or private harassment - Publishing others' private information, such as a physical or electronic address, without explicit permission - Other conduct which could reasonably be considered inappropriate in a professional setting ## Our Responsibilities Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. ## Scope This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at kent+coc@doddsfamily.us. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. ## Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] [homepage]: http://contributor-covenant.org [version]: http://contributor-covenant.org/version/1/4/ ================================================ FILE: CONTRIBUTING.md ================================================ # Contributing Thanks for being willing to contribute! **Working on your first Pull Request?** You can learn how from this _free_ series [How to Contribute to an Open Source Project on GitHub][egghead] ## Project setup 1. Fork and clone the repo 2. `npm run setup` to setup and validate your clone of the project 3. Create a branch for your PR > Tip: Keep your `master` branch pointing at the original repository and make > pull requests from branches on your fork. To do this, run: > > ``` > git remote add upstream https://github.com/downshift-js/downshift.git > git fetch upstream > git branch --set-upstream-to=upstream/master master > ``` > > This will add the original repository as a "remote" called "upstream," Then > fetch the git information from that remote, then set your local `master` > branch to use the upstream master branch whenever you run `git pull`. Then you > can make all of your pull request branches based on this `master` branch. > Whenever you want to update your version of `master`, do a regular `git pull`. ## Committing and Pushing changes Please make sure to run the tests before you commit your changes. You can run `npm run test:update` which will update any snapshots that need updating. Make sure to include those changes (if they exist) in your commit. We also track the bundle sizes in a `.size-snapshot.json` file, this will likely update when you make changes to the codebase. ### Tests There are quite a few test scripts that run as part of a `validate` script in this project: - lint - ESLint stuff, pretty basic. Please fix any errors/warnings :) - build-and-test - This ensures that the built version of `downshift` is what we expect. These tests live in `other/misc-tests/__tests__`. - test:cover - This is primarily unit tests on the source code and accounts for most of the coverage. We enforce 100% code coverage on this library. These tests live in `src/__tests__` - test:ts - This runs `tsc` on the codebase to make sure the type script definitions are correct for the `tsx` files in the `test` directory. - test:ssr - This ensures that downshift works with server-side rendering (it can run and render in an environment without the DOM). These tests live in `other/ssr/__tests__` - test:cypress - This runs tests in an actual browser. It runs and tests the storybook examples. These tests live in `cypress/integration`. ### opt into git hooks There are git hooks set up with this project that are automatically installed when you install dependencies. They're really handy, but are turned off by default (so as to not hinder new contributors). You can opt into these by creating a file called `.opt-in` at the root of the project and putting this inside: ``` pre-commit ``` ## Help needed Please checkout the [the open issues][issues] Also, please watch the repo and respond to questions/bug reports/feature requests! Thanks! [egghead]: https://app.egghead.io/playlists/how-to-contribute-to-an-open-source-project-on-github [all-contributors]: https://github.com/kentcdodds/all-contributors [issues]: https://github.com/downshift-js/downshift/issues ================================================ FILE: LICENSE ================================================ The MIT License (MIT) Copyright (c) 2017 PayPal Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: README.md ================================================

downshift 🏎
downshift logo

Primitives to build simple, flexible, WAI-ARIA compliant React autocomplete, combobox or select dropdown components.

> [Read the docs](https://downshift-js.com) | > [See the intro blog post](https://kentcdodds.com/blog/introducing-downshift-for-react) > | > [Listen to the Episode 79 of the Full Stack Radio podcast](https://fullstackradio.com/79)
[![Build Status][build-badge]][build] [![Code Coverage][coverage-badge]][coverage] [![downloads][downloads-badge]][npmcharts] [![version][version-badge]][package] [![MIT License][license-badge]][license] [![All Contributors](https://img.shields.io/badge/all_contributors-113-orange.svg?style=flat-square)](#contributors) [![PRs Welcome][prs-badge]][prs] [![Chat][chat-badge]][chat] [![Code of Conduct][coc-badge]][coc] [![Join the community on Spectrum][spectrum-badge]][spectrum] [![Supports React and Preact][react-badge]][react] [![size][size-badge]][unpkg-dist] [![gzip size][gzip-badge]][unpkg-dist] [![module formats: umd, cjs, and es][module-formats-badge]][unpkg-dist] ## The problem You need an autocomplete, a combobox or a select experience in your application and you want it to be accessible. You also want it to be simple and flexible to account for your use cases. Finally, it should follow the [ARIA][aria] design pattern for a [combobox][combobox-aria-example] or a [select][select-aria-example], depending on your use case. ## This solution The library offers a couple of solutions. The first solution, which is the one we recommend you to try first, is a set of React hooks. Each hook provides the stateful logic needed to make the corresponding component functional and accessible. Navigate to the documentation for each by using the links in the list below. - [useSelect][useselect-readme] for a custom select component. - [useCombobox][combobox-readme] for a combobox or autocomplete input. - [useTagGroup][tag-group-readme] for a tag group component. Also useful to build a multiple selection combobox or select component with tags. The second solution is the `Downshift` component, which can also be used to create accessible combobox and select components, providing the logic in the form of a render prop. It served as inspiration for developing the hooks and it has been around for a while. It established a successful pattern for making components accessible and functional while giving developers complete freedom when building the UI. Both _useSelect_ and _useCombobox_ support the latest ARIA combobox patterns for W3C, which _Downshift_ does not. Consequently, we strongly recommend the you use the hooks. The hooks have been migrated to the ARIA 1.2 combobox pattern in the version 7 of _downshift_. There is a [Migration Guide][migration-guide-v7] that documents the changes introduced in version 7. The `README` on this page covers only the component while each hook has its own `README` page. You can navigate to the [hooks page][hooks-readme] or go directly to the hook you need by using the links in the list above. For examples on how to use the hooks or the Downshift component, check out our [docsite][docsite]! **🚨 Use the Downshift hooks 🚨** If you are new to the library, consider the _useSelect_ and _useCombobox_ hooks as the first option. As mentioned above, the hooks benefit from the updated ARIA patterns and are actively maintained and improved. If there are use cases that are supported by the _Downshift_ component and not by the hooks, please create an issue in our repo. The _Downshift_ component is going to be removed completely once the hooks become mature. ### Downshift This is a component that controls user interactions and state for you so you can create autocomplete, combobox or select dropdown components. It uses a [render prop][use-a-render-prop] which gives you maximum flexibility with a minimal API because you are responsible for the rendering of everything and you simply apply props to what you're rendering. This differs from other solutions which render things for their use case and then expose many options to allow for extensibility resulting in a bigger API that is less flexible as well as making the implementation more complicated and harder to contribute to. > NOTE: The original use case of this component is autocomplete, however the API > is powerful and flexible enough to build things like dropdowns as well. ## Table of Contents - [Installation](#installation) - [Usage](#usage) - [Basic Props](#basic-props) - [children](#children) - [itemToString](#itemtostring) - [onChange](#onchange) - [stateReducer](#statereducer) - [Advanced Props](#advanced-props) - [initialSelectedItem](#initialselecteditem) - [initialInputValue](#initialinputvalue) - [initialHighlightedIndex](#initialhighlightedindex) - [initialIsOpen](#initialisopen) - [defaultHighlightedIndex](#defaulthighlightedindex) - [defaultIsOpen](#defaultisopen) - [selectedItemChanged](#selecteditemchanged) - [getA11yStatusMessage](#geta11ystatusmessage) - [onSelect](#onselect) - [onStateChange](#onstatechange) - [onInputValueChange](#oninputvaluechange) - [itemCount](#itemcount) - [highlightedIndex](#highlightedindex) - [inputValue](#inputvalue) - [isOpen](#isopen) - [selectedItem](#selecteditem) - [id](#id) - [inputId](#inputid) - [labelId](#labelid) - [menuId](#menuid) - [getItemId](#getitemid) - [environment](#environment) - [onOuterClick](#onouterclick) - [scrollIntoView](#scrollintoview) - [stateChangeTypes](#statechangetypes) - [Control Props](#control-props) - [Children Function](#children-function) - [prop getters](#prop-getters) - [actions](#actions) - [state](#state) - [props](#props) - [Event Handlers](#event-handlers) - [default handlers](#default-handlers) - [customizing handlers](#customizing-handlers) - [Utilities](#utilities) - [resetIdCounter](#resetidcounter) - [React Native](#react-native) - [Gotchas](#gotchas) - [Advanced React Component Patterns course](#advanced-react-component-patterns-course) - [Examples](#examples) - [FAQ](#faq) - [Inspiration](#inspiration) - [Other Solutions](#other-solutions) - [Bindings for ReasonML](#bindings-for-reasonml) - [Contributors](#contributors) - [LICENSE](#license) ## Installation This module is distributed via [npm][npm] which is bundled with [node][node] and should be installed as one of your project's `dependencies`: ``` npm install --save downshift ``` > This package also depends on `react`. Please make sure you have it installed > as well. > Note also this library supports `preact` out of the box. If you are using > `preact` then use the corresponding module in the `preact/dist` folder. You > can even `import Downshift from 'downshift/preact'` 👍 ## Usage > [Try it out in the browser][code-sandbox-try-it-out] ```jsx import * as React from 'react' import {render} from 'react-dom' import Downshift from 'downshift' const items = [ {value: 'apple'}, {value: 'pear'}, {value: 'orange'}, {value: 'grape'}, {value: 'banana'}, ] render( alert(selection ? `You selected ${selection.value}` : 'Selection Cleared') } itemToString={item => (item ? item.value : '')} > {({ getInputProps, getItemProps, getLabelProps, getMenuProps, isOpen, inputValue, highlightedIndex, selectedItem, getRootProps, }) => (
)}
, document.getElementById('root'), ) ``` There is also an [example without getRootProps][code-sandbox-no-get-root-props]. > Warning: The example without `getRootProps` is not fully accessible with > screen readers as it's not possible to achieve the HTML structure suggested by > ARIA. We recommend following the example with `getRootProps`. Examples on how > to use `Downshift` component with and without `getRootProps` are on the > [docsite](https://downshift-js.com/). `Downshift` is the only component exposed by this package. It doesn't render anything itself, it just calls the render function and renders that. ["Use a render prop!"][use-a-render-prop]! `{downshift =>
/* your JSX here! */
}
`. ## Basic Props This is the list of props that you should probably know about. There are some [advanced props](#advanced-props) below as well. ### children > `function({})` | _required_ This is called with an object. Read more about the properties of this object in the section "[Children Function](#children-function)". ### itemToString > `function(item: any)` | defaults to: `item => (item ? String(item) : '')` If your items are stored as, say, objects instead of strings, downshift still needs a string representation for each one (e.g., to set `inputValue`). **Note:** This callback _must_ include a null check: it is invoked with `null` whenever the user abandons input via ``. ### onChange > `function(selectedItem: any, stateAndHelpers: object)` | optional, no useful > default Called when the selected item changes, either by the user selecting an item or the user clearing the selection. Called with the item that was selected or `null` and the new state of `downshift`. (see `onStateChange` for more info on `stateAndHelpers`). - `selectedItem`: The item that was just selected. `null` if the selection was cleared. - `stateAndHelpers`: This is the same thing your `children` function is called with (see [Children Function](#children-function)) ### stateReducer > `function(state: object, changes: object)` | optional **🚨 This is a really handy power feature 🚨** This function will be called each time `downshift` sets its internal state (or calls your `onStateChange` handler for control props). It allows you to modify the state change that will take place which can give you fine grain control over how the component interacts with user updates without having to use [Control Props](#control-props). It gives you the current state and the state that will be set, and you return the state that you want to set. - `state`: The full current state of downshift. - `changes`: These are the properties that are about to change. This also has a `type` property which you can learn more about in the [`stateChangeTypes`](#statechangetypes) section. ```jsx const ui = ( {/* your callback */} ) function stateReducer(state, changes) { // this prevents the menu from being closed when the user // selects an item with a keyboard or mouse switch (changes.type) { case Downshift.stateChangeTypes.keyDownEnter: case Downshift.stateChangeTypes.clickItem: return { ...changes, isOpen: state.isOpen, highlightedIndex: state.highlightedIndex, } default: return changes } } ``` > NOTE: This is only called when state actually changes. You should not attempt > to use this to handle events. If you wish to handle events, put your event > handlers directly on the elements (make sure to use the prop getters though! > For example: `` should be > ``). Also, your reducer > function should be "pure." This means it should do nothing other than return > the state changes you want to have happen. ## Advanced Props ### initialSelectedItem > `any` | defaults to `null` Pass an item or an array of items that should be selected when downshift is initialized. ### initialInputValue > `string` | defaults to `''` This is the initial input value when downshift is initialized. ### initialHighlightedIndex > `number`/`null` | defaults to `defaultHighlightedIndex` This is the initial value to set the highlighted index to when downshift is initialized. ### initialIsOpen > `boolean` | defaults to `defaultIsOpen` This is the initial `isOpen` value when downshift is initialized. ### defaultHighlightedIndex > `number`/`null` | defaults to `null` This is the value to set the `highlightedIndex` to anytime downshift is reset, when the selection is cleared, when an item is selected or when the inputValue is changed. ### defaultIsOpen > `boolean` | defaults to `false` This is the value to set the `isOpen` to anytime downshift is reset, when the the selection is cleared, or when an item is selected. ### selectedItemChanged > `function(prevItem: any, item: any)` | defaults to: > `(prevItem, item) => (prevItem !== item)` Used to determine if the new `selectedItem` has changed compared to the previous `selectedItem` and properly update Downshift's internal state. ### getA11yStatusMessage > `function({/* see below */})` | default messages provided in English This function is passed as props to a `Status` component nested within and allows you to create your own assertive ARIA statuses. A default `getA11yStatusMessage` function is provided that will check `resultCount` and return "No results are available." or if there are results , "`resultCount` results are available, use up and down arrow keys to navigate. Press Enter key to select." The object you are passed to generate your status message has the following properties: | property | type | description | | --------------------- | --------------- | -------------------------------------------------------------------------------------------- | | `highlightedIndex` | `number`/`null` | The currently highlighted index | | `highlightedItem` | `any` | The value of the highlighted item | | `inputValue` | `string` | The current input value | | `isOpen` | `boolean` | The `isOpen` state | | `itemToString` | `function(any)` | The `itemToString` function (see props) for getting the string value from one of the options | | `previousResultCount` | `number` | The total items showing in the dropdown the last time the status was updated | | `resultCount` | `number` | The total items showing in the dropdown | | `selectedItem` | `any` | The value of the currently selected item | ### onSelect > `function(selectedItem: any, stateAndHelpers: object)` | optional, no useful > default Called when the user selects an item, regardless of the previous selected item. Called with the item that was selected and the new state of `downshift`. (see `onStateChange` for more info on `stateAndHelpers`). - `selectedItem`: The item that was just selected - `stateAndHelpers`: This is the same thing your `children` function is called with (see [Children Function](#children-function)) ### onStateChange > `function(changes: object, stateAndHelpers: object)` | optional, no useful > default This function is called anytime the internal state changes. This can be useful if you're using downshift as a "controlled" component, where you manage some or all of the state (e.g., isOpen, selectedItem, highlightedIndex, etc) and then pass it as props, rather than letting downshift control all its state itself. The parameters both take the shape of internal state (`{highlightedIndex: number, inputValue: string, isOpen: boolean, selectedItem: any}`) but differ slightly. - `changes`: These are the properties that actually have changed since the last state change. This also has a `type` property which you can learn more about in the [`stateChangeTypes`](#statechangetypes) section. - `stateAndHelpers`: This is the exact same thing your `children` function is called with (see [Children Function](#children-function)) > Tip: This function will be called any time _any_ state is changed. The best > way to determine whether any particular state was changed, you can use > `changes.hasOwnProperty('propName')`. > NOTE: This is only called when state actually changes. You should not attempt > to use this to handle events. If you wish to handle events, put your event > handlers directly on the elements (make sure to use the prop getters though! > For example: `` should be > ``). ### onInputValueChange > `function(inputValue: string, stateAndHelpers: object)` | optional, no useful > default Called whenever the input value changes. Useful to use instead or in combination of `onStateChange` when `inputValue` is a controlled prop to [avoid issues with cursor positions](https://github.com/downshift-js/downshift/issues/217). - `inputValue`: The current value of the input - `stateAndHelpers`: This is the same thing your `children` function is called with (see [Children Function](#children-function)) ### itemCount > `number` | optional, defaults the number of times you call getItemProps This is useful if you're using some kind of virtual listing component for "windowing" (like [`react-virtualized`](https://github.com/bvaughn/react-virtualized)). ### highlightedIndex > `number` | **control prop** (read more about this in > [the Control Props section](#control-props)) The index that should be highlighted ### inputValue > `string` | **control prop** (read more about this in > [the Control Props section](#control-props)) The value the input should have ### isOpen > `boolean` | **control prop** (read more about this in > [the Control Props section](#control-props)) Whether the menu should be considered open or closed. Some aspects of the downshift component respond differently based on this value (for example, if `isOpen` is true when the user hits "Enter" on the input field, then the item at the `highlightedIndex` item is selected). ### selectedItem > `any`/`Array(any)` | **control prop** (read more about this in > [the Control Props section](#control-props)) The currently selected item. ### id > `string` | defaults to a generated ID You should not normally need to set this prop. It's only useful if you're server rendering items (which each have an `id` prop generated based on the `downshift` `id`). For more information see the `FAQ` below. ### inputId > `string` | defaults to a generated ID Used for `aria` attributes and the `id` prop of the element (`input`) you use [`getInputProps`](#getinputprops) with. ### labelId > `string` | defaults to a generated ID Used for `aria` attributes and the `id` prop of the element (`label`) you use [`getLabelProps`](#getlabelprops) with. ### menuId > `string` | defaults to a generated ID Used for `aria` attributes and the `id` prop of the element (`ul`) you use [`getMenuProps`](#getmenuprops) with. ### getItemId > `function(index)` | defaults to a function that generates an ID based on the > index Used for `aria` attributes and the `id` prop of the element (`li`) you use [`getInputProps`](#getinputprops) with. ### environment > `window` | defaults to `window` This prop is only useful if you're rendering downshift within a different `window` context from where your JavaScript is running; for example, an iframe or a shadow-root. If the given context is lacking `document` and/or `add|removeEventListener` on its prototype (as is the case for a shadow-root) then you will need to pass in a custom object that is able to provide [access to these properties](https://gist.github.com/Rendez/1dd55882e9b850dd3990feefc9d6e177) for downshift. ### onOuterClick > `function(stateAndHelpers: object)` | optional A helper callback to help control internal state of downshift like `isOpen` as mentioned in [this issue](https://github.com/downshift-js/downshift/issues/206). The same behavior can be achieved using `onStateChange`, but this prop is provided as a helper because it's a fairly common use-case if you're controlling the `isOpen` state: ```jsx const ui = ( this.setState({menuIsOpen: false})} > {/* your callback */} ) ``` This callback will only be called if `isOpen` is `true`. ### scrollIntoView > `function(node: HTMLElement, menuNode: HTMLElement)` | defaults to internal > implementation This allows you to customize how the scrolling works when the highlighted index changes. It receives the node to be scrolled to and the root node (the root node you render in downshift). Internally we use [`compute-scroll-into-view`](https://www.npmjs.com/package/compute-scroll-into-view) so if you use that package then you wont be adding any additional bytes to your bundle :) ## stateChangeTypes There are a few props that expose changes to state ([`onStateChange`](#onstatechange) and [`stateReducer`](#statereducer)). For you to make the most of these APIs, it's important for you to understand why state is being changed. To accomplish this, there's a `type` property on the `changes` object you get. This `type` corresponds to a `Downshift.stateChangeTypes` property. The list of all possible values this `type` property can take is defined in [this file](https://github.com/downshift-js/downshift/blob/master/src/stateChangeTypes.js) and is as follows: - `Downshift.stateChangeTypes.unknown` - `Downshift.stateChangeTypes.mouseUp` - `Downshift.stateChangeTypes.itemMouseEnter` - `Downshift.stateChangeTypes.keyDownArrowUp` - `Downshift.stateChangeTypes.keyDownArrowDown` - `Downshift.stateChangeTypes.keyDownEscape` - `Downshift.stateChangeTypes.keyDownEnter` - `Downshift.stateChangeTypes.keyDownHome` - `Downshift.stateChangeTypes.keyDownEnd` - `Downshift.stateChangeTypes.clickItem` - `Downshift.stateChangeTypes.blurInput` - `Downshift.stateChangeTypes.changeInput` - `Downshift.stateChangeTypes.keyDownSpaceButton` - `Downshift.stateChangeTypes.clickButton` - `Downshift.stateChangeTypes.blurButton` - `Downshift.stateChangeTypes.controlledPropUpdatedSelectedItem` - `Downshift.stateChangeTypes.touchEnd` See [`stateReducer`](#statereducer) for a concrete example on how to use the `type` property. ## Control Props downshift manages its own state internally and calls your `onChange` and `onStateChange` handlers with any relevant changes. The state that downshift manages includes: `isOpen`, `selectedItem`, `inputValue`, and `highlightedIndex`. Your Children function (read more below) can be used to manipulate this state and can likely support many of your use cases. However, if more control is needed, you can pass any of these pieces of state as a prop (as indicated above) and that state becomes controlled. As soon as `this.props[statePropKey] !== undefined`, internally, `downshift` will determine its state based on your prop's value rather than its own internal state. You will be required to keep the state up to date (this is where `onStateChange` comes in really handy), but you can also control the state from anywhere, be that state from other components, `redux`, `react-router`, or anywhere else. > Note: This is very similar to how normal controlled components work elsewhere > in react (like ``). If you want to learn more about this concept, you > can learn about that from this the > [Advanced React Component Patterns course](#advanced-react-component-patterns-course) ## Children Function This is where you render whatever you want to based on the state of `downshift`. You use it like so: ```javascript const ui = ( {downshift => ( // use downshift utilities and state here, like downshift.isOpen, // downshift.getInputProps, etc.
{/* more jsx here */}
)}
) ``` The properties of this `downshift` object can be split into three categories as indicated below: ### prop getters > See > [the blog post about prop getters](https://kentcdodds.com/blog/how-to-give-rendering-control-to-users-with-prop-getters) > NOTE: These prop-getters provide important `aria-` attributes which are very > important to your component being accessible. It's recommended that you > utilize these functions and apply the props they give you to your components. These functions are used to apply props to the elements that you render. This gives you maximum flexibility to render what, when, and wherever you like. You call these on the element in question (for example: ` | property | type | description | | ---------------------- | ----------------- | ---------------------------------------------------------------------------------------------- | | `getToggleButtonProps` | `function({})` | returns the props you should apply to any menu toggle button element you render. | | `getInputProps` | `function({})` | returns the props you should apply to the `input` element that you render. | | `getItemProps` | `function({})` | returns the props you should apply to any menu item elements you render. | | `getLabelProps` | `function({})` | returns the props you should apply to the `label` element that you render. | | `getMenuProps` | `function({},{})` | returns the props you should apply to the `ul` element (or root of your menu) that you render. | | `getRootProps` | `function({},{})` | returns the props you should apply to the root element that you render. It can be optional. | #### `getRootProps`
If you cannot render a div as the root element, then read this Most of the time, you can just render a `div` yourself and `Downshift` will apply the props it needs to do its job (and you don't need to call this function). However, if you're rendering a composite component (custom component) as the root element, then you'll need to call `getRootProps` and apply that to your root element (downshift will throw an error otherwise). There are no required properties for this method. Optional properties: - `refKey`: if you're rendering a composite component, that component will need to accept a prop which it forwards to the root DOM element. Commonly, folks call this `innerRef`. So you'd call: `getRootProps({refKey: 'innerRef'})` and your composite component would forward like: `
`. It defaults to `ref`. If you're rendering a composite component, `Downshift` checks that `getRootProps` is called and that `refKey` is a prop of the returned composite component. This is done to catch common causes of errors but, in some cases, the check could fail even if the ref is correctly forwarded to the root DOM component. In these cases, you can provide the object `{suppressRefError : true}` as the second argument to `getRootProps` to completely bypass the check.\ **Please use it with extreme care and only if you are absolutely sure that the ref is correctly forwarded otherwise `Downshift` will unexpectedly fail.**\ See [#235](https://github.com/downshift-js/downshift/issues/235) for the discussion that lead to this.
#### `getInputProps` This method should be applied to the `input` you render. It is recommended that you pass all props as an object to this method which will compose together any of the event handlers you need to apply to the `input` while preserving the ones that `downshift` needs to apply to make the `input` behave. There are no required properties for this method. Optional properties: - `disabled`: If this is set to true, then no event handlers will be returned from `getInputProps` and a `disabled` prop will be returned (effectively disabling the input). - `aria-label`: By default the menu will add an `aria-labelledby` that refers to the `