[
  {
    "path": ".browserslistrc",
    "content": "> 0.25%\nie 11\nnot op_mini all\n"
  },
  {
    "path": ".changeset/README.md",
    "content": "# Changesets\n\nHello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works with `bolt` to help you release components from a mono-repository. You can find the full documentation for it [here](https://www.npmjs.com/package/@changesets/cli)\n\nTo help you get started though, here are some things you should know about this folder:\n\n## Changesets are automatically generated\n\nChangesets are generated by the `yarn changeset` or `npx changeset` command. As long as you are following a changeset release flow, you shouldn't have any problems.\n\n## Each changeset is its own folder\n\nWe use hashes by default for these folder names to avoid collisions when generating them, but there's no harm that will come from renaming them.\n\n## Changesets are automatically removed\n\nWhen `changeset bump` or equivalent command is run, all the changeset folders are removed. This is so we only ever use a changeset once. This makes this a very bad place to store any other information.\n\n## Changesets come in two parts\n\nYou should treat these parts quite differently:\n\n- `changes.md` is a file you should feel free to edit as much as you want. It will be prepended to your changelog when you next run your version command.\n- `changes.json` is a file that includes information about releases, what should be versioned by the version command. We strongly recommend against editing this directly, as you may make a new changeset that puts your bolt repository into an invalid state.\n\n## I want to edit the information in a `changes.json` - how do I do it safely?\n\nThe best option is to make a new changeset using the changeset command, copy over the `changes.md`, then delete the old changeset.\n\n## Can I rename the folder for my changeset?\n\nAbsolutely! We need unique hashes to make changesets play nicely with git, but changing your folder from our hash to your own name isn't going to cause any problems.\n\n## Can I manually delete changesets?\n\nYou can, but you should be aware this will remove the intent to release communicated by the changeset, and should be done with caution.\n"
  },
  {
    "path": ".changeset/config.json",
    "content": "{\n  \"$schema\": \"https://unpkg.com/@changesets/config@0.2.1/schema.json\",\n  \"changelog\": \"./getChangelogEntry\",\n  \"commit\": false,\n  \"linked\": [],\n  \"access\": \"public\"\n}\n"
  },
  {
    "path": ".changeset/getChangelogEntry.js",
    "content": "require('dotenv').config();\nconst { getInfo } = require('@changesets/get-github-info');\n\nconst getReleaseLine = async (changeset, type) => {\n  const [firstLine, ...futureLines] = changeset.summary\n    .split('\\n')\n    .map((l) => l.trimRight());\n  let { links } = await getInfo({\n    repo: 'JedWatson/react-select',\n    commit: changeset.commit,\n  });\n  return `- ${links.commit}${links.pull === null ? '' : ` ${links.pull}`}${\n    links.user === null ? '' : ` Thanks ${links.user}!`\n  } - ${firstLine}\\n${futureLines.map((l) => `  ${l}`).join('\\n')}`;\n};\n\nconst getDependencyReleaseLine = async (changesets, dependenciesUpdated) => {\n  if (dependenciesUpdated.length === 0) return '';\n\n  const changesetLinks = changesets.map(\n    (changeset) => `- Updated dependencies [${changeset.commit}]:`\n  );\n\n  const updatedDepenenciesList = dependenciesUpdated.map(\n    (dependency) => `  - ${dependency.name}@${dependency.version}`\n  );\n\n  return [...changesetLinks, ...updatedDepenenciesList].join('\\n');\n};\n\nmodule.exports = {\n  getReleaseLine,\n  getDependencyReleaseLine,\n};\n"
  },
  {
    "path": ".circleci/config.yml",
    "content": "version: 2\n\ndocker_defaults: &docker_defaults\n    docker:\n        - image: cypress/browsers:latest\n          environment:\n              TERM: xterm\n    working_directory: ~/project/repo\n\nattach_workspace: &attach_workspace\n    attach_workspace:\n        at: ~/project\n\ninstall_steps: &install_steps\n    steps:\n        - checkout\n        - restore_cache:\n              name: Restore node_modules cache\n              keys:\n                  - dependency-cache-{{ .Branch }}-{{ checksum \"yarn.lock\" }}\n                  - dependency-cache-{{ .Branch }}-\n                  - dependency-cache-\n                  - cache-{{ checksum \"package.json\" }}\n        - run:\n              name: Installing Dependencies\n              command: |\n                  yarn install --silent\n        - save_cache:\n              name: Save node_modules cache\n              key: dependency-cache-{{ .Branch }}-{{ checksum \"package.json\" }}\n              paths:\n                  - ~/.cache\n        - persist_to_workspace:\n              root: ~/project\n              paths:\n                  - repo\n\nworkflows:\n    version: 2\n    build_pipeline:\n        jobs:\n            - build\n            - unit_test:\n                  requires:\n                      - build\n            - end_to_end:\n                  requires:\n                      - build\njobs:\n    build:\n        <<: *docker_defaults\n        <<: *install_steps\n    unit_test:\n        <<: *docker_defaults\n        steps:\n            - *attach_workspace\n            - run:\n                  name: Running unit tests\n                  command: |\n                      yarn prettier:check\n                      yarn lint\n                      yarn type-check\n                      yarn test:jest\n                      yarn coveralls\n    end_to_end:\n        <<: *docker_defaults\n        steps:\n            - *attach_workspace\n            - run:\n                  name: Running E2E tests\n                  command: |\n                      yarn global add cypress\n                      yarn install --silent\n                      yarn cypress install\n                      yarn e2e\n"
  },
  {
    "path": ".codesandbox/ci.json",
    "content": "{\n  \"buildCommand\": \"build\",\n  \"packages\": [\"packages/*\"],\n  \"sandboxes\": [\"nfmxw\"],\n  \"node\": \"20\"\n}\n"
  },
  {
    "path": ".coveralls.yml",
    "content": "service-name: travis-ci\nrepo_token: itdMRdBNgDK8Gb5nIA63zVMEryaxTQxkR\n"
  },
  {
    "path": ".editorconfig",
    "content": "# This file is for unifying the coding style for different editors and IDEs\n# editorconfig.org\nroot = true\n\n[*]\nend_of_line = lf\ncharset = utf-8\ntrim_trailing_whitespace = true\ninsert_final_newline = true\nindent_style = space\nindent_size = 2\n\n[*.md]\ntrim_trailing_whitespace = false\n\n[.circleci/config.yml]\nindent_size = 4\n"
  },
  {
    "path": ".eslintignore",
    "content": "coverage/*\ncypress/plugins/*\ncypress/support/*\n**/dist/*\nlib/*\nnode_modules/*\n**/node_modules/*\n"
  },
  {
    "path": ".eslintrc.js",
    "content": "module.exports = {\n  extends: ['plugin:react-hooks/recommended', 'plugin:@typescript-eslint/base'],\n  parser: '@typescript-eslint/parser',\n  env: {\n    browser: true,\n    es6: true,\n    node: true,\n  },\n  plugins: ['react', '@typescript-eslint'],\n  rules: {\n    '@typescript-eslint/no-unused-vars': [\n      'error',\n      {\n        args: 'after-used',\n        argsIgnorePattern: '^event$',\n        ignoreRestSiblings: true,\n        vars: 'all',\n        varsIgnorePattern: 'jsx|emotionJSX',\n      },\n    ],\n    curly: [2, 'multi-line'],\n    'jsx-quotes': 1,\n    'no-shadow': 0,\n    '@typescript-eslint/no-shadow': 2,\n    'no-trailing-spaces': 1,\n    'no-underscore-dangle': 1,\n    '@typescript-eslint/no-unused-expressions': 1,\n    'object-curly-spacing': [1, 'always'],\n    '@typescript-eslint/quotes': [2, 'single', 'avoid-escape'],\n    'react/jsx-boolean-value': 1,\n    'react/jsx-no-undef': 1,\n    'react/jsx-uses-react': 1,\n    'react/jsx-uses-vars': 1,\n    'react/jsx-wrap-multilines': 1,\n    'react/no-did-mount-set-state': 1,\n    'react/no-did-update-set-state': 1,\n    'react/no-unknown-property': 1,\n    'react/react-in-jsx-scope': 1,\n    'react/self-closing-comp': 1,\n    'react/sort-prop-types': 1,\n    '@typescript-eslint/semi': 2,\n    '@typescript-eslint/no-inferrable-types': 2,\n    strict: 0,\n  },\n  settings: {\n    react: {\n      version: 'detect',\n    },\n  },\n};\n"
  },
  {
    "path": ".github/CONTRIBUTING.md",
    "content": "# Contributing\n\nThanks for your interest in React-Select. All forms of contribution are\nwelcome, from issue reports to PRs and documentation / write-ups.\n\nBefore you open a PR:\n\n- In development, run `yarn start` to build (+watch) the project source, and run\n  the [development server](http://localhost:8000).\n- Please ensure all the examples work correctly after your change. If you're\n  adding a major new use-case, add a new example demonstrating its use.\n- Be careful to follow the code style of the project. Run `yarn lint` after\n  your changes and ensure you do not introduce any new errors or warnings.\n- This repository uses TypeScript, please run `yarn type-check` after your changes to ensure\n  that you do not introduce any new type errors.\n\n- Ensure that your effort is aligned with the project's roadmap by talking to\n  the maintainers, especially if you are going to spend a lot of time on it.\n- Make sure there's an issue open for any work you take on and intend to submit\n  as a pull request - it helps core members review your concept and direction\n  early and is a good way to discuss what you're planning to do.\n- If you open an issue and are interested in working on a fix, please let us\n  know. We'll help you get started, rather than adding it to the queue.\n- Make sure you do not add regressions by running `yarn test`.\n- Where possible, include tests with your changes, either that demonstrates the\n  bug, or tests the new functionality. If you're not sure how to test your\n  changes, feel free to ping @gwyneplaine or @JedWatson\n- Run `yarn coveralls` to check that the coverage hasn't dropped, and look at the\n  report (under the generated `coverage` directory) to check that your changes are\n  covered\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/bug_report.md",
    "content": "---\nname: Bug report\nabout: File a bug report\ntitle: '<title>'\nlabels: [issue/bug-unconfirmed]\nassignees: ''\n---\n\n**Thanks for using react-select!**\n\nIf you are going to ask a question or want to propose a change or a new feature, then please don't file an issue for this.\nQuestions and feature requests have their own place in our discussions section.\n\n## Are you reporting a bug or runtime error?\n\nPlease include a test case that demonstrates the issue you're reporting!\n\nThis is very helpful to maintainers in order to help us see the issue you're seeing.\n\nPlease note we are currently only directing our efforts towards the current major (v5) version and beyond.\n\nWe understand this might be inconvenient but it is in the best interest of supporting the broader community and to sustain the `react-select` project going forward.\n\nTo report bugs against react-select v5 please fork the following code-sandbox:\nhttps://codesandbox.io/s/react-select-v5-sandbox-y5jtm\n\nYou may also find the [online Babel tool](https://babeljs.io/repl/) quite helpful if you wish to use ES6/ES7 syntax not yet supported by the browser you are using.\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/config.yml",
    "content": "blank_issues_enabled: false\ncontact_links:\n  - name: Feature request\n    url: https://github.com/JedWatson/react-select/discussions/categories/ideas\n    about: Got an idea for a feature or want to propose a change? Then this is the place for you.\n  - name: Question on usage\n    url: https://github.com/JedWatson/react-select/discussions/categories/q-a\n    about: If you have a question regarding the usage of the library.\n  - name: StackOverflow\n    url: https://stackoverflow.com/questions/tagged/react-select\n    about: Alternatively you can visit StackOverflow with the `[react-select]` tag\n"
  },
  {
    "path": ".github/dependabot.yml",
    "content": "version: 2\nupdates:\n  - package-ecosystem: 'npm'\n    directory: '/'\n    schedule:\n      interval: 'weekly'\n    ignore:\n      - dependency-name: '*'\n        update-types:\n          ['version-update:semver-minor', 'version-update:semver-patch']\n"
  },
  {
    "path": ".github/workflows/release.yml",
    "content": "name: Release\n\non:\n  push:\n    branches:\n      - master\n\npermissions:\n  contents: read\n\njobs:\n  release:\n    permissions:\n      # for changesets/action\n      contents: write\n      pull-requests: write\n    name: Release\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout Repo\n        uses: actions/checkout@v3\n        with:\n          # This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits\n          fetch-depth: 0\n\n      - name: Setup Node.js 22.x\n        uses: actions/setup-node@v4\n        with:\n          node-version: 22.x\n\n      - name: Install Dependencies\n        run: yarn\n\n      - name: Create Release Pull Request or Publish to npm\n        uses: changesets/action@v1\n        with:\n          publish: yarn release\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n          NPM_TOKEN: ${{ secrets.NPM_TOKEN }}\n"
  },
  {
    "path": ".gitignore",
    "content": "# Build\nlib\ndist\ndocs/dist\n.env\n\n# Logs\nlogs\n*.log\n\n# Runtime data\npids\n*.pid\n*.seed\n\n# Coverage tools\nlib-cov\ncoverage\n.nyc_output\n\n# Cypress\ncypress/videos\ncypress/screenshots\ncypress/support\ncypress/plugins\n\n# Dependency directory\nnode_modules\nbower_components\n\n# Publish directory\n.publish\n\n# Editor artefacts\n.idea\n\n# Other\n.DS_Store\n.env\npackage-lock.json\n\n# Notes\n.NOTES.md\n\nmagical-types\n"
  },
  {
    "path": ".nvmrc",
    "content": "22\n"
  },
  {
    "path": ".prettierignore",
    "content": "coverage/*\ncypress/plugins/*\ncypress/support/*\n**/dist/*\nlib/*\nnode_modules/*\n**/node_modules/*\n**/magical-types/*\n"
  },
  {
    "path": ".prettierrc.js",
    "content": "module.exports = {\n  singleQuote: true,\n  trailingComma: 'es5',\n  overrides: [\n    {\n      files: '.changeset/pre.json',\n      options: { parser: 'json-stringify' },\n    },\n  ],\n};\n"
  },
  {
    "path": "CONTRIBUTING.md",
    "content": "# Contributing\n\nThanks for your interest in React-Select. All forms of contribution are\nwelcome, from issue reports to PRs and documentation / write-ups.\n\nBefore you open a PR:\n\n- In development, run `yarn start` to build (and watch) the project source, and run\n  the [development server](http://localhost:8000).\n- Please ensure all the examples work correctly after your change. If you're\n  adding a major new use-case, add a new example `/docs/examples` and subsequent documentation demonstrating its use `/docs/pages`.\n- Ensure that your effort is aligned with the project's roadmap by talking to\n  the maintainers, especially if you are going to spend a lot of time on it.\n- Make sure there's an issue open for any work you take on and intend to submit\n  as a pull request - it helps core members review your concept and direction\n  early and is a good way to discuss what you're planning to do.\n- If you open an issue and are interested in working on a fix, please let us\n  know. We'll help you get started, rather than inadvertently doubling up on your hard work.\n- Make sure you do not add regressions by running `yarn test`.\n- Where possible, include tests with your changes, either that demonstrates the\n  bug, or tests the new functionality.\n- All new features and changes need documentation.\n"
  },
  {
    "path": "LICENSE",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2022 Jed Watson\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "[![NPM](https://img.shields.io/npm/v/react-select.svg)](https://www.npmjs.com/package/react-select)\n[![CircleCI](https://circleci.com/gh/JedWatson/react-select/tree/master.svg?style=shield)](https://circleci.com/gh/JedWatson/react-select/tree/master)\n[![Coverage Status](https://coveralls.io/repos/JedWatson/react-select/badge.svg?branch=master&service=github)](https://coveralls.io/github/JedWatson/react-select?branch=master)\n[![Supported by Thinkmill](https://thinkmill.github.io/badge/heart.svg)](http://thinkmill.com.au/?utm_source=github&utm_medium=badge&utm_campaign=react-select)\n\n# React-Select\n\nThe Select control for [React](https://reactjs.org). Initially built for use in [KeystoneJS](https://www.keystonejs.com).\n\nSee [react-select.com](https://www.react-select.com) for live demos and comprehensive docs.\n\n`react-select` is funded by [Thinkmill](https://www.thinkmill.com.au) and [Atlassian](https://atlaskit.atlassian.com).\nWe are an open source project that is continuously supported by the community.\n\nReact Select helps you develop powerful select components that _just work_ out of the box, without stopping you from customising the parts that are important to you.\n\nFor the story behind this component, watch Jed's talk at React Conf 2019 - [building React Select](https://youtu.be/yS0jUnmBujE)\n\nFeatures include:\n\n- Flexible approach to data, with customisable functions\n- Extensible styling API with [emotion](https://emotion.sh)\n- Component Injection API for complete control over the UI behaviour\n- Controllable state props and modular architecture\n- Long-requested features like option groups, portal support, animation, and more\n\n## Using an older version?\n\n- [v3, v4, and v5 upgrade guide](https://react-select.com/upgrade)\n- [v2 upgrade guide](https://react-select.com/upgrade-to-v2)\n- React Select v1 documentation and examples are available at [v1.react-select.com](https://v1.react-select.com)\n\n# Installation and usage\n\nThe easiest way to use react-select is to install it from npm and build it into your app with Webpack.\n\n```\nyarn add react-select\n```\n\nThen use it in your app:\n\n```js\nimport React, { useState } from 'react';\nimport Select from 'react-select';\n\nconst options = [\n  { value: 'chocolate', label: 'Chocolate' },\n  { value: 'strawberry', label: 'Strawberry' },\n  { value: 'vanilla', label: 'Vanilla' },\n];\n\nexport default function App() {\n  const [selectedOption, setSelectedOption] = useState(null);\n\n  return (\n    <div className=\"App\">\n      <Select\n        defaultValue={selectedOption}\n        onChange={setSelectedOption}\n        options={options}\n      />\n    </div>\n  );\n}\n```\n\n## Props\n\nCommon props you may want to specify include:\n\n- `autoFocus` - focus the control when it mounts\n- `className` - apply a className to the control\n- `classNamePrefix` - apply classNames to inner elements with the given prefix\n- `isDisabled` - disable the control\n- `isMulti` - allow the user to select multiple values\n- `isSearchable` - allow the user to search for matching options\n- `name` - generate an HTML input with this name, containing the current value\n- `onChange` - subscribe to change events\n- `options` - specify the options the user can select from\n- `placeholder` - change the text displayed when no option is selected\n- `noOptionsMessage` - ({ inputValue: string }) => string | null - Text to display when there are no options\n- `value` - control the current value\n\nSee the [props documentation](https://www.react-select.com/props) for complete documentation on the props react-select supports.\n\n## Controllable Props\n\nYou can control the following props by providing values for them. If you don't, react-select will manage them for you.\n\n- `value` / `onChange` - specify the current value of the control\n- `menuIsOpen` / `onMenuOpen` / `onMenuClose` - control whether the menu is open\n- `inputValue` / `onInputChange` - control the value of the search input (changing this will update the available options)\n\nIf you don't provide these props, you can set the initial value of the state they control:\n\n- `defaultValue` - set the initial value of the control\n- `defaultMenuIsOpen` - set the initial open value of the menu\n- `defaultInputValue` - set the initial value of the search input\n\n## Methods\n\nReact-select exposes two public methods:\n\n- `focus()` - focus the control programmatically\n- `blur()` - blur the control programmatically\n\n## Customisation\n\nCheck the docs for more information on:\n\n- [Customising the styles](https://www.react-select.com/styles)\n- [Using custom components](https://www.react-select.com/components)\n- [Using the built-in animated components](https://www.react-select.com/home#animated-components)\n- [Creating an async select](https://www.react-select.com/async)\n- [Allowing users to create new options](https://www.react-select.com/creatable)\n- [Advanced use-cases](https://www.react-select.com/advanced)\n- [TypeScript guide](https://www.react-select.com/typescript)\n\n## TypeScript\n\nThe v5 release represents a rewrite from JavaScript to TypeScript. The types for v4 and earlier releases are available at [@types](https://www.npmjs.com/package/@types/react-select). See the [TypeScript guide](https://www.react-select.com/typescript) for how to use the types starting with v5.\n\n# Thanks\n\nThank you to everyone who has contributed to this project. It's been a wild ride.\n\nIf you like React Select, you should [follow me on Twitter](https://twitter.com/jedwatson)!\n\nShout out to [Joss Mackison](https://github.com/jossmac), [Charles Lee](https://github.com/gwyneplaine), [Ben Conolly](https://github.com/Noviny), [Tom Walker](https://github.com/bladey), [Nathan Bierema](https://github.com/Methuselah96), [Eric Bonow](https://github.com/ebonow), [Emma Hamilton](https://github.com/emmatown), [Dave Brotherstone](https://github.com/bruderstein), [Brian Vaughn](https://github.com/bvaughn), and the [Atlassian Design System](https://atlassian.design) team who along with many other contributors have made this possible ❤️\n\n## License\n\nMIT Licensed. Copyright (c) Jed Watson 2022.\n"
  },
  {
    "path": "babel.config.js",
    "content": "module.exports = {\n  plugins: [\n    '@emotion/babel-plugin',\n    ['@babel/plugin-proposal-class-properties', { loose: true }],\n    ['@babel/plugin-proposal-private-methods', { loose: true }],\n    '@babel/plugin-transform-runtime',\n  ],\n  presets: [\n    '@babel/preset-env',\n    '@babel/preset-react',\n    '@babel/preset-typescript',\n  ],\n};\n"
  },
  {
    "path": "cypress/fixtures/selectors.json",
    "content": "{\n  \"singleBasic\": \"#cypress-single\",\n  \"singleBasicSelect\": \"#basic-select-single\",\n  \"singleClearable\": \"#cypress-single-clearable\",\n  \"singleClearableSelect\": \"#clearable-select-single\",\n  \"singleGroupedSelect\": \"#grouped-options-single\",\n  \"checkboxDisable\": \".disable-checkbox\",\n  \"checkboxEscapeClearsValue\": \".escape-clears-value-checkbox\",\n  \"groupHeading\": \".react-select__group-heading\",\n  \"indicatorClear\": \".react-select__clear-indicator\",\n  \"indicatorDropdown\": \".react-select__dropdown-indicator\",\n  \"menu\": \".react-select__menu\",\n  \"control\": \".react-select__control\",\n  \"menuOption\": \".react-select__option\",\n  \"noOptionsValue\": \".react-select__menu-notice--no-options\",\n  \"placeholder\": \".react-select__placeholder\",\n  \"singleValue\": \".react-select__single-value\",\n  \"menuSingle\": \"#basic-select-single .react-select__menu\",\n  \"singleSelectSingleInput\": \"#react-select-basic-select-single-input\",\n  \"toggleMenuSingle\": \"#basic-select-single .react-select__dropdown-indicator\",\n  \"firstMultiValueRemove\": \"#multi-select .react-select__multi-value__remove:first\",\n  \"menuMulti\": \"#multi-select .react-select__menu\",\n  \"multiSelectDefaultValues\": \"#multi-select .react-select__multi-value\",\n  \"multiSelectInput\": \"#react-select-multi-select-input\",\n  \"placeHolderMulti\": \"#multi-select .react-select__placeholder\",\n  \"toggleMenuMulti\": \"#multi-select .react-select__dropdown-indicator\",\n  \"focusedOption\": \".react-select__option--is-focused\"\n}\n"
  },
  {
    "path": "cypress/integration/multi-select.spec.ts",
    "content": "import selector from '../fixtures/selectors.json';\nimport cypressJson from '../../cypress.json';\n\nconst setup = [\n  { width: 1440, height: 900, viewport: 'macbook-15', device: 'Laptop' },\n  { width: 375, height: 667, viewport: 'iphone-6', device: 'Mobile' },\n  { width: 768, height: 1024, viewport: 'ipad-2', device: 'Tablet' },\n];\n\ndescribe('Multi Select', () => {\n  before(() => {\n    cy.visit(cypressJson.baseUrl);\n    cy.title().should('equal', 'React-Select');\n    cy.get('h1').should('contain', 'Test Page for Cypress');\n  });\n  beforeEach(() => {\n    cy.reload();\n  });\n\n  for (let config of setup) {\n    const { viewport } = config;\n    it(`Should display several default values that can be removed in view: ${viewport}`, () => {\n      cy.get(selector.multiSelectDefaultValues).then(function ($defaultValue) {\n        expect($defaultValue).to.have.length(2);\n        expect($defaultValue.eq(0)).to.contain('Purple');\n        expect($defaultValue.eq(1)).to.contain('Red');\n      });\n\n      cy.get(selector.firstMultiValueRemove)\n        .click()\n        .get(selector.multiSelectDefaultValues)\n        .then(function ($defaultValue) {\n          expect($defaultValue).to.have.length(1);\n          expect($defaultValue.eq(0)).to.contain('Red');\n        })\n        .get(selector.menuMulti)\n        .should('not.be.visible');\n    });\n\n    it(`Should be able to remove values on keyboard actions in view: ${viewport}`, () => {\n      cy.get(selector.multiSelectInput)\n        .click()\n        .type('{backspace}', { force: true })\n        .get(selector.multiSelectDefaultValues)\n        .then(function ($defaultValue) {\n          expect($defaultValue).to.have.length(1);\n          expect($defaultValue.eq(0)).to.contain('Purple');\n        })\n        .get(selector.multiSelectInput)\n        .type('{backspace}', { force: true })\n        .get(selector.placeHolderMulti)\n        .should('contain', 'Select...');\n    });\n\n    it(`Should select different options using - click and enter in view: ${viewport}`, () => {\n      cy.get(selector.menuMulti)\n        .should('not.exist')\n        .get(selector.toggleMenuMulti)\n        .click()\n        .get(selector.menuMulti)\n        .should('exist')\n        .get(selector.menuMulti)\n        .should('be.visible')\n        .get(selector.menuOption)\n        .contains('Orange')\n        .click()\n        .get(selector.toggleMenuMulti)\n        .click()\n        .get(selector.menuOption)\n        .contains('Yellow')\n        .click()\n        .get(selector.multiSelectInput)\n        .click({ force: true })\n        .type('Slate', { force: true })\n        .type('{enter}', { force: true })\n        .get(selector.multiSelectDefaultValues)\n        .then(function ($defaultValue) {\n          expect($defaultValue).to.have.length(5);\n          expect($defaultValue.eq(0)).to.contain('Purple');\n          expect($defaultValue.eq(1)).to.contain('Red');\n          expect($defaultValue.eq(2)).to.contain('Orange');\n          expect($defaultValue.eq(3)).to.contain('Yellow');\n          expect($defaultValue.eq(4)).to.contain('Slate');\n        });\n    });\n  }\n});\n"
  },
  {
    "path": "cypress/integration/single-select.spec.ts",
    "content": "import selector from '../fixtures/selectors.json';\nimport cypressJson from '../../cypress.json';\n\nconst setup = [\n  {\n    width: 1440,\n    height: 900,\n    viewport: 'macbook-15' as const,\n    device: 'Laptop',\n  },\n  { width: 375, height: 667, viewport: 'iphone-6' as const, device: 'Mobile' },\n  { width: 768, height: 1024, viewport: 'ipad-2' as const, device: 'Tablet' },\n];\n\ndescribe('Single Select', () => {\n  before(() => {\n    cy.visit(cypressJson.baseUrl);\n    cy.title().should('equal', 'React-Select');\n    cy.get('h1').should('contain', 'Test Page for Cypress');\n  });\n\n  for (let config of setup) {\n    const { viewport } = config;\n\n    context(`Basic in view: ${viewport}`, () => {\n      before(() => {\n        cy.viewport(viewport);\n      });\n\n      beforeEach(() => {\n        cy.reload();\n      });\n\n      // TODO:\n      // This test seems to fail when cypress tab is focused.\n      // Also, manual testing does not confirm the desired behavior.\n      it.skip(`Should not display the options menu when touched and dragged in view: ${viewport}`, () => {\n        cy.get(selector.toggleMenuSingle)\n          .click()\n          .click()\n          .get(selector.menuSingle)\n          .should('not.be.visible')\n          // to be sure it says focus and the menu is closed\n          .get(selector.singleSelectSingleInput)\n          .trigger('mousedown')\n          .get(selector.menuSingle)\n          .should('not.be.visible');\n      });\n      it(`Should display a default value in view: ${viewport}`, () => {\n        cy.get(selector.singleBasicSelect)\n          .find(selector.singleValue)\n          .should('contain', 'Ocean');\n      });\n\n      it(`Should expand the menu when expand icon is clicked in view: ${viewport}`, () => {\n        cy\n          // Menu is not yet open\n          .get(selector.singleBasicSelect)\n          .find(selector.menu)\n          .should('not.exist')\n          // A dropdown icon is shown\n          .get(selector.singleBasicSelect)\n          .find(selector.indicatorDropdown)\n          .should('be.visible')\n          // Click the icon to open the menu\n          .click()\n          .get(selector.singleBasicSelect)\n          .find(selector.menu)\n          .should('exist')\n          .should('be.visible')\n          .contains('Green');\n      });\n\n      it(`Should close the menu after selecting an option in view: ${viewport}`, () => {\n        cy.get(selector.singleBasicSelect)\n          .find(selector.indicatorDropdown)\n          .click()\n          .get(selector.singleBasicSelect)\n          .find(selector.menu)\n          .should('contain', 'Green')\n          .contains('Green')\n          .click()\n          // Value has updated\n          .get(selector.singleBasicSelect)\n          .find(selector.singleValue)\n          .should('contain', 'Green')\n          // Menu has closed\n          .get(selector.singleBasicSelect)\n          .find(selector.menu)\n          .should('not.exist');\n      });\n\n      it(`Should be disabled once disabled is checked in view: ${viewport}`, () => {\n        cy\n          // Does not start out disabled\n          .get(selector.singleBasicSelect)\n          // .click()\n          .find('input')\n          .should('exist')\n          .should('not.be.disabled')\n          // Disable the select component\n          .get(selector.singleBasic)\n          .find(selector.checkboxDisable)\n          .click()\n          // Now the input should be disabled\n          .get(selector.singleBasicSelect)\n          .click({ force: true })\n          .find('input')\n          .should('exist')\n          .should('be.disabled')\n          // control should have aria-disabled\n          .get(selector.singleBasicSelect)\n          .find(selector.control)\n          .should('have.attr', 'aria-disabled', 'true');\n      });\n\n      it(`Should filter options when searching in view: ${viewport}`, () => {\n        cy.get(selector.singleBasicSelect)\n          .click()\n          .find('input')\n          .type('For', { force: true })\n          .get(selector.singleBasicSelect)\n          .find(selector.menu)\n          .should('contain', 'Forest')\n          .find(selector.menuOption)\n          .should('have.length', 1);\n      });\n\n      it(`Should show \"No options\" if searched value is not found  in view: ${viewport}`, () => {\n        cy.get(selector.singleBasicSelect)\n          .click()\n          .find('input')\n          .type('/', { force: true })\n          .get(selector.noOptionsValue)\n          .should('contain', 'No options');\n      });\n\n      it(`Should not clear the value when backspace is pressed in view: ${viewport}`, () => {\n        cy.get(selector.singleBasicSelect)\n          .click()\n          .find('input')\n          .type('{backspace}', { force: true })\n          .get(selector.singleBasicSelect)\n          .find(selector.placeholder)\n          .should('not.be.visible');\n      });\n    });\n\n    context(`Grouped in view: ${viewport}`, () => {\n      before(() => {\n        cy.viewport(viewport);\n      });\n\n      beforeEach(() => {\n        cy.reload();\n      });\n\n      it(`Should display a default value in view: ${viewport}`, () => {\n        cy.get(selector.singleGroupedSelect)\n          .find(selector.singleValue)\n          .should('contain', 'Blue');\n      });\n\n      it(`Should display group headings in the menu in view: ${viewport}`, () => {\n        cy.get(selector.singleGroupedSelect)\n          .find(selector.indicatorDropdown)\n          .click()\n          .get(selector.singleGroupedSelect)\n          .find(selector.menu)\n          .should('be.visible')\n          .find(selector.groupHeading)\n          .should('have.length', 2);\n      });\n\n      it(`Should focus next option on down arrow key press: ${viewport}`, () => {\n        cy.get(selector.singleGroupedSelect)\n          .click()\n          .find('input')\n          .type('{downarrow}', { force: true })\n          .get(selector.focusedOption)\n          .should('exist');\n      });\n\n      it(`Should focus next option on down arrow key press after filtering: ${viewport}`, () => {\n        cy.get(selector.singleGroupedSelect)\n          .click()\n          .find('input')\n          .type('o', { force: true })\n          .type('{downarrow}', { force: true })\n          .get(selector.focusedOption)\n          .should('exist');\n      });\n    });\n\n    context(`Clearable in view: ${viewport}`, () => {\n      before(() => {\n        cy.viewport(viewport);\n      });\n\n      beforeEach(() => {\n        cy.reload();\n      });\n\n      it(`Should display a default value in view: ${viewport}`, () => {\n        cy.get(selector.singleClearableSelect)\n          .find(selector.singleValue)\n          .should('contain', 'Blue');\n      });\n\n      it(`Should display a clear indicator in view: ${viewport}`, () => {\n        cy.get(selector.singleClearableSelect)\n          .find(selector.indicatorClear)\n          .should('be.visible');\n      });\n\n      it(`Should clear the default value when clear is clicked in view: ${viewport}`, () => {\n        cy.get(selector.singleClearableSelect)\n          .find(selector.indicatorClear)\n          .click()\n          .get(selector.singleClearableSelect)\n          .find(selector.placeholder)\n          .should('be.visible')\n          .should('contain', 'Select...');\n      });\n\n      // 'backspaceRemovesValue' is true by default\n      it(`Should clear the value when backspace is pressed in view: ${viewport}`, () => {\n        cy.get(selector.singleClearableSelect)\n          .click()\n          .find('input')\n          .type('{backspace}', { force: true })\n          .get(selector.singleClearableSelect)\n          .find(selector.placeholder)\n          .should('be.visible')\n          .should('contain', 'Select...');\n      });\n\n      // 'backspaceRemovesValue' is true by default, and delete is included\n      it(`Should clear the value when delete is pressed in view: ${viewport}`, () => {\n        cy.get(selector.singleClearableSelect)\n          .click()\n          .find('input')\n          .type('{del}', { force: true })\n          .get(selector.singleClearableSelect)\n          .find(selector.placeholder)\n          .should('be.visible')\n          .should('contain', 'Select...');\n      });\n\n      it(`Should not open the menu when a value is cleared with backspace in view: ${viewport}`, () => {\n        cy.get(selector.singleClearableSelect)\n          .click()\n          .find('input')\n          // Close the menu, but leave focused\n          .type('{esc}', { force: true })\n          .get(selector.singleClearableSelect)\n          .find(selector.menu)\n          .should('not.be.visible')\n          // Clear the value, verify menu doesn't pop\n          .get(selector.singleClearableSelect)\n          .find('input')\n          .type('{backspace}', { force: true })\n          .get(selector.singleClearableSelect)\n          .find(selector.menu)\n          .should('not.be.visible');\n      });\n\n      it(`Should clear the value when escape is pressed if escapeClearsValue and menu is closed in view: ${viewport}`, () => {\n        cy\n          // nothing happens if escapeClearsValue is false\n          .get(selector.singleClearableSelect)\n          .click()\n          .find('input')\n          // Escape once to close the menu\n          .type('{esc}', { force: true })\n          .get(selector.singleBasicSelect)\n          .find(selector.menu)\n          .should('not.be.visible')\n          // Escape again to verify value is not cleared\n          .get(selector.singleClearableSelect)\n          .find('input')\n          .type('{esc}', { force: true })\n          .get(selector.singleClearableSelect)\n          .find(selector.placeholder)\n          .should('not.be.visible')\n          // Enable escapeClearsValue and try again, it should clear the value\n          .get(selector.singleClearable)\n          .find(selector.checkboxEscapeClearsValue)\n          .click()\n          .get(selector.singleClearableSelect)\n          .click()\n          .find('input')\n          // Escape once to close the menu\n          .type('{esc}', { force: true })\n          .get(selector.singleBasicSelect)\n          .find(selector.menu)\n          .should('not.be.visible')\n          // Escape again to clear value\n          .get(selector.singleClearableSelect)\n          .find('input')\n          .type('{esc}', { force: true })\n          .get(selector.singleClearableSelect)\n          .find(selector.placeholder)\n          .should('be.visible');\n      });\n    });\n  }\n});\n"
  },
  {
    "path": "cypress/tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"target\": \"es6\",\n    \"module\": \"commonjs\",\n    \"noEmit\": true,\n    \"strict\": true,\n    \"types\": [\"cypress\"],\n    \"esModuleInterop\": true,\n    \"resolveJsonModule\": true\n  }\n}\n"
  },
  {
    "path": "cypress.json",
    "content": "{\n  \"baseUrl\": \"http://localhost:8000/cypress-tests\",\n  \"video\": false\n}\n"
  },
  {
    "path": "docs/App/Footer.tsx",
    "content": "/** @jsx jsx */\nimport { jsx } from '@emotion/react';\n\n// const smallDevice = '@media (max-width: 769px)';\nconst largeDevice = '@media (min-width: 770px)';\n\nconst Wrapper = (props: JSX.IntrinsicElements['div']) => (\n  <div\n    css={{\n      backgroundColor: '#FAFBFC',\n      borderTop: '1px solid #EBECF0',\n      color: '#7A869A',\n      fontSize: '0.85em',\n      zIndex: 1,\n    }}\n    {...props}\n  />\n);\nconst Container = (props: JSX.IntrinsicElements['div']) => (\n  <div\n    css={{\n      boxSizing: 'border-box',\n      maxWidth: 800,\n      marginLeft: 'auto',\n      marginRight: 'auto',\n      paddingLeft: 20,\n      paddingRight: 20,\n\n      [largeDevice]: {\n        alignItems: 'center',\n        display: 'flex',\n        justifyContent: 'space-between',\n        paddingBottom: 20,\n        paddingTop: 20,\n      },\n    }}\n    {...props}\n  />\n);\nconst A = (props: JSX.IntrinsicElements['a']) => (\n  <a\n    {...props}\n    css={{\n      color: '#505F79',\n      textDecoration: 'none',\n\n      ':visited': {\n        color: '#505F79',\n      },\n      ':hover': {\n        textDecoration: 'underline',\n      },\n    }}\n    target=\"_blank\"\n  />\n);\n\nexport default function Footer() {\n  return (\n    <Wrapper>\n      <Container>\n        <p>\n          Copyright © <A href=\"https://twitter.com/JedWatson\">Jed Watson</A>,\n          2022. MIT Licensed.\n        </p>\n        <p>\n          Thanks to <A href=\"https://www.thinkmill.com.au\">Thinkmill</A> and{' '}\n          <A href=\"https://www.atlassian.com\">Atlassian</A> for supporting this\n          project.\n        </p>\n      </Container>\n    </Wrapper>\n  );\n}\n"
  },
  {
    "path": "docs/App/GitHubButton.tsx",
    "content": "/** @jsx jsx */\nimport { jsx } from '@emotion/react';\n\ninterface Props {\n  readonly count: number;\n  readonly repo: string;\n}\n\nconst StarButton = ({ count, repo }: Props) => (\n  <div css={{ alignItems: 'center', display: 'inline-flex', minWidth: 128 }}>\n    <a\n      aria-label=\"Star react-select on GitHub\"\n      css={{\n        alignItems: 'center',\n        display: 'flex',\n        borderRadius: 2,\n        color: '#253858',\n        backgroundColor: 'white',\n        boxShadow: '0 1px 0 rgba(0, 0, 0, 0.2)',\n        cursor: 'pointer',\n        fontSize: 13,\n        fontWeight: 'bold',\n        padding: '6px 10px',\n        position: 'relative',\n        textDecoration: 'none',\n\n        ':hover': {\n          boxShadow: '0 1px 0 rgba(0, 0, 0, 0.2), 0 2px 5px rgba(0, 0, 0, 0.2)',\n          color: '#091e42',\n        },\n        ':active': {\n          background: '#DFE1E5',\n          boxShadow: '0 1px 0 rgba(0, 0, 0, 0.2)',\n          color: '#091e42',\n          bottom: -1,\n        },\n      }}\n      style={{\n        backgroundImage: 'linear-gradient(180deg, #fff 33%, #DFE1E5 100%)',\n      }}\n      href={repo}\n      target=\"_blank\"\n    >\n      <svg\n        version=\"1.1\"\n        width=\"16\"\n        height=\"16\"\n        viewBox=\"0 0 16 16\"\n        fill=\"currentColor\"\n        aria-hidden=\"true\"\n      >\n        <path\n          fillRule=\"evenodd\"\n          d=\"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z\"\n        />\n      </svg>\n      <span css={{ paddingLeft: 4 }}>Star</span>\n    </a>\n    <a\n      css={{\n        backgroundColor: 'white',\n        borderRadius: 2,\n        color: '#253858',\n        cursor: 'pointer',\n        display: 'inline-block',\n        fontSize: 13,\n        fontWeight: 500,\n        letterSpacing: '-0.01em',\n        marginLeft: 6,\n        opacity: count > 0 ? 1 : 0,\n        padding: '6px 7px',\n        position: 'relative',\n        textDecoration: 'none',\n        transition: 'opacity 200ms',\n\n        '&:before': {\n          border: '4px solid transparent',\n          borderRightColor: 'white',\n          content: '\" \"',\n          height: 0,\n          left: -8,\n          top: '50%',\n          marginTop: -4,\n          position: 'absolute',\n          width: 0,\n        },\n      }}\n      href={`${repo}/stargazers`}\n      target=\"_blank\"\n    >\n      <span>{count && count.toLocaleString()}</span>\n    </a>\n  </div>\n);\n\nexport default StarButton;\n"
  },
  {
    "path": "docs/App/Header.tsx",
    "content": "/** @jsx jsx */\nimport fetch from 'unfetch';\nimport { Component, Ref, RefCallback } from 'react';\nimport { jsx } from '@emotion/react';\nimport { RouteComponentProps, withRouter } from 'react-router-dom';\n\nimport Select, { StylesConfig } from 'react-select';\nimport GitHubButton from './GitHubButton';\nimport TwitterButton from './TwitterButton';\nimport isArray from '../isArray';\n\nconst smallDevice = '@media (max-width: 769px)';\nconst largeDevice = '@media (min-width: 770px)';\n\ninterface Change {\n  value: string;\n  icon: string;\n  label: string;\n}\n\nconst changes = [\n  {\n    value: '/typescript',\n    icon: '🛠️',\n    label: 'Written in TypeScript',\n  },\n  {\n    value: '/props',\n    icon: '❤️',\n    label: 'Simpler and more extensible',\n  },\n  {\n    value: '/styles',\n    icon: '🎨',\n    label: 'CSS-in-JS styling API',\n  },\n  {\n    value: '/components',\n    icon: '📦',\n    label: 'Replaceable component architecture',\n  },\n  {\n    value: '/advanced',\n    icon: '🔥',\n    label: 'Lots of advanced functionality',\n  },\n  {\n    value: '/upgrade',\n    icon: '🗺',\n    label: 'Check out the Upgrade Guide',\n  },\n];\n\nfunction getLabel({ icon, label }: Change) {\n  return (\n    <div style={{ alignItems: 'center', display: 'flex' }}>\n      <span style={{ fontSize: 18, marginRight: '0.5em' }}>{icon}</span>\n      <span style={{ fontSize: 14 }}>{label}</span>\n    </div>\n  );\n}\n\nconst headerSelectStyles: StylesConfig<Change, boolean> = {\n  control: (base, { isFocused }) => ({\n    ...base,\n    backgroundClip: 'padding-box',\n    borderColor: 'rgba(0,0,0,0.1)',\n    boxShadow: isFocused ? '0 0 0 1px #4C9AFF' : undefined,\n\n    ':hover': {\n      borderColor: 'rgba(0,0,0,0.2)',\n    },\n  }),\n  option: (base) => ({\n    ...base,\n    padding: '4px 12px',\n  }),\n  placeholder: (base) => ({\n    ...base,\n    color: 'black',\n  }),\n};\n\nconst Gradient = (props: JSX.IntrinsicElements['div']) => (\n  <div\n    css={{\n      backgroundColor: '#2684FF',\n      backgroundImage: 'linear-gradient(135deg, #2684FF 0%, #0747A6 100%)',\n      color: 'white',\n      position: 'relative',\n      zIndex: 2,\n\n      [largeDevice]: {\n        boxShadow: '0 5px 0 rgba(0, 0, 0, 0.08)',\n      },\n    }}\n    {...props}\n  />\n);\nconst Container = (props: JSX.IntrinsicElements['div']) => (\n  <div\n    css={{\n      boxSizing: 'border-box',\n      maxWidth: 800,\n      marginLeft: 'auto',\n      marginRight: 'auto',\n      padding: 20,\n\n      [largeDevice]: {\n        paddingBottom: 40,\n        paddingTop: 40,\n      },\n    }}\n    {...props}\n  />\n);\n\ninterface HeaderState {\n  readonly stars: number;\n}\n\nconst apiUrl = 'https://api.github.com/repos/jedwatson/react-select';\n\nclass Header extends Component<RouteComponentProps, HeaderState> {\n  nav: HTMLElement | undefined;\n  content!: HTMLElement;\n  state: HeaderState = { stars: 0 };\n  componentDidMount() {\n    this.getStarCount();\n  }\n  getStarCount = () => {\n    fetch(apiUrl)\n      .then((res) => res.json())\n      .then((data) => {\n        const stars = data.stargazers_count;\n        this.setState({ stars });\n      })\n      .catch((err) => {\n        console.error('Error retrieving data', err);\n      });\n  };\n  isHome = (props = this.props) => {\n    const valid = ['/', '/home'];\n    return valid.includes(props.location.pathname);\n  };\n  setContentRef: RefCallback<HTMLDivElement> = (ref) => {\n    if (!ref) return;\n    this.content = ref;\n  };\n  getContentHeight = () => {\n    if (!this.content) {\n      return 'auto';\n    }\n\n    return this.content.scrollHeight;\n  };\n  render() {\n    const { children, history } = this.props;\n    const { stars } = this.state;\n\n    return (\n      <Gradient>\n        {children}\n        <Collapse\n          isCollapsed={!this.isHome()}\n          height={this.getContentHeight()}\n          innerRef={this.setContentRef}\n        >\n          <Container>\n            <h1\n              css={{\n                fontSize: '2.4em',\n                fontWeight: 'bold',\n                lineHeight: 1,\n                margin: 0,\n                marginTop: '-0.2em',\n                textShadow: '1px 1px 0 rgba(0, 82, 204, 0.33)',\n                color: 'inherit',\n\n                [largeDevice]: {\n                  fontSize: '3.6em',\n                },\n              }}\n            >\n              React Select\n            </h1>\n            <Content\n              stars={stars}\n              onChange={(opt) => {\n                history.push(opt.value);\n              }}\n            />\n          </Container>\n        </Collapse>\n      </Gradient>\n    );\n  }\n}\n\ninterface CollapseProps {\n  readonly height: 'auto' | number;\n  readonly isCollapsed: boolean;\n  readonly innerRef: Ref<HTMLDivElement>;\n}\n\nconst Collapse = ({\n  height,\n  isCollapsed,\n  innerRef,\n  ...props\n}: CollapseProps & JSX.IntrinsicElements['div']) => {\n  return (\n    <div\n      ref={innerRef}\n      css={{\n        height: isCollapsed ? 0 : height,\n        overflow: isCollapsed ? 'hidden' : undefined,\n        transition: 'height 260ms cubic-bezier(0.2, 0, 0, 1)',\n      }}\n      {...props}\n    />\n  );\n};\n\ninterface ContentProps {\n  readonly onChange: (option: Change) => void;\n  readonly stars: number;\n}\n\nconst Content = ({ onChange, stars }: ContentProps) => (\n  <div\n    css={{\n      marginTop: 16,\n\n      [largeDevice]: { display: 'flex' },\n    }}\n  >\n    <div css={{ flex: 1, [largeDevice]: { paddingRight: 30 } }}>\n      <p\n        style={{\n          fontSize: '1.25em',\n          lineHeight: 1.4,\n          marginTop: -5,\n        }}\n      >\n        A flexible and beautiful Select Input control for ReactJS with\n        multiselect, autocomplete, async and creatable support.\n      </p>\n      <div css={{ flex: 1, alignItems: 'center' }}>\n        <GitHubButton\n          count={stars}\n          repo=\"https://github.com/jedwatson/react-select\"\n        />\n        <TwitterButton />\n      </div>\n    </div>\n    <div\n      css={{\n        color: 'black',\n        flex: '0 1 320px',\n        [smallDevice]: {\n          paddingTop: 30,\n        },\n      }}\n    >\n      <div className=\"animate-dropin\">\n        <Select\n          formatOptionLabel={getLabel}\n          isSearchable={false}\n          options={changes}\n          onChange={(option) => {\n            if (option && !isArray(option)) {\n              onChange(option);\n            }\n          }}\n          value={null}\n          placeholder=\"🎉 Feature Highlights\"\n          styles={headerSelectStyles}\n        />\n      </div>\n    </div>\n  </div>\n);\n\nexport default withRouter(Header);\n"
  },
  {
    "path": "docs/App/PageNav.tsx",
    "content": "/** @jsx jsx */\nimport { Component, FunctionComponent, MouseEvent, RefCallback } from 'react';\nimport { jsx } from '@emotion/react';\nimport { Route, RouteComponentProps, Switch } from 'react-router-dom';\n\nimport { animatedScrollTo } from 'react-select/src/utils';\nimport routes from './routes';\nimport ScrollSpy from './ScrollSpy';\nimport Sticky from './Sticky';\nimport store, { Data } from '../markdown/store';\n\nconst navWidth = 180;\nconst appGutter = 20;\nconst contentGutter = 30;\n\nconst smallDevice = '@media (max-width: 769px)';\nconst largeDevice = '@media (min-width: 770px)';\n\nconst NavSection: FunctionComponent<RouteComponentProps> = () => {\n  const routeKeys = Object.keys(routes);\n  return (\n    <Switch>\n      {routeKeys.map((r) => (\n        <Route key={r} path={r} render={(p) => <PageNav {...p} />} />\n      ))}\n    </Switch>\n  );\n};\n\ninterface NavState {\n  readonly links: readonly Data[];\n  readonly activeId: string | null;\n}\n\nclass PageNav extends Component<RouteComponentProps, NavState> {\n  scrollSpy!: ScrollSpy;\n  state: NavState = { activeId: null, links: [] };\n  componentDidMount() {\n    const { match } = this.props;\n\n    // eslint-disable-next-line\n    this.setState({ links: store.getPageHeadings(match.path) });\n  }\n  componentDidUpdate({ history, location }: RouteComponentProps) {\n    const { hash } = this.props.location; // old hash\n    const shouldRefresh = location.hash !== hash && history.action !== 'POP';\n\n    // this makes everything work, need those fresh nodes\n    if (shouldRefresh && this.scrollSpy.buildNodeList) {\n      this.scrollSpy.buildNodeList();\n    }\n  }\n  getSelected = (ids: readonly (string | null)[]) => {\n    const activeId = ids[0];\n    if (activeId !== this.state.activeId) {\n      this.setState({ activeId });\n    }\n  };\n  getScrollSpy: RefCallback<ScrollSpy> = (ref) => {\n    if (!ref) return;\n    this.scrollSpy = ref;\n  };\n  handleItemClick = ({\n    event,\n    hash,\n  }: {\n    readonly event: MouseEvent<HTMLDivElement>;\n    readonly hash: string;\n  }) => {\n    event.preventDefault();\n    const path = `#${hash}`;\n    const el = document.querySelector<HTMLElement>(path);\n    const { history } = this.props;\n\n    if (el && el.offsetTop) {\n      history.replace(path);\n      animatedScrollTo(window, el.offsetTop);\n    }\n  };\n  render() {\n    const { activeId, links } = this.state;\n    const isSmallDevice = window.innerWidth <= 769;\n\n    return links && links.length ? (\n      <Sticky preserveHeight={isSmallDevice}>\n        <ScrollSpy ref={this.getScrollSpy} onChange={this.getSelected}>\n          <Nav>\n            {links.map((l) => {\n              const hash = l.path.slice(1);\n              const selected = hash === activeId;\n\n              return l.level > 0 ? (\n                <NavItem\n                  data-hash={hash}\n                  key={hash}\n                  selected={selected}\n                  level={l.level}\n                  onClick={(event) => {\n                    this.handleItemClick({ event, hash });\n                  }}\n                >\n                  {l.label}\n                </NavItem>\n              ) : null;\n            })}\n          </Nav>\n        </ScrollSpy>\n      </Sticky>\n    ) : null;\n  }\n}\n\nexport default NavSection;\n\nconst Nav = (props: JSX.IntrinsicElements['div']) => (\n  <div\n    css={{\n      [smallDevice]: {\n        backgroundColor: 'rgba(255, 255, 255, 0.96)',\n        boxShadow: 'inset 0 -1px 0 rgba(0, 0, 0, 0.1)',\n        display: 'flex',\n        fontSize: 13,\n        marginLeft: -appGutter,\n        marginRight: -appGutter,\n        overflowX: 'auto',\n        WebkitOverflowScrolling: 'touch',\n      },\n\n      [largeDevice]: {\n        display: 'block',\n        float: 'left',\n        paddingBottom: contentGutter,\n        paddingTop: contentGutter,\n        width: navWidth,\n        zIndex: 1,\n      },\n    }}\n    {...props}\n  />\n);\n\ninterface NavItemProps {\n  readonly level: number;\n  readonly selected: boolean;\n}\n\nconst NavItem = ({\n  level,\n  selected,\n  ...props\n}: NavItemProps & JSX.IntrinsicElements['div']) => (\n  <div\n    role=\"button\"\n    css={{\n      color: selected ? '#091e42' : '#7A869A',\n      cursor: 'pointer',\n      display: 'inline-block',\n      padding: `15px ${appGutter}px`,\n      position: 'relative',\n      textDecoration: 'none',\n      whiteSpace: 'nowrap',\n\n      ':hover, :active': {\n        color: selected ? 'hsl(0, 0%, 10%)' : '#2684FF',\n      },\n\n      [smallDevice]: {\n        display: level === 3 ? 'none' : undefined,\n        boxShadow: selected ? 'inset 0 -1px 0 black' : undefined,\n        padding: `10px ${appGutter}px`,\n      },\n\n      [largeDevice]: {\n        backgroundColor: selected ? 'white' : 'transparent',\n        display: 'block',\n        fontSize: level === 3 ? '0.9em' : undefined,\n        fontWeight: selected ? 800 : 'inherit',\n        padding: '10px 20px 10px 0',\n        paddingLeft: level === 3 ? 10 : 0,\n        transition: 'padding-left 150ms ease-out',\n      },\n    }}\n    {...props}\n  />\n);\n"
  },
  {
    "path": "docs/App/ScrollSpy.tsx",
    "content": "import React, { Component, ReactElement, RefCallback } from 'react';\nimport rafSchedule from 'raf-schd';\nimport NodeResolver from 'react-node-resolver';\n\ninterface Props {\n  readonly children: ReactElement;\n  readonly onChange: (elements: readonly (string | null)[]) => void;\n}\ninterface State {\n  readonly elements: readonly HTMLElement[];\n}\n\nfunction getStyle(el: HTMLElement, prop: string) {\n  const val = window.getComputedStyle(el, null).getPropertyValue(prop);\n  return parseFloat(val);\n}\nfunction isInView(el: HTMLElement) {\n  let rect = el.getBoundingClientRect();\n\n  const topOffset =\n    (getStyle(el, 'padding-top') + getStyle(el, 'margin-top')) * -1;\n\n  if (rect.top >= topOffset && rect.bottom <= window.innerHeight) {\n    return true;\n  }\n\n  return false;\n}\n\nexport default class ScrollSpy extends Component<Props, State> {\n  nav: HTMLElement | undefined;\n  allIds = [];\n  state: State = { elements: [] };\n  static defaultProps = { preserveHeight: false };\n  componentDidMount() {\n    window.addEventListener('scroll', this.handleScroll, false);\n    this.buildNodeList();\n  }\n  componentWillUnmount() {\n    window.removeEventListener('scroll', this.handleScroll);\n  }\n  handleScroll = rafSchedule((event: Event) => {\n    event.preventDefault();\n    const { onChange } = this.props;\n    const { elements } = this.state;\n    if (!elements.length) return;\n\n    const idsInView = elements\n      .filter(isInView)\n      .map((i) => i.getAttribute('id'));\n    if (idsInView.length) {\n      onChange(idsInView);\n    }\n  });\n  getElements: RefCallback<HTMLElement> = (ref) => {\n    if (!ref) return;\n    this.nav = ref;\n  };\n  buildNodeList = () => {\n    if (!this.nav) return;\n\n    const anchorList = this.nav.querySelectorAll<HTMLElement>('[data-hash]');\n    const elements = Array.from(anchorList).map(\n      (i) => document.querySelector<HTMLElement>(`#${i.dataset.hash}`)!\n    );\n\n    this.setState({ elements });\n  };\n  render() {\n    return (\n      <NodeResolver innerRef={this.getElements}>\n        {this.props.children}\n      </NodeResolver>\n    );\n  }\n}\n"
  },
  {
    "path": "docs/App/Section.tsx",
    "content": "import React, { FunctionComponent } from 'react';\nimport { Redirect, Route, RouteComponentProps, Switch } from 'react-router-dom';\n\nimport routes from './routes';\n\nconst Section: FunctionComponent<RouteComponentProps> = () => {\n  const routeKeys = Object.keys(routes);\n  return (\n    <Switch>\n      {routeKeys.map((r) => (\n        <Route key={r} path={r} render={(p) => <Content {...p} />} />\n      ))}\n      <Redirect from=\"/\" to=\"/home\" />\n    </Switch>\n  );\n};\n\nconst Content = ({ location, match }: RouteComponentProps) => {\n  const page = routes[match.path];\n\n  return (\n    <Route\n      path={match.path}\n      render={() => (\n        <Switch>\n          <Route exact key={location.key} path={match.path} component={page} />\n        </Switch>\n      )}\n    />\n  );\n};\n\nexport default Section;\n"
  },
  {
    "path": "docs/App/Sticky.tsx",
    "content": "import React, { Component, CSSProperties, RefCallback } from 'react';\nimport rafSchedule from 'raf-schd';\n\ninterface Props {\n  readonly preserveHeight: boolean;\n}\ninterface State {\n  readonly height: number | 'auto';\n  readonly isFixed: boolean;\n  readonly overScroll: number;\n  readonly scrollHeight: number | null | undefined;\n  readonly width: number | 'auto';\n}\n\nexport default class Sticky extends Component<Props, State> {\n  innerEl: HTMLDivElement | undefined;\n  outerEl: HTMLDivElement | undefined;\n  state: State = {\n    height: 'auto',\n    isFixed: false,\n    overScroll: 0,\n    scrollHeight: null,\n    width: 'auto',\n  };\n  static defaultProps = { preserveHeight: false };\n  componentDidMount() {\n    window.addEventListener('scroll', this.handleScroll, false);\n    // this.handleScroll();\n  }\n  componentWillUnmount() {\n    window.removeEventListener('scroll', this.handleScroll);\n  }\n  handleScroll = rafSchedule((event: Event) => {\n    if (!this.innerEl || !this.outerEl) return;\n\n    const offsetBottom = 88; // footer height\n    const { top: outerTop } = this.outerEl.getBoundingClientRect();\n    const innerTop = (this.innerEl.offsetTop && this.innerEl.offsetTop) || 0;\n    const scrollY = window.pageYOffset;\n    const maxScroll =\n      document.body &&\n      document.body.scrollHeight - window.innerHeight - offsetBottom;\n    const { isFixed, overScroll } = this.state;\n\n    // check for `isFixed` before setting state to prevent thrashing\n    if (isFixed && outerTop > 0) {\n      this.setState({ isFixed: false });\n    } else if (!isFixed && scrollY >= innerTop) {\n      this.setState({ isFixed: true });\n    }\n\n    // handle over scroll\n    if (maxScroll && scrollY >= maxScroll) {\n      this.setState({ overScroll: scrollY - maxScroll });\n    } else if (overScroll > 0 && scrollY < maxScroll) {\n      this.setState({ overScroll: 0 });\n    }\n  });\n  getOuterEl: RefCallback<HTMLDivElement> = (ref) => {\n    if (!ref) return;\n\n    this.outerEl = ref;\n  };\n  getInnerEl: RefCallback<HTMLDivElement> = (ref) => {\n    if (!ref) return;\n\n    this.innerEl = ref;\n\n    // get dimensions once, we're not interested in resize events\n    const firstChild = ref.firstElementChild!;\n    const availableHeight = window.innerHeight;\n    let { height, width } = firstChild.getBoundingClientRect();\n    let scrollHeight;\n\n    if (typeof this.state.height !== 'number') {\n      if (height > availableHeight) scrollHeight = availableHeight;\n      this.setState({ height, scrollHeight, width });\n    }\n  };\n  render() {\n    const { preserveHeight } = this.props;\n    const { height, isFixed, overScroll, scrollHeight, width } = this.state;\n    const outerStyle = isFixed && preserveHeight ? { height } : undefined;\n    const fixedStyles: CSSProperties = {\n      position: 'fixed',\n      top: 0,\n      width,\n      zIndex: 1,\n    };\n    const scrollStyles = scrollHeight\n      ? {\n          height: overScroll ? scrollHeight - overScroll : scrollHeight,\n          overflow: 'scroll',\n        }\n      : null;\n    const innerStyle = isFixed\n      ? { ...fixedStyles, ...scrollStyles }\n      : undefined;\n\n    return (\n      <div ref={this.getOuterEl} style={outerStyle}>\n        <div ref={this.getInnerEl} style={innerStyle}>\n          {this.props.children}\n        </div>\n      </div>\n    );\n  }\n}\n"
  },
  {
    "path": "docs/App/TwitterButton.tsx",
    "content": "/** @jsx jsx */\nimport { jsx } from '@emotion/react';\n\nconst TwitterButton = () => (\n  <div css={{ alignItems: 'center', display: 'inline-flex' }}>\n    <a\n      aria-label=\"Follow @JedWatson on Twitter\"\n      css={{\n        alignItems: 'center',\n        display: 'flex',\n        borderRadius: 2,\n        color: 'white',\n        border: '1px solid rgba(255, 255, 255, 0.3)',\n        background: 'rgba(255, 255, 255, 0.1)',\n        cursor: 'pointer',\n        fontSize: 13,\n        fontWeight: 'bold',\n        padding: '5px 12px 5px 8px',\n        marginLeft: '16px',\n        position: 'relative',\n        textDecoration: 'none',\n\n        ':hover': {\n          border: '1px solid rgba(255, 255, 255, 0.4)',\n          background: 'rgba(255, 255, 255, 0.15)',\n        },\n      }}\n      href=\"https://twitter.com/JedWatson\"\n      target=\"_blank\"\n    >\n      <svg\n        version=\"1.1\"\n        width=\"16\"\n        height=\"16\"\n        viewBox=\"0 0 2000 1625.36\"\n        fill=\"currentColor\"\n        aria-hidden=\"true\"\n      >\n        <path d=\"m 1999.9999,192.4 c -73.58,32.64 -152.67,54.69 -235.66,64.61 84.7,-50.78 149.77,-131.19 180.41,-227.01 -79.29,47.03 -167.1,81.17 -260.57,99.57 C 1609.3399,49.82 1502.6999,0 1384.6799,0 c -226.6,0 -410.328,183.71 -410.328,410.31 0,32.16 3.628,63.48 10.625,93.51 -341.016,-17.11 -643.368,-180.47 -845.739,-428.72 -35.324,60.6 -55.5583,131.09 -55.5583,206.29 0,142.36 72.4373,267.95 182.5433,341.53 -67.262,-2.13 -130.535,-20.59 -185.8519,-51.32 -0.039,1.71 -0.039,3.42 -0.039,5.16 0,198.803 141.441,364.635 329.145,402.342 -34.426,9.375 -70.676,14.395 -108.098,14.395 -26.441,0 -52.145,-2.578 -77.203,-7.364 52.215,163.008 203.75,281.649 383.304,284.946 -140.429,110.062 -317.351,175.66 -509.5972,175.66 -33.1211,0 -65.7851,-1.949 -97.8828,-5.738 181.586,116.4176 397.27,184.359 628.988,184.359 754.732,0 1167.462,-625.238 1167.462,-1167.47 0,-17.79 -0.41,-35.48 -1.2,-53.08 80.1799,-57.86 149.7399,-130.12 204.7499,-212.41\" />\n      </svg>\n      <span css={{ paddingLeft: 8 }}>Follow</span>\n    </a>\n  </div>\n);\n\nexport default TwitterButton;\n"
  },
  {
    "path": "docs/App/components.tsx",
    "content": "/** @jsx jsx */\nimport { Component } from 'react';\nimport {\n  Link,\n  LinkProps,\n  RouteComponentProps,\n  withRouter,\n} from 'react-router-dom';\nimport { jsx } from '@emotion/react';\n\nconst navWidth = 180;\nconst appWidth = 800;\nconst appGutter = 20;\nconst contentGutter = 30;\nconst smallDevice = '@media (max-width: 769px)';\nconst largeDevice = '@media (min-width: 770px)';\n\nexport const AppContainer = (props: JSX.IntrinsicElements['div']) => (\n  <div\n    css={{\n      boxSizing: 'border-box',\n      marginLeft: 'auto',\n      marginRight: 'auto',\n      maxWidth: appWidth,\n      minHeight: '100vh',\n      padding: `0 ${appGutter}px`,\n    }}\n    {...props}\n  />\n);\nexport const PageContent = (props: JSX.IntrinsicElements['div']) => (\n  <div\n    css={{\n      paddingBottom: contentGutter * 4,\n      paddingTop: contentGutter,\n\n      [smallDevice]: {\n        paddingTop: contentGutter * 2,\n      },\n    }}\n    {...props}\n  />\n);\nexport const AppContent = (props: JSX.IntrinsicElements['div']) => (\n  <div\n    css={{\n      flex: '1 1 auto',\n      marginLeft: 'auto',\n      marginRight: 'auto',\n\n      [largeDevice]: {\n        paddingLeft: navWidth + contentGutter,\n      },\n    }}\n    {...props}\n  />\n);\n\n// ==============================\n// Navigation\n// ==============================\n\nexport const PrimaryNav = (props: JSX.IntrinsicElements['div']) => (\n  <div\n    css={{\n      backgroundColor: 'rgba(0, 0, 0, 0.11)',\n      fontWeight: 500,\n      overflowX: 'auto',\n      top: 0,\n      width: '100%',\n      WebkitOverflowScrolling: 'touch',\n    }}\n  >\n    <div\n      css={{\n        boxSizing: 'border-box',\n        display: 'flex',\n        maxWidth: 800,\n        marginLeft: 'auto',\n        marginRight: 'auto',\n      }}\n      {...props}\n    />\n  </div>\n);\nexport const PrimaryNavItem = ({\n  selected,\n  ...props\n}: LinkProps & { readonly selected: boolean }) => (\n  <Link\n    css={{\n      color: selected ? 'white' : '#DEEBFF',\n      display: 'inline-block',\n      opacity: selected ? 1 : 0.8,\n      padding: `20px ${appGutter}px`,\n      position: 'relative',\n      textDecoration: 'none',\n      whiteSpace: 'nowrap',\n\n      ':hover, :active': {\n        opacity: 1,\n      },\n\n      [smallDevice]: {\n        fontSize: 13,\n        padding: `10px ${appGutter}px`,\n      },\n    }}\n    {...props}\n  />\n);\n\n// ==============================\n// Scroll Restoration\n// ==============================\n\n// Return scroll to top on route change\nclass ScrollToTop extends Component<RouteComponentProps> {\n  componentDidUpdate(prevProps: RouteComponentProps) {\n    const { history, location } = this.props;\n\n    // do not influence scroll on browser back/forward\n    if (history.action === 'POP') return;\n\n    // no scroll when extending the current path\n    const pathArr = location.pathname.split('/');\n    if (!prevProps.location.pathname.includes(pathArr[1])) {\n      window.scrollTo(0, 0);\n    }\n  }\n\n  render() {\n    return this.props.children;\n  }\n}\n\nexport const ScrollRestoration = withRouter(ScrollToTop);\n"
  },
  {
    "path": "docs/App/index.tsx",
    "content": "import React, { Component, Fragment } from 'react';\nimport { BrowserRouter, Route, Switch } from 'react-router-dom';\nimport { Helmet } from 'react-helmet';\n\nimport Header from './Header';\nimport Footer from './Footer';\n// import NoMatch from '../NoMatch';\n\nimport {\n  AppContainer,\n  AppContent,\n  PageContent,\n  PrimaryNav,\n  PrimaryNavItem,\n  ScrollRestoration,\n} from './components';\nimport Section from './Section';\nimport PageNav from './PageNav';\nimport Tests from '../Tests';\n\nconst sections = [\n  { label: 'Home', path: '/home' },\n  { label: 'Props', path: '/props' },\n  { label: 'Styles', path: '/styles' },\n  { label: 'Components', path: '/components' },\n  { label: 'Async', path: '/async' },\n  { label: 'Creatable', path: '/creatable' },\n  { label: 'Advanced', path: '/advanced' },\n  { label: 'TypeScript', path: '/typescript' },\n  { label: 'Upgrading', path: '/upgrade' },\n];\n\nexport default class App extends Component {\n  render() {\n    return (\n      <BrowserRouter>\n        <Switch>\n          <Route exact path=\"/cypress-tests\" component={Tests} />\n          <Route>\n            <div>\n              <Header>\n                <Route\n                  render={({ location }) => (\n                    <PrimaryNav>\n                      {sections.map((l) => {\n                        const selected = location.pathname.includes(l.path);\n\n                        return (\n                          <PrimaryNavItem\n                            key={l.path}\n                            selected={selected}\n                            to={l.path}\n                          >\n                            {l.label}\n                          </PrimaryNavItem>\n                        );\n                      })}\n                    </PrimaryNav>\n                  )}\n                />\n              </Header>\n\n              <ScrollRestoration>\n                <AppContainer>\n                  <Helmet>\n                    <title>React Select</title>\n                    <meta\n                      name=\"description\"\n                      content=\"A flexible and beautiful Select Input control for ReactJS with multiselect, autocomplete, async and creatable support.\"\n                    />\n                  </Helmet>\n                  <Route\n                    render={(props) => (\n                      <Fragment>\n                        <PageNav {...props} />\n                        <AppContent>\n                          <PageContent>\n                            <Section {...props} />\n                          </PageContent>\n                        </AppContent>\n                      </Fragment>\n                    )}\n                  />\n                </AppContainer>\n              </ScrollRestoration>\n              <Footer />\n            </div>\n          </Route>\n        </Switch>\n      </BrowserRouter>\n    );\n  }\n}\n"
  },
  {
    "path": "docs/App/routes.ts",
    "content": "import { ComponentType } from 'react';\nimport Home from '../pages/home';\nimport Props from '../pages/props';\nimport Styles from '../pages/styles';\nimport Components from '../pages/components';\nimport Async from '../pages/async';\nimport Creatable from '../pages/creatable';\nimport Advanced from '../pages/advanced';\nimport TypeScript from '../pages/typescript';\nimport Upgrade from '../pages/upgrade';\nimport UpgradeToV2 from '../pages/upgrade-to-v2';\n\nconst routes: { readonly [key: string]: ComponentType } = {\n  '/home': Home,\n  '/props': Props,\n  '/styles': Styles,\n  '/components': Components,\n  '/async': Async,\n  '/creatable': Creatable,\n  '/advanced': Advanced,\n  '/typescript': TypeScript,\n  '/upgrade': Upgrade,\n  '/upgrade-to-v2': UpgradeToV2,\n};\n\nexport default routes;\n"
  },
  {
    "path": "docs/CHANGELOG.md",
    "content": "# @react-select/docs\n\n## 3.1.3\n\n### Patch Changes\n\n- [`0773095f`](https://github.com/JedWatson/react-select/commit/0773095f4990b636f64ae7d0ab593353a1e03b22) [#5457](https://github.com/JedWatson/react-select/pull/5457) Thanks [@nderkim](https://github.com/nderkim)! - Add classNames API and unstyled prop\n\n- Updated dependencies [0773095f]:\n  - react-select@undefined\n\n## 3.1.2\n\n### Patch Changes\n\n- [`0ca2d5ba`](https://github.com/JedWatson/react-select/commit/0ca2d5ba4aa42fb2a1bf033bcee660a293e39e50) [#5431](https://github.com/JedWatson/react-select/pull/5431) Thanks [@nderkim](https://github.com/nderkim)! - Change `class` components to `functional` components\n\n- Updated dependencies [0ca2d5ba]:\n  - react-select@undefined\n\n## 3.1.1\n\n### Patch Changes\n\n- [638f5455](https://github.com/JedWatson/react-select/commit/638f545517d320fe70ca954511a71e96956abae3) [#4702](https://github.com/JedWatson/react-select/pull/4702) Thanks [@Methuselah96](https://github.com/Methuselah96)! - The Option generic is no longer required to extend the OptionBase type\n\n- Updated dependencies [10225290]:\n- Updated dependencies [53f1972b]:\n- Updated dependencies [b41f4ceb]:\n- Updated dependencies [4b028829]:\n- Updated dependencies [7fcec537]:\n- Updated dependencies [ca2c0e5b]:\n- Updated dependencies [9e82aadc]:\n- Updated dependencies [638f5455]:\n- Updated dependencies [23cea0b5]:\n- Updated dependencies [ef87c3ac]:\n  - react-select@undefined\n\n## 3.1.1-beta.1\n\n### Patch Changes\n\n- [638f5455](https://github.com/JedWatson/react-select/commit/638f545517d320fe70ca954511a71e96956abae3) [#4702](https://github.com/JedWatson/react-select/pull/4702) Thanks [@Methuselah96](https://github.com/Methuselah96)! - The Option generic is no longer required to extend the OptionBase type\n\n- Updated dependencies [10225290]:\n- Updated dependencies [53f1972b]:\n- Updated dependencies [b41f4ceb]:\n- Updated dependencies [7fcec537]:\n- Updated dependencies [9e82aadc]:\n- Updated dependencies [638f5455]:\n  - react-select@undefined\n\n## 3.1.1-beta.0\n\n### Patch Changes\n\n- Updated dependencies [4b028829]:\n- Updated dependencies [ef87c3ac]:\n  - react-select@undefined\n\n## 3.1.0\n\n### Minor Changes\n\n- [2baf5a9d](https://github.com/JedWatson/react-select/commit/2baf5a9df2f4f56f9c9374fcb879cb5259a6d8d0) [#4414](https://github.com/JedWatson/react-select/pull/4414) Thanks [@ebonow](https://github.com/ebonow)! - Add ariaLiveMessages prop for internationalization and other customisations\n\n### Patch Changes\n\n- Updated dependencies [2ffed9c6]:\n- Updated dependencies [c955415c]:\n- Updated dependencies [3ca22b2f]:\n- Updated dependencies [dce3863f]:\n- Updated dependencies [2baf5a9d]:\n- Updated dependencies [7cdb8a6b]:\n- Updated dependencies [ec7c0728]:\n  - react-select@undefined\n\n## 3.0.1\n\n### Patch Changes\n\n- [a016c878](https://github.com/JedWatson/react-select/commit/a016c87821d9289ef9c317c0c397d64a0824ce16) [#4420](https://github.com/JedWatson/react-select/pull/4420) Thanks [@Methuselah96](https://github.com/Methuselah96)! - Bump dependency on @babel/runtime in order to fix compatibility issues with Webpack 5\n\n- [0dbf0438](https://github.com/JedWatson/react-select/commit/0dbf043864ce7a7fa7d822182b4f1770aad5b036) [#4387](https://github.com/JedWatson/react-select/pull/4387) Thanks [@ebonow](https://github.com/ebonow)! - Update example for MultiSelectSort to prevent dragging on multiValueRemove component #4387\n\n- Updated dependencies [f600d13f]:\n- Updated dependencies [b5f9b0c5]:\n- Updated dependencies [a016c878]:\n- Updated dependencies [19b76342]:\n- Updated dependencies [10b5f5a5]:\n  - react-select@undefined\n\n## 3.0.0\n\n### Major Changes\n\n- [26b6325c](https://github.com/JedWatson/react-select/commit/26b6325c95113591e568451bc2296f98318a8dd9) [#4283](https://github.com/JedWatson/react-select/pull/4283) Thanks [@majgaard](https://github.com/majgaard)! - Upgrades Emotion dependency to v11.0.0\n\n  BREAKING CHANGE: The NonceProvider component now requires a `cacheKey` prop that corresponds to the `key` for the Emotion cache.\n\n### Patch Changes\n\n- Updated dependencies [2d5496d5]:\n- Updated dependencies [02050675]:\n- Updated dependencies [26b6325c]:\n- Updated dependencies [b2488bb5]:\n  - react-select@undefined\n\n## 2.4.6\n\n### Patch Changes\n\n- [7af1aafb](https://github.com/JedWatson/react-select/commit/7af1aafb2314db02544b7970784b868e97ec4824) [#4295](https://github.com/JedWatson/react-select/pull/4295) Thanks [@JedWatson](https://github.com/JedWatson)! - Fix menuplacement context\n\n- Updated dependencies [c8d74bd5]:\n- Updated dependencies [c8447f48]:\n- Updated dependencies [7af1aafb]:\n- Updated dependencies [32ad5c04]:\n- Updated dependencies [6af14fbb]:\n- Updated dependencies [0eb1ef96]:\n- Updated dependencies [ad608c8f]:\n  - react-select@undefined\n\n## 2.4.5\n\n- Updated dependencies [[9ad152b](https://github.com/JedWatson/react-select/commit/9ad152b)]:\n  - react-select@3.0.0\n"
  },
  {
    "path": "docs/ExampleWrapper.tsx",
    "content": "/** @jsx jsx */\nimport { jsx } from '@emotion/react'; // eslint-disable-line no-unused-vars\nimport { CSSObject } from '@emotion/serialize';\nimport { ReactNode, useState } from 'react';\nimport CodeSandboxer, { GitInfo } from 'react-codesandboxer';\nimport { CodeBlock } from './markdown/renderer';\nimport pkg from '../packages/react-select/package.json';\nimport { defaultTheme } from 'react-select';\nimport Svg, { SvgProps } from './Svg';\n\nconst { colors } = defaultTheme;\n\nconst gitInfo: GitInfo = {\n  account: 'JedWatson',\n  repository: 'react-select',\n  branch: 'master',\n  host: 'github',\n};\n\nconst sourceUrl = `https://github.com/${gitInfo.account}/react-select/tree/${gitInfo.branch}`;\n\ninterface Props {\n  children?: ReactNode;\n  readonly label: string;\n  readonly raw: { readonly default: string };\n  readonly urlPath: string;\n  readonly isEditable?: boolean;\n}\n\nexport default ({\n  children,\n  label,\n  raw,\n  urlPath,\n  isEditable = true,\n}: Props) => {\n  const [showCode, setShowCode] = useState(false);\n\n  return (\n    <div>\n      <ExampleHeading>\n        <h4>{label}</h4>\n        <Actions>\n          {raw ? (\n            <ButtonAction\n              onClick={() => setShowCode((prev) => !prev)}\n              title=\"View Source\"\n            >\n              <SourceIcon />\n            </ButtonAction>\n          ) : (\n            <AAction\n              href={`${sourceUrl}/${urlPath}`}\n              target=\"_blank\"\n              title=\"View Source\"\n            >\n              <SourceIcon />\n            </AAction>\n          )}\n          {isEditable ? (\n            <CodeSandboxer\n              example={raw.default}\n              examplePath={urlPath}\n              pkgJSON={pkg}\n              gitInfo={gitInfo}\n              dependencies={{\n                [pkg.name]: pkg.version,\n              }}\n            >\n              {({ isLoading }) => (\n                <ButtonAction title=\"Edit in CodeSandbox\">\n                  {isLoading ? <Spinner /> : <NewWindowIcon />}\n                </ButtonAction>\n              )}\n            </CodeSandboxer>\n          ) : null}\n        </Actions>\n      </ExampleHeading>\n      {showCode && raw ? (\n        <CodeBlock literal={raw.default} codeinfo={['jsx']} />\n      ) : null}\n      {children}\n    </div>\n  );\n};\n\nconst ExampleHeading = (props: any) => (\n  <div\n    css={{\n      alignItems: 'center',\n      display: 'flex',\n      paddingBottom: '1em',\n      paddingTop: '1.25em',\n\n      '& > h4': {\n        margin: 0,\n      },\n    }}\n    {...props}\n  />\n);\n\n// ==============================\n// Source & Sandbox Actions\n// ==============================\n\nconst SourceIcon = (props: Omit<SvgProps, 'ref' | 'size'>) => (\n  <Svg size={16} {...props}>\n    <title>Source Code Icon</title>\n    <path d=\"M5.719 14.75c-0.236 0-0.474-0.083-0.664-0.252l-5.060-4.498 5.341-4.748c0.412-0.365 1.044-0.33 1.411 0.083s0.33 1.045-0.083 1.412l-3.659 3.253 3.378 3.002c0.413 0.367 0.45 0.999 0.083 1.412-0.197 0.223-0.472 0.336-0.747 0.336zM14.664 14.748l5.341-4.748-5.060-4.498c-0.413-0.367-1.045-0.33-1.411 0.083s-0.33 1.045 0.083 1.412l3.378 3.003-3.659 3.252c-0.413 0.367-0.45 0.999-0.083 1.412 0.197 0.223 0.472 0.336 0.747 0.336 0.236 0 0.474-0.083 0.664-0.252zM9.986 16.165l2-12c0.091-0.545-0.277-1.060-0.822-1.151-0.547-0.092-1.061 0.277-1.15 0.822l-2 12c-0.091 0.545 0.277 1.060 0.822 1.151 0.056 0.009 0.11 0.013 0.165 0.013 0.48 0 0.904-0.347 0.985-0.835z\" />\n  </Svg>\n);\nconst NewWindowIcon = (props: Omit<SvgProps, 'ref' | 'size'>) => (\n  <Svg size={16} {...props}>\n    <title>New Window Icon</title>\n    <path d=\"M18.174 1.826c-1.102-1.102-2.082-0.777-2.082-0.777l-8.639 8.632-1.453 4.319 4.317-1.454 8.634-8.638c0 0 0.324-0.98-0.777-2.082zM10.605 11.605l-0.471 0.47-1.473 0.5c-0.104-0.24-0.234-0.477-0.498-0.74s-0.5-0.394-0.74-0.498l0.5-1.473 0.471-0.47c0 0 0.776-0.089 1.537 0.673 0.762 0.761 0.674 1.538 0.674 1.538zM16 17h-13v-13h5l2-2h-7c-1.1 0-2 0.9-2 2v13c0 1.1 0.9 2 2 2h13c1.1 0 2-0.9 2-2v-7l-2 2v5z\" />\n  </Svg>\n);\n\nconst actionCSS: CSSObject = {\n  alignItems: 'center',\n  background: 0,\n  border: 0,\n  borderRadius: 3,\n  boxSizing: 'border-box',\n  color: colors.neutral40,\n  cursor: 'pointer',\n  display: 'flex',\n  fontSize: 'inherit',\n  height: 24,\n  marginLeft: 2,\n  justifyContent: 'center',\n  position: 'relative',\n  transition: 'background-color 150ms, box-shadow 150ms, color 150ms',\n  width: 30,\n\n  ':hover': {\n    backgroundColor: colors.neutral5,\n    outline: 0,\n  },\n  ':active': {\n    backgroundColor: colors.neutral10,\n    bottom: -1,\n  },\n};\n\ninterface ActionProps {\n  readonly css?: CSSObject;\n}\nconst ButtonAction = ({\n  css,\n  ...props\n}: ActionProps & Omit<JSX.IntrinsicElements['button'], 'css'>) => {\n  return (\n    <button\n      css={{\n        ...actionCSS,\n        ...css,\n      }}\n      {...props}\n    />\n  );\n};\nconst AAction = ({\n  css,\n  ...props\n}: ActionProps & Omit<JSX.IntrinsicElements['a'], 'css'>) => {\n  return (\n    <a\n      css={{\n        ...actionCSS,\n        ...css,\n      }}\n      {...props}\n    />\n  );\n};\n\nconst Actions = (props: JSX.IntrinsicElements['div']) => (\n  <div\n    css={{\n      flex: '1 1',\n      alignItems: 'center',\n      display: 'flex',\n      justifyContent: 'flex-end',\n      opacity: 0.8,\n      transition: 'opacity 140ms',\n      transitionDelay: '140ms',\n\n      '&:hover': {\n        opacity: 1,\n      },\n      '&:focus-within': {\n        opacity: 1,\n      },\n    }}\n    {...props}\n  />\n);\n\n// ==============================\n// Spinner\n// ==============================\n\nconst Spinner = () => {\n  const offset = 187;\n  const duration = '1.4s';\n  const size = 16;\n\n  return (\n    <div css={{ height: size, width: size }}>\n      <style>{`\n      @keyframes rotator {\n        0% { transform: rotate(0deg); }\n        100% { transform: rotate(270deg); }\n      }\n\n      @keyframes dash {\n       0% { stroke-dashoffset: ${offset}; }\n       50% {\n         stroke-dashoffset: ${offset / 4};\n         transform:rotate(135deg);\n       }\n       100% {\n         stroke-dashoffset: ${offset};\n         transform:rotate(450deg);\n       }\n      }`}</style>\n      <svg\n        css={{ animation: `rotator ${duration} linear infinite` }}\n        width={size}\n        height={size}\n        viewBox=\"0 0 66 66\"\n        xmlns=\"http://www.w3.org/2000/svg\"\n      >\n        <circle\n          css={{\n            strokeDasharray: offset,\n            strokeDashoffset: 0,\n            transformOrigin: 'center',\n            animation: `dash ${duration} ease-in-out infinite`,\n          }}\n          fill=\"none\"\n          stroke=\"currentColor\"\n          strokeWidth=\"7\"\n          strokeLinecap=\"round\"\n          cx=\"33\"\n          cy=\"33\"\n          r=\"30\"\n        />\n      </svg>\n    </div>\n  );\n};\n"
  },
  {
    "path": "docs/NoMatch.tsx",
    "content": "import React from 'react';\nimport { Link } from 'react-router-dom';\nimport { H1 } from './styled-components';\n\nexport default function NoMatch() {\n  return (\n    <div>\n      <H1>Oops!</H1>\n      <p>Couldn&apos;t find this page.</p>\n      <Link to=\"/\">Back home</Link>\n    </div>\n  );\n}\n"
  },
  {
    "path": "docs/PropTypes/Async.ts",
    "content": "export { AsyncAdditionalProps } from 'react-select/src/useAsync';\n"
  },
  {
    "path": "docs/PropTypes/Creatable.ts",
    "content": "export { CreatableAdditionalProps } from 'react-select/src/useCreatable';\n"
  },
  {
    "path": "docs/PropTypes/Select.ts",
    "content": "import { Component } from 'react';\n\nimport { Props, defaultProps } from 'react-select/src/Select';\nimport { GroupBase } from 'react-select';\n\nexport default class Select extends Component<\n  Props<unknown, boolean, GroupBase<unknown>>\n> {\n  defaultProps = defaultProps;\n}\n"
  },
  {
    "path": "docs/PropTypes/components/ClearIndicator.ts",
    "content": "import { Component } from 'react';\nimport { GroupBase, ClearIndicatorProps } from 'react-select';\n\nexport default class ClearIndicator<\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n> extends Component<ClearIndicatorProps<Option, IsMulti, Group>> {}\n"
  },
  {
    "path": "docs/PropTypes/components/Control.ts",
    "content": "import { Component } from 'react';\nimport { ControlProps, GroupBase } from 'react-select';\n\nexport default class Control<\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n> extends Component<ControlProps<Option, IsMulti, Group>> {}\n"
  },
  {
    "path": "docs/PropTypes/components/DropdownIndicator.ts",
    "content": "import { Component } from 'react';\nimport { GroupBase, DropdownIndicatorProps } from 'react-select';\n\nexport default class DropdownIndicator<\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n> extends Component<DropdownIndicatorProps<Option, IsMulti, Group>> {}\n"
  },
  {
    "path": "docs/PropTypes/components/Group.ts",
    "content": "import { Component } from 'react';\nimport { GroupBase, GroupProps } from 'react-select';\n\nexport default class Group<\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n> extends Component<GroupProps<Option, IsMulti, Group>> {}\n"
  },
  {
    "path": "docs/PropTypes/components/IndicatorsContainer.ts",
    "content": "import { Component } from 'react';\nimport { GroupBase, IndicatorsContainerProps } from 'react-select';\n\nexport default class IndicatorsContainer<\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n> extends Component<IndicatorsContainerProps<Option, IsMulti, Group>> {}\n"
  },
  {
    "path": "docs/PropTypes/components/IndicatorsSeparator.ts",
    "content": "import { Component } from 'react';\nimport { DropdownIndicatorProps, GroupBase } from 'react-select';\n\nexport default class DropdownIndicator<\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n> extends Component<DropdownIndicatorProps<Option, IsMulti, Group>> {}\n"
  },
  {
    "path": "docs/PropTypes/components/Input.ts",
    "content": "import { Component } from 'react';\nimport { GroupBase, InputProps } from 'react-select';\n\nexport default class Input<\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n> extends Component<InputProps<Option, IsMulti, Group>> {}\n"
  },
  {
    "path": "docs/PropTypes/components/LoadingIndicator.ts",
    "content": "import { Component } from 'react';\nimport { GroupBase, LoadingIndicatorProps } from 'react-select';\n\nexport default class LoadingIndicator<\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n> extends Component<LoadingIndicatorProps<Option, IsMulti, Group>> {}\n"
  },
  {
    "path": "docs/PropTypes/components/LoadingMessage.ts",
    "content": "import { Component } from 'react';\nimport { GroupBase, NoticeProps } from 'react-select';\n\nexport default class LoadingMessage<\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n> extends Component<NoticeProps<Option, IsMulti, Group>> {}\n"
  },
  {
    "path": "docs/PropTypes/components/Menu.ts",
    "content": "import { Component } from 'react';\nimport { GroupBase, MenuProps } from 'react-select';\n\nexport default class Menu<\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n> extends Component<MenuProps<Option, IsMulti, Group>> {}\n"
  },
  {
    "path": "docs/PropTypes/components/MenuList.ts",
    "content": "import { Component } from 'react';\nimport { GroupBase, MenuListProps } from 'react-select';\n\nexport default class MenuList<\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n> extends Component<MenuListProps<Option, IsMulti, Group>> {}\n"
  },
  {
    "path": "docs/PropTypes/components/MultiValue.ts",
    "content": "import { Component } from 'react';\nimport { GroupBase, MultiValueProps } from 'react-select';\n\nexport default class MultiValue<\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n> extends Component<MultiValueProps<Option, IsMulti, Group>> {}\n"
  },
  {
    "path": "docs/PropTypes/components/MultiValueContainer.ts",
    "content": "import { Component } from 'react';\nimport { GroupBase, MultiValueGenericProps } from 'react-select';\n\nexport default class MultiValueContainer<\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n> extends Component<MultiValueGenericProps<Option, IsMulti, Group>> {}\n"
  },
  {
    "path": "docs/PropTypes/components/MultiValueLabel.ts",
    "content": "import { Component } from 'react';\nimport { GroupBase, MultiValueGenericProps } from 'react-select';\n\nexport default class MultiValueLabel<\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n> extends Component<MultiValueGenericProps<Option, IsMulti, Group>> {}\n"
  },
  {
    "path": "docs/PropTypes/components/MultiValueRemove.ts",
    "content": "import { Component } from 'react';\nimport { GroupBase, MultiValueGenericProps } from 'react-select';\n\nexport default class MultiValueRemove<\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n> extends Component<MultiValueGenericProps<Option, IsMulti, Group>> {}\n"
  },
  {
    "path": "docs/PropTypes/components/NoOptionsMessage.ts",
    "content": "import { Component } from 'react';\nimport { GroupBase, NoticeProps } from 'react-select';\n\nexport default class NoOptionsMessage<\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n> extends Component<NoticeProps<Option, IsMulti, Group>> {}\n"
  },
  {
    "path": "docs/PropTypes/components/Option.ts",
    "content": "import { Component } from 'react';\nimport { GroupBase, OptionProps } from 'react-select';\n\nexport default class Option<\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n> extends Component<OptionProps<Option, IsMulti, Group>> {}\n"
  },
  {
    "path": "docs/PropTypes/components/Placeholder.ts",
    "content": "import { Component } from 'react';\nimport { GroupBase, PlaceholderProps } from 'react-select';\n\nexport default class Placeholder<\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n> extends Component<PlaceholderProps<Option, IsMulti, Group>> {}\n"
  },
  {
    "path": "docs/PropTypes/components/SelectContainer.ts",
    "content": "import { Component } from 'react';\nimport { ContainerProps, GroupBase } from 'react-select';\n\nexport default class SelectContainer<\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n> extends Component<ContainerProps<Option, IsMulti, Group>> {}\n"
  },
  {
    "path": "docs/PropTypes/components/SingleValue.ts",
    "content": "import { Component } from 'react';\nimport { GroupBase, SingleValueProps } from 'react-select';\n\nexport default class SingleValue<\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n> extends Component<SingleValueProps<Option, IsMulti, Group>> {}\n"
  },
  {
    "path": "docs/PropTypes/components/ValueContainer.ts",
    "content": "import { Component } from 'react';\nimport { GroupBase, ValueContainerProps } from 'react-select';\n\nexport default class ValueContainer<\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n> extends Component<ValueContainerProps<Option, IsMulti, Group>> {}\n"
  },
  {
    "path": "docs/PropTypes/stateManager.ts",
    "content": "export { StateManagerAdditionalProps } from 'react-select/src/useStateManager';\n"
  },
  {
    "path": "docs/Svg.tsx",
    "content": "/** @jsx jsx */\nimport { jsx } from '@emotion/react';\n\nexport type SvgProps = { readonly size: number } & JSX.IntrinsicElements['svg'];\n\nconst Svg = ({ size, ...props }: SvgProps) => (\n  <svg\n    focusable=\"false\"\n    height={size}\n    role=\"image\"\n    viewBox=\"0 0 20 20\"\n    width={size}\n    css={{\n      display: 'inline-block',\n      fill: 'currentColor',\n      flexShrink: 0,\n      lineHeight: 1,\n      stroke: 'currentColor',\n      strokeWidth: 0,\n    }}\n    {...props}\n  />\n);\n\nexport default Svg;\n"
  },
  {
    "path": "docs/Table.tsx",
    "content": "/** @jsx jsx */\nimport { FunctionComponent } from 'react';\nimport { jsx } from '@emotion/react';\n\nexport const Table: FunctionComponent = ({ children }) => (\n  <table\n    css={{\n      width: '100%',\n      marginTop: '30px',\n      borderCollapse: 'collapse',\n    }}\n  >\n    {children}\n  </table>\n);\n\nexport const Header: FunctionComponent = ({ children }) => (\n  <td\n    css={{\n      fontWeight: 'bold',\n      padding: '4px 8px 4px 0',\n      borderBottom: '3px solid #eee',\n    }}\n  >\n    {children}\n  </td>\n);\n\nexport const Cell: FunctionComponent = ({ children }) => (\n  <td\n    css={{\n      fontSize: '90%',\n      padding: '4px 8px 4px 0',\n      borderBottom: '1px solid #eee',\n      verticalAlign: 'top',\n    }}\n  >\n    {children}\n  </td>\n);\n"
  },
  {
    "path": "docs/Tests.tsx",
    "content": "import React, {\n  ChangeEventHandler,\n  ComponentProps,\n  ComponentType,\n  useState,\n} from 'react';\n\nimport Select, { MenuPlacement } from 'react-select';\nimport { H1, Note } from './styled-components';\nimport { colourOptions, groupedOptions, optionLength } from './data';\n\nimport * as animatedComponents from 'react-select/animated';\n\ninterface SuiteProps {\n  readonly selectComponent: ComponentType<ComponentProps<typeof Select>>;\n  readonly idSuffix: string;\n}\n\nconst AnimatedSelect = (props: ComponentProps<typeof Select>) => (\n  <Select\n    {...props}\n    components={{\n      ...animatedComponents,\n      ...props.components,\n    }}\n  />\n);\n\nconst TestSuite = ({ selectComponent: SelectComp, idSuffix }: SuiteProps) => {\n  const [isDisabled, setIsDisabled] = useState(false);\n  const [isFixed, setIsFixed] = useState(false);\n  const [isLoading, setIsLoading] = useState(false);\n  const [escapeClearsValue, setEscapeClearsValue] = useState(false);\n  const [portalPlacement, setPortalPlacement] = useState<MenuPlacement>('top');\n  const [blockScroll, setBlockScroll] = useState(true);\n  const toggleDisabled = () => {\n    setIsDisabled((state) => !state);\n  };\n  const toggleLoading = () => {\n    setIsLoading((state) => !state);\n  };\n  const toggleScroll = () => {\n    setBlockScroll((state) => !state);\n  };\n  const toggleMode = () => {\n    setIsFixed((state) => !state);\n  };\n  const toggleEscapeClearsValue = () => {\n    setEscapeClearsValue((state) => !state);\n  };\n\n  const setPlacement: ChangeEventHandler<HTMLSelectElement> = ({\n    currentTarget,\n  }) => {\n    const newPortalPlacement =\n      currentTarget && (currentTarget.value as MenuPlacement);\n    setPortalPlacement(newPortalPlacement);\n  };\n\n  const menuPortalTarget = !isFixed ? document.body : null;\n\n  return (\n    <div id={`cypress-container-${idSuffix}`}>\n      <div id={`cypress-${idSuffix}`}>\n        <SelectComp\n          autoFocus\n          id={`basic-select-${idSuffix}`}\n          instanceId={`basic-select-${idSuffix}`}\n          classNamePrefix=\"react-select\"\n          defaultValue={colourOptions[0]}\n          styles={{\n            menuPortal: (base) => ({ ...base, zIndex: 999 }),\n          }}\n          isDisabled={isDisabled}\n          isLoading={isLoading}\n          options={colourOptions}\n        />\n        <Note Tag=\"label\">\n          <input\n            type=\"checkbox\"\n            onChange={toggleDisabled}\n            className=\"disable-checkbox\"\n            id={`cypress-${idSuffix}__disabled-checkbox`}\n          />\n          Disabled\n        </Note>\n        <Note Tag=\"label\" style={{ marginLeft: '1em' }}>\n          <input\n            type=\"checkbox\"\n            onChange={toggleLoading}\n            id={`cypress-${idSuffix}__loading-checkbox`}\n          />\n          Loading\n        </Note>\n      </div>\n\n      <h4>Grouped</h4>\n      <div id={`cypress-${idSuffix}-grouped`}>\n        <SelectComp\n          id={`grouped-options-${idSuffix}`}\n          classNamePrefix=\"react-select\"\n          defaultValue={colourOptions[1]}\n          options={groupedOptions}\n        />\n      </div>\n\n      <h4>Clearable</h4>\n      <div id={`cypress-${idSuffix}-clearable`}>\n        <SelectComp\n          id={`clearable-select-${idSuffix}`}\n          isClearable\n          escapeClearsValue={escapeClearsValue}\n          classNamePrefix=\"react-select\"\n          defaultValue={colourOptions[1]}\n          options={groupedOptions}\n        />\n        <Note Tag=\"label\">\n          <input\n            type=\"checkbox\"\n            onChange={toggleEscapeClearsValue}\n            className=\"escape-clears-value-checkbox\"\n          />\n          escapeClearsValue\n        </Note>\n      </div>\n\n      <h4>Portalled</h4>\n      <div\n        id={`cypress-${idSuffix}-portalled`}\n        style={{\n          backgroundColor: 'papayaWhip',\n          borderRadius: 5,\n          boxSizing: 'border-box',\n          height: 200,\n          overflow: 'auto',\n          padding: 15,\n          width: '100%',\n        }}\n      >\n        <div style={{ height: 100 }} />\n        <pre>{'overflow: hidden; position: absolute;'}</pre>\n        <SelectComp\n          id={`portalled-select-${idSuffix}`}\n          instanceId={`portalled-select-${idSuffix}`}\n          classNamePrefix=\"react-select\"\n          defaultValue={colourOptions[0]}\n          options={colourOptions}\n          menuPortalTarget={menuPortalTarget}\n          menuShouldBlockScroll={blockScroll}\n          menuShouldScrollIntoView\n          menuPlacement={portalPlacement}\n          menuPosition={isFixed ? 'fixed' : 'absolute'}\n        />\n        <Note Tag=\"label\">\n          <select\n            onChange={setPlacement}\n            value={portalPlacement}\n            id=\"cypress-portalled__radio-bottom\"\n          >\n            <option value=\"auto\">auto</option>\n            <option value=\"bottom\">bottom</option>\n            <option value=\"top\">top</option>\n          </select>\n        </Note>\n        <Note Tag=\"label\" style={{ marginLeft: '1em' }}>\n          <input\n            type=\"radio\"\n            onChange={toggleMode}\n            value=\"fixed\"\n            checked={isFixed}\n            id=\"cypress-portalled__fixed\"\n          />\n          Fixed\n        </Note>\n        <Note Tag=\"label\" style={{ marginLeft: '1em' }}>\n          <input\n            type=\"radio\"\n            onChange={toggleMode}\n            value=\"portal\"\n            checked={!isFixed}\n            id=\"cypress-portalled__portal\"\n          />\n          Portal\n        </Note>\n        <Note Tag=\"label\" style={{ marginLeft: '1em' }}>\n          <input\n            type=\"checkbox\"\n            onChange={toggleScroll}\n            value=\"blockScroll\"\n            checked={blockScroll}\n            id=\"cypress-portalled__scroll\"\n          />\n          Block Scroll\n        </Note>\n        <div style={{ height: 100 }} />\n      </div>\n    </div>\n  );\n};\n\nexport default function Tests() {\n  return (\n    <div\n      style={{\n        margin: 'auto',\n        maxWidth: 440,\n        padding: 20,\n        position: 'relative',\n      }}\n    >\n      <H1>Test Page for Cypress</H1>\n      <h2>Single Select</h2>\n      <TestSuite selectComponent={Select} idSuffix=\"single\" />\n      <h3>Animated components</h3>\n      <TestSuite selectComponent={AnimatedSelect} idSuffix=\"animated\" />\n      <h2>Multi Select</h2>\n      <div id=\"cypress-multi\">\n        <Select\n          id=\"multi-select\"\n          instanceId=\"multi-select\"\n          classNamePrefix=\"react-select\"\n          defaultValue={[colourOptions[2], colourOptions[3]]}\n          isMulti\n          options={colourOptions}\n        />\n      </div>\n      <div style={{ height: 400 }} />\n      <h3> Long Values </h3>\n      <div id={'cypress-long-values'}>\n        <Select\n          id=\"long-value-select\"\n          instanceId=\"long-value-select\"\n          classNamePrefix=\"react-select\"\n          defaultValue={optionLength[3]}\n          options={optionLength}\n        />\n      </div>\n    </div>\n  );\n}\n"
  },
  {
    "path": "docs/_redirects",
    "content": "/*    /index.html   200\n"
  },
  {
    "path": "docs/data.ts",
    "content": "export interface ColourOption {\n  readonly value: string;\n  readonly label: string;\n  readonly color: string;\n  readonly isFixed?: boolean;\n  readonly isDisabled?: boolean;\n}\n\nexport const colourOptions: readonly ColourOption[] = [\n  { value: 'ocean', label: 'Ocean', color: '#00B8D9', isFixed: true },\n  { value: 'blue', label: 'Blue', color: '#0052CC', isDisabled: true },\n  { value: 'purple', label: 'Purple', color: '#5243AA' },\n  { value: 'red', label: 'Red', color: '#FF5630', isFixed: true },\n  { value: 'orange', label: 'Orange', color: '#FF8B00' },\n  { value: 'yellow', label: 'Yellow', color: '#FFC400' },\n  { value: 'green', label: 'Green', color: '#36B37E' },\n  { value: 'forest', label: 'Forest', color: '#00875A' },\n  { value: 'slate', label: 'Slate', color: '#253858' },\n  { value: 'silver', label: 'Silver', color: '#666666' },\n];\n\nexport interface FlavourOption {\n  readonly value: string;\n  readonly label: string;\n  readonly rating: string;\n}\n\nexport const flavourOptions: readonly FlavourOption[] = [\n  { value: 'vanilla', label: 'Vanilla', rating: 'safe' },\n  { value: 'chocolate', label: 'Chocolate', rating: 'good' },\n  { value: 'strawberry', label: 'Strawberry', rating: 'wild' },\n  { value: 'salted-caramel', label: 'Salted Caramel', rating: 'crazy' },\n];\n\nexport interface StateOption {\n  readonly value: string;\n  readonly label: string;\n}\n\nexport const stateOptions: readonly StateOption[] = [\n  { value: 'AL', label: 'Alabama' },\n  { value: 'AK', label: 'Alaska' },\n  { value: 'AS', label: 'American Samoa' },\n  { value: 'AZ', label: 'Arizona' },\n  { value: 'AR', label: 'Arkansas' },\n  { value: 'CA', label: 'California' },\n  { value: 'CO', label: 'Colorado' },\n  { value: 'CT', label: 'Connecticut' },\n  { value: 'DE', label: 'Delaware' },\n  { value: 'DC', label: 'District Of Columbia' },\n  { value: 'FM', label: 'Federated States Of Micronesia' },\n  { value: 'FL', label: 'Florida' },\n  { value: 'GA', label: 'Georgia' },\n  { value: 'GU', label: 'Guam' },\n  { value: 'HI', label: 'Hawaii' },\n  { value: 'ID', label: 'Idaho' },\n  { value: 'IL', label: 'Illinois' },\n  { value: 'IN', label: 'Indiana' },\n  { value: 'IA', label: 'Iowa' },\n  { value: 'KS', label: 'Kansas' },\n  { value: 'KY', label: 'Kentucky' },\n  { value: 'LA', label: 'Louisiana' },\n  { value: 'ME', label: 'Maine' },\n  { value: 'MH', label: 'Marshall Islands' },\n  { value: 'MD', label: 'Maryland' },\n  { value: 'MA', label: 'Massachusetts' },\n  { value: 'MI', label: 'Michigan' },\n  { value: 'MN', label: 'Minnesota' },\n  { value: 'MS', label: 'Mississippi' },\n  { value: 'MO', label: 'Missouri' },\n  { value: 'MT', label: 'Montana' },\n  { value: 'NE', label: 'Nebraska' },\n  { value: 'NV', label: 'Nevada' },\n  { value: 'NH', label: 'New Hampshire' },\n  { value: 'NJ', label: 'New Jersey' },\n  { value: 'NM', label: 'New Mexico' },\n  { value: 'NY', label: 'New York' },\n  { value: 'NC', label: 'North Carolina' },\n  { value: 'ND', label: 'North Dakota' },\n  { value: 'MP', label: 'Northern Mariana Islands' },\n  { value: 'OH', label: 'Ohio' },\n  { value: 'OK', label: 'Oklahoma' },\n  { value: 'OR', label: 'Oregon' },\n  { value: 'PW', label: 'Palau' },\n  { value: 'PA', label: 'Pennsylvania' },\n  { value: 'PR', label: 'Puerto Rico' },\n  { value: 'RI', label: 'Rhode Island' },\n  { value: 'SC', label: 'South Carolina' },\n  { value: 'SD', label: 'South Dakota' },\n  { value: 'TN', label: 'Tennessee' },\n  { value: 'TX', label: 'Texas' },\n  { value: 'UT', label: 'Utah' },\n  { value: 'VT', label: 'Vermont' },\n  { value: 'VI', label: 'Virgin Islands' },\n  { value: 'VA', label: 'Virginia' },\n  { value: 'WA', label: 'Washington' },\n  { value: 'WV', label: 'West Virginia' },\n  { value: 'WI', label: 'Wisconsin' },\n  { value: 'WY', label: 'Wyoming' },\n];\n\nexport const optionLength = [\n  { value: 1, label: 'general' },\n  {\n    value: 2,\n    label:\n      'Evil is the moment when I lack the strength to be true to the Good that compels me.',\n  },\n  {\n    value: 3,\n    label:\n      \"It is now an easy matter to spell out the ethic of a truth: 'Do all that you can to persevere in that which exceeds your perseverance. Persevere in the interruption. Seize in your being that which has seized and broken you.\",\n  },\n];\n\nexport const dogOptions = [\n  { id: 1, label: 'Chihuahua' },\n  { id: 2, label: 'Bulldog' },\n  { id: 3, label: 'Dachshund' },\n  { id: 4, label: 'Akita' },\n];\n\n// let bigOptions = [];\n// for (let i = 0; i < 10000; i++) {\n// \tbigOptions = bigOptions.concat(colourOptions);\n// }\n\nexport interface GroupedOption {\n  readonly label: string;\n  readonly options: readonly ColourOption[] | readonly FlavourOption[];\n}\n\nexport const groupedOptions: readonly GroupedOption[] = [\n  {\n    label: 'Colours',\n    options: colourOptions,\n  },\n  {\n    label: 'Flavours',\n    options: flavourOptions,\n  },\n];\n"
  },
  {
    "path": "docs/examples/AccessingInternals.tsx",
    "content": "import React, { Fragment, useRef } from 'react';\n\nimport Select, { SelectInstance } from 'react-select';\nimport AsyncSelect from 'react-select/async';\nimport CreatableSelect from 'react-select/creatable';\n\nimport { Note } from '../styled-components';\nimport { ColourOption, colourOptions } from '../data';\n\nconst filterColors = (inputValue: string) => {\n  return colourOptions.filter((i) =>\n    i.label.toLowerCase().includes(inputValue.toLowerCase())\n  );\n};\n\nconst promiseOptions = (inputValue: string) =>\n  new Promise<ColourOption[]>((resolve) => {\n    setTimeout(() => {\n      resolve(filterColors(inputValue));\n    }, 1000);\n  });\n\nexport default function AccessingInternals() {\n  const selectRef = useRef<SelectInstance<ColourOption> | null>(null);\n  const asyncRef = useRef<SelectInstance<ColourOption> | null>(null);\n  const creatableRef = useRef<SelectInstance<ColourOption> | null>(null);\n\n  // Focus handlers\n  const focus = () => {\n    console.log(selectRef);\n    selectRef.current?.focus();\n  };\n  const focusAsync = () => {\n    console.log(asyncRef);\n    asyncRef.current?.focus();\n  };\n  const focusCreatable = () => {\n    console.log(creatableRef);\n    creatableRef.current?.focus();\n  };\n\n  // Blur handlers\n  const blur = () => {\n    selectRef.current?.blur();\n  };\n  const blurAsync = () => {\n    asyncRef.current?.blur();\n  };\n  const blurCreatable = () => {\n    creatableRef.current?.blur();\n  };\n\n  return (\n    <Fragment>\n      <h4>Creatable Select</h4>\n      <CreatableSelect ref={creatableRef} isClearable options={colourOptions} />\n      <Note Tag=\"label\">\n        <button\n          onClick={focusCreatable}\n          id=\"cypress-single__clearable-checkbox\"\n        >\n          Focus\n        </button>\n      </Note>\n      <Note Tag=\"label\">\n        <button onClick={blurCreatable} id=\"cypress-single__clearable-checkbox\">\n          Blur\n        </button>\n      </Note>\n      <h4>Async Select</h4>\n      <AsyncSelect\n        ref={asyncRef}\n        cacheOptions\n        defaultOptions\n        loadOptions={promiseOptions}\n      />\n      <Note Tag=\"label\">\n        <button onClick={focusAsync} id=\"cypress-single__clearable-checkbox\">\n          Focus\n        </button>\n      </Note>\n      <Note Tag=\"label\">\n        <button onClick={blurAsync} id=\"cypress-single__clearable-checkbox\">\n          Blur\n        </button>\n      </Note>\n      <h4>Select</h4>\n      <Select\n        ref={selectRef}\n        defaultValue={colourOptions[2]}\n        name=\"colors\"\n        options={colourOptions}\n      />\n      <Note Tag=\"label\">\n        <button onClick={focus} id=\"cypress-single__clearable-checkbox\">\n          Focus\n        </button>\n      </Note>\n      <Note Tag=\"label\">\n        <button onClick={blur} id=\"cypress-single__clearable-checkbox\">\n          Blur\n        </button>\n      </Note>\n    </Fragment>\n  );\n}\n"
  },
  {
    "path": "docs/examples/AnimatedMulti.tsx",
    "content": "import React from 'react';\n\nimport Select from 'react-select';\nimport makeAnimated from 'react-select/animated';\nimport { colourOptions } from '../data';\n\nconst animatedComponents = makeAnimated();\n\nexport default function AnimatedMulti() {\n  return (\n    <Select\n      closeMenuOnSelect={false}\n      components={animatedComponents}\n      defaultValue={[colourOptions[4], colourOptions[5]]}\n      isMulti\n      options={colourOptions}\n    />\n  );\n}\n"
  },
  {
    "path": "docs/examples/AsyncCallbacks.tsx",
    "content": "import React from 'react';\n\nimport AsyncSelect from 'react-select/async';\nimport { ColourOption, colourOptions } from '../data';\n\nconst filterColors = (inputValue: string) => {\n  return colourOptions.filter((i) =>\n    i.label.toLowerCase().includes(inputValue.toLowerCase())\n  );\n};\n\nconst loadOptions = (\n  inputValue: string,\n  callback: (options: ColourOption[]) => void\n) => {\n  setTimeout(() => {\n    callback(filterColors(inputValue));\n  }, 1000);\n};\n\nexport default () => (\n  <AsyncSelect cacheOptions loadOptions={loadOptions} defaultOptions />\n);\n"
  },
  {
    "path": "docs/examples/AsyncCreatable.tsx",
    "content": "import React from 'react';\n\nimport AsyncCreatableSelect from 'react-select/async-creatable';\nimport { ColourOption, colourOptions } from '../data';\n\nconst filterColors = (inputValue: string) => {\n  return colourOptions.filter((i) =>\n    i.label.toLowerCase().includes(inputValue.toLowerCase())\n  );\n};\n\nconst promiseOptions = (inputValue: string) =>\n  new Promise<ColourOption[]>((resolve) => {\n    setTimeout(() => {\n      resolve(filterColors(inputValue));\n    }, 1000);\n  });\n\nexport default () => (\n  <AsyncCreatableSelect\n    cacheOptions\n    defaultOptions\n    loadOptions={promiseOptions}\n  />\n);\n"
  },
  {
    "path": "docs/examples/AsyncMulti.tsx",
    "content": "import React from 'react';\n\nimport AsyncSelect from 'react-select/async';\nimport { ColourOption, colourOptions } from '../data';\n\nconst filterColors = (inputValue: string) => {\n  return colourOptions.filter((i) =>\n    i.label.toLowerCase().includes(inputValue.toLowerCase())\n  );\n};\n\nconst promiseOptions = (inputValue: string) =>\n  new Promise<ColourOption[]>((resolve) => {\n    setTimeout(() => {\n      resolve(filterColors(inputValue));\n    }, 1000);\n  });\n\nexport default () => (\n  <AsyncSelect\n    isMulti\n    cacheOptions\n    defaultOptions\n    loadOptions={promiseOptions}\n  />\n);\n"
  },
  {
    "path": "docs/examples/AsyncPromises.tsx",
    "content": "import React from 'react';\n\nimport AsyncSelect from 'react-select/async';\nimport { ColourOption, colourOptions } from '../data';\n\nconst filterColors = (inputValue: string) => {\n  return colourOptions.filter((i) =>\n    i.label.toLowerCase().includes(inputValue.toLowerCase())\n  );\n};\n\nconst promiseOptions = (inputValue: string) =>\n  new Promise<ColourOption[]>((resolve) => {\n    setTimeout(() => {\n      resolve(filterColors(inputValue));\n    }, 1000);\n  });\n\nexport default () => (\n  <AsyncSelect cacheOptions defaultOptions loadOptions={promiseOptions} />\n);\n"
  },
  {
    "path": "docs/examples/BasicGrouped.tsx",
    "content": "import React, { CSSProperties } from 'react';\n\nimport Select from 'react-select';\nimport {\n  ColourOption,\n  colourOptions,\n  FlavourOption,\n  GroupedOption,\n  groupedOptions,\n} from '../data';\n\nconst groupStyles = {\n  display: 'flex',\n  alignItems: 'center',\n  justifyContent: 'space-between',\n};\nconst groupBadgeStyles: CSSProperties = {\n  backgroundColor: '#EBECF0',\n  borderRadius: '2em',\n  color: '#172B4D',\n  display: 'inline-block',\n  fontSize: 12,\n  fontWeight: 'normal',\n  lineHeight: '1',\n  minWidth: 1,\n  padding: '0.16666666666667em 0.5em',\n  textAlign: 'center',\n};\n\nconst formatGroupLabel = (data: GroupedOption) => (\n  <div style={groupStyles}>\n    <span>{data.label}</span>\n    <span style={groupBadgeStyles}>{data.options.length}</span>\n  </div>\n);\n\nexport default () => (\n  <Select<ColourOption | FlavourOption, false, GroupedOption>\n    defaultValue={colourOptions[1]}\n    options={groupedOptions}\n    formatGroupLabel={formatGroupLabel}\n  />\n);\n"
  },
  {
    "path": "docs/examples/BasicMulti.tsx",
    "content": "import React from 'react';\n\nimport Select from 'react-select';\nimport { colourOptions } from '../data';\n\nexport default () => (\n  <Select\n    defaultValue={[colourOptions[2], colourOptions[3]]}\n    isMulti\n    name=\"colors\"\n    options={colourOptions}\n    className=\"basic-multi-select\"\n    classNamePrefix=\"select\"\n  />\n);\n"
  },
  {
    "path": "docs/examples/BasicSingle.tsx",
    "content": "import React, { useState } from 'react';\n\nimport Select from 'react-select';\nimport { colourOptions } from '../data';\n\nconst Checkbox = ({ children, ...props }: JSX.IntrinsicElements['input']) => (\n  <label style={{ marginRight: '1em' }}>\n    <input type=\"checkbox\" {...props} />\n    {children}\n  </label>\n);\n\nexport default () => {\n  const [isClearable, setIsClearable] = useState(true);\n  const [isSearchable, setIsSearchable] = useState(true);\n  const [isDisabled, setIsDisabled] = useState(false);\n  const [isLoading, setIsLoading] = useState(false);\n  const [isRtl, setIsRtl] = useState(false);\n\n  return (\n    <>\n      <Select\n        className=\"basic-single\"\n        classNamePrefix=\"select\"\n        defaultValue={colourOptions[0]}\n        isDisabled={isDisabled}\n        isLoading={isLoading}\n        isClearable={isClearable}\n        isRtl={isRtl}\n        isSearchable={isSearchable}\n        name=\"color\"\n        options={colourOptions}\n      />\n\n      <div\n        style={{\n          color: 'hsl(0, 0%, 40%)',\n          display: 'inline-block',\n          fontSize: 12,\n          fontStyle: 'italic',\n          marginTop: '1em',\n        }}\n      >\n        <Checkbox\n          checked={isClearable}\n          onChange={() => setIsClearable((state) => !state)}\n        >\n          Clearable\n        </Checkbox>\n        <Checkbox\n          checked={isSearchable}\n          onChange={() => setIsSearchable((state) => !state)}\n        >\n          Searchable\n        </Checkbox>\n        <Checkbox\n          checked={isDisabled}\n          onChange={() => setIsDisabled((state) => !state)}\n        >\n          Disabled\n        </Checkbox>\n        <Checkbox\n          checked={isLoading}\n          onChange={() => setIsLoading((state) => !state)}\n        >\n          Loading\n        </Checkbox>\n        <Checkbox checked={isRtl} onChange={() => setIsRtl((state) => !state)}>\n          RTL\n        </Checkbox>\n      </div>\n    </>\n  );\n};\n"
  },
  {
    "path": "docs/examples/ControlledMenu.tsx",
    "content": "import React, { useRef, useState } from 'react';\n\nimport Select, { SelectInstance } from 'react-select';\nimport { colourOptions } from '../data';\nimport { Note } from '../styled-components';\n\nconst Checkbox = (props: JSX.IntrinsicElements['input']) => (\n  <input type=\"checkbox\" {...props} />\n);\n\nexport default () => {\n  const ref = useRef<SelectInstance>(null);\n  const [menuIsOpen, setMenuIsOpen] = useState<boolean>(false);\n\n  const toggleMenuIsOpen = () => {\n    setMenuIsOpen((value) => !value);\n    const selectEl = ref.current;\n    if (!selectEl) return;\n    if (menuIsOpen) selectEl.blur();\n    else selectEl.focus();\n  };\n\n  return (\n    <>\n      <Select\n        ref={ref}\n        defaultValue={colourOptions[0]}\n        isClearable\n        menuIsOpen={menuIsOpen}\n        styles={{ menu: (base) => ({ ...base, position: 'relative' }) }}\n        name=\"color\"\n        options={colourOptions}\n      />\n      <Note Tag=\"label\">\n        <Checkbox\n          checked={menuIsOpen}\n          onChange={toggleMenuIsOpen}\n          id=\"cypress-single__clearable-checkbox\"\n        />\n        menuIsOpen\n      </Note>\n    </>\n  );\n};\n"
  },
  {
    "path": "docs/examples/CreatableAdvanced.tsx",
    "content": "import React, { useState } from 'react';\n\nimport CreatableSelect from 'react-select/creatable';\n\ninterface Option {\n  readonly label: string;\n  readonly value: string;\n}\n\nconst createOption = (label: string) => ({\n  label,\n  value: label.toLowerCase().replace(/\\W/g, ''),\n});\n\nconst defaultOptions = [\n  createOption('One'),\n  createOption('Two'),\n  createOption('Three'),\n];\n\nexport default () => {\n  const [isLoading, setIsLoading] = useState(false);\n  const [options, setOptions] = useState(defaultOptions);\n  const [value, setValue] = useState<Option | null>();\n\n  const handleCreate = (inputValue: string) => {\n    setIsLoading(true);\n    setTimeout(() => {\n      const newOption = createOption(inputValue);\n      setIsLoading(false);\n      setOptions((prev) => [...prev, newOption]);\n      setValue(newOption);\n    }, 1000);\n  };\n\n  return (\n    <CreatableSelect\n      isClearable\n      isDisabled={isLoading}\n      isLoading={isLoading}\n      onChange={(newValue) => setValue(newValue)}\n      onCreateOption={handleCreate}\n      options={options}\n      value={value}\n    />\n  );\n};\n"
  },
  {
    "path": "docs/examples/CreatableInputOnly.tsx",
    "content": "import React, { KeyboardEventHandler } from 'react';\n\nimport CreatableSelect from 'react-select/creatable';\n\nconst components = {\n  DropdownIndicator: null,\n};\n\ninterface Option {\n  readonly label: string;\n  readonly value: string;\n}\n\nconst createOption = (label: string) => ({\n  label,\n  value: label,\n});\n\nexport default () => {\n  const [inputValue, setInputValue] = React.useState('');\n  const [value, setValue] = React.useState<readonly Option[]>([]);\n\n  const handleKeyDown: KeyboardEventHandler = (event) => {\n    if (!inputValue) return;\n    switch (event.key) {\n      case 'Enter':\n      case 'Tab':\n        setValue((prev) => [...prev, createOption(inputValue)]);\n        setInputValue('');\n        event.preventDefault();\n    }\n  };\n\n  return (\n    <CreatableSelect\n      components={components}\n      inputValue={inputValue}\n      isClearable\n      isMulti\n      menuIsOpen={false}\n      onChange={(newValue) => setValue(newValue)}\n      onInputChange={(newValue) => setInputValue(newValue)}\n      onKeyDown={handleKeyDown}\n      placeholder=\"Type something and press enter...\"\n      value={value}\n    />\n  );\n};\n"
  },
  {
    "path": "docs/examples/CreatableMulti.tsx",
    "content": "import React from 'react';\n\nimport CreatableSelect from 'react-select/creatable';\nimport { colourOptions } from '../data';\n\nexport default () => <CreatableSelect isMulti options={colourOptions} />;\n"
  },
  {
    "path": "docs/examples/CreatableSingle.tsx",
    "content": "import React from 'react';\n\nimport CreatableSelect from 'react-select/creatable';\nimport { colourOptions } from '../data';\n\nexport default () => <CreatableSelect isClearable options={colourOptions} />;\n"
  },
  {
    "path": "docs/examples/CreateFilter.tsx",
    "content": "import React, { useState } from 'react';\nimport Select, { createFilter } from 'react-select';\nimport { colourOptions } from '../data';\nimport { Note } from '../styled-components';\n\nconst Checkbox = (props: JSX.IntrinsicElements['input']) => (\n  <input type=\"checkbox\" {...props} />\n);\n\nexport default () => {\n  const [ignoreCase, setIgnoreCase] = useState(false);\n  const [ignoreAccents, setIgnoreAccents] = useState(false);\n  const [trim, setTrim] = useState(false);\n  const [matchFromStart, setMatchFromStart] = useState(false);\n\n  const filterConfig = {\n    ignoreCase,\n    ignoreAccents,\n    trim,\n    matchFrom: matchFromStart ? ('start' as const) : ('any' as const),\n  };\n\n  return (\n    <>\n      <Select\n        defaultValue={colourOptions[0]}\n        isClearable\n        isSearchable\n        name=\"color\"\n        options={colourOptions}\n        filterOption={createFilter(filterConfig)}\n      />\n      <Note Tag=\"label\">\n        <Checkbox\n          checked={ignoreCase}\n          onChange={() => setIgnoreCase((prev) => !prev)}\n          id=\"cypress-single__clearable-checkbox\"\n        />\n        Ignore Case\n      </Note>\n      <Note Tag=\"label\">\n        <Checkbox\n          checked={ignoreAccents}\n          onChange={() => setIgnoreAccents((prev) => !prev)}\n          id=\"cypress-single__clearable-checkbox\"\n        />\n        Ignore Accents\n      </Note>\n      <Note Tag=\"label\">\n        <Checkbox\n          checked={trim}\n          onChange={() => setTrim((prev) => !prev)}\n          id=\"cypress-single__clearable-checkbox\"\n        />\n        Trim\n      </Note>\n      <Note Tag=\"label\">\n        <Checkbox\n          checked={matchFromStart}\n          onChange={() => setMatchFromStart((prev) => !prev)}\n          id=\"cypress-single__clearable-checkbox\"\n        />\n        Match from the start\n      </Note>\n    </>\n  );\n};\n"
  },
  {
    "path": "docs/examples/CustomAriaLive.tsx",
    "content": "import React, { CSSProperties, useState } from 'react';\n\nimport Select, { AriaOnFocus } from 'react-select';\nimport { ColourOption, colourOptions } from '../data';\n\nexport default function CustomAriaLive() {\n  const [ariaFocusMessage, setAriaFocusMessage] = useState('');\n  const [isMenuOpen, setIsMenuOpen] = useState(false);\n\n  const style: { [key: string]: CSSProperties } = {\n    blockquote: {\n      fontStyle: 'italic',\n      fontSize: '.75rem',\n      margin: '1rem 0',\n    },\n    label: {\n      fontSize: '.75rem',\n      fontWeight: 'bold',\n      lineHeight: 2,\n    },\n  };\n\n  const onFocus: AriaOnFocus<ColourOption> = ({ focused, isDisabled }) => {\n    const msg = `You are currently focused on option ${focused.label}${\n      isDisabled ? ', disabled' : ''\n    }`;\n    setAriaFocusMessage(msg);\n    return msg;\n  };\n\n  const onMenuOpen = () => setIsMenuOpen(true);\n  const onMenuClose = () => setIsMenuOpen(false);\n\n  return (\n    <form>\n      <label style={style.label} id=\"aria-label\" htmlFor=\"aria-example-input\">\n        Select a color\n      </label>\n\n      {!!ariaFocusMessage && !!isMenuOpen && (\n        <blockquote style={style.blockquote}>\"{ariaFocusMessage}\"</blockquote>\n      )}\n\n      <Select\n        aria-labelledby=\"aria-label\"\n        ariaLiveMessages={{\n          onFocus,\n        }}\n        inputId=\"aria-example-input\"\n        name=\"aria-live-color\"\n        onMenuOpen={onMenuOpen}\n        onMenuClose={onMenuClose}\n        options={colourOptions}\n      />\n    </form>\n  );\n}\n"
  },
  {
    "path": "docs/examples/CustomClearIndicator.tsx",
    "content": "import React, { CSSProperties, FunctionComponent } from 'react';\n\nimport Select, { ClearIndicatorProps } from 'react-select';\nimport { CSSObject } from '@emotion/serialize';\nimport { ColourOption, colourOptions } from '../data';\n\nconst CustomClearText: FunctionComponent = () => <>clear all</>;\nconst ClearIndicator = (props: ClearIndicatorProps<ColourOption, true>) => {\n  const {\n    children = <CustomClearText />,\n    getStyles,\n    innerProps: { ref, ...restInnerProps },\n  } = props;\n  return (\n    <div\n      {...restInnerProps}\n      ref={ref}\n      style={getStyles('clearIndicator', props) as CSSProperties}\n    >\n      <div style={{ padding: '0px 5px' }}>{children}</div>\n    </div>\n  );\n};\n\nconst ClearIndicatorStyles = (\n  base: CSSObject,\n  state: ClearIndicatorProps<ColourOption>\n): CSSObject => ({\n  ...base,\n  cursor: 'pointer',\n  color: state.isFocused ? 'blue' : 'black',\n});\n\nexport default function CustomClearIndicator() {\n  return (\n    <Select\n      closeMenuOnSelect={false}\n      components={{ ClearIndicator }}\n      styles={{ clearIndicator: ClearIndicatorStyles }}\n      defaultValue={[colourOptions[4], colourOptions[5]]}\n      isMulti\n      options={colourOptions}\n    />\n  );\n}\n"
  },
  {
    "path": "docs/examples/CustomControl.tsx",
    "content": "import React from 'react';\n\nimport Select, { components, ControlProps } from 'react-select';\nimport { ColourOption, colourOptions } from '../data';\nconst controlStyles = {\n  border: '1px solid black',\n  padding: '5px',\n  background: colourOptions[2].color,\n  color: 'white',\n};\n\nconst ControlComponent = (props: ControlProps<ColourOption, false>) => (\n  <div style={controlStyles}>\n    <p>Custom Control</p>\n    <components.Control {...props} />\n  </div>\n);\n\nexport default () => (\n  <Select\n    defaultValue={colourOptions[0]}\n    isClearable\n    components={{ Control: ControlComponent }}\n    isSearchable\n    name=\"color\"\n    options={colourOptions}\n  />\n);\n"
  },
  {
    "path": "docs/examples/CustomDropdownIndicator.tsx",
    "content": "import React from 'react';\nimport EmojiIcon from '@atlaskit/icon/glyph/emoji';\nimport Select, { components, DropdownIndicatorProps } from 'react-select';\nimport { ColourOption, colourOptions } from '../data';\n\nconst DropdownIndicator = (\n  props: DropdownIndicatorProps<ColourOption, true>\n) => {\n  return (\n    <components.DropdownIndicator {...props}>\n      <EmojiIcon label=\"Emoji\" primaryColor={colourOptions[2].color} />\n    </components.DropdownIndicator>\n  );\n};\n\nexport default () => (\n  <Select\n    closeMenuOnSelect={false}\n    components={{ DropdownIndicator }}\n    defaultValue={[colourOptions[4], colourOptions[5]]}\n    isMulti\n    options={colourOptions}\n  />\n);\n"
  },
  {
    "path": "docs/examples/CustomFilterOptions.tsx",
    "content": "import React from 'react';\nimport Select from 'react-select';\nimport { colourOptions } from '../data';\n\nconst filterOptions = (\n  candidate: { label: string; value: string; data: any },\n  input: string\n) => {\n  if (input) {\n    return candidate.value === customOptions[0].value;\n  }\n  return true;\n};\n\nconst customOptions = [\n  {\n    value: 'custom',\n    label: 'Using a custom filter to always display this option on search',\n  },\n  ...colourOptions,\n];\n\nexport default () => (\n  <Select\n    defaultValue={customOptions[0]}\n    isClearable\n    isSearchable\n    name=\"color\"\n    options={customOptions}\n    filterOption={filterOptions}\n  />\n);\n"
  },
  {
    "path": "docs/examples/CustomGetOptionLabel.tsx",
    "content": "import React from 'react';\nimport Select from 'react-select';\nimport { flavourOptions } from '../data';\n\nexport default () => (\n  <>\n    <p>\n      Composing a display label from the label property and rating property in\n      the options object\n    </p>\n    <Select\n      defaultValue={flavourOptions[0]}\n      isClearable\n      isSearchable\n      name=\"color\"\n      options={flavourOptions}\n      getOptionLabel={(option) => `${option.label}: ${option.rating}`}\n    />\n  </>\n);\n"
  },
  {
    "path": "docs/examples/CustomGetOptionValue.tsx",
    "content": "import React, { Fragment } from 'react';\nimport Select from 'react-select';\nimport { dogOptions } from '../data';\n\nexport default function CustomGetOptionValue() {\n  return (\n    <Fragment>\n      <p>Using id property, instead of value property.</p>\n      <Select\n        defaultValue={dogOptions[0]}\n        isClearable\n        isSearchable\n        name=\"dog\"\n        options={dogOptions}\n        getOptionValue={(option) => `${option['id']}`}\n      />\n    </Fragment>\n  );\n}\n"
  },
  {
    "path": "docs/examples/CustomGroup.tsx",
    "content": "import React from 'react';\n\nimport Select, { components, GroupProps } from 'react-select';\nimport {\n  ColourOption,\n  colourOptions,\n  FlavourOption,\n  groupedOptions,\n} from '../data';\n\nconst groupStyles = {\n  border: `2px dotted ${colourOptions[2].color}`,\n  borderRadius: '5px',\n  background: '#f2fcff',\n};\n\nconst Group = (props: GroupProps<ColourOption | FlavourOption, false>) => (\n  <div style={groupStyles}>\n    <components.Group {...props} />\n  </div>\n);\n\nexport default () => (\n  <Select<ColourOption | FlavourOption>\n    defaultValue={colourOptions[1]}\n    options={groupedOptions}\n    components={{ Group }}\n  />\n);\n"
  },
  {
    "path": "docs/examples/CustomGroupHeading.tsx",
    "content": "import React from 'react';\n\nimport Select, { components, GroupHeadingProps } from 'react-select';\nimport {\n  ColourOption,\n  colourOptions,\n  FlavourOption,\n  groupedOptions,\n} from '../data';\nimport EditorPanelIcon from '@atlaskit/icon/glyph/editor/panel';\nimport Tooltip from '@atlaskit/tooltip';\n\nconst groupStyles = {\n  border: `2px dotted ${colourOptions[2].color}`,\n  color: 'white',\n  background: colourOptions[2].color,\n  padding: '5px 0px',\n  display: 'flex',\n};\n\nconst GroupHeading = (\n  props: GroupHeadingProps<ColourOption | FlavourOption>\n) => (\n  <div style={groupStyles}>\n    <components.GroupHeading {...props} />\n    <Tooltip content=\"Custom GroupHeading Component\">\n      <EditorPanelIcon label=\"Editor Panel\" />\n    </Tooltip>\n  </div>\n);\n\nexport default () => (\n  <Select<ColourOption | FlavourOption>\n    defaultValue={colourOptions[1]}\n    options={groupedOptions}\n    components={{ GroupHeading }}\n    styles={{\n      groupHeading: (base) => ({\n        ...base,\n        flex: '1 1',\n        color: 'white',\n        margin: 0,\n      }),\n    }}\n  />\n);\n"
  },
  {
    "path": "docs/examples/CustomIndicatorSeparator.tsx",
    "content": "import React from 'react';\nimport Select, { IndicatorSeparatorProps } from 'react-select';\nimport { ColourOption, colourOptions } from '../data';\n\nconst indicatorSeparatorStyle = {\n  alignSelf: 'stretch',\n  backgroundColor: colourOptions[2].color,\n  marginBottom: 8,\n  marginTop: 8,\n  width: 1,\n};\n\nconst IndicatorSeparator = ({\n  innerProps,\n}: IndicatorSeparatorProps<ColourOption, true>) => {\n  return <span style={indicatorSeparatorStyle} {...innerProps} />;\n};\n\nexport default () => (\n  <Select\n    closeMenuOnSelect={false}\n    components={{ IndicatorSeparator }}\n    defaultValue={[colourOptions[4], colourOptions[5]]}\n    isMulti\n    options={colourOptions}\n  />\n);\n"
  },
  {
    "path": "docs/examples/CustomIndicatorsContainer.tsx",
    "content": "import React from 'react';\nimport Select, { components, IndicatorsContainerProps } from 'react-select';\nimport { ColourOption, colourOptions } from '../data';\n\nconst IndicatorsContainer = (\n  props: IndicatorsContainerProps<ColourOption, true>\n) => {\n  return (\n    <div style={{ background: colourOptions[2].color }}>\n      <components.IndicatorsContainer {...props} />\n    </div>\n  );\n};\n\nexport default () => (\n  <Select\n    closeMenuOnSelect={false}\n    components={{ IndicatorsContainer }}\n    defaultValue={[colourOptions[4], colourOptions[5]]}\n    isMulti\n    options={colourOptions}\n  />\n);\n"
  },
  {
    "path": "docs/examples/CustomInput.tsx",
    "content": "import React from 'react';\nimport Tooltip from '@atlaskit/tooltip';\nimport Select, { components, InputProps } from 'react-select';\nimport { ColourOption, colourOptions } from '../data';\n\nconst Input = (props: InputProps<ColourOption, true>) => {\n  if (props.isHidden) {\n    return <components.Input {...props} />;\n  }\n  return (\n    <div style={{ border: `1px dotted ${colourOptions[2].color}` }}>\n      <Tooltip content={'Custom Input'}>\n        <components.Input {...props} />\n      </Tooltip>\n    </div>\n  );\n};\n\nexport default () => (\n  <Select\n    closeMenuOnSelect={false}\n    components={{ Input }}\n    defaultValue={[colourOptions[4], colourOptions[5]]}\n    isMulti\n    options={colourOptions}\n  />\n);\n"
  },
  {
    "path": "docs/examples/CustomIsOptionDisabled.tsx",
    "content": "import React from 'react';\nimport Select from 'react-select';\nimport { flavourOptions } from '../data';\n\nexport default () => (\n  <>\n    <p>\n      Disable all options that do not have a 'safe' rating, via the\n      isOptionsDisabled fn prop\n    </p>\n    <Select\n      defaultValue={flavourOptions[0]}\n      isClearable\n      isSearchable\n      name=\"color\"\n      options={flavourOptions}\n      isOptionDisabled={(option) => option.rating !== 'safe'}\n    />\n  </>\n);\n"
  },
  {
    "path": "docs/examples/CustomLoadingIndicator.tsx",
    "content": "import React from 'react';\nimport Spinner from '@atlaskit/spinner';\nimport Tooltip from '@atlaskit/tooltip';\nimport AsyncSelect from 'react-select/async';\nimport { LoadingIndicatorProps } from 'react-select';\nimport { ColourOption, colourOptions } from '../data';\n\nconst LoadingIndicator = (props: LoadingIndicatorProps<ColourOption>) => {\n  return (\n    <Tooltip content={'Custom Loader'}>\n      <Spinner {...props} delay={0} />\n    </Tooltip>\n  );\n};\n\nconst filterColors = (inputValue: string) =>\n  colourOptions.filter((i) =>\n    i.label.toLowerCase().includes(inputValue.toLowerCase())\n  );\n\nconst promiseOptions = (inputValue: string) =>\n  new Promise<ColourOption[]>((resolve) => {\n    setTimeout(() => {\n      resolve(filterColors(inputValue));\n    }, 1000);\n  });\n\nconst CustomLoadingIndicator = () => {\n  return (\n    <AsyncSelect\n      cacheOptions\n      defaultOptions\n      loadOptions={promiseOptions}\n      components={{ LoadingIndicator }}\n    />\n  );\n};\n\nexport default CustomLoadingIndicator;\n"
  },
  {
    "path": "docs/examples/CustomLoadingMessage.tsx",
    "content": "import React, { CSSProperties } from 'react';\nimport Tooltip from '@atlaskit/tooltip';\nimport AsyncSelect from 'react-select/async';\nimport { NoticeProps } from 'react-select';\nimport { ColourOption, colourOptions } from '../data';\n\nconst LoadingMessage = (props: NoticeProps<ColourOption, false>) => {\n  return (\n    <Tooltip content={'Custom Loading Message'}>\n      <div\n        {...props.innerProps}\n        style={props.getStyles('loadingMessage', props) as CSSProperties}\n      >\n        {props.children}\n      </div>\n    </Tooltip>\n  );\n};\n\nconst filterColors = (inputValue: string) =>\n  colourOptions.filter((i) =>\n    i.label.toLowerCase().includes(inputValue.toLowerCase())\n  );\n\nconst promiseOptions = (inputValue: string) =>\n  new Promise<ColourOption[]>((resolve) => {\n    setTimeout(() => {\n      resolve(filterColors(inputValue));\n    }, 1000);\n  });\n\nconst CustomLoadingMessage = () => {\n  return (\n    <AsyncSelect\n      cacheOptions\n      defaultOptions\n      loadOptions={promiseOptions}\n      styles={{\n        loadingMessage: (base) => ({\n          ...base,\n          backgroundColor: colourOptions[2].color,\n          color: 'white',\n        }),\n      }}\n      components={{ LoadingMessage }}\n    />\n  );\n};\n\nexport default CustomLoadingMessage;\n"
  },
  {
    "path": "docs/examples/CustomMenu.tsx",
    "content": "import React, { Fragment } from 'react';\n\nimport Select, { components, MenuProps } from 'react-select';\nimport {\n  ColourOption,\n  colourOptions,\n  FlavourOption,\n  GroupedOption,\n  groupedOptions,\n} from '../data';\n\nfunction getLength(\n  options: readonly (GroupedOption | ColourOption | FlavourOption)[]\n): number {\n  return options.reduce((acc, curr) => {\n    if ('options' in curr) return acc + getLength(curr.options);\n    return acc + 1;\n  }, 0);\n}\n\nconst menuHeaderStyle = {\n  padding: '8px 12px',\n};\n\nconst Menu = (\n  props: MenuProps<ColourOption | FlavourOption, false, GroupedOption>\n) => {\n  const optionsLength = getLength(props.options);\n  return (\n    <Fragment>\n      <div style={menuHeaderStyle}>\n        Custom Menu with {optionsLength} options\n      </div>\n      <components.Menu<ColourOption | FlavourOption, false, GroupedOption>\n        {...props}\n      >\n        {props.children}\n      </components.Menu>\n    </Fragment>\n  );\n};\n\nexport default () => (\n  <Select<ColourOption | FlavourOption, false, GroupedOption>\n    defaultValue={colourOptions[1]}\n    options={groupedOptions}\n    components={{ Menu }}\n  />\n);\n"
  },
  {
    "path": "docs/examples/CustomMenuList.tsx",
    "content": "import React from 'react';\n\nimport Select, { components, MenuListProps } from 'react-select';\nimport {\n  ColourOption,\n  colourOptions,\n  FlavourOption,\n  GroupedOption,\n  groupedOptions,\n} from '../data';\n\nconst menuHeaderStyle = {\n  padding: '8px 12px',\n  background: colourOptions[2].color,\n  color: 'white',\n};\n\nconst MenuList = (\n  props: MenuListProps<ColourOption | FlavourOption, false, GroupedOption>\n) => {\n  return (\n    <components.MenuList {...props}>\n      <div style={menuHeaderStyle}>Custom Menu List</div>\n      {props.children}\n    </components.MenuList>\n  );\n};\n\nexport default () => (\n  <Select<ColourOption | FlavourOption, false, GroupedOption>\n    defaultValue={colourOptions[1]}\n    options={groupedOptions}\n    components={{ MenuList }}\n  />\n);\n"
  },
  {
    "path": "docs/examples/CustomMultiValueContainer.tsx",
    "content": "import React from 'react';\nimport Tooltip from '@atlaskit/tooltip';\nimport Select, { components, MultiValueGenericProps } from 'react-select';\nimport { ColourOption, colourOptions } from '../data';\n\nconst MultiValueContainer = (props: MultiValueGenericProps<ColourOption>) => {\n  return (\n    <Tooltip content={'Customise your multi-value container!'}>\n      <components.MultiValueContainer {...props} />\n    </Tooltip>\n  );\n};\n\nexport default () => (\n  <Select\n    closeMenuOnSelect={false}\n    components={{ MultiValueContainer }}\n    styles={{\n      multiValue: (base) => ({\n        ...base,\n        border: `2px dotted ${colourOptions[2].color}`,\n      }),\n    }}\n    defaultValue={[colourOptions[4], colourOptions[5]]}\n    isMulti\n    options={colourOptions}\n  />\n);\n"
  },
  {
    "path": "docs/examples/CustomMultiValueLabel.tsx",
    "content": "import React from 'react';\nimport Tooltip from '@atlaskit/tooltip';\nimport Select, { components, MultiValueGenericProps } from 'react-select';\nimport { ColourOption, colourOptions } from '../data';\n\nconst MultiValueLabel = (props: MultiValueGenericProps<ColourOption>) => {\n  return (\n    <Tooltip content={'Customise your multi-value label component!'}>\n      <components.MultiValueLabel {...props} />\n    </Tooltip>\n  );\n};\n\nexport default () => (\n  <Select\n    closeMenuOnSelect={false}\n    components={{ MultiValueLabel }}\n    styles={{\n      multiValueLabel: (base) => ({\n        ...base,\n        backgroundColor: colourOptions[2].color,\n        color: 'white',\n      }),\n    }}\n    defaultValue={[colourOptions[4], colourOptions[5]]}\n    isMulti\n    options={colourOptions}\n  />\n);\n"
  },
  {
    "path": "docs/examples/CustomMultiValueRemove.tsx",
    "content": "import React from 'react';\nimport EmojiIcon from '@atlaskit/icon/glyph/emoji';\nimport Tooltip from '@atlaskit/tooltip';\nimport Select, { components, MultiValueRemoveProps } from 'react-select';\nimport { ColourOption, colourOptions } from '../data';\n\nconst MultiValueRemove = (props: MultiValueRemoveProps<ColourOption>) => {\n  return (\n    <Tooltip content={'Customise your multi-value remove component!'} truncate>\n      <components.MultiValueRemove {...props}>\n        <EmojiIcon label=\"Emoji\" primaryColor={colourOptions[2].color} />\n      </components.MultiValueRemove>\n    </Tooltip>\n  );\n};\n\nexport default () => (\n  <Select\n    closeMenuOnSelect={false}\n    components={{ MultiValueRemove }}\n    styles={{\n      multiValueRemove: (base) => ({\n        ...base,\n        border: `1px dotted ${colourOptions[2].color}`,\n        height: '100%',\n      }),\n    }}\n    defaultValue={[colourOptions[4], colourOptions[5]]}\n    isMulti\n    options={colourOptions}\n  />\n);\n"
  },
  {
    "path": "docs/examples/CustomNoOptionsMessage.tsx",
    "content": "import React from 'react';\nimport Tooltip from '@atlaskit/tooltip';\nimport Select, { components, NoticeProps } from 'react-select';\nimport { colourOptions } from '../data';\n\nconst msgStyles = {\n  background: colourOptions[2].color,\n  color: 'white',\n};\n\nconst NoOptionsMessage = (props: NoticeProps) => {\n  return (\n    <Tooltip content=\"Custom NoOptionsMessage Component\">\n      <components.NoOptionsMessage {...props} />\n    </Tooltip>\n  );\n};\n\nconst CustomNoOptionsMessage = () => {\n  return (\n    <Select\n      isClearable\n      components={{ NoOptionsMessage }}\n      styles={{ noOptionsMessage: (base) => ({ ...base, ...msgStyles }) }}\n      isSearchable\n      name=\"color\"\n      options={[]}\n    />\n  );\n};\n\nexport default CustomNoOptionsMessage;\n"
  },
  {
    "path": "docs/examples/CustomOption.tsx",
    "content": "import React from 'react';\nimport Tooltip from '@atlaskit/tooltip';\nimport Select, { components, OptionProps } from 'react-select';\nimport { ColourOption, colourOptions } from '../data';\n\nconst Option = (props: OptionProps<ColourOption>) => {\n  return (\n    <Tooltip content={'Customise your option component!'} truncate>\n      <components.Option {...props} />\n    </Tooltip>\n  );\n};\n\nexport default () => (\n  <Select\n    closeMenuOnSelect={false}\n    components={{ Option }}\n    styles={{\n      option: (base) => ({\n        ...base,\n        border: `1px dotted ${colourOptions[2].color}`,\n        height: '100%',\n      }),\n    }}\n    defaultValue={colourOptions[4]}\n    options={colourOptions}\n  />\n);\n"
  },
  {
    "path": "docs/examples/CustomPlaceholder.tsx",
    "content": "import React from 'react';\nimport Select, { components, PlaceholderProps } from 'react-select';\nimport { ColourOption, colourOptions } from '../data';\n\nconst Placeholder = (props: PlaceholderProps<ColourOption>) => {\n  return <components.Placeholder {...props} />;\n};\n\nexport default () => (\n  <Select\n    closeMenuOnSelect={false}\n    components={{ Placeholder }}\n    placeholder={'custom placeholder component'}\n    styles={{\n      placeholder: (base) => ({\n        ...base,\n        fontSize: '1em',\n        color: colourOptions[2].color,\n        fontWeight: 400,\n      }),\n    }}\n    options={colourOptions}\n  />\n);\n"
  },
  {
    "path": "docs/examples/CustomSelectContainer.tsx",
    "content": "import React from 'react';\nimport Select, { components, ContainerProps } from 'react-select';\nimport Tooltip from '@atlaskit/tooltip';\nimport { ColourOption, colourOptions } from '../data';\n\nconst SelectContainer = ({\n  children,\n  ...props\n}: ContainerProps<ColourOption>) => {\n  return (\n    <Tooltip content={'customise your select container'} delay={0}>\n      <components.SelectContainer {...props}>\n        {children}\n      </components.SelectContainer>\n    </Tooltip>\n  );\n};\n\nexport default () => (\n  <Select\n    closeMenuOnSelect={false}\n    components={{ SelectContainer }}\n    styles={{\n      container: (base) => ({\n        ...base,\n        backgroundColor: colourOptions[2].color,\n        padding: 5,\n      }),\n    }}\n    options={colourOptions}\n  />\n);\n"
  },
  {
    "path": "docs/examples/CustomSelectProps.tsx",
    "content": "import React, { MouseEventHandler, useState } from 'react';\nimport Select, {\n  components,\n  ControlProps,\n  Props,\n  StylesConfig,\n} from 'react-select';\nimport { ColourOption, colourOptions } from '../data';\n\nconst EMOJIS = ['👍', '🤙', '👏', '👌', '🙌', '✌️', '🖖', '👐'];\n\nconst Control = ({ children, ...props }: ControlProps<ColourOption, false>) => {\n  // @ts-ignore\n  const { emoji, onEmojiClick } = props.selectProps;\n  const style = { cursor: 'pointer' };\n\n  return (\n    <components.Control {...props}>\n      <span onMouseDown={onEmojiClick} style={style}>\n        {emoji}\n      </span>\n      {children}\n    </components.Control>\n  );\n};\n\nconst CustomSelectProps = (props: Props<ColourOption>) => {\n  const [clickCount, setClickCount] = useState(0);\n\n  const onClick: MouseEventHandler<HTMLSpanElement> = (e) => {\n    setClickCount(clickCount + 1);\n    e.preventDefault();\n    e.stopPropagation();\n  };\n\n  const styles: StylesConfig<ColourOption, false> = {\n    control: (css) => ({ ...css, paddingLeft: '1rem' }),\n  };\n\n  const emoji = EMOJIS[clickCount % EMOJIS.length];\n\n  return (\n    <Select\n      {...props}\n      // @ts-ignore\n      emoji={emoji}\n      onEmojiClick={onClick}\n      components={{ Control }}\n      isSearchable\n      name=\"emoji\"\n      options={colourOptions}\n      styles={styles}\n    />\n  );\n};\n\nexport default CustomSelectProps;\n"
  },
  {
    "path": "docs/examples/CustomSingleValue.tsx",
    "content": "import React from 'react';\nimport Select, { components, SingleValueProps } from 'react-select';\nimport { ColourOption, colourOptions } from '../data';\n\nconst SingleValue = ({\n  children,\n  ...props\n}: SingleValueProps<ColourOption>) => (\n  <components.SingleValue {...props}>{children}</components.SingleValue>\n);\n\nexport default () => (\n  <Select\n    defaultValue={colourOptions[0]}\n    isClearable\n    styles={{\n      singleValue: (base) => ({\n        ...base,\n        padding: 5,\n        borderRadius: 5,\n        background: colourOptions[2].color,\n        color: 'white',\n        display: 'flex',\n      }),\n    }}\n    components={{ SingleValue }}\n    isSearchable\n    name=\"color\"\n    options={colourOptions}\n  />\n);\n"
  },
  {
    "path": "docs/examples/CustomValueContainer.tsx",
    "content": "import React from 'react';\nimport Select, { components, ValueContainerProps } from 'react-select';\nimport { ColourOption, colourOptions } from '../data';\n\nconst ValueContainer = ({\n  children,\n  ...props\n}: ValueContainerProps<ColourOption>) => (\n  <components.ValueContainer {...props}>{children}</components.ValueContainer>\n);\n\nexport default () => (\n  <Select\n    defaultValue={colourOptions[0]}\n    isClearable\n    styles={{\n      singleValue: (base) => ({ ...base, color: 'white' }),\n      valueContainer: (base) => ({\n        ...base,\n        background: colourOptions[2].color,\n        color: 'white',\n        width: '100%',\n      }),\n    }}\n    components={{ ValueContainer }}\n    isSearchable\n    name=\"color\"\n    options={colourOptions}\n  />\n);\n"
  },
  {
    "path": "docs/examples/DefaultOptions.tsx",
    "content": "import React from 'react';\n\nimport AsyncSelect from 'react-select/async';\nimport { ColourOption, colourOptions } from '../data';\n\nconst filterColors = (inputValue: string) => {\n  return colourOptions.filter((i) =>\n    i.label.toLowerCase().includes(inputValue.toLowerCase())\n  );\n};\n\nconst promiseOptions = (inputValue: string) =>\n  new Promise<ColourOption[]>((resolve) => {\n    setTimeout(() => {\n      resolve(filterColors(inputValue));\n    }, 1000);\n  });\n\nexport default () => (\n  <AsyncSelect\n    cacheOptions\n    defaultOptions={colourOptions}\n    loadOptions={promiseOptions}\n  />\n);\n"
  },
  {
    "path": "docs/examples/Experimental.tsx",
    "content": "/** @jsx jsx */\nimport { useState } from 'react';\nimport { jsx } from '@emotion/react';\nimport { CSSObject } from '@emotion/serialize';\nimport moment, { Moment } from 'moment';\nimport * as chrono from 'chrono-node';\n\nimport Select, {\n  GroupProps,\n  OptionProps,\n  components as SelectComponents,\n} from 'react-select';\n\ninterface DateOption {\n  date: Moment;\n  value: Date;\n  label: string;\n  display?: string;\n}\n\nconst createOptionForDate = (d: Moment | Date) => {\n  const date = moment.isMoment(d) ? d : moment(d);\n  return {\n    date,\n    value: date.toDate(),\n    label: date.calendar(null, {\n      sameDay: '[Today] (Do MMM YYYY)',\n      nextDay: '[Tomorrow] (Do MMM YYYY)',\n      nextWeek: '[Next] dddd (Do MMM YYYY)',\n      lastDay: '[Yesterday] (Do MMM YYYY)',\n      lastWeek: '[Last] dddd (Do MMM YYYY)',\n      sameElse: 'Do MMMM YYYY',\n    }),\n  };\n};\n\ninterface CalendarGroup {\n  label: string;\n  options: readonly DateOption[];\n}\n\nconst defaultOptions: (DateOption | CalendarGroup)[] = [\n  'today',\n  'tomorrow',\n  'yesterday',\n].map((i) => createOptionForDate(chrono.parseDate(i)));\n\nconst createCalendarOptions = (date = new Date()) => {\n  const daysInMonth = Array.apply(null, Array(moment(date).daysInMonth())).map(\n    (x, i) => {\n      const d = moment(date).date(i + 1);\n      return { ...createOptionForDate(d), display: 'calendar' };\n    }\n  );\n  return {\n    label: moment(date).format('MMMM YYYY'),\n    options: daysInMonth,\n  };\n};\n\ndefaultOptions.push(createCalendarOptions());\n\nconst suggestions = [\n  'sunday',\n  'saturday',\n  'friday',\n  'thursday',\n  'wednesday',\n  'tuesday',\n  'monday',\n  'december',\n  'november',\n  'october',\n  'september',\n  'august',\n  'july',\n  'june',\n  'may',\n  'april',\n  'march',\n  'february',\n  'january',\n  'yesterday',\n  'tomorrow',\n  'today',\n].reduce<{ [key: string]: string }>((acc, str) => {\n  for (let i = 1; i < str.length; i++) {\n    acc[str.substr(0, i)] = str;\n  }\n  return acc;\n}, {});\n\nconst suggest = (str: string) =>\n  str\n    .split(/\\b/)\n    .map((i) => suggestions[i] || i)\n    .join('');\n\nconst days = ['S', 'M', 'T', 'W', 'T', 'F', 'S'];\n\nconst daysHeaderStyles: CSSObject = {\n  marginTop: '5px',\n  paddingTop: '5px',\n  paddingLeft: '2%',\n  borderTop: '1px solid #eee',\n};\nconst daysHeaderItemStyles: CSSObject = {\n  color: '#999',\n  cursor: 'default',\n  fontSize: '75%',\n  fontWeight: 500,\n  display: 'inline-block',\n  width: '12%',\n  margin: '0 1%',\n  textAlign: 'center',\n};\nconst daysContainerStyles: CSSObject = {\n  paddingTop: '5px',\n  paddingLeft: '2%',\n};\n\nconst Group = (props: GroupProps<DateOption, false>) => {\n  const {\n    Heading,\n    getStyles,\n    getClassNames,\n    children,\n    label,\n    headingProps,\n    cx,\n    theme,\n    selectProps,\n  } = props;\n  return (\n    <div aria-label={label as string} css={getStyles('group', props)}>\n      <Heading\n        selectProps={selectProps}\n        theme={theme}\n        getStyles={getStyles}\n        getClassNames={getClassNames}\n        cx={cx}\n        {...headingProps}\n      >\n        {label}\n      </Heading>\n      <div css={daysHeaderStyles}>\n        {days.map((day, i) => (\n          <span key={`${i}-${day}`} css={daysHeaderItemStyles}>\n            {day}\n          </span>\n        ))}\n      </div>\n      <div css={daysContainerStyles}>{children}</div>\n    </div>\n  );\n};\n\nconst getOptionStyles = (defaultStyles: CSSObject): CSSObject => ({\n  ...defaultStyles,\n  display: 'inline-block',\n  width: '12%',\n  margin: '0 1%',\n  textAlign: 'center',\n  borderRadius: '4px',\n});\n\nconst Option = (props: OptionProps<DateOption, false>) => {\n  const { data, getStyles, innerRef, innerProps } = props;\n  if (data.display === 'calendar') {\n    const defaultStyles = getStyles('option', props);\n    const styles = getOptionStyles(defaultStyles);\n    if (data.date.date() === 1) {\n      const indentBy = data.date.day();\n      if (indentBy) {\n        styles.marginLeft = `${indentBy * 14 + 1}%`;\n      }\n    }\n    return (\n      <span {...innerProps} css={styles} ref={innerRef}>\n        {data.date.format('D')}\n      </span>\n    );\n  } else return <SelectComponents.Option {...props} />;\n};\n\ninterface DatePickerProps {\n  readonly value: DateOption | null;\n  readonly onChange: (newValue: DateOption | null) => void;\n}\n\nconst DatePicker = (props: DatePickerProps) => {\n  const [options, setOptions] = useState(defaultOptions);\n\n  const handleInputChange = (value: string) => {\n    if (!value) {\n      setOptions(defaultOptions);\n      return;\n    }\n    const date = chrono.parseDate(suggest(value.toLowerCase()));\n    if (!date) {\n      setOptions([]);\n      return;\n    }\n    setOptions([createOptionForDate(date), createCalendarOptions(date)]);\n  };\n\n  return (\n    <Select<DateOption, false>\n      {...props}\n      components={{ Group, Option }}\n      filterOption={null}\n      isMulti={false}\n      isOptionSelected={(o, v) => v.some((i) => i.date.isSame(o.date, 'day'))}\n      maxMenuHeight={380}\n      onChange={props.onChange}\n      onInputChange={handleInputChange}\n      options={options}\n      value={props.value}\n    />\n  );\n};\n\nexport default () => {\n  const [value, setValue] = useState<DateOption | null>(\n    defaultOptions[0] as DateOption\n  );\n\n  return (\n    <DatePicker value={value} onChange={(newValue) => setValue(newValue)} />\n  );\n};\n"
  },
  {
    "path": "docs/examples/FixedOptions.tsx",
    "content": "import React, { useState } from 'react';\n\nimport Select, { ActionMeta, OnChangeValue, StylesConfig } from 'react-select';\nimport { ColourOption, colourOptions } from '../data';\n\nconst styles: StylesConfig<ColourOption, true> = {\n  multiValue: (base, state) => {\n    return state.data.isFixed ? { ...base, backgroundColor: 'gray' } : base;\n  },\n  multiValueLabel: (base, state) => {\n    return state.data.isFixed\n      ? { ...base, fontWeight: 'bold', color: 'white', paddingRight: 6 }\n      : base;\n  },\n  multiValueRemove: (base, state) => {\n    return state.data.isFixed ? { ...base, display: 'none' } : base;\n  },\n};\n\nconst orderOptions = (values: readonly ColourOption[]) => {\n  return values\n    .filter((v) => v.isFixed)\n    .concat(values.filter((v) => !v.isFixed));\n};\n\nexport default () => {\n  const [value, setValue] = useState<readonly ColourOption[]>(\n    orderOptions([colourOptions[0], colourOptions[1], colourOptions[3]])\n  );\n\n  const onChange = (\n    newValue: OnChangeValue<ColourOption, true>,\n    actionMeta: ActionMeta<ColourOption>\n  ) => {\n    switch (actionMeta.action) {\n      case 'remove-value':\n      case 'pop-value':\n        if (actionMeta.removedValue.isFixed) {\n          return;\n        }\n        break;\n      case 'clear':\n        newValue = colourOptions.filter((v) => v.isFixed);\n        break;\n    }\n\n    setValue(orderOptions(newValue));\n  };\n\n  return (\n    <Select\n      value={value}\n      isMulti\n      styles={styles}\n      isClearable={value.some((v) => !v.isFixed)}\n      name=\"colors\"\n      className=\"basic-multi-select\"\n      classNamePrefix=\"select\"\n      onChange={onChange}\n      options={colourOptions}\n    />\n  );\n};\n"
  },
  {
    "path": "docs/examples/MenuBuffer.tsx",
    "content": "import React from 'react';\nimport Select from 'react-select';\n\nimport { colourOptions } from '../data';\n\nexport default () => (\n  <Select\n    defaultValue={colourOptions[0]}\n    options={colourOptions}\n    styles={{ menu: (base) => ({ ...base, marginBottom: 76 }) }}\n  />\n);\n"
  },
  {
    "path": "docs/examples/MenuPortal.tsx",
    "content": "import React, { useState } from 'react';\nimport Modal from '@atlaskit/modal-dialog';\nimport Button from '@atlaskit/button';\nimport Select, { MenuPlacement } from 'react-select';\nimport { H1, Note } from '../styled-components';\n\nimport { colourOptions } from '../data';\n\nexport default () => {\n  const [isOpen, setIsOpen] = useState(false);\n  const [isFixed, setIsFixed] = useState(false);\n  const [menuPlacement, setMenuPlacement] = useState<MenuPlacement>('bottom');\n\n  return (\n    <>\n      <Button onClick={() => setIsOpen(true)}>Open Modal</Button>\n      {isOpen ? (\n        <Modal onClose={() => setIsOpen(false)}>\n          <H1>Portaled Menu Element</H1>\n          <Select\n            defaultValue={colourOptions[0]}\n            isClearable\n            styles={{ menuPortal: (base) => ({ ...base, zIndex: 9999 }) }}\n            menuPortalTarget={document.body}\n            isSearchable\n            name=\"color\"\n            menuPosition={isFixed ? 'fixed' : 'absolute'}\n            menuPlacement={menuPlacement}\n            options={colourOptions}\n            menuShouldScrollIntoView={false}\n          />\n          <Note Tag=\"label\">\n            <select\n              onChange={(e) =>\n                setMenuPlacement(e.currentTarget.value as MenuPlacement)\n              }\n              value={menuPlacement}\n              id=\"cypress-portalled__radio-bottom\"\n            >\n              <option value=\"auto\">auto</option>\n              <option value=\"bottom\">bottom</option>\n              <option value=\"top\">top</option>\n            </select>\n          </Note>\n          <Note Tag=\"label\" style={{ marginLeft: '1em' }}>\n            <input\n              type=\"radio\"\n              onChange={() => setIsFixed((prev) => !prev)}\n              value=\"fixed\"\n              checked={isFixed}\n              id=\"cypress-portalled__fixed\"\n            />\n            Fixed\n          </Note>\n          <Note Tag=\"label\" style={{ marginLeft: '1em' }}>\n            <input\n              type=\"radio\"\n              onChange={() => setIsFixed((prev) => !prev)}\n              value=\"portal\"\n              checked={!isFixed}\n              id=\"cypress-portalled__portal\"\n            />\n            Portal\n          </Note>\n        </Modal>\n      ) : null}\n    </>\n  );\n};\n"
  },
  {
    "path": "docs/examples/MultiSelectSort.tsx",
    "content": "import React, { MouseEventHandler } from 'react';\n\nimport Select, {\n  components,\n  MultiValueGenericProps,\n  MultiValueProps,\n  OnChangeValue,\n  Props,\n} from 'react-select';\nimport {\n  SortableContainer,\n  SortableContainerProps,\n  SortableElement,\n  SortEndHandler,\n  SortableHandle,\n} from 'react-sortable-hoc';\nimport { ColourOption, colourOptions } from '../data';\n\nfunction arrayMove<T>(array: readonly T[], from: number, to: number) {\n  const slicedArray = array.slice();\n  slicedArray.splice(\n    to < 0 ? array.length + to : to,\n    0,\n    slicedArray.splice(from, 1)[0]\n  );\n  return slicedArray;\n}\n\nconst SortableMultiValue = SortableElement(\n  (props: MultiValueProps<ColourOption>) => {\n    // this prevents the menu from being opened/closed when the user clicks\n    // on a value to begin dragging it. ideally, detecting a click (instead of\n    // a drag) would still focus the control and toggle the menu, but that\n    // requires some magic with refs that are out of scope for this example\n    const onMouseDown: MouseEventHandler<HTMLDivElement> = (e) => {\n      e.preventDefault();\n      e.stopPropagation();\n    };\n    const innerProps = { ...props.innerProps, onMouseDown };\n    return <components.MultiValue {...props} innerProps={innerProps} />;\n  }\n);\n\nconst SortableMultiValueLabel = SortableHandle(\n  (props: MultiValueGenericProps) => <components.MultiValueLabel {...props} />\n);\n\nconst SortableSelect = SortableContainer(Select) as React.ComponentClass<\n  Props<ColourOption, true> & SortableContainerProps\n>;\n\nexport default function MultiSelectSort() {\n  const [selected, setSelected] = React.useState<readonly ColourOption[]>([\n    colourOptions[4],\n    colourOptions[5],\n  ]);\n\n  const onChange = (selectedOptions: OnChangeValue<ColourOption, true>) =>\n    setSelected(selectedOptions);\n\n  const onSortEnd: SortEndHandler = ({ oldIndex, newIndex }) => {\n    const newValue = arrayMove(selected, oldIndex, newIndex);\n    setSelected(newValue);\n    console.log(\n      'Values sorted:',\n      newValue.map((i) => i.value)\n    );\n  };\n\n  return (\n    <SortableSelect\n      useDragHandle\n      // react-sortable-hoc props:\n      axis=\"xy\"\n      onSortEnd={onSortEnd}\n      distance={4}\n      // small fix for https://github.com/clauderic/react-sortable-hoc/pull/352:\n      getHelperDimensions={({ node }) => node.getBoundingClientRect()}\n      // react-select props:\n      isMulti\n      options={colourOptions}\n      value={selected}\n      onChange={onChange}\n      components={{\n        // @ts-ignore We're failing to provide a required index prop to SortableElement\n        MultiValue: SortableMultiValue,\n        MultiValueLabel: SortableMultiValueLabel,\n      }}\n      closeMenuOnSelect={false}\n    />\n  );\n}\n"
  },
  {
    "path": "docs/examples/OnSelectResetsInput.tsx",
    "content": "import React from 'react';\nimport Select, { InputActionMeta } from 'react-select';\nimport { colourOptions } from '../data';\n\nexport default () => {\n  const [menuIsOpen, setMenuIsOpen] = React.useState<boolean>();\n\n  const onInputChange = (\n    inputValue: string,\n    { action, prevInputValue }: InputActionMeta\n  ) => {\n    if (action === 'input-change') return inputValue;\n    if (action === 'menu-close') {\n      if (prevInputValue) setMenuIsOpen(true);\n      else setMenuIsOpen(undefined);\n    }\n    return prevInputValue;\n  };\n\n  return (\n    <Select\n      isMulti\n      defaultValue={colourOptions[0]}\n      isClearable\n      isSearchable\n      onInputChange={onInputChange}\n      name=\"color\"\n      options={colourOptions}\n      menuIsOpen={menuIsOpen}\n    />\n  );\n};\n"
  },
  {
    "path": "docs/examples/Popout.tsx",
    "content": "/** @jsx jsx */\nimport { ReactNode, useState } from 'react';\nimport { jsx } from '@emotion/react';\nimport Button from '@atlaskit/button';\n\nimport Select, { StylesConfig } from 'react-select';\nimport { defaultTheme } from 'react-select';\nimport { StateOption, stateOptions } from '../data';\n\nconst { colors } = defaultTheme;\n\nconst selectStyles: StylesConfig<StateOption, false> = {\n  control: (provided) => ({\n    ...provided,\n    minWidth: 240,\n    margin: 8,\n  }),\n  menu: () => ({ boxShadow: 'inset 0 1px 0 rgba(0, 0, 0, 0.1)' }),\n};\n\nexport default () => {\n  const [isOpen, setIsOpen] = useState(false);\n  const [value, setValue] = useState<StateOption | null>();\n\n  return (\n    <Dropdown\n      isOpen={isOpen}\n      onClose={() => setIsOpen(false)}\n      target={\n        <Button\n          iconAfter={<ChevronDown />}\n          onClick={() => setIsOpen((prev) => !prev)}\n          isSelected={isOpen}\n        >\n          {value ? `State: ${value.label}` : 'Select a State'}\n        </Button>\n      }\n    >\n      <Select\n        autoFocus\n        backspaceRemovesValue={false}\n        components={{ DropdownIndicator, IndicatorSeparator: null }}\n        controlShouldRenderValue={false}\n        hideSelectedOptions={false}\n        isClearable={false}\n        menuIsOpen\n        onChange={(newValue) => {\n          setValue(newValue);\n          setIsOpen(false);\n        }}\n        options={stateOptions}\n        placeholder=\"Search...\"\n        styles={selectStyles}\n        tabSelectsValue={false}\n        value={value}\n      />\n    </Dropdown>\n  );\n};\n\n// styled components\n\nconst Menu = (props: JSX.IntrinsicElements['div']) => {\n  const shadow = 'hsla(218, 50%, 10%, 0.1)';\n  return (\n    <div\n      css={{\n        backgroundColor: 'white',\n        borderRadius: 4,\n        boxShadow: `0 0 0 1px ${shadow}, 0 4px 11px ${shadow}`,\n        marginTop: 8,\n        position: 'absolute',\n        zIndex: 2,\n      }}\n      {...props}\n    />\n  );\n};\nconst Blanket = (props: JSX.IntrinsicElements['div']) => (\n  <div\n    css={{\n      bottom: 0,\n      left: 0,\n      top: 0,\n      right: 0,\n      position: 'fixed',\n      zIndex: 1,\n    }}\n    {...props}\n  />\n);\nconst Dropdown = ({\n  children,\n  isOpen,\n  target,\n  onClose,\n}: {\n  children?: ReactNode;\n  readonly isOpen: boolean;\n  readonly target: ReactNode;\n  readonly onClose: () => void;\n}) => (\n  <div css={{ position: 'relative' }}>\n    {target}\n    {isOpen ? <Menu>{children}</Menu> : null}\n    {isOpen ? <Blanket onClick={onClose} /> : null}\n  </div>\n);\nconst Svg = (p: JSX.IntrinsicElements['svg']) => (\n  <svg\n    width=\"24\"\n    height=\"24\"\n    viewBox=\"0 0 24 24\"\n    focusable=\"false\"\n    role=\"presentation\"\n    {...p}\n  />\n);\nconst DropdownIndicator = () => (\n  <div css={{ color: colors.neutral20, height: 24, width: 32 }}>\n    <Svg>\n      <path\n        d=\"M16.436 15.085l3.94 4.01a1 1 0 0 1-1.425 1.402l-3.938-4.006a7.5 7.5 0 1 1 1.423-1.406zM10.5 16a5.5 5.5 0 1 0 0-11 5.5 5.5 0 0 0 0 11z\"\n        fill=\"currentColor\"\n        fillRule=\"evenodd\"\n      />\n    </Svg>\n  </div>\n);\nconst ChevronDown = () => (\n  <Svg style={{ marginRight: -6 }}>\n    <path\n      d=\"M8.292 10.293a1.009 1.009 0 0 0 0 1.419l2.939 2.965c.218.215.5.322.779.322s.556-.107.769-.322l2.93-2.955a1.01 1.01 0 0 0 0-1.419.987.987 0 0 0-1.406 0l-2.298 2.317-2.307-2.327a.99.99 0 0 0-1.406 0z\"\n      fill=\"currentColor\"\n      fillRule=\"evenodd\"\n    />\n  </Svg>\n);\n"
  },
  {
    "path": "docs/examples/StyleCompositionExample.tsx",
    "content": "/** @jsx jsx */\nimport { jsx } from '@emotion/react';\nimport Select, { OptionProps } from 'react-select';\nimport { ColourOption, colourOptions } from '../data';\n\nconst Option = (props: OptionProps<ColourOption>) => {\n  const {\n    children,\n    className,\n    cx,\n    getStyles,\n    isDisabled,\n    isFocused,\n    isSelected,\n    innerRef,\n    innerProps,\n  } = props;\n  return (\n    <div\n      ref={innerRef}\n      css={getStyles('option', props)}\n      className={cx(\n        {\n          option: true,\n          'option--is-disabled': isDisabled,\n          'option--is-focused': isFocused,\n          'option--is-selected': isSelected,\n        },\n        className\n      )}\n      {...innerProps}\n    >\n      {children}\n    </div>\n  );\n};\n\nexport default () => (\n  <Select\n    closeMenuOnSelect={false}\n    components={{ Option }}\n    styles={{\n      option: (base) => ({\n        ...base,\n        border: `1px dotted ${colourOptions[2].color}`,\n        height: '100%',\n      }),\n    }}\n    defaultValue={colourOptions[4]}\n    options={colourOptions}\n  />\n);\n"
  },
  {
    "path": "docs/examples/StyledMulti.tsx",
    "content": "import React from 'react';\nimport chroma from 'chroma-js';\n\nimport { ColourOption, colourOptions } from '../data';\nimport Select, { StylesConfig } from 'react-select';\n\nconst colourStyles: StylesConfig<ColourOption, true> = {\n  control: (styles) => ({ ...styles, backgroundColor: 'white' }),\n  option: (styles, { data, isDisabled, isFocused, isSelected }) => {\n    const color = chroma(data.color);\n    return {\n      ...styles,\n      backgroundColor: isDisabled\n        ? undefined\n        : isSelected\n        ? data.color\n        : isFocused\n        ? color.alpha(0.1).css()\n        : undefined,\n      color: isDisabled\n        ? '#ccc'\n        : isSelected\n        ? chroma.contrast(color, 'white') > 2\n          ? 'white'\n          : 'black'\n        : data.color,\n      cursor: isDisabled ? 'not-allowed' : 'default',\n\n      ':active': {\n        ...styles[':active'],\n        backgroundColor: !isDisabled\n          ? isSelected\n            ? data.color\n            : color.alpha(0.3).css()\n          : undefined,\n      },\n    };\n  },\n  multiValue: (styles, { data }) => {\n    const color = chroma(data.color);\n    return {\n      ...styles,\n      backgroundColor: color.alpha(0.1).css(),\n    };\n  },\n  multiValueLabel: (styles, { data }) => ({\n    ...styles,\n    color: data.color,\n  }),\n  multiValueRemove: (styles, { data }) => ({\n    ...styles,\n    color: data.color,\n    ':hover': {\n      backgroundColor: data.color,\n      color: 'white',\n    },\n  }),\n};\n\nexport default () => (\n  <Select\n    closeMenuOnSelect={false}\n    defaultValue={[colourOptions[0], colourOptions[1]]}\n    isMulti\n    options={colourOptions}\n    styles={colourStyles}\n  />\n);\n"
  },
  {
    "path": "docs/examples/StyledSingle.tsx",
    "content": "import React from 'react';\nimport chroma from 'chroma-js';\n\nimport { ColourOption, colourOptions } from '../data';\nimport Select, { StylesConfig } from 'react-select';\n\nconst dot = (color = 'transparent') => ({\n  alignItems: 'center',\n  display: 'flex',\n\n  ':before': {\n    backgroundColor: color,\n    borderRadius: 10,\n    content: '\" \"',\n    display: 'block',\n    marginRight: 8,\n    height: 10,\n    width: 10,\n  },\n});\n\nconst colourStyles: StylesConfig<ColourOption> = {\n  control: (styles) => ({ ...styles, backgroundColor: 'white' }),\n  option: (styles, { data, isDisabled, isFocused, isSelected }) => {\n    const color = chroma(data.color);\n    return {\n      ...styles,\n      backgroundColor: isDisabled\n        ? undefined\n        : isSelected\n        ? data.color\n        : isFocused\n        ? color.alpha(0.1).css()\n        : undefined,\n      color: isDisabled\n        ? '#ccc'\n        : isSelected\n        ? chroma.contrast(color, 'white') > 2\n          ? 'white'\n          : 'black'\n        : data.color,\n      cursor: isDisabled ? 'not-allowed' : 'default',\n\n      ':active': {\n        ...styles[':active'],\n        backgroundColor: !isDisabled\n          ? isSelected\n            ? data.color\n            : color.alpha(0.3).css()\n          : undefined,\n      },\n    };\n  },\n  input: (styles) => ({ ...styles, ...dot() }),\n  placeholder: (styles) => ({ ...styles, ...dot('#ccc') }),\n  singleValue: (styles, { data }) => ({ ...styles, ...dot(data.color) }),\n};\n\nexport default () => (\n  <Select\n    defaultValue={colourOptions[2]}\n    options={colourOptions}\n    styles={colourStyles}\n  />\n);\n"
  },
  {
    "path": "docs/examples/Theme.tsx",
    "content": "import React from 'react';\n\nimport { flavourOptions } from '../data';\nimport Select from 'react-select';\n\nexport default () => (\n  <Select\n    defaultValue={flavourOptions[2]}\n    options={flavourOptions}\n    theme={(theme) => ({\n      ...theme,\n      borderRadius: 0,\n      colors: {\n        ...theme.colors,\n        primary25: 'hotpink',\n        primary: 'black',\n      },\n    })}\n  />\n);\n"
  },
  {
    "path": "docs/examples/index.tsx",
    "content": "export { default as AccessingInternals } from './AccessingInternals';\nexport { default as ControlledMenu } from './ControlledMenu';\nexport { default as AnimatedMulti } from './AnimatedMulti';\nexport { default as AsyncCallbacks } from './AsyncCallbacks';\nexport { default as AsyncCreatable } from './AsyncCreatable';\nexport { default as AsyncPromises } from './AsyncPromises';\nexport { default as BasicGrouped } from './BasicGrouped';\nexport { default as BasicMulti } from './BasicMulti';\nexport { default as BasicSingle } from './BasicSingle';\nexport { default as CustomAriaLive } from './CustomAriaLive';\nexport { default as CustomControl } from './CustomControl';\nexport { default as CreatableAdvanced } from './CreatableAdvanced';\nexport { default as CreatableInputOnly } from './CreatableInputOnly';\nexport { default as CreateFilter } from './CreateFilter';\nexport { default as CreatableMulti } from './CreatableMulti';\nexport { default as CreatableSingle } from './CreatableSingle';\nexport { default as CustomSelectProps } from './CustomSelectProps';\nexport { default as CustomClearIndicator } from './CustomClearIndicator';\nexport { default as CustomDropdownIndicator } from './CustomDropdownIndicator';\nexport { default as CustomLoadingIndicator } from './CustomLoadingIndicator';\nexport { default as CustomLoadingMessage } from './CustomLoadingMessage';\nexport { default as CustomGroup } from './CustomGroup';\nexport { default as CustomMenu } from './CustomMenu';\nexport { default as CustomMenuList } from './CustomMenuList';\nexport { default as CustomIndicatorsContainer } from './CustomIndicatorsContainer';\nexport { default as CustomIndicatorSeparator } from './CustomIndicatorSeparator';\nexport { default as CustomNoOptionsMessage } from './CustomNoOptionsMessage';\nexport { default as CustomMultiValueContainer } from './CustomMultiValueContainer';\nexport { default as CustomOption } from './CustomOption';\nexport { default as CustomMultiValueLabel } from './CustomMultiValueLabel';\nexport { default as CustomMultiValueRemove } from './CustomMultiValueRemove';\nexport { default as CustomInput } from './CustomInput';\nexport { default as CustomGroupHeading } from './CustomGroupHeading';\nexport { default as CustomPlaceholder } from './CustomPlaceholder';\nexport { default as CustomSelectContainer } from './CustomSelectContainer';\nexport { default as CustomSingleValue } from './CustomSingleValue';\nexport { default as CustomValueContainer } from './CustomValueContainer';\nexport { default as CustomGetOptionLabel } from './CustomGetOptionLabel';\nexport { default as CustomGetOptionValue } from './CustomGetOptionValue';\nexport { default as CustomFilterOptions } from './CustomFilterOptions';\nexport { default as CustomIsOptionDisabled } from './CustomIsOptionDisabled';\nexport { default as DefaultOptions } from './DefaultOptions';\nexport { default as Experimental } from './Experimental';\nexport { default as FixedOptions } from './FixedOptions';\nexport { default as MultiSelectSort } from './MultiSelectSort';\nexport { default as Popout } from './Popout';\nexport { default as StyledMulti } from './StyledMulti';\nexport { default as StyledSingle } from './StyledSingle';\nexport { default as OnSelectResetsInput } from './OnSelectResetsInput';\nexport { default as AsyncMulti } from './AsyncMulti';\nexport { default as MenuBuffer } from './MenuBuffer';\nexport { default as MenuPortal } from './MenuPortal';\nexport { default as Theme } from './Theme';\nexport { default as StyleCompositionExample } from './StyleCompositionExample';\n"
  },
  {
    "path": "docs/generate-magical-types/generate/package.json",
    "content": "{\n  \"main\": \"dist/react-select-generate-magical-types-generate.cjs.js\",\n  \"module\": \"dist/react-select-generate-magical-types-generate.esm.js\"\n}\n"
  },
  {
    "path": "docs/generate-magical-types/package.json",
    "content": "{\n  \"name\": \"@react-select/generate-magical-types\",\n  \"main\": \"dist/generate-magical-types.cjs.js\",\n  \"exports\": {\n    \"./generate\": {\n      \"module\": \"./generate/dist/react-select-generate-magical-types-generate.esm.js\",\n      \"import\": \"./generate/dist/react-select-generate-magical-types-generate.cjs.mjs\",\n      \"default\": \"./generate/dist/react-select-generate-magical-types-generate.cjs.js\"\n    },\n    \"./serialize\": {\n      \"module\": \"./serialize/dist/react-select-generate-magical-types-serialize.esm.js\",\n      \"import\": \"./serialize/dist/react-select-generate-magical-types-serialize.cjs.mjs\",\n      \"default\": \"./serialize/dist/react-select-generate-magical-types-serialize.cjs.js\"\n    },\n    \"./package.json\": \"./package.json\"\n  },\n  \"//\": \"these deps aren't real, they're just to appease preconstruct\",\n  \"dependencies\": {\n    \"@babel/runtime\": \"*\",\n    \"@magical-types/convert-type\": \"*\",\n    \"@magical-types/serialization\": \"*\",\n    \"ts-morph\": \"*\",\n    \"fs-extra\": \"*\",\n    \"flatted\": \"*\"\n  },\n  \"preconstruct\": {\n    \"entrypoints\": [\n      \"generate.ts\",\n      \"serialize.ts\"\n    ]\n  }\n}\n"
  },
  {
    "path": "docs/generate-magical-types/serialize/package.json",
    "content": "{\n  \"main\": \"dist/react-select-generate-magical-types-serialize.cjs.js\",\n  \"module\": \"dist/react-select-generate-magical-types-serialize.esm.js\"\n}\n"
  },
  {
    "path": "docs/generate-magical-types/src/generate.ts",
    "content": "import path from 'path';\n\n// @ts-ignore\nimport fs from 'fs-extra';\nimport * as flatted from 'flatted';\nimport { Project } from 'ts-morph';\nimport { MagicalNode } from '@magical-types/types';\nimport { convertType, getPropTypesType } from '@magical-types/convert-type';\n\ntype MagicalNodesForPackage = Record<\n  string,\n  { type: 'component' | 'other'; node: MagicalNode }\n>;\n\nexport type MagicalNodes = Record<string, MagicalNodesForPackage>;\n\nif (process.env.NODE_ENV === 'test') {\n  fs.outputFileSync(\n    path.join(__dirname, '..', 'dist', 'magical-types.json'),\n    flatted.stringify({})\n  );\n} else {\n  const OTHERFILES: string[] = ['stateManager', 'Async', 'Creatable'];\n  const getOtherProps = (obj: MagicalNodes) => {\n    OTHERFILES.forEach((name: string) => {\n      let pkgExports: MagicalNodesForPackage = {};\n      obj[`${name}`] = pkgExports;\n      let sourceFile = project.getSourceFile(\n        path.join(__dirname, '../../PropTypes', `${name}.ts`)\n      );\n      if (!sourceFile) {\n        sourceFile = project.getSourceFile(\n          path.join(__dirname, '../../PropTypes', `${name}.tsx`)\n        );\n      }\n      if (!sourceFile) {\n        throw new Error(`source file not found for ${name}`);\n      }\n      resolveTypes({ sourceFile, item: name, pkgExports });\n    });\n  };\n\n  const resolveTypes = ({\n    sourceFile,\n    item,\n    pkgExports,\n  }: {\n    sourceFile: any;\n    item: string;\n    pkgExports: MagicalNodesForPackage;\n  }) => {\n    let exportedDeclarations = sourceFile.getExportedDeclarations();\n    for (const [exportName, declaration] of exportedDeclarations) {\n      if (declaration.length) {\n        let type = declaration[0].getType().compilerType;\n        let typeKind: 'component' | 'other' = 'other';\n        console.log(`about to convert ${exportName} from ${item}`);\n        if (exportName[0].toUpperCase() === exportName[0]) {\n          try {\n            type = getPropTypesType(type);\n            typeKind = 'component';\n          } catch (err) {}\n        }\n        pkgExports[exportName] = {\n          node: convertType(type, []),\n          type: typeKind,\n        };\n        console.log('converted');\n      }\n    }\n  };\n\n  let project = new Project({\n    addFilesFromTsConfig: true,\n    tsConfigFilePath: path.resolve(__dirname, '../../../tsconfig.json'),\n  });\n  console.log('done');\n  let pkgDir = path.resolve(__dirname, '../../../packages');\n  let pkgs = fs\n    .readdirSync(pkgDir, {\n      withFileTypes: true,\n    })\n    .filter(\n      // @ts-ignore\n      (x) =>\n        x.isDirectory() &&\n        fs.existsSync(path.join(pkgDir, path.join(x.name), 'package.json'))\n    )\n    // @ts-ignore\n    .map((x) => x.name);\n\n  let obj: MagicalNodes = {};\n\n  for (const item of pkgs) {\n    let pkgExports: MagicalNodesForPackage = {};\n    obj[`${item}`] = pkgExports;\n    let sourceFile = project.getSourceFile(\n      path.join(pkgDir, item, 'src', 'index.tsx')\n    );\n    if (!sourceFile) {\n      sourceFile = project.getSourceFile(\n        path.join(pkgDir, item, 'src', 'index.ts')\n      );\n    }\n    if (!sourceFile) {\n      throw new Error(`source file not found for ${item}`);\n    }\n    resolveTypes({ sourceFile, item, pkgExports });\n  }\n\n  getOtherProps(obj);\n\n  fs.outputFileSync(\n    path.join(__dirname, '..', 'dist', 'magical-types.json'),\n    flatted.stringify(obj)\n  );\n}\n"
  },
  {
    "path": "docs/generate-magical-types/src/serialize.ts",
    "content": "import path from 'path';\n\n// @ts-ignore\nimport fs from 'fs-extra';\nimport * as flatted from 'flatted';\nimport { MagicalNode } from '@magical-types/types';\nimport {\n  chunkNodes,\n  serializeNodes,\n} from '@magical-types/serialization/serialize';\n\nimport { MagicalNodeMetadata, MagicalNodes } from './types';\n\nconst allTypes: MagicalNodes = flatted.parse(\n  fs.readFileSync(\n    path.join(__dirname, '..', 'dist', 'magical-types.json'),\n    'utf8'\n  )\n);\n\nconst magicalTypesDir = path.resolve(__dirname, '..', '..', 'magical-types');\n\nfs.removeSync(magicalTypesDir);\n\nfs.ensureDirSync(magicalTypesDir);\n\nlet rootNodes: MagicalNode[] = [];\n\nfor (const pkgName in allTypes) {\n  for (const exportName in allTypes[pkgName]) {\n    rootNodes.push(allTypes[pkgName][exportName].node);\n  }\n}\n\nconsole.log('serializing nodes');\nconst serializationResult = serializeNodes(rootNodes);\nconsole.log('done');\n\nconsole.log('chunking nodes');\nconst chunkedNodes = chunkNodes(serializationResult);\nconsole.log('done');\n\nlet outputPaths = chunkedNodes.map((x, index) =>\n  path.join(\n    magicalTypesDir,\n    `magical-types-${index}-${Math.random().toString(36)}.json`\n  )\n);\n\nlet outputUrlSegments = outputPaths.map(\n  (filepath) => `/magical-types/${path.basename(filepath)}`\n);\nlet manifestOutputPath = path.resolve(\n  magicalTypesDir,\n  'magical-types-manifest.json'\n);\n\nconst metadataWithIndexes: MagicalNodeMetadata = {};\n\nfor (const pkgName in allTypes) {\n  metadataWithIndexes[pkgName] = {};\n  for (const exportName in allTypes[pkgName]) {\n    if (serializationResult.nodesMeta.has(allTypes[pkgName][exportName].node)) {\n      metadataWithIndexes[pkgName][exportName] = {\n        type: allTypes[pkgName][exportName].type,\n        index: serializationResult.nodesMeta.get(\n          allTypes[pkgName][exportName].node\n        )!.index,\n      };\n    }\n  }\n}\n\n(async () => {\n  console.log('writing output');\n  await Promise.all([\n    fs.writeFile(\n      manifestOutputPath,\n      JSON.stringify({\n        paths: outputUrlSegments,\n        types: metadataWithIndexes,\n      })\n    ),\n    ...outputPaths.map((filepath, index) =>\n      fs.writeFile(filepath, JSON.stringify(chunkedNodes[index]))\n    ),\n  ]);\n\n  console.log('done');\n})().catch((err) => {\n  console.error(err);\n  process.exit(1);\n});\n"
  },
  {
    "path": "docs/generate-magical-types/src/types.ts",
    "content": "import { MagicalNode, MagicalNodeIndex } from '@magical-types/types';\n\nexport type MagicalNodeMetadata = Record<\n  string,\n  Record<string, MagicalNodeRecord>\n>;\n\nexport type MagicalNodeRecord = {\n  type: 'component' | 'other';\n  index: MagicalNodeIndex;\n};\n\nexport type MagicalNodesForPackage = Record<\n  string,\n  { type: 'component' | 'other'; node: MagicalNode }\n>;\n\nexport type MagicalNodes = Record<string, MagicalNodesForPackage>;\n"
  },
  {
    "path": "docs/index.css",
    "content": "@import url('https://fonts.googleapis.com/css?family=Roboto+Mono|Roboto:400,500,700');\n\nbody {\n  -moz-font-feature-settings: 'liga' on;\n  -moz-osx-font-smoothing: grayscale;\n  -webkit-font-smoothing: antialiased;\n  color: #253858;\n  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Helvetica Neue',\n    Helvetica, sans-serif;\n  font-style: normal;\n  font-weight: 400;\n  margin: 0;\n  padding: 0;\n  text-rendering: optimizeLegibility;\n}\np > a,\np > a:hover,\np > a:visited,\nli > a,\nli > a:hover,\nli > a:visited {\n  color: #2684ff;\n}\ncode {\n  font-family: Roboto Mono, Monaco, monospace;\n}\np > code {\n  white-space: nowrap;\n}\np,\nul,\nol {\n  line-height: 1.5;\n}\ntd p {\n  margin: 0;\n}\nh1,\nh2,\nh3,\nh4,\nh5 {\n  color: #091e42;\n}\nh6 {\n  color: #777;\n  margin-bottom: 0.25em;\n  text-transform: uppercase;\n}\n@keyframes dropIn {\n  from,\n  60%,\n  75%,\n  90%,\n  to {\n    animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);\n  }\n  0% {\n    opacity: 0;\n    transform: translate3d(0, -1666px, 0);\n  }\n  60% {\n    opacity: 1;\n    transform: translate3d(0, 26px, 0);\n  }\n  75% {\n    transform: translate3d(0, -10px, 0);\n  }\n  90% {\n    transform: translate3d(0, 6px, 0);\n  }\n  to {\n    transform: translate3d(0, 0, 0);\n  }\n}\n.animate-dropin {\n  animation: dropIn 0.66s;\n}\n"
  },
  {
    "path": "docs/index.html",
    "content": "<!DOCTYPE html>\n<head>\n  <meta charset=\"utf-8\" />\n  <title>React-Select</title>\n  <meta\n    name=\"viewport\"\n    content=\"initial-scale=1.0,user-scalable=no,maximum-scale=1,width=device-width\"\n  />\n  <meta\n    name=\"keywords\"\n    content=\"react,reactjs,react component,component,select,form,autocomplete,control,ui,javascript\"\n  />\n  <meta\n    name=\"description\"\n    content=\"A flexible and beautiful Select Input control for ReactJS with multiselect, autocomplete and ajax support.\"\n  />\n  <meta property=\"og:locale\" content=\"en-us\" />\n  <meta property=\"og:title\" content=\"React-Select\" />\n  <meta\n    property=\"og:description\"\n    content=\"A flexible and beautiful Select Input control for ReactJS with multiselect, autocomplete and ajax support.\"\n  />\n  <meta property=\"og:url\" content=\"https://jedwatson.github.io/react-select\" />\n  <meta property=\"og:site_name\" content=\"React-Select\" />\n  <meta property=\"og:type\" content=\"article\" />\n  <link rel=\"stylesheet\" href=\"index.css\" />\n  <link rel=\"icon\" type=\"image/x-icon\" href=\"favicon.ico\" />\n  <!-- Global site tag (gtag.js) - Google Analytics -->\n  <script\n    async\n    src=\"https://www.googletagmanager.com/gtag/js?id=UA-122737675-1\"\n  ></script>\n  <script>\n    window.dataLayer = window.dataLayer || [];\n    function gtag() {\n      dataLayer.push(arguments);\n    }\n    gtag('js', new Date());\n\n    gtag('config', 'UA-122737675-1');\n  </script>\n  <!--\n\tNOTE: Include the polyfill below if you are testing the async/await example\n\t<script language=\"javascript\" src=\"https://unpkg.com/babel-polyfill@6.26.0/dist/polyfill.min.js\"></script>\n\t-->\n</head>\n<body>\n  <div id=\"root\"></div>\n  <script src=\"index.js\"></script>\n</body>\n"
  },
  {
    "path": "docs/index.tsx",
    "content": "import '@babel/polyfill';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport App from './App';\n\nReactDOM.render(<App />, document.getElementById('root'));\n"
  },
  {
    "path": "docs/isArray.ts",
    "content": "/**\n * Alternative to Array.isArray that correctly narrows the type for readonly arrays.\n */\nexport default function isArray<T>(arg: unknown): arg is readonly T[] {\n  return Array.isArray(arg);\n}\n"
  },
  {
    "path": "docs/markdown/renderer.tsx",
    "content": "/** @jsx emotionJSX */\nimport md, {\n  CodeProps,\n  CommonProps,\n  HeadingProps,\n  LinkProps,\n} from 'react-markings';\nimport { jsx as emotionJSX } from '@emotion/react'; // eslint-disable-line no-unused-vars\nimport { Link as RRLink } from 'react-router-dom';\n\nimport Svg, { SvgProps } from '../Svg';\nimport store from './store';\n\n// ==============================\n// Syntax Highlighter\n// ==============================\n\nimport SyntaxHighlighter, {\n  registerLanguage,\n} from 'react-syntax-highlighter/prism-light';\nimport jsx from 'react-syntax-highlighter/languages/prism/jsx';\nimport { coy } from 'react-syntax-highlighter/styles/prism';\nimport { ReactElement } from 'react';\n\nconst customCoy = {\n  ...coy,\n  'code[class*=\"language-\"]': {\n    ...coy['code[class*=\"language-\"]'],\n    fontFamily: null, // inherit from css\n  },\n  'pre[class*=\"language-\"]': {\n    ...coy['pre[class*=\"language-\"]'],\n    fontFamily: null, // inherit from css\n  },\n};\n\nregisterLanguage('jsx', jsx);\n\n// ==============================\n// Helpers\n// ==============================\n\nfunction slugify(str: string): string {\n  return str.replace(/\\W/g, '-').toLowerCase();\n}\n\n// ==============================\n// Renderers\n// ==============================\n\nfunction isReactElement(child: ReactElement | string): child is ReactElement {\n  return (child as ReactElement).props;\n}\n\nfunction getLabel(children: (ReactElement | string)[] | ReactElement | string) {\n  let str = '';\n\n  if (Array.isArray(children)) {\n    children.forEach((c) => {\n      if (Array.isArray(c)) {\n        getLabel(c);\n      } else if (isReactElement(c)) {\n        str = c.props.children;\n      } else {\n        str = c;\n      }\n    });\n  } else if (isReactElement(children)) {\n    getLabel(children.props.children);\n  } else {\n    str = children;\n  }\n\n  return str;\n}\n\nconst Chain = (props: Omit<SvgProps, 'ref' | 'size'>) => (\n  <Svg\n    size={16}\n    css={{\n      color: '#4C9AFF',\n      paddingRight: 10,\n      opacity: 0,\n      position: 'absolute',\n      top: '50%',\n      transform: 'translate(-100%, -50%)',\n      transition: 'opacity 200ms',\n    }}\n    {...props}\n  >\n    <title>Link to</title>\n    <path d=\"M7.859 14.691l-0.81 0.805c-0.701 0.695-1.843 0.695-2.545 0-0.336-0.334-0.521-0.779-0.521-1.252s0.186-0.916 0.521-1.252l2.98-2.955c0.617-0.613 1.779-1.515 2.626-0.675 0.389 0.386 1.016 0.384 1.403-0.005 0.385-0.389 0.383-1.017-0.006-1.402-1.438-1.428-3.566-1.164-5.419 0.675l-2.98 2.956c-0.715 0.709-1.108 1.654-1.108 2.658 0 1.006 0.394 1.949 1.108 2.658 0.736 0.73 1.702 1.096 2.669 1.096s1.934-0.365 2.669-1.096l0.811-0.805c0.389-0.385 0.391-1.012 0.005-1.4s-1.014-0.39-1.403-0.006zM16.891 3.207c-1.547-1.534-3.709-1.617-5.139-0.197l-1.009 1.002c-0.389 0.386-0.392 1.013-0.006 1.401 0.386 0.389 1.013 0.391 1.402 0.005l1.010-1.001c0.74-0.736 1.711-0.431 2.346 0.197 0.336 0.335 0.522 0.779 0.522 1.252s-0.186 0.917-0.522 1.251l-3.18 3.154c-1.454 1.441-2.136 0.766-2.427 0.477-0.389-0.386-1.016-0.383-1.401 0.005s-0.384 1.017 0.005 1.401c0.668 0.662 1.43 0.99 2.228 0.99 0.977 0 2.010-0.492 2.993-1.467l3.18-3.153c0.712-0.71 1.107-1.654 1.107-2.658s-0.395-1.949-1.109-2.659z\" />\n  </Svg>\n);\n\nconst Heading = (props: HeadingProps) => {\n  const { children, level, nodeKey } = props;\n\n  const Tag = `h${level}` as 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n  const label = getLabel(children);\n  const slug = slugify(label);\n  const linkify = [1, 2].includes(level);\n\n  if (linkify) {\n    store.add(nodeKey, { key: nodeKey, label, level, path: `#${slug}` });\n  }\n  const css = {\n    '&:first-child': { marginTop: 0 },\n  };\n\n  return linkify ? (\n    <Tag id={slug} css={css}>\n      <RRLink\n        to={`#${slug}`}\n        css={{\n          color: 'inherit',\n          position: 'relative',\n          textDecoration: 'none',\n          '&:hover > svg': { opacity: 1, transitionDelay: '300ms' },\n        }}\n      >\n        <Chain />\n        {children}\n      </RRLink>\n    </Tag>\n  ) : (\n    <Tag css={css}>{children}</Tag>\n  );\n};\n\nexport const Code = ({ literal }: CodeProps) => (\n  <code\n    css={{\n      backgroundColor: 'rgba(38, 132, 255, 0.08)',\n      color: '#172B4D',\n      fontSize: '90%',\n      fontStyle: 'normal',\n      padding: '1px 5px 2px',\n      borderRadius: 4,\n    }}\n  >\n    {literal}\n  </code>\n);\n\ninterface CodeBlockProps {\n  codeinfo?: string[];\n  literal: string | null;\n  nodeKey?: string;\n}\n\nexport const CodeBlock = ({\n  codeinfo,\n  literal,\n  nodeKey,\n  ...props\n}: CodeBlockProps) => {\n  const language = codeinfo![0];\n\n  return (\n    <SyntaxHighlighter\n      language={language}\n      style={customCoy}\n      customStyle={{\n        backgroundColor: 'none',\n        borderRadius: 4,\n        fontSize: 13,\n        marginBottom: '1em',\n        marginTop: '1em',\n        overflowX: 'auto',\n        WebkitOverflowScrolling: 'touch',\n      }}\n      {...props}\n    >\n      {literal}\n    </SyntaxHighlighter>\n  );\n};\nCodeBlock.defaultProps = { codeinfo: [], language: 'jsx' };\n\nconst Blockquote = ({ nodeKey, ...props }: CommonProps) => (\n  <blockquote\n    css={{\n      color: '#7A869A',\n      fontStyle: 'italic',\n      marginLeft: 0,\n      paddingLeft: 16,\n      borderLeft: '4px solid #eee',\n    }}\n    {...props}\n  />\n);\n\nconst Link = ({ nodeKey, href, ...props }: LinkProps) =>\n  href[0] === '/' ? (\n    <RRLink to={href} {...props} />\n  ) : (\n    <a href={href} {...props} />\n  );\n\n// ==============================\n// Exports\n// ==============================\n\nexport default md.customize({\n  renderers: { Blockquote, Code, Heading, CodeBlock, Link },\n});\n"
  },
  {
    "path": "docs/markdown/store.ts",
    "content": "export interface Data {\n  key: string;\n  label: string;\n  level: number;\n  path: string;\n}\n\nclass HeadingStore {\n  store: { [key: string]: Data } = {};\n  headings: { [key: string]: Data[] } = {};\n\n  add(key: string, data: Data) {\n    console.log('add being called with', data.label);\n    if (!this.headings[location.pathname]) {\n      this.headings[location.pathname] = [];\n    }\n\n    if (!this.store[key]) {\n      this.store[key] = data;\n      this.headings[location.pathname].push(data);\n    }\n  }\n  getStore() {\n    return this.store;\n  }\n  getPageHeadings(page: string) {\n    return this.headings[page];\n  }\n  getAllHeadings() {\n    return this.headings;\n  }\n  getHeadingByKey(key: string) {\n    return this.store[key];\n  }\n}\n\n// global heading store\nconst store = new HeadingStore();\n\nexport default store;\n"
  },
  {
    "path": "docs/package.json",
    "content": "{\n  \"name\": \"@react-select/docs\",\n  \"private\": true,\n  \"version\": \"3.1.3\",\n  \"main\": \"dist/docs.cjs.js\",\n  \"author\": \"Jed Watson\",\n  \"license\": \"MIT\",\n  \"dependencies\": {\n    \"@atlaskit/button\": \"^15.1.4\",\n    \"@atlaskit/icon\": \"^11.0.1\",\n    \"@atlaskit/modal-dialog\": \"^11.2.5\",\n    \"@atlaskit/spinner\": \"^15.0.6\",\n    \"@atlaskit/tooltip\": \"^17.1.2\",\n    \"@babel/runtime\": \"^7.12.0\",\n    \"@emotion/react\": \"^11.8.1\",\n    \"@magical-types/convert-type\": \"^0.1.4\",\n    \"@magical-types/pretty\": \"^0.3.5\",\n    \"@magical-types/serialization\": \"^0.2.1\",\n    \"@magical-types/types\": \"^0.1.2\",\n    \"@types/chroma-js\": \"^1.4.3\",\n    \"@types/node-fetch\": \"^2.5.8\",\n    \"@types/raf-schd\": \"^4.0.0\",\n    \"@types/react-codesandboxer\": \"^3.1.0\",\n    \"@types/react-helmet\": \"^5.0.16\",\n    \"@types/react-markings\": \"^1.3.0\",\n    \"@types/react-node-resolver\": \"^2.0.0\",\n    \"@types/react-router-dom\": \"^4.3.5\",\n    \"@types/react-syntax-highlighter\": \"^0.0.8\",\n    \"@types/webpack\": \"^4.41.26\",\n    \"@types/webpack-dev-server\": \"^3.11.1\",\n    \"babel-plugin-macros\": \"^3.0.1\",\n    \"chroma-js\": \"^2.4.2\",\n    \"chrono-node\": \"^2.1.11\",\n    \"clean-webpack-plugin\": \"^3.0.0\",\n    \"codesandboxer\": \"^0.1.1\",\n    \"fork-ts-checker-webpack-plugin\": \"^6.1.0\",\n    \"html-webpack-plugin\": \"^3.2.0\",\n    \"moment\": \"^2.29.4\",\n    \"raf-schd\": \"^4.0.3\",\n    \"raw-loader\": \"^2.0.0\",\n    \"react\": \"^16.13.0\",\n    \"react-codesandboxer\": \"^3.1.5\",\n    \"react-dom\": \"^16.13.0\",\n    \"react-helmet\": \"^5.2.0\",\n    \"react-markings\": \"^1.3.0\",\n    \"react-router-dom\": \"^4.2.2\",\n    \"react-select\": \"^5.7.0\",\n    \"react-sortable-hoc\": \"^1.9.1\",\n    \"react-syntax-highlighter\": \"^7.0.1\",\n    \"style-loader\": \"^0.23.1\",\n    \"styled-components\": \"^4.4.1\",\n    \"ts-node\": \"^9.1.1\",\n    \"unfetch\": \"^4.2.0\",\n    \"webpack\": \"^4.30.0\",\n    \"webpack-cli\": \"^4.10.0\",\n    \"webpack-dev-server\": \"^3.3.1\"\n  },\n  \"scripts\": {\n    \"site-prebuild\": \"node ./generate-magical-types/generate && node ./generate-magical-types/serialize\",\n    \"start\": \"yarn site-prebuild && webpack serve --progress\",\n    \"start:test\": \"NODE_ENV=test yarn site-prebuild && webpack serve --progress\",\n    \"build:docs\": \"rimraf docs/dist && yarn site-prebuild && webpack --progress --mode production\"\n  }\n}\n"
  },
  {
    "path": "docs/pages/advanced/index.tsx",
    "content": "import React, { Fragment } from 'react';\nimport Helmet from 'react-helmet';\nimport md from '../../markdown/renderer';\nimport ExampleWrapper from '../../ExampleWrapper';\nimport {\n  AccessingInternals,\n  BasicGrouped,\n  CreateFilter,\n  ControlledMenu,\n  CustomAriaLive,\n  CustomFilterOptions,\n  CustomGetOptionLabel,\n  CustomGetOptionValue,\n  CustomIsOptionDisabled,\n  Experimental,\n  MenuBuffer,\n  MenuPortal,\n  MultiSelectSort,\n  Popout,\n  OnSelectResetsInput,\n} from '../../examples';\n\nexport default function Advanced() {\n  return (\n    <Fragment>\n      <Helmet>\n        <title>Advanced - React Select</title>\n        <meta\n          name=\"description\"\n          content=\"The react-select property API documentation.\"\n        />\n      </Helmet>\n      {md`\n      # Advanced\n\n      ## Accessibility\n      Accessibility is important. React-select is committed to providing a custom experience to all users and relies heavily on the aria-live spec to provide\n      a custom experience for all users. As such, we also provide an api to address internationalization or further customisation.\n\n      ${(\n        <ExampleWrapper\n          label=\"Custom aria live example\"\n          urlPath=\"docs/examples/CustomAriaLive.tsx\"\n          raw={require('!!raw-loader!../../examples/CustomAriaLive.tsx')}\n        >\n          <CustomAriaLive />\n        </ExampleWrapper>\n      )}\n\n      ## Sortable MultiSelect\n      Using the [react-sortable-hoc](https://www.npmjs.com/package/react-sortable-hoc) package we can easily allow sorting of MultiSelect values by drag and drop.\n\n      ${(\n        <ExampleWrapper\n          label=\"Sortable MultiSelect example\"\n          urlPath=\"docs/examples/MultiSelectSort.tsx\"\n          raw={require('!!raw-loader!../../examples/MultiSelectSort.tsx')}\n        >\n          <MultiSelectSort />\n        </ExampleWrapper>\n      )}\n\n      ## Custom Filter logic\n      While React-Select assumes a standard way of filtering the menu on search, our api allows you to customise that filtering logic in various ways.\n\n      ### createFilter function\n      React-Select exports a createFilter function that returns a filterOption method. By using this, users can pick and choose bits of the filtration logic to customise,\n      without having to rewrite the logic wholesale.\n\n      ~~~jsx\n      // default filter configuration\n      ignoreCase: true,\n      ignoreAccents: true,\n      matchFrom: 'any',\n      stringify: option => \\`\\${option.label} \\${option.value}\\`,\n      trim: true,\n      ~~~\n\n      Below is an example of how you could use the createFilter function to customise filtration logic in react-select.\n\n      ${(\n        <ExampleWrapper\n          label=\"Custom filterOption with createFilter\"\n          urlPath=\"docs/examples/CreateFilter.tsx\"\n          raw={require('!!raw-loader!../../examples/CreateFilter.tsx')}\n        >\n          <CreateFilter />\n        </ExampleWrapper>\n      )}\n\n      ### filterOption\n      If you really would like to rewrite the filtration logic from the ground up, simply declare a new filterOption function to be passed in as a prop to react-select.\n      For details on the shape of the filterOption prop, please see the proptypes in the api docs [here](/props).\n\n      ${(\n        <ExampleWrapper\n          label=\"Custom filterOption function\"\n          urlPath=\"docs/examples/CustomFilterOptions.tsx\"\n          raw={require('!!raw-loader!../../examples/CustomFilterOptions.tsx')}\n        >\n          <CustomFilterOptions />\n        </ExampleWrapper>\n      )}\n      ~~~jsx\n      ~~~\n      > Please note that if you are using a Select that is creatable, you would also likey want to include the \"Create\" option.\n      ~~~jsx\n      const filterOption = (candidate, input) => {\n        return candidate.data.__isNew__ || candidate.label.includes(input);\n      };\n      ~~~\n\n\n      ## Replacing builtins\n      For a list of builtins that we expose, please see the API docs [here](/props#prop-types).\n\n      ${(\n        <ExampleWrapper\n          label=\"custom formatGroupLabel function example\"\n          urlPath=\"docs/examples/BasicGrouped.tsx\"\n          raw={require('!!raw-loader!../../examples/BasicGrouped.tsx')}\n        >\n          <BasicGrouped />\n        </ExampleWrapper>\n      )}\n\n      ${(\n        <ExampleWrapper\n          label=\"custom getOptionLabel function example\"\n          urlPath=\"docs/examples/CustomGetOptionLabel.tsx\"\n          raw={require('!!raw-loader!../../examples/CustomGetOptionLabel.tsx')}\n        >\n          <CustomGetOptionLabel />\n        </ExampleWrapper>\n      )}\n\n      ${(\n        <ExampleWrapper\n          label=\"custom getOptionValue function example\"\n          urlPath=\"docs/examples/CustomGetOptionValue.tsx\"\n          raw={require('!!raw-loader!../../examples/CustomGetOptionValue.tsx')}\n        >\n          <CustomGetOptionValue />\n        </ExampleWrapper>\n      )}\n\n      ${(\n        <ExampleWrapper\n          label=\"custom isOptionDisabled function example\"\n          urlPath=\"docs/examples/CustomIsOptionDisabled.tsx\"\n          raw={require('!!raw-loader!../../examples/CustomIsOptionDisabled.tsx')}\n        >\n          <CustomIsOptionDisabled />\n        </ExampleWrapper>\n      )}\n\n      ${(\n        <ExampleWrapper\n          label=\"Using the style API to replace `menuBuffer`\"\n          urlPath=\"docs/examples/MenuBuffer.tsx\"\n          raw={require('!!raw-loader!../../examples/MenuBuffer.tsx')}\n        >\n          <MenuBuffer />\n        </ExampleWrapper>\n      )}\n\n      ## Methods\n\n      These two methods sit as callable methods on the component. They are designed\n      to be accessible to wrapping components.\n\n      ### \\`focus()\\`\n\n      Focused the internal control input.\n\n      ### \\`blur()\\`\n\n      Blur the internal control input.\n\n      ## Action Meta\n      React Select exposes a variety of eventListeners to you via props.\n      The onchange function prop now has the following signature.\n      (value: ValueType, action: ActionType) => undefined;\n\n      The action argument is a string with the following possible values\n\n      * 'select-option': Selecting an option from the list\n      * 'deselect-option': (Multiple) Deselecting an option from the list\n      * 'remove-value': (Multiple) Removing a selected option with the remove button\n      * 'pop-value': Removing options using backspace\n      * 'set-value': Calling setValue from a component without an action\n      * 'clear': Removing all selected options with the clear button\n      * 'create-option': (Creatable) Creating a new option\n\n      By explicitly passing you what type of change event has been fired, we allow you to have more granular control\n      over how the select behaves after an onChange even is fired.\n\n      Below is an example of replicating the behaviour of the deprecated props from react-select v1, onSelectResetsInput and closeOnSelect\n\n      ${(\n        <ExampleWrapper\n          label=\"onSelectResetsInput = false; closeMenuOnSelect = false\"\n          urlPath=\"docs/examples/OnSelectResetsInput.tsx\"\n          raw={require('!!raw-loader!../../examples/OnSelectResetsInput.tsx')}\n        >\n          <OnSelectResetsInput />\n        </ExampleWrapper>\n      )}\n\n      ## Portaling\n      React-select exposes a menuPortalTarget prop, that lets you portal the select menu to a dom node of your choosing.\n      Additionally we expose the menuPortal styles for layering purposes.\n\n      ${(\n        <ExampleWrapper\n          isEditable={false}\n          label=\"Example of Portaling\"\n          urlPath=\"docs/examples/MenuPortal.tsx\"\n          raw={require('!!raw-loader!../../examples/MenuPortal.tsx')}\n        >\n          <MenuPortal />\n        </ExampleWrapper>\n      )}\n\n      ## Controlled Props\n\n      ${(\n        <ExampleWrapper\n          label=\"Example of controlled MenuIsOpen\"\n          urlPath=\"docs/examples/ControlledMenu.tsx\"\n          raw={require('!!raw-loader!../../examples/ControlledMenu.tsx')}\n        >\n          <ControlledMenu />\n        </ExampleWrapper>\n      )}\n\n      ## Accessing Internals\n      ${(\n        <ExampleWrapper\n          isEditable={false}\n          label=\"Accessing Internals via ref\"\n          urlPath=\"docs/examples/AccessingInternals.tsx\"\n          raw={require('!!raw-loader!../../examples/AccessingInternals.tsx')}\n        >\n          <AccessingInternals />\n        </ExampleWrapper>\n      )}\n\n      ## SSR / Universal Rendering\n\n      React-Select uses Emotion for CSS which has zero-config server rendering. This means that all you need to do to server-render React-Select is call React's \\`renderToString\\` or use a framework like Next.js or Gatsby and it will work.\n\n      ~~~jsx\n      import { renderToString } from 'react-dom/server'\n      import App from './App'\n\n      const html = renderToString(<App />)\n      ~~~\n\n      ## Experimental\n\n      Experimental recipes of prop combinations with react-select.\n\n      ${(\n        <ExampleWrapper\n          isEditable={false}\n          label=\"Popout\"\n          urlPath=\"docs/examples/Popout.tsx\"\n          raw={require('!!raw-loader!../../examples/Popout.tsx')}\n        >\n          <Popout />\n        </ExampleWrapper>\n      )}\n\n      A popular recipe for using select when there's limited real estate.\n\n      > When \\`controlShouldRenderValue\\` is disabled, it's recommended to also disable \\`isClearable\\` and \\`backspaceRemovesValue\\`.\n\n      ${(\n        <ExampleWrapper\n          isEditable={false}\n          label=\"Date Picker\"\n          urlPath=\"docs/examples/Experimental.tsx\"\n          raw={require('!!raw-loader!../../examples/Experimental.tsx')}\n        >\n          <Experimental />\n        </ExampleWrapper>\n      )}\n\n      This example uses a combination of custom components and functions to make react-select behave like a date picker.\n\n      > Type a date like \"25/8/18\", \"tomorrow\", \"next monday\", or \"6 weeks from now\" into the field to get date suggestions.\n\n    `}\n    </Fragment>\n  );\n}\n"
  },
  {
    "path": "docs/pages/async/index.tsx",
    "content": "import React, { Fragment } from 'react';\nimport Helmet from 'react-helmet';\nimport ExampleWrapper from '../../ExampleWrapper';\nimport md from '../../markdown/renderer';\nimport {\n  AsyncCallbacks,\n  AsyncMulti,\n  AsyncPromises,\n  DefaultOptions,\n} from '../../examples';\n\nexport default function Async() {\n  return (\n    <Fragment>\n      <Helmet>\n        <title>Async - React Select</title>\n        <meta name=\"description\" content=\"The react-select Async Component.\" />\n      </Helmet>\n      {md`\n    # Async\n    Use the Async component to load options from a remote source as the user types.\n\n    ~~~jsx\n    import Async, { useAsync } from 'react-select/async';\n    ~~~\n\n    ## Loading Asynchronously\n\n    The loadOptions prop allows users to either resolve from a callback...\n\n    ${(\n      <ExampleWrapper\n        label=\"Callbacks\"\n        urlPath=\"docs/examples/AsyncCallbacks.tsx\"\n        raw={require('!!raw-loader!../../examples/AsyncCallbacks.tsx')}\n      >\n        <AsyncCallbacks />\n      </ExampleWrapper>\n    )}\n\n    or resolve from a returned promise....\n\n    ${(\n      <ExampleWrapper\n        label=\"Promises\"\n        urlPath=\"docs/examples/AsyncPromises.tsx\"\n        raw={require('!!raw-loader!../../examples/AsyncPromises.tsx')}\n      >\n        <AsyncPromises />\n      </ExampleWrapper>\n    )}\n\n    ${(\n      <ExampleWrapper\n        label=\"Async MultiSelect\"\n        urlPath=\"docs/examples/AsyncMulti.tsx\"\n        raw={require('!!raw-loader!../../examples/AsyncMulti.tsx')}\n      >\n        <AsyncMulti />\n      </ExampleWrapper>\n    )}\n\n    ## defaultOptions\n\n    The defaultOptions prop determines \"when\" your remote request is initially fired. There are two valid values for this property. Providing an option array to this prop will populate the initial set of options used when opening the select, at which point the remote load only occurs when filtering the options (typing in the control). Providing the prop by itself (or with 'true') tells the control to immediately fire the remote request, described by your loadOptions, to get those initial values for the Select.\n\n    ${(\n      <ExampleWrapper\n        label=\"Async with defaultOptions provided\"\n        urlPath=\"docs/examples/DefaultOptions.tsx\"\n        raw={require('!!raw-loader!../../examples/DefaultOptions.tsx')}\n      >\n        <DefaultOptions />\n      </ExampleWrapper>\n    )}\n\n    ${(\n      <ExampleWrapper\n        label=\"Async with defaultOptions as true\"\n        urlPath=\"docs/examples/AsyncPromises.tsx\"\n        raw={require('!!raw-loader!../../examples/AsyncPromises.tsx')}\n      >\n        <AsyncPromises />\n      </ExampleWrapper>\n    )}\n  `}\n    </Fragment>\n  );\n}\n"
  },
  {
    "path": "docs/pages/components/index.tsx",
    "content": "import React, { Fragment } from 'react';\nimport { Helmet } from 'react-helmet';\n\nimport md from '../../markdown/renderer';\nimport ExampleWrapper from '../../ExampleWrapper';\nimport {\n  CustomSelectProps,\n  CustomClearIndicator,\n  CustomDropdownIndicator,\n  CustomLoadingIndicator,\n  CustomLoadingMessage,\n  CustomIndicatorsContainer,\n  CustomIndicatorSeparator,\n  CustomNoOptionsMessage,\n  CustomMultiValueContainer,\n  CustomMultiValueRemove,\n  CustomMultiValueLabel,\n  CustomControl,\n  CustomGroup,\n  CustomInput,\n  CustomOption,\n  CustomMenu,\n  CustomMenuList,\n  CustomPlaceholder,\n  CustomSelectContainer,\n  CustomSingleValue,\n  CustomGroupHeading,\n  CustomValueContainer,\n} from '../../examples';\n\nexport default function Components() {\n  return (\n    <Fragment>\n      <Helmet>\n        <title>Components - React Select</title>\n        <meta\n          name=\"description\"\n          content=\"The main feature of this library is providing consumers with the building blocks necessary to create their component.\"\n        />\n      </Helmet>\n      {md`\n        # Components\n\n        The main feature of this library is providing consumers with the\n        building blocks necessary to create _their_ component.\n\n        The following components are customisable and switchable:\n          * ClearIndicator\n          * Control\n          * DropdownIndicator\n          * DownChevron\n          * CrossIcon\n          * Group\n          * GroupHeading\n          * IndicatorsContainer\n          * IndicatorSeparator\n          * Input\n          * LoadingIndicator\n          * Menu\n          * MenuList\n          * MenuPortal\n          * LoadingMessage\n          * NoOptionsMessage\n          * MultiValue\n          * MultiValueContainer\n          * MultiValueLabel\n          * MultiValueRemove\n          * Option\n          * Placeholder\n          * SelectContainer\n          * SingleValue\n          * ValueContainer\n\n        ## Replacing Components\n\n        React-Select allows you to augment layout and functionality by replacing\n        the default components with your own, using the \\`components\\`\n        property. These components are given all the current props and state\n        letting you achieve anything you dream up.\n\n        ## Inner Ref\n        Some components also take an innerRef prop that react-select needs in\n        order to manage internal behaviour. Please assign this to the ref\n        property of the relevant react-element. For example:\n\n        ~~~~\n        const CustomOption = ({ innerRef, innerProps }) => (\n        <div ref={innerRef} {...innerProps} />)\n        ~~~~\n\n        ### Inner Props\n\n        All functional properties that the component needs are provided in\n        \\`innerProps\\` which you must spread.\n\n        ### Common Props\n\n        Every component receives \\`commonProps\\` which are spread onto\n        the component. These include:\n\n        * \\`clearValue\\`\n        * \\`getStyles\\`\n        * \\`getValue\\`\n        * \\`hasValue\\`\n        * \\`isMulti\\`\n        * \\`isRtl\\`\n        * \\`options\\`\n        * \\`selectOption\\`\n        * \\`setValue\\`\n        * \\`selectProps\\`\n\n        ~~~jsx\n        import React from 'react';\n        import Select from 'react-select';\n\n        const CustomOption = ({ innerProps, isDisabled }) =>\n          !isDisabled ? (\n            <div {...innerProps}>{/* your component internals */}</div>\n          ) : null;\n\n        class Component extends React.Component {\n          render() {\n            return <Select components={{ Option: CustomOption }} />;\n          }\n        }\n\n        ~~~\n\n        ## Defining components\n\n        When defining replacement components, it is important to do so __outside__ the scope of\n        rendering the Select. Defining a replacement component directly in the components prop can\n        cause issues.\n\n        On this topic, React\n        [documentation](https://reactjs.org/docs/higher-order-components.html#dont-use-hocs-inside-the-render-method)\n        has the following to say:\n\n        > The problem here isn’t just about performance — remounting a component causes the state\n        of that component and all of its children to be lost.\n\n        This statement applies as well when replacing components in react-select with inline definitions.\n\n        ~~~jsx\n        // Bad: Inline declaration will cause remounting issues\n        const BadSelect = props => (\n          <Select {...props} components={{\n            Control: ({ children, ...rest }) => (\n              <components.Control {...rest}>\n                👎 {children}\n              </components.Control>\n            )}}\n          />\n        )\n\n        // Good: Custom component declared outside of the Select scope\n        const Control = ({ children, ...props }) => (\n          <components.Control {...props}>\n            👍 {children}\n          </components.Control>\n        );\n\n        const GoodSelect = props => <Select {...props} components={{ Control }} />\n\n        ~~~\n\n        There will likely be times that data or methods may need to be shared,\n        but this can be achieved with the \\`selectProps\\` prop passed to each component.\n\n        ${(\n          <ExampleWrapper\n            label=\"Custom Component with selectProps Example\"\n            urlPath=\"docs/examples/CustomSelectProps.tsx\"\n            raw={require('!!raw-loader!../../examples/CustomSelectProps.tsx')}\n          >\n            <CustomSelectProps />\n          </ExampleWrapper>\n        )}\n\n        ~~~\n        ~~~\n\n        ## Adjusting the Styling\n\n        The \\`styles\\` prop allows you to pass styles to a particular component, without\n        replacing the entire component. If you only want to change styling, you should\n        start by using the \\`styles\\` prop.\n\n        ## Replaceable components\n\n        ### ClearIndicator\n\n        The indicator presented to clear the values from the component. The default\n        component is a cross. The conditions under which the indicator will not be\n        rendered when:\n\n        * When \\`isClearable\\` is false, or when \\`isMulti\\` is false, and \\`isClearable\\` is undefined\n        * When the select is disabled\n        * When the select has no value\n        * When the select is loading\n\n        See [props docs](/props#clearindicator) for more details\n\n        ${(\n          <ExampleWrapper\n            label=\"Custom ClearIndicator Example\"\n            urlPath=\"docs/examples/CustomClearIndicator.tsx\"\n            raw={require('!!raw-loader!../../examples/CustomClearIndicator.tsx')}\n          >\n            <CustomClearIndicator />\n          </ExampleWrapper>\n        )}\n\n        ### Control\n\n        The second highest level wrapper around the components. It is responsible for the\n        positioning of the \\`ValueContainer\\` and \\`IndicatorsContainer\\`. It is followed\n        by the Menu.\n\n        See [props docs](/props#control) for more details\n\n        ${(\n          <ExampleWrapper\n            label=\"Custom Control Example\"\n            urlPath=\"docs/examples/CustomControl.tsx\"\n            raw={require('!!raw-loader!../../examples/CustomControl.tsx')}\n          >\n            <CustomControl />\n          </ExampleWrapper>\n        )}\n\n        ### Dropdown Indicator\n\n        The indicator for opening the select, designed to indicate to users that\n        this is a select. By default it is a chevron pointed down.\n\n        See [props docs](/props#dropdownindicator) for more details\n\n        ${(\n          <ExampleWrapper\n            label=\"Custom Dropdown Indicator Example\"\n            urlPath=\"docs/examples/CustomDropdownIndicator.tsx\"\n            raw={require('!!raw-loader!../../examples/CustomDropdownIndicator.tsx')}\n          >\n            <CustomDropdownIndicator />\n          </ExampleWrapper>\n        )}\n\n        ### Group\n\n        The wrapper around each group if the Select has groups in its data. The default\n        component is responsible both for mapping its options, as well as rendering\n        its data into the GroupHeading.\n\n        See [props docs](/props#group) for more details\n\n        ${(\n          <ExampleWrapper\n            label=\"Custom Group Example\"\n            urlPath=\"docs/examples/CustomGroup.tsx\"\n            raw={require('!!raw-loader!../../examples/CustomGroup.tsx')}\n          >\n            <CustomGroup />\n          </ExampleWrapper>\n        )}\n\n        ### GroupHeading\n\n        Component that renders the data of a group.\n\n        See [props docs](/props#groupheading) for more details\n\n        ${(\n          <ExampleWrapper\n            label=\"Custom GroupHeading Example\"\n            urlPath=\"docs/examples/CustomGroupHeading.tsx\"\n            raw={require('!!raw-loader!../../examples/CustomGroupHeading.tsx')}\n          >\n            <CustomGroupHeading />\n          </ExampleWrapper>\n        )}\n\n        ### IndicatorsContainer\n\n        Wraps the indicators. This is one of the two components directly under the\n        control. The indicators that \\`react-select\\` will check to render by are:\n\n        * Clear Indicator\n        * Loading Indicator\n        * Dropdown Indicator\n\n        See [props docs](/props#indicatorscontainer) for more details\n\n        ${(\n          <ExampleWrapper\n            label=\"Custom IndicatorsContainer Example\"\n            urlPath=\"docs/examples/CustomIndicatorsContainer.tsx\"\n            raw={require('!!raw-loader!../../examples/CustomIndicatorsContainer.tsx')}\n          >\n            <CustomIndicatorsContainer />\n          </ExampleWrapper>\n        )}\n\n        ### Indicator Separator\n\n        Component directly to the the inner side of the Dropdown Indicator. By default\n        it is a line to act as a visual separator.\n\n        See [props docs](/props#customindicatorseparator) for more details\n\n        ${(\n          <ExampleWrapper\n            label=\"Custom IndicatorSeparator Example\"\n            urlPath=\"docs/examples/CustomIndicatorSeparator.tsx\"\n            raw={require('!!raw-loader!../../examples/CustomIndicatorSeparator.tsx')}\n          >\n            <CustomIndicatorSeparator />\n          </ExampleWrapper>\n        )}\n\n        ### Input\n\n        Input to render when an input is required. If the select is not searchable,\n        a dummy input is rendered instead. If the select is disabled, a div of the\n        correct size and shape is rendered.\n\n        All provided inputs are given aria attributes to ensure the input is accessible\n        by default.\n\n        See [props docs](/props#input) for more details\n\n        ${(\n          <ExampleWrapper\n            label=\"Custom Input Example\"\n            urlPath=\"docs/examples/CustomInput.tsx\"\n            raw={require('!!raw-loader!../../examples/CustomInput.tsx')}\n          >\n            <CustomInput />\n          </ExampleWrapper>\n        )}\n\n        ### LoadingIndicator\n\n        Loading indicator to be displayed in the Indicators Container when \\`isLoading\\`\n        is true. By default it is three dots.\n\n        See [props docs](/props#loadingindicator) for more details\n\n        ${(\n          <ExampleWrapper\n            label=\"Custom LoadingIndicator Example\"\n            urlPath=\"docs/examples/CustomLoadingIndicator.tsx\"\n            raw={require('!!raw-loader!../../examples/CustomLoadingIndicator.tsx')}\n          >\n            <CustomLoadingIndicator />\n          </ExampleWrapper>\n        )}\n\n        ### Menu\n\n        The wrapper for the dropdown menu in the select. It is responsible for wrapping\n        the menu items. If you want to modify the options themselves, you should use\n        the \\`Option\\` component.\n\n        See [props docs](/props#menu) for more details\n\n        ${(\n          <ExampleWrapper\n            label=\"Custom Menu Example\"\n            urlPath=\"docs/examples/CustomMenu.tsx\"\n            raw={require('!!raw-loader!../../examples/CustomMenu.tsx')}\n          >\n            <CustomMenu />\n          </ExampleWrapper>\n        )}\n\n        ### MenuList\n\n        Inner wrapper for the menu. It directly wraps around the returned options.\n\n        See [props docs](/props#menulist) for more details\n\n        ${(\n          <ExampleWrapper\n            label=\"Custom MenuList Example\"\n            urlPath=\"docs/examples/CustomMenuList.tsx\"\n            raw={require('!!raw-loader!../../examples/CustomMenuList.tsx')}\n          >\n            <CustomMenuList />\n          </ExampleWrapper>\n        )}\n\n        ### LoadingMessage\n\n        Message to display in the menu when there are no options and \\`isLoading\\` is\n        true. By default it is 'Loading...'\n\n        See [props docs](/props#loadingmessage) for more details\n\n        ${(\n          <ExampleWrapper\n            label=\"Custom LoadingMessage Example\"\n            urlPath=\"docs/examples/CustomLoadingMessage.tsx\"\n            raw={require('!!raw-loader!../../examples/CustomLoadingMessage.tsx')}\n          >\n            <CustomLoadingMessage />\n          </ExampleWrapper>\n        )}\n\n        ### NoOptionsMessage\n\n        Message to be displayed in the menu if there are no options passed in.\n\n        See [props docs](/props#nooptionsmessage) for more details\n\n        ${(\n          <ExampleWrapper\n            label=\"Custom NoOptionsMessage Example\"\n            urlPath=\"docs/examples/CustomNoOptionsMessage.tsx\"\n            raw={require('!!raw-loader!../../examples/CustomNoOptionsMessage.tsx')}\n          >\n            <CustomNoOptionsMessage />\n          </ExampleWrapper>\n        )}\n\n        ### MultiValue\n\n        Component used to display a selected option in the input when \\`isMulti\\` is\n        true. Takes responsibility for rendering the \\`MultiValueContainer\\`,\n        \\`MultiValueLabel\\`, and \\`MultiValueRemove\\`.\n\n        ### MultiValueContainer\n\n        Wraps the Label and Remove in a Multi Value\n\n        See [props docs](/props#multivaluecontainer) for more details\n\n        ${(\n          <ExampleWrapper\n            label=\"Custom MultiValueContainer Example\"\n            urlPath=\"docs/examples/CustomMultiValueContainer.tsx\"\n            raw={require('!!raw-loader!../../examples/CustomMultiValueContainer.tsx')}\n          >\n            <CustomMultiValueContainer />\n          </ExampleWrapper>\n        )}\n\n        ### MultiValueLabel\n\n        Receives the value of the option and is responsible for rendering it to the\n        input.\n\n        See [props docs](/props#multivaluelabel) for more details\n\n        ${(\n          <ExampleWrapper\n            label=\"Custom MultiValueLabel Example\"\n            urlPath=\"docs/examples/CustomMultiValueLabel.tsx\"\n            raw={require('!!raw-loader!../../examples/CustomMultiValueLabel.tsx')}\n          >\n            <CustomMultiValueLabel />\n          </ExampleWrapper>\n        )}\n\n\n        ### MultiValueRemove\n\n        Receives an onClick to remove the selected item. By default it is a cross.\n\n        See [props docs](/props#multivalueremove) for more details\n\n        ${(\n          <ExampleWrapper\n            label=\"Custom MultiValueRemove Example\"\n            urlPath=\"docs/examples/CustomMultiValueRemove.tsx\"\n            raw={require('!!raw-loader!../../examples/CustomMultiValueRemove.tsx')}\n          >\n            <CustomMultiValueRemove />\n          </ExampleWrapper>\n        )}\n\n        ### Option\n\n        Component responsible for displaying an option in the menu.\n\n        See [props docs](/props#option) for more details\n\n        ${(\n          <ExampleWrapper\n            label=\"Custom Option Example\"\n            urlPath=\"docs/examples/CustomOption.tsx\"\n            raw={require('!!raw-loader!../../examples/CustomOption.tsx')}\n          >\n            <CustomOption />\n          </ExampleWrapper>\n        )}\n\n\n        ### Placeholder\n\n        Component to be displayed in the input when nothing is selected. By default\n        it is the text 'Select...'\n\n        See [props docs](/props#placeholder) for more details\n\n        ${(\n          <ExampleWrapper\n            label=\"Custom Placeholder Example\"\n            urlPath=\"docs/examples/CustomPlaceholder.tsx\"\n            raw={require('!!raw-loader!../../examples/CustomPlaceholder.tsx')}\n          >\n            <CustomPlaceholder />\n          </ExampleWrapper>\n        )}\n\n        ### SelectContainer\n\n        The wrapper around the entire select component.\n\n        See [props docs](/props#selectcontainer) for more details\n\n        ${(\n          <ExampleWrapper\n            label=\"Custom SelectContainer Example\"\n            urlPath=\"docs/examples/CustomSelectContainer.tsx\"\n            raw={require('!!raw-loader!../../examples/CustomSelectContainer.tsx')}\n          >\n            <CustomSelectContainer />\n          </ExampleWrapper>\n        )}\n\n        ### SingleValue\n\n        The component that displays the selected value in the input for a single select.\n\n        See [props docs](/props#singlevalue) for more details\n\n        ${(\n          <ExampleWrapper\n            label=\"Custom SingleValue Example\"\n            urlPath=\"docs/examples/CustomSingleValue.tsx\"\n            raw={require('!!raw-loader!../../examples/CustomSingleValue.tsx')}\n          >\n            <CustomSingleValue />\n          </ExampleWrapper>\n        )}\n\n        ### ValueContainer\n\n        Container responsible for loading the placeholder value and the input.\n\n        See [props docs](/props#valuecontainer) for more details\n\n        ${(\n          <ExampleWrapper\n            label=\"Custom ValueContainer Example\"\n            urlPath=\"docs/examples/CustomValueContainer.tsx\"\n            raw={require('!!raw-loader!../../examples/CustomValueContainer.tsx')}\n          >\n            <CustomValueContainer />\n          </ExampleWrapper>\n        )}\n      `}\n    </Fragment>\n  );\n}\n"
  },
  {
    "path": "docs/pages/creatable/index.tsx",
    "content": "import React, { Fragment } from 'react';\nimport Helmet from 'react-helmet';\nimport md from '../../markdown/renderer';\nimport ExampleWrapper from '../../ExampleWrapper';\n\nimport {\n  AsyncCreatable,\n  CreatableAdvanced,\n  CreatableInputOnly,\n  CreatableMulti,\n  CreatableSingle,\n} from '../../examples';\n\nexport default function Creatable() {\n  return (\n    <Fragment>\n      <Helmet>\n        <title>Creatable - React Select</title>\n        <meta\n          name=\"description\"\n          content=\"The react-select Creatable Component.\"\n        />\n      </Helmet>\n      {md`\n      # Creatable\n\n      ~~~jsx\n      import Creatable, { useCreatable } from 'react-select/creatable';\n      ~~~\n\n      For the prop definition, please see the API docs [here](/props)\n\n      ${(\n        <ExampleWrapper\n          label=\"Creatable Example\"\n          urlPath=\"docs/examples/CreatableSingle.tsx\"\n          raw={require('!!raw-loader!../../examples/CreatableSingle.tsx')}\n        >\n          <CreatableSingle />\n        </ExampleWrapper>\n      )}\n\n      ${(\n        <ExampleWrapper\n          label=\"Creatable Multiselect Example\"\n          urlPath=\"docs/examples/CreatableMulti.tsx\"\n          raw={require('!!raw-loader!../../examples/CreatableMulti.tsx')}\n        >\n          <CreatableMulti />\n        </ExampleWrapper>\n      )}\n\n      ${(\n        <ExampleWrapper\n          label=\"Advanced Example\"\n          urlPath=\"docs/examples/CreatableAdvanced.tsx\"\n          raw={require('!!raw-loader!../../examples/CreatableAdvanced.tsx')}\n        >\n          <CreatableAdvanced />\n        </ExampleWrapper>\n      )}\n\n      > This example uses the \\`onCreateOption\\` prop to handle new options.\n\n      > To simulate waiting for a back-end service to create a new option, the input is disabled for a second before the new option is added to the list and the value is updated.\n\n      ${(\n        <ExampleWrapper\n          label=\"Async Creatable Example\"\n          urlPath=\"docs/examples/AsyncCreatable.tsx\"\n          raw={require('!!raw-loader!../../examples/AsyncCreatable.tsx')}\n        >\n          <AsyncCreatable />\n        </ExampleWrapper>\n      )}\n\n      > This example uses the combined async + creatable variant, imported from \\`react-select/async-creatable\\`\n\n      ${(\n        <ExampleWrapper\n          label=\"Multi-select text input\"\n          urlPath=\"docs/examples/CreatableInputOnly.tsx\"\n          raw={require('!!raw-loader!../../examples/CreatableInputOnly.tsx')}\n        >\n          <CreatableInputOnly />\n        </ExampleWrapper>\n      )}\n    `}\n    </Fragment>\n  );\n}\n"
  },
  {
    "path": "docs/pages/home/index.tsx",
    "content": "import React from 'react';\nimport ExampleWrapper from '../../ExampleWrapper';\nimport md from '../../markdown/renderer';\nimport {\n  AsyncCallbacks,\n  AsyncPromises,\n  AnimatedMulti,\n  BasicSingle,\n  BasicGrouped,\n  BasicMulti,\n  CreatableSingle,\n  FixedOptions,\n  StyledMulti,\n  StyledSingle,\n} from '../../examples';\n\nexport default function Home() {\n  return md`\n  # Welcome\n\n  Each of the examples below is an interactive example of react-select.\n\n  See the source or open the examples on codesandbox using the buttons that appear when you hover over each select below.\n\n  For complete docs, see the [Props API](/props) and [Advanced Usage](/advanced).\n\n  To contribute, or open an issue, check out the [source code on GitHub](https://github.com/JedWatson/react-select).\n\n  ${(\n    <ExampleWrapper\n      label=\"Single\"\n      urlPath=\"docs/examples/BasicSingle.tsx\"\n      raw={require('!!raw-loader!../../examples/BasicSingle.tsx')}\n    >\n      <BasicSingle />\n    </ExampleWrapper>\n  )}\n\n  ${(\n    <ExampleWrapper\n      label=\"Multi\"\n      urlPath=\"docs/examples/BasicMulti.tsx\"\n      raw={require('!!raw-loader!../../examples/BasicMulti.tsx')}\n    >\n      <BasicMulti />\n    </ExampleWrapper>\n  )}\n\n  ${(<br />)}\n\n  ## Getting Started\n\n  Start by installing \\`react-select\\`\n\n  ~~~bash\n  yarn add react-select\n  ~~~\n\n  or\n\n  ~~~bash\n  npm i --save react-select\n  ~~~\n\n  Import the default export and render in your component:\n\n  ~~~jsx\n  import React from 'react'\n  import Select from 'react-select'\n\n  const options = [\n    { value: 'chocolate', label: 'Chocolate' },\n    { value: 'strawberry', label: 'Strawberry' },\n    { value: 'vanilla', label: 'Vanilla' }\n  ]\n\n  const MyComponent = () => (\n    <Select options={options} />\n  )\n  ~~~\n\n  ${(\n    <ExampleWrapper\n      label=\"Grouped\"\n      urlPath=\"docs/examples/BasicGrouped.tsx\"\n      raw={require('!!raw-loader!../../examples/BasicGrouped.tsx')}\n    >\n      <BasicGrouped />\n    </ExampleWrapper>\n  )}\n\n  ## Animated Components\n\n  React-Select comes with a makeAnimated function that create animated wrappers around components passed in as arguments.\n  If no arguments are passed, built-in components are wrapped instead.\n\n  ~~~jsx\n  import makeAnimated from 'react-select/animated';\n  ~~~\n\n  Remove the values below to see them in action.\n\n  ${(\n    <ExampleWrapper\n      label=\"Animation\"\n      urlPath=\"docs/examples/AnimatedMulti.tsx\"\n      raw={require('!!raw-loader!../../examples/AnimatedMulti.tsx')}\n    >\n      <AnimatedMulti />\n    </ExampleWrapper>\n  )}\n\n  ## Custom Styles\n\n  Style individual components with custom css using the \\`styles\\` prop.\n\n  ${(\n    <ExampleWrapper\n      label=\"Single\"\n      urlPath=\"docs/examples/StyledSingle.tsx\"\n      raw={require('!!raw-loader!../../examples/StyledSingle.tsx')}\n    >\n      <StyledSingle />\n    </ExampleWrapper>\n  )}\n\n  ${(\n    <ExampleWrapper\n      label=\"Multi Select\"\n      urlPath=\"docs/examples/StyledMulti.tsx\"\n      raw={require('!!raw-loader!../../examples/StyledMulti.tsx')}\n    >\n      <StyledMulti />\n    </ExampleWrapper>\n  )}\n\n  You can see a full explanation of how to do this on the [styles](/styles) page.\n\n  # Async\n  Use the Async component to load options from a remote source as the user types.\n\n  ~~~jsx\n  import AsyncSelect from 'react-select/async';\n  ~~~\n\n  ${(\n    <ExampleWrapper\n      label=\"Callbacks\"\n      urlPath=\"docs/examples/AsyncCallbacks.tsx\"\n      raw={require('!!raw-loader!../../examples/AsyncCallbacks.tsx')}\n    >\n      <AsyncCallbacks />\n    </ExampleWrapper>\n  )}\n\n  ${(\n    <ExampleWrapper\n      label=\"Promises\"\n      urlPath=\"docs/examples/AsyncPromises.tsx\"\n      raw={require('!!raw-loader!../../examples/AsyncPromises.tsx')}\n    >\n      <AsyncPromises />\n    </ExampleWrapper>\n  )}\n\n  You can see a full explanation of how to do this on the [async](/async) page.\n\n  # Creatable\n  The Creatable component enables users to create new options along with choosing existing options.\n\n  ~~~jsx\n  import Creatable from 'react-select/creatable';\n  ~~~\n\n  ${(\n    <ExampleWrapper\n      label=\"Creatable Example\"\n      urlPath=\"docs/home/examples/CreatableSingle.tsx\"\n      raw={require('!!raw-loader!../../examples/CreatableSingle.tsx')}\n    >\n      <CreatableSingle />\n    </ExampleWrapper>\n  )}\n\n  You can see a full explanation of how to do this on the [creatable](/creatable) page.\n\n  # Fixed Options\n\n  ${(\n    <ExampleWrapper\n      label=\"Fixed Options Example\"\n      urlPath=\"docs/home/examples/FixedOptions.tsx\"\n      raw={require('!!raw-loader!../../examples/FixedOptions.tsx')}\n    >\n      <FixedOptions />\n    </ExampleWrapper>\n  )}\n`;\n}\n"
  },
  {
    "path": "docs/pages/props/index.tsx",
    "content": "import React, { Fragment } from 'react';\n\nimport { Helmet } from 'react-helmet';\nimport type { MagicalNodeRecord } from '../../generate-magical-types/src/types';\nimport md from '../../markdown/renderer';\n\nimport { metadata, useMagicalNodes, getNodeType } from '../../utils';\nimport { PropTypes } from '@magical-types/pretty';\n\ntype ShowTypesProps = {\n  getNode?: getNodeType;\n  type?: MagicalNodeRecord;\n};\n\nconst ShowTypes = ({ getNode, type }: ShowTypesProps) => {\n  if (!type || !type.index) return null;\n  if (!getNode) return <span>loading</span>;\n\n  return <PropTypes node={getNode(type.index)} />;\n};\n\nexport default function Api() {\n  const getNode = useMagicalNodes();\n  const stateManagerTypes = metadata['stateManager'];\n  const selectTypes = metadata['react-select'];\n  const asyncTypes = metadata['Async'];\n  const creatableTypes = metadata['Creatable'];\n  console.log(stateManagerTypes);\n  return (\n    <Fragment>\n      <Helmet>\n        <title>API - React Select</title>\n        <meta\n          name=\"description\"\n          content=\"The react-select property API documentation.\"\n        />\n      </Helmet>\n      {md`\n    # API\n\n    ## Prop Types\n\n    ### Internal Types\n\n    You'll see these in the public props below:\n\n    ~~~js\n    type OptionType = { [string]: any }\n    type OptionsType = Array<OptionType>\n\n    type GroupType = {\n      [string]: any, // group label\n      options: OptionsType,\n    }\n\n    type ValueType = OptionType | OptionsType | null | void\n\n    type CommonProps = {\n      clearValue: () => void,\n      getStyles: (string, any) => {},\n      getValue: () => ValueType,\n      hasValue: boolean,\n      isMulti: boolean,\n      options: OptionsType,\n      selectOption: OptionType => void,\n      selectProps: any,\n      setValue: (ValueType, ActionTypes) => void,\n      emotion: any,\n    }\n\n    // passed as the second argument to \\`onChange\\`\n    type ActionTypes = | 'clear' | 'create-option' | 'deselect-option' | 'pop-value' | 'remove-value' | 'select-option' | 'set-value'\n    ~~~\n\n    Even when commonProps are not listed in the prop types below, a custom component\n    will still have access to them.\n\n    ## StateManager Props\n\n    The statemanager is a utility class that wraps around the base Select and each Select variant to\n    expose inputValue and value as controllable props. For more detailed information on these props and their usage\n    please see the [controlled props](/advanced#controlled-props) section of the advanced page.\n\n    ${(\n      <ShowTypes\n        getNode={getNode}\n        type={stateManagerTypes?.StateManagerAdditionalProps}\n      />\n    )}\n\n    ## Select Props\n\n    These base props are those available to be passed to all select variants.\n\n    ${(<ShowTypes getNode={getNode} type={selectTypes?.Props} />)}\n\n    ## Async props\n\n    These props are included with in both the Async and AsyncCreatable select. For\n    more on using async selects, see the [async select documentation](/async)\n\n    ${(<ShowTypes getNode={getNode} type={asyncTypes?.AsyncAdditionalProps} />)}\n\n    ## Creatable props\n\n    ${(\n      <ShowTypes\n        getNode={getNode}\n        type={creatableTypes?.CreatableAdditionalProps}\n      />\n    )}\n\n    These props are included with in both the Creatable and AsyncCreatable select. For\n    more on using creatable selects, see the [creatable select documentation](/creatable)\n\n\n    ## Replacing Components\n\n    React-Select allows you to augment layout and functionality by replacing\n    the default components with your own, using the \\`components\\`\n    property. These components are given all the current props and state\n    letting you achieve anything you dream up. For more information in replacing\n    components see [the components documentation](/components)\n\n    ### Inner Ref\n    Some components are passed an innerRef property to facilitate for internally\n    managed behaviour within the base select. This should be assigned to the\n    ref property of the relevant dom element.\n    i.e.\n\n    ~~~\n    const CustomOptionComponent = ({ innerProps, innerRef }) =>\n    (<div ref={innerRef} {...innerProps} />)\n    ~~~\n\n    ### Inner Props\n\n    All functional properties that the component needs are provided in\n    \\`innerProps\\` which you must spread.\n\n    ## Components\n\n    **IMPORTANT NOTE** The below props are provided automatically by \\`react-select\\`\n    when these components are passed into the \\`components\\` object above. Knowing\n    their API is most necessary if you intend to provide your own components, to\n    understand what information they will be handed.\n\n    ### ClearIndicator\n\n    ${(<ShowTypes getNode={getNode} type={selectTypes?.ClearIndicatorProps} />)}\n\n    ### Control\n\n    ${(<ShowTypes getNode={getNode} type={selectTypes?.ControlProps} />)}\n    ### DropdownIndicator\n\n    ${(\n      <ShowTypes getNode={getNode} type={selectTypes?.DropdownIndicatorProps} />\n    )}\n\n    ### Group\n\n    ${(<ShowTypes getNode={getNode} type={selectTypes?.GroupProps} />)}\n\n    ### GroupHeading\n\n    Group Heading can be any component.\n\n    ### IndicatorsContainer\n\n    ${(\n      <ShowTypes\n        getNode={getNode}\n        type={selectTypes?.IndicatorsContainerProps}\n      />\n    )}\n\n    ### IndicatorSeparator\n\n    ${(\n      <ShowTypes\n        getNode={getNode}\n        type={selectTypes?.IndicatorSeparatorProps}\n      />\n    )}\n\n    ### Input\n\n    ${(<ShowTypes getNode={getNode} type={selectTypes?.InputProps} />)}\n\n    ### LoadingIndicator\n\n    ${(\n      <ShowTypes getNode={getNode} type={selectTypes?.LoadingIndicatorProps} />\n    )}\n\n    ### Menu\n\n    ${(<ShowTypes getNode={getNode} type={selectTypes?.MenuProps} />)}\n\n    ### MenuList\n\n    ${(<ShowTypes getNode={getNode} type={selectTypes?.MenuListProps} />)}\n\n    ### LoadingMessage\n\n    ${(<ShowTypes getNode={getNode} type={selectTypes?.NoticeProps} />)}\n\n    ### NoOptionsMessage\n\n    ${(<ShowTypes getNode={getNode} type={selectTypes?.NoticeProps} />)}\n\n    ### MultiValue\n\n    ${(<ShowTypes getNode={getNode} type={selectTypes?.MultiValueProps} />)}\n\n    ### MultiValueContainer\n\n    ${(\n      <ShowTypes getNode={getNode} type={selectTypes?.MultiValueGenericProps} />\n    )}\n\n    ### MultiValueLabel\n\n    ${(\n      <ShowTypes getNode={getNode} type={selectTypes?.MultiValueGenericProps} />\n    )}\n\n    ### MultiValueRemove\n\n    ${(\n      <ShowTypes getNode={getNode} type={selectTypes?.MultiValueRemoveProps} />\n    )}\n\n    ### Option\n\n    ${(<ShowTypes getNode={getNode} type={selectTypes?.OptionProps} />)}\n\n    ### Placeholder\n\n    ${(<ShowTypes getNode={getNode} type={selectTypes?.PlaceholderProps} />)}\n\n    ### SelectContainer\n\n    ${(<ShowTypes getNode={getNode} type={selectTypes?.ContainerProps} />)}\n\n    ### SingleValue\n\n    ${(<ShowTypes getNode={getNode} type={selectTypes?.SingleValueProps} />)}\n\n    ### ValueContainer\n\n    ${(<ShowTypes getNode={getNode} type={selectTypes?.ValueContainerProps} />)}\n\n\n        `}\n    </Fragment>\n  );\n}\n"
  },
  {
    "path": "docs/pages/styles/index.tsx",
    "content": "/** @jsx jsx */\nimport React, { Fragment } from 'react';\nimport { jsx } from '@emotion/react';\nimport Helmet from 'react-helmet';\nimport md from '../../markdown/renderer';\nimport ExampleWrapper from '../../ExampleWrapper';\nimport {\n  StyledSingle,\n  StyledMulti,\n  Theme,\n  StyleCompositionExample,\n} from '../../examples';\nimport { ColorSample } from '../../styled-components';\nimport { defaultTheme } from 'react-select';\n\nexport default function Styles() {\n  return (\n    <Fragment>\n      <Helmet>\n        <title>Styles - React Select</title>\n        <meta\n          name=\"description\"\n          content=\"React-Select offers a flexible, light-weight styling framework which is a thin abstraction over simple javascript objects\"\n        />\n      </Helmet>\n      {md`\n    # Styles\n\n    React Select offers 3 main APIs for styling:\n\n    - [The styles prop](#the-styles-prop)\n    - [The classNames prop](#the-classnames-prop)\n    - [The classNamePrefix prop](#the-classnameprefix-prop)\n\n    ## The styles prop\n\n    The recommended way to provide custom styles to \\`react-select\\` is to use the \\`styles\\` prop.\n    \\`styles\\` takes an object with keys to represent the various [inner components](#inner-components) that \\`react-select\\` is made up of.\n    Each inner component takes a callback function with the following signature:\n\n    ~~~jsx\n    <Select\n      styles={{\n        control: (baseStyles, state) => ({\n          ...baseStyles,\n          borderColor: state.isFocused ? 'grey' : 'red',\n        }),\n      }}\n    />\n    ~~~\n\n    The first argument is an object with the base styles. Spreading the base styles into your returned object lets you extend it however you like while maintaining existing styles. Alternatively, you can omit the provided styles and completely take control of the component's styles.\n\n    The second argument is the current state (features like \\`isFocused\\`, \\`isSelected\\` etc). This allows you to implement dynamic styles for each of the components.\n\n    ## The classNames prop\n\n    As of version \\`5.7.0\\` of \\`react-select\\` you can now use the \\`classNames\\` prop for styling. Note: this is not to be confused with the \\`className\\` prop, which will add a class to the component.\n\n    \\`classNames\\` takes an object with keys to represent the various [inner components](#inner-components) that \\`react-select\\` is made up of.\n    Each inner component takes a callback function with the following signature:\n\n    ~~~jsx\n    <Select\n      classNames={{\n        control: (state) =>\n          state.isFocused ? 'border-red-600' : 'border-grey-300',\n      }}\n    />\n    ~~~\n\n    ### Note on CSS specificity\n\n    If you are using the \\`classNames\\` API and you are trying to override some base styles with the same level of specificity, you must ensure that your provided styles are declared later than the styles from React Select (e.g. the \\`link\\` or \\`style\\` tag in the head of your HTML document) in order for them to take precedence.\n\n    For an example on how you might want to do this, see the [Storybook example here](https://github.com/JedWatson/react-select/blob/master/storybook/stories/ClassNamesWithTailwind.stories.tsx).\n\n    ## The unstyled prop\n\n    If you are trying to style everything from scratch you can use the \\`unstyled\\` prop. This removes all the presentational styles from React Select (leaving some important functional styles, like those for menu positioning and input width in multi select).\n\n    This will make it easier to completely specify your own \\`styles\\` _or_ \\`classNames\\` to control the look of React Select, without having to specifically override the default theme we apply.\n\n    ## Inner components\n\n    <details>\n      <summary>See list of keys for all of React Select's inner components</summary>\n      <ul>\n        <li>clearIndicator</li>\n        <li>container</li>\n        <li>control</li>\n        <li>dropdownIndicator</li>\n        <li>group</li>\n        <li>groupHeading</li>\n        <li>indicatorsContainer</li>\n        <li>indicatorSeparator</li>\n        <li>input</li>\n        <li>loadingIndicator</li>\n        <li>loadingMessage</li>\n        <li>menu</li>\n        <li>menuList</li>\n        <li>menuPortal</li>\n        <li>multiValue</li>\n        <li>multiValueLabel</li>\n        <li>multiValueRemove</li>\n        <li>noOptionsMessage</li>\n        <li>option</li>\n        <li>placeholder</li>\n        <li>singleValue</li>\n        <li>valueContainer</li>\n      </ul>\n    </details>\n\n    ## The classNamePrefix prop\n\n    If you provide the \\`classNamePrefix\\` prop to React Select, all inner elements will be given a className with the provided prefix.\n\n    Given the following JSX:\n\n    ~~~jsx\n    <Select\n      {...props}\n      className=\"react-select-container\"\n      classNamePrefix=\"react-select\"\n    />\n    ~~~\n\n    ...the DOM structure is similar to this:\n\n    ~~~html\n    <div class=\"react-select-container\">\n      <div class=\"react-select__control\">\n        <div class=\"react-select__value-container\">...</div>\n        <div class=\"react-select__indicators\">...</div>\n      </div>\n      <div class=\"react-select__menu\">\n        <div class=\"react-select__menu-list\">\n          <div class=\"react-select__option\">...</div>\n        </div>\n      </div>\n    </div>\n    ~~~\n\n    ## Select props\n\n    In the \\`state\\` argument for both the \\`styles\\` and \\`classNames\\` API, you have access to \\`selectProps\\` which will allow you to gain access to your own arguments passed into the Select body.\n\n\n\n\n\n    ## cx and custom Components\n\n    In the event that you need to rewrite a particular component, you'll also have to compose together the styling functionality.\n    Thankfully all the requisite parts are supplied to you via props as below:\n\n    ### cx\n    cx is an internal utility function that manages the composition of emotion style declarations, className/classNamePrefixes and\n    additional BEM style modifiers into a selector value for each component.\n    It has the following signature:\n\n    ~~~\n    (prefix ?: string,\n      cssKey?: string,\n      state?: {},\n      className?: string) => string\n    ~~~\n\n    * prefix: is the value of the optional classNamePrefix,\n    * cssKey: is the uid generated by the invocation of the css method imported from emotion\n    * state: an object declaring state based modifiers to be applied to our selector\n    * className: any className prop specified for custom components will also be composed into the selector string produced by the cx functions\n\n    ### getStyles\n    Each component gets passed a getStyles method which has the following signature:\n\n    ~~~\n    (key: string, props: Object) => stylesObject;\n    ~~~\n\n    The key is a lowercased string value corresponding to the component that the styles apply to,\n    i.e. option for the Option component, menuplacer for the MenuPlacer component.\n\n    The props argument is an object of relevant properties/ state values that are relevant to computing styles,\n    i.e. isFocused or isSelected. Additional props can be added here for computation using the styles api.\n\n    In the end configuring your custom component with the correct styling functionality should look like this\n    ~~~\n    import { css } from 'emotion';\n\n    const CustomOption = ({ cx, children, getStyles, innerRef, ...props }) => (\n      <div\n        ref={innerRef}\n        className={cx(\n          css(getStyles('option', props)),\n          {\n            'option': true,\n            'option--is-disabled': isDisabled,\n            'option--is-focused': isFocused,\n            'option--is-selected': isSelected,\n          }\n        )}\n      >\n        {children}\n      </div>\n    )\n    ~~~\n\n    ${(\n      <ExampleWrapper\n        label=\"Style composition for custom components\"\n        urlPath=\"docs/examples/StyleCompositionExample.tsx\"\n        raw={require('!!raw-loader!../../examples/StyleCompositionExample.tsx')}\n      >\n        <StyleCompositionExample />\n      </ExampleWrapper>\n    )}\n\n    ## Overriding the theme\n\n    The default styles are derived from a theme object, which you can mutate like \\`styles\\`.\n\n    The \\`theme\\` object is available for the \\`styles\\` functions as well.\n\n    ${(\n      <ExampleWrapper\n        label=\"Customised theme\"\n        urlPath=\"docs/examples/Theme.tsx\"\n        raw={require('!!raw-loader!../../examples/Theme.tsx')}\n      >\n        <Theme />\n      </ExampleWrapper>\n    )}\n\n    ###### Theme colors\n\n    ${(\n      <div css={{ marginTop: '1em' }}>\n        {Object.keys(defaultTheme.colors).map((key) => (\n          <ColorSample\n            key={key}\n            name={key}\n            color={defaultTheme.colors[key as keyof typeof defaultTheme.colors]}\n          />\n        ))}\n      </div>\n    )}\n\n    ## Examples\n\n      ${(\n        <ExampleWrapper\n          label=\"Customised Styles for Single Select\"\n          urlPath=\"docs/examples/StyledSingle.tsx\"\n          raw={require('!!raw-loader!../../examples/StyledSingle.tsx')}\n        >\n          <StyledSingle />\n        </ExampleWrapper>\n      )}\n\n      ${(\n        <ExampleWrapper\n          label=\"Customised styles for Multi Select\"\n          urlPath=\"docs/examples/StyledMulti.tsx\"\n          raw={require('!!raw-loader!../../examples/StyledMulti.tsx')}\n        >\n          <StyledMulti />\n        </ExampleWrapper>\n      )}\n\n    `}\n    </Fragment>\n  );\n}\n"
  },
  {
    "path": "docs/pages/typescript/index.tsx",
    "content": "import React from 'react';\nimport Helmet from 'react-helmet';\nimport md from '../../markdown/renderer';\n\nexport default function TypeScript() {\n  return (\n    <>\n      <Helmet>\n        <title>TypeScript - React Select</title>\n        <meta\n          name=\"description\"\n          content=\"React-Select offers a flexible, light-weight styling framework which is a thin abstraction over simple javascript objects\"\n        />\n      </Helmet>\n      {md`\n# TypeScript usage\n\n## Select generics\n\nThere are three generics used by the \\`Select\\` component: \\`Option\\`, \\`IsMulti\\`, and \\`Group\\`. All of them are optional and TypeScript attempts to detect them automatically, but sometimes it might need some help. Many of the \\`react-select\\` types include the three generics like this:\n\n~~~jsx\ninterface SelectProps<\n  Option = unknown,\n  IsMulti extends boolean = false,\n  Group extends GroupBase<Option> = GroupBase<Option>\n> {\n ...\n}\n~~~\n\n### \\`Option = unknown\\`\n\nThis is the type of the option passed into the \\`options\\` prop (or the \\`options\\` property on groups). If TypeScript can't detect what type this should be, it defaults to \\`unknown\\`. This generic comes in handy for correctly typing callbacks like \\`filterOption\\`, \\`formatOptionLabel\\`, \\`getOptionLabel\\`, \\`getOptionValue\\`, \\`isOptionDisabled\\`, \\`isOptionSelected\\`, \\`onChange\\`, etc.\n\n### \\`IsMulti extends boolean = false\\`\n\nThis type is \\`false\\` for single-selects and is \\`true\\` for multi-selects. It defaults to \\`false\\` for the exported components because TypeScript isn't smart enough to figure out that it should be \\`false\\` if the \\`isMulti\\` prop is not specified, but on other exported interfaces it defaults to \\`boolean\\` so that it handles both single-select and multi-select values. This generic is primarily used to determine the type of the first argument passed to \\`onChange\\` which will be \\`Option | null\\` if \\`IsMulti\\` is \\`false\\` and will be \\`readonly Option[]\\` if \\`IsMulti\\` is \\`true\\`.\n\n### \\`Group extends GroupBase<Option> = GroupBase<Option>\\`\n\nThis generic is the type for the groups that are passed into the \\`options\\` when using groups. The \\`GroupBase\\` type is:\n\n~~~jsx\ninterface GroupBase<Option> {\n  readonly options: readonly Option[];\n  readonly label?: string;\n}\n~~~\n\nThis generic comes in handy when trying to type the \\`formatGroupLabel\\` prop.\n\n### Wrapping the \\`Select\\` component\n\nOftentimes the \\`Select\\` component is wrapped in another component that is used throughout an app and the wrapper should be just as flexible as the original \\`Select\\` component (i.e., allow for different \\`Option\\` types, groups, single-select, or multi-select). In order to provide this flexibility, the wrapping component should re-declare the generics and forward them to the underlying \\`Select\\`. Here is an example of how to do that:\n\n~~~jsx\nfunction CustomSelect<\n  Option,\n  IsMulti extends boolean = false,\n  Group extends GroupBase<Option> = GroupBase<Option>\n>(props: Props<Option, IsMulti, Group>) {\n  return (\n    <Select {...props} theme={(theme) => ({ ...theme, borderRadius: 0 })} />\n  );\n}\n~~~\n\n## onChange\n\nIf you have a single-select you can type \\`onChange\\` like this:\n\n~~~jsx\nconst onChange = (option: Option | null, actionMeta: ActionMeta<Option>) => {\n   ...\n}\n~~~\n\nIf you have a multi-select you can type \\`onChange\\` like this:\n\n~~~jsx\nconst onChange = (option: readonly Option[], actionMeta: ActionMeta<Option>) => {\n   ...\n}\n~~~\n\nThe \\`actionMeta\\` parameter is optional. \\`ActionMeta\\` is a union that is discriminated on the \\`action\\` type. Take a look at [types.ts](https://github.com/JedWatson/react-select/blob/master/packages/react-select/src/types.ts) in the source code to see its full definition.\n\n## Custom Select props\n\nYou can use module augmentation to add custom props to the \\`Select\\` prop types:\n\n~~~jsx\nimport type {} from 'react-select/base';\n// This import is necessary for module augmentation.\n// It allows us to extend the 'Props' interface in the 'react-select/base' module\n// and add our custom property 'myCustomProp' to it.\n\ndeclare module 'react-select/base' {\n  export interface Props<\n    Option,\n    IsMulti extends boolean,\n    Group extends GroupBase<Option>\n  > {\n    myCustomProp: string;\n  }\n}\n~~~\n\nThis will make the custom prop available both when using the \\`Select\\` component as well as when accessing \\`selectProps\\` when [customising components](./components).\n      `}\n    </>\n  );\n}\n"
  },
  {
    "path": "docs/pages/upgrade/index.tsx",
    "content": "import React from 'react';\nimport Helmet from 'react-helmet';\nimport md from '../../markdown/renderer';\nimport { Cell, Header, Table } from '../../Table';\n\nexport default function Upgrade() {\n  return (\n    <>\n      <Helmet>\n        <title>{'React Select Upgrade Guide'}</title>\n        <meta name=\"description\" content=\"React-select Upgrade Guide\" />\n      </Helmet>\n      <>\n        {md`\n# Upgrade guide\n\n## From v4 to v5\n\n### Summary\n\n- Convert to TypeScript - TypeScript types now come packaged with \\`react-select\\` so you no longer need to have \\`@types/react-select\\` installed; we no longer include Flow types\n- Drop IE11 support - this allows us to make changes to our CSS that we've wanted to make for a long time as well as remove unnecessary JS solutions (those changes are noted below)\n- Use \\`forwardRef\\` for all wrapped components - this means that if you were accessing anything on the \\`Select\\` instance using a \\`ref\\`, the \\`ref\\` will now reference the internal \\`Select\\` directly (see below for how to upgrade)\n- Replace HOCs with hooks - if you were using our HOCs to create custom \\`Select\\`s (i.e., \\`makeCreatableSelect\\`, \\`manageState\\`, \\`makeAsyncSelect\\`) these have now been replaced by hooks (i.e., \\`useCreatable\\`, \\`useStateManager\\`, \\`useAsync\\`)\n- Remove dependency on [AutosizeInput](https://github.com/JedWatson/react-input-autosize) - our new solution uses CSS grid which IE11 does not fully support; also \\`.prefix__input\\` now targets the input and NOT the container\n- Improve screen reader experience - this isn't a breaking change in the API but it does change the screen reader announcements\n- Use CSS grid for single value layout - this also isn't a breaking change in the API but is it a change in the styles since it switches to using CSS grid (not fully supported by IE11) for single-value \\`Select\\`s\n- Remove \\`readonly\\` attribute on our \\`DummyInput\\` - this results in better accessibility but uses \\`caret-color\\` which is not available on IE11\n\n### Details\n\n#### Convert to TypeScript\n\nWe've rewritten \\`react-select\\` in TypeScript which means you can remove any dependencies on \\`@types/react-select\\`. If you were using the Flow types than look into contributing types for v5 to \\`flow-typed\\`.\n\nHere are the most notable changes when replacing \\`@types/react-select\\` with our packaged types:\n        `}\n        <TypesReplacementTable />\n        <br />\n        {md`\nIf you were previously importing a type from the \\`src\\` directory when using \\`@types/react-select\\`:\n\n~~~jsx\nimport { ... } from 'react-select/src/...';\n~~~\n\nThese should now be imported from the \\`dist/declarations/src\\` directory:\n\n~~~jsx\nimport { ... } from 'react-select/dist/declarations/src/...';\n~~~\n\nWe export any types from the main entry point that we think might be useful to the user. If you are using a type that is not exported from the main entry point please open a PR or issue so that we can add it.\n\nIf you are using custom props for the \\`Select\\` component you can use module augmentation to add them to the \\`Select\\` prop types:\n\n~~~jsx\ndeclare module 'react-select/dist/declarations/src/Select' {\n  export interface Props<\n    Option,\n    IsMulti extends boolean,\n    Group extends GroupBase<Option>\n  > {\n    myCustomProp: string;\n  }\n}\n~~~\n\n#### Drop IE11 support\n\nThis allows us to use modern CSS in order to improve the quality of \\`react-select\\` and remove excessive JavaScript code to work around not having the ability to use modern CSS. If you need IE11 support either:\n\n1.  Stay on v4.\n2.  Attempt to use our [Styles API](./styles) and/or [Components API](./components) to override styles and/or components that don't support IE11. The only change that might be hard to override is \"Remove \\`readonly\\` attribute on our \\`DummyInput\\`\" since you can't override the \\`DummyInput\\` component with the Styles or Components API.\n3.  If there are simple changes that make \\`react-select\\` compatible with IE11, open a PR. We are unlikely to provide official support for IE11 since supporting IE11 makes maintaining \\`react-select\\` a lot more difficult and holds us back from changes we want to make, but we also are glad to accept simple changes if they make your life easier.\n\n#### Use \\`forwardRef\\` for all wrapped components\n\nNOTE: Accessing any of the internals of the \\`Select\\` component using \\`ref\\`s is not part of our public API. The internals of the \\`Select\\` component can change at any time (including in minor and patch releases). The only methods on the \\`Select\\` component that are part of the public API are the \\`focus()\\` and \\`blur()\\` methods.\n\n\\`react-select\\` exports five components: \\`BaseSelect\\`, \\`CreatableSelect\\`, \\`Select\\` (the default export), \\`AsyncSelect\\`, \\`AsyncCreatableSelect\\`. The last four components are wrappers around the \\`BaseSelect\\`. Previously the \\`ref\\` for each of these components was pointing to itself, but now we use \\`forwardRef\\` which means that the \\`ref\\`s for all five components now point to \\`BaseSelect\\`.\n\nThe \\`focus()\\` and \\`blur()\\` methods are untouched by this change. However if you were accessing the internals of the \\`BaseSelect\\` component, you will need to update how you were accessing the \\`BaseSelect\\`. Here is how to update access to the \\`BaseSelect\\` component:\n        `}\n        <RefReplacementTable />\n        <br />\n        {md`\n#### Replace HOCs with hooks\n\nThe primary reason for this change is that hooks combined with generic components are easier to type in TypeScript than HOCs combined with generic components. These HOCs/hooks are considered advanced usage.\n\nIf you were using the HOCs, it shouldn't be too hard to replace them with its corresponding hook (i.e., \\`useStateManager\\`, \\`useCreatable\\`, or \\`useAsync\\`). As an example, here is how the state managed Select (the default export) used to be constructed with the \\`manageState\\` HOC:\n\n~~~jsx\nconst Select = manageState(SelectBase);\n~~~\n\nWith hooks it is now constructed like this:\n\n~~~jsx\nconst Select = (props) => {\n  const baseSelectProps = useStateManager(props);\n  return <SelectBase {...baseSelectProps} />;\n};\n~~~\n\nConsult the source code for how the other components are constructed.\n\n#### Remove dependency on AutosizeInput\n\nThis is an exciting change because we get to drop a dependency on \\`react-input-autosize\\`. We now use a pure CSS solution to auto-size the input, however this means that we have to drop support for IE11 since IE11 does not fully support CSS grid. As part of this refactor the \\`.prefix__input\\` CSS class now targets the input itself and NOT the container. See [#4625](https://github.com/JedWatson/react-select/pull/4625) for more details.\n\n#### Improve screen reader experience\n\nThe following improvements have been made for screen reader users:\n\n- NVDA now announces the context text when initially focused\n- Selected option(s) (single and multi) are now announced when initially focused\n- VoiceOver now announces the context text when re-focusing\n- The clear action is now announced\n- Placeholder text is now announced\n- Mobile VoiceOver is now able to remove selected multi options\n\nAlso we've added the role of combobox and the required ARIA attributes to the \\`Input\\` and \\`DummyInput\\` components to allow JAWS support and a better screen reader experience overall. See [#4695](https://github.com/JedWatson/react-select/issues/4695) for more details.\n\n#### Use CSS grid for single value layout\n\nPreviously the absolution positioning of both the value and the placeholder pulled them out of the flow, and thus the component itself collapsed down when used as a flex child. To solve this we are now using CSS grid for the single value layout.\n\n<img width=\"593\" alt=\"before-after\" src=\"https://user-images.githubusercontent.com/157960/129303649-73afd0dc-5d11-4c7d-b39b-42fa18c1b1f9.png\">\n\n### Remove \\`readonly\\` attribute on our \\`DummyInput\\`\n\nPreviously we added the \\`readonly\\` attribute to the \\`DummyInput\\` (when \\`isSearchable\\` is set to \\`false\\`) in order to hide the flashing cursor and prevent devices from showing a virtual keyboard. However the \\`readonly\\` attribute causes the \\`DummyInput\\` to be removed from the tab order in iOS Safari. In order to solve this we're replacing the \\`readonly\\` attribute with setting the \\`caret-color\\` CSS prop (which IE11 does not support) to \\`transparent\\` and setting the \\`inputMode\\` attribute on the \\`<input>\\` to \\`none\\`.\n\n## From v3 to v4\n\n### Summary\n\n- Standardize value passed to \\`onChange\\` - the \\`onChange\\` handler is now always passed an array of options if \\`isMulti\\` is set to \\`true\\`\n- Emotion 11 - should only affect you if you're using the \\`NonceProvider\\` component\n- Remove usage of UNSAFE React methods - shouldn't affect you except now you won't see those warning messages in the console anymore\n\n### Details\n\n#### Standardize value passed to \\`onChange\\`\n\nThis change makes it so that the first parameter passed to the \\`onChange\\` callback will now always be an array of options if \\`isMulti\\` is set to \\`true\\` and will always be a single option or \\`null\\` if \\`isMulti\\` is set to \\`false\\`. Previously the first parameter of \\`onChange\\` could be an array _or_ \\`null\\` when \\`isMulti\\` was set to \\`true\\`.\n\nThat means if you were previously using nullish coalescing in order to handle \\`null\\` for \\`isMulti\\` like this:\n\n~~~jsx\n<Select isMulti onChange={(newValues) => setValues(newValues ?? [])} />\n~~~\n\nYou can now remove the nullish coalescing because \\`onChange\\` will always be an array when \\`isMulti\\` is set to \\`true\\`:\n\n~~~jsx\n<Select isMulti onChange={(newValues) => setValues(newValues)} />\n~~~\n\n#### Emotion 11\n\nThe \\`NonceProvider\\` component now requires a \\`cacheKey\\` prop that corresponds to the [newly required \\`key\\` prop](https://emotion.sh/docs/emotion-11#emotions-caches) for the Emotion cache. This won't affect you if you aren't using \\`NonceProvider\\`. See [#4283](https://github.com/JedWatson/react-select/pull/4283) for more details.\n\n#### Remove usage of UNSAFE React methods\n\nThis isn't necessarily a breaking change, but it required a large refactor in order to accomplish so we released this in a major upgrade in case it has some unintended consequences.\n\n## From v2 to v3\n\nThe core motivation behind 3.0.0 is to set us up to leverage new tools to make react-select better. As such we've made the following changes:\n\n### Breaking Changes\n\n- Upgrade from Emotion 9 to Emotion 10\n- Multiple Entrypoints\n- UMD builds deprecated\n- React 16.8 required as peer dependencies\n- Normalized Values [#3416](https://github.com/JedWatson/react-select/pull/3416)\n\n### What this means for you\n\n#### Emotion 10\n\nMoving to the latest major version of emotion affords us zero-config SSR and enabling easier CSP support. Unfortunately this will be a breaking change for consumers who are currently leveraging emotion to build custom components for react-select. For example, you'd previously create an custom Option component with emotion like so:\n\n~~~jsx\nimport { css } from 'emotion'\n\nconst customOption = ({ cx, className, getStyles, _ }) =>\n  <div\n     classNames={cx(\n       css(getStyles('option', props)),\n       {\n         'option': true,\n         'option--is-disabled': isDisabled,\n         'option--is-focused': isFocused,\n         'option--is-selected': isSelected,\n        },\n        className\n     )}\n     {...}\n  >\n~~~\n\nWith react-select 3.0.0, and emotion 10 it would be the following:\n\n~~~jsx\n/** @jsx jsx */\nimport { jsx } from '@emotion/core';\n\nconst customOption = ({ cx, className, getStyles, _ }) =>\n  <div\n    css={getStyles('option', props)}\n    classNames={cx(\n     {\n       'option': true,\n       'option--is-disabled': isDisabled,\n       'option--is-focused': isFocused,\n       'option--is-selected': isSelected,\n      },\n      className\n    )}\n    {...}\n  >\n~~~\n\n#### Multiple Entrypoints:\n\nv3.0.0 separates removes the following components from the main entry point, and instead exports them as separate entrypoints:\n\n- Async (now exported from react-select/async)\n- Creatable (now exported from react-select/creatable)\n- Async Creatable (now exported from react-select/async-creatable)\n- makeAnimated and default animated components (now exported from react-select/animated)\n\nWhere you’d previously import them as such\n\n~~~jsx\n\\timport { Async } from 'react-select'\n~~~\n\nOr as:\n\n~~~jsx\n\\timport Async from 'react-select/lib/Async'\n~~~\n\nNow imports look like this:\n\n~~~jsx\n\\timport AsyncSelect from 'react-select/async'\n~~~\n\nThis should have no bundle-size impact on react-select consumers currently leveraging tree-shaking. However for consumers who aren’t leveraging tree-shaking, this should help alleviate some of the bundle-weight.\n\n#### UMD Builds\n\nUMD builds have been removed as of react-select v3.\n\n#### Peer dependency on React 16.8\n\nWe've decided on requiring 16.8 as a peer dependency for react-select 3.0.0. This is motivated by our commitment to leveraging the improvements in recent versions of React such as hooks to make react-select even better.\n\n#### Normalized Values\n\nAt the moment, if no value is specified by the consumer, it's instantiated as a null value, regardless of whether the select isMulti or not.\n\nWhen isMulti is false this is fine. On selection of an option, the value becomes an object, and on clearing of said value, it returns to being null. \\`(null --> {} --> null)\\`\n\nHowever when isMulti is true, this becomes more inconsistent. On selection of options, the value becomes an array of options, removing values extricates them from this array, removing the last selected value results in an empty array, instead of the initial base state of null.\n\\`(null --> [{}] --> [])\\`\n\nWe rectify this in 3.0.0, on removal of _all_ selected values in an isMulti Select, the value passed to onChange is \\`null\\` and not \\`[]\\`.\n<img src=\"https://i.imgur.com/bPVpQjV.gif\" alt=\"normalize-value\" width=\"550\" />\n\n## From v1 to v2\n\nYou can find the v2 upgrade guide [here](./upgrade-to-v2).\n        `}\n      </>\n    </>\n  );\n}\n\nconst TypesReplacementTable = () => (\n  <Table>\n    <thead>\n      <tr>\n        <Header>@types/react-select</Header>\n        <Header>react-select</Header>\n        <Header>Notes</Header>\n      </tr>\n    </thead>\n    <tbody>\n      <tr>\n        <Cell>{md`\n\\`OptionTypeBase\\`\n        `}</Cell>\n        <Cell>no replacement</Cell>\n        <Cell>{md`\nOptions can be any type (if using \\`getOptionValue\\` and \\`getOptionLabel\\`) so there's no longer a base type for options\n        `}</Cell>\n      </tr>\n      <tr>\n        <Cell>{md`\n\\`OptionsType\\`\n        `}</Cell>\n        <Cell>{md`\n\\`Options\\`\n        `}</Cell>\n        <Cell />\n      </tr>\n      <tr>\n        <Cell>{md`\n\\`GroupTypeBase\\`\n        `}</Cell>\n        <Cell>{md`\n\\`GroupBase\\`\n        `}</Cell>\n        <Cell />\n      </tr>\n      <tr>\n        <Cell>{md`\n\\`GroupedOptionsType\\`\n        `}</Cell>\n        <Cell>no replacement</Cell>\n        <Cell>{md`\nThis is equivalent to \\`ReadonlyArray<Group>\\`\n        `}</Cell>\n      </tr>\n      <tr>\n        <Cell>{md`\n\\`ValueType\\`\n        `}</Cell>\n        <Cell>{md`\n\\`OnChangeValue\\`\n        `}</Cell>\n        <Cell />\n      </tr>\n      <tr>\n        <Cell>{md`\n\\`InputActionTypes\\`\n        `}</Cell>\n        <Cell>{md`\n\\`InputAction\\`\n        `}</Cell>\n        <Cell />\n      </tr>\n      <tr>\n        <Cell>{md`\n\\`NamedProps\\`\n        `}</Cell>\n        <Cell>{md`\n\\`Props\\`\n        `}</Cell>\n        <Cell />\n      </tr>\n      <tr>\n        <Cell>{md`\n\\`Select\\` (the \\`ref\\` type)\n        `}</Cell>\n        <Cell>{md`\n\\`SelectInstance\\`\n        `}</Cell>\n        <Cell>{md`\nSee \"Use \\`forwardRef\\` for all wrapped components\" for more details\n        `}</Cell>\n      </tr>\n      <tr>\n        <Cell>{md`\n\\`AsyncSelect\\` (the \\`ref\\` type)\n        `}</Cell>\n        <Cell>{md`\n\\`SelectInstance\\`\n        `}</Cell>\n        <Cell>{md`\nSee \"Use \\`forwardRef\\` for all wrapped components\" for more details\n        `}</Cell>\n      </tr>\n      <tr>\n        <Cell>{md`\n\\`CreatableSelect\\` (the \\`ref\\` type)\n        `}</Cell>\n        <Cell>{md`\n\\`SelectInstance\\`\n        `}</Cell>\n        <Cell>{md`\nSee \"Use \\`forwardRef\\` for all wrapped components\" for more details\n        `}</Cell>\n      </tr>\n      <tr>\n        <Cell>{md`\n\\`AsyncCreatableSelect\\` (the \\`ref\\` type)\n        `}</Cell>\n        <Cell>{md`\n\\`SelectInstance\\`\n        `}</Cell>\n        <Cell>{md`\nSee \"Use \\`forwardRef\\` for all wrapped components\" for more details\n        `}</Cell>\n      </tr>\n    </tbody>\n  </Table>\n);\n\nconst RefReplacementTable = () => (\n  <Table>\n    <thead>\n      <tr>\n        <Header>Component</Header>\n        <Header>v4</Header>\n        <Header>v5</Header>\n      </tr>\n    </thead>\n    <tbody>\n      <tr>\n        <Cell>{md`\n\\`BaseSelect\\`\n        `}</Cell>\n        <Cell>{md`\n\\`ref\\`\n        `}</Cell>\n        <Cell>{md`\n\\`ref\\`\n        `}</Cell>\n      </tr>\n      <tr>\n        <Cell>{md`\n\\`CreatableSelect\\`\n        `}</Cell>\n        <Cell>{md`\n\\`ref.select.select\\`\n        `}</Cell>\n        <Cell>{md`\n\\`ref\\`\n        `}</Cell>\n      </tr>\n      <tr>\n        <Cell>{md`\n\\`Select\\`\n        `}</Cell>\n        <Cell>{md`\n\\`ref.select\\`\n        `}</Cell>\n        <Cell>{md`\n\\`ref\\`\n        `}</Cell>\n      </tr>\n      <tr>\n        <Cell>{md`\n\\`AsyncSelect\\`\n        `}</Cell>\n        <Cell>{md`\n\\`ref.select.select\\`\n        `}</Cell>\n        <Cell>{md`\n\\`ref\\`\n        `}</Cell>\n      </tr>\n      <tr>\n        <Cell>{md`\n\\`AsyncCreatableSelect\\`\n        `}</Cell>\n        <Cell>{md`\n\\`ref.select.select.select\\`\n        `}</Cell>\n        <Cell>{md`\n\\`ref\\`\n        `}</Cell>\n      </tr>\n    </tbody>\n  </Table>\n);\n"
  },
  {
    "path": "docs/pages/upgrade-to-v2/index.tsx",
    "content": "import React, { Fragment } from 'react';\nimport Helmet from 'react-helmet';\nimport md from '../../markdown/renderer';\n\nimport PropChanges from './props';\n\nexport default function UpgradeGuide() {\n  return (\n    <Fragment>\n      <Helmet>\n        <title>{'React Select v1.x -> 2.x Upgrade Guide'}</title>\n        <meta name=\"description\" content=\"React-select v2 Upgrade Guide\" />\n      </Helmet>\n      {md`\n# Upgrade guide for v2\n\n> This guide is a work in progress. Please [open an issue](https://github.com/jedwatson/react-select/issues)\n> if you need something clarified, or [submit a PR](https://github.com/jedwatson/react-select/pulls)\n> if you have an improvement!\n\nReact-select v2 is a complete rewrite, and includes some major changes:\n\n- The architecture has been cleaned up\n- Many redundant props have been removed\n- Several major features have been added (including option groups!)\n- The custom component API has been reinvented and is much more consistent\n- Styles are now implemented with css-in-js rather than less / scss stylesheets\n- Support for option groups has been added 🎉\n- You can use any shape of data in your options array, and control how they are\n  handled by providing custom functions\n\nWith that in mind, we've tried to make the upgrade as easy as possible. How\ncomplex the upgrade is will depend on how much you have customised react-select.\n\nWe've also done our best to keep feature parity with v1, either through\ncontinuing to support props or by providing another way to achieve the same\nresult.\n\n## Concepts\n\n### Controllable Props and defaults\n\nIn v2, there are three optional props you can use to control the state of the\ncomponent:\n\n- \\`value\\` controls the select value\n- \\`inputValue\\` controls the search input value\n- \\`menuIsOpen\\` controls whether the menu is open\n\nYou can use none, any, or all of these depending on your requirements.\n\nThe props have associated events that are called when the value should change.\nHere's an example implementation of all three:\n\n~~~js\n<Select\n  value={this.state.value}\n  onChange={(value) => this.setState({ value })}\n  inputValue={this.state.inputValue}\n  onInputChange={(inputValue) => this.setState({ inputValue })}\n  menuIsOpen={this.state.menuIsOpen}\n  onMenuOpen={() => this.setState({ menuIsOpen: true })}\n  onMenuClose={() => this.setState({ menuIsOpen: false })}\n/>\n~~~\n\nIf you don't use the controlled props, react-select has props that let you\ndefault their value when it mounts:\n\n~~~js\n<Select\n  defaultValue={{ label: 'Default Option', value: 'default-value' }}\n  defaultInputValue=\"Search Text\"\n  defaultMenuIsOpen={true}\n/>\n~~~\n\nFor more information, see\n[controlled components](https://reactjs.org/docs/forms.html#controlled-components)\nand [uncontrolled components](https://reactjs.org/docs/uncontrolled-components.html)\nin the React docs.\n\n### Action Meta\n\nThe \\`onChange\\` prop is now passed a second argument, which contains meta about\nwhy the event was called. For example:\n\n~~~js\nonChange = (newValue, actionMeta) => console.log(actionMeta);\n// possible values:\n{\n  action: 'select-option' |\n    'deselect-option' |\n    'remove-value' |\n    'pop-value' |\n    'set-value' |\n    'clear' |\n    'create-option';\n}\n~~~\n\nThe new \\`onInputChange\\` prop also passes actionMeta:\n\n~~~js\nonInputChange = (newValue, actionMeta) => console.log(actionMeta);\n// possible values:\n{\n  action: 'set-value' | 'input-change' | 'input-blur' | 'menu-close';\n}\n~~~\n\n### Options Data\n\nYou can now provide option data in any shape you like, without conforming to the\nexpected \\`{ label, value }\\` keys.\n\nThis means the \\`labelKey\\` and \\`valueKey\\` props are no longer supported.\n\nInstead, you can use the following props to customise how react-select deals\nwith your options:\n\n~~~\n<Select\n  filterOption={(option: {}, inputValue: string) => boolean}\n  formatOptionLabel={(option: {}, context: {} ) => Node}\n  getOptionLabel={(option: {}) => string}\n  getOptionValue={(option: {}) => string}\n  isOptionDisabled={(option: {}, value: [{}]) => boolean}\n  isOptionSelected?={(option: {}, value: [{}]) => boolean}\n/>\n~~~\n\n## New Styles API\n\nWhere v1 included LESS / SCSS stylesheets and applied styles using classNames,\nv2 uses css-in-js to apply styles. This gives you complete control over how\nthe control looks, but is a significant change.\n\nEach component that react-select renders has a corresponding key that you can\nspecify in the \\`styles\\` prop. Each value you provide should be a function that\ntakes the default styles, and returns your customised style object.\n\nFor example, to give the control a white background:\n\n~~~js\nstyles={{\n  control: (base) => ({ ...base, color: 'white' })\n}}\n~~~\n\nSee the [Styles Documentation](/styles) for more details and examples.\n\nThis means the following props have been removed, and their use-cases should now\nbe handled with the new styles API:\n\n- \\`menuContainerStyle\\`\n- \\`menuStyle\\`\n- \\`optionClassName\\`\n- \\`wrapperStyle\\`\n\n### Using classNames\n\nIf you provide the \\`classNamePrefix\\` prop to react-select, all inner elements will\nbe given a className based on the one you have provided.\n\nFor example, given \\`classNamePrefix=\"react-select\"\\`, the DOM would roughly look\nlike this:\n\n~~~html\n<div class=\"react-select\">\n  <div class=\"react-select__control\">\n    <div class=\"react-select__value-container\">...</div>\n    <div class=\"react-select__indicators\">...</div>\n  </div>\n  <div class=\"react-select__menu\">\n    <div class=\"react-select__menu-list\">\n      <div class=\"react-select__option\">...</div>\n    </div>\n  </div>\n</div>\n~~~\n\n## New Components API\n\nReact-select v1 had several props that would allow you to render specific parts\nof the UI, or specify your own custom components.\n\nIn v2, we've doubled down on this approach and introduced a new \\`components\\`\nprop that lets you replace any part of react-select.\n\nFor example, to render a custom \\`Option\\` component:\n\n~~~js\ncomponents={{\n  Option: ({ children, innerProps }) => (\n    <div className=\"custom-option\" ref={innerRef} {...innerProps}>\n      {children}\n    </div>\n  )\n}}\n~~~\n\nAll components are passed a set of common props. The most important to\nunderstand are:\n\n- \\`children\\` - if the component should contain other components (for example,\n  a menu contains options) they will be passed as children. This way you don't\n  need to re-implement more than you absolutely need to.\n- \\`innerProps\\` - a set of props that should be spread onto the DOM element\n  your component returns. It wires up accessibility attributes and events.\n- \\`getStyles\\` - a function that will return an object containing the styles\n  for the component. If you have specified custom style modifiers, they will be\n  executed by this function.\n- \\`innerRef\\` - additional some components need to expose a ref to\n  the base Select component, to facilitate internally managed behaviour.\n  We specify this as innerRef to avoid collision with React's reserved \\`ref\\`\n  keyword when we spread props.\n\nAside from innerRef (where applicable), you don't _have_ to use these props, and are free to implement whatever - but\nthey are intended to help make custom implementations easier to manage.\n\nSee the [Components Documentation](/components) for more details and\nexamples.\n\nThis means the following props have been removed, and their use-cases should now\nbe handled with the new components API:\n\n- \\`inputProps\\`\n- \\`inputRenderer\\`\n- \\`menuRenderer\\`\n- \\`optionComponent\\`\n- \\`optionRenderer\\`\n- \\`valueComponent\\`\n- \\`valueRenderer\\`\n- \\`arrowRenderer\\`\n- \\`clearRenderer\\`\n\n## Filtering\n\nWhere react-select v1 had several props for controlling how options are\nfiltered, v2 simply expects you to provide a function that tests each option\nagainst the input value.\n\nThe new export \\`createFilter\\` allows you to easily create a filter function\nthat implements the same options previously available as props to react-select.\n\nFor example:\n\n~~~js\nimport Select, { createFilter } from 'react-select';\n\nconst customFilter = createFilter({\n  ignoreCase?: boolean,\n  ignoreAccents?: boolean,\n  stringify?: Object => string,\n  trim?: boolean,\n  matchFrom?: 'any' | 'start',\n});\n\n<Select filterOptions={customFilter} ... />\n~~~\n\nSee the [Advanced Guide](/advanced) for more details and examples.\n\n## Simple Value\n\nReact-select v1 allowed you to use strings for the \\`value\\` prop, but with v2 we've deprecated this behaviour\nin favor of a value prop that is always either an array of Options objects or an Options object.\nIf you still want to manage your selected values as a simple string you\ncan easily do so by applying a simple filter on your dataset as below.\n\n~~~js\nconst options = [\n  { name: 'John', id: 1 },\n  { name: 'Doe', id: 2 },\n];\nreturn (\n  <ReactSelect\n    options={options}\n    value={options.filter(({ id }) => id === this.state.id)}\n    getOptionLabel={({ name }) => name}\n    getOptionValue={({ id }) => id}\n    onChange={({ value }) => this.setState({ id: value })}\n  />\n);\n~~~\n\nNote that if you use the default react-select options schema (an array with\nobjects having \\`label\\` and \\`value\\` keys) you don't need to define\n\\`getOptionValue\\` nor \\`getOptionLabel\\`.\n\n## Prop Update Guide\n      `}\n      <PropChanges />\n    </Fragment>\n  );\n}\n"
  },
  {
    "path": "docs/pages/upgrade-to-v2/props.tsx",
    "content": "import React, {\n  Component,\n  Fragment,\n  FunctionComponent,\n  ReactElement,\n} from 'react';\n\nimport Select, { components, OptionProps } from 'react-select';\nimport md from '../../markdown/renderer';\nimport { Table, Header, Cell } from '../../Table';\n\nconst Code: FunctionComponent = ({ children }) => <code>{children}</code>;\n\nconst propChangeData: (\n  | [string, string]\n  | [string, string, string | ReactElement]\n)[] = [\n  ['aria-describedby', 'unchanged'],\n  ['aria-label', 'unchanged'],\n  ['aria-labelledby', 'unchanged'],\n  ['arrowRenderer', 'components'],\n  ['autoBlur', 'renamed', 'blurInputOnSelect'],\n  ['autoFocus', 'unchanged'],\n  ['autoLoad', 'removed', 'see the Async component (defaultOptions)'],\n  ['autosize', 'components'],\n  ['backspaceRemoves', 'renamed', 'backspaceRemovesValue'],\n  [\n    'backspaceToRemoveMessage',\n    'removed',\n    'may be implemented in a later version',\n  ],\n  ['className', 'unchanged'],\n  ['clearable', 'renamed', 'isClearable'],\n  ['clearAllText', 'removed'],\n  ['clearRenderer', 'components'],\n  ['clearValueText', 'removed'],\n  ['closeOnSelect', 'renamed', 'closeMenuOnSelect'],\n  ['deleteRemoves', 'removed'],\n  ['delimiter', 'unchanged'],\n  ['disabled', 'renamed', 'isDisabled'],\n  ['escapeClearsValue', 'unchanged'],\n  [\n    'filterOptions',\n    'removed',\n    md`\nuse \\`filterOption\\` instead\n    `,\n  ],\n  ['id', 'unchanged'],\n  [\n    'ignoreAccents',\n    'removed',\n    md`\nsee \\`createFilter()\\`\n    `,\n  ],\n  [\n    'ignoreCase',\n    'removed',\n    md`\nsee \\`createFilter()\\`\n    `,\n  ],\n  ['inputProps', 'components'],\n  ['inputRenderer', 'components'],\n  ['instanceId', 'unchanged'],\n  ['isLoading', 'unchanged'],\n  [\n    'joinValues',\n    'removed',\n    md`\nnow inferred from \\`delimiter\\`\n    `,\n  ],\n  ['labelKey', 'removed'],\n  ['loadOptions', 'unchanged'],\n  [\n    'matchPos',\n    'removed',\n    md`\nsee \\`createFilter()\\`\n    `,\n  ],\n  [\n    'matchProp',\n    'removed',\n    md`\nsee \\`createFilter()\\`\n    `,\n  ],\n  ['menuBuffer', 'styles'],\n  ['menuContainerStyle', 'styles'],\n  ['menuRenderer', 'components'],\n  ['menuStyle', 'styles'],\n  ['multi', 'renamed', 'isMulti'],\n  ['name', 'unchanged'],\n  ['noResultsText', 'renamed', 'noOptionsMessage'],\n  ['onBlur', 'unchanged'],\n  ['onBlurResetsInput', 'removed'],\n  ['onClose', 'renamed', 'onMenuClose'],\n  ['onCloseResetsInput', 'removed'],\n  ['onFocus', 'unchanged'],\n  ['onInputChange', 'unchanged'],\n  ['onInputKeyDown', 'renamed', 'onKeyDown'],\n  ['onMenuScrollToBottom', 'unchanged'],\n  ['onOpen', 'renamed', 'onMenuOpen'],\n  ['onSelectResetsInput', 'removed'],\n  ['onValueClick', 'removed'],\n  ['openOnClick', 'renamed', 'openMenuOnClick'],\n  ['openOnFocus', 'renamed', 'openMenuOnFocus'],\n  ['optionClassName', 'components'],\n  ['optionComponent', 'components'],\n  ['optionRenderer', 'components'],\n  ['options', 'unchanged'],\n  ['pageSize', 'unchanged'],\n  ['placeholder', 'changed', 'now only accepts a string'],\n  ['removeSelected', 'renamed', 'hideSelectedOptions'],\n  ['required', 'removed', 'may be implemented in a later version'],\n  [\n    'resetValue',\n    'removed',\n    md`\ncontrol the \\`value\\` prop\n    `,\n  ],\n  ['rtl', 'renamed', 'isRtl'],\n  ['scrollMenuIntoView', 'renamed', 'menuShouldScrollIntoView'],\n  ['searchable', 'renamed', 'isSearchable'],\n  ['searchPromptText', 'removed'],\n  ['simpleValue', 'removed'],\n  ['style', 'styles'],\n  ['tabIndex', 'unchanged'],\n  ['tabSelectsValue', 'unchanged'],\n  [\n    'trimFilter',\n    'removed',\n    md`\nsee \\`createFilter()\\`\n    `,\n  ],\n  ['value', 'unchanged'],\n  ['valueComponent', 'components'],\n  ['valueKey', 'removed'],\n  ['valueRenderer', 'components'],\n  ['wrapperStyle', 'styles'],\n];\n\ninterface Props {\n  prop: string;\n  status: string;\n  note: string | ReactElement | undefined;\n}\n\nclass PropStatus extends Component<Props> {\n  renderStatus() {\n    const { status, note } = this.props;\n    switch (status) {\n      case 'components':\n        return (\n          <Fragment>\n            <Cell>removed</Cell>\n            <Cell>use the new Components API</Cell>\n          </Fragment>\n        );\n      case 'styles':\n        return (\n          <Fragment>\n            <Cell>removed</Cell>\n            <Cell>use the new Styles API</Cell>\n          </Fragment>\n        );\n      case 'renamed':\n        return (\n          <Fragment>\n            <Cell>renamed</Cell>\n            <Cell>\n              use <Code>{note}</Code>\n            </Cell>\n          </Fragment>\n        );\n      default:\n        return (\n          <Fragment>\n            <Cell>{status}</Cell>\n            <Cell>{note}</Cell>\n          </Fragment>\n        );\n    }\n  }\n  render() {\n    const { prop } = this.props;\n    return (\n      <tr>\n        <Cell>\n          <Code>{prop}</Code>\n        </Cell>\n        {this.renderStatus()}\n      </tr>\n    );\n  }\n}\n\ninterface InputOptionState {\n  readonly isActive: boolean;\n}\n\nclass InputOption extends Component<OptionProps, InputOptionState> {\n  state: InputOptionState = { isActive: false };\n  onMouseDown = () => this.setState({ isActive: true });\n  onMouseUp = () => this.setState({ isActive: false });\n  onMouseLeave = () => this.setState({ isActive: false });\n\n  render() {\n    const {\n      getStyles,\n      isDisabled,\n      isFocused,\n      isSelected,\n      children,\n      innerProps,\n      ...rest\n    } = this.props;\n    const { isActive } = this.state;\n\n    // styles\n    let bg = 'transparent';\n    if (isFocused) bg = '#eee';\n    if (isActive) bg = '#B2D4FF';\n\n    const style = {\n      alignItems: 'center',\n      backgroundColor: bg,\n      color: 'inherit',\n      display: 'flex ',\n    };\n\n    // prop assignment\n    const props = {\n      ...innerProps,\n      onMouseDown: this.onMouseDown,\n      onMouseUp: this.onMouseUp,\n      onMouseLeave: this.onMouseLeave,\n      style,\n    };\n\n    return (\n      <components.Option\n        {...rest}\n        isDisabled={isDisabled}\n        isFocused={isFocused}\n        isSelected={isSelected}\n        getStyles={getStyles}\n        innerProps={props}\n      >\n        <input type=\"checkbox\" checked={isSelected} />\n        {children}\n      </components.Option>\n    );\n  }\n}\n\nconst allOptions = [\n  { value: 'removed', label: 'removed' },\n  { value: 'unchanged', label: 'unchanged' },\n  { value: 'renamed', label: 'renamed' },\n];\n\nconst filterOptions = [\n  { value: 'propName', label: 'propName' },\n  { value: 'status', label: 'status' },\n];\n\nconst getDisplayedStatus = (status: string) => {\n  if (status === 'components' || status === 'styles') return 'removed';\n  else return status;\n};\n\ninterface PropChangesProps {}\n\ninterface PropChangesState {\n  readonly selectedOptions: readonly string[];\n  readonly filterValue: string;\n}\n\nclass PropChanges extends Component<PropChangesProps, PropChangesState> {\n  state: PropChangesState = {\n    selectedOptions: allOptions.map((opt) => opt.value),\n    filterValue: filterOptions[0].value,\n  };\n\n  render() {\n    let { selectedOptions, filterValue } = this.state;\n\n    return (\n      <Fragment>\n        {/* filter */}\n        <h4>Filter Props</h4>\n        <Select\n          defaultValue={allOptions}\n          isMulti\n          closeMenuOnSelect={false}\n          hideSelectedOptions={false}\n          onChange={(options) => {\n            if (Array.isArray(options)) {\n              this.setState({\n                selectedOptions: options.map((opt) => opt.value),\n              });\n            }\n          }}\n          options={allOptions}\n          components={{\n            Option: InputOption,\n          }}\n        />\n        {/* sort */}\n        <h4>Sort Props</h4>\n        <Select\n          defaultValue={filterOptions[0]}\n          onChange={(option) => {\n            if (!Array.isArray(option)) {\n              this.setState({ filterValue: option ? option.value : '' });\n            }\n          }}\n          options={filterOptions}\n        />\n        <Table>\n          <thead>\n            <tr>\n              <Header>Prop</Header>\n              <Header>Status</Header>\n              <Header>Notes</Header>\n            </tr>\n          </thead>\n          <tbody>\n            {propChangeData\n              .sort((a, b) => {\n                if (filterValue === 'propName') {\n                  return a[0].localeCompare(b[0]);\n                } else {\n                  return getDisplayedStatus(a[1]).localeCompare(\n                    getDisplayedStatus(b[1])\n                  );\n                }\n              })\n              .map((data) => {\n                const [prop, status, note] = data;\n                return selectedOptions.includes(getDisplayedStatus(status)) ? (\n                  <PropStatus\n                    key={prop}\n                    prop={prop}\n                    status={status}\n                    note={note}\n                  />\n                ) : null;\n              })}\n          </tbody>\n        </Table>\n      </Fragment>\n    );\n  }\n}\n\nexport default PropChanges;\n"
  },
  {
    "path": "docs/styled-components.tsx",
    "content": "/** @jsx emotionJSX */\nimport { jsx as emotionJSX } from '@emotion/react';\n\nimport SyntaxHighlighter, {\n  registerLanguage,\n} from 'react-syntax-highlighter/prism-light';\nimport jsx from 'react-syntax-highlighter/languages/prism/jsx';\nimport { tomorrow } from 'react-syntax-highlighter/styles/prism';\nimport { HTMLAttributes } from 'react';\n\nconst customTomorrow = {\n  ...tomorrow,\n  'code[class*=\"language-\"]': {\n    ...tomorrow['code[class*=\"language-\"]'],\n    fontFamily: null, // inherit from css\n  },\n  'pre[class*=\"language-\"]': {\n    ...tomorrow['pre[class*=\"language-\"]'],\n    fontFamily: null, // inherit from css\n  },\n};\n\nregisterLanguage('jsx', jsx);\n\nexport const Hr = () => (\n  <div\n    css={{\n      backgroundColor: 'hsl(0, 0%, 90%)',\n      height: 2,\n      marginBottom: '2em',\n      marginTop: '2em',\n    }}\n  />\n);\n\nexport const Note = ({\n  Tag = 'div',\n  ...props\n}: { readonly Tag?: string } & HTMLAttributes<HTMLElement>) => (\n  <Tag\n    css={{\n      color: 'hsl(0, 0%, 40%)',\n      display: 'inline-block',\n      fontSize: 12,\n      fontStyle: 'italic',\n      marginTop: '1em',\n    }}\n    {...props}\n  />\n);\n\nexport const H1 = (props: JSX.IntrinsicElements['h1']) => (\n  <h1 css={{ marginTop: 0 }} {...props} />\n);\nexport const H2 = (props: any) => <h2 css={{ marginTop: '2em' }} {...props} />;\n\nexport const ColorSample = ({\n  name,\n  color,\n}: {\n  color: string;\n  name: string;\n}) => (\n  <div\n    css={{\n      display: 'inline-flex',\n      marginBottom: '0.5em',\n      alignItems: 'center',\n      minWidth: '10em',\n    }}\n  >\n    <span\n      title={color}\n      css={{\n        marginRight: '0.5em',\n        display: 'inline-block',\n        borderRadius: 3,\n        width: '1em',\n        height: '1em',\n        backgroundColor: color,\n      }}\n    />\n    <Code>{name}</Code>\n  </div>\n);\n\n// ==============================\n// Code\n// ==============================\n\nexport const Code = (props: JSX.IntrinsicElements['code']) => (\n  <code\n    css={{\n      backgroundColor: 'rgba(38, 132, 255, 0.08)',\n      // color: '#0747A6',\n      fontSize: '85%',\n      padding: '1px 5px 2px',\n      borderRadius: 4,\n    }}\n    {...props}\n  />\n);\n\ninterface PreProps {\n  readonly children: string;\n  readonly language: string;\n}\n\nexport const CodeBlock = ({ children, language, ...props }: PreProps) => {\n  return (\n    <SyntaxHighlighter\n      language={language}\n      style={customTomorrow}\n      customStyle={{\n        borderRadius: 4,\n        fontSize: 13,\n        marginBottom: '1em',\n        marginTop: '1em',\n        overflowX: 'auto',\n        WebkitOverflowScrolling: 'touch',\n      }}\n      {...props}\n    >\n      {children}\n    </SyntaxHighlighter>\n  );\n};\nCodeBlock.defaultProps = { language: 'jsx' };\n"
  },
  {
    "path": "docs/tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"target\": \"es6\",\n    \"module\": \"commonjs\",\n    \"jsx\": \"react\",\n    \"noEmit\": true,\n    \"strict\": true,\n    \"esModuleInterop\": true,\n    \"forceConsistentCasingInFileNames\": true,\n    \"resolveJsonModule\": true\n  }\n}\n"
  },
  {
    "path": "docs/utils.ts",
    "content": "import { useEffect, useState } from 'react';\nimport { MagicalNode, MagicalNodeIndex } from '@magical-types/types';\nimport { deserialize } from '@magical-types/serialization/deserialize';\n\nimport type { MagicalNodeMetadata } from './generate-magical-types/src/types';\n// @ts-ignore\nimport manifest from './magical-types/magical-types-manifest.json';\n\nexport type getNodeType =\n  | ((index: MagicalNodeIndex) => MagicalNode)\n  | undefined;\n\nlet getNode: getNodeType;\n\nexport const metadata: MagicalNodeMetadata = (manifest as any).types;\n\nexport function useMagicalNodes() {\n  let [, forceUpdate] = useState(0);\n\n  useEffect(() => {\n    if (!getNode) {\n      fetch(manifest.paths[0])\n        .then((x) => x.json())\n        .then((firstNodeGroup) => {\n          getNode = deserialize([\n            firstNodeGroup,\n            ...(manifest.paths as string[])\n              .slice(1)\n              .map((path) => () => fetch(path).then((x) => x.json())),\n          ]);\n          forceUpdate(1);\n        });\n    }\n  }, []);\n  return getNode;\n}\n"
  },
  {
    "path": "docs/webpack.config.ts",
    "content": "import * as path from 'path';\nimport * as webpack from 'webpack';\nimport CopyWebpackPlugin from 'copy-webpack-plugin';\nimport HtmlWebpackPlugin from 'html-webpack-plugin';\nimport ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';\nimport { config } from 'dotenv';\nimport { CleanWebpackPlugin } from 'clean-webpack-plugin';\n\nconfig();\n\nconst webpackConfig: webpack.Configuration = {\n  context: __dirname,\n  entry: {\n    index: './index',\n  },\n  output: {\n    path: path.resolve(__dirname, 'dist'),\n    filename: '[name].js',\n    publicPath: '/',\n  },\n  devServer: {\n    port: 8000,\n    historyApiFallback: true,\n  },\n  // devtool: 'source-map',\n  devtool: 'cheap-module-eval-source-map',\n  resolve: {\n    extensions: ['.ts', '.tsx', '.js', '.jsx', '.json'],\n  },\n  module: {\n    rules: [\n      {\n        test: /\\.(ts|js)x?$/,\n        exclude: [/node_modules/],\n        use: [\n          {\n            loader: 'babel-loader',\n            options: {\n              root: path.join(__dirname, '..'),\n            },\n          },\n        ],\n      },\n      {\n        test: /\\.css$/,\n        use: [{ loader: 'style-loader' }, { loader: 'css-loader' }],\n      },\n    ],\n  },\n  plugins: [\n    // new webpack.DefinePlugin({\n    //   'process.env.CLIENT_ID': `'${process.env.CLIENT_ID}'`,\n    //   'process.env.CLIENT_SECRET': `'${process.env.CLIENT_SECRET}'`,\n    // }),\n    new CleanWebpackPlugin(),\n    new HtmlWebpackPlugin({\n      filename: 'index.html',\n      inject: false,\n      template: path.resolve(__dirname, 'index.html'),\n    }),\n    new CopyWebpackPlugin([\n      '_redirects',\n      'favicon.ico',\n      'index.css',\n      'magical-types/*',\n    ]),\n    new ForkTsCheckerWebpackPlugin({\n      async: false,\n      typescript: {\n        configFile: './tsconfig.json',\n      },\n    }),\n  ],\n};\n\nexport default webpackConfig;\n"
  },
  {
    "path": "netlify.toml",
    "content": "[build]\n  command = \"yarn build:docs\"\n  publish = \"docs/dist\"\n\n[build.environment]\n  YARN_VERSION = \"1.22.22\"\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"@react-select/monorepo\",\n  \"private\": true,\n  \"version\": \"1.0.0\",\n  \"description\": \"A Select control built with and for ReactJS\",\n  \"author\": \"Jed Watson\",\n  \"license\": \"MIT\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/JedWatson/react-select.git\"\n  },\n  \"dependencies\": {\n    \"@babel/core\": \"^7.19.6\",\n    \"@babel/plugin-proposal-class-properties\": \"^7.12.1\",\n    \"@babel/plugin-proposal-private-methods\": \"^7.13.0\",\n    \"@babel/plugin-transform-runtime\": \"^7.12.0\",\n    \"@babel/polyfill\": \"^7.12.1\",\n    \"@babel/preset-env\": \"^7.19.4\",\n    \"@babel/preset-react\": \"^7.12.1\",\n    \"@babel/preset-typescript\": \"^7.18.6\",\n    \"@babel/runtime\": \"^7.12.0\",\n    \"@changesets/cli\": \"^2.17.0\",\n    \"@changesets/get-github-info\": \"^0.5.0\",\n    \"@emotion/babel-plugin\": \"^11.10.2\",\n    \"@emotion/jest\": \"^11.1.0\",\n    \"@manypkg/cli\": \"^0.19.2\",\n    \"@preconstruct/cli\": \"^2.6.2\",\n    \"@testing-library/dom\": \"8.19.0\",\n    \"@testing-library/jest-dom\": \"5.1.1\",\n    \"@testing-library/react\": \"12.1.4\",\n    \"@testing-library/user-event\": \"^10.0.0\",\n    \"@types/copy-webpack-plugin\": \"^5.0.2\",\n    \"@types/html-webpack-plugin\": \"^3.2.4\",\n    \"@types/jest-in-case\": \"^1.0.6\",\n    \"@types/node\": \"^16.11.68\",\n    \"@types/pretty-proptypes\": \"^1.1.0\",\n    \"@types/react\": \"^16.14.60\",\n    \"@types/react-dom\": \"^16.9.10\",\n    \"@types/react-transition-group\": \"^4.4.0\",\n    \"@typescript-eslint/eslint-plugin\": \"^4.14.0\",\n    \"@typescript-eslint/parser\": \"^4.14.0\",\n    \"babel-core\": \"^7.0.0-bridge.0\",\n    \"babel-eslint\": \"^10.1.0\",\n    \"babel-jest\": \"^23.6.0\",\n    \"babel-loader\": \"^8.2.5\",\n    \"concurrently\": \"^7.5.0\",\n    \"copy-webpack-plugin\": \"^5.0.3\",\n    \"coveralls\": \"^3.1.1\",\n    \"cross-env\": \"^7.0.3\",\n    \"css-loader\": \"^0.28.7\",\n    \"cypress\": \"^5.0.0\",\n    \"dotenv\": \"^16.0.3\",\n    \"eslint\": \"^7.18.0\",\n    \"eslint-plugin-react\": \"^7.22.0\",\n    \"eslint-plugin-react-hooks\": \"^4.2.0\",\n    \"gh-pages\": \"^1.1.0\",\n    \"jest\": \"^25.1.0\",\n    \"jest-in-case\": \"^1.0.2\",\n    \"prettier\": \"^2.2.1\",\n    \"style-loader\": \"^0.23.1\",\n    \"typescript\": \"^4.1.3\",\n    \"user-agent-data-types\": \"^0.4.2\"\n  },\n  \"scripts\": {\n    \"build\": \"preconstruct build\",\n    \"watch\": \"preconstruct watch\",\n    \"coveralls\": \"cat coverage/lcov.info | coveralls\",\n    \"prettify\": \"prettier --write .\",\n    \"prettier:check\": \"prettier --check .\",\n    \"lint\": \"eslint . --ext .js,.jsx,.ts,.tsx\",\n    \"start\": \"cd docs && yarn start\",\n    \"start:test\": \"cd docs && yarn start:test\",\n    \"build:docs\": \"yarn --cwd=docs build:docs && yarn --cwd=storybook build && cp -r storybook/storybook-static docs/dist/storybook\",\n    \"fresh\": \"rm -rf node_modules && yarn install\",\n    \"test\": \"npm run test:jest && npm run test:cypress\",\n    \"test:jest\": \"jest --coverage\",\n    \"e2e\": \"concurrently --kill-others --success=first --names 'SERVER,E2E' 'yarn start:test' 'yarn test:cypress'\",\n    \"type-check\": \"tsc --build packages/react-select/tsconfig.json && tsc --build packages/react-select/src/__tests__/tsconfig.json && tsc --build docs/tsconfig.json && tsc --build cypress/tsconfig.json\",\n    \"precommit\": \"yarn run type-check\",\n    \"postinstall\": \"preconstruct dev && manypkg check\",\n    \"test:cypress\": \"yarn test:cypress:chrome && yarn test:cypress:firefox\",\n    \"test:cypress:chrome\": \"cypress run --browser chrome\",\n    \"test:cypress:firefox\": \"cypress run --browser firefox\",\n    \"test:cypress:watch\": \"node ./node_modules/.bin/cypress open\",\n    \"changeset\": \"changeset\",\n    \"version-packages\": \"changeset version\",\n    \"release\": \"yarn build && changeset publish\"\n  },\n  \"files\": [\n    \"dist\",\n    \"src\"\n  ],\n  \"keywords\": [\n    \"combobox\",\n    \"form\",\n    \"input\",\n    \"multiselect\",\n    \"react\",\n    \"react-component\",\n    \"select\",\n    \"ui\"\n  ],\n  \"jest\": {\n    \"modulePathIgnorePatterns\": [\n      \"./node_modules\"\n    ],\n    \"testRegex\": \"src/*(/(__tests?__/)([^_].*/)*?[^_][^/]*?\\\\.(test|spec)?\\\\.(ts|js)x?)$\",\n    \"setupFilesAfterEnv\": [\n      \"./test-setup.js\"\n    ],\n    \"snapshotSerializers\": [\n      \"@emotion/jest/serializer\"\n    ]\n  },\n  \"workspaces\": [\n    \"packages/*\",\n    \"docs\",\n    \"storybook\"\n  ],\n  \"preconstruct\": {\n    \"packages\": [\n      \"packages/*\",\n      \"docs/generate-magical-types\"\n    ],\n    \"exports\": {\n      \"importConditionDefaultExport\": \"default\"\n    }\n  },\n  \"resolutions\": {\n    \"csstype\": \"^3.0.2\"\n  }\n}\n"
  },
  {
    "path": "packages/react-select/CHANGELOG.md",
    "content": "# react-select\n\n## 5.10.2\n\n### Patch Changes\n\n- [`bf0c8615`](https://github.com/JedWatson/react-select/commit/bf0c8615f8574264883f984c0d2ff36ff9dcdcb7) [#6051](https://github.com/JedWatson/react-select/pull/6051) Thanks [@jnyholm-sc](https://github.com/jnyholm-sc)! - fix: hydration problem caused by isAppleDevice\n\n## 5.10.1\n\n### Patch Changes\n\n- [`c5706a0d`](https://github.com/JedWatson/react-select/commit/c5706a0d2b90f7a29bf12b760b048262ae8cc24c) [#6013](https://github.com/JedWatson/react-select/pull/6013) Thanks [@jonahShaf](https://github.com/jonahShaf)! - Distribute license file\n\n## 5.10.0\n\n### Minor Changes\n\n- [`6d28ed76`](https://github.com/JedWatson/react-select/commit/6d28ed762e5ef47543fc63ce7588db77455d1534) [#5993](https://github.com/JedWatson/react-select/pull/5993) Thanks [@onihani](https://github.com/onihani)! - Export the `FilterOptionOption` type\n\n## 5.9.0\n\n### Minor Changes\n\n- [`01206c33`](https://github.com/JedWatson/react-select/commit/01206c333c481b511e36521e5b568aebd4534b26) [#5984](https://github.com/JedWatson/react-select/pull/5984) Thanks [@Thris3n](https://github.com/Thris3n)! - Add React 19 to peer dependency range\n\n## 5.8.3\n\n### Patch Changes\n\n- [`111efad1`](https://github.com/JedWatson/react-select/commit/111efad170a11dbae96ae436251cd028e702eb72) [#5974](https://github.com/JedWatson/react-select/pull/5974) Thanks [@j2ghz](https://github.com/j2ghz)! - Fix types compatibility with React 19\n\n## 5.8.2\n\n### Patch Changes\n\n- [`781284a9`](https://github.com/JedWatson/react-select/commit/781284a97059b80c07eb77bc871540fe99304e8f) [#5771](https://github.com/JedWatson/react-select/pull/5771) Thanks [@tu4mo](https://github.com/tu4mo)! - Fix for calling non-cancellable scroll events\n\n## 5.8.1\n\n### Patch Changes\n\n- [`dd740ced`](https://github.com/JedWatson/react-select/commit/dd740cedb29c810a89da4445d4864cd7e63d3aaf) [#5960](https://github.com/JedWatson/react-select/pull/5960) Thanks [@leonaves](https://github.com/leonaves)! - No longer send pop-value action when multi-select is empty. This correctly resolves typings with that event, where removedValue cannot be undefined.\n\n## 5.8.0\n\n### Minor Changes\n\n- [`884f1c42`](https://github.com/JedWatson/react-select/commit/884f1c42549faad7cb210169223b427ad6f0c9fd) [#5758](https://github.com/JedWatson/react-select/pull/5758) Thanks [@Ke1sy](https://github.com/Ke1sy)! - 1. Added 'aria-activedescendant' for input and functionality to calculate it;\n\n  2. Added role 'option' and 'aria-selected' for option;\n  3. Added role 'listbox' for menu;\n  4. Added tests for 'aria-activedescendant';\n  5. Changes in aria-live region:\n\n  - the instructions how to use select will be announced only one time when user focuses the input for the first time.\n  - instructions for menu or selected value will be announced only once after focusing them.\n  - removed aria-live for focused option because currently with correct aria-attributes it will be announced by screenreader natively as well as the status of this option (active or disabled).\n  - separated ariaContext into ariaFocused, ariaResults, ariaGuidance to avoid announcing redundant information and higlight only current change.\n\n## 5.7.7\n\n### Patch Changes\n\n- [`224a8f0d`](https://github.com/JedWatson/react-select/commit/224a8f0d01a5b6200ff10280a0d7a9b613383032) [#5666](https://github.com/JedWatson/react-select/pull/5666) Thanks [@yhy-1](https://github.com/yhy-1)! - Add aria-disabled to select's control component.\n\n## 5.7.6\n\n### Patch Changes\n\n- [`f6315cd5`](https://github.com/JedWatson/react-select/commit/f6315cd5feddb2e9ea168bcad391b29990b53afb) [#5672](https://github.com/JedWatson/react-select/pull/5672) Thanks [@tu4mo](https://github.com/tu4mo)! - Fix for calling non-cancellable scroll events\n\n## 5.7.5\n\n### Patch Changes\n\n- [`9d1730ba`](https://github.com/JedWatson/react-select/commit/9d1730ba4f97a51d25c7e704acd1a4c2be8f7182) [#5347](https://github.com/JedWatson/react-select/pull/5347) Thanks [@aszmyd](https://github.com/aszmyd)! - Make scroll lock div work on a document context it belongs to\n\n## 5.7.4\n\n### Patch Changes\n\n- [`16414bb5`](https://github.com/JedWatson/react-select/commit/16414bb53295b362690d2b089d74182ddeabc1dd) [#5689](https://github.com/JedWatson/react-select/pull/5689) Thanks [@Rall3n](https://github.com/Rall3n)! - Resolve `defaultProps` deprecation warning for React v18+.\n\n## 5.7.3\n\n### Patch Changes\n\n- [`59513d00`](https://github.com/JedWatson/react-select/commit/59513d0035a20cf9c0575c4be52204de7f77d742) [#5626](https://github.com/JedWatson/react-select/pull/5626) Thanks [@emmatown](https://github.com/emmatown)! - Fix importing `react-select` in Node ESM\n\n## 5.7.2\n\n### Patch Changes\n\n- [`925cd4a2`](https://github.com/JedWatson/react-select/commit/925cd4a26097823187fb14cdae2561dd3c637e8c) [#5536](https://github.com/JedWatson/react-select/pull/5536) Thanks [@Rall3n](https://github.com/Rall3n)! - `required` prop accessibiltiy and functionality improvements\n\n## 5.7.1\n\n### Patch Changes\n\n- [`597143ee`](https://github.com/JedWatson/react-select/commit/597143ee3d5c27ce87e9b1508b068dc7c1323201) [#5559](https://github.com/JedWatson/react-select/pull/5559) Thanks [@gdiazdelaserna](https://github.com/gdiazdelaserna)! - Add `exports` field in package.json\n\n## 5.7.0\n\n### Minor Changes\n\n- [`0773095f`](https://github.com/JedWatson/react-select/commit/0773095f4990b636f64ae7d0ab593353a1e03b22) [#5457](https://github.com/JedWatson/react-select/pull/5457) Thanks [@nderkim](https://github.com/nderkim)! - Add classNames API and unstyled prop\n\n## 5.6.1\n\n### Patch Changes\n\n- [`cda16826`](https://github.com/JedWatson/react-select/commit/cda168262f777fd7be275d46063149c7d157fe55) [#5482](https://github.com/JedWatson/react-select/pull/5482) Thanks [@nderkim](https://github.com/nderkim)! - Fix unstable theme rerendering menu\n\n## 5.6.0\n\n### Minor Changes\n\n- [`c37e86d8`](https://github.com/JedWatson/react-select/commit/c37e86d8eaa3f6eba83696453a58d525cce6c7c6) [#4882](https://github.com/JedWatson/react-select/pull/4882) Thanks [@Rall3n](https://github.com/Rall3n)! - Add `required` prop\n\n## 5.5.9\n\n### Patch Changes\n\n- [`851ed2b8`](https://github.com/JedWatson/react-select/commit/851ed2b8b88d7230be2263a6c07c826bf507374d) [#5430](https://github.com/JedWatson/react-select/pull/5430) Thanks [@Rall3n](https://github.com/Rall3n)! - Fix focused option if `defaultMenuIsOpen` is set\n\n## 5.5.8\n\n### Patch Changes\n\n- [`1ad6de4e`](https://github.com/JedWatson/react-select/commit/1ad6de4ee75041129a657b92931a2965a1805c31) [#5084](https://github.com/JedWatson/react-select/pull/5084) Thanks [@kosciolek](https://github.com/kosciolek)! - When focusing a dropdown option, the numbers included in the aria live region take filtering into consideration.\n\n## 5.5.7\n\n### Patch Changes\n\n- [`0ca2d5ba`](https://github.com/JedWatson/react-select/commit/0ca2d5ba4aa42fb2a1bf033bcee660a293e39e50) [#5431](https://github.com/JedWatson/react-select/pull/5431) Thanks [@nderkim](https://github.com/nderkim)! - Change `class` components to `functional` components\n\n## 5.5.6\n\n### Patch Changes\n\n- [`92398939`](https://github.com/JedWatson/react-select/commit/9239893986c6aaaa7105d3f5a91022827e544b10) [#5409](https://github.com/JedWatson/react-select/pull/5409) Thanks [@lukebennett88](https://github.com/lukebennett88)! - Move files around to as to be compatible with version 2 of `@preconstruct/cli`\n\n## 5.5.5\n\n### Patch Changes\n\n- [`0dd38029`](https://github.com/JedWatson/react-select/commit/0dd3802977e525b4d8ea1eb083f8f13788016c28) [#5246](https://github.com/JedWatson/react-select/pull/5246) Thanks [@Rall3n](https://github.com/Rall3n)! - Fix re-focus of component in Firefox if being disabled while focused\n\n## 5.5.4\n\n### Patch Changes\n\n- [`ebb0a17a`](https://github.com/JedWatson/react-select/commit/ebb0a17a30b22cb7e7f7467ed8eda4256166e401) [#5404](https://github.com/JedWatson/react-select/pull/5404) Thanks [@Methuselah96](https://github.com/Methuselah96)! - Use ResizeObserver to auto-update menu position if available\n\n## 5.5.3\n\n### Patch Changes\n\n- [`07656aaa`](https://github.com/JedWatson/react-select/commit/07656aaac7f636129f8d09e723df9fa6e5ff2841) [#5399](https://github.com/JedWatson/react-select/pull/5399) Thanks [@dependabot](https://github.com/apps/dependabot)! - Update memoize-one\n\n## 5.5.2\n\n### Patch Changes\n\n- [`00238f1a`](https://github.com/JedWatson/react-select/commit/00238f1a65ce9184b99edd6d3b3307f9b5c0c6c1) [#5376](https://github.com/JedWatson/react-select/pull/5376) Thanks [@lukebennett88](https://github.com/lukebennett88)! - Fix bug with animated multi-value select width being too wide\n\n## 5.5.1\n\n### Patch Changes\n\n- [`0f6ef093`](https://github.com/JedWatson/react-select/commit/0f6ef093282ca7356fb0e7ee7c706681a5a97901) [#5381](https://github.com/JedWatson/react-select/pull/5381) Thanks [@Methuselah96](https://github.com/Methuselah96)! - Disable use of ResizeObserver for menu position auto-updating to avoid potential breaking changes.\n\n## 5.5.0\n\n### Minor Changes\n\n- [`598f9ee0`](https://github.com/JedWatson/react-select/commit/598f9ee0e641138820ae1b3d2a2121a1c21d3876) [#5256](https://github.com/JedWatson/react-select/pull/5256) Thanks [@Methuselah96](https://github.com/Methuselah96)! - Auto-update menu position when using menu portalling\n\n## 5.4.0\n\n### Minor Changes\n\n- [`5d49f70a`](https://github.com/JedWatson/react-select/commit/5d49f70aeb9d6c2685b81b361e3dab3e2064292d) [#5249](https://github.com/JedWatson/react-select/pull/5249) Thanks [@Methuselah96](https://github.com/Methuselah96)! - Export `formatOptionLabel` types (i.e., `FormatOptionLabelMeta` and `FormatOptionLabelContext`).\n\n## 5.3.2\n\n### Patch Changes\n\n- [`1f140e42`](https://github.com/JedWatson/react-select/commit/1f140e423707e9966254050e3234a65ee05977e9) [#5177](https://github.com/JedWatson/react-select/pull/5177) Thanks [@Methuselah96](https://github.com/Methuselah96)! - Fix view height used for menu positioning to be the scroll parent instead of the window\n\n## 5.3.1\n\n### Patch Changes\n\n- [`03bf7351`](https://github.com/JedWatson/react-select/commit/03bf735127fec6e47de8ae45e7cdc0a39c8b638b) [#5164](https://github.com/JedWatson/react-select/pull/5164) Thanks [@Methuselah96](https://github.com/Methuselah96)! - Bump @emotion/react to ^11.8.1 to avoid `useInsertionEffect` bug\n\n## 5.3.0\n\n### Minor Changes\n\n- [`c7d8d4b3`](https://github.com/JedWatson/react-select/commit/c7d8d4b3ee01cee63b34adf4a895ef07ce2f3b03) [#5133](https://github.com/JedWatson/react-select/pull/5133) Thanks [@nil4](https://github.com/nil4)! - Update `peerDependencies` to include React 18\n\n### Patch Changes\n\n- [`0aaa9575`](https://github.com/JedWatson/react-select/commit/0aaa9575ed7e817841b9c9b494b4bd4dc2247b26) [#5134](https://github.com/JedWatson/react-select/pull/5134) Thanks [@rkulinski](https://github.com/rkulinski)! - Use defaultPrevented to skip duplicate event handler for clicking select.\n\n- [`87e14431`](https://github.com/JedWatson/react-select/commit/87e144319f485fba20b46bc71eb8162f88d19430) [#5131](https://github.com/JedWatson/react-select/pull/5131) Thanks [@pcorpet](https://github.com/pcorpet)! - Avoid referencing an ID that is not in the DOM\n\n- [`7184d538`](https://github.com/JedWatson/react-select/commit/7184d538f587c1dd5a4ca5ad6cc0745fbb8d3809) [#5082](https://github.com/JedWatson/react-select/pull/5082) Thanks [@Methuselah96](https://github.com/Methuselah96)! - Fix type inference for Async's loadOptions prop\n\n- [`bd4ee8ae`](https://github.com/JedWatson/react-select/commit/bd4ee8ae66e581e8be1679fa4b1838451e3f23b7) [#5057](https://github.com/JedWatson/react-select/pull/5057) Thanks [@Rall3n](https://github.com/Rall3n)! - Prevent transition props from being forwarded to `<input>` element in `DummyInput` component\n\n## 5.2.2\n\n### Patch Changes\n\n- [`940a50b1`](https://github.com/JedWatson/react-select/commit/940a50b1a579b279b82c1efc5608a92eb422919e) [#4928](https://github.com/JedWatson/react-select/pull/4928) Thanks [@Methuselah96](https://github.com/Methuselah96)! - Fix usage with esModuleInterop disabled\n\n- [`54f9538e`](https://github.com/JedWatson/react-select/commit/54f9538e350bae4e11aa11311731cb95eb56d669) [#4941](https://github.com/JedWatson/react-select/pull/4941) Thanks [@prichey](https://github.com/prichey)! - Use React's AriaAttributes type directly rather than recreating\n\n- [`e97d45c0`](https://github.com/JedWatson/react-select/commit/e97d45c04bbc91e9e2ff9509f0d9c16fc4e4234e) [#4908](https://github.com/JedWatson/react-select/pull/4908) Thanks [@vjee](https://github.com/vjee)! - Make 3rd argument of CommonProps['setValue'] optional.\n\n## 5.2.1\n\n### Patch Changes\n\n- [`f172d7f9`](https://github.com/JedWatson/react-select/commit/f172d7f9c20b82db14e795d578ee4802475d2bdc) [#4886](https://github.com/JedWatson/react-select/pull/4886) Thanks [@Akridian](https://github.com/Akridian)! - Hooks for creation of custom Selects are now exported from main entry\n\n## 5.2.0\n\n### Minor Changes\n\n- [`6c7a3d1e`](https://github.com/JedWatson/react-select/commit/6c7a3d1e07b7d6a8f484a829e69b20eae5a92b91) [#4785](https://github.com/JedWatson/react-select/pull/4785) Thanks [@Rall3n](https://github.com/Rall3n)! - Add `prevInputValue` to action meta\n\n- [`b522ac65`](https://github.com/JedWatson/react-select/commit/b522ac658f85701ecf413436f3cf8d8d49117c82) [#4860](https://github.com/JedWatson/react-select/pull/4860) Thanks [@ebonow](https://github.com/ebonow)! - Fix animated MultiValue transitions when being removed and change method used to generate unique keys for Option components. Closes #4844 , closes #4602\n\n### Patch Changes\n\n- [`417e7217`](https://github.com/JedWatson/react-select/commit/417e721786af309ede9b35983a18df89363cd1c5) [#4842](https://github.com/JedWatson/react-select/pull/4842) Thanks [@Methuselah96](https://github.com/Methuselah96)! - Remove src directory from published package\n\n- [`480ea85b`](https://github.com/JedWatson/react-select/commit/480ea85bed6f7c90c45d14884b4ec1105d92971a) [#4846](https://github.com/JedWatson/react-select/pull/4846) Thanks [@Methuselah96](https://github.com/Methuselah96)! - Add missing index to MultiValue props type\n\n- [`b8e34472`](https://github.com/JedWatson/react-select/commit/b8e34472d352a87e9687027a5c3f4ed767984177) [#4854](https://github.com/JedWatson/react-select/pull/4854) Thanks [@mikunpham](https://github.com/mikunpham)! - Make input container css re-compute whenever input value changes due to a bug from `@emotion/react` in development env.\n\n## 5.1.0\n\n### Minor Changes\n\n- [8b38d49b](https://github.com/JedWatson/react-select/commit/8b38d49b4a779c653f70b502a61f7c64220fa44d) [#4807](https://github.com/JedWatson/react-select/pull/4807) Thanks [@hcharley](https://github.com/hcharley)! - Export AsyncCreatableProps from creatable entrypoint\n\n- [46eeda1a](https://github.com/JedWatson/react-select/commit/46eeda1a6829af168ae24b49a251d12e410706ab) [#4801](https://github.com/JedWatson/react-select/pull/4801) Thanks [@Methuselah96](https://github.com/Methuselah96)! - Export more types from main entry point\n\n### Patch Changes\n\n- [fdd01e66](https://github.com/JedWatson/react-select/commit/fdd01e664400b684b83c2b1c629bd3c76b152236) [#4833](https://github.com/JedWatson/react-select/pull/4833) Thanks [@ebonow](https://github.com/ebonow)! - Value container display property should be grid when isMulti and has no value so the Placeholder component is positioned correctly with the Input\n\n- [0937604f](https://github.com/JedWatson/react-select/commit/0937604ffcec5d56dd4918ae728feee345e1c78c) [#4823](https://github.com/JedWatson/react-select/pull/4823) Thanks [@mikunpham](https://github.com/mikunpham)! - Fix the issue where input contents are moved to the left due to multiple space characters.\n\n- [ec80b577](https://github.com/JedWatson/react-select/commit/ec80b577665f2bd9b2cff9d7ca34723b6b65e5b8) [#4803](https://github.com/JedWatson/react-select/pull/4803) Thanks [@Methuselah96](https://github.com/Methuselah96)! - Import CSSObject from @emotion/react instead of @emotion/serialize\n\n## 5.0.0\n\n### Major Changes\n\n- [ef87c3ac](https://github.com/JedWatson/react-select/commit/ef87c3ac7fd453800595eebebb85f1107f78d34c) [#4683](https://github.com/JedWatson/react-select/pull/4683) Thanks [@JedWatson](https://github.com/JedWatson)! - React-Select has been converted from Flow to TypeScript.\n\n  Other changes for v5 include usage of `forwardRef`, new hooks for `stateManager`, `async` and `creatable` components, and more reliable filtering implementation with new options in the creatable variant.\n\n### Patch Changes\n\n- [10225290](https://github.com/JedWatson/react-select/commit/10225290f9b1c9a722fc96fa4c74d91bfbeb7df8) [#4720](https://github.com/JedWatson/react-select/pull/4720) - Updated the layout for the singleValue input/placeholder/container so that it works better when used in flex layouts.\n\n- [53f1972b](https://github.com/JedWatson/react-select/commit/53f1972b2d76443a63df18eb538ccbf68787e362) [#4731](https://github.com/JedWatson/react-select/pull/4731) Thanks [@JedWatson](https://github.com/JedWatson)! - MultiValue key now includes a hyphen between the value and the index to prevent edge cases where you could get a duplicate key error\n\n- [b41f4ceb](https://github.com/JedWatson/react-select/commit/b41f4cebbcaa8714bcf36cf24357f580a74c6a16) [#4704](https://github.com/JedWatson/react-select/pull/4704) Thanks [@Rall3n](https://github.com/Rall3n)! - Fix findDOMNode deprecation by adding refs to transition components\n\n- [4b028829](https://github.com/JedWatson/react-select/commit/4b028829721bcd9014d70ee8dce1efbaf6373cd0) [#4634](https://github.com/JedWatson/react-select/pull/4634) - The readonly attribute has been removed from the DummyInput to improve accessibility\n\n- [7fcec537](https://github.com/JedWatson/react-select/commit/7fcec537e75b80b3084b64db76150cfef9d2ee2f) [#4697](https://github.com/JedWatson/react-select/pull/4697) - Add the role of combobox and the required ARIA attributes to the Input and DummyInput components to allow JAWS support and a better screen reader experience overall.\n\n- [ca2c0e5b](https://github.com/JedWatson/react-select/commit/ca2c0e5b18f0c862e7cb5956d0f56104ffa4255f) [#4756](https://github.com/JedWatson/react-select/pull/4756) Thanks [@fdcds](https://github.com/fdcds)! - Add `option` field to type of `CreateOptionActionMeta`\n\n- [9e82aadc](https://github.com/JedWatson/react-select/commit/9e82aadcd1931f730235d317a2299a681da8c373) [#4676](https://github.com/JedWatson/react-select/pull/4676) - The following improvements have been made for screen reader users:\n\n  - NVDA now announces the context text when initially focused\n  - Selected option/s (single and multi) are now announced when initially focused\n  - VoiceOver now announces the context text when re-focusing\n  - The clear action is now announced\n  - Placeholder text is now announced\n  - Mobile VoiceOver is now able to remove selected multi options\n\n- [638f5455](https://github.com/JedWatson/react-select/commit/638f545517d320fe70ca954511a71e96956abae3) [#4702](https://github.com/JedWatson/react-select/pull/4702) Thanks [@Methuselah96](https://github.com/Methuselah96)! - The Option generic is no longer required to extend the OptionBase type\n\n- [23cea0b5](https://github.com/JedWatson/react-select/commit/23cea0b513525bdf6282e3d03e66eff38da9e993) [#4782](https://github.com/JedWatson/react-select/pull/4782) Thanks [@Methuselah96](https://github.com/Methuselah96)! - Fix type of loadingMessage prop to allow it to return any ReactNode\n\n## 5.0.0-beta.1\n\n### Patch Changes\n\n- [10225290](https://github.com/JedWatson/react-select/commit/10225290f9b1c9a722fc96fa4c74d91bfbeb7df8) [#4720](https://github.com/JedWatson/react-select/pull/4720) - Updated the layout for the singleValue input/placeholder/container so that it works better when used in flex layouts.\n\n- [53f1972b](https://github.com/JedWatson/react-select/commit/53f1972b2d76443a63df18eb538ccbf68787e362) [#4731](https://github.com/JedWatson/react-select/pull/4731) Thanks [@JedWatson](https://github.com/JedWatson)! - MultiValue key now includes a hyphen between the value and the index to prevent edge cases where you could get a duplicate key error\n\n- [b41f4ceb](https://github.com/JedWatson/react-select/commit/b41f4cebbcaa8714bcf36cf24357f580a74c6a16) [#4704](https://github.com/JedWatson/react-select/pull/4704) Thanks [@Rall3n](https://github.com/Rall3n)! - Fix findDOMNode deprecation by adding refs to transition components\n\n- [7fcec537](https://github.com/JedWatson/react-select/commit/7fcec537e75b80b3084b64db76150cfef9d2ee2f) [#4697](https://github.com/JedWatson/react-select/pull/4697) - Add the role of combobox and the required ARIA attributes to the Input and DummyInput components to allow JAWS support and a better screen reader experience overall.\n\n- [9e82aadc](https://github.com/JedWatson/react-select/commit/9e82aadcd1931f730235d317a2299a681da8c373) [#4676](https://github.com/JedWatson/react-select/pull/4676) - The following improvements have been made for screen reader users:\n\n  - NVDA now announces the context text when initially focused\n  - Selected option/s (single and multi) are now announced when initially focused\n  - VoiceOver now announces the context text when re-focusing\n  - The clear action is now announced\n  - Placeholder text is now announced\n  - Mobile VoiceOver is now able to remove selected multi options\n\n- [638f5455](https://github.com/JedWatson/react-select/commit/638f545517d320fe70ca954511a71e96956abae3) [#4702](https://github.com/JedWatson/react-select/pull/4702) Thanks [@Methuselah96](https://github.com/Methuselah96)! - The Option generic is no longer required to extend the OptionBase type\n\n## 5.0.0-beta.0\n\n### Major Changes\n\n- [ef87c3ac](https://github.com/JedWatson/react-select/commit/ef87c3ac7fd453800595eebebb85f1107f78d34c) [#4489](https://github.com/JedWatson/react-select/pull/4489) Thanks [@Methuselah96](https://github.com/Methuselah96)! - React-Select has been converted from Flow to TypeScript.\n\n  Other changes for v5 include usage of `forwardRef`, new hooks for `stateManager`, `async` and `creatable` components, and more reliable filtering implementation with new options in the creatable variant.\n\n- [#4625](https://github.com/JedWatson/react-select/pull/4625) Thanks [@ebonow](https://github.com/ebonow)! - Remove dependency on AutoSizeInput\n  - BREAKING CHANGES:\n    - IE11 no longer works as it does not fully support CSS grid\n    - Renaming the .prefix\\_\\_input now targets the input and NOT the container. Unfortunate but overdue and perhaps opens the door to completely decoupling the input from needing a container if autosizing is not important.\n\n### Patch Changes\n\n- [4b028829](https://github.com/JedWatson/react-select/commit/4b028829721bcd9014d70ee8dce1efbaf6373cd0) [#4634](https://github.com/JedWatson/react-select/pull/4634) - The readonly attribute has been removed from the DummyInput to improve accessibility\n\n---\n\n## 4.3.1\n\n### Patch Changes\n\n- [2c915d10](https://github.com/JedWatson/react-select/commit/2c915d10b5ce7b7f48aa0903fa838f9c294c434d) [#4577](https://github.com/JedWatson/react-select/pull/4577) - Bump @emotion/cache to v11.4.0 which fixes an issue where different versions of Emotion running at the same time causes styles to disappear in production.\n\n## 4.3.0\n\n### Minor Changes\n\n- [035294f4](https://github.com/JedWatson/react-select/commit/035294f457921423c9237861f7c73584bdecbcc4) [#3360](https://github.com/JedWatson/react-select/pull/3360) Thanks [@JedWatson](https://github.com/JedWatson)! - Now pass the focusedOption to the MenuList Component as a prop\n\n### Patch Changes\n\n- [7a414a7c](https://github.com/JedWatson/react-select/commit/7a414a7c7a1f8e2902e43bd476e3db17a8dce049) [#3262](https://github.com/JedWatson/react-select/pull/3262) Thanks [@JedWatson](https://github.com/JedWatson)! - The Menu bottom is no longer scrolled into view when menuShouldScrollIntoView=false\n\n## 4.2.1\n\n### Patch Changes\n\n- [ca3c41bb](https://github.com/JedWatson/react-select/commit/ca3c41bb55e2666589bbbb69d1153357191d07a4) [#4478](https://github.com/JedWatson/react-select/pull/4478) Thanks [@ebonow](https://github.com/ebonow)! - Check passive events polyfill for the existence of window for SSR\n\n## 4.2.0\n\n### Minor Changes\n\n- [2ffed9c6](https://github.com/JedWatson/react-select/commit/2ffed9c6c40c9d5b81d7c8faf7bfc995976299ec) [#4444](https://github.com/JedWatson/react-select/pull/4444) Thanks [@Rall3n](https://github.com/Rall3n)! - Use accessor props to get value and label in `compareOption`\n\n- [2baf5a9d](https://github.com/JedWatson/react-select/commit/2baf5a9df2f4f56f9c9374fcb879cb5259a6d8d0) [#4414](https://github.com/JedWatson/react-select/pull/4414) Thanks [@ebonow](https://github.com/ebonow)! - Add ariaLiveMessages prop for internationalization and other customisations\n\n- [7cdb8a6b](https://github.com/JedWatson/react-select/commit/7cdb8a6b4d9de89a599b3aee8b6d90a44a931ea6) [#4391](https://github.com/JedWatson/react-select/pull/4391) Thanks [@ebonow](https://github.com/ebonow)! - Pass and sanitize CommonProps passed to Group and Input components\n\n### Patch Changes\n\n- [c955415c](https://github.com/JedWatson/react-select/commit/c955415cd3724489423dd8e84d6dab5ace24c984) [#4437](https://github.com/JedWatson/react-select/pull/4437) Thanks [@ebonow](https://github.com/ebonow)! - Set event listeners to be non-passive to remove Chrome console warnings\n\n- [3ca22b2f](https://github.com/JedWatson/react-select/commit/3ca22b2f49ad4f05f98ec8a565d74c483c0b98aa) [#3827](https://github.com/JedWatson/react-select/pull/3827) Thanks [@emmatown](https://github.com/emmatown)! - Memoize stripDiacritics in createFilter for the input with memoize-one so that stripDiacritics is not called for the same string as many times as there are options every time the input changes\n\n  Inspired by https://blog.johnnyreilly.com/2019/04/react-select-with-less-typing-lag.html\n\n- [dce3863f](https://github.com/JedWatson/react-select/commit/dce3863ff2ba8dfb50f505d81a2e70cf2d7a97e7) [#4423](https://github.com/JedWatson/react-select/pull/4423) Thanks [@Methuselah96](https://github.com/Methuselah96)! - Remove browser alias fields in order to fix SSR apps\n\n- [ec7c0728](https://github.com/JedWatson/react-select/commit/ec7c0728c5bfe98a81ab557699147ae244f7a073) [#4443](https://github.com/JedWatson/react-select/pull/4443) Thanks [@ebonow](https://github.com/ebonow)! - Allow tabIndex prop Type to be number or string\n\n## 4.1.0\n\n### Minor Changes\n\n- [b5f9b0c5](https://github.com/JedWatson/react-select/commit/b5f9b0c59d7ac8559f88287ba73f0495b4c8eed2) [#4342](https://github.com/JedWatson/react-select/pull/4342) Thanks [@Methuselah96](https://github.com/Methuselah96)! - Standardized innerProps and className props on customisable components\n\n- [19b76342](https://github.com/JedWatson/react-select/commit/19b763428d6df254f0b9662f18a698dd3c59d83b) [#3911](https://github.com/JedWatson/react-select/pull/3911) Thanks [@eugenet8k](https://github.com/eugenet8k)! - Add `removedValues` to `onChange` event meta when the action is `clear` (when the user clears the value in the Select)\n\n### Patch Changes\n\n- [f600d13f](https://github.com/JedWatson/react-select/commit/f600d13f5981c9e54e78247fdd82f62555373cff) [#4422](https://github.com/JedWatson/react-select/pull/4422) Thanks [@Methuselah96](https://github.com/Methuselah96)! - Fix finding focusable options for groups\n\n- [a016c878](https://github.com/JedWatson/react-select/commit/a016c87821d9289ef9c317c0c397d64a0824ce16) [#4420](https://github.com/JedWatson/react-select/pull/4420) Thanks [@Methuselah96](https://github.com/Methuselah96)! - Bump dependency on @babel/runtime in order to fix compatibility issues with Webpack 5\n\n- [10b5f5a5](https://github.com/JedWatson/react-select/commit/10b5f5a5edc93becb6b46f22666305ec8c1b7de3) [#4404](https://github.com/JedWatson/react-select/pull/4404) Thanks [@Methuselah96](https://github.com/Methuselah96)! - Remove unnecessary dependency on @emotion/css\n\n## 4.0.2\n\n### Patch Changes\n\n- [44f285b0](https://github.com/JedWatson/react-select/commit/44f285b0d4a50e16713b9aa3746d73d80dee2c91) [#4399](https://github.com/JedWatson/react-select/pull/4399) Thanks [@Methuselah96](https://github.com/Methuselah96)! - Fixed building focusable options from groups\n\n## 4.0.1\n\n### Patch Changes\n\n- [645feb3e](https://github.com/JedWatson/react-select/commit/645feb3e34776a5f181b32f603027df5ca709b7d) [#4396](https://github.com/JedWatson/react-select/pull/4396) Thanks [@Methuselah96](https://github.com/Methuselah96)! - Fixed keys for options within groups\n\n## 4.0.0\n\n### Major Changes\n\n- [02050675](https://github.com/JedWatson/react-select/commit/020506755728f607a77145e2a00458526596496f) [#4339](https://github.com/JedWatson/react-select/pull/4339) Thanks [@Methuselah96](https://github.com/Methuselah96)! - Standardized value passed to onChange\n\n- [26b6325c](https://github.com/JedWatson/react-select/commit/26b6325c95113591e568451bc2296f98318a8dd9) [#4283](https://github.com/JedWatson/react-select/pull/4283) Thanks [@majgaard](https://github.com/majgaard)! - Upgrades Emotion dependency to v11.0.0\n\n  BREAKING CHANGE: The NonceProvider component now requires a `cacheKey` prop that corresponds to the `key` for the Emotion cache.\n\n- [b2488bb5](https://github.com/JedWatson/react-select/commit/b2488bb561ed08c822bc1a828d2d9fd957f25bdf) [#4313](https://github.com/JedWatson/react-select/pull/4313) Thanks [@Methuselah96](https://github.com/Methuselah96)! - Removed usages of UNSAFE React methods\n\n### Patch Changes\n\n- [2d5496d5](https://github.com/JedWatson/react-select/commit/2d5496d52b6650b57352a0ea0dfcab383567f3ac) [#4388](https://github.com/JedWatson/react-select/pull/4388) Thanks [@Methuselah96](https://github.com/Methuselah96)! - Removed memoization of buildMenuOptions\n\n## 3.2.0\n\n### Minor Changes\n\n- [c615e93d](https://github.com/JedWatson/react-select/commit/c615e93dbca15b9f9c6c3e6437744ca53703347f) [#4084](https://github.com/JedWatson/react-select/pull/4084) Thanks [@JedWatson](https://github.com/JedWatson)! - Changed the `cx` and `getValue` props that are passed to components into instance properties, which means they now pass a referential equality check on subsequent renders.\n\n  This is helpful, for example, when you're optimising the performance of rendering custom Option components - see [#3055](https://github.com/JedWatson/react-select/issues/3055)\n\n- [72f6036f](https://github.com/JedWatson/react-select/commit/72f6036fa6f425837c8c2326bf91dff7bd7f6147) [#4306](https://github.com/JedWatson/react-select/pull/4306) Thanks [@bladey](https://github.com/bladey)! - Remove duplicate prop createOptionPosition\n\n### Patch Changes\n\n- [ee638d46](https://github.com/JedWatson/react-select/commit/ee638d4615e789090ea860d2e1c9f4d95a829d50) [#4275](https://github.com/JedWatson/react-select/pull/4275) Thanks [@Methuselah96](https://github.com/Methuselah96)! - Adds react ^17.0.0 to peer dependencies for React 17 support\n\n- [a0133f19](https://github.com/JedWatson/react-select/commit/a0133f19f45eb2dc9a2faebd74e18f44da7d509b) [#4154](https://github.com/JedWatson/react-select/pull/4154) Thanks [@brenshanny](https://github.com/brenshanny)! - Creatable: Fixed removing MultiValues that have identical values. See issue #4137 for details.\n\n- [d1e660c6](https://github.com/JedWatson/react-select/commit/d1e660c6b261d7fd60a85a6eca2ee9e3e0348ea2) [#4213](https://github.com/JedWatson/react-select/pull/4213) Thanks [@eythort](https://github.com/eythort)! - Added a guard to the `ScrollCaptor` component to check that `el` exists before calling `removeEventListener`, fixes intermittent errors\n\n- [a1e1db25](https://github.com/JedWatson/react-select/commit/a1e1db255aceda301d9705d0639e7ca0302bd079) [#4373](https://github.com/JedWatson/react-select/pull/4373) Thanks [@Methuselah96](https://github.com/Methuselah96)! - Fixed value passed to onChange when clearing value\n\n- [2ad29d61](https://github.com/JedWatson/react-select/commit/2ad29d615bc769c3b3dc4177eb0007a267369748) [#4136](https://github.com/JedWatson/react-select/pull/4136) Thanks [@Methuselah96](https://github.com/Methuselah96)! - Base aria-live message on tabSelectsValue prop\n\n- [ad890f27](https://github.com/JedWatson/react-select/commit/ad890f279300b6baaca55a642141999a79af8883) [#4326](https://github.com/JedWatson/react-select/pull/4326) Thanks [@Methuselah96](https://github.com/Methuselah96)! - Updated react-input-autosize to v3.0.0\n\n- [b28d9922](https://github.com/JedWatson/react-select/commit/b28d99222ab191db27482c6219f8c8b12ef753d8) [#3990](https://github.com/JedWatson/react-select/pull/3990) Thanks [@nikitaindik](https://github.com/nikitaindik)! - Fixed onCreateOption is not always called for Creatable\n\n- [24ba8702](https://github.com/JedWatson/react-select/commit/24ba8702b93885790ee919de8c01ea8f44d1c354) [#4289](https://github.com/JedWatson/react-select/pull/4289) Thanks [@slimklim](https://github.com/slimklim)! - Added `innerProps` prop to the built-in `MenuList` component to reduce the need for additional DOM nodes or forking internal code when passing additional props to the DOM element the MenuList component is rendering.\n\n  See issue [#4265](https://github.com/JedWatson/react-select/issues/4265) for an explanation.\n\n## 3.1.1\n\n### Patch Changes\n\n- [c8d74bd5](https://github.com/JedWatson/react-select/commit/c8d74bd5710b1db6736837fb4334a59e46614a27) [#3979](https://github.com/JedWatson/react-select/pull/3979) Thanks [@emmatown](https://github.com/emmatown)! - Fix repository field\n\n- [c8447f48](https://github.com/JedWatson/react-select/commit/c8447f480f8b9ca04386bee08e8d3a6fbb4f07c8) [#4034](https://github.com/JedWatson/react-select/pull/4034) Thanks [@sophiebits](https://github.com/sophiebits)! - Improve performance of option filtering when ignoreAccents is enabled (the default)\n\n- [7af1aafb](https://github.com/JedWatson/react-select/commit/7af1aafb2314db02544b7970784b868e97ec4824) [#4295](https://github.com/JedWatson/react-select/pull/4295) Thanks [@JedWatson](https://github.com/JedWatson)! - Fix menuplacement context\n\n- [32ad5c04](https://github.com/JedWatson/react-select/commit/32ad5c040bdd96cd1ca71010c2558842d684629c) [#3892](https://github.com/JedWatson/react-select/pull/3892) Thanks [@flexdinesh](https://github.com/flexdinesh)! - Fix react-select ignoring HTML5 \"form\" attribute\n\n- [6af14fbb](https://github.com/JedWatson/react-select/commit/6af14fbbc8ab42f2d17721732c9fe221d47c9e30) [#3897](https://github.com/JedWatson/react-select/pull/3897) Thanks [@lorisdev](https://github.com/lorisdev)! - Removes the call to `onMenuOpen` on every input change\n\n  If you were relying on this undesired behavior it may be a breaking change.\n  Please upgrade accordingly.\n\n- [0eb1ef96](https://github.com/JedWatson/react-select/commit/0eb1ef9625de907fddaf29516cec3bd93bf9c5f7) Thanks [@JedWatson](https://github.com/JedWatson)! - Fixes touch issues in IE11\n\n- [ad608c8f](https://github.com/JedWatson/react-select/commit/ad608c8f1f445e70a082bae755dd30bda5b5f205) [#3928](https://github.com/JedWatson/react-select/pull/3928) Thanks [@dpordomingo](https://github.com/dpordomingo)! - Update MenuPlacer context usage in order to the new React Context API\n\n## 3.1.0\n\n### Minor Changes\n\n- [4cf6c43c](https://github.com/JedWatson/react-select/commit/4cf6c43cc17a01b043fb60b33cad355d433fdf8c) [#3690](https://github.com/JedWatson/react-select/pull/3690) Thanks [@JedWatson](https://github.com/JedWatson)! - Add `isLoading` prop support to the AsyncSelect component (see #3690)\n\n### Patch Changes\n\n- [83b48de4](https://github.com/JedWatson/react-select/commit/83b48de4a18263b361744fc5e89d9b9845b26e4f) [#3868](https://github.com/JedWatson/react-select/pull/3868) Thanks [@Tirzono](https://github.com/Tirzono)! - Fix for not focusing the selected value when the menu opens\n- [563b046a](https://github.com/JedWatson/react-select/commit/563b046a57a94c47950e62cedc4ce1c489f19f91) [#3794](https://github.com/JedWatson/react-select/pull/3794) Thanks [@emmatown](https://github.com/emmatown)! - Convert class components that don't have to be class components to function components to reduce bundle size\n- [c7e9c697](https://github.com/JedWatson/react-select/commit/c7e9c697dada15ce3ff9a767bf914ad890080433) [#3682](https://github.com/JedWatson/react-select/pull/3682) Thanks [@JedWatson](https://github.com/JedWatson)! - Allow the input component to be a `textarea` element\n- [3c7de0de](https://github.com/JedWatson/react-select/commit/3c7de0de52826fe74d303a01475c43fe88256156) [#3090](https://github.com/JedWatson/react-select/pull/3090) Thanks [@akiselev](https://github.com/akiselev)! - Add aria attributes to dummy input\n- [d2a820ef](https://github.com/JedWatson/react-select/commit/d2a820efc70835adf864169eebc76947783a15e2) [#3537](https://github.com/JedWatson/react-select/pull/3537) Thanks [@jdelStrother](https://github.com/jdelStrother)! - Fix Flow issues. Refer to the linked PR for more details on the specific issues.\n- [fc52085b](https://github.com/JedWatson/react-select/commit/fc52085b969b1b6f53adf29d52469db9560b828c) [#3662](https://github.com/JedWatson/react-select/pull/3662) Thanks [@eemeli](https://github.com/eemeli)! - Update react-transition-group to ^4.3.0\n- [edb18dd3](https://github.com/JedWatson/react-select/commit/edb18dd3d65b8fbc342bde9e805c5e3293ab6e37) [#3797](https://github.com/JedWatson/react-select/pull/3797) Thanks [@emmatown](https://github.com/emmatown)! - Enable Babel loose mode to improve bundle size\n\n## 3.0.8\n\n### Patch Changes\n\n- [a575a3c4](https://github.com/JedWatson/react-select/commit/a575a3c41798696620c77e8098c1150b4adda6cb) [#3727](https://github.com/JedWatson/react-select/pull/3727) Thanks [@tonytangau](https://github.com/tonytangau)! - Adding an `index` prop to `MultiValue` components\n- [916f0d2c](https://github.com/JedWatson/react-select/commit/916f0d2c651189bfeff2289d8d3cc597e06cb2ea) [#3644](https://github.com/JedWatson/react-select/pull/3644) Thanks [@TrySound](https://github.com/TrySound)! - Remove usage of `raf` package and replace with `window.requestAnimationFrame` because React already depends on `requestAnimationFrame`\n- [cba15309](https://github.com/JedWatson/react-select/commit/cba15309c4d7523ab6a785c8d5c0c7ec1048e22f) [#3676](https://github.com/JedWatson/react-select/pull/3676) Thanks [@wiesys](https://github.com/wiesys)! - Fix `loadingMessage` and `noOptionsMessage` properties in `Styles` flow type\n- [32f9475e](https://github.com/JedWatson/react-select/commit/32f9475e6d43a71000a3906da9e6d2d30710efd2) [#3790](https://github.com/JedWatson/react-select/pull/3790) Thanks [@JedWatson](https://github.com/JedWatson)! - Remove unnecessary dependency on `classnames` package\n- [1731175d](https://github.com/JedWatson/react-select/commit/1731175d790530b9dbfa787e3fffaff3fb0e44a0) [#3733](https://github.com/JedWatson/react-select/pull/3733) Thanks [@ddc67cd](https://github.com/ddc67cd)! - Pass `name` to `onChange` meta in `Creatable` to make it consistent with onChange in standard `Select`\n\n## 3.0.7\n\n### Patch Changes\n\n- [df864f2](https://github.com/JedWatson/react-select/commit/df864f2) - Include updated yarn.lock\n\n## 3.0.6\n\n### Patch Changes\n\n- [3e0a7a7](https://github.com/JedWatson/react-select/commit/3e0a7a7) - \\* remove emotion 9 dep from mono repo (this wasn't being used anywhere)\n  - update dep on react-input-autosize to 2.2.2 (adds UNSAFE prefix to deprecated lifecycles) (resolves #3773)\n\n## 3.0.5\n\n### Patch Changes\n\n- [270cc01](https://github.com/JedWatson/react-select/commit/270cc01) [#3719](https://github.com/JedWatson/react-select/pulls/3719) Thanks [@jossmac](https://github.com/jossmac)! - Leverage currentColor for loading indicator dots -- makes styling easier, and more consistent, for consumers\n- [bab8af1](https://github.com/JedWatson/react-select/commit/bab8af1) - Update lifecycle methods with UNSAFE prefix\n\n## 3.0.4\n\n### Patch Changes\n\n- [cd8c3090](https://github.com/JedWatson/react-select/commit/cd8c3090) [#3586](https://github.com/JedWatson/react-select/pull/3586) Thanks [@emmatown](https://github.com/emmatown)! - Add base entrypoint back\n\n- [#3569](https://github.com/JedWatson/react-select/pull/3569) Thanks [@vadimka123](https://github.com/vadimka123) - Performance improvement: menu items are built when the menu opens, not in the constructor\n\n- [#3326](https://github.com/JedWatson/react-select/pull/3326) Thanks [@stevemao](https://github.com/stevemao) Fix for iOS focus management when clearing the select value\n\n- [#3532](https://github.com/JedWatson/react-select/pull/3532) Thanks [@alisonhall](https://github.com/alisonhall)! - Change aria-live assertive to polite\n\n## 3.0.3\n\n- Remove base entrypoint to fix rollup dependency resolution issue\n\n## 3.0.2\n\n- fix erroneous build\n\n## 3.0.1\n\n- [patch][](https://github.com/JedWatson/react-select/commit/):\n\n  - Add README.md file for npm\n\n## 3.0.0\n\n- [major][9ad152b](https://github.com/JedWatson/react-select/commit/9ad152b) [#3574](https://github.com/JedWatson/react-select/pulls/3574) Thanks [@gwyneplaine](https://github.com/gwyneplaine):\n  - Upgrade emotion dependency from 9.x to 10.x [#3321](https://github.com/JedWatson/react-select/pull/3321)\n  - Normalize Values [#3416](https://github.com/JedWatson/react-select/pull/3416)\n  - Separate entrypoints for Async, Creatable and makeAnimated [#3541](https://github.com/JedWatson/react-select/pull/3541)\n  - UMD builds deprecated\n  - required react peer-dependecy of 16.8\n\n## v2.4.4 / 2019-05-27\n\n### BugFixes\n\n- [#3540] Fixed active styles previously being applied to disabled options. Thanks [@risenforces](https://github.com/risenforces)\n- [#3563] Fixed IME composition bugs in non Chrome browsers. Thanks [@jwilander](https://github.com/jwilander)\n\n## v2.4.3 / 2019-03-17\n\n### Bugfixes\n\n- [#3492](https://github.com/JedWatson/react-select/pull/3492) Add labels to fields to make inspection. [@destructobeam](https://github.com/destructobeam)\n- [#3442](https://github.com/JedWatson/react-select/pull/3442) Ignore keydown events on `Enter` in IME. [@sat0yu](https://github.com/sat0yu).\n- [#3343](https://github.com/JedWatson/react-select/pull/3343) fix lint issues. [@JoshMcCullough](https://github.com/JoshMcCullough).\n- [#3498](https://github.com/JedWatson/react-select/pull/3498) Fix async type. [@mufasa71](https://github.com/mufasa71)\n- [#3436](https://github.com/JedWatson/react-select/pull/3436) Allow Node as placeholder [@eemeli](https://github.com/eemeli).\n\n## v2.4.2 / 2019-03-11\n\n### Bug fixes\n\n- [#3446](https://github.com/JedWatson/react-select/pull/3446) Fix bug with select input value not being selectable. Thanks [kangweichan](https://github.com/kangweichan).\n- [#3445](https://github.com/JedWatson/react-select/pull/3446) Fix accessibility bug. Disabled options are now focusable and announced by screen-readers but not selectable. Thanks [sarahbethfederman](https://github.com/sarahbethfederman).\n\n## Updates\n\n- Fixed typo in style docs. Thanks [thiagodebastos](https://github.com/thiagodebastos).\n- [#3460](https://github.com/JedWatson/react-select/pull/3460) Added description for actionTypes to docs. Thanks [mikekellyio](https://github.com/mikekellyio)\n\n## v2.4.1 / 2019-02-18\n\n### Bug fixes\n\n- [#3432](https://github.com/JedWatson/react-select/pull/3432) Fix bug with select menu's not working on mobile.\n\n## v2.4.0 / 2019-02-15\n\n### Bug fixes\n\n- [#3427](https://github.com/JedWatson/react-select/pull/3427) remove focusOption() invocation on ENTER press if the menu is not open.\n- [#3402](https://github.com/JedWatson/react-select/pull/3402) fix menu scroll being reset on focus of a select with an open menu in ie11. See [#3342](https://github.com/JedWatson/react-select/issues/3342) for details. Thanks [timothypage](https://github.com/timothypage)\n- [#3420](https://github.com/JedWatson/react-select/pull/3420) fixed select menu being opened on click, when openMenuOnClick is false. Thanks [caleb](https://github.com/caleb) and [rscotten](https://github.com/rscotten)\n- [#3419](https://github.com/JedWatson/react-select/pull/3419) fixed bug with ScrollCaptor operating on an undefined scrollTarget. Thanks [iulian-radu-at](https://github.com/iulian-radu-at)\n- [#3411](https://github.com/JedWatson/react-select/pull/3411) fix bug where Enter key press on select with a closed menu wouldn't propagate up. Resolves [#2217](https://github.com/JedWatson/react-select/issues/2217).\n- [#3407](https://github.com/JedWatson/react-select/pull/3407) remove unnecessary aria-roles from menu and options. This is now all handled by our aria-live implementation. Resolves [#3355](https://github.com/JedWatson/react-select/issues/3355). Thanks [sarahbethfederman](https://github.com/sarahbethfederman).\n- [#3393](https://github.com/JedWatson/react-select/pull/3393), fix aria live announcement text for removing a selected option. Thanks [msharkeyiii](https://github.com/msharkeyiii).\n- [#3350](https://github.com/JedWatson/react-select/pull/3350) Updated to 0.91 of flow. Updated types to pass stricter type checking, in later versions of flow. Thanks [DragonWW](https://github.com/DragorWW)\n\n### Updates\n\n- [#3370](https://github.com/JedWatson/react-select/pull/3370) Updated memoize-one dependency to 5.0.0. Thanks [adam187](https://github.com/adam187)\n- [#3366](https://github.com/JedWatson/react-select/pull/3366/files) Update build tooling, to leverage babel 7. Thanks [DragonWW](https://github.com/DragorWW)\n\n## v2.3.0 / 2019-01-18\n\n### Bug fixes\n\n- [#3315](https://github.com/JedWatson/react-select/pull/3315) add RAF call to Collapse component getRef() such that getBoundingClientRect() is invoked consistently.\n- [#3275](https://github.com/JedWatson/react-select/pull/3275/files) wrap String invocation around inputValue to avoid calling toLowerCase on invalid elements. thanks [tavareshenrique](https://github.com/tavareshenrique)\n- [#3357](https://github.com/JedWatson/react-select/pull/3357), fix loadOptions call in Async select to always pass in a string for the inputValue.\n- [#3346](https://github.com/JedWatson/react-select/pull/3346) Revert work done in CSP nonce PR [#3260](https://github.com/JedWatson/react-select/pull/3260) to unblock react-select usage in an SSR setting. Users who need nonce support still, please pin your version of react-select at 2.2.0. Nonce support will be re-added in 3.0.0 along with an upgrade to emotion 10; which includes nonce support without having to provide a custom emotion instance.\n\n### Features\n\n- [#3115](https://github.com/JedWatson/react-select/pull/3115) menu-is-open modifier added to control class when the menu is open. [@s20lee](https://github.com/s20lee)\n\n## v2.2.0 / 2018-12-28\n\n### Bug Fixes\n\n- [#3296](https://github.com/JedWatson/react-select/pull/3296) Fix for tab interactions when in composition mode with an IME. Thanks [yshr446](https://github.com/yshr446) for the PR.\n- [#3302](https://github.com/JedWatson/react-select/pull/3302) Fix to breaking android and mobile safari touch bug [#2755](https://github.com/JedWatson/react-select/issues/2755), by adding more conscientious checks to the onTouchStart and onTouchMove listeners. Thanks [xakep139](https://github.com/xakep139) for the PR.\n- [#3303](https://github.com/JedWatson/react-select/pull/3303) Input and GroupHeading components now get passed the selectProps prop, thanks [maxmarchuk](https://github.com/maxmarchuk) for the PR.\n- [#3260](https://github.com/JedWatson/react-select/pull/3260) As a result of the CSP nonce support feature, the emotion instance is now cached and passed down to all internal components, meaning that users looking to heavily customise their Select components can do so without externally importing emotion, and nonce instances are respected per select instance. Please see [this segment](https://react-select.com/styles#cx-and-custom-components) in the docs for a more detailed explanation.\n- [#3299](https://github.com/JedWatson/react-select/pull/3299) fix to assistive text on menu open.\n\n### Feature\n\n- [#3260](https://github.com/JedWatson/react-select/pull/3260) Add CSP nonce support to Select, thanks [Avaq](https://github.com/Avaq) and [Andarist](https://github.com/Andarist) for the heavy lifting.\n\n## v2.1.2 / 2018-11-22\n\n### Bug fixes\n\n- [#3161] Initialize state with `inputValue` when `defaultOptions` is true in AsyncSelect, resolves [#3160](https://github.com/JedWatson/react-select/issues/3160), thanks [@cutterbl](https://github.com/cutterbl)\n- [#3096] Placeholder component now also receives the isFocused state value as a prop. Thanks [@Nelrohd](https://github.com/Nelrohd)\n- [#3060] Fix bug where trying to set the cursor somewhere in an input value would close the menu. Thanks [@stijndeschuymer](https://github.com/stijndeschuymer)\n- [#3163] Fixed bug where isDisabled wasn't being reflected onto the DummyInput, which meant that disabled non searchable selects were still focusable. Thanks [@gm0t](https://github.com/gm0t)\n- [#3216] Fixes bug where clearing with backspace in a single select would result in an empty array, as opposed to the expected empty object. Thanks [@IanVS](https://github.com/IanVS)\n- [#3013] Fixes bug where the menu would close on trying to scroll using the scroll bar in IE11. Thanks [@rakid](https://github.com/rakid)\n\n### Misc\n\n- A big shoutout to everyone who helped contribute to the docs. In no particular order [@acrawford13](https://github.com/JedWatson/react-select/commits?author=acrawford13), [@kirillku](https://github.com/kirillku), [@ajaymathur](https://github.com/ajaymathur), [@mgalgs](https://github.com/mgalgs), [@cutterbl](https://github.com/cutterbl), [@JonathanWbn](https://github.com/JonathanWbn), [@mwood23](https://github.com/mwood23), [@stevemao](https://github.com/stevemao), [@jossmac](https://github.com/jossmac), and anyone else I've missed.\n- Thanks to [@IanVS](https://github.com/IanVS) for cleaning up our cypress tests.\n\n## v2.1.1 / 2018-10-24\n\n### Bug fixes\n\n- [#3132] Strip theme props from default Input and GroupHeading components, as they were polluting the DOM.\n- [#3131] Add support for the 'Delete' key in the internal onKeyDown method. Same functionality as 'Backspace'.\n- [#3100] Update flow-types and normalised default prop declarations in indicators. Thanks [iseredov](https://github.com/iseredov)\n\n### Updates\n\n- [#3083] Added sideEffects property to package.json to support tree-shaking in webpack 4.x. Thanks [SimenB](https://github.com/SimenB).\n- [#3078] Update jest dependency to 23.6.0. Thanks [papandreou](https://github.com/papandreou)\n- [#3065] Update babel-plugin-emotion to 9.2.10. Thanks [mtzhang](https://github.com/mtzhang)\n- [#3108] Update docs to include instructions for replicating the simple-value use case within react-select v2. Thanks [elboletaire](https://github.com/elboletaire)\n\n## v2.1.0 / 2018-10-03\n\n- [#2839] Added support for theming via theme prop. Thanks [akx](https://github.com/akx)\n- [#2874] Fixed flow-types of MultiValue components. Thanks [mike1808](https://github.com/mike1808)\n- [#2903] Fix missing form input when there isn't a selected value. Thanks [alvinsj](https://github.com/alvinsj)\n- [#2934] Reduced theme colors to a sane value set to make the exported theme more easy to consume and configure. Thanks [jossmac](https://github.com/jossmac)\n- [#2876] Added overflow hidden to valueContainer to stop overflowing text in the control. Thanks [mike1808](https://github.com/mike1808)\n- [#2975] Separated menu placement logic from menu primitive. Thanks [jossmac](https://github.com/jossmac).\n\n## v2.0.0 / 2018-07-23\n\n- async select now accepts a filterOptions function as a prop [#2822](https://github.com/JedWatson/react-select/pull/2822)\n- [BREAKING] react-select now exports react-select.esm.js from dist instead of react-select.es.js [#2641](https://github.com/JedWatson/react-select/pull/2641)\n- [BREAKING] innerRef assignments in custom components must now be made from the root of the prop object, as opposed to reaching into innerProps. This is part of the work to normalize the behaviour circa custom components. [#2824](https://github.com/JedWatson/react-select/pull/2824)\n- className and classNamePrefix deprecation warning and backward compatibility removed. className now only affects the select container, classNamePrefix prefixes all internal components. [#2820](https://github.com/JedWatson/react-select/pull/2820)\n- Added `closeMenuOnScroll` prop, which can either be a `boolean` or a `function`, if set to `true` the select menu will close on scroll of the document/body. If a function is supplied, it must take the following shape `(event: ScrollEvent) => boolean`, the boolean value will be used to resolve whether the menu should be closed or stay open. [#2809](https://github.com/JedWatson/react-select/pull/2809), thanks [Vynlar](https://github.com/Vynlar) for this.\n- Added fix to support IME inputs. [#2767](https://github.com/JedWatson/react-select/pull/2767), thanks [shamabe](https://github.com/shamabe)\n- Removed primitives, and normalise multi-value components to be in line with existing component customisation patterns. [#2821](https://github.com/JedWatson/react-select/pull/2821)\n- Normalised isOptionDisabled to be inline with its sibling prop isOptionSelected. [#2821](https://github.com/JedWatson/react-select/pull/2695) Thanks [SimeonC](https://github.com/SimeonC)\n- [#2814](https://github.com/JedWatson/react-select/pull/2814) Added memoization to custom components within Select.js as well as in the exported makeAnimated factory method. Thanks to [Alex Reardon's](https://github.com/alexreardon) [memoize-one](https://github.com/alexreardon/memoize-one)\n- [#2652](https://github.com/JedWatson/react-select/pull/2652), Async Select now re-evaluates defaultOptions on componentWillReceiveProps. Thanks [jesstelford](https://github.com/jesstelford)\n\n## v2.0.0-beta.7 / 2018-07-03\n\n- Removed old aria-attributes in Option, MenuList and other components in favor of an aria-live-region implementation. `screenReaderStatus` prop is still at the moment untouched, and `aria-labelledby` and `aria-label` props are still available and retain their functionality. See [#2581](https://github.com/JedWatson/react-select/pull/2581).\n- Internal ref `input` is now `inputRef` for consistency.\n- Internal ref `menuRef` is now `menuListRef` for consistency.\n- Fixed bug with MultiValueRemove interaction not working in mobile [#2762](https://github.com/JedWatson/react-select/pull/2762), thanks [chuckbergeron](https://github.com/chuckbergeron).\n- Added makeAnimated function export, that takes passed in components and wraps them in higher order components that expose animated functionality. [#2724](https://github.com/JedWatson/react-select/pull/2724)\n- Added functionality to not render the menu if `noOptionsMessage` or `loadingMessage` are set to null. [#2754](https://github.com/JedWatson/react-select/pull/2754)\n- Fixed bug with mobile menu being blocked when `menuShouldBlockScroll` is true.\n  [#2756](https://github.com/JedWatson/react-select/pull/2756)\n- Enabled hideSelectedOptions functionality for single-select as well. Changed logic so that if isMulti is true and hideSelectedOptions is not defined, we will hide selected options by default. Explicitly setting hideSelectedOptions will override this behaviour. https://github.com/JedWatson/react-select/pull/2753\n- Updates to flow types, thanks [mike1808](https://github.com/mike1808), [himerus](https://github.com/himerus),\n  [teamable-software](https://github.com/teamable-software) and\n- Bumped internal flow-bin dependency to 0.72.0, [#2646](https://github.com/JedWatson/react-select/pull/2646) thanks [lunij](https://github.com/lunij)\n- Fixed [#2701](https://github.com/JedWatson/react-select/issues/2701), use of un-polyfilled array.includes() in Select.js, this has now been subbed out for a IE compatible implementation.\n- [#2733](https://github.com/JedWatson/react-select/issues/2733), fixed classname bug to do with prefixing classes with modifiers.\n- [#2723](https://github.com/JedWatson/react-select/issues/2732), fixed emotion compilation bug blocking loadingDot rendering.\n- [#2749](https://github.com/JedWatson/react-select/pull/2749) fixed typo in docs. thanks [JuhQ](https://github.com/juhq)\n- [#2717](https://github.com/JedWatson/react-select/pull/2717) added selected value to onChange to accommodate multi-select, thanks [SimeonC](https://github.com/simeonc)\n\n## v2.0.0-beta.6 / 2018-05-23\n\n- Fixed bug with `css` attribute being wrongly applied to a DOM element in SingleValue. Thanks [guigs](http://github.com/guigs)\n- Added `removedValue` to the `actionMeta` of the `remove-value` action that's passed into the `onChange` prop.\n- Reverted previous change of `innerRef` in `innerProps` of custom Components to `ref`. The property is now once again named `innerRef`. This is mostly to resolve issues with styled-components not passing `ref` down to wrapped dom elements, however this is also a safer pattern to apply as it requires users providing their own custom components to explicitly associate the passed down ref with the requisite dom element.\n- selectValue now filters items based on the getOptionValue method. Thanks (inv8der)[http://github.com/inv8der]\n- Added `createOptionPosition` to creatable select to allow users to specify where the createOption element appears in the menu.\n- Added touch handling logic to detect user intent to scroll the page when interacting with the select control.\n\n## v2.0.0-beta.5 / 2018-05-18\n\n- Added `controlShouldRenderValue` prop, defaults to true. Setting it to false disables rendering values in the control. Thanks[Joss Mackison](http://github.com/jossmac)\n\n## v2.0.0-beta.4 / 2018-05-15\n\n- Fixed bug where transition props were being spread onto the DummyInput causing react warnings in the console. Thanks [Mike Gardner](https://github.com/MikeLimeRocket)\n\n## v2.0.0-beta.3 / 2018-05-14\n\n**Note**: There is an important change in this release to the behaviour of `className`.\n\nPreviously, `className` would control the class names applied to internal components\nas well as the containing element. Now, the `className` prop only controls the class\nname of the containing element, and the new prop `classNamePrefix` controls classes\napplies to internal components.\n\nUntil 2.0.0 final is released, we have added backwards compatibility and a deprecation\nwarning to cover this change.\n\n- Added `classNamePrefix` prop, which now controls the class names applied to internal components\n- Refactored cx internal implementation to reduce specificity of css-in-jss base styles.\n- `maxValueHeight` prop removed\n- Added `--is-disabled` className modifier to Option component, thanks [eemeli](https://github.com/eemeli)\n- Fixed various IE11 issues, see [#2583](https://github.com/JedWatson/react-select/issues/2583)\n- Added multi-value keyboard navigation using left and right arrows.\n- Simplified flow distribution, thanks [falconmick](https://github.com/falconmick)\n- Added fix to ensure focus is on the Input when the menu opens\n\n## v2.0.0-beta.2 / 2018-04-25\n\n- Switched from glam to [emotion](https://emotion.sh) for css-in-js\n- Input colour can now be changed\n- Use of React 16 Fragment removed, 2.0.0 should work with React 15\n- SSR support improved\n- Indicator icons are now exported\n\n## v2.0.0-beta.1 / 2018-04-20\n\n- Added `tabIndex` prop\n- Added `classNames` prop\n- Added upgrade guide from v1 --> v2\n- Fixed bug with overflowing long values in the control\n- Fixed ie11 bug to do with absolutely positioned children in flex parent.\n- Documentation ie11, styling and copy improvements\n\n## v2.0.0-alpha.11 / 2018-04-12\n\nMinor fix since last alpha:\n\n- Fixed a flow type issue that was causing issues for consumers\n\n## v2.0.0-alpha.10 / 2018-04-10\n\nMinor fix since last alpha:\n\n- Fixed an issue with `dist/react-select.es.js` where `babelHelpers` weren't defined\n\n## v2.0.0-alpha.9 / 2018-04-10\n\nOngoing rewrite. Major changes since last alpha:\n\n- Added `openMenuOnClick` and `openMenuOnFocus` props\n- Significant test coverage and documentation improvements\n- Added `onMenuScrollToTop` and `onMenuScrollToBottom` event props\n- `scrollMenuIntoView` prop renamed `menuShouldScrollIntoView`\n- `onKeyDown` now based on event.key not event.keyCode\n- Component ids no longer have double separators\n- Fixed a Firefox bug with `position: absolute` and `display: flex`\n- Added support for fixed position menu and scroll blocking\n- Fixed issue with transition group props being passed to child components\n- Fixed issue with portalled menu display when `menuPlacement=\"top\"`\n\n## v2.0.0-alpha.8 / 2018-02-20\n\nOngoing rewrite. Major changes since last alpha:\n\n- Made `focus` and `blur` methods work consistently when composing HOCs\n- Added `menuPortalTarget` prop which portals the menu, with a `MenuPortal` component and `menuPortal` style key\n- Allow the `MultiValueRemove` component children to be changed\n- Lots of new tests, updates to documentation and examples\n\n## v2.0.0-alpha.7 / 2018-02-14\n\nOngoing rewrite. Major changes since last alpha:\n\n- Significantly improved touch and mobile support\n- New positioning behaviour for the Menu\n- Added `scrollMenuIntoView` prop, which does exactly what you'd expect\n- Added action meta to the `onInputChange` event handler arguments\n- `Creatable` Component Added\n- `AsyncCreatable` Component Added\n- Fixed an issue with the layout that would trigger a Firefox repaint bug\n- Improved behaviour when the `isDisabled` prop value is changed\n- The `IndicatorSeparator` isn't rendered when there is no `DropdownIndicator`\n- Converted `StateManager` to a higher order component\n- New website, docs, and more tests! (still WIP)\n- Examples can now be launched in CodeSandbox, thanks to [Ben Conolly](https://github.com/noviny)\n\n## v2.0.0-alpha.6 / 2018-02-14\n\nOngoing rewrite. Major changes since last alpha:\n\n- `menuIsOpen`, `inputValue` and `value` are now controllable props that default to internal state\n- Fixed missing loading indicator\n- Added \"open in code sandbox\" to all examples\n- Switched menu rendering from li to div tags for better screen reader usability\n- Removed unused primitives and simplified indicator components\n- Improved accessibility of groups and options, cleaned up Group implementation\n- Fixed some input alignment issues\n- Added right-to-left support with `isRtl` prop\n- Support blocking page scroll at menu boundaries with `captureMenuScroll` prop\n- Added automatic menu flipping at window boundaries with `menuPlacement` and `menuShouldFlip` props\n- Added `isSearchable` prop to support simple (not searchable) select inputs\n- Added `pageSize` prop\n\n## v2.0.0-alpha.5 / 2018-02-07\n\nOngoing rewrite. Major changes since last alpha:\n\n- Fixed an issue where animated values would show ellipsis while leaving\n- Long single values are now also correctly truncated\n\n## v2.0.0-alpha.4 / 2018-02-06\n\nOngoing rewrite. Major changes since last alpha:\n\n- Added support for Promises in the Async component\n- Added `setValue` method on the Select class\n- More consistent use of `innerProps` for internal components\n- Internal components are now provided a consistent set of props and API\n- Improved handling of keyboard and mouse interaction for options in the menu\n- Default filtering behaviour now has parity with v1\n- New `createFilter` method lets you customise the filter options\n- Some unnecessary components have been removed for better performance\n- Long values are now truncated\n\n## v2.0.0-alpha.3 / 2018-02-02\n\nOngoing rewrite. Major changes since last alpha:\n\n- Added `getOptionValue`, `getOptionLabel` and `formatOptionLabel` props\n- Added `isOptionSelected` and `isOptionDisabled` props\n- Added `name` and `delimiter` props to support hidden html inputs for forms\n- Added `loadingMessage`, `noOptionsMessage` and `screenReaderStatus` props so messages can be customised\n- Customisable components are now passed `innerProps` for simpler implementation\n- Cleaned up internal Components and made sure they can all be styled\n- Implemented customisable filtering function with support for case and diacritics\n- Fixed various css bugs and vendor prefixing issues\n- Accessibility improvements\n\n## v2.0.0-alpha.2 / 2018-01-25\n\nOngoing rewrite. Major changes since last alpha:\n\n- `Async` component added\n- `styles` prop added to Select component\n- `isLoading` prop to Select component and new indicator added\n- Support added for disabled options\n- Internal components cleaned up\n- Cypress tests added\n- CSS class names added to default components\n- Accessibility improvements\n\n## v2.0.0-alpha.1 / 2018-01-12\n\nComplete rewrite, docs and upgrade notes on changes from v1 to come later.\n\n## v1.2.1 / 2018-01-13\n\n- Fixed blocking the Del key when deleteRemoves is false, thanks [Nachtigall, Jens (init)](https://github.com/jnachtigall) - [see PR](https://github.com/JedWatson/react-select/pull/2291)\n- Fixed inline-block rendering for arrowRenderer without autosize, thanks [Harry Kao](https://github.com/harrykao) - [see PR](https://github.com/JedWatson/react-select/pull/2276)\n- Fixed dropdown menu positioning issues in IE 11, thanks [jharris4](https://github.com/jharris4) - [see PR](https://github.com/JedWatson/react-select/pull/2273)\n- Added missing rule to the `scss` stylesheet, thanks [Jordan Whitfield](https://github.com/mantissa7) - [see PR](https://github.com/JedWatson/react-select/pull/2280)\n  > > > > > > > master\n\n## v1.2.0 / 2018-01-08\n\n- Source cleanup, thanks to [Yuri S](https://github.com/yuri-sakharov) and\n  [Charles Lee](https://github.com/gwyneplaine) -\n  [see PR](https://github.com/JedWatson/react-select/pull/2262)\n- Switched from babel-preset-es2015 to babel-preset-env, thanks\n  [Rambabu Yadlapalli](https://github.com/RamYadlapalli) -\n  [see PR](https://github.com/JedWatson/react-select/pull/2254)\n- Fixed focused option. Issue #2237, thanks\n  [Yuri S](https://github.com/yuri-sakharov) -\n  [see PR](https://github.com/JedWatson/react-select/pull/2245)\n- Fix onSelectResetsInput bug from keyboard navigation, thanks\n  [Charles Lee](https://github.com/gwyneplaine) -\n  [see PR](https://github.com/JedWatson/react-select/pull/2259)\n- Fixed all warnings on running tests, thanks\n  [Yuri S](https://github.com/yuri-sakharov) -\n  [see PR](https://github.com/JedWatson/react-select/pull/2231)\n- Added missing tests for Option.js and refactored Option-test.js., thanks\n  [Yuri S](https://github.com/yuri-sakharov) -\n  [see PR](https://github.com/JedWatson/react-select/pull/2249)\n- Added missing tests for Async.js, thanks\n  [Yuri S](https://github.com/yuri-sakharov) -\n  [see PR](https://github.com/JedWatson/react-select/pull/2250)\n- Fixed console error in GitHub users example, thanks\n  [Yuri S](https://github.com/yuri-sakharov) -\n  [see PR](https://github.com/JedWatson/react-select/pull/2244)\n- Fixed readme example. Issue #2235, thanks\n  [Yuri S](https://github.com/yuri-sakharov) -\n  [see PR](https://github.com/JedWatson/react-select/pull/2246)\n- Regression fix for single select with onSelectResetsInput=false, thanks\n  [Yuri S](https://github.com/yuri-sakharov) -\n  [see PR](https://github.com/JedWatson/react-select/pull/2226)\n- Pass placeholder prop to ValueComponent, thanks\n  [Aravind Srivatsan](https://github.com/aravindsrivats) -\n  [see PR](https://github.com/JedWatson/react-select/pull/2225)\n- Refactored handleKeyDown switch, thanks\n  [Yuri S](https://github.com/yuri-sakharov) -\n  [see PR](https://github.com/JedWatson/react-select/pull/2228)\n- onSelectResetsInput regression fixed, thanks\n  [Jed Watson](https://github.com/dehamilton) -\n  [see PR](https://github.com/JedWatson/react-select/pull/2215)\n- Don't open drop down menu when clear values, thanks\n  [Jed Watson](https://github.com/Chopinsky) -\n  [see PR](https://github.com/JedWatson/react-select/pull/2198)\n- Clear input value on receiving props with another value., thanks\n  [Yuri S](https://github.com/yuri-sakharov) -\n  [see PR](https://github.com/JedWatson/react-select/pull/2183)\n- Fix/is option unique crash, thanks [Jacob Zuo](https://github.com/Chopinsky) -\n  [see PR](https://github.com/JedWatson/react-select/pull/2185)\n- Use react-input-autosize v2.1.2 for guard against undefined window, thanks\n  [DStyleZ](https://github.com/sximba) -\n  [see PR](https://github.com/JedWatson/react-select/pull/2187)\n- Fix issue #2182, thanks [Kurt Hoyt](https://github.com/kurtinatlanta) -\n  [see PR](https://github.com/JedWatson/react-select/pull/2213)\n- Documenting behavior of onBlurResetsInput in the readme., thanks\n  [hobbsl](https://github.com/levininja) -\n  [see PR](https://github.com/JedWatson/react-select/pull/2212)\n- Use onSelectResetsInput for single select, thanks\n  [lachiet](https://github.com/lachiet) -\n  [see PR](https://github.com/JedWatson/react-select/pull/2205)\n- Fix state value in README example, thanks\n  [Srishan Bhattarai](https://github.com/srishanbhattarai) -\n  [see PR](https://github.com/JedWatson/react-select/pull/2192)\n- document breaking change of removing getInputValue, thanks\n  [Turadg Aleahmad](https://github.com/turadg) -\n  [see PR](https://github.com/JedWatson/react-select/pull/2195)\n- Fixed search for invalid label and/or value, thanks\n  [Yuri S](https://github.com/yuri-sakharov) -\n  [see PR](https://github.com/JedWatson/react-select/pull/2179)\n\n## v1.1.0 / 2017-11-28\n\n- added; more props are passed to the Option component: `focusOption`,\n  `inputValue`, `selectValue`, `removeValue`\n- added; the `inputValue` is passed as the third argument to the\n  `optionRenderer`\n- fixed; issues opening the menu correctly for multiselect when\n  `autosize={false}`\n- fixed; removed `event.stopPropagation()` from Select's `clearValue` and\n  `onClick` handlers, thanks [Thomas Burke](https://github.com/etburke)\n- fixed; `handleMouseDownOnArrow` when `openOnClick={false}`, thanks\n  [elias ghali](https://github.com/elghali)\n- fixed; conditional scrolling into view of focused option, thanks\n  [Michael Lewis](https://github.com/mtlewis)\n\n## v1.0.1 / 2017-11-24\n\n- reintroduced source files for scss and less stylesheets into the npm package\n\n## v1.0.0 / 2017-11-23\n\n- breaking; removed `getInputValue` function -\n  [see PR](https://github.com/JedWatson/react-select/pull/2108)\n- reverted spacebar-selects-option behaviour for searchable selects, thanks\n  [Charles Lee](https://github.com/gwyneplaine) -\n  [see PR](https://github.com/JedWatson/react-select/pull/2163)\n- fixed behaviour where async doesn't handle onInputChange returning a value,\n  thanks [Anton](https://github.com/tehbi4) -\n  [see PR](https://github.com/JedWatson/react-select/pull/2133)\n- fixed Creatable bug where the first enter keypress is ignored when\n  `promptTextCreator` returns only the label, thanks\n  [George Karagkiaouris](https://github.com/karaggeorge) -\n  [see PR](https://github.com/JedWatson/react-select/pull/2140)\n- Utility functions are now exported from the es6 build, thanks\n  [Deiru](https://github.com/Deiru2k) -\n  [see PR](https://github.com/JedWatson/react-select/pull/2154)\n- Update aria-only class to have absolute positioning, thanks\n  [Jacob Hilker](https://github.com/JHilker) -\n  [see PR](https://github.com/JedWatson/react-select/pull/1243)\n- gives possibility to use ref property for Creatable, thanks\n  [blacktemplar](https://github.com/blacktemplar) -\n  [see PR](https://github.com/JedWatson/react-select/pull/1646)\n- Adds lint and test pre-commit hooks, thanks\n  [carymcpoland](https://github.com/mcpolandc) -\n  [see PR](https://github.com/JedWatson/react-select/pull/2077)\n- Disable some browser-specific behaviours that break the input, thanks\n  [Jed Watson](https://github.com/JedWatson) -\n  [see PR](https://github.com/JedWatson/react-select/pull/2101)\n- onOpen: run after dom has rendered, thanks\n  [Karl-Aksel Puulmann](https://github.com/macobo) -\n  [see PR](https://github.com/JedWatson/react-select/pull/#1756)\n- fix not clearing when given invalid values, from #1756, thanks\n  [Mário][https://github.com/ticklemynausea] -\n  [see PR](https://github.com/JedWatson/react-select/pull/2100)\n- Exports Option Component, thanks\n  [Erkelens, Jan Paul](https://github.com/jperkelens) -\n  [see PR](https://github.com/JedWatson/react-select/pull/2097)\n- Fix/numeric multi select, thanks\n  [Charles Lee](https://github.com/gwyneplaine) -\n  [see PR](https://github.com/JedWatson/react-select/pull/2086)\n- removeSelected prop (round 2), for optionally keeping selected values in\n  dropdown, thanks [Jed Watson](https://github.com/banderson) -\n  [see PR](https://github.com/JedWatson/react-select/pull/1891)\n- pass removeValue() and always pass valueArray, thanks\n  [kcliu](https://github.com/kcliu) -\n  [see PR](https://github.com/JedWatson/react-select/pull/1850)\n- Accessibility Enhancements - Aria tags, Space/Enter keys, thanks\n  [sushmabadam](https://github.com/sushmabadam) -\n  [see PR](https://github.com/JedWatson/react-select/pull/1428)\n- added rtl support, thanks [Dekel](https://github.com/dekelb) -\n  [see PR](https://github.com/JedWatson/react-select/pull/1613)\n- Add inputValue to menuRenderer, thanks\n  [headcanon](https://github.com/chronick) -\n  [see PR](https://github.com/JedWatson/react-select/pull/1732)\n- fix typo in handleKeyDown method, thanks\n  [jasonchangxo](https://github.com/jasonchangxo) -\n  [see PR](https://github.com/JedWatson/react-select/pull/2088)\n- Fix/numeric multi select, thanks\n  [Charles Lee](https://github.com/gwyneplaine) -\n  [see PR](https://github.com/JedWatson/react-select/pull/2086)\n- expose children in AsyncCreatable.js, thanks\n  [Charles Lee](https://github.com/gwyneplaine) -\n  [see PR](https://github.com/JedWatson/react-select/pull/2084)\n- replace trim fn loop with regex, thanks\n  [Charles Lee](https://github.com/gwyneplaine) -\n  [see PR](https://github.com/JedWatson/react-select/pull/2085)\n- Trim search text from beginning and the end. (fixes #1861), thanks\n  [Serkan Ozer](https://github.com/serkanozer) -\n  [see PR](https://github.com/JedWatson/react-select/pull/1862)\n- Add variable for focused input background, thanks\n  [Aron Strandberg](https://github.com/aronstrandberg) -\n  [see PR](https://github.com/JedWatson/react-select/pull/1998)\n- Added id in the input select, thanks\n  [thecreazy](https://github.com/thecreazy) -\n  [see PR](https://github.com/JedWatson/react-select/pull/2027)\n- adding a nvmrc file and adding coverage to eslintignore, thanks\n  [Dave Birch](https://github.com/uxtx) -\n  [see PR](https://github.com/JedWatson/react-select/pull/1137)\n- Updated the comment for the deleteRemoves option., thanks\n  [Abul Dider](https://github.com/dider7) -\n  [see PR](https://github.com/JedWatson/react-select/pull/2078)\n- implemented optional rendering of arrow, thanks\n  [rolandjohann](https://github.com/rolandjohann) -\n  [see PR](https://github.com/JedWatson/react-select/pull/1761)\n- Skip rendering arrow wrapper when custom arrow renderer returns falsy value,\n  thanks [Mike Lewis](https://github.com/mtlewis) -\n  [see PR](https://github.com/JedWatson/react-select/pull/2055)\n- do not show clear button if value is an empty string, thanks\n  [Marie Godon](https://github.com/mariegodon) -\n  [see PR](https://github.com/JedWatson/react-select/pull/2074)\n- Set isLoading to false if cache hit, thanks\n  [timhwang21](https://github.com/timhwang21) -\n  [see PR](https://github.com/JedWatson/react-select/pull/2042)\n- Add aria-labels to Options, thanks\n  [jasonchangxo](https://github.com/jasonchangxo) -\n  [see PR](https://github.com/JedWatson/react-select/pull/2036)\n- Adds source links to each example, thanks\n  [Damon Bauer](https://github.com/damonbauer) -\n  [see PR](https://github.com/JedWatson/react-select/pull/2051)\n- Issue #2056: onInputChange should return modified value, thanks\n  [Caleb Scholze](https://github.com/cscholze) -\n  [see PR](https://github.com/JedWatson/react-select/pull/2057)\n- Remove option `addLabelText` from README and propTypes, thanks\n  [Jannes Jeising](https://github.com/jjeising) -\n  [see PR](https://github.com/JedWatson/react-select/pull/2040)\n- GitHub has a capital H, thanks\n  [David Baumgold](https://github.com/singingwolfboy) -\n  [see PR](https://github.com/JedWatson/react-select/pull/2053)\n- refactor componentWillUnmount(), thanks\n  [riophae](https://github.com/riophae) -\n  [see PR](https://github.com/JedWatson/react-select/pull/2064)\n- Slim down NPM package, thanks [Valentin Agachi](https://github.com/avaly) -\n  [see PR](https://github.com/JedWatson/react-select/pull/2062)\n- Update contributing doc, thanks [Gregg Brewster](https://github.com/greggb) -\n  [see PR](https://github.com/JedWatson/react-select/pull/2059)\n- strip proptypes in production build (fixes #1882), thanks\n  [Jochen Berger](https://github.com/jochenberger) -\n  [see PR](https://github.com/JedWatson/react-select/pull/2003)\n- Support Webpack 2, Webpack 3, rollup., thanks\n  [Matthew Schnee](https://github.com/mschnee) -\n  [see PR](https://github.com/JedWatson/react-select/pull/2020)\n- Add missing semicolon, thanks\n  [jochenberger](https://github.com/jochenberger) -\n  [see PR](https://github.com/JedWatson/react-select/pull/2018)\n- autofocus --> autoFocus, thanks\n  [Charles Lee](https://github.com/gwyneplaine) -\n  [see PR](https://github.com/JedWatson/react-select/pull/2002)\n- Async> cache async response regardless of req order, thanks\n  [Timothy Hwang](https://github.com/timhwang21) -\n  [see PR](https://github.com/JedWatson/react-select/pull/2012)\n- Make this work in preact., thanks [liaoxuezhi](https://github.com/2betop) -\n  [see PR](https://github.com/JedWatson/react-select/pull/2013)\n- Correct release candidate version on README, thanks\n  [Damon Aw](https://github.com/daemonsy) -\n  [see PR](https://github.com/JedWatson/react-select/pull/2017)\n- Fix test name, thanks [jochenberger](https://github.com/jochenberger) -\n  [see PR](https://github.com/JedWatson/react-select/pull/2005)\n- Fixing css states to be scoped with Select selector, closes #1951., thanks\n  [Adam Girton](https://github.com/agirton) -\n  [see PR](https://github.com/JedWatson/react-select/pull/2000)\n- fix typo, thanks [jochenberger](https://github.com/jochenberger) -\n  [see PR](https://github.com/JedWatson/react-select/pull/1999)\n\n## v1.0.0-rc.10 / 2017-09-13\n\n- changed; `openAfterFocus` prop has been renamed to `openOnClick`, and now\n  defaults to `true`\n- fixed; React.PropTypes deprecation warning, thanks\n  [Jeremy Liberman](https://github.com/MrLeebo)\n- improved; scrolling behaviour when navigating the menu with the keyboard,\n  thanks [boatkorachal](https://github.com/boatkorachal)\n- fixed; error with the `Async` cache when you type `\"hasOwnProperty\"`, thanks\n  [SuhushinAS](https://github.com/SuhushinAS)\n\n## v1.0.0-rc.9 / 2017-09-13\n\n- fixed; clearable padding style, thanks\n  [Minori Miyauchi](https://github.com/mmiyauchi)\n- fixed; removed use of `Object.assign`, fixes IE compatibility\n- added; new `closeOnSelect` prop (defaults to `true`) that controls whether the\n  menu is closed when an option is selected, thanks to\n  [Michael Elgar](https://github.com/melgar) for the original idea\n- changed; by default, the menu for multi-selects now closes when an option is\n  selected\n- changed; `Async` component no longer always clears options when one is\n  selected (although the menu is now closed by default). Use\n  `closeOnSelect={false} onSelectResetsInput={false}` to leave the menu open.\n- fixed; `Async` component always called `onChange` even when it wasn't provided\n- fixed; input lag for the `Async` component when results are returned from\n  cache\n- fixed; required was not being updated without an onChange handler\n- fixed; peer dependencies for `prop-types`, thanks\n  [Michaël De Boey](https://github.com/MichaelDeBoey)\n- fixed; internal optimisations, thanks\n  [Kieran Boyle](https://github.com/dysfunc)\n- added; `Value` component is now exported, thanks\n  [Prof Gra](https://github.com/Grahack)\n- fixed; callback fired after `Async` component unmounts, thanks\n  [Andrew Russell](https://github.com/DeadHeadRussell)\n- fixed; wrapping on Firefox in SCSS files, thanks\n  [Michael Williamson](https://github.com/mwilliamson)\n\n## v1.0.0-rc.8 / 2017-09-12\n\n- fixed; `onMenuScrollToBottom` does not work in chrome 58.0, thanks\n  [Simon Hartcher](https://github.com/deevus)\n- fixed; missing es6 module build for `js:next` entrypoint\n- updated; `react-input-autosize@2.0.0` including several fixes for react-select\n  (see\n  [changes](https://github.com/JedWatson/react-input-autosize/blob/master/HISTORY.md))\n\n## v1.0.0-rc.7 / 2017-09-11\n\n- fixed; issue with `lib` build preventing use in ES2015 environments\n\n## v1.0.0-rc.6 / 2017-09-10\n\n- fixed; changing `required` prop from `true` to `false` now works as expected,\n  thanks [George Karagkiaouris](https://github.com/karaggeorge)\n- added; new prop `onSelectResetsInput` controls whether the input value is\n  cleared when options are selected, thanks\n  [David Roeca](https://github.com/davidroeca) and\n  [Alexander Nosov](https://github.com/nosovsh)\n- fixed; tabindex parent bug fix for Edge, thanks\n  [George Payne](https://github.com/George-A-Payne)\n- fixed; update selectize link in README.md, thanks\n  [kerumen](https://github.com/kerumen)\n- added; standard issue template, thanks [agirton](https://github.com/agirton)\n- added; new build process using rollup and webpack. Removed grunt. thanks\n  [gwyneplaine](https://github.com/gwyneplaine)\n- fixed; updated contributor docs with the correct node version reference\n  [gwyneplaine](https://github.com/gwyneplaine)\n- fixed; missing method binds in Option, thanks\n  [agirton](https://github.com/agirton)\n- fixed; converted components to use es6 classes, thanks\n  [jochenberger](https://github.com/jochenberger)\n- fixed; console.log example in usage docs, thanks\n  [rohmanhm](https://github.com/rohmanhm)\n- fixed; hide create option after closing menu, thanks\n  [andreme](https://github.com/andreme)\n- fixed; remove circular reference, thanks [agirton](https://github.com/agirton)\n- fixed; readme typo, thanks [ieldanr](https:/github.com/ieldanr)\n- fixed; add missing function binds in Option component, thanks\n  [agirton](https://github.com/agirton) and\n  [blacktemplar](https://github.com/blacktemplar)\n- fixed; re-added fix to\n  [#1580](https://github.com/JedWatson/react-select/issues/1580), thanks\n  [agirton](https://github.com/agirton)\n- fixed; avoid mutating user inputs when ignoring case/accents, thanks\n  [not-an-aardvark](https://github.com/not-an-aardvark)\n- fixed; issues synchronising options props in `Async`, thanks\n  [cbergmiller](https://github.com/cbergmiller)\n- fixed; backspace handling for non-multi select controls, thanks\n  [Jeremy Liberman](https://github.com/MrLeebo)\n\n## v1.0.0-rc.5 / 2017-05-25\n\n- fixed; Allow `falsey` values to be clearable, thanks\n  [Simon Gaestel](https://github.com/sgaestel)\n- fixed; issue where Firefox would crash due to incorrect use of `aria-owns`\n  attribute, thanks [Max Hubenthal](https://github.com/mhubenthal)\n- fixed; regression where options not using the value key couldn't be focused,\n  thanks [Benjamin Piouffle](https://github.com/Betree)\n\n## v1.0.0-rc.4 / 2017-05-14\n\n- fixed; no more warning when using React 15.5, thanks\n  [Adam Girton](https://github.com/agirton)\n- fixed; issue comparing objects in `getFocusableOptionIndex`, thanks\n  [rndm2](https://github.com/rndm2)\n- fixed; missing .focus() method in `Creatable`, thanks\n  [Anton Alexandrenok](https://github.com/the-spyke)\n- added; support for `aria-describedby` attribute, thanks\n  [Eric Lee](https://github.com/ericj17)\n- added; `.is-clearable` className when clearable is true, thanks\n  [Dan Diaz](https://github.com/dan-diaz)\n\n## v1.0.0-rc.3 / 2017-02-01\n\n- added; `arrowRenderer` prop, thanks [Brian Vaughn](https://github.com/bvaughn)\n- added; child-function support to `Async` and `Creatable` components so that\n  they can compose each other (or future HOCs), thanks\n  [Brian Vaughn](https://github.com/bvaughn)\n- added; `asyncCreatable` HOC that combines `Async` and `Creatable` so they can\n  be used together, thanks [Brian Vaughn](https://github.com/bvaughn)\n- added; undocumented arguments for `menuRenderer`, thanks\n  [Julian Krispel-Samsel](https://github.com/juliankrispel)\n- fixed; Do not focus and open menu when disabled, thanks\n  [nhducit](https://github.com/nhducit)\n- fixed; Scrolling with arrow-keys is not working correctly, thanks\n  [Damian Pieczynski](https://github.com/piecyk)\n- added; \"select all text\" functionality `Shift+Home|Del`, thanks\n  [Damian Pieczynski](https://github.com/piecyk)\n- added; support for `boolean` values, thanks\n  [Aaron Hardy](https://github.com/Aaronius)\n- fixed; Remove duplicated `promptTextCreator` field from readme, thanks\n  [Jih-Chi Lee](https://github.com/jihchi)\n- fixed; Adding back ref that was removed in rc2, thanks\n  [Martin Jujou](https://github.com/jooj123)\n- fixed; `Creatable` component doesn't allow input key down handling, thanks\n  [Ivan Leonenko](https://github.com/IvanLeonenko)\n- added; Allow react nodes to be passed as loadingPlaceholder, thanks\n  [Daniel Heath](https://github.com/DanielHeath)\n- fixed; IE8 compatibility issues, thanks\n  [Kirill Mesnyankin](https://github.com/strayiker)\n- improved; Allow users to specify noResultsText, thanks\n  [Daniel Heath](https://github.com/DanielHeath)\n- added; Only remove options if a loading placeholder is available, thanks\n  [Daniel Heath](https://github.com/DanielHeath)\n- fixed; firefox display items in two rows due to reflow, thanks\n  [Daniel Heath](https://github.com/DanielHeath)\n- fixed; `Creatable` readme typo, thanks [Ben](https://github.com/rockingskier)\n- fixed; explain way to implement `allowCreate` functionality with `Creatable`\n  to readme, thanks [mayerwin](https://github.com/mayerwin)\n- added; delete key removes an item when there is no input, thanks\n  [forum-is](https://github.com/forum-is)\n- added; `onNewOptionClick` handler for `Creatable`, thanks\n  [Lee Siong Chan](https://github.com/leesiongchan)\n- fixed; `onInputChange` consistent for `Creatable`, thanks\n  [Lee Siong Chan](https://github.com/leesiongchan)\n- fixed; `menuRenderer` is treated consistently between `Creatable` and\n  `Select`, thanks [Brian Vaughn](https://github.com/bvaughn)\n- fixed; `asyncCreatable` options parsing will not parse undefined values into\n  props, thanks [Romain Dardour](https://github.com/unity)\n- added; pass `inputProps` to `inputRenderer`, thanks\n  [Alec Winograd](https://github.com/awinograd)\n- fixed; no exception when clearing an Async field that is not set to multi,\n  thanks [Patrik Stutz](https://github.com/VanCoding)\n- added; allow rendering a custom clear component, thanks\n  [Conor Hastings](https://github.com/conorhastings)\n- fixed; document `ignoreAccents`, thanks\n  [Domenico Matteo](https://github.com/dmatteo)\n- fixed; arrowing up or down in `Select` with 0 options does not throw type\n  error, thanks [Alex Howard](https://github.com/thezanke)\n- fixed; `Creatable` handles null children prop, thanks\n  [Jack Coulter](https://github.com/jscinoz)\n- added; provide `isOpen` to arrowRenderer, thanks\n  [Kuan](https://github.com/khankuan)\n- fixed; re-added the `focus()` method on `Select.Async`, thanks,\n  [Maarten Claes](https://github.com/mcls)\n- fixed; focus the next available option after a selection, not the top option,\n  thanks [Nicolas Raynaud](https://github.com/nraynaud)\n\nNote there has also been a breaking change to the props for the `Async`\ncomponent: both `minimumInput` and `searchingText` have been removed. See #1226\nfor more details. Apologies for doing this in an RC release, but we had to trade\noff between resolving some important bugs and breaking the API, and figured it\nwas better to do this before declaring 1.0.0 stable.\n\n## v1.0.0-rc.1 / 2016-09-04\n\n- fixed; reset value to `[]` when `multi=true`, thanks\n  [Michael Williamson](https://github.com/mwilliamson)\n- added; pass index to `renderLabel` method, thanks\n  [nhducit](https://github.com/nhducit)\n- fixed; uncontrolled to controlled component warning in React 15.3\n- fixed; props cleanup, thanks\n  [Forbes Lindesay](https://github.com/ForbesLindesay)\n- fixed; issue where a value of the number `0` would be assumed to be no value,\n  thanks [Hanwen Cheng](https://github.com/hanwencheng)\n- fixed; internal refs converted to callbacks instead of strings, thanks\n  [Johnny Nguyen](https://github.com/gojohnnygo)\n- added; optional `instanceId` prop for server-side rendering, thanks\n  [Jevin Anderson](https://github.com/JevinAnderson)\n- added; `onCloseResetsInput` prop, thanks\n  [Frankie](https://github.com/frankievx)\n- added; `Creatable` component, replaces pre-1.0 `allowCreate` prop, thanks\n  [Brian Vaughn](https://github.com/bvaughn)\n\n## v1.0.0-beta14 / 2016-07-17\n\n- fixed; `react-input-autosize` has been updated to `1.1.0`, which includes\n  fixes for the new warnings that React 15.2 logs\n- fixed; \"Unknown prop `inputClassName` on <div> tag\" warning, thanks\n  [Max Stoiber](https://github.com/mxstbr)\n- fixed; Removed unnecessary `onUnfocus`, thanks\n  [Johnny Nguyen](https://github.com/gojohnnygo)\n- added; Support for react components in `searchPromptText`, thanks\n  [Matt](https://github.com/hellaeon)\n- fixed; focus bug on iOS, thanks\n  [Tony deCatanzaro](https://github.com/tonydecat)\n- fixed; Async bugs with Promises, thanks\n  [Vladimir](https://github.com/VladimirPal) and\n  [Ian Firkin](https://github.com/lobsteropteryx)\n- fixed; `searchingText` bug, thanks\n  [Tony deCatanzaro](https://github.com/tonydecat)\n- improved; More antive-like input behaviour, thanks\n  [Johnny Nguyen](https://github.com/gojohnnygo)\n- fixed; Added missing unit (px) to `minWidth` attribute, thanks\n  [Ian Witherow](https://github.com/ianwitherow)\n- added; Support for assistive technologies, thanks\n  [Dave Brotherstone](https://github.com/bruderstein)\n- fixed; React error if `onChange` callback causes a root component to unmount,\n  thanks [Nathan Norton](https://github.com/Xesued)\n- fixed; Open menu is now closed if `disabled` becomes true, thanks\n  [Jason Moon](https://github.com/jsnmoon)\n- fixed; Prevent `getFocusableOptionIndex` from returning a disabled option,\n  thanks [Brian Powers](https://github.com/brianspowers)\n- added; Home, End, Page Up/Down support, thanks\n  [Jason Kadrmas](https://github.com/blackjk3)\n- fixed; Don't render `backspaceToRemoveMessage` if `backspaceRemoves` is set to\n  false, thanks [Ryan Zec](https://github.com/ryanzec)\n- fixed; Issue with an outline appearing on the auto sized input, thanks\n  [Ryan Zec](https://github.com/ryanzec)\n- fixed; Events don't propagate when `esc` is pressed, thanks\n  [Yoshihide Jimbo](https://github.com/jmblog)\n- fixed; Update `required` prop based on nextProps on update, thanks\n  [Matt Shwery](https://github.com/mshwery)\n- fixed; On focus check whether input ref is a real input or an input component,\n  thanks [Peter Brant](https://github.com/pbrant) and\n  [Greg Poole](https://github.com/gpoole)\n\nAlso a big thanks to [Brian Vaughn](https://github.com/bvaughn) for his help\ntriaging issues for this release!\n\n## v1.0.0-beta13 / 2016-05-30\n\n- added; `inputRenderer` prop, allows you to override the input component,\n  thanks [Sean Burke](https://github.com/leftmostcat)\n- added; `openOnFocus` prop, causes the menu to always open when the select\n  control is focused, thanks\n  [HuysentruytRuben](https://github.com/HuysentruytRuben)\n- added; `react-virtualised-select` HOC example, thanks\n  [Brian Vaughn](https://github.com/bvaughn)\n- added; `tabSelectsValue` prop can be set to false to prevent selection of\n  focused option when tab is pressed, thanks\n  [Byron Anderson](https://github.com/byronanderson)\n- added; ability to override `resetValue` when clearing the control, thanks\n  [Alexander Luberg](https://github.com/LubergAlexander)\n- added; input can be updated with `onInputChange`, thanks\n  [Brett DeWoody](https://github.com/brettdewoody)\n- added; Styles for .is-selected class, thanks\n  [Danny Herran](https://github.com/dherran)\n- fixed; `noResultsText` prop type is now `stringOrNode` for Async component,\n  thanks [Michael Groeneman](https://github.com/mgroeneman)\n- fixed; `onInputChange` is wrapped by Async component, thanks\n  [Eric O'Connell](https://github.com/drd)\n- fixed; `scrollMenuIntoView` behaviour in IE10, thanks\n  [Ivan Jager](https://github.com/aij)\n- fixed; isEqualNode replaced with strict equality check, thanks\n  [Alexandre Balhier](https://github.com/abalhier)\n- fixed; issue with value object not being passed to `handleRequired`, thanks\n  [Andrew Hite](https://github.com/andyhite)\n- fixed; the menu-outer container is no longer rendered when it does not contain\n  anything, thanks [Kuan](https://github.com/khankuan)\n- improved; better support for IE8 in styles, thanks\n  [Rockallite Wulf](https://github.com/rockallite)\n\n## v1.0.0-beta12 / 2016-04-02\n\n- added; `menuRenderer` method and example for efficiently rendering thousands\n  of options, thanks [Brian Vaughn](https://github.com/bvaughn)\n- added; `optionClassName` prop, thanks [Max Tyler](https://github.com/iam4x)\n\n## v1.0.0-beta11 / 2016-03-09\n\n- updated dependencies to allow use with React 15.x\n- changed; multiple selected values are now submitted using multiple inputs,\n  thanks [Trinh Hoang Nhu](https://github.com/james4388)\n- added; `joinValues` prop to revert the above change and submit multiple values\n  in a single field with the delimiter\n\n## v1.0.0-beta10 / 2016-02-23\n\n- fixed build issues with v1.0.0-beta9\n\n## v1.0.0-beta9 / 2016-02-12\n\n- added; onBlurResetsInput prop, thanks\n  [Sly Bridges](https://github.com/slybridges)\n- changed; Enter selects and retains focus, Tab selects and shifts focus, thanks\n  [RDX](https://github.com/rdsubhas)\n- fixed; Hide noResultsText when value is falsy, thanks\n  [Fernando Alex Helwanger](https://github.com/fhelwanger)\n- added; `required` prop, adds HTML5 required attribute, thanks\n  [Domenico Matteo](https://github.com/dmatteo)\n- fixed; Touch drag behaviour, thanks\n  [Pavel Tarnopolsky](https://github.com/Paveltarno)\n- added; `onOpen` and `onClose` event props, thanks\n  [Jacob Page](https://github.com/DullReferenceException)\n- fixed; Pressing Enter on open Select should stop propagation, thanks\n  [Jeremy Liberman](https://github.com/MrLeebo)\n- fixed; Missing handleMouseDownOnMenu, thanks\n  [Jeremy Liberman](https://github.com/MrLeebo)\n- added; Ensures the selected option is immediately visible when the menu is\n  open, thanks [Martin Jujou](https://github.com/jooj123)\n- added; `autoBlur` prop, blurs the input when a value is selected, thanks\n  [Pavel Tarnopolsky](https://github.com/Paveltarno)\n- fixed; Several isFocused checks weren't working properly\n\n## v1.0.0-beta8 / 2015-12-20\n\n- fixed; input focus bug when toggling `disabled` prop, thanks\n  [Davide Curletti](https://github.com/dcurletti)\n- fixed; `focus()` is now exposed on the `Async` component, thanks\n  [AugustinLF](https://github.com/AugustinLF)\n\n## v1.0.0-beta7 / 2015-12-15\n\n- You can now use React elements for placeholders and the text props, thanks\n  [kromit](https://github.com/kromit) and\n  [Alyssa Biasi](https://github.com/alyssaBiasi)\n- Fixed a problem where the border doesn't show when the element is inside a\n  table, thanks [Rodrigo Boratto](https://github.com/rwrz)\n- New prop `scrollMenuIntoView` scrolls the viewport to display the menu, thanks\n  [Alexander Zaharakis](https://github.com/azaharakis)\n- New LESS / SCSS variable `select-option-bg` lets you control the menu option\n  background color, thanks [Evan Goldenberg](https://github.com/Naveg)\n- Fixed an error in the blur handler on IE when the menu is not visible, thanks\n  [Gaston Sanchez](https://github.com/gaastonsr)\n- Added support for a `clearableValue` option property in `multi` mode, thanks\n  [Sly Bridges](https://github.com/slybridges)\n\n## v1.0.0-beta6 / 2015-11-29\n\n- Test suite complete and passing, with a couple of minor fixes thanks to\n  @bruderstein\n\n## v1.0.0-beta5 / 2015-11-08\n\n- Fixes issues relating to serializing simple values into the hidden field\n\n## v1.0.0-beta4 / 2015-11-08\n\n- New default styles that match [Elemental UI](http://elemental-ui.com) and look\n  right at home in the new [KeystoneJS Admin UI](http://keystonejs.com)\n\nWe're potentially going to ship some theme stylesheets in the future, shout out\non GitHub if this interests you.\n\n## v1.0.0-beta3 / 2015-11-08\n\n- The selected value populated in the hidden field has been fixed (was `\"[object Object]\"` before)\n- Added new `autofocus` prop\n- Fixed duplicate key error for options and values with duplicate `value`\n  properties\n- SCSS variables now have `!default` so you can override them\n\n## v1.0.0-beta2 / 2015-11-06\n\nChanged since beta 1:\n\n- Async options cache works again\n- New style props for custom styling the component without modifying css\n  classes: `style` `wrapperStyle` `menuStyle` `menuContainerStyle`\n- The menu opens and closes correctly when `searchable={false}`, there is still\n  some work to do on this use-case\n\n## v1.0.0-beta1 / 2015-11-06\n\nThis is a complete rewrite. Major changes include:\n\n- Everything is simpler (I'm nearly done and the source code is only 60% of the\n  size of the last version)\n- No more timeouts or weird handlers, the restructuring has let me make\n  everything more straight-forward\n- The options array is no longer preprocessed into state, just retrieved from\n  props\n- The values array is now initialised in the Options array during render, and\n  not stored in state, which along with the change to options makes the\n  component more reliable and fixes issues with props not updating correctly\n- The component no longer stores its own value in state (ever) - it needs to be\n  passed as a prop and handled with `onChange`.\n- Complex values are now enabled by default (so you're passed the option object,\n  not its value); you can enable the legacy mode with a prop\n- The Value and Option components have been cleaned up as well for consistency\n- The hidden `<input>` field is now optional and the component is better suited\n  to use in a rich React.js app than it was\n- You can disable options filtering to do the filtering externally with\n  `onInputChange`\n- Accents on characters can now be ignored\n- The `asyncOptions` prop has been replaced by a new wrapper component:\n  `Select.Async`\n\nNote that \"Tag mode\" (creating options on the fly) isn't reimplemented yet.\n\nA full guide to the breaking changes and new features will be written up soon.\nIn the meantime please see the new examples.\n\n## v0.9.1 / 2015-11-01\n\n- added; new Contributors example w/ async options loading and custom value /\n  label keys\n- fixed; several issues with custom `valueKey` and `labelKey` props\n- fixed; autoload now loads options with no search input\n\n## v0.9.0 / 2015-10-29\n\n- added; SCSS stylesheets!\n- improved; Options rendering should be more performant\n- breaking change; Custom `Option` components now need to pass their `option`\n  prop to event handlers; see\n  [this commit](https://github.com/JedWatson/react-select/commit/89af12a80a972794222b193a767f44234bbe9817)\n  for an example of the required change.\n\n## v0.8.4 / 2015-10-27\n\n- fixed; LESS math operations now work with --strict-math=on, thanks\n  [Vincent Fretin](https://github.com/vincentfretin)\n\n## v0.8.3 / 2015-10-27\n\n- fixed; IE issue where clicking the scrollbar would close the menu, thanks\n  [Pete Nykänen](https://github.com/petetnt)\n\n## v0.8.2 / 2015-10-22\n\n- added; Promise support for `loadAsyncOptions`, thanks\n  [Domenico Matteo](https://github.com/dmatteo)\n\n## v0.8.1 / 2015-10-20\n\n- fixed; `loadAsyncOptions` raises TypeError in setup, see #439 for details,\n  thanks [Pancham Mehrunkar](https://github.com/pancham348)\n\n## v0.8.0 / 2015-10-19\n\nThis release contains significant DOM structure and CSS improvements by\n@jossmac, including:\n\n- no more `position: absolute` for inner controls\n- `display: table` is used for layout, which works in IE8 and above, and\n  [all other modern browsers](http://caniuse.com/#feat=css-table)\n- less \"magic numbers\" used for layout, should fix various browser-specific\n  alignment issues\n- clear \"x\" control now animates in\n- clearer `.Select--multi` className replaces `.Select.is-multi`\n- new height & theme variables\n- \"dropdown\" indicator chevron is no longer displayed for multi-select controls\n\nThere are no functional changes, but if you've forked the LESS / CSS to create\nyour own theme you'll want to pay close attention to PR #527 when upgrading to\nthis version.\n\n## v0.7.0 / 2015-10-10\n\nReact Select is updated for React 0.14. If you're still using React 0.13, please\ncontinue to use `react-select@0.6.x`. There are no functional differences\nbetween v0.7.0 and v0.6.12.\n\nAdditionally, our tests now require Node.js 4.x. If you are developing\n`react-select`, please make sure you are running the latest version of node.\n\nThanks to @bruderstein, @dmatteo and @hull for their help getting these updates\nshipped!\n\n## v0.6.12 / 2015-10-02\n\n- added; `labelKey` and `valueKey` props, so you can now use different keys in\n  `option` objects for the label and value\n- fixed; additional `isMounted()` checks in timeouts\n- fixed; componentDidUpdate timeout is reset correctly, see #208 and #434,\n  thanks [Petr Gladkikh](https://github.com/PetrGlad)\n- fixed; mousedown event on scrollbar in menu no longer hides it, thanks\n  [Yishai Burt](https://github.com/burtyish)\n\n## v0.6.11 / 2015-09-28\n\n- added; `isLoading` prop, allows indication of async options loading in\n  situations where more control is required, thanks\n  [Jon Gautsch](https://github.com/jgautsch)\n\n## v0.6.10 / 2015-09-24\n\n- fixed; a build issue with the previous release that prevented the stylesheet\n  being generated / included\n- fixed; a LESS syntax issue, thanks [Bob Cardenas](https://github.com/bcardi)\n\n## v0.6.9 / 2015-09-19\n\n- added; `style` key for package.json, thanks\n  [Stephen Wan](https://github.com/stephen)\n- added; `onInputChange` handler that returns the current input value, thanks\n  [Tom Leslie](https://github.com/lomteslie)\n- fixed; simplifying handleKey function & preventDefault behaviour, thanks\n  [davidpene](https://github.com/davidpene)\n- fixed; Display spinner while auto-loading initial data, thanks\n  [Ben Jenkinson](https://github.com/BenJenkinson)\n- fixed; better support for touch events, thanks\n  [Montlouis-Calixte Stéphane](https://github.com/bulby97)\n- fixed; prevent value splitting on non-multi-value select, thanks\n  [Alan R. Soares](https://github.com/alanrsoares)\n\n## v0.6.8 / 2015-09-16\n\n- fixed; broader range of allowed prereleases for React 0.14, including rc1\n- fixed; preventing backspace from navigating back in the browser history,\n  thanks [davidpene](https://github.com/davidpene)\n\n## v0.6.7 / 2015-08-28\n\n- fixed; missing styles for `.Select-search-prompt` and `.Select-searching`\n  issues, thanks [Jaak Erisalu](https://github.com/jaakerisalu) and\n  [davidpene](https://github.com/davidpene)\n\n## v0.6.6 / 2015-08-26\n\n- fixed; issue in Chrome where clicking the scrollbar would close the menu,\n  thanks [Vladimir Matsola](https://github.com/vomchik)\n\n## v0.6.5 / 2015-08-24\n\n- fixed; completely ignores clicks on disabled items, unless the target of the\n  click is a link, thanks [Ben Stahl](https://github.com/bhstahl)\n\n## v0.6.4 / 2015-08-24\n\nThis release includes a huge improvement to the examples / website thanks to\n@jossmac. Also:\n\n- added; support for React 0.14 beta3\n- fixed; disabled options after searching, thanks @bruderstein\n- added; support for \"Searching...\" text (w/ prop) while loading async results,\n  thanks @bruderstein and @johnomalley\n- added; `className`, `style` and `title` keys are now supported in option\n  properties, thanks @bruderstein\n\n## v0.6.3 / 2015-08-18\n\nOtherwise known as \"the real 0.6.2\" this includes the updated build for the last\nversion; sorry about that!\n\n## v0.6.2 / 2015-08-13\n\n- changed; if the `searchable` prop is `false`, the menu is opened _or closed_\n  on click, more like a standard Select input. thanks\n  [MaaikeB](https://github.com/MaaikeB)\n\n## v0.6.1 / 2015-08-09\n\n- added; Support for options with numeric values, thanks\n  [Dave Brotherstone](https://github.com/bruderstein)\n- changed; Disabled options now appear in the search results , thanks\n  [Dave Brotherstone](https://github.com/bruderstein)\n- fixed; asyncOptions are reloaded on componentWillReceiveProps when the value\n  has changed, thanks [Francis Cote](https://github.com/drfeelgoud)\n- added; `cacheAsyncResults` prop (default `true`) now controls whether the\n  internal cache is used for `asyncOptions`\n\n## v0.6.0 / 2015-08-05\n\n- improved; option, value and single value have been split out into their own\n  components, and can be customised with props. see\n  [#328](https://github.com/JedWatson/react-select/pull/328) for more details.\n- improved; Near-complete test coverage thanks to the awesome work of\n  [Dave Brotherstone](https://github.com/bruderstein)\n- improved; Support all alpha/beta/rc's of React 0.14.0, thanks\n  [Sébastien Lorber](https://github.com/slorber)\n- fixed; Close multi-select menu when tabbing away, thanks\n  [Ben Alpert](https://github.com/spicyj)\n- fixed; Bug where Select shows the value instead of the label (reapplying fix)\n- fixed; `valueRenderer` now works when `multi={false}`, thanks\n  [Chris Portela](https://github.com/0xCMP)\n- added; New property `backspaceRemoves` (default `true`), allows the default\n  behaviour of removing values with backspace when `multi={true}`, thanks\n  [Leo Lehikoinen](https://github.com/lehikol2)\n\n## v0.5.6 / 2015-07-27\n\n- fixed; Allow entering of commas when allowCreate is on but multi is off,\n  thanks [Angelo DiNardi](https://github.com/adinardi)\n- fixed; Times (clear) character is now rendered from string unicode character\n  for consistent output, thanks [Nibbles](https://github.com/Siliconrob)\n- fixed; allowCreate bug, thanks [goodzsq](https://github.com/goodzsq)\n- fixed; changes to props.placeholder weren't being reflected correctly, thanks\n  [alesn](https://github.com/alesn)\n- fixed; error when escape is pressedn where `clearValue` was not passed the\n  event, thanks [Mikhail Kotelnikov](https://github.com/mkotelnikov)\n- added; More tests, thanks [Dave Brotherstone](https://github.com/bruderstein)\n\n## v0.5.5 / 2015-07-12\n\n- fixed; replaced usage of `component.getDOMNode()` with\n  `React.findDOMNode(component)` for compatibility with React 0.14\n\n## v0.5.4 / 2015-07-06\n\n- fixed; regression in 0.5.3 that broke componentWillMount, sorry everyone!\n- added; `addLabelText` prop for customising the \"add {label}?\" text when in\n  tags mode, thanks [Fenn](https://github.com/Fenntasy)\n\n## v0.5.3 / 2015-07-05\n\n- fixed; autoload issues, thanks [Maxime Tyler](https://github.com/iam4x)\n- fixed; style incompatibilities with Foundation framework, thanks\n  [Timothy Kempf](https://github.com/Fauntleroy)\n\n## v0.5.2 / 2015-06-28\n\n- fixed; bug where Select shows the value instead of the label, thanks\n  [Stephen Demjanenko](https://github.com/sdemjanenko)\n- added; 'is-selected' classname is added to the selected option, thanks\n  [Alexey Volodkin](https://github.com/miraks)\n- fixed; async options are now loaded with the initial value, thanks\n  [Pokai Chang](https://github.com/Neson)\n- fixed; `react-input-autosize` now correctly escapes ampersands (&), not\n  actually a fix in react-select but worth noting here because it would have\n  been causing a problem in `react-select` as well.\n\n## v0.5.1 / 2015-06-21\n\n- added; custom option and value rendering capability, thanks\n  [Brian Reavis](https://github.com/brianreavis)\n- fixed; collapsing issue when single-select or empty multi-select fields are\n  disabled\n- fixed; issue where an empty value would be left after clearing all values in a\n  multi-select field\n\n## v0.5.0 / 2015-06-20\n\n- fixed; `esc` key incorrectly created empty options, thanks\n  [rgrzelak](https://github.com/rgrzelak)\n- adeed; New feature to allow option creation (\"tags mode\"), enable with\n  `allowCreate` prop, thanks [Florent Vilmart](https://github.com/flovilmart)\n  and [Brian Reavis](https://github.com/brianreavis)\n- fixed; IE8 compatibility fallback for `addEventListener/removeEventListener`,\n  which don't exist in IE8, thanks\n  [Stefan Billiet](https://github.com/StefanBilliet)\n- fixed; Undefined values when using asyncOptions, thanks\n  [bannaN](https://github.com/bannaN)\n- fixed; Prevent add the last focused value when the drop down menu is closed /\n  Pushing enter without dropdown open adds a value, thanks\n  [Giuseppe](https://github.com/giuse88)\n- fixed; Callback context is undefined, thanks\n  [Giuseppe](https://github.com/giuse88)\n- fixed; Issue with event being swallowed on Enter `keydown`, thanks\n  [Kevin Burke](https://github.com/kembuco)\n- added; Support for case-insensitive filtering when `matchPos=\"start\"`, thanks\n  [wesrage](https://github.com/wesrage)\n- added; Support for customisable background color, thanks\n  [John Morales](https://github.com/JohnMorales)\n- fixed; Updated ESLint and cleared up warnings, thanks\n  [Alexander Shemetovsky](https://github.com/AlexKVal)\n- fixed; Close dropdown when clicking on select, thanks\n  [Nik Butenko](https://github.com/nkbt)\n- added; Tests, and mocha test framework, thanks\n  [Craig Dallimore](https://github.com/craigdallimore)\n- fixed; You can now start the example server and watch for changes with `npm start`\n\n## v0.4.9 / 2015-05-11\n\n- fixed; focus was being grabbed by the select when `autoload` and\n  `asyncOptions` were set\n- added; `focus` method on the component\n- added; support for disabled options, thanks\n  [Pasha Palangpour](https://github.com/pashap)\n- improved; more closures, less binds, for better performance, thanks\n  [Daniel Cousens](https://github.com/dcousens)\n\n## v0.4.8 / 2015-05-02\n\n- fixed; restored `dist/default.css`\n- fixed; standalone example works again\n- fixed; clarified dependency documentation and added dependencies for Bower\n- fixed; Scoping issues in `_bindCloseMenuIfClickedOutside`, thanks\n  [bannaN](https://github.com/bannaN)\n- fixed; Doesn't try to set focus afterupdate if component is disabled, thanks\n  [bannaN](https://github.com/bannaN)\n\n## v0.4.7 / 2015-04-21\n\n- improved; lodash is no longer a dependency, thanks\n  [Daniel Lo Nigro](https://github.com/Daniel15)\n\n## v0.4.6 / 2015-04-06\n\n- updated; dependencies, build process and input-autosize component\n\n## v0.4.5 / 2015-03-28\n\n- fixed; issue with long options overlapping arrow and clear icons, thanks\n  [Rohit Kalkur](https://github.com/rovolution)\n\n## v0.4.4 / 2015-03-26\n\n- fixed; error handling click events when the menu is closed, thanks\n  [Ilya Petrov](https://github.com/muromec)\n- fixed; issue where options will not be filtered in certain conditions, thanks\n  [G. Kay Lee](https://github.com/gsklee)\n\n## v0.4.3 / 2015-03-25\n\n- added tests and updated dependencies\n\n## v0.4.2 / 2015-03-23\n\n- added; ESLint and contributing guide\n- fixed; incorrect `classnames` variable assignment in window scope\n- fixed; all ESLint errors and warnings (except invalid JSX undefined/unused\n  vars due to ESLint bug)\n- fixed; first option is now focused correctly, thanks\n  [Eivind Siqveland Larsen](https://github.com/esiqveland)\n\n## v0.4.1 / 2015-03-20\n\n- fixed; IE11 issue: clicking on scrollbar within menu no longer closes menu,\n  thanks [Rohit Kalkur](https://github.com/rovolution)\n\n## v0.4.0 / 2015-03-12\n\n- updated; compatible with React 0.13\n\n## v0.3.5 / 2015-03-09\n\n- improved; less/no repaint on scroll for performance wins, thanks\n  [jsmunich](https://github.com/jsmunich)\n- added; `onBlur` and `onFocus` event handlers, thanks\n  [Jonas Budelmann](https://github.com/cloudkite)\n- added; support for `inputProps` prop, passed to the `<input>` component,\n  thanks [Yann Plantevin](https://github.com/YannPl)\n- changed; now using\n  [react-component-gulp-tasks](https://github.com/JedWatson/react-component-gulp-tasks)\n  for build\n- fixed; issue w/ remote callbacks overriding cached options, thanks\n  [Corey McMahon](https://github.com/coreymcmahon)\n- fixed; if not `this.props.multi`, menu doesn't need handleMouseDown, thanks\n  [wenbing](https://github.com/wenbing)\n\n## v0.3.4 / 2015-02-23\n\n- fixed; issues with the underscore/lodash dependency change, thanks\n  [Aaron Powell](https://github.com/aaronpowell)\n\n## v0.3.3 / 2015-02-22\n\n- added; `disabled` prop, thanks [Danny Shaw](https://github.com/dannyshaw)\n- added; `searchable` prop - set to `false` to disable the search box, thanks\n  [Julen Ruiz Aizpuru](https://github.com/julen)\n- added; `onOptionLabelClick` prop - see\n  [#66](https://github.com/JedWatson/react-select/pull/66) for docs, thanks\n  [Dmitry Smirnov](https://github.com/dmitry-smirnov)\n- fixed; `text-overflow: ellipsis;` typo, thanks\n  [Andru Vallance](https://github.com/andru)\n\n## v0.3.2 / 2015-01-30\n\n- fixed; issue adding undefined values to multiselect, thanks\n  [Tejas Dinkar](https://github.com/gja)\n\n## v0.3.1 / 2015-01-20\n\n- fixed; missing `var` statement\n\n## v0.3.0 / 2015-01-20\n\n- added; node compatible build now available in `/lib`\n\n## v0.2.14 / 2015-01-07\n\n- added; `searchPromptText` property that is displayed when `asyncOptions` is\n  set and there are (a) no options loaded, and (b) no input entered to search\n  on, thanks [Anton Fedchenko](https://github.com/kompot)\n- added; `clearable` property (defaults to `true`) to control whether the\n  \"clear\" control is available, thanks\n  [Anton Fedchenko](https://github.com/kompot)\n\n## v0.2.13 / 2015-01-05\n\n- fixed; height issues in Safari, thanks\n  [Joss Mackison](https://github.com/jossmac)\n- added; Option to specify \"Clear value\" label as prop for i18n\n\n## v0.2.12 / 2015-01-04\n\n- fixed; UI now responds to touch events, and works on mobile devices! thanks\n  [Fraser Xu](https://github.com/fraserxu)\n\n## v0.2.11 / 2015-01-04\n\n- fixed; Options in the dropdown now scroll into view when they are focused,\n  thanks [Adam](https://github.com/fmovlex)\n- improved; Example dist is now excluded from the npm package\n\n## v0.2.10 / 2015-01-01\n\n- fixed; More specific mixin name to avoid conflicts (css)\n- fixed; Example CSS now correctly rebuilds on changes in development\n- fixed; Values are now expanded correctly when options change (see #28)\n- added; Option to specify \"No results found\" label as prop for i18n, thanks\n  [Julen Ruiz Aizpuru](https://github.com/julen)\n\n## v0.2.9 / 2014-12-09\n\n- added; `filterOption` and `filterOptions` props for more control over\n  filtering\n\n## v0.2.8 / 2014-12-08\n\n- added; `matchPos` option to control whether to match the `start` or `any`\n  position in the string when filtering options (default: `any`)\n- added; `matchProp` option to control whether to match the `value`, `label` or\n  `any` property of each option when filtering (default: `any`)\n\n## v0.2.7 / 2014-12-01\n\n- fixed; screen-readers will now read \"clear value\" instead of \"times\" for the\n  clear button\n- fixed; non-left-click mousedown events aren't blocked by the control\n\n## v0.2.6 / 2014-11-30\n\n- improved; better comparison of changes to [options] in `willReceiveProps`\n- fixed; now focuses the first option correctly when in multiselect mode\n- fixed; fixed focused option behaviour on value change\n- fixed; when filtering, there is always a focused option (#19)\n- changed; using ^ in package.json to compare dependencies\n\n## v0.2.5 / 2014-11-20\n\n- fixed; compatibility with case-sensitive file systems\n\n## v0.2.4 / 2014-11-20\n\n- fixed; package.json pointed at the right file\n\n## v0.2.3 / 2014-11-17\n\n- fixed; Updating state correctly when props change\n- improved; Build tasks and docs\n- added; Working standalone build\n- added; Minified dist version\n- added; Published to Bower\n\n## v0.2.2 / 2014-11-15\n\n- fixed; backspace event being incorrectly cancelled\n\n## v0.2.1 / 2014-11-15\n\n- fixed; issue where backspace incorrectly clears the value (#14)\n\n## v0.2.0 / 2014-11-15\n\n- changed; Major rewrite to improve focus handling and internal state management\n- added; Support for `multi` prop, enable multiselect mode\n\n## v0.1.1 / 2014-11-03\n\n- added; Support for `onChange` event\n- added; `propTypes` are defined by the `Select` component now\n- added; `className` property, sets the `className` on the outer `div` element\n- fixed; Removed deprecated `React.DOM.x` calls\n\n## v0.1.0 / 2014-11-01\n\n- updated; React to 0.12.0\n\n## v0.0.6 / 2014-10-14\n\n- fixed; Error keeping value when using Async Options\n"
  },
  {
    "path": "packages/react-select/LICENSE",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2022 Jed Watson\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "packages/react-select/README.md",
    "content": "[![NPM](https://img.shields.io/npm/v/react-select.svg)](https://www.npmjs.com/package/react-select)\n[![CircleCI](https://circleci.com/gh/JedWatson/react-select/tree/master.svg?style=shield)](https://circleci.com/gh/JedWatson/react-select/tree/master)\n[![Coverage Status](https://coveralls.io/repos/JedWatson/react-select/badge.svg?branch=master&service=github)](https://coveralls.io/github/JedWatson/react-select?branch=master)\n[![Supported by Thinkmill](https://thinkmill.github.io/badge/heart.svg)](http://thinkmill.com.au/?utm_source=github&utm_medium=badge&utm_campaign=react-select)\n\n# React-Select\n\nThe Select control for [React](https://reactjs.com). Initially built for use in [KeystoneJS](http://www.keystonejs.com).\n\nSee [react-select.com](https://www.react-select.com) for live demos and comprehensive docs.\n\nReact Select is funded by [Thinkmill](https://www.thinkmill.com.au) and [Atlassian](https://atlaskit.atlassian.com). It represents a whole new approach to developing powerful React.js components that _just work_ out of the box, while being extremely customisable.\n\nFor the story behind this component, watch Jed's talk at React Conf 2019 - [building React Select](https://youtu.be/yS0jUnmBujE)\n\nFeatures include:\n\n- Flexible approach to data, with customisable functions\n- Extensible styling API with [emotion](https://emotion.sh)\n- Component Injection API for complete control over the UI behaviour\n- Controllable state props and modular architecture\n- Long-requested features like option groups, portal support, animation, and more\n\n## Using an older version?\n\n- [v3, v4, and v5 upgrade guide](https://react-select.com/upgrade)\n- [v2 upgrade guide](https://react-select.com/upgrade-to-v2)\n- React Select v1 documentation and examples are available at [v1.react-select.com](https://v1.react-select.com)\n\n# Installation and usage\n\nThe easiest way to use react-select is to install it from npm and build it into your app with Webpack.\n\n```\nyarn add react-select\n```\n\nThen use it in your app:\n\n#### With React Component\n\n```js\nimport React from 'react';\nimport Select from 'react-select';\n\nconst options = [\n  { value: 'chocolate', label: 'Chocolate' },\n  { value: 'strawberry', label: 'Strawberry' },\n  { value: 'vanilla', label: 'Vanilla' },\n];\n\nclass App extends React.Component {\n  state = {\n    selectedOption: null,\n  };\n  handleChange = (selectedOption) => {\n    this.setState({ selectedOption }, () =>\n      console.log(`Option selected:`, this.state.selectedOption)\n    );\n  };\n  render() {\n    const { selectedOption } = this.state;\n\n    return (\n      <Select\n        value={selectedOption}\n        onChange={this.handleChange}\n        options={options}\n      />\n    );\n  }\n}\n```\n\n#### With React Hooks\n\n```js\nimport React, { useState } from 'react';\nimport Select from 'react-select';\n\nconst options = [\n  { value: 'chocolate', label: 'Chocolate' },\n  { value: 'strawberry', label: 'Strawberry' },\n  { value: 'vanilla', label: 'Vanilla' },\n];\n\nexport default function App() {\n  const [selectedOption, setSelectedOption] = useState(null);\n\n  return (\n    <div className=\"App\">\n      <Select\n        defaultValue={selectedOption}\n        onChange={setSelectedOption}\n        options={options}\n      />\n    </div>\n  );\n}\n```\n\n## Props\n\nCommon props you may want to specify include:\n\n- `autoFocus` - focus the control when it mounts\n- `className` - apply a className to the control\n- `classNamePrefix` - apply classNames to inner elements with the given prefix\n- `isDisabled` - disable the control\n- `isMulti` - allow the user to select multiple values\n- `isSearchable` - allow the user to search for matching options\n- `name` - generate an HTML input with this name, containing the current value\n- `onChange` - subscribe to change events\n- `options` - specify the options the user can select from\n- `placeholder` - change the text displayed when no option is selected\n- `noOptionsMessage` - ({ inputValue: string }) => string | null - Text to display when there are no options\n- `value` - control the current value\n\nSee the [props documentation](https://www.react-select.com/props) for complete documentation on the props react-select supports.\n\n## Controllable Props\n\nYou can control the following props by providing values for them. If you don't, react-select will manage them for you.\n\n- `value` / `onChange` - specify the current value of the control\n- `menuIsOpen` / `onMenuOpen` / `onMenuClose` - control whether the menu is open\n- `inputValue` / `onInputChange` - control the value of the search input (changing this will update the available options)\n\nIf you don't provide these props, you can set the initial value of the state they control:\n\n- `defaultValue` - set the initial value of the control\n- `defaultMenuIsOpen` - set the initial open value of the menu\n- `defaultInputValue` - set the initial value of the search input\n\n## Methods\n\nReact-select exposes two public methods:\n\n- `focus()` - focus the control programmatically\n- `blur()` - blur the control programmatically\n\n## Customisation\n\nCheck the docs for more information on:\n\n- [Customising the styles](https://www.react-select.com/styles)\n- [Using custom components](https://www.react-select.com/components)\n- [Using the built-in animated components](https://www.react-select.com/home#animated-components)\n- [Creating an async select](https://www.react-select.com/async)\n- [Allowing users to create new options](https://www.react-select.com/creatable)\n- [Advanced use-cases](https://www.react-select.com/advanced)\n- [TypeScript guide](https://www.react-select.com/typescript)\n\n## TypeScript\n\nThe v5 release represents a rewrite from JavaScript to TypeScript. The types for v4 and earlier releases are available at [@types](https://www.npmjs.com/package/@types/react-select). See the [TypeScript guide](https://www.react-select.com/typescript) for how to use the types starting with v5.\n\n# Thanks\n\nThank you to everyone who has contributed to this project. It's been a wild ride.\n\nIf you like React Select, you should [follow me on twitter](https://twitter.com/jedwatson)!\n\nShout out to [Joss Mackison](https://github.com/jossmac), [Charles Lee](https://github.com/gwyneplaine), [Ben Conolly](https://github.com/Noviny), [Tom Walker](https://github.com/bladey), [Nathan Bierema](https://github.com/Methuselah96), [Eric Bonow](https://github.com/ebonow), [Emma Hamilton](https://github.com/emmatown), [Dave Brotherstone](https://github.com/bruderstein), [Brian Vaughn](https://github.com/bvaughn), and the [Atlassian Design System](https://atlassian.design) team who along with many other contributors have made this possible ❤️\n\n## License\n\nMIT Licensed. Copyright (c) Jed Watson 2022.\n"
  },
  {
    "path": "packages/react-select/animated/package.json",
    "content": "{\n  \"main\": \"dist/react-select-animated.cjs.js\",\n  \"module\": \"dist/react-select-animated.esm.js\",\n  \"types\": \"dist/react-select-animated.cjs.d.ts\"\n}\n"
  },
  {
    "path": "packages/react-select/async/package.json",
    "content": "{\n  \"main\": \"dist/react-select-async.cjs.js\",\n  \"module\": \"dist/react-select-async.esm.js\",\n  \"types\": \"dist/react-select-async.cjs.d.ts\"\n}\n"
  },
  {
    "path": "packages/react-select/async-creatable/package.json",
    "content": "{\n  \"main\": \"dist/react-select-async-creatable.cjs.js\",\n  \"module\": \"dist/react-select-async-creatable.esm.js\",\n  \"types\": \"dist/react-select-async-creatable.cjs.d.ts\"\n}\n"
  },
  {
    "path": "packages/react-select/base/package.json",
    "content": "{\n  \"main\": \"dist/react-select-base.cjs.js\",\n  \"module\": \"dist/react-select-base.esm.js\",\n  \"types\": \"dist/react-select-base.cjs.d.ts\"\n}\n"
  },
  {
    "path": "packages/react-select/creatable/package.json",
    "content": "{\n  \"main\": \"dist/react-select-creatable.cjs.js\",\n  \"module\": \"dist/react-select-creatable.esm.js\",\n  \"types\": \"dist/react-select-creatable.cjs.d.ts\"\n}\n"
  },
  {
    "path": "packages/react-select/package.json",
    "content": "{\n  \"name\": \"react-select\",\n  \"version\": \"5.10.2\",\n  \"description\": \"A Select control built with and for ReactJS\",\n  \"main\": \"dist/react-select.cjs.js\",\n  \"module\": \"dist/react-select.esm.js\",\n  \"types\": \"dist/react-select.cjs.d.ts\",\n  \"sideEffects\": false,\n  \"author\": \"Jed Watson\",\n  \"license\": \"MIT\",\n  \"repository\": \"https://github.com/JedWatson/react-select/tree/master/packages/react-select\",\n  \"dependencies\": {\n    \"@babel/runtime\": \"^7.12.0\",\n    \"@emotion/cache\": \"^11.4.0\",\n    \"@emotion/react\": \"^11.8.1\",\n    \"@floating-ui/dom\": \"^1.0.1\",\n    \"@types/react-transition-group\": \"^4.4.0\",\n    \"memoize-one\": \"^6.0.0\",\n    \"prop-types\": \"^15.6.0\",\n    \"react-transition-group\": \"^4.3.0\",\n    \"use-isomorphic-layout-effect\": \"^1.2.0\"\n  },\n  \"devDependencies\": {\n    \"@types/jest-in-case\": \"^1.0.6\",\n    \"enzyme\": \"^3.8.0\",\n    \"enzyme-to-json\": \"^3.3.0\",\n    \"jest-in-case\": \"^1.0.2\",\n    \"react\": \"^16.13.0\",\n    \"react-dom\": \"^16.13.0\"\n  },\n  \"peerDependencies\": {\n    \"react\": \"^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0\",\n    \"react-dom\": \"^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0\"\n  },\n  \"files\": [\n    \"dist\",\n    \"base\",\n    \"animated\",\n    \"async\",\n    \"creatable\",\n    \"async-creatable\"\n  ],\n  \"keywords\": [\n    \"combobox\",\n    \"form\",\n    \"input\",\n    \"multiselect\",\n    \"react\",\n    \"react-component\",\n    \"select\",\n    \"ui\"\n  ],\n  \"preconstruct\": {\n    \"entrypoints\": [\n      \"index.ts\",\n      \"base/index.ts\",\n      \"animated/index.ts\",\n      \"async/index.ts\",\n      \"creatable/index.ts\",\n      \"async-creatable/index.ts\"\n    ]\n  },\n  \"exports\": {\n    \".\": {\n      \"module\": \"./dist/react-select.esm.js\",\n      \"import\": \"./dist/react-select.cjs.mjs\",\n      \"default\": \"./dist/react-select.cjs.js\"\n    },\n    \"./base\": {\n      \"module\": \"./base/dist/react-select-base.esm.js\",\n      \"import\": \"./base/dist/react-select-base.cjs.mjs\",\n      \"default\": \"./base/dist/react-select-base.cjs.js\"\n    },\n    \"./async\": {\n      \"module\": \"./async/dist/react-select-async.esm.js\",\n      \"import\": \"./async/dist/react-select-async.cjs.mjs\",\n      \"default\": \"./async/dist/react-select-async.cjs.js\"\n    },\n    \"./animated\": {\n      \"module\": \"./animated/dist/react-select-animated.esm.js\",\n      \"import\": \"./animated/dist/react-select-animated.cjs.mjs\",\n      \"default\": \"./animated/dist/react-select-animated.cjs.js\"\n    },\n    \"./creatable\": {\n      \"module\": \"./creatable/dist/react-select-creatable.esm.js\",\n      \"import\": \"./creatable/dist/react-select-creatable.cjs.mjs\",\n      \"default\": \"./creatable/dist/react-select-creatable.cjs.js\"\n    },\n    \"./async-creatable\": {\n      \"module\": \"./async-creatable/dist/react-select-async-creatable.esm.js\",\n      \"import\": \"./async-creatable/dist/react-select-async-creatable.cjs.mjs\",\n      \"default\": \"./async-creatable/dist/react-select-async-creatable.cjs.js\"\n    },\n    \"./package.json\": \"./package.json\"\n  }\n}\n"
  },
  {
    "path": "packages/react-select/src/Async.tsx",
    "content": "import * as React from 'react';\nimport {\n  forwardRef,\n  MutableRefObject,\n  ReactElement,\n  RefAttributes,\n} from 'react';\nimport Select from './Select';\nimport { GroupBase } from './types';\nimport useStateManager from './useStateManager';\nimport useAsync from './useAsync';\nimport type { AsyncProps } from './useAsync';\nexport type { AsyncProps };\n\ntype AsyncSelect = <\n  Option = unknown,\n  IsMulti extends boolean = false,\n  Group extends GroupBase<Option> = GroupBase<Option>\n>(\n  props: AsyncProps<Option, IsMulti, Group> &\n    RefAttributes<Select<Option, IsMulti, Group>>\n) => ReactElement;\n\nconst AsyncSelect = forwardRef(\n  <Option, IsMulti extends boolean, Group extends GroupBase<Option>>(\n    props: AsyncProps<Option, IsMulti, Group>,\n    ref:\n      | ((instance: Select<Option, IsMulti, Group> | null) => void)\n      | MutableRefObject<Select<Option, IsMulti, Group> | null>\n      | null\n  ) => {\n    const stateManagedProps = useAsync(props);\n    const selectProps = useStateManager(stateManagedProps);\n\n    return <Select ref={ref} {...selectProps} />;\n  }\n) as AsyncSelect;\n\nexport { useAsync };\nexport default AsyncSelect;\n"
  },
  {
    "path": "packages/react-select/src/AsyncCreatable.tsx",
    "content": "import * as React from 'react';\nimport {\n  forwardRef,\n  MutableRefObject,\n  ReactElement,\n  RefAttributes,\n} from 'react';\nimport Select from './Select';\nimport { GroupBase } from './types';\nimport useAsync, { AsyncAdditionalProps } from './useAsync';\nimport useStateManager, { StateManagerProps } from './useStateManager';\nimport useCreatable, { CreatableAdditionalProps } from './useCreatable';\n\nexport type AsyncCreatableProps<\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n> = StateManagerProps<Option, IsMulti, Group> &\n  CreatableAdditionalProps<Option, Group> &\n  AsyncAdditionalProps<Option, Group>;\n\ntype AsyncCreatableSelect = <\n  Option = unknown,\n  IsMulti extends boolean = false,\n  Group extends GroupBase<Option> = GroupBase<Option>\n>(\n  props: AsyncCreatableProps<Option, IsMulti, Group> &\n    RefAttributes<Select<Option, IsMulti, Group>>\n) => ReactElement;\n\nconst AsyncCreatableSelect = forwardRef(\n  <Option, IsMulti extends boolean, Group extends GroupBase<Option>>(\n    props: AsyncCreatableProps<Option, IsMulti, Group>,\n    ref:\n      | ((instance: Select<Option, IsMulti, Group> | null) => void)\n      | MutableRefObject<Select<Option, IsMulti, Group> | null>\n      | null\n  ) => {\n    const stateManagerProps = useAsync(props);\n    const creatableProps = useStateManager(stateManagerProps);\n    const selectProps = useCreatable(creatableProps);\n\n    return <Select ref={ref} {...selectProps} />;\n  }\n) as AsyncCreatableSelect;\n\nexport default AsyncCreatableSelect;\n"
  },
  {
    "path": "packages/react-select/src/Creatable.tsx",
    "content": "import * as React from 'react';\nimport {\n  forwardRef,\n  MutableRefObject,\n  ReactElement,\n  RefAttributes,\n} from 'react';\nimport Select from './Select';\nimport { GroupBase } from './types';\nimport useStateManager, { StateManagerProps } from './useStateManager';\nimport useCreatable, { CreatableAdditionalProps } from './useCreatable';\n\nexport type CreatableProps<\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n> = StateManagerProps<Option, IsMulti, Group> &\n  CreatableAdditionalProps<Option, Group>;\n\ntype CreatableSelect = <\n  Option = unknown,\n  IsMulti extends boolean = false,\n  Group extends GroupBase<Option> = GroupBase<Option>\n>(\n  props: CreatableProps<Option, IsMulti, Group> &\n    RefAttributes<Select<Option, IsMulti, Group>>\n) => ReactElement;\n\nconst CreatableSelect = forwardRef(\n  <Option, IsMulti extends boolean, Group extends GroupBase<Option>>(\n    props: CreatableProps<Option, IsMulti, Group>,\n    ref:\n      | ((instance: Select<Option, IsMulti, Group> | null) => void)\n      | MutableRefObject<Select<Option, IsMulti, Group> | null>\n      | null\n  ) => {\n    const creatableProps = useStateManager(props);\n    const selectProps = useCreatable(creatableProps);\n\n    return <Select ref={ref} {...selectProps} />;\n  }\n) as CreatableSelect;\n\nexport { useCreatable };\nexport default CreatableSelect;\n"
  },
  {
    "path": "packages/react-select/src/NonceProvider.tsx",
    "content": "import * as React from 'react';\nimport { useMemo } from 'react';\nimport { ReactNode } from 'react';\nimport { CacheProvider } from '@emotion/react';\nimport createCache from '@emotion/cache';\n\ninterface NonceProviderProps {\n  nonce: string;\n  children: ReactNode;\n  cacheKey: string;\n}\n\nexport default ({ nonce, children, cacheKey }: NonceProviderProps) => {\n  const emotionCache = useMemo(\n    () => createCache({ key: cacheKey, nonce }),\n    [cacheKey, nonce]\n  );\n  return <CacheProvider value={emotionCache}>{children}</CacheProvider>;\n};\n"
  },
  {
    "path": "packages/react-select/src/Select.tsx",
    "content": "import * as React from 'react';\nimport {\n  AriaAttributes,\n  Component,\n  FocusEventHandler,\n  FormEventHandler,\n  JSX,\n  KeyboardEventHandler,\n  MouseEventHandler,\n  ReactNode,\n  RefCallback,\n  TouchEventHandler,\n} from 'react';\nimport { MenuPlacer } from './components/Menu';\nimport LiveRegion from './components/LiveRegion';\n\nimport { createFilter, FilterOptionOption } from './filters';\nimport { DummyInput, ScrollManager, RequiredInput } from './internal/index';\nimport { AriaLiveMessages, AriaSelection } from './accessibility/index';\nimport { isAppleDevice } from './accessibility/helpers';\n\nimport {\n  classNames,\n  cleanValue,\n  isTouchCapable,\n  isMobileDevice,\n  noop,\n  scrollIntoView,\n  isDocumentElement,\n  notNullish,\n  valueTernary,\n  multiValueAsValue,\n  singleValueAsValue,\n} from './utils';\n\nimport {\n  formatGroupLabel as formatGroupLabelBuiltin,\n  getOptionLabel as getOptionLabelBuiltin,\n  getOptionValue as getOptionValueBuiltin,\n  isOptionDisabled as isOptionDisabledBuiltin,\n} from './builtins';\n\nimport { defaultComponents, SelectComponentsConfig } from './components/index';\n\nimport {\n  ClassNamesConfig,\n  defaultStyles,\n  StylesConfig,\n  StylesProps,\n} from './styles';\nimport { defaultTheme, ThemeConfig } from './theme';\n\nimport {\n  ActionMeta,\n  FocusDirection,\n  GetOptionLabel,\n  GetOptionValue,\n  GroupBase,\n  InputActionMeta,\n  MenuPlacement,\n  MenuPosition,\n  OnChangeValue,\n  Options,\n  OptionsOrGroups,\n  PropsValue,\n  SetValueAction,\n} from './types';\n\nexport type FormatOptionLabelContext = 'menu' | 'value';\nexport interface FormatOptionLabelMeta<Option> {\n  context: FormatOptionLabelContext;\n  inputValue: string;\n  selectValue: Options<Option>;\n}\n\nexport interface Props<\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n> {\n  /** HTML ID of an element containing an error message related to the input**/\n  'aria-errormessage'?: AriaAttributes['aria-errormessage'];\n  /** Indicate if the value entered in the field is invalid **/\n  'aria-invalid'?: AriaAttributes['aria-invalid'];\n  /** Aria label (for assistive tech) */\n  'aria-label'?: AriaAttributes['aria-label'];\n  /** HTML ID of an element that should be used as the label (for assistive tech) */\n  'aria-labelledby'?: AriaAttributes['aria-labelledby'];\n  /** Used to set the priority with which screen reader should treat updates to live regions. The possible settings are: off, polite (default) or assertive */\n  'aria-live'?: AriaAttributes['aria-live'];\n  /** Customise the messages used by the aria-live component */\n  ariaLiveMessages?: AriaLiveMessages<Option, IsMulti, Group>;\n  /** Focus the control when it is mounted */\n  autoFocus?: boolean;\n  /** Remove the currently focused option when the user presses backspace when Select isClearable or isMulti */\n  backspaceRemovesValue: boolean;\n  /** Remove focus from the input when the user selects an option (handy for dismissing the keyboard on touch devices) */\n  blurInputOnSelect: boolean;\n  /** When the user reaches the top/bottom of the menu, prevent scroll on the scroll-parent  */\n  captureMenuScroll: boolean;\n  /** Sets a className attribute on the outer component */\n  className?: string;\n  /**\n   * If provided, all inner components will be given a prefixed className attribute.\n   *\n   * This is useful when styling via CSS classes instead of the Styles API approach.\n   */\n  classNamePrefix?: string | null;\n  /**\n   * Provide classNames based on state for each inner component\n   */\n  classNames: ClassNamesConfig<Option, IsMulti, Group>;\n  /** Close the select menu when the user selects an option */\n  closeMenuOnSelect: boolean;\n  /**\n   * If `true`, close the select menu when the user scrolls the document/body.\n   *\n   * If a function, takes a standard javascript `ScrollEvent` you return a boolean:\n   *\n   * `true` => The menu closes\n   *\n   * `false` => The menu stays open\n   *\n   * This is useful when you have a scrollable modal and want to portal the menu out,\n   * but want to avoid graphical issues.\n   */\n  closeMenuOnScroll: boolean | ((event: Event) => boolean);\n  /**\n   * This complex object includes all the compositional components that are used\n   * in `react-select`. If you wish to overwrite a component, pass in an object\n   * with the appropriate namespace.\n   *\n   * If you only wish to restyle a component, we recommend using the `styles` prop\n   * instead. For a list of the components that can be passed in, and the shape\n   * that will be passed to them, see [the components docs](/components)\n   */\n  components: SelectComponentsConfig<Option, IsMulti, Group>;\n  /** Whether the value of the select, e.g. SingleValue, should be displayed in the control. */\n  controlShouldRenderValue: boolean;\n  /** Delimiter used to join multiple values into a single HTML Input value */\n  delimiter?: string;\n  /** Clear all values when the user presses escape AND the menu is closed */\n  escapeClearsValue: boolean;\n  /** Custom method to filter whether an option should be displayed in the menu */\n  filterOption:\n    | ((option: FilterOptionOption<Option>, inputValue: string) => boolean)\n    | null;\n  /**\n   * Formats group labels in the menu as React components\n   *\n   * An example can be found in the [Replacing builtins](/advanced#replacing-builtins) documentation.\n   */\n  formatGroupLabel: (group: Group) => ReactNode;\n  /** Formats option labels in the menu and control as React components */\n  formatOptionLabel?: (\n    data: Option,\n    formatOptionLabelMeta: FormatOptionLabelMeta<Option>\n  ) => ReactNode;\n  /**\n   * Resolves option data to a string to be displayed as the label by components\n   *\n   * Note: Failure to resolve to a string type can interfere with filtering and\n   * screen reader support.\n   */\n  getOptionLabel: GetOptionLabel<Option>;\n  /** Resolves option data to a string to compare options and specify value attributes */\n  getOptionValue: GetOptionValue<Option>;\n  /** Hide the selected option from the menu */\n  hideSelectedOptions?: boolean;\n  /** The id to set on the SelectContainer component. */\n  id?: string;\n  /** The value of the search input */\n  inputValue: string;\n  /** The id of the search input */\n  inputId?: string;\n  /** Define an id prefix for the select components e.g. {your-id}-value */\n  instanceId?: number | string;\n  /** Is the select value clearable */\n  isClearable?: boolean;\n  /** Is the select disabled */\n  isDisabled: boolean;\n  /** Is the select in a state of loading (async) */\n  isLoading: boolean;\n  /**\n   * Override the built-in logic to detect whether an option is disabled\n   *\n   * An example can be found in the [Replacing builtins](/advanced#replacing-builtins) documentation.\n   */\n  isOptionDisabled: (option: Option, selectValue: Options<Option>) => boolean;\n  /** Override the built-in logic to detect whether an option is selected */\n  isOptionSelected?: (option: Option, selectValue: Options<Option>) => boolean;\n  /** Support multiple selected options */\n  isMulti: IsMulti;\n  /** Is the select direction right-to-left */\n  isRtl: boolean;\n  /** Whether to enable search functionality */\n  isSearchable: boolean;\n  /** Async: Text to display when loading options */\n  loadingMessage: (obj: { inputValue: string }) => ReactNode;\n  /** Minimum height of the menu before flipping */\n  minMenuHeight: number;\n  /** Maximum height of the menu before scrolling */\n  maxMenuHeight: number;\n  /** Whether the menu is open */\n  menuIsOpen: boolean;\n  /**\n   * Default placement of the menu in relation to the control. 'auto' will flip\n   * when there isn't enough space below the control.\n   */\n  menuPlacement: MenuPlacement;\n  /** The CSS position value of the menu, when \"fixed\" extra layout management is required */\n  menuPosition: MenuPosition;\n  /**\n   * Whether the menu should use a portal, and where it should attach\n   *\n   * An example can be found in the [Portaling](/advanced#portaling) documentation\n   */\n  menuPortalTarget?: HTMLElement | null;\n  /** Whether to block scroll events when the menu is open */\n  menuShouldBlockScroll: boolean;\n  /** Whether the menu should be scrolled into view when it opens */\n  menuShouldScrollIntoView: boolean;\n  /** Name of the HTML Input (optional - without this, no input will be rendered) */\n  name?: string;\n  /** Text to display when there are no options */\n  noOptionsMessage: (obj: { inputValue: string }) => ReactNode;\n  /** Handle blur events on the control */\n  onBlur?: FocusEventHandler<HTMLInputElement>;\n  /** Handle change events on the select */\n  onChange: (\n    newValue: OnChangeValue<Option, IsMulti>,\n    actionMeta: ActionMeta<Option>\n  ) => void;\n  /** Handle focus events on the control */\n  onFocus?: FocusEventHandler<HTMLInputElement>;\n  /** Handle change events on the input */\n  onInputChange: (newValue: string, actionMeta: InputActionMeta) => void;\n  /** Handle key down events on the select */\n  onKeyDown?: KeyboardEventHandler<HTMLDivElement>;\n  /** Handle the menu opening */\n  onMenuOpen: () => void;\n  /** Handle the menu closing */\n  onMenuClose: () => void;\n  /** Fired when the user scrolls to the top of the menu */\n  onMenuScrollToTop?: (event: WheelEvent | TouchEvent) => void;\n  /** Fired when the user scrolls to the bottom of the menu */\n  onMenuScrollToBottom?: (event: WheelEvent | TouchEvent) => void;\n  /** Allows control of whether the menu is opened when the Select is focused */\n  openMenuOnFocus: boolean;\n  /** Allows control of whether the menu is opened when the Select is clicked */\n  openMenuOnClick: boolean;\n  /** Array of options that populate the select menu */\n  options: OptionsOrGroups<Option, Group>;\n  /** Number of options to jump in menu when page{up|down} keys are used */\n  pageSize: number;\n  /** Placeholder for the select value */\n  placeholder: ReactNode;\n  /** Status to relay to screen readers */\n  screenReaderStatus: (obj: { count: number }) => string;\n  /**\n   * Style modifier methods\n   *\n   * A basic example can be found at the bottom of the [Replacing builtins](/advanced#replacing-builtins) documentation.\n   */\n  styles: StylesConfig<Option, IsMulti, Group>;\n  /** Theme modifier method */\n  theme?: ThemeConfig;\n  /** Sets the tabIndex attribute on the input */\n  tabIndex: number;\n  /** Select the currently focused option when the user presses tab */\n  tabSelectsValue: boolean;\n  /** Remove all non-essential styles */\n  unstyled: boolean;\n  /** The value of the select; reflected by the selected option */\n  value: PropsValue<Option>;\n  /** Sets the form attribute on the input */\n  form?: string;\n  /** Marks the value-holding input as required for form validation */\n  required?: boolean;\n}\n\nexport const defaultProps = {\n  'aria-live': 'polite',\n  backspaceRemovesValue: true,\n  blurInputOnSelect: isTouchCapable(),\n  captureMenuScroll: !isTouchCapable(),\n  classNames: {},\n  closeMenuOnSelect: true,\n  closeMenuOnScroll: false,\n  components: {},\n  controlShouldRenderValue: true,\n  escapeClearsValue: false,\n  filterOption: createFilter(),\n  formatGroupLabel: formatGroupLabelBuiltin,\n  getOptionLabel: getOptionLabelBuiltin,\n  getOptionValue: getOptionValueBuiltin,\n  isDisabled: false,\n  isLoading: false,\n  isMulti: false,\n  isRtl: false,\n  isSearchable: true,\n  isOptionDisabled: isOptionDisabledBuiltin,\n  loadingMessage: () => 'Loading...',\n  maxMenuHeight: 300,\n  minMenuHeight: 140,\n  menuIsOpen: false,\n  menuPlacement: 'bottom',\n  menuPosition: 'absolute',\n  menuShouldBlockScroll: false,\n  menuShouldScrollIntoView: !isMobileDevice(),\n  noOptionsMessage: () => 'No options',\n  openMenuOnFocus: false,\n  openMenuOnClick: true,\n  options: [],\n  pageSize: 5,\n  placeholder: 'Select...',\n  screenReaderStatus: ({ count }: { count: number }) =>\n    `${count} result${count !== 1 ? 's' : ''} available`,\n  styles: {},\n  tabIndex: 0,\n  tabSelectsValue: true,\n  unstyled: false,\n};\n\ninterface State<\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n> {\n  ariaSelection: AriaSelection<Option, IsMulti> | null;\n  inputIsHidden: boolean;\n  isFocused: boolean;\n  focusedOption: Option | null;\n  focusedOptionId: string | null;\n  focusableOptionsWithIds: FocusableOptionWithId<Option>[];\n  focusedValue: Option | null;\n  selectValue: Options<Option>;\n  clearFocusValueOnUpdate: boolean;\n  prevWasFocused: boolean;\n  inputIsHiddenAfterUpdate: boolean | null | undefined;\n  prevProps: Props<Option, IsMulti, Group> | void;\n  instancePrefix: string;\n  isAppleDevice: boolean;\n}\n\ninterface CategorizedOption<Option> {\n  type: 'option';\n  data: Option;\n  isDisabled: boolean;\n  isSelected: boolean;\n  label: string;\n  value: string;\n  index: number;\n}\n\ninterface FocusableOptionWithId<Option> {\n  data: Option;\n  id: string;\n}\n\ninterface CategorizedGroup<Option, Group extends GroupBase<Option>> {\n  type: 'group';\n  data: Group;\n  options: readonly CategorizedOption<Option>[];\n  index: number;\n}\n\ntype CategorizedGroupOrOption<Option, Group extends GroupBase<Option>> =\n  | CategorizedGroup<Option, Group>\n  | CategorizedOption<Option>;\n\nfunction toCategorizedOption<\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>(\n  props: Props<Option, IsMulti, Group>,\n  option: Option,\n  selectValue: Options<Option>,\n  index: number\n): CategorizedOption<Option> {\n  const isDisabled = isOptionDisabled(props, option, selectValue);\n  const isSelected = isOptionSelected(props, option, selectValue);\n  const label = getOptionLabel(props, option);\n  const value = getOptionValue(props, option);\n\n  return {\n    type: 'option',\n    data: option,\n    isDisabled,\n    isSelected,\n    label,\n    value,\n    index,\n  };\n}\n\nfunction buildCategorizedOptions<\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>(\n  props: Props<Option, IsMulti, Group>,\n  selectValue: Options<Option>\n): CategorizedGroupOrOption<Option, Group>[] {\n  return props.options\n    .map((groupOrOption, groupOrOptionIndex) => {\n      if ('options' in groupOrOption) {\n        const categorizedOptions = groupOrOption.options\n          .map((option, optionIndex) =>\n            toCategorizedOption(props, option, selectValue, optionIndex)\n          )\n          .filter((categorizedOption) => isFocusable(props, categorizedOption));\n        return categorizedOptions.length > 0\n          ? {\n              type: 'group' as const,\n              data: groupOrOption,\n              options: categorizedOptions,\n              index: groupOrOptionIndex,\n            }\n          : undefined;\n      }\n      const categorizedOption = toCategorizedOption(\n        props,\n        groupOrOption,\n        selectValue,\n        groupOrOptionIndex\n      );\n      return isFocusable(props, categorizedOption)\n        ? categorizedOption\n        : undefined;\n    })\n    .filter(notNullish);\n}\n\nfunction buildFocusableOptionsFromCategorizedOptions<\n  Option,\n  Group extends GroupBase<Option>\n>(categorizedOptions: readonly CategorizedGroupOrOption<Option, Group>[]) {\n  return categorizedOptions.reduce<Option[]>(\n    (optionsAccumulator, categorizedOption) => {\n      if (categorizedOption.type === 'group') {\n        optionsAccumulator.push(\n          ...categorizedOption.options.map((option) => option.data)\n        );\n      } else {\n        optionsAccumulator.push(categorizedOption.data);\n      }\n      return optionsAccumulator;\n    },\n    []\n  );\n}\n\nfunction buildFocusableOptionsWithIds<Option, Group extends GroupBase<Option>>(\n  categorizedOptions: readonly CategorizedGroupOrOption<Option, Group>[],\n  optionId: string\n) {\n  return categorizedOptions.reduce<FocusableOptionWithId<Option>[]>(\n    (optionsAccumulator, categorizedOption) => {\n      if (categorizedOption.type === 'group') {\n        optionsAccumulator.push(\n          ...categorizedOption.options.map((option) => ({\n            data: option.data,\n            id: `${optionId}-${categorizedOption.index}-${option.index}`,\n          }))\n        );\n      } else {\n        optionsAccumulator.push({\n          data: categorizedOption.data,\n          id: `${optionId}-${categorizedOption.index}`,\n        });\n      }\n      return optionsAccumulator;\n    },\n    []\n  );\n}\n\nfunction buildFocusableOptions<\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>(props: Props<Option, IsMulti, Group>, selectValue: Options<Option>) {\n  return buildFocusableOptionsFromCategorizedOptions(\n    buildCategorizedOptions(props, selectValue)\n  );\n}\n\nfunction isFocusable<\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>(\n  props: Props<Option, IsMulti, Group>,\n  categorizedOption: CategorizedOption<Option>\n) {\n  const { inputValue = '' } = props;\n  const { data, isSelected, label, value } = categorizedOption;\n\n  return (\n    (!shouldHideSelectedOptions(props) || !isSelected) &&\n    filterOption(props, { label, value, data }, inputValue)\n  );\n}\n\nfunction getNextFocusedValue<\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>(state: State<Option, IsMulti, Group>, nextSelectValue: Options<Option>) {\n  const { focusedValue, selectValue: lastSelectValue } = state;\n  const lastFocusedIndex = lastSelectValue.indexOf(focusedValue!);\n  if (lastFocusedIndex > -1) {\n    const nextFocusedIndex = nextSelectValue.indexOf(focusedValue!);\n    if (nextFocusedIndex > -1) {\n      // the focused value is still in the selectValue, return it\n      return focusedValue;\n    } else if (lastFocusedIndex < nextSelectValue.length) {\n      // the focusedValue is not present in the next selectValue array by\n      // reference, so return the new value at the same index\n      return nextSelectValue[lastFocusedIndex];\n    }\n  }\n  return null;\n}\n\nfunction getNextFocusedOption<\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>(state: State<Option, IsMulti, Group>, options: Options<Option>) {\n  const { focusedOption: lastFocusedOption } = state;\n  return lastFocusedOption && options.indexOf(lastFocusedOption) > -1\n    ? lastFocusedOption\n    : options[0];\n}\n\nconst getFocusedOptionId = <Option,>(\n  focusableOptionsWithIds: FocusableOptionWithId<Option>[],\n  focusedOption: Option\n) => {\n  const focusedOptionId = focusableOptionsWithIds.find(\n    (option) => option.data === focusedOption\n  )?.id;\n  return focusedOptionId || null;\n};\n\nconst getOptionLabel = <\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>(\n  props: Props<Option, IsMulti, Group>,\n  data: Option\n): string => {\n  return props.getOptionLabel(data);\n};\nconst getOptionValue = <\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>(\n  props: Props<Option, IsMulti, Group>,\n  data: Option\n): string => {\n  return props.getOptionValue(data);\n};\n\nfunction isOptionDisabled<\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>(\n  props: Props<Option, IsMulti, Group>,\n  option: Option,\n  selectValue: Options<Option>\n): boolean {\n  return typeof props.isOptionDisabled === 'function'\n    ? props.isOptionDisabled(option, selectValue)\n    : false;\n}\nfunction isOptionSelected<\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>(\n  props: Props<Option, IsMulti, Group>,\n  option: Option,\n  selectValue: Options<Option>\n): boolean {\n  if (selectValue.indexOf(option) > -1) return true;\n  if (typeof props.isOptionSelected === 'function') {\n    return props.isOptionSelected(option, selectValue);\n  }\n  const candidate = getOptionValue(props, option);\n  return selectValue.some((i) => getOptionValue(props, i) === candidate);\n}\nfunction filterOption<\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>(\n  props: Props<Option, IsMulti, Group>,\n  option: FilterOptionOption<Option>,\n  inputValue: string\n) {\n  return props.filterOption ? props.filterOption(option, inputValue) : true;\n}\n\nconst shouldHideSelectedOptions = <\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>(\n  props: Props<Option, IsMulti, Group>\n) => {\n  const { hideSelectedOptions, isMulti } = props;\n  if (hideSelectedOptions === undefined) return isMulti;\n  return hideSelectedOptions;\n};\n\nlet instanceId = 1;\n\nexport default class Select<\n  Option = unknown,\n  IsMulti extends boolean = false,\n  Group extends GroupBase<Option> = GroupBase<Option>\n> extends Component<\n  Props<Option, IsMulti, Group>,\n  State<Option, IsMulti, Group>\n> {\n  static defaultProps = defaultProps;\n  state: State<Option, IsMulti, Group> = {\n    ariaSelection: null,\n    focusedOption: null,\n    focusedOptionId: null,\n    focusableOptionsWithIds: [],\n    focusedValue: null,\n    inputIsHidden: false,\n    isFocused: false,\n    selectValue: [],\n    clearFocusValueOnUpdate: false,\n    prevWasFocused: false,\n    inputIsHiddenAfterUpdate: undefined,\n    prevProps: undefined,\n    instancePrefix: '',\n    isAppleDevice: false,\n  };\n\n  // Misc. Instance Properties\n  // ------------------------------\n\n  blockOptionHover = false;\n  isComposing = false;\n  commonProps: any; // TODO\n  initialTouchX = 0;\n  initialTouchY = 0;\n  openAfterFocus = false;\n  scrollToFocusedOptionOnUpdate = false;\n  userIsDragging?: boolean;\n\n  // Refs\n  // ------------------------------\n\n  controlRef: HTMLDivElement | null = null;\n  getControlRef: RefCallback<HTMLDivElement> = (ref) => {\n    this.controlRef = ref;\n  };\n  focusedOptionRef: HTMLDivElement | null = null;\n  getFocusedOptionRef: RefCallback<HTMLDivElement> = (ref) => {\n    this.focusedOptionRef = ref;\n  };\n  menuListRef: HTMLDivElement | null = null;\n  getMenuListRef: RefCallback<HTMLDivElement> = (ref) => {\n    this.menuListRef = ref;\n  };\n  inputRef: HTMLInputElement | null = null;\n  getInputRef: RefCallback<HTMLInputElement> = (ref) => {\n    this.inputRef = ref;\n  };\n\n  // Lifecycle\n  // ------------------------------\n\n  constructor(props: Props<Option, IsMulti, Group>) {\n    super(props);\n    this.state.instancePrefix =\n      'react-select-' + (this.props.instanceId || ++instanceId);\n    this.state.selectValue = cleanValue(props.value);\n    // Set focusedOption if menuIsOpen is set on init (e.g. defaultMenuIsOpen)\n    if (props.menuIsOpen && this.state.selectValue.length) {\n      const focusableOptionsWithIds: FocusableOptionWithId<Option>[] =\n        this.getFocusableOptionsWithIds();\n      const focusableOptions = this.buildFocusableOptions();\n      const optionIndex = focusableOptions.indexOf(this.state.selectValue[0]);\n      this.state.focusableOptionsWithIds = focusableOptionsWithIds;\n      this.state.focusedOption = focusableOptions[optionIndex];\n      this.state.focusedOptionId = getFocusedOptionId(\n        focusableOptionsWithIds,\n        focusableOptions[optionIndex]\n      );\n    }\n  }\n\n  static getDerivedStateFromProps(\n    props: Props<unknown, boolean, GroupBase<unknown>>,\n    state: State<unknown, boolean, GroupBase<unknown>>\n  ) {\n    const {\n      prevProps,\n      clearFocusValueOnUpdate,\n      inputIsHiddenAfterUpdate,\n      ariaSelection,\n      isFocused,\n      prevWasFocused,\n      instancePrefix,\n    } = state;\n    const { options, value, menuIsOpen, inputValue, isMulti } = props;\n    const selectValue = cleanValue(value);\n    let newMenuOptionsState = {};\n    if (\n      prevProps &&\n      (value !== prevProps.value ||\n        options !== prevProps.options ||\n        menuIsOpen !== prevProps.menuIsOpen ||\n        inputValue !== prevProps.inputValue)\n    ) {\n      const focusableOptions = menuIsOpen\n        ? buildFocusableOptions(props, selectValue)\n        : [];\n\n      const focusableOptionsWithIds = menuIsOpen\n        ? buildFocusableOptionsWithIds(\n            buildCategorizedOptions(props, selectValue),\n            `${instancePrefix}-option`\n          )\n        : [];\n\n      const focusedValue = clearFocusValueOnUpdate\n        ? getNextFocusedValue(state, selectValue)\n        : null;\n      const focusedOption = getNextFocusedOption(state, focusableOptions);\n      const focusedOptionId = getFocusedOptionId(\n        focusableOptionsWithIds,\n        focusedOption\n      );\n\n      newMenuOptionsState = {\n        selectValue,\n        focusedOption,\n        focusedOptionId,\n        focusableOptionsWithIds,\n        focusedValue,\n        clearFocusValueOnUpdate: false,\n      };\n    }\n    // some updates should toggle the state of the input visibility\n    const newInputIsHiddenState =\n      inputIsHiddenAfterUpdate != null && props !== prevProps\n        ? {\n            inputIsHidden: inputIsHiddenAfterUpdate,\n            inputIsHiddenAfterUpdate: undefined,\n          }\n        : {};\n\n    let newAriaSelection = ariaSelection;\n\n    let hasKeptFocus = isFocused && prevWasFocused;\n\n    if (isFocused && !hasKeptFocus) {\n      // If `value` or `defaultValue` props are not empty then announce them\n      // when the Select is initially focused\n      newAriaSelection = {\n        value: valueTernary(isMulti, selectValue, selectValue[0] || null),\n        options: selectValue,\n        action: 'initial-input-focus',\n      };\n\n      hasKeptFocus = !prevWasFocused;\n    }\n\n    // If the 'initial-input-focus' action has been set already\n    // then reset the ariaSelection to null\n    if (ariaSelection?.action === 'initial-input-focus') {\n      newAriaSelection = null;\n    }\n\n    return {\n      ...newMenuOptionsState,\n      ...newInputIsHiddenState,\n      prevProps: props,\n      ariaSelection: newAriaSelection,\n      prevWasFocused: hasKeptFocus,\n    };\n  }\n  componentDidMount() {\n    this.startListeningComposition();\n    this.startListeningToTouch();\n\n    if (this.props.closeMenuOnScroll && document && document.addEventListener) {\n      // Listen to all scroll events, and filter them out inside of 'onScroll'\n      document.addEventListener('scroll', this.onScroll, true);\n    }\n\n    if (this.props.autoFocus) {\n      this.focusInput();\n    }\n\n    // Scroll focusedOption into view if menuIsOpen is set on mount (e.g. defaultMenuIsOpen)\n    if (\n      this.props.menuIsOpen &&\n      this.state.focusedOption &&\n      this.menuListRef &&\n      this.focusedOptionRef\n    ) {\n      scrollIntoView(this.menuListRef, this.focusedOptionRef);\n    }\n    if (isAppleDevice()) {\n      // eslint-disable-next-line react/no-did-mount-set-state\n      this.setState({ isAppleDevice: true });\n    }\n  }\n  componentDidUpdate(prevProps: Props<Option, IsMulti, Group>) {\n    const { isDisabled, menuIsOpen } = this.props;\n    const { isFocused } = this.state;\n\n    if (\n      // ensure focus is restored correctly when the control becomes enabled\n      (isFocused && !isDisabled && prevProps.isDisabled) ||\n      // ensure focus is on the Input when the menu opens\n      (isFocused && menuIsOpen && !prevProps.menuIsOpen)\n    ) {\n      this.focusInput();\n    }\n\n    if (isFocused && isDisabled && !prevProps.isDisabled) {\n      // ensure select state gets blurred in case Select is programmatically disabled while focused\n      // eslint-disable-next-line react/no-did-update-set-state\n      this.setState({ isFocused: false }, this.onMenuClose);\n    } else if (\n      !isFocused &&\n      !isDisabled &&\n      prevProps.isDisabled &&\n      this.inputRef === document.activeElement\n    ) {\n      // ensure select state gets focused in case Select is programatically re-enabled while focused (Firefox)\n      // eslint-disable-next-line react/no-did-update-set-state\n      this.setState({ isFocused: true });\n    }\n\n    // scroll the focused option into view if necessary\n    if (\n      this.menuListRef &&\n      this.focusedOptionRef &&\n      this.scrollToFocusedOptionOnUpdate\n    ) {\n      scrollIntoView(this.menuListRef, this.focusedOptionRef);\n      this.scrollToFocusedOptionOnUpdate = false;\n    }\n  }\n  componentWillUnmount() {\n    this.stopListeningComposition();\n    this.stopListeningToTouch();\n    document.removeEventListener('scroll', this.onScroll, true);\n  }\n\n  // ==============================\n  // Consumer Handlers\n  // ==============================\n\n  onMenuOpen() {\n    this.props.onMenuOpen();\n  }\n  onMenuClose() {\n    this.onInputChange('', {\n      action: 'menu-close',\n      prevInputValue: this.props.inputValue,\n    });\n\n    this.props.onMenuClose();\n  }\n  onInputChange(newValue: string, actionMeta: InputActionMeta) {\n    this.props.onInputChange(newValue, actionMeta);\n  }\n\n  // ==============================\n  // Methods\n  // ==============================\n\n  focusInput() {\n    if (!this.inputRef) return;\n    this.inputRef.focus();\n  }\n  blurInput() {\n    if (!this.inputRef) return;\n    this.inputRef.blur();\n  }\n\n  // aliased for consumers\n  focus = this.focusInput;\n  blur = this.blurInput;\n\n  openMenu(focusOption: 'first' | 'last') {\n    const { selectValue, isFocused } = this.state;\n    const focusableOptions = this.buildFocusableOptions();\n    let openAtIndex = focusOption === 'first' ? 0 : focusableOptions.length - 1;\n\n    if (!this.props.isMulti) {\n      const selectedIndex = focusableOptions.indexOf(selectValue[0]);\n      if (selectedIndex > -1) {\n        openAtIndex = selectedIndex;\n      }\n    }\n\n    // only scroll if the menu isn't already open\n    this.scrollToFocusedOptionOnUpdate = !(isFocused && this.menuListRef);\n\n    this.setState(\n      {\n        inputIsHiddenAfterUpdate: false,\n        focusedValue: null,\n        focusedOption: focusableOptions[openAtIndex],\n        focusedOptionId: this.getFocusedOptionId(focusableOptions[openAtIndex]),\n      },\n      () => this.onMenuOpen()\n    );\n  }\n\n  focusValue(direction: 'previous' | 'next') {\n    const { selectValue, focusedValue } = this.state;\n\n    // Only multiselects support value focusing\n    if (!this.props.isMulti) return;\n\n    this.setState({\n      focusedOption: null,\n    });\n\n    let focusedIndex = selectValue.indexOf(focusedValue!);\n    if (!focusedValue) {\n      focusedIndex = -1;\n    }\n\n    const lastIndex = selectValue.length - 1;\n    let nextFocus = -1;\n    if (!selectValue.length) return;\n\n    switch (direction) {\n      case 'previous':\n        if (focusedIndex === 0) {\n          // don't cycle from the start to the end\n          nextFocus = 0;\n        } else if (focusedIndex === -1) {\n          // if nothing is focused, focus the last value first\n          nextFocus = lastIndex;\n        } else {\n          nextFocus = focusedIndex - 1;\n        }\n        break;\n      case 'next':\n        if (focusedIndex > -1 && focusedIndex < lastIndex) {\n          nextFocus = focusedIndex + 1;\n        }\n        break;\n    }\n    this.setState({\n      inputIsHidden: nextFocus !== -1,\n      focusedValue: selectValue[nextFocus],\n    });\n  }\n\n  focusOption(direction: FocusDirection = 'first') {\n    const { pageSize } = this.props;\n    const { focusedOption } = this.state;\n    const options = this.getFocusableOptions();\n\n    if (!options.length) return;\n    let nextFocus = 0; // handles 'first'\n    let focusedIndex = options.indexOf(focusedOption!);\n    if (!focusedOption) {\n      focusedIndex = -1;\n    }\n\n    if (direction === 'up') {\n      nextFocus = focusedIndex > 0 ? focusedIndex - 1 : options.length - 1;\n    } else if (direction === 'down') {\n      nextFocus = (focusedIndex + 1) % options.length;\n    } else if (direction === 'pageup') {\n      nextFocus = focusedIndex - pageSize;\n      if (nextFocus < 0) nextFocus = 0;\n    } else if (direction === 'pagedown') {\n      nextFocus = focusedIndex + pageSize;\n      if (nextFocus > options.length - 1) nextFocus = options.length - 1;\n    } else if (direction === 'last') {\n      nextFocus = options.length - 1;\n    }\n    this.scrollToFocusedOptionOnUpdate = true;\n    this.setState({\n      focusedOption: options[nextFocus],\n      focusedValue: null,\n      focusedOptionId: this.getFocusedOptionId(options[nextFocus]),\n    });\n  }\n  onChange = (\n    newValue: OnChangeValue<Option, IsMulti>,\n    actionMeta: ActionMeta<Option>\n  ) => {\n    const { onChange, name } = this.props;\n    actionMeta.name = name;\n\n    this.ariaOnChange(newValue, actionMeta);\n    onChange(newValue, actionMeta);\n  };\n  setValue = (\n    newValue: OnChangeValue<Option, IsMulti>,\n    action: SetValueAction,\n    option?: Option\n  ) => {\n    const { closeMenuOnSelect, isMulti, inputValue } = this.props;\n    this.onInputChange('', { action: 'set-value', prevInputValue: inputValue });\n    if (closeMenuOnSelect) {\n      this.setState({\n        inputIsHiddenAfterUpdate: !isMulti,\n      });\n      this.onMenuClose();\n    }\n    // when the select value should change, we should reset focusedValue\n    this.setState({ clearFocusValueOnUpdate: true });\n    this.onChange(newValue, { action, option });\n  };\n  selectOption = (newValue: Option) => {\n    const { blurInputOnSelect, isMulti, name } = this.props;\n    const { selectValue } = this.state;\n    const deselected = isMulti && this.isOptionSelected(newValue, selectValue);\n    const isDisabled = this.isOptionDisabled(newValue, selectValue);\n\n    if (deselected) {\n      const candidate = this.getOptionValue(newValue);\n      this.setValue(\n        multiValueAsValue(\n          selectValue.filter((i) => this.getOptionValue(i) !== candidate)\n        ),\n        'deselect-option',\n        newValue\n      );\n    } else if (!isDisabled) {\n      // Select option if option is not disabled\n      if (isMulti) {\n        this.setValue(\n          multiValueAsValue([...selectValue, newValue]),\n          'select-option',\n          newValue\n        );\n      } else {\n        this.setValue(singleValueAsValue(newValue), 'select-option');\n      }\n    } else {\n      this.ariaOnChange(singleValueAsValue(newValue), {\n        action: 'select-option',\n        option: newValue,\n        name,\n      });\n      return;\n    }\n\n    if (blurInputOnSelect) {\n      this.blurInput();\n    }\n  };\n  removeValue = (removedValue: Option) => {\n    const { isMulti } = this.props;\n    const { selectValue } = this.state;\n    const candidate = this.getOptionValue(removedValue);\n    const newValueArray = selectValue.filter(\n      (i) => this.getOptionValue(i) !== candidate\n    );\n    const newValue = valueTernary(\n      isMulti,\n      newValueArray,\n      newValueArray[0] || null\n    );\n\n    this.onChange(newValue, { action: 'remove-value', removedValue });\n    this.focusInput();\n  };\n  clearValue = () => {\n    const { selectValue } = this.state;\n    this.onChange(valueTernary(this.props.isMulti, [], null), {\n      action: 'clear',\n      removedValues: selectValue,\n    });\n  };\n  popValue = () => {\n    const { isMulti } = this.props;\n    const { selectValue } = this.state;\n    const lastSelectedValue = selectValue[selectValue.length - 1];\n    const newValueArray = selectValue.slice(0, selectValue.length - 1);\n    const newValue = valueTernary(\n      isMulti,\n      newValueArray,\n      newValueArray[0] || null\n    );\n\n    if (lastSelectedValue) {\n      this.onChange(newValue, {\n        action: 'pop-value',\n        removedValue: lastSelectedValue,\n      });\n    }\n  };\n\n  // ==============================\n  // Getters\n  // ==============================\n\n  getTheme() {\n    // Use the default theme if there are no customisations.\n    if (!this.props.theme) {\n      return defaultTheme;\n    }\n    // If the theme prop is a function, assume the function\n    // knows how to merge the passed-in default theme with\n    // its own modifications.\n    if (typeof this.props.theme === 'function') {\n      return this.props.theme(defaultTheme);\n    }\n    // Otherwise, if a plain theme object was passed in,\n    // overlay it with the default theme.\n    return {\n      ...defaultTheme,\n      ...this.props.theme,\n    };\n  }\n\n  getFocusedOptionId = (focusedOption: Option) => {\n    return getFocusedOptionId(\n      this.state.focusableOptionsWithIds,\n      focusedOption\n    );\n  };\n\n  getFocusableOptionsWithIds = () => {\n    return buildFocusableOptionsWithIds(\n      buildCategorizedOptions(this.props, this.state.selectValue),\n      this.getElementId('option')\n    );\n  };\n\n  getValue = () => this.state.selectValue;\n\n  cx = (...args: any) => classNames(this.props.classNamePrefix, ...args);\n\n  getCommonProps() {\n    const {\n      clearValue,\n      cx,\n      getStyles,\n      getClassNames,\n      getValue,\n      selectOption,\n      setValue,\n      props,\n    } = this;\n    const { isMulti, isRtl, options } = props;\n    const hasValue = this.hasValue();\n\n    return {\n      clearValue,\n      cx,\n      getStyles,\n      getClassNames,\n      getValue,\n      hasValue,\n      isMulti,\n      isRtl,\n      options,\n      selectOption,\n      selectProps: props,\n      setValue,\n      theme: this.getTheme(),\n    };\n  }\n\n  getOptionLabel = (data: Option): string => {\n    return getOptionLabel(this.props, data);\n  };\n  getOptionValue = (data: Option): string => {\n    return getOptionValue(this.props, data);\n  };\n  getStyles = <Key extends keyof StylesProps<Option, IsMulti, Group>>(\n    key: Key,\n    props: StylesProps<Option, IsMulti, Group>[Key]\n  ) => {\n    const { unstyled } = this.props;\n    const base = defaultStyles[key](props as any, unstyled);\n    base.boxSizing = 'border-box';\n    const custom = this.props.styles[key];\n    return custom ? custom(base, props as any) : base;\n  };\n  getClassNames = <Key extends keyof StylesProps<Option, IsMulti, Group>>(\n    key: Key,\n    props: StylesProps<Option, IsMulti, Group>[Key]\n  ) => this.props.classNames[key]?.(props as any);\n  getElementId = (\n    element:\n      | 'group'\n      | 'input'\n      | 'listbox'\n      | 'option'\n      | 'placeholder'\n      | 'live-region'\n  ) => {\n    return `${this.state.instancePrefix}-${element}`;\n  };\n\n  getComponents = () => {\n    return defaultComponents(this.props);\n  };\n\n  buildCategorizedOptions = () =>\n    buildCategorizedOptions(this.props, this.state.selectValue);\n  getCategorizedOptions = () =>\n    this.props.menuIsOpen ? this.buildCategorizedOptions() : [];\n  buildFocusableOptions = () =>\n    buildFocusableOptionsFromCategorizedOptions(this.buildCategorizedOptions());\n  getFocusableOptions = () =>\n    this.props.menuIsOpen ? this.buildFocusableOptions() : [];\n\n  // ==============================\n  // Helpers\n  // ==============================\n\n  ariaOnChange = (\n    value: OnChangeValue<Option, IsMulti>,\n    actionMeta: ActionMeta<Option>\n  ) => {\n    this.setState({ ariaSelection: { value, ...actionMeta } });\n  };\n\n  hasValue() {\n    const { selectValue } = this.state;\n    return selectValue.length > 0;\n  }\n  hasOptions() {\n    return !!this.getFocusableOptions().length;\n  }\n  isClearable(): boolean {\n    const { isClearable, isMulti } = this.props;\n\n    // single select, by default, IS NOT clearable\n    // multi select, by default, IS clearable\n    if (isClearable === undefined) return isMulti;\n\n    return isClearable;\n  }\n  isOptionDisabled(option: Option, selectValue: Options<Option>): boolean {\n    return isOptionDisabled(this.props, option, selectValue);\n  }\n  isOptionSelected(option: Option, selectValue: Options<Option>): boolean {\n    return isOptionSelected(this.props, option, selectValue);\n  }\n  filterOption(option: FilterOptionOption<Option>, inputValue: string) {\n    return filterOption(this.props, option, inputValue);\n  }\n  formatOptionLabel(\n    data: Option,\n    context: FormatOptionLabelContext\n  ): ReactNode {\n    if (typeof this.props.formatOptionLabel === 'function') {\n      const { inputValue } = this.props;\n      const { selectValue } = this.state;\n      return this.props.formatOptionLabel(data, {\n        context,\n        inputValue,\n        selectValue,\n      });\n    } else {\n      return this.getOptionLabel(data);\n    }\n  }\n  formatGroupLabel(data: Group) {\n    return this.props.formatGroupLabel(data);\n  }\n\n  // ==============================\n  // Mouse Handlers\n  // ==============================\n\n  onMenuMouseDown: MouseEventHandler<HTMLDivElement> = (event) => {\n    if (event.button !== 0) {\n      return;\n    }\n    event.stopPropagation();\n    event.preventDefault();\n    this.focusInput();\n  };\n  onMenuMouseMove: MouseEventHandler<HTMLDivElement> = (event) => {\n    this.blockOptionHover = false;\n  };\n  onControlMouseDown = (\n    event: React.MouseEvent<HTMLDivElement> | React.TouchEvent<HTMLDivElement>\n  ) => {\n    // Event captured by dropdown indicator\n    if (event.defaultPrevented) {\n      return;\n    }\n    const { openMenuOnClick } = this.props;\n    if (!this.state.isFocused) {\n      if (openMenuOnClick) {\n        this.openAfterFocus = true;\n      }\n      this.focusInput();\n    } else if (!this.props.menuIsOpen) {\n      if (openMenuOnClick) {\n        this.openMenu('first');\n      }\n    } else {\n      if (\n        (event.target as HTMLElement).tagName !== 'INPUT' &&\n        (event.target as HTMLElement).tagName !== 'TEXTAREA'\n      ) {\n        this.onMenuClose();\n      }\n    }\n    if (\n      (event.target as HTMLElement).tagName !== 'INPUT' &&\n      (event.target as HTMLElement).tagName !== 'TEXTAREA'\n    ) {\n      event.preventDefault();\n    }\n  };\n  onDropdownIndicatorMouseDown = (\n    event: React.MouseEvent<HTMLDivElement> | React.TouchEvent<HTMLDivElement>\n  ) => {\n    // ignore mouse events that weren't triggered by the primary button\n    if (\n      event &&\n      event.type === 'mousedown' &&\n      (event as React.MouseEvent<HTMLDivElement>).button !== 0\n    ) {\n      return;\n    }\n    if (this.props.isDisabled) return;\n    const { isMulti, menuIsOpen } = this.props;\n    this.focusInput();\n    if (menuIsOpen) {\n      this.setState({ inputIsHiddenAfterUpdate: !isMulti });\n      this.onMenuClose();\n    } else {\n      this.openMenu('first');\n    }\n    event.preventDefault();\n  };\n  onClearIndicatorMouseDown = (\n    event: React.MouseEvent<HTMLDivElement> | React.TouchEvent<HTMLDivElement>\n  ) => {\n    // ignore mouse events that weren't triggered by the primary button\n    if (\n      event &&\n      event.type === 'mousedown' &&\n      (event as React.MouseEvent<HTMLDivElement>).button !== 0\n    ) {\n      return;\n    }\n    this.clearValue();\n    event.preventDefault();\n    this.openAfterFocus = false;\n    if (event.type === 'touchend') {\n      this.focusInput();\n    } else {\n      setTimeout(() => this.focusInput());\n    }\n  };\n  onScroll = (event: Event) => {\n    if (typeof this.props.closeMenuOnScroll === 'boolean') {\n      if (\n        event.target instanceof HTMLElement &&\n        isDocumentElement(event.target)\n      ) {\n        this.props.onMenuClose();\n      }\n    } else if (typeof this.props.closeMenuOnScroll === 'function') {\n      if (this.props.closeMenuOnScroll(event)) {\n        this.props.onMenuClose();\n      }\n    }\n  };\n\n  // ==============================\n  // Composition Handlers\n  // ==============================\n\n  startListeningComposition() {\n    if (document && document.addEventListener) {\n      document.addEventListener(\n        'compositionstart',\n        this.onCompositionStart,\n        false\n      );\n      document.addEventListener('compositionend', this.onCompositionEnd, false);\n    }\n  }\n  stopListeningComposition() {\n    if (document && document.removeEventListener) {\n      document.removeEventListener('compositionstart', this.onCompositionStart);\n      document.removeEventListener('compositionend', this.onCompositionEnd);\n    }\n  }\n  onCompositionStart = () => {\n    this.isComposing = true;\n  };\n  onCompositionEnd = () => {\n    this.isComposing = false;\n  };\n\n  // ==============================\n  // Touch Handlers\n  // ==============================\n\n  startListeningToTouch() {\n    if (document && document.addEventListener) {\n      document.addEventListener('touchstart', this.onTouchStart, false);\n      document.addEventListener('touchmove', this.onTouchMove, false);\n      document.addEventListener('touchend', this.onTouchEnd, false);\n    }\n  }\n  stopListeningToTouch() {\n    if (document && document.removeEventListener) {\n      document.removeEventListener('touchstart', this.onTouchStart);\n      document.removeEventListener('touchmove', this.onTouchMove);\n      document.removeEventListener('touchend', this.onTouchEnd);\n    }\n  }\n  onTouchStart = ({ touches }: TouchEvent) => {\n    const touch = touches && touches.item(0);\n    if (!touch) {\n      return;\n    }\n\n    this.initialTouchX = touch.clientX;\n    this.initialTouchY = touch.clientY;\n    this.userIsDragging = false;\n  };\n  onTouchMove = ({ touches }: TouchEvent) => {\n    const touch = touches && touches.item(0);\n    if (!touch) {\n      return;\n    }\n\n    const deltaX = Math.abs(touch.clientX - this.initialTouchX);\n    const deltaY = Math.abs(touch.clientY - this.initialTouchY);\n    const moveThreshold = 5;\n\n    this.userIsDragging = deltaX > moveThreshold || deltaY > moveThreshold;\n  };\n  onTouchEnd = (event: TouchEvent) => {\n    if (this.userIsDragging) return;\n\n    // close the menu if the user taps outside\n    // we're checking on event.target here instead of event.currentTarget, because we want to assert information\n    // on events on child elements, not the document (which we've attached this handler to).\n    if (\n      this.controlRef &&\n      !this.controlRef.contains(event.target as Node) &&\n      this.menuListRef &&\n      !this.menuListRef.contains(event.target as Node)\n    ) {\n      this.blurInput();\n    }\n\n    // reset move vars\n    this.initialTouchX = 0;\n    this.initialTouchY = 0;\n  };\n  onControlTouchEnd: TouchEventHandler<HTMLDivElement> = (event) => {\n    if (this.userIsDragging) return;\n    this.onControlMouseDown(event);\n  };\n  onClearIndicatorTouchEnd: TouchEventHandler<HTMLDivElement> = (event) => {\n    if (this.userIsDragging) return;\n\n    this.onClearIndicatorMouseDown(event);\n  };\n  onDropdownIndicatorTouchEnd: TouchEventHandler<HTMLDivElement> = (event) => {\n    if (this.userIsDragging) return;\n\n    this.onDropdownIndicatorMouseDown(event);\n  };\n\n  // ==============================\n  // Focus Handlers\n  // ==============================\n\n  handleInputChange: FormEventHandler<HTMLInputElement> = (event) => {\n    const { inputValue: prevInputValue } = this.props;\n    const inputValue = event.currentTarget.value;\n    this.setState({ inputIsHiddenAfterUpdate: false });\n    this.onInputChange(inputValue, { action: 'input-change', prevInputValue });\n    if (!this.props.menuIsOpen) {\n      this.onMenuOpen();\n    }\n  };\n  onInputFocus: FocusEventHandler<HTMLInputElement> = (event) => {\n    if (this.props.onFocus) {\n      this.props.onFocus(event);\n    }\n    this.setState({\n      inputIsHiddenAfterUpdate: false,\n      isFocused: true,\n    });\n    if (this.openAfterFocus || this.props.openMenuOnFocus) {\n      this.openMenu('first');\n    }\n    this.openAfterFocus = false;\n  };\n  onInputBlur: FocusEventHandler<HTMLInputElement> = (event) => {\n    const { inputValue: prevInputValue } = this.props;\n    if (this.menuListRef && this.menuListRef.contains(document.activeElement)) {\n      this.inputRef!.focus();\n      return;\n    }\n    if (this.props.onBlur) {\n      this.props.onBlur(event);\n    }\n    this.onInputChange('', { action: 'input-blur', prevInputValue });\n    this.onMenuClose();\n    this.setState({\n      focusedValue: null,\n      isFocused: false,\n    });\n  };\n  onOptionHover = (focusedOption: Option) => {\n    if (this.blockOptionHover || this.state.focusedOption === focusedOption) {\n      return;\n    }\n    const options = this.getFocusableOptions();\n    const focusedOptionIndex = options.indexOf(focusedOption!);\n    this.setState({\n      focusedOption,\n      focusedOptionId:\n        focusedOptionIndex > -1 ? this.getFocusedOptionId(focusedOption) : null,\n    });\n  };\n  shouldHideSelectedOptions = () => {\n    return shouldHideSelectedOptions(this.props);\n  };\n\n  // If the hidden input gets focus through form submit,\n  // redirect focus to focusable input.\n  onValueInputFocus: FocusEventHandler = (e) => {\n    e.preventDefault();\n    e.stopPropagation();\n\n    this.focus();\n  };\n\n  // ==============================\n  // Keyboard Handlers\n  // ==============================\n\n  onKeyDown: KeyboardEventHandler<HTMLDivElement> = (event) => {\n    const {\n      isMulti,\n      backspaceRemovesValue,\n      escapeClearsValue,\n      inputValue,\n      isClearable,\n      isDisabled,\n      menuIsOpen,\n      onKeyDown,\n      tabSelectsValue,\n      openMenuOnFocus,\n    } = this.props;\n    const { focusedOption, focusedValue, selectValue } = this.state;\n\n    if (isDisabled) return;\n\n    if (typeof onKeyDown === 'function') {\n      onKeyDown(event);\n      if (event.defaultPrevented) {\n        return;\n      }\n    }\n\n    // Block option hover events when the user has just pressed a key\n    this.blockOptionHover = true;\n    switch (event.key) {\n      case 'ArrowLeft':\n        if (!isMulti || inputValue) return;\n        this.focusValue('previous');\n        break;\n      case 'ArrowRight':\n        if (!isMulti || inputValue) return;\n        this.focusValue('next');\n        break;\n      case 'Delete':\n      case 'Backspace':\n        if (inputValue) return;\n        if (focusedValue) {\n          this.removeValue(focusedValue);\n        } else {\n          if (!backspaceRemovesValue) return;\n          if (isMulti) {\n            this.popValue();\n          } else if (isClearable) {\n            this.clearValue();\n          }\n        }\n        break;\n      case 'Tab':\n        if (this.isComposing) return;\n\n        if (\n          event.shiftKey ||\n          !menuIsOpen ||\n          !tabSelectsValue ||\n          !focusedOption ||\n          // don't capture the event if the menu opens on focus and the focused\n          // option is already selected; it breaks the flow of navigation\n          (openMenuOnFocus && this.isOptionSelected(focusedOption, selectValue))\n        ) {\n          return;\n        }\n        this.selectOption(focusedOption);\n        break;\n      case 'Enter':\n        if (event.keyCode === 229) {\n          // ignore the keydown event from an Input Method Editor(IME)\n          // ref. https://www.w3.org/TR/uievents/#determine-keydown-keyup-keyCode\n          break;\n        }\n        if (menuIsOpen) {\n          if (!focusedOption) return;\n          if (this.isComposing) return;\n          this.selectOption(focusedOption);\n          break;\n        }\n        return;\n      case 'Escape':\n        if (menuIsOpen) {\n          this.setState({\n            inputIsHiddenAfterUpdate: false,\n          });\n          this.onInputChange('', {\n            action: 'menu-close',\n            prevInputValue: inputValue,\n          });\n          this.onMenuClose();\n        } else if (isClearable && escapeClearsValue) {\n          this.clearValue();\n        }\n        break;\n      case ' ': // space\n        if (inputValue) {\n          return;\n        }\n        if (!menuIsOpen) {\n          this.openMenu('first');\n          break;\n        }\n        if (!focusedOption) return;\n        this.selectOption(focusedOption);\n        break;\n      case 'ArrowUp':\n        if (menuIsOpen) {\n          this.focusOption('up');\n        } else {\n          this.openMenu('last');\n        }\n        break;\n      case 'ArrowDown':\n        if (menuIsOpen) {\n          this.focusOption('down');\n        } else {\n          this.openMenu('first');\n        }\n        break;\n      case 'PageUp':\n        if (!menuIsOpen) return;\n        this.focusOption('pageup');\n        break;\n      case 'PageDown':\n        if (!menuIsOpen) return;\n        this.focusOption('pagedown');\n        break;\n      case 'Home':\n        if (!menuIsOpen) return;\n        this.focusOption('first');\n        break;\n      case 'End':\n        if (!menuIsOpen) return;\n        this.focusOption('last');\n        break;\n      default:\n        return;\n    }\n    event.preventDefault();\n  };\n\n  // ==============================\n  // Renderers\n  // ==============================\n  renderInput() {\n    const {\n      isDisabled,\n      isSearchable,\n      inputId,\n      inputValue,\n      tabIndex,\n      form,\n      menuIsOpen,\n      required,\n    } = this.props;\n    const { Input } = this.getComponents();\n    const { inputIsHidden, ariaSelection } = this.state;\n    const { commonProps } = this;\n\n    const id = inputId || this.getElementId('input');\n\n    // aria attributes makes the JSX \"noisy\", separated for clarity\n    const ariaAttributes = {\n      'aria-autocomplete': 'list' as const,\n      'aria-expanded': menuIsOpen,\n      'aria-haspopup': true,\n      'aria-errormessage': this.props['aria-errormessage'],\n      'aria-invalid': this.props['aria-invalid'],\n      'aria-label': this.props['aria-label'],\n      'aria-labelledby': this.props['aria-labelledby'],\n      'aria-required': required,\n      role: 'combobox',\n      'aria-activedescendant': this.state.isAppleDevice\n        ? undefined\n        : this.state.focusedOptionId || '',\n\n      ...(menuIsOpen && {\n        'aria-controls': this.getElementId('listbox'),\n      }),\n      ...(!isSearchable && {\n        'aria-readonly': true,\n      }),\n      ...(this.hasValue()\n        ? ariaSelection?.action === 'initial-input-focus' && {\n            'aria-describedby': this.getElementId('live-region'),\n          }\n        : {\n            'aria-describedby': this.getElementId('placeholder'),\n          }),\n    };\n\n    if (!isSearchable) {\n      // use a dummy input to maintain focus/blur functionality\n      return (\n        <DummyInput\n          id={id}\n          innerRef={this.getInputRef}\n          onBlur={this.onInputBlur}\n          onChange={noop}\n          onFocus={this.onInputFocus}\n          disabled={isDisabled}\n          tabIndex={tabIndex}\n          inputMode=\"none\"\n          form={form}\n          value=\"\"\n          {...ariaAttributes}\n        />\n      );\n    }\n\n    return (\n      <Input\n        {...commonProps}\n        autoCapitalize=\"none\"\n        autoComplete=\"off\"\n        autoCorrect=\"off\"\n        id={id}\n        innerRef={this.getInputRef}\n        isDisabled={isDisabled}\n        isHidden={inputIsHidden}\n        onBlur={this.onInputBlur}\n        onChange={this.handleInputChange}\n        onFocus={this.onInputFocus}\n        spellCheck=\"false\"\n        tabIndex={tabIndex}\n        form={form}\n        type=\"text\"\n        value={inputValue}\n        {...ariaAttributes}\n      />\n    );\n  }\n  renderPlaceholderOrValue() {\n    const {\n      MultiValue,\n      MultiValueContainer,\n      MultiValueLabel,\n      MultiValueRemove,\n      SingleValue,\n      Placeholder,\n    } = this.getComponents();\n    const { commonProps } = this;\n    const {\n      controlShouldRenderValue,\n      isDisabled,\n      isMulti,\n      inputValue,\n      placeholder,\n    } = this.props;\n    const { selectValue, focusedValue, isFocused } = this.state;\n\n    if (!this.hasValue() || !controlShouldRenderValue) {\n      return inputValue ? null : (\n        <Placeholder\n          {...commonProps}\n          key=\"placeholder\"\n          isDisabled={isDisabled}\n          isFocused={isFocused}\n          innerProps={{ id: this.getElementId('placeholder') }}\n        >\n          {placeholder}\n        </Placeholder>\n      );\n    }\n\n    if (isMulti) {\n      return selectValue.map((opt, index) => {\n        const isOptionFocused = opt === focusedValue;\n        const key = `${this.getOptionLabel(opt)}-${this.getOptionValue(opt)}`;\n\n        return (\n          <MultiValue\n            {...commonProps}\n            components={{\n              Container: MultiValueContainer,\n              Label: MultiValueLabel,\n              Remove: MultiValueRemove,\n            }}\n            isFocused={isOptionFocused}\n            isDisabled={isDisabled}\n            key={key}\n            index={index}\n            removeProps={{\n              onClick: () => this.removeValue(opt),\n              onTouchEnd: () => this.removeValue(opt),\n              onMouseDown: (e) => {\n                e.preventDefault();\n              },\n            }}\n            data={opt}\n          >\n            {this.formatOptionLabel(opt, 'value')}\n          </MultiValue>\n        );\n      });\n    }\n\n    if (inputValue) {\n      return null;\n    }\n\n    const singleValue = selectValue[0];\n    return (\n      <SingleValue {...commonProps} data={singleValue} isDisabled={isDisabled}>\n        {this.formatOptionLabel(singleValue, 'value')}\n      </SingleValue>\n    );\n  }\n  renderClearIndicator() {\n    const { ClearIndicator } = this.getComponents();\n    const { commonProps } = this;\n    const { isDisabled, isLoading } = this.props;\n    const { isFocused } = this.state;\n\n    if (\n      !this.isClearable() ||\n      !ClearIndicator ||\n      isDisabled ||\n      !this.hasValue() ||\n      isLoading\n    ) {\n      return null;\n    }\n\n    const innerProps = {\n      onMouseDown: this.onClearIndicatorMouseDown,\n      onTouchEnd: this.onClearIndicatorTouchEnd,\n      'aria-hidden': 'true',\n    };\n\n    return (\n      <ClearIndicator\n        {...commonProps}\n        innerProps={innerProps}\n        isFocused={isFocused}\n      />\n    );\n  }\n  renderLoadingIndicator() {\n    const { LoadingIndicator } = this.getComponents();\n    const { commonProps } = this;\n    const { isDisabled, isLoading } = this.props;\n    const { isFocused } = this.state;\n\n    if (!LoadingIndicator || !isLoading) return null;\n\n    const innerProps = { 'aria-hidden': 'true' };\n    return (\n      <LoadingIndicator\n        {...commonProps}\n        innerProps={innerProps}\n        isDisabled={isDisabled}\n        isFocused={isFocused}\n      />\n    );\n  }\n  renderIndicatorSeparator() {\n    const { DropdownIndicator, IndicatorSeparator } = this.getComponents();\n\n    // separator doesn't make sense without the dropdown indicator\n    if (!DropdownIndicator || !IndicatorSeparator) return null;\n\n    const { commonProps } = this;\n    const { isDisabled } = this.props;\n    const { isFocused } = this.state;\n\n    return (\n      <IndicatorSeparator\n        {...commonProps}\n        isDisabled={isDisabled}\n        isFocused={isFocused}\n      />\n    );\n  }\n  renderDropdownIndicator() {\n    const { DropdownIndicator } = this.getComponents();\n    if (!DropdownIndicator) return null;\n    const { commonProps } = this;\n    const { isDisabled } = this.props;\n    const { isFocused } = this.state;\n\n    const innerProps = {\n      onMouseDown: this.onDropdownIndicatorMouseDown,\n      onTouchEnd: this.onDropdownIndicatorTouchEnd,\n      'aria-hidden': 'true',\n    };\n\n    return (\n      <DropdownIndicator\n        {...commonProps}\n        innerProps={innerProps}\n        isDisabled={isDisabled}\n        isFocused={isFocused}\n      />\n    );\n  }\n  renderMenu() {\n    const {\n      Group,\n      GroupHeading,\n      Menu,\n      MenuList,\n      MenuPortal,\n      LoadingMessage,\n      NoOptionsMessage,\n      Option,\n    } = this.getComponents();\n    const { commonProps } = this;\n    const { focusedOption } = this.state;\n    const {\n      captureMenuScroll,\n      inputValue,\n      isLoading,\n      loadingMessage,\n      minMenuHeight,\n      maxMenuHeight,\n      menuIsOpen,\n      menuPlacement,\n      menuPosition,\n      menuPortalTarget,\n      menuShouldBlockScroll,\n      menuShouldScrollIntoView,\n      noOptionsMessage,\n      onMenuScrollToTop,\n      onMenuScrollToBottom,\n    } = this.props;\n\n    if (!menuIsOpen) return null;\n\n    // TODO: Internal Option Type here\n    const render = (props: CategorizedOption<Option>, id: string) => {\n      const { type, data, isDisabled, isSelected, label, value } = props;\n      const isFocused = focusedOption === data;\n      const onHover = isDisabled ? undefined : () => this.onOptionHover(data);\n      const onSelect = isDisabled ? undefined : () => this.selectOption(data);\n      const optionId = `${this.getElementId('option')}-${id}`;\n      const innerProps = {\n        id: optionId,\n        onClick: onSelect,\n        onMouseMove: onHover,\n        onMouseOver: onHover,\n        tabIndex: -1,\n        role: 'option',\n        'aria-selected': this.state.isAppleDevice ? undefined : isSelected, // is not supported on Apple devices\n      };\n\n      return (\n        <Option\n          {...commonProps}\n          innerProps={innerProps}\n          data={data}\n          isDisabled={isDisabled}\n          isSelected={isSelected}\n          key={optionId}\n          label={label}\n          type={type}\n          value={value}\n          isFocused={isFocused}\n          innerRef={isFocused ? this.getFocusedOptionRef : undefined}\n        >\n          {this.formatOptionLabel(props.data, 'menu')}\n        </Option>\n      );\n    };\n\n    let menuUI: ReactNode;\n\n    if (this.hasOptions()) {\n      menuUI = this.getCategorizedOptions().map((item) => {\n        if (item.type === 'group') {\n          const { data, options, index: groupIndex } = item;\n          const groupId = `${this.getElementId('group')}-${groupIndex}`;\n          const headingId = `${groupId}-heading`;\n\n          return (\n            <Group\n              {...commonProps}\n              key={groupId}\n              data={data}\n              options={options}\n              Heading={GroupHeading}\n              headingProps={{\n                id: headingId,\n                data: item.data,\n              }}\n              label={this.formatGroupLabel(item.data)}\n            >\n              {item.options.map((option) =>\n                render(option, `${groupIndex}-${option.index}`)\n              )}\n            </Group>\n          );\n        } else if (item.type === 'option') {\n          return render(item, `${item.index}`);\n        }\n      });\n    } else if (isLoading) {\n      const message = loadingMessage({ inputValue });\n      if (message === null) return null;\n      menuUI = <LoadingMessage {...commonProps}>{message}</LoadingMessage>;\n    } else {\n      const message = noOptionsMessage({ inputValue });\n      if (message === null) return null;\n      menuUI = <NoOptionsMessage {...commonProps}>{message}</NoOptionsMessage>;\n    }\n    const menuPlacementProps = {\n      minMenuHeight,\n      maxMenuHeight,\n      menuPlacement,\n      menuPosition,\n      menuShouldScrollIntoView,\n    };\n\n    const menuElement = (\n      <MenuPlacer {...commonProps} {...menuPlacementProps}>\n        {({ ref, placerProps: { placement, maxHeight } }) => (\n          <Menu\n            {...commonProps}\n            {...menuPlacementProps}\n            innerRef={ref}\n            innerProps={{\n              onMouseDown: this.onMenuMouseDown,\n              onMouseMove: this.onMenuMouseMove,\n            }}\n            isLoading={isLoading}\n            placement={placement}\n          >\n            <ScrollManager\n              captureEnabled={captureMenuScroll}\n              onTopArrive={onMenuScrollToTop}\n              onBottomArrive={onMenuScrollToBottom}\n              lockEnabled={menuShouldBlockScroll}\n            >\n              {(scrollTargetRef) => (\n                <MenuList\n                  {...commonProps}\n                  innerRef={(instance) => {\n                    this.getMenuListRef(instance);\n                    scrollTargetRef(instance);\n                  }}\n                  innerProps={{\n                    role: 'listbox',\n                    'aria-multiselectable': commonProps.isMulti,\n                    id: this.getElementId('listbox'),\n                  }}\n                  isLoading={isLoading}\n                  maxHeight={maxHeight}\n                  focusedOption={focusedOption}\n                >\n                  {menuUI}\n                </MenuList>\n              )}\n            </ScrollManager>\n          </Menu>\n        )}\n      </MenuPlacer>\n    );\n\n    // positioning behaviour is almost identical for portalled and fixed,\n    // so we use the same component. the actual portalling logic is forked\n    // within the component based on `menuPosition`\n    return menuPortalTarget || menuPosition === 'fixed' ? (\n      <MenuPortal\n        {...commonProps}\n        appendTo={menuPortalTarget}\n        controlElement={this.controlRef}\n        menuPlacement={menuPlacement}\n        menuPosition={menuPosition}\n      >\n        {menuElement}\n      </MenuPortal>\n    ) : (\n      menuElement\n    );\n  }\n  renderFormField() {\n    const { delimiter, isDisabled, isMulti, name, required } = this.props;\n    const { selectValue } = this.state;\n\n    if (required && !this.hasValue() && !isDisabled) {\n      return <RequiredInput name={name} onFocus={this.onValueInputFocus} />;\n    }\n\n    if (!name || isDisabled) return;\n\n    if (isMulti) {\n      if (delimiter) {\n        const value = selectValue\n          .map((opt) => this.getOptionValue(opt))\n          .join(delimiter);\n        return <input name={name} type=\"hidden\" value={value} />;\n      } else {\n        const input =\n          selectValue.length > 0 ? (\n            selectValue.map((opt, i) => (\n              <input\n                key={`i-${i}`}\n                name={name}\n                type=\"hidden\"\n                value={this.getOptionValue(opt)}\n              />\n            ))\n          ) : (\n            <input name={name} type=\"hidden\" value=\"\" />\n          );\n\n        return <div>{input}</div>;\n      }\n    } else {\n      const value = selectValue[0] ? this.getOptionValue(selectValue[0]) : '';\n      return <input name={name} type=\"hidden\" value={value} />;\n    }\n  }\n\n  renderLiveRegion() {\n    const { commonProps } = this;\n    const {\n      ariaSelection,\n      focusedOption,\n      focusedValue,\n      isFocused,\n      selectValue,\n    } = this.state;\n\n    const focusableOptions = this.getFocusableOptions();\n\n    return (\n      <LiveRegion\n        {...commonProps}\n        id={this.getElementId('live-region')}\n        ariaSelection={ariaSelection}\n        focusedOption={focusedOption}\n        focusedValue={focusedValue}\n        isFocused={isFocused}\n        selectValue={selectValue}\n        focusableOptions={focusableOptions}\n        isAppleDevice={this.state.isAppleDevice}\n      />\n    );\n  }\n\n  render() {\n    const { Control, IndicatorsContainer, SelectContainer, ValueContainer } =\n      this.getComponents();\n\n    const { className, id, isDisabled, menuIsOpen } = this.props;\n    const { isFocused } = this.state;\n    const commonProps = (this.commonProps = this.getCommonProps());\n\n    return (\n      <SelectContainer\n        {...commonProps}\n        className={className}\n        innerProps={{\n          id: id,\n          onKeyDown: this.onKeyDown,\n        }}\n        isDisabled={isDisabled}\n        isFocused={isFocused}\n      >\n        {this.renderLiveRegion()}\n        <Control\n          {...commonProps}\n          innerRef={this.getControlRef}\n          innerProps={{\n            onMouseDown: this.onControlMouseDown,\n            onTouchEnd: this.onControlTouchEnd,\n          }}\n          isDisabled={isDisabled}\n          isFocused={isFocused}\n          menuIsOpen={menuIsOpen}\n        >\n          <ValueContainer {...commonProps} isDisabled={isDisabled}>\n            {this.renderPlaceholderOrValue()}\n            {this.renderInput()}\n          </ValueContainer>\n          <IndicatorsContainer {...commonProps} isDisabled={isDisabled}>\n            {this.renderClearIndicator()}\n            {this.renderLoadingIndicator()}\n            {this.renderIndicatorSeparator()}\n            {this.renderDropdownIndicator()}\n          </IndicatorsContainer>\n        </Control>\n        {this.renderMenu()}\n        {this.renderFormField()}\n      </SelectContainer>\n    );\n  }\n}\n\nexport type PublicBaseSelectProps<\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n> = JSX.LibraryManagedAttributes<typeof Select, Props<Option, IsMulti, Group>>;\n"
  },
  {
    "path": "packages/react-select/src/__tests__/Async.test.tsx",
    "content": "import React from 'react';\nimport cases from 'jest-in-case';\nimport { render, fireEvent, waitFor, act } from '@testing-library/react';\nimport userEvent from '@testing-library/user-event';\n\nimport Async from '../Async';\nimport { Option, OPTIONS } from './constants';\n\ntest('defaults - snapshot', () => {\n  const { container } = render(<Async />);\n  expect(container).toMatchSnapshot();\n});\n\n/**\n * loadOptions with promise is not resolved and it renders loading options\n * confirmed by logging in component that loadOptions is resolved and options are available\n * but still loading options is rendered\n */\ncases(\n  'load option prop with defaultOptions true',\n  async ({ props, expectOptionLength }) => {\n    const { container } = render(\n      <Async classNamePrefix=\"react-select\" menuIsOpen {...props} />\n    );\n\n    await waitFor(() => {\n      expect(container.querySelectorAll('.react-select__option').length).toBe(\n        expectOptionLength\n      );\n    });\n  },\n  {\n    'with callback  > should resolve options': {\n      props: {\n        defaultOptions: true,\n        loadOptions: (\n          inputValue: string,\n          callBack: (options: readonly Option[]) => void\n        ) => callBack([OPTIONS[0]]),\n      },\n      expectOptionLength: 1,\n    },\n    'with promise  > should resolve options': {\n      props: {\n        defaultOptions: true,\n        loadOptions: () => Promise.resolve([OPTIONS[0]]),\n      },\n      expectOptionLength: 1,\n    },\n  }\n);\n\ntest('load options prop with defaultOptions true and inputValue prop', () => {\n  const loadOptionsSpy = jest.fn((value) => value);\n  const searchString = 'hello world';\n  render(\n    <Async\n      loadOptions={loadOptionsSpy}\n      defaultOptions\n      inputValue={searchString}\n    />\n  );\n  expect(loadOptionsSpy).toHaveReturnedWith(searchString);\n});\n\n/**\n * loadOptions with promise is not resolved and it renders loading options\n * confirmed by logging in component that loadOptions is resolved and options are available\n * but still loading options is rendered\n */\ncases(\n  'load options props with no default options',\n  async ({ props, expectloadOptionsLength }) => {\n    let { container } = render(\n      <Async\n        className=\"react-select\"\n        classNamePrefix=\"react-select\"\n        {...props}\n      />\n    );\n    let input = container.querySelector('input.react-select__input');\n    userEvent.type(input!, 'a');\n    await waitFor(() => {\n      expect(container.querySelectorAll('.react-select__option').length).toBe(\n        expectloadOptionsLength\n      );\n    });\n  },\n  {\n    'with callback > should resolve the options': {\n      props: {\n        loadOptions: (\n          inputValue: string,\n          callBack: (options: readonly Option[]) => void\n        ) => callBack(OPTIONS),\n      },\n      expectloadOptionsLength: 17,\n    },\n    'with promise > should resolve the options': {\n      props: {\n        loadOptions: () => Promise.resolve(OPTIONS),\n      },\n      expectloadOptionsLength: 17,\n    },\n  }\n);\n\ntest('to not call loadOptions again for same value when cacheOptions is true', () => {\n  let loadOptionsSpy = jest.fn((_, callback) => callback([]));\n  let { container } = render(\n    <Async\n      className=\"react-select\"\n      classNamePrefix=\"react-select\"\n      loadOptions={loadOptionsSpy}\n      cacheOptions\n    />\n  );\n  let input = container.querySelector('input.react-select__input');\n\n  fireEvent.input(input!, {\n    target: {\n      value: 'foo',\n    },\n    bubbles: true,\n    cancelable: true,\n  });\n  fireEvent.input(input!, {\n    target: {\n      value: 'bar',\n    },\n    bubbles: true,\n    cancelable: true,\n  });\n  fireEvent.input(input!, {\n    target: {\n      value: 'foo',\n    },\n    bubbles: true,\n    cancelable: true,\n  });\n  expect(loadOptionsSpy).toHaveBeenCalledTimes(2);\n});\n\ntest('to create new cache for each instance', async () => {\n  let loadOptionsOne = jest.fn();\n  let { container: containerOne } = render(\n    <Async\n      classNamePrefix=\"react-select\"\n      cacheOptions\n      menuIsOpen\n      loadOptions={loadOptionsOne}\n    />\n  );\n  userEvent.type(containerOne.querySelector('input.react-select__input')!, 'a');\n\n  let loadOptionsTwo = jest.fn();\n  let { container: containerTwo } = render(\n    <Async\n      classNamePrefix=\"react-select\"\n      cacheOptions\n      menuIsOpen\n      loadOptions={loadOptionsTwo}\n    />\n  );\n\n  userEvent.type(containerTwo.querySelector('input.react-select__input')!, 'a');\n\n  expect(loadOptionsOne).toHaveBeenCalled();\n  expect(loadOptionsTwo).toHaveBeenCalled();\n});\n\ntest('in case of callbacks display the most recently-requested loaded options (if results are returned out of order)', () => {\n  let callbacks: ((options: readonly Option[]) => void)[] = [];\n  const loadOptions = (\n    inputValue: string,\n    callback: (options: readonly Option[]) => void\n  ) => {\n    callbacks.push(callback);\n  };\n  let { container } = render(\n    <Async\n      className=\"react-select\"\n      classNamePrefix=\"react-select\"\n      loadOptions={loadOptions}\n    />\n  );\n\n  let input = container.querySelector('input.react-select__input');\n  fireEvent.input(input!, {\n    target: {\n      value: 'foo',\n    },\n    bubbles: true,\n    cancelable: true,\n  });\n  fireEvent.input(input!, {\n    target: {\n      value: 'bar',\n    },\n    bubbles: true,\n    cancelable: true,\n  });\n  expect(container.querySelector('.react-select__option')).toBeFalsy();\n  act(() => {\n    callbacks[1]([{ value: 'bar', label: 'bar' }]);\n  });\n  act(() => {\n    callbacks[0]([{ value: 'foo', label: 'foo' }]);\n  });\n  expect(container.querySelector('.react-select__option')!.textContent).toBe(\n    'bar'\n  );\n});\n\n// QUESTION: we currently do not do this, do we want to?\ntest.skip('in case of callbacks should handle an error by setting options to an empty array', () => {\n  const loadOptions = (\n    inputValue: string,\n    callback: (options: readonly Option[]) => void\n  ) => {\n    // @ts-ignore\n    callback(new Error('error'));\n  };\n  let { container } = render(\n    <Async\n      className=\"react-select\"\n      classNamePrefix=\"react-select\"\n      loadOptions={loadOptions}\n      options={OPTIONS}\n    />\n  );\n  let input = container.querySelector('input.react-select__input');\n  fireEvent.input(input!, {\n    target: {\n      value: 'foo',\n    },\n    bubbles: true,\n    cancelable: true,\n  });\n  expect(container.querySelectorAll('.react-select__option').length).toBe(0);\n});\n"
  },
  {
    "path": "packages/react-select/src/__tests__/AsyncCreatable.test.tsx",
    "content": "import React from 'react';\n\nimport AsyncCreatable from '../AsyncCreatable';\nimport { Option, OPTIONS } from './constants';\nimport { render, waitFor } from '@testing-library/react';\nimport userEvent from '@testing-library/user-event';\n\ntest('defaults - snapshot', () => {\n  const { container } = render(<AsyncCreatable />);\n  expect(container).toMatchSnapshot();\n});\n\ntest('creates an inner Select', () => {\n  const { container } = render(\n    <AsyncCreatable className=\"react-select\" classNamePrefix=\"react-select\" />\n  );\n  expect(container.querySelector('.react-select')).toBeInTheDocument();\n});\n\ntest('render decorated select with props passed', () => {\n  const { container } = render(\n    <AsyncCreatable className=\"foo\" classNamePrefix=\"foo\" />\n  );\n  expect(container.querySelector('.foo')).toBeInTheDocument();\n});\n\ntest('to show the create option in menu', () => {\n  let { container, rerender } = render(\n    <AsyncCreatable className=\"react-select\" classNamePrefix=\"react-select\" />\n  );\n  let input = container.querySelector('input.react-select__input');\n  rerender(\n    <AsyncCreatable\n      className=\"react-select\"\n      classNamePrefix=\"react-select\"\n      inputValue=\"a\"\n    />\n  );\n  userEvent.type(input!, 'a');\n  expect(container.querySelector('.react-select__option')!.textContent).toBe(\n    'Create \"a\"'\n  );\n});\n\ntest('to show loading and then create option in menu', async () => {\n  let loadOptionsSpy = jest.fn(\n    (inputValue: string, callback: (options: readonly Option[]) => void) => {\n      setTimeout(() => callback(OPTIONS), 200);\n    }\n  );\n  let { container } = render(\n    <AsyncCreatable\n      className=\"react-select\"\n      classNamePrefix=\"react-select\"\n      loadOptions={loadOptionsSpy}\n    />\n  );\n  let input = container.querySelector('input.react-select__input');\n  userEvent.type(input!, 'a');\n\n  // to show a loading message while loading options\n  expect(container.querySelector('.react-select__menu')!.textContent).toBe(\n    'Loading...'\n  );\n  await waitFor(() => {\n    // show create options once options are loaded\n    let options = container.querySelectorAll('.react-select__option');\n    expect(options[options.length - 1].textContent).toBe('Create \"a\"');\n  });\n});\n"
  },
  {
    "path": "packages/react-select/src/__tests__/Creatable.test.tsx",
    "content": "import React from 'react';\nimport { render, fireEvent } from '@testing-library/react';\nimport cases from 'jest-in-case';\n\nimport Creatable from '../Creatable';\nimport { Option, OPTIONS } from './constants';\n\ninterface BasicProps {\n  readonly className: string;\n  readonly classNamePrefix: string;\n  readonly onChange: () => void;\n  readonly onInputChange: () => void;\n  readonly onMenuClose: () => void;\n  readonly onMenuOpen: () => void;\n  readonly name: string;\n  readonly options: readonly Option[];\n}\n\nconst BASIC_PROPS: BasicProps = {\n  className: 'react-select',\n  classNamePrefix: 'react-select',\n  onChange: jest.fn(),\n  onInputChange: jest.fn(),\n  onMenuClose: jest.fn(),\n  onMenuOpen: jest.fn(),\n  name: 'test-input-name',\n  options: OPTIONS,\n};\n\ntest('defaults - snapshot', () => {\n  const { container } = render(<Creatable />);\n  expect(container).toMatchSnapshot();\n});\n\ninterface Props extends Partial<BasicProps> {\n  readonly isMulti?: boolean;\n}\n\ninterface Opts {\n  readonly props?: Props;\n}\n\ncases<Opts>(\n  'filtered option is an exact match for an existing option',\n  ({ props }) => {\n    props = { ...BASIC_PROPS, ...props };\n    const { container, rerender } = render(<Creatable menuIsOpen {...props} />);\n    rerender(<Creatable inputValue=\"one\" menuIsOpen {...props} />);\n    expect(\n      container.querySelector('.react-select__menu')!.textContent\n    ).not.toEqual(expect.stringContaining('create'));\n  },\n  {\n    'single select > should not show \"create...\" prompt\"': {},\n    'multi select > should not show \"create...\" prompt\"': {\n      props: {\n        isMulti: true,\n        options: OPTIONS,\n      },\n    },\n  }\n);\n\ncases<Opts>(\n  'filterOptions returns invalid value ( null )',\n  ({ props }) => {\n    props = { ...BASIC_PROPS, ...props };\n    let filterOptionSpy = jest.fn().mockReturnValue(null);\n\n    const { container, rerender } = render(\n      <Creatable filterOption={filterOptionSpy} menuIsOpen {...props} />\n    );\n    rerender(\n      <Creatable\n        filterOption={filterOptionSpy}\n        menuIsOpen\n        inputValue=\"one\"\n        {...props}\n      />\n    );\n\n    expect(\n      container.querySelector('.react-select__menu-notice--no-options')!\n        .textContent\n    ).toEqual(expect.stringContaining('No options'));\n  },\n  {\n    'single select > should not show \"create...\" prompt\"': {},\n    'multi select > should not show \"create...\" prompt\"': {\n      props: {\n        isMulti: true,\n        options: OPTIONS,\n      },\n    },\n  }\n);\n\ncases<Opts>(\n  'inputValue does not match any option after filter',\n  ({ props }) => {\n    props = { ...BASIC_PROPS, ...props };\n\n    const { container, rerender } = render(<Creatable menuIsOpen {...props} />);\n    rerender(\n      <Creatable menuIsOpen {...props} inputValue=\"option not is list\" />\n    );\n\n    expect(container.querySelector('.react-select__menu')!.textContent).toBe(\n      'Create \"option not is list\"'\n    );\n  },\n  {\n    'single select > should show a placeholder \"create...\" prompt': {},\n    'multi select > should show a placeholder \"create...\" prompt': {\n      props: {\n        isMulti: true,\n        options: OPTIONS,\n      },\n    },\n  }\n);\n\ncases<Opts>(\n  'isValidNewOption() prop',\n  ({ props }) => {\n    props = { ...BASIC_PROPS, ...props };\n    let isValidNewOption = jest.fn((options) => options === 'new Option');\n\n    const { container, rerender } = render(\n      <Creatable menuIsOpen isValidNewOption={isValidNewOption} {...props} />\n    );\n\n    rerender(\n      <Creatable\n        menuIsOpen\n        isValidNewOption={isValidNewOption}\n        {...props}\n        inputValue=\"new Option\"\n      />\n    );\n\n    expect(container.querySelector('.react-select__menu')!.textContent).toEqual(\n      'Create \"new Option\"'\n    );\n\n    expect(\n      container.querySelector('.react-select__menu-notice--no-options')\n    ).toBeFalsy();\n\n    rerender(\n      <Creatable\n        menuIsOpen\n        isValidNewOption={isValidNewOption}\n        inputValue=\"invalid new Option\"\n        {...props}\n      />\n    );\n    expect(\n      container.querySelector('.react-select__menu')!.textContent\n    ).not.toEqual('Create \"invalid new Option\"');\n\n    expect(\n      container.querySelector('.react-select__menu-notice--no-options')\n    ).toBeTruthy();\n  },\n  {\n    'single select > should show \"create...\" prompt only if isValidNewOption returns thruthy value':\n      {},\n    'multi select > should show \"create...\" prompt only if isValidNewOption returns thruthy value':\n      {\n        props: {\n          isMulti: true,\n          options: OPTIONS,\n        },\n      },\n  }\n);\n\ncases<Opts>(\n  'close by hitting escape with search text present',\n  ({ props }) => {\n    props = { ...BASIC_PROPS, ...props };\n    const { container, rerender } = render(<Creatable menuIsOpen {...props} />);\n    rerender(<Creatable menuIsOpen inputValue=\"new Option\" {...props} />);\n    fireEvent.keyDown(container, { keyCode: 27, key: 'Escape' });\n    expect(container.querySelector('input')!.textContent).toEqual('');\n  },\n  {\n    'single select > should remove the search text': {},\n    'multi select > should remove the search text': {\n      props: {\n        isMulti: true,\n        options: OPTIONS,\n      },\n    },\n  }\n);\n\ntest('should remove the new option after closing on blur', () => {\n  const { container, rerender } = render(\n    <Creatable menuIsOpen options={OPTIONS} />\n  );\n  rerender(<Creatable menuIsOpen options={OPTIONS} inputValue=\"new Option\" />);\n  fireEvent.blur(container);\n  expect(container.querySelector('input')!.textContent).toEqual('');\n});\n\ncases<Opts>(\n  'getNewOptionData() prop',\n  ({ props }) => {\n    props = { ...BASIC_PROPS, ...props };\n    let getNewOptionDataSpy = jest.fn((label) => ({\n      label: `custom text ${label}`,\n      value: label,\n    }));\n    const { container, rerender } = render(\n      <Creatable menuIsOpen getNewOptionData={getNewOptionDataSpy} {...props} />\n    );\n    rerender(\n      <Creatable\n        menuIsOpen\n        getNewOptionData={getNewOptionDataSpy}\n        inputValue=\"new Option\"\n        {...props}\n      />\n    );\n\n    expect(container.querySelector('.react-select__menu')!.textContent).toEqual(\n      'custom text new Option'\n    );\n  },\n  {\n    'single select > should create option as per label returned from getNewOptionData':\n      {},\n    'multi select > should create option as per label returned from getNewOptionData':\n      {\n        props: {\n          isMulti: true,\n          options: OPTIONS,\n        },\n      },\n  }\n);\n\ncases<Opts>(\n  'formatCreateLabel() prop',\n  ({ props = { options: OPTIONS } }) => {\n    props = { ...BASIC_PROPS, ...props };\n    let formatCreateLabelSpy = jest.fn((label) => `custom label \"${label}\"`);\n    const { container, rerender } = render(\n      <Creatable\n        menuIsOpen\n        formatCreateLabel={formatCreateLabelSpy}\n        {...props}\n      />\n    );\n\n    rerender(\n      <Creatable\n        menuIsOpen\n        formatCreateLabel={formatCreateLabelSpy}\n        inputValue=\"new Option\"\n        {...props}\n      />\n    );\n    expect(container.querySelector('.react-select__menu')!.textContent).toEqual(\n      'custom label \"new Option\"'\n    );\n  },\n  {\n    'single select > should show label of custom option as per text returned from formatCreateLabel':\n      {},\n    'multi select > should show label of custom option as per text returned from formatCreateLabel':\n      {\n        props: {\n          isMulti: true,\n          options: OPTIONS,\n        },\n      },\n  }\n);\n\ninterface CustomOption {\n  readonly key: string;\n  readonly title: string;\n}\n\nconst CUSTOM_OPTIONS: readonly CustomOption[] = [\n  { key: 'testa', title: 'Test A' },\n  { key: 'testb', title: 'Test B' },\n  { key: 'testc', title: 'Test C' },\n  { key: 'testd', title: 'Test D' },\n];\n\ninterface CustomOptsProps extends Partial<Omit<BasicProps, 'options'>> {\n  isMulti?: boolean;\n  options: readonly CustomOption[];\n}\n\ninterface CustomOpts {\n  props: CustomOptsProps;\n}\n\ncases<CustomOpts>(\n  'compareOption() method',\n  ({ props }) => {\n    props = { ...BASIC_PROPS, ...props };\n\n    const getOptionLabel = ({ title }: CustomOption) => title;\n    const getOptionValue = ({ key }: CustomOption) => key;\n\n    const { container, rerender } = render(\n      <Creatable\n        menuIsOpen\n        getOptionLabel={getOptionLabel}\n        getOptionValue={getOptionValue}\n        {...props}\n      />\n    );\n\n    rerender(\n      <Creatable\n        menuIsOpen\n        getOptionLabel={getOptionLabel}\n        getOptionValue={getOptionValue}\n        inputValue=\"testc\"\n        {...props}\n      />\n    );\n    expect(container.querySelector('.react-select__menu')!.textContent).toEqual(\n      'Test C'\n    );\n  },\n  {\n    'single select > should handle options with custom structure': {\n      props: {\n        options: CUSTOM_OPTIONS,\n      },\n    },\n    'multi select > should handle options with custom structure': {\n      props: {\n        isMulti: true,\n        options: CUSTOM_OPTIONS,\n      },\n    },\n  }\n);\n"
  },
  {
    "path": "packages/react-select/src/__tests__/Select.test.tsx",
    "content": "import React, { KeyboardEvent } from 'react';\nimport { render, fireEvent, EventType } from '@testing-library/react';\nimport userEvent from '@testing-library/user-event';\nimport cases from 'jest-in-case';\n\nimport {\n  OPTIONS,\n  OPTIONS_ACCENTED,\n  OPTIONS_NUMBER_VALUE,\n  OPTIONS_GROUPED,\n  OPTIONS_BOOLEAN_VALUE,\n  OPTIONS_DISABLED,\n  Option,\n  GroupedOption,\n  OptionNumberValue,\n  OptionBooleanValue,\n} from './constants';\nimport Select, { FormatOptionLabelMeta } from '../Select';\nimport { FilterOptionOption } from '../filters';\n\nimport { matchers } from '@emotion/jest';\nimport { AriaLiveMessages } from '../accessibility';\nimport { noop } from '../utils';\nimport { GroupBase } from '../types';\n\nexpect.extend(matchers);\n\ninterface BasicProps {\n  readonly className: string;\n  readonly classNamePrefix: string;\n  readonly onChange: () => void;\n  readonly onInputChange: () => void;\n  readonly onMenuClose: () => void;\n  readonly onMenuOpen: () => void;\n  readonly name: string;\n  readonly options: readonly Option[];\n  readonly inputValue: string;\n  readonly value: null;\n}\n\nconst BASIC_PROPS: BasicProps = {\n  className: 'react-select',\n  classNamePrefix: 'react-select',\n  onChange: jest.fn(),\n  onInputChange: jest.fn(),\n  onMenuClose: jest.fn(),\n  onMenuOpen: jest.fn(),\n  name: 'test-input-name',\n  options: OPTIONS,\n  inputValue: '',\n  value: null,\n};\n\ntest('snapshot - defaults', () => {\n  const { container } = render(\n    <Select\n      onChange={noop}\n      onInputChange={noop}\n      onMenuOpen={noop}\n      onMenuClose={noop}\n      inputValue=\"\"\n      value={null}\n    />\n  );\n  expect(container).toMatchSnapshot();\n});\n\ntest('instanceId prop > to have instanceId as id prefix for the select components', () => {\n  let { container } = render(\n    <Select {...BASIC_PROPS} menuIsOpen instanceId={'custom-id'} />\n  );\n  expect(container.querySelector('input')!.id).toContain('custom-id');\n  container.querySelectorAll('div.react-select__option').forEach((opt) => {\n    expect(opt.id).toContain('custom-id');\n  });\n});\n\ntest('hidden input field is not present if name is not passes', () => {\n  let { container } = render(\n    <Select\n      onChange={noop}\n      onInputChange={noop}\n      onMenuOpen={noop}\n      onMenuClose={noop}\n      inputValue=\"\"\n      value={null}\n      options={OPTIONS}\n    />\n  );\n  expect(container.querySelector('input[type=\"hidden\"]')).toBeNull();\n});\n\ntest('hidden input field is present if name passes', () => {\n  let { container } = render(\n    <Select\n      onChange={noop}\n      onInputChange={noop}\n      onMenuOpen={noop}\n      onMenuClose={noop}\n      inputValue=\"\"\n      value={null}\n      name=\"test-input-name\"\n      options={OPTIONS}\n    />\n  );\n  expect(container.querySelector('input[type=\"hidden\"]')).toBeTruthy();\n});\n\ntest('single select > passing multiple values > should select the first value', () => {\n  const props = { ...BASIC_PROPS, value: [OPTIONS[0], OPTIONS[4]] };\n  let { container } = render(<Select {...props} />);\n\n  expect(container.querySelector('.react-select__control')!.textContent).toBe(\n    '0'\n  );\n});\n\ntest('isRtl boolean prop sets direction: rtl on container', () => {\n  let { container } = render(\n    <Select {...BASIC_PROPS} value={[OPTIONS[0]]} isRtl isClearable />\n  );\n  expect(container.firstChild).toHaveStyleRule('direction', 'rtl');\n});\n\ntest('isOptionSelected() prop > single select > mark value as isSelected if isOptionSelected returns true for the option', () => {\n  // Select all but option with label '1'\n  let isOptionSelected = jest.fn((option) => option.label !== '1');\n  let { container } = render(\n    <Select {...BASIC_PROPS} isOptionSelected={isOptionSelected} menuIsOpen />\n  );\n  let options = container.querySelectorAll('.react-select__option');\n\n  // Option label 0 to be selected\n  expect(options[0].classList).toContain('react-select__option--is-selected');\n  // Option label 1 to be not selected\n  expect(options[1].classList).not.toContain(\n    'react-select__option--is-selected'\n  );\n});\n\ntest('isOptionSelected() prop > multi select > to not show the selected options in Menu for multiSelect', () => {\n  // Select all but option with label '1'\n  let isOptionSelected = jest.fn((option) => option.label !== '1');\n  let { container } = render(\n    <Select\n      {...BASIC_PROPS}\n      isMulti\n      isOptionSelected={isOptionSelected}\n      menuIsOpen\n    />\n  );\n\n  expect(container.querySelectorAll('.react-select__option')).toHaveLength(1);\n  expect(container.querySelector('.react-select__option')!.textContent).toBe(\n    '1'\n  );\n});\n\ncases(\n  'formatOptionLabel',\n  ({ props, valueComponentSelector, expectedOptions }) => {\n    let { container } = render(<Select {...props} />);\n    let value = container.querySelector(valueComponentSelector);\n    expect(value!.textContent).toBe(expectedOptions);\n  },\n  {\n    'single select > should format label of options according to text returned by formatOptionLabel':\n      {\n        props: {\n          ...BASIC_PROPS,\n          formatOptionLabel: (\n            { label, value }: Option,\n            { context }: FormatOptionLabelMeta<Option>\n          ) => `${label} ${value} ${context}`,\n          value: OPTIONS[0],\n        },\n        valueComponentSelector: '.react-select__single-value',\n        expectedOptions: '0 zero value',\n      },\n    'multi select > should format label of options according to text returned by formatOptionLabel':\n      {\n        props: {\n          ...BASIC_PROPS,\n          formatOptionLabel: (\n            { label, value }: Option,\n            { context }: FormatOptionLabelMeta<Option>\n          ) => `${label} ${value} ${context}`,\n          isMulti: true,\n          value: OPTIONS[0],\n        },\n        valueComponentSelector: '.react-select__multi-value',\n        expectedOptions: '0 zero value',\n      },\n  }\n);\n\ncases(\n  'name prop',\n  ({ expectedName, props }) => {\n    let { container } = render(<Select {...props} />);\n    let input = container.querySelector<HTMLInputElement>('input[type=hidden]');\n\n    expect(input!.name).toBe(expectedName);\n  },\n  {\n    'single select > should assign the given name': {\n      props: { ...BASIC_PROPS, name: 'form-field-single-select' },\n      expectedName: 'form-field-single-select',\n    },\n    'multi select > should assign the given name': {\n      props: {\n        ...BASIC_PROPS,\n        name: 'form-field-multi-select',\n        isMulti: true,\n        value: OPTIONS[2],\n      },\n      expectedName: 'form-field-multi-select',\n    },\n  }\n);\n\ncases(\n  'menuIsOpen prop',\n  ({ props = BASIC_PROPS }) => {\n    let { container, rerender } = render(<Select {...props} />);\n    expect(container.querySelector('.react-select__menu')).toBeFalsy();\n\n    rerender(<Select {...props} menuIsOpen />);\n    expect(container.querySelector('.react-select__menu')).toBeTruthy();\n\n    rerender(<Select {...props} />);\n    expect(container.querySelector('.react-select__menu')).toBeFalsy();\n  },\n  {\n    'single select > should show menu if menuIsOpen is true and hide menu if menuIsOpen prop is false':\n      {},\n    'multi select > should show menu if menuIsOpen is true and hide menu if menuIsOpen prop is false':\n      {\n        props: {\n          ...BASIC_PROPS,\n          isMulti: true,\n        },\n      },\n  }\n);\n\ncases(\n  'filterOption() prop - default filter behavior',\n  ({ props, searchString, expectResultsLength }) => {\n    let { container, rerender } = render(<Select {...props} />);\n    rerender(<Select {...props} inputValue={searchString} />);\n    expect(container.querySelectorAll('.react-select__option')).toHaveLength(\n      expectResultsLength\n    );\n  },\n  {\n    'single select > should match accented char': {\n      props: {\n        ...BASIC_PROPS,\n        menuIsOpen: true,\n        options: OPTIONS_ACCENTED,\n      },\n      searchString: 'ecole', // should match \"école\"\n      expectResultsLength: 1,\n    },\n    'single select > should ignore accented char in query': {\n      props: {\n        ...BASIC_PROPS,\n        menuIsOpen: true,\n        options: OPTIONS_ACCENTED,\n      },\n      searchString: 'schoöl', // should match \"school\"\n      expectResultsLength: 1,\n    },\n  }\n);\n\ncases(\n  'filterOption() prop - should filter only if function returns truthy for value',\n  ({ props, searchString, expectResultsLength }) => {\n    let { container, rerender } = render(<Select {...props} />);\n    rerender(<Select {...props} inputValue={searchString} />);\n    expect(container.querySelectorAll('.react-select__option')).toHaveLength(\n      expectResultsLength\n    );\n  },\n  {\n    'single select > should filter all options as per searchString': {\n      props: {\n        ...BASIC_PROPS,\n        filterOption: (value: FilterOptionOption<Option>, search: string) =>\n          value.value.indexOf(search) > -1,\n        menuIsOpen: true,\n        value: OPTIONS[0],\n      },\n      searchString: 'o',\n      expectResultsLength: 5,\n    },\n    'multi select > should filter all options other that options in value of select':\n      {\n        props: {\n          ...BASIC_PROPS,\n          filterOption: (value: FilterOptionOption<Option>, search: string) =>\n            value.value.indexOf(search) > -1,\n          isMulti: true,\n          menuIsOpen: true,\n          value: OPTIONS[0],\n        },\n        searchString: 'o',\n        expectResultsLength: 4,\n      },\n  }\n);\n\ncases(\n  'filterOption prop is null',\n  ({ props, searchString, expectResultsLength }) => {\n    let { container, rerender } = render(<Select {...props} />);\n    rerender(<Select {...props} inputValue={searchString} />);\n    expect(container.querySelectorAll('.react-select__option')).toHaveLength(\n      expectResultsLength\n    );\n  },\n  {\n    'single select > should show all the options': {\n      props: {\n        ...BASIC_PROPS,\n        filterOption: null,\n        menuIsOpen: true,\n        value: OPTIONS[0],\n      },\n      searchString: 'o',\n      expectResultsLength: 17,\n    },\n    'multi select > should show all the options other than selected options': {\n      props: {\n        ...BASIC_PROPS,\n        filterOption: null,\n        isMulti: true,\n        menuIsOpen: true,\n        value: OPTIONS[0],\n      },\n      searchString: 'o',\n      expectResultsLength: 16,\n    },\n  }\n);\n\ncases(\n  'no option found on search based on filterOption prop',\n  ({ props, searchString }) => {\n    let { getByText, rerender } = render(<Select {...props} />);\n    rerender(<Select {...props} inputValue={searchString} />);\n    expect(getByText('No options').className).toContain(\n      'menu-notice--no-options'\n    );\n  },\n  {\n    'single Select > should show NoOptionsMessage': {\n      props: {\n        ...BASIC_PROPS,\n        filterOption: (value: FilterOptionOption<Option>, search: string) =>\n          value.value.indexOf(search) > -1,\n        menuIsOpen: true,\n      },\n      searchString: 'some text not in options',\n    },\n    'multi select > should show NoOptionsMessage': {\n      props: {\n        ...BASIC_PROPS,\n        filterOption: (value: FilterOptionOption<Option>, search: string) =>\n          value.value.indexOf(search) > -1,\n        menuIsOpen: true,\n      },\n      searchString: 'some text not in options',\n    },\n  }\n);\n\ncases(\n  'noOptionsMessage() function prop',\n  ({ props, expectNoOptionsMessage, searchString }) => {\n    let { getByText, rerender } = render(<Select {...props} />);\n    rerender(<Select {...props} inputValue={searchString} />);\n    expect(getByText(expectNoOptionsMessage).className).toContain(\n      'menu-notice--no-options'\n    );\n  },\n  {\n    'single Select > should show NoOptionsMessage returned from noOptionsMessage function prop':\n      {\n        props: {\n          ...BASIC_PROPS,\n          filterOption: (value: FilterOptionOption<Option>, search: string) =>\n            value.value.indexOf(search) > -1,\n          menuIsOpen: true,\n          noOptionsMessage: () =>\n            'this is custom no option message for single select',\n        },\n        expectNoOptionsMessage:\n          'this is custom no option message for single select',\n        searchString: 'some text not in options',\n      },\n    'multi select > should show NoOptionsMessage returned from noOptionsMessage function prop':\n      {\n        props: {\n          ...BASIC_PROPS,\n          filterOption: (value: FilterOptionOption<Option>, search: string) =>\n            value.value.indexOf(search) > -1,\n          menuIsOpen: true,\n          noOptionsMessage: () =>\n            'this is custom no option message for multi select',\n        },\n        expectNoOptionsMessage:\n          'this is custom no option message for multi select',\n        searchString: 'some text not in options',\n      },\n  }\n);\n\ncases(\n  'value prop',\n  ({ props, expectedValue }) => {\n    let value;\n    render(\n      <Select<Option | OptionNumberValue, boolean>\n        {...props}\n        components={{\n          Control: ({ getValue }) => {\n            value = getValue();\n            return null;\n          },\n        }}\n      />\n    );\n    expect(value).toEqual(expectedValue);\n  },\n  {\n    'single select > should set it as initial value': {\n      props: {\n        ...BASIC_PROPS,\n        value: OPTIONS[2],\n      },\n      expectedValue: [{ label: '2', value: 'two' }],\n    },\n    'single select > with option values as number > should set it as initial value':\n      {\n        props: {\n          ...BASIC_PROPS,\n          value: OPTIONS_NUMBER_VALUE[2],\n        },\n        expectedValue: [{ label: '2', value: 2 }],\n      },\n    'multi select > should set it as initial value': {\n      props: {\n        ...BASIC_PROPS,\n        isMulti: true,\n        value: OPTIONS[1],\n      },\n      expectedValue: [{ label: '1', value: 'one' }],\n    },\n    'multi select > with option values as number > should set it as initial value':\n      {\n        props: {\n          ...BASIC_PROPS,\n          isMulti: true,\n          value: OPTIONS_NUMBER_VALUE[1],\n        },\n        expectedValue: [{ label: '1', value: 1 }],\n      },\n  }\n);\n\ncases(\n  'update the value prop',\n  ({\n    props = { ...BASIC_PROPS, value: OPTIONS[1] },\n    updateValueTo,\n    expectedInitialValue,\n    expectedUpdatedValue,\n  }) => {\n    let { container, rerender } = render(\n      <Select<Option | OptionNumberValue, boolean> {...props} />\n    );\n    expect(\n      container.querySelector<HTMLInputElement>('input[type=\"hidden\"]')!.value\n    ).toEqual(expectedInitialValue);\n\n    rerender(\n      <Select<Option | OptionNumberValue, boolean>\n        {...props}\n        value={updateValueTo}\n      />\n    );\n\n    expect(\n      container.querySelector<HTMLInputElement>('input[type=\"hidden\"]')!.value\n    ).toEqual(expectedUpdatedValue);\n  },\n  {\n    'single select > should update the value when prop is updated': {\n      updateValueTo: OPTIONS[3],\n      expectedInitialValue: 'one',\n      expectedUpdatedValue: 'three',\n    },\n    'single select > value of options is number > should update the value when prop is updated':\n      {\n        props: {\n          ...BASIC_PROPS,\n          options: OPTIONS_NUMBER_VALUE,\n          value: OPTIONS_NUMBER_VALUE[2],\n        },\n        updateValueTo: OPTIONS_NUMBER_VALUE[3],\n        expectedInitialValue: '2',\n        expectedUpdatedValue: '3',\n      },\n    'multi select > should update the value when prop is updated': {\n      props: {\n        ...BASIC_PROPS,\n        isMulti: true,\n        value: OPTIONS[1],\n      },\n      updateValueTo: OPTIONS[3],\n      expectedInitialValue: 'one',\n      expectedUpdatedValue: 'three',\n    },\n    'multi select > value of options is number > should update the value when prop is updated':\n      {\n        props: {\n          ...BASIC_PROPS,\n          delimiter: ',',\n          isMulti: true,\n          options: OPTIONS_NUMBER_VALUE,\n          value: OPTIONS_NUMBER_VALUE[2],\n        },\n        updateValueTo: [OPTIONS_NUMBER_VALUE[3], OPTIONS_NUMBER_VALUE[2]],\n        expectedInitialValue: '2',\n        expectedUpdatedValue: '3,2',\n      },\n  }\n);\n\ncases(\n  'calls onChange on selecting an option',\n  ({\n    props = { ...BASIC_PROPS, menuIsOpen: true },\n    event: [eventName, eventOptions],\n    expectedSelectedOption,\n    optionsSelected,\n    focusedOption,\n    expectedActionMetaOption,\n  }) => {\n    let onChangeSpy = jest.fn();\n    props = { ...props, onChange: onChangeSpy };\n    let { container } = render(\n      <Select<Option | OptionNumberValue | OptionBooleanValue, boolean>\n        {...props}\n      />\n    );\n\n    if (focusedOption) {\n      focusOption(container, focusedOption, props.options);\n    }\n\n    let selectOption = [\n      ...container.querySelectorAll('div.react-select__option'),\n    ].find((n) => n.textContent === optionsSelected.label);\n\n    fireEvent[eventName](selectOption!, eventOptions);\n    expect(onChangeSpy).toHaveBeenCalledWith(expectedSelectedOption, {\n      action: 'select-option',\n      option: expectedActionMetaOption,\n      name: BASIC_PROPS.name,\n    });\n  },\n  {\n    'single select > option is clicked > should call onChange() prop with selected option':\n      {\n        event: ['click' as const] as const,\n        optionsSelected: { label: '2', value: 'two' },\n        expectedSelectedOption: { label: '2', value: 'two' },\n      },\n    'single select > option with number value > option is clicked > should call onChange() prop with selected option':\n      {\n        props: {\n          ...BASIC_PROPS,\n          menuIsOpen: true,\n          options: OPTIONS_NUMBER_VALUE,\n        },\n        event: ['click' as const] as const,\n        optionsSelected: { label: '0', value: 0 },\n        expectedSelectedOption: { label: '0', value: 0 },\n      },\n    'single select > option with boolean value > option is clicked > should call onChange() prop with selected option':\n      {\n        props: {\n          ...BASIC_PROPS,\n          menuIsOpen: true,\n          options: OPTIONS_BOOLEAN_VALUE,\n        },\n        event: ['click' as const] as const,\n        optionsSelected: { label: 'true', value: true },\n        expectedSelectedOption: { label: 'true', value: true },\n      },\n    'single select > tab key is pressed while focusing option > should call onChange() prop with selected option':\n      {\n        event: ['keyDown' as const, { keyCode: 9, key: 'Tab' }] as const,\n        optionsSelected: { label: '1', value: 'one' },\n        focusedOption: { label: '1', value: 'one' },\n        expectedSelectedOption: { label: '1', value: 'one' },\n      },\n    'single select > enter key is pressed while focusing option > should call onChange() prop with selected option':\n      {\n        event: ['keyDown' as const, { keyCode: 13, key: 'Enter' }] as const,\n        optionsSelected: { label: '3', value: 'three' },\n        focusedOption: { label: '3', value: 'three' },\n        expectedSelectedOption: { label: '3', value: 'three' },\n      },\n    'single select > space key is pressed while focusing option > should call onChange() prop with selected option':\n      {\n        event: ['keyDown' as const, { keyCode: 32, key: ' ' }] as const,\n        optionsSelected: { label: '1', value: 'one' },\n        focusedOption: { label: '1', value: 'one' },\n        expectedSelectedOption: { label: '1', value: 'one' },\n      },\n    'multi select > option is clicked > should call onChange() prop with selected option':\n      {\n        props: {\n          ...BASIC_PROPS,\n          isMulti: true,\n          menuIsOpen: true,\n          options: OPTIONS,\n        },\n        event: ['click' as const] as const,\n        optionsSelected: { label: '2', value: 'two' },\n        expectedSelectedOption: [{ label: '2', value: 'two' }],\n        expectedActionMetaOption: { label: '2', value: 'two' },\n      },\n    'multi select > option with number value > option is clicked > should call onChange() prop with selected option':\n      {\n        props: {\n          ...BASIC_PROPS,\n          isMulti: true,\n          menuIsOpen: true,\n          options: OPTIONS_NUMBER_VALUE,\n        },\n        event: ['click' as const] as const,\n        optionsSelected: { label: '0', value: 0 },\n        expectedSelectedOption: [{ label: '0', value: 0 }],\n        expectedActionMetaOption: { label: '0', value: 0 },\n      },\n    'multi select > option with boolean value > option is clicked > should call onChange() prop with selected option':\n      {\n        props: {\n          ...BASIC_PROPS,\n          isMulti: true,\n          menuIsOpen: true,\n          options: OPTIONS_BOOLEAN_VALUE,\n        },\n        event: ['click' as const] as const,\n        optionsSelected: { label: 'true', value: true },\n        expectedSelectedOption: [{ label: 'true', value: true }],\n        expectedActionMetaOption: { label: 'true', value: true },\n      },\n    'multi select > tab key is pressed while focusing option > should call onChange() prop with selected option':\n      {\n        props: {\n          ...BASIC_PROPS,\n          isMulti: true,\n          menuIsOpen: true,\n          options: OPTIONS,\n        },\n        event: ['keyDown' as const, { keyCode: 9, key: 'Tab' }] as const,\n        menuIsOpen: true,\n        optionsSelected: { label: '1', value: 'one' },\n        focusedOption: { label: '1', value: 'one' },\n        expectedSelectedOption: [{ label: '1', value: 'one' }],\n        expectedActionMetaOption: { label: '1', value: 'one' },\n      },\n    'multi select > enter key is pressed while focusing option > should call onChange() prop with selected option':\n      {\n        props: {\n          ...BASIC_PROPS,\n          isMulti: true,\n          menuIsOpen: true,\n          options: OPTIONS,\n        },\n        event: ['keyDown' as const, { keyCode: 13, key: 'Enter' }] as const,\n        optionsSelected: { label: '3', value: 'three' },\n        focusedOption: { label: '3', value: 'three' },\n        expectedSelectedOption: [{ label: '3', value: 'three' }],\n        expectedActionMetaOption: { label: '3', value: 'three' },\n      },\n    'multi select > space key is pressed while focusing option > should call onChange() prop with selected option':\n      {\n        props: {\n          ...BASIC_PROPS,\n          isMulti: true,\n          menuIsOpen: true,\n          options: OPTIONS,\n        },\n        event: ['keyDown' as const, { keyCode: 32, key: ' ' }] as const,\n        optionsSelected: { label: '1', value: 'one' },\n        focusedOption: { label: '1', value: 'one' },\n        expectedSelectedOption: [{ label: '1', value: 'one' }],\n        expectedActionMetaOption: { label: '1', value: 'one' },\n      },\n  }\n);\n\ninterface CallsOnChangeOnDeselectOptsProps\n  extends Omit<BasicProps, 'options' | 'value'> {\n  readonly options: readonly (\n    | Option\n    | OptionNumberValue\n    | OptionBooleanValue\n  )[];\n  readonly value:\n    | readonly Option[]\n    | readonly OptionNumberValue[]\n    | readonly OptionBooleanValue[]\n    | Option;\n  readonly menuIsOpen?: boolean;\n  readonly hideSelectedOptions?: boolean;\n  readonly isMulti?: boolean;\n}\n\ninterface CallsOnOnDeselectChangeOpts {\n  readonly props: CallsOnChangeOnDeselectOptsProps;\n  readonly event: readonly [EventType] | readonly [EventType, {}];\n  readonly menuIsOpen?: boolean;\n  readonly optionsSelected: Option | OptionNumberValue | OptionBooleanValue;\n  readonly focusedOption?: Option | OptionNumberValue | OptionBooleanValue;\n  readonly expectedSelectedOption:\n    | readonly Option[]\n    | readonly OptionNumberValue[]\n    | readonly OptionBooleanValue[];\n  readonly expectedMetaOption: Option | OptionNumberValue | OptionBooleanValue;\n}\n\ncases<CallsOnOnDeselectChangeOpts>(\n  'calls onChange on de-selecting an option in multi select',\n  ({\n    props,\n    event: [eventName, eventOptions],\n    expectedSelectedOption,\n    expectedMetaOption,\n    optionsSelected,\n    focusedOption,\n  }) => {\n    let onChangeSpy = jest.fn();\n    props = {\n      ...props,\n      onChange: onChangeSpy,\n      menuIsOpen: true,\n      hideSelectedOptions: false,\n      isMulti: true,\n    };\n    let { container } = render(\n      <Select<Option | OptionNumberValue | OptionBooleanValue, boolean>\n        {...props}\n      />\n    );\n\n    let selectOption = [\n      ...container.querySelectorAll('div.react-select__option'),\n    ].find((n) => n.textContent === optionsSelected.label);\n    if (focusedOption) {\n      focusOption(container, focusedOption, props.options);\n    }\n    fireEvent[eventName](selectOption!, eventOptions);\n    expect(onChangeSpy).toHaveBeenCalledWith(expectedSelectedOption, {\n      action: 'deselect-option',\n      option: expectedMetaOption,\n      name: BASIC_PROPS.name,\n    });\n  },\n  {\n    'option is clicked > should call onChange() prop with correct selected options and meta':\n      {\n        props: {\n          ...BASIC_PROPS,\n          options: OPTIONS,\n          value: [{ label: '2', value: 'two' }],\n        },\n        event: ['click'],\n        optionsSelected: { label: '2', value: 'two' },\n        expectedSelectedOption: [],\n        expectedMetaOption: { label: '2', value: 'two' },\n      },\n    'option with number value > option is clicked > should call onChange() prop with selected option':\n      {\n        props: {\n          ...BASIC_PROPS,\n          options: OPTIONS_NUMBER_VALUE,\n          value: [{ label: '0', value: 0 }],\n        },\n        event: ['click'],\n        optionsSelected: { label: '0', value: 0 },\n        expectedSelectedOption: [],\n        expectedMetaOption: { label: '0', value: 0 },\n      },\n    'option with boolean value > option is clicked > should call onChange() prop with selected option':\n      {\n        props: {\n          ...BASIC_PROPS,\n          options: OPTIONS_BOOLEAN_VALUE,\n          value: [{ label: 'true', value: true }],\n        },\n        event: ['click'],\n        optionsSelected: { label: 'true', value: true },\n        expectedSelectedOption: [],\n        expectedMetaOption: { label: 'true', value: true },\n      },\n    'tab key is pressed while focusing option > should call onChange() prop with selected option':\n      {\n        props: {\n          ...BASIC_PROPS,\n          options: OPTIONS,\n          value: [{ label: '1', value: 'one' }],\n        },\n        event: ['keyDown', { keyCode: 9, key: 'Tab' }],\n        menuIsOpen: true,\n        optionsSelected: { label: '1', value: 'one' },\n        focusedOption: { label: '1', value: 'one' },\n        expectedSelectedOption: [],\n        expectedMetaOption: { label: '1', value: 'one' },\n      },\n    'enter key is pressed while focusing option > should call onChange() prop with selected option':\n      {\n        props: {\n          ...BASIC_PROPS,\n          options: OPTIONS,\n          value: { label: '3', value: 'three' },\n        },\n        event: ['keyDown', { keyCode: 13, key: 'Enter' }],\n        optionsSelected: { label: '3', value: 'three' },\n        focusedOption: { label: '3', value: 'three' },\n        expectedSelectedOption: [],\n        expectedMetaOption: { label: '3', value: 'three' },\n      },\n    'space key is pressed while focusing option > should call onChange() prop with selected option':\n      {\n        props: {\n          ...BASIC_PROPS,\n          options: OPTIONS,\n          value: [{ label: '1', value: 'one' }],\n        },\n        event: ['keyDown', { keyCode: 32, key: ' ' }],\n        optionsSelected: { label: '1', value: 'one' },\n        focusedOption: { label: '1', value: 'one' },\n        expectedSelectedOption: [],\n        expectedMetaOption: { label: '1', value: 'one' },\n      },\n  }\n);\n\nfunction focusOption(\n  container: HTMLElement,\n  option: Option | OptionNumberValue | OptionBooleanValue,\n  options: readonly (Option | OptionNumberValue | OptionBooleanValue)[]\n) {\n  let indexOfSelectedOption = options.findIndex(\n    (o) => o.value === option.value\n  );\n\n  for (let i = -1; i < indexOfSelectedOption; i++) {\n    fireEvent.keyDown(container.querySelector('.react-select__menu')!, {\n      keyCode: 40,\n      key: 'ArrowDown',\n    });\n  }\n  expect(\n    container.querySelector('.react-select__option--is-focused')!.textContent\n  ).toEqual(option.label);\n}\n\ncases(\n  'hitting escape on select option',\n  ({\n    props,\n    event: [eventName, eventOptions],\n    focusedOption,\n    optionsSelected,\n  }) => {\n    let onChangeSpy = jest.fn();\n    let { container } = render(\n      <Select\n        {...props}\n        onChange={onChangeSpy}\n        onInputChange={jest.fn()}\n        onMenuClose={jest.fn()}\n      />\n    );\n\n    let selectOption = [\n      ...container.querySelectorAll('div.react-select__option'),\n    ].find((n) => n.textContent === optionsSelected.label);\n    focusOption(container, focusedOption, props.options);\n\n    fireEvent[eventName](selectOption!, eventOptions);\n    expect(onChangeSpy).not.toHaveBeenCalled();\n  },\n  {\n    'single select > should not call onChange prop': {\n      props: {\n        ...BASIC_PROPS,\n        menuIsOpen: true,\n      },\n      optionsSelected: { label: '1', value: 'one' },\n      focusedOption: { label: '1', value: 'one' },\n      event: ['keyDown' as const, { keyCode: 27 }] as const,\n    },\n    'multi select > should not call onChange prop': {\n      props: {\n        ...BASIC_PROPS,\n        isMulti: true,\n        menuIsOpen: true,\n      },\n      optionsSelected: { label: '1', value: 'one' },\n      focusedOption: { label: '1', value: 'one' },\n      event: ['keyDown' as const, { keyCode: 27 }] as const,\n    },\n  }\n);\n\ncases(\n  'click to open select',\n  ({ props = BASIC_PROPS, expectedToFocus }) => {\n    let { container, rerender } = render(\n      <Select\n        {...props}\n        onMenuOpen={() => {\n          rerender(<Select {...props} menuIsOpen onMenuOpen={noop} />);\n        }}\n      />\n    );\n\n    fireEvent.mouseDown(\n      container.querySelector('.react-select__dropdown-indicator')!,\n      { button: 0 }\n    );\n    expect(\n      container.querySelector('.react-select__option--is-focused')!.textContent\n    ).toEqual(expectedToFocus.label);\n  },\n  {\n    'single select > should focus the first option': {\n      expectedToFocus: { label: '0', value: 'zero' },\n    },\n    'multi select > should focus the first option': {\n      props: {\n        ...BASIC_PROPS,\n        isMulti: true,\n      },\n      expectedToFocus: { label: '0', value: 'zero' },\n    },\n  }\n);\n\ntest('clicking when focused does not open select when openMenuOnClick=false', () => {\n  let spy = jest.fn();\n  let { container } = render(\n    <Select {...BASIC_PROPS} openMenuOnClick={false} onMenuOpen={spy} />\n  );\n\n  // this will get updated on input click, though click on input is not bubbling up to control component\n  userEvent.click(container.querySelector('input.react-select__input')!);\n  expect(spy).not.toHaveBeenCalled();\n});\n\ncases(\n  'focus on options > keyboard interaction with Menu',\n  ({ props, selectedOption, nextFocusOption, keyEvent = [] }) => {\n    let { container } = render(<Select {...props} />);\n\n    let indexOfSelectedOption = props.options.indexOf(selectedOption);\n\n    for (let i = -1; i < indexOfSelectedOption; i++) {\n      fireEvent.keyDown(container.querySelector('.react-select__menu')!, {\n        keyCode: 40,\n        key: 'ArrowDown',\n      });\n    }\n\n    expect(\n      container.querySelector('.react-select__option--is-focused')!.textContent\n    ).toEqual(selectedOption.label);\n\n    for (let event of keyEvent) {\n      fireEvent.keyDown(container.querySelector('.react-select__menu')!, event);\n    }\n\n    expect(\n      container.querySelector('.react-select__option--is-focused')!.textContent\n    ).toEqual(nextFocusOption.label);\n  },\n  {\n    'single select > ArrowDown key on first option should focus second option':\n      {\n        props: {\n          ...BASIC_PROPS,\n          menuIsOpen: true,\n        },\n        keyEvent: [{ keyCode: 40, key: 'ArrowDown' }],\n        selectedOption: OPTIONS[0],\n        nextFocusOption: OPTIONS[1],\n      },\n    'single select > ArrowDown key on last option should focus first option': {\n      props: {\n        ...BASIC_PROPS,\n        menuIsOpen: true,\n        options: OPTIONS,\n      },\n      keyEvent: [{ keyCode: 40, key: 'ArrowDown' }],\n      selectedOption: OPTIONS[OPTIONS.length - 1],\n      nextFocusOption: OPTIONS[0],\n    },\n    'single select > ArrowUp key on first option should focus last option': {\n      props: {\n        ...BASIC_PROPS,\n        menuIsOpen: true,\n        options: OPTIONS,\n      },\n      keyEvent: [{ keyCode: 38, key: 'ArrowUp' }],\n      selectedOption: OPTIONS[0],\n      nextFocusOption: OPTIONS[OPTIONS.length - 1],\n    },\n    'single select > ArrowUp key on last option should focus second last option':\n      {\n        props: {\n          ...BASIC_PROPS,\n          menuIsOpen: true,\n          options: OPTIONS,\n        },\n        keyEvent: [{ keyCode: 38, key: 'ArrowUp' }],\n        selectedOption: OPTIONS[OPTIONS.length - 1],\n        nextFocusOption: OPTIONS[OPTIONS.length - 2],\n      },\n    'single select > disabled options should be focusable': {\n      props: {\n        ...BASIC_PROPS,\n        menuIsOpen: true,\n        options: OPTIONS_DISABLED,\n      },\n      keyEvent: [{ keyCode: 40, key: 'ArrowDown' }],\n      selectedOption: OPTIONS_DISABLED[0],\n      nextFocusOption: OPTIONS_DISABLED[1],\n    },\n    'single select > PageDown key takes us to next page with default page size of 5':\n      {\n        props: {\n          ...BASIC_PROPS,\n          menuIsOpen: true,\n          options: OPTIONS,\n        },\n        keyEvent: [{ keyCode: 34, key: 'PageDown' }],\n        selectedOption: OPTIONS[0],\n        nextFocusOption: OPTIONS[5],\n      },\n    'single select > PageDown key takes us to next page with custom pageSize 7':\n      {\n        props: {\n          ...BASIC_PROPS,\n          menuIsOpen: true,\n          pageSize: 7,\n          options: OPTIONS,\n        },\n        keyEvent: [{ keyCode: 34, key: 'PageDown' }],\n        selectedOption: OPTIONS[0],\n        nextFocusOption: OPTIONS[7],\n      },\n    'single select > PageDown key takes to the last option is options below is less then page size':\n      {\n        props: {\n          ...BASIC_PROPS,\n          menuIsOpen: true,\n          options: OPTIONS,\n        },\n        keyEvent: [{ keyCode: 34, key: 'PageDown' }],\n        selectedOption: OPTIONS[OPTIONS.length - 3],\n        nextFocusOption: OPTIONS[OPTIONS.length - 1],\n      },\n    'single select > PageUp key takes us to previous page with default page size of 5':\n      {\n        props: {\n          ...BASIC_PROPS,\n          menuIsOpen: true,\n          options: OPTIONS,\n        },\n        keyEvent: [{ keyCode: 33, key: 'PageUp' }],\n        selectedOption: OPTIONS[6],\n        nextFocusOption: OPTIONS[1],\n      },\n    'single select > PageUp key takes us to previous page with custom pageSize of 7':\n      {\n        props: {\n          ...BASIC_PROPS,\n          menuIsOpen: true,\n          pageSize: 7,\n          options: OPTIONS,\n        },\n        keyEvent: [{ keyCode: 33, key: 'PageUp' }],\n        selectedOption: OPTIONS[9],\n        nextFocusOption: OPTIONS[2],\n      },\n    'single select > PageUp key takes us to first option - (previous options < pageSize)':\n      {\n        props: {\n          ...BASIC_PROPS,\n          menuIsOpen: true,\n          options: OPTIONS,\n        },\n        keyEvent: [{ keyCode: 33, key: 'PageUp' }],\n        selectedOption: OPTIONS[1],\n        nextFocusOption: OPTIONS[0],\n      },\n    'single select > Home key takes up to the first option': {\n      props: {\n        ...BASIC_PROPS,\n        menuIsOpen: true,\n        options: OPTIONS,\n      },\n      keyEvent: [{ keyCode: 36, key: 'Home' }],\n      selectedOption: OPTIONS[OPTIONS.length - 3],\n      nextFocusOption: OPTIONS[0],\n    },\n    'single select > End key takes down to the last option': {\n      props: {\n        ...BASIC_PROPS,\n        menuIsOpen: true,\n        options: OPTIONS,\n      },\n      keyEvent: [{ keyCode: 35, key: 'End' }],\n      selectedOption: OPTIONS[2],\n      nextFocusOption: OPTIONS[OPTIONS.length - 1],\n    },\n    'multi select > ArrowDown key on first option should focus second option': {\n      props: {\n        ...BASIC_PROPS,\n        isMulti: true,\n        menuIsOpen: true,\n        options: OPTIONS,\n      },\n      keyEvent: [{ keyCode: 40, key: 'ArrowDown' }],\n      selectedOption: OPTIONS[0],\n      nextFocusOption: OPTIONS[1],\n    },\n    'multi select > ArrowDown key on last option should focus first option': {\n      props: {\n        ...BASIC_PROPS,\n        isMulti: true,\n        menuIsOpen: true,\n        options: OPTIONS,\n      },\n      keyEvent: [{ keyCode: 40, key: 'ArrowDown' }],\n      selectedOption: OPTIONS[OPTIONS.length - 1],\n      nextFocusOption: OPTIONS[0],\n    },\n    'multi select > ArrowUp key on first option should focus last option': {\n      props: {\n        ...BASIC_PROPS,\n        isMulti: true,\n        menuIsOpen: true,\n        options: OPTIONS,\n      },\n      keyEvent: [{ keyCode: 38, key: 'ArrowUp' }],\n      selectedOption: OPTIONS[0],\n      nextFocusOption: OPTIONS[OPTIONS.length - 1],\n    },\n    'multi select > ArrowUp key on last option should focus second last option':\n      {\n        props: {\n          ...BASIC_PROPS,\n          isMulti: true,\n          menuIsOpen: true,\n          options: OPTIONS,\n        },\n        keyEvent: [{ keyCode: 38, key: 'ArrowUp' }],\n        selectedOption: OPTIONS[OPTIONS.length - 1],\n        nextFocusOption: OPTIONS[OPTIONS.length - 2],\n      },\n    'multi select > PageDown key takes us to next page with default page size of 5':\n      {\n        props: {\n          ...BASIC_PROPS,\n          isMulti: true,\n          menuIsOpen: true,\n          options: OPTIONS,\n        },\n        keyEvent: [{ keyCode: 34, key: 'PageDown' }],\n        selectedOption: OPTIONS[0],\n        nextFocusOption: OPTIONS[5],\n      },\n    'multi select > PageDown key takes us to next page with custom pageSize of 8':\n      {\n        props: {\n          ...BASIC_PROPS,\n          isMulti: true,\n          menuIsOpen: true,\n          pageSize: 8,\n          options: OPTIONS,\n        },\n        keyEvent: [{ keyCode: 34, key: 'PageDown' }],\n        selectedOption: OPTIONS[0],\n        nextFocusOption: OPTIONS[8],\n      },\n    'multi select > PageDown key takes to the last option is options below is less then page size':\n      {\n        props: {\n          ...BASIC_PROPS,\n          isMulti: true,\n          menuIsOpen: true,\n          options: OPTIONS,\n        },\n        keyEvent: [{ keyCode: 34, key: 'PageDown' }],\n        selectedOption: OPTIONS[OPTIONS.length - 3],\n        nextFocusOption: OPTIONS[OPTIONS.length - 1],\n      },\n    'multi select > PageUp key takes us to previous page with default page size of 5':\n      {\n        props: {\n          ...BASIC_PROPS,\n          isMulti: true,\n          menuIsOpen: true,\n          options: OPTIONS,\n        },\n        keyEvent: [{ keyCode: 33, key: 'PageUp' }],\n        selectedOption: OPTIONS[6],\n        nextFocusOption: OPTIONS[1],\n      },\n    'multi select > PageUp key takes us to previous page with default page size of 9':\n      {\n        props: {\n          ...BASIC_PROPS,\n          isMulti: true,\n          menuIsOpen: true,\n          pageSize: 9,\n          options: OPTIONS,\n        },\n        keyEvent: [{ keyCode: 33, key: 'PageUp' }],\n        selectedOption: OPTIONS[10],\n        nextFocusOption: OPTIONS[1],\n      },\n    'multi select > PageUp key takes us to first option - previous options < pageSize':\n      {\n        props: {\n          ...BASIC_PROPS,\n          isMulti: true,\n          menuIsOpen: true,\n          options: OPTIONS,\n        },\n        keyEvent: [{ keyCode: 33, key: 'PageUp' }],\n        selectedOption: OPTIONS[1],\n        nextFocusOption: OPTIONS[0],\n      },\n    'multi select > Home key takes up to the first option': {\n      props: {\n        ...BASIC_PROPS,\n        isMulti: true,\n        menuIsOpen: true,\n        options: OPTIONS,\n      },\n      keyEvent: [{ keyCode: 36, key: 'Home' }],\n      selectedOption: OPTIONS[OPTIONS.length - 3],\n      nextFocusOption: OPTIONS[0],\n    },\n    'multi select > End key takes down to the last option': {\n      props: {\n        ...BASIC_PROPS,\n        isMulti: true,\n        menuIsOpen: true,\n        options: OPTIONS,\n      },\n      keyEvent: [{ keyCode: 35, key: 'End' }],\n      selectedOption: OPTIONS[2],\n      nextFocusOption: OPTIONS[OPTIONS.length - 1],\n    },\n  }\n);\n\n// TODO: Cover more scenario\ncases(\n  'hitting escape with inputValue in select',\n  ({ props }) => {\n    let spy = jest.fn();\n    let { container } = render(\n      <Select {...props} onInputChange={spy} onMenuClose={jest.fn()} />\n    );\n\n    fireEvent.keyDown(container.querySelector('.react-select')!, {\n      keyCode: 27,\n      key: 'Escape',\n    });\n    expect(spy).toHaveBeenCalledWith('', {\n      action: 'menu-close',\n      prevInputValue: 'test',\n    });\n  },\n  {\n    'single select > should call onInputChange prop with empty string as inputValue':\n      {\n        props: {\n          ...BASIC_PROPS,\n          inputValue: 'test',\n          menuIsOpen: true,\n          value: OPTIONS[0],\n        },\n      },\n    'multi select > should call onInputChange prop with empty string as inputValue':\n      {\n        props: {\n          ...BASIC_PROPS,\n          inputValue: 'test',\n          isMulti: true,\n          menuIsOpen: true,\n          value: OPTIONS[0],\n        },\n      },\n  }\n);\n\ncases(\n  'Clicking dropdown indicator on select with closed menu with primary button on mouse',\n  ({ props = BASIC_PROPS }) => {\n    let onMenuOpenSpy = jest.fn();\n    props = { ...props, onMenuOpen: onMenuOpenSpy };\n    let { container } = render(<Select {...props} />);\n    // Menu is closed\n    expect(\n      container.querySelector('.react-select__menu')\n    ).not.toBeInTheDocument();\n    fireEvent.mouseDown(\n      container.querySelector('div.react-select__dropdown-indicator')!,\n      { button: 0 }\n    );\n    expect(onMenuOpenSpy).toHaveBeenCalled();\n  },\n  {\n    'single select > should call onMenuOpen prop when select is opened and onMenuClose prop when select is closed':\n      {},\n    'multi select > should call onMenuOpen prop when select is opened and onMenuClose prop when select is closed':\n      {\n        props: {\n          ...BASIC_PROPS,\n          isMulti: true,\n        },\n      },\n  }\n);\n\ncases(\n  'Clicking dropdown indicator on select with open menu with primary button on mouse',\n  ({ props = BASIC_PROPS }) => {\n    let onMenuCloseSpy = jest.fn();\n    props = { ...props, onMenuClose: onMenuCloseSpy };\n    let { container } = render(<Select {...props} menuIsOpen />);\n    // Menu is open\n    expect(container.querySelector('.react-select__menu')).toBeInTheDocument();\n    fireEvent.mouseDown(\n      container.querySelector('div.react-select__dropdown-indicator')!,\n      { button: 0 }\n    );\n    expect(onMenuCloseSpy).toHaveBeenCalled();\n  },\n  {\n    'single select > should call onMenuOpen prop when select is opened and onMenuClose prop when select is closed':\n      {},\n    'multi select > should call onMenuOpen prop when select is opened and onMenuClose prop when select is closed':\n      {\n        props: {\n          ...BASIC_PROPS,\n          isMulti: true,\n        },\n      },\n  }\n);\n\ninterface ClickingEnterOptsProps extends BasicProps {\n  readonly menuIsOpen?: boolean;\n}\n\ninterface ClickingEnterOpts {\n  readonly props: ClickingEnterOptsProps;\n  readonly expectedValue: boolean;\n}\n\ncases<ClickingEnterOpts>(\n  'Clicking Enter on a focused select',\n  ({ props, expectedValue }) => {\n    let event!: KeyboardEvent<HTMLDivElement>;\n    let { container } = render(\n      <div\n        onKeyDown={(_event) => {\n          event = _event;\n          event.persist();\n        }}\n      >\n        <Select {...props} />\n      </div>\n    );\n    if (props.menuIsOpen) {\n      fireEvent.keyDown(container.querySelector('.react-select__menu')!, {\n        keyCode: 40,\n        key: 'ArrowDown',\n      });\n    }\n\n    fireEvent.keyDown(container.querySelector('.react-select')!, {\n      key: 'Enter',\n      keyCode: 13,\n    });\n    expect(event.defaultPrevented).toBe(expectedValue);\n  },\n  {\n    'while menuIsOpen && focusedOption && !isComposing  > should invoke event.preventDefault':\n      {\n        props: {\n          ...BASIC_PROPS,\n          menuIsOpen: true,\n        },\n        expectedValue: true,\n      },\n    'while !menuIsOpen > should not invoke event.preventDefault': {\n      props: {\n        ...BASIC_PROPS,\n      },\n      expectedValue: false,\n    },\n  }\n);\n\n// QUESTION: Is this test right? I tried right clicking on the dropdown indicator in a browser and the select opened but this test says it shouldn't?\ncases(\n  'clicking on select using secondary button on mouse',\n  ({ props = BASIC_PROPS }) => {\n    let onMenuOpenSpy = jest.fn();\n    let onMenuCloseSpy = jest.fn();\n    let { container, rerender } = render(\n      <Select\n        {...props}\n        onMenuClose={onMenuCloseSpy}\n        onMenuOpen={onMenuOpenSpy}\n      />\n    );\n    let downButton = container.querySelector(\n      'div.react-select__dropdown-indicator'\n    );\n\n    // does not open menu if menu is closed\n    fireEvent.mouseDown(downButton!, { button: 1 });\n    expect(onMenuOpenSpy).not.toHaveBeenCalled();\n\n    // does not close menu if menu is opened\n    rerender(\n      <Select\n        {...props}\n        menuIsOpen\n        onMenuClose={onMenuCloseSpy}\n        onMenuOpen={onMenuOpenSpy}\n      />\n    );\n    fireEvent.mouseDown(downButton!, { button: 1 });\n    expect(onMenuCloseSpy).not.toHaveBeenCalled();\n  },\n  {\n    'single select > secondary click is ignored > should not call onMenuOpen and onMenuClose prop':\n      {\n        skip: true,\n      },\n    'multi select > secondary click is ignored > should not call onMenuOpen and onMenuClose prop':\n      {\n        props: {\n          ...BASIC_PROPS,\n          isMulti: true,\n        },\n        skip: true,\n      },\n  }\n);\n\ninterface RequiredOnInputOpts {\n  readonly props?: BasicProps;\n  readonly isMulti?: boolean;\n}\n\ncases<RequiredOnInputOpts>(\n  'required on input is not there by default',\n  ({ props = BASIC_PROPS }) => {\n    let { container } = render(<Select {...props} onInputChange={jest.fn()} />);\n    let input = container.querySelector<HTMLInputElement>(\n      'input.react-select__input'\n    );\n    expect(input!.required).toBe(false);\n  },\n  {\n    'single select > should not have required attribute': {},\n    'multi select > should not have required attribute': { isMulti: true },\n  }\n);\n\ncases(\n  'value of hidden input control',\n  ({ props, expectedValue }) => {\n    let { container } = render(\n      <Select<Option | OptionNumberValue | OptionBooleanValue, boolean>\n        {...props}\n      />\n    );\n    let hiddenInput = container.querySelector<HTMLInputElement>(\n      'input[type=\"hidden\"]'\n    );\n    expect(hiddenInput!.value).toEqual(expectedValue);\n  },\n  {\n    'single select > should set value of input as value prop': {\n      props: {\n        ...BASIC_PROPS,\n        value: OPTIONS[3],\n      },\n      expectedValue: 'three',\n    },\n    'single select > options with number values > should set value of input as value prop':\n      {\n        props: {\n          ...BASIC_PROPS,\n          options: OPTIONS_NUMBER_VALUE,\n          value: OPTIONS_NUMBER_VALUE[3],\n        },\n        expectedValue: '3',\n      },\n    'single select > options with boolean values > should set value of input as value prop':\n      {\n        props: {\n          ...BASIC_PROPS,\n          options: OPTIONS_BOOLEAN_VALUE,\n          value: OPTIONS_BOOLEAN_VALUE[1],\n        },\n        expectedValue: 'false',\n      },\n    'multi select > should set value of input as value prop': {\n      props: {\n        ...BASIC_PROPS,\n        isMulti: true,\n        value: OPTIONS[3],\n      },\n      expectedValue: 'three',\n    },\n    'multi select > with delimiter prop > should set value of input as value prop':\n      {\n        props: {\n          ...BASIC_PROPS,\n          delimiter: ', ',\n          isMulti: true,\n          value: [OPTIONS[3], OPTIONS[5]],\n        },\n        expectedValue: 'three, five',\n      },\n    'multi select > options with number values > should set value of input as value prop':\n      {\n        props: {\n          ...BASIC_PROPS,\n          isMulti: true,\n          options: OPTIONS_NUMBER_VALUE,\n          value: OPTIONS_NUMBER_VALUE[3],\n        },\n        expectedValue: '3',\n      },\n    'multi select > with delimiter prop > options with number values > should set value of input as value prop':\n      {\n        props: {\n          ...BASIC_PROPS,\n          delimiter: ', ',\n          isMulti: true,\n          options: OPTIONS_NUMBER_VALUE,\n          value: [OPTIONS_NUMBER_VALUE[3], OPTIONS_NUMBER_VALUE[1]],\n        },\n        expectedValue: '3, 1',\n      },\n    'multi select > options with boolean values > should set value of input as value prop':\n      {\n        props: {\n          ...BASIC_PROPS,\n          isMulti: true,\n          options: OPTIONS_BOOLEAN_VALUE,\n          value: OPTIONS_BOOLEAN_VALUE[1],\n        },\n        expectedValue: 'false',\n      },\n    'multi select > with delimiter prop > options with boolean values > should set value of input as value prop':\n      {\n        props: {\n          ...BASIC_PROPS,\n          delimiter: ', ',\n          isMulti: true,\n          options: OPTIONS_BOOLEAN_VALUE,\n          value: [OPTIONS_BOOLEAN_VALUE[1], OPTIONS_BOOLEAN_VALUE[0]],\n        },\n        expectedValue: 'false, true',\n      },\n  }\n);\n\ncases(\n  'isOptionDisabled() prop',\n  ({ props, expectedEnabledOption, expectedDisabledOption }) => {\n    let { container } = render(<Select {...props} />);\n\n    const enabledOptionsValues = [\n      ...container.querySelectorAll('.react-select__option'),\n    ]\n      .filter((n) => !n.classList.contains('react-select__option--is-disabled'))\n      .map((option) => option.textContent);\n\n    enabledOptionsValues.forEach((option) => {\n      expect(expectedDisabledOption.indexOf(option!)).toBe(-1);\n    });\n\n    const disabledOptionsValues = [\n      ...container.querySelectorAll('.react-select__option'),\n    ]\n      .filter((n) => n.classList.contains('react-select__option--is-disabled'))\n      .map((option) => option.textContent);\n\n    disabledOptionsValues.forEach((option) => {\n      expect(expectedEnabledOption.indexOf(option!)).toBe(-1);\n    });\n  },\n  {\n    'single select > should add isDisabled as true prop only to options that are disabled':\n      {\n        props: {\n          ...BASIC_PROPS,\n          menuIsOpen: true,\n          isOptionDisabled: (option: Option) =>\n            ['zero', 'two', 'five', 'ten'].indexOf(option.value) > -1,\n        },\n        expectedEnabledOption: ['1', '3', '11'],\n        expectedDisabledOption: ['0', '2', '5'],\n      },\n    'multi select > should add isDisabled as true prop only to options that are disabled':\n      {\n        props: {\n          ...BASIC_PROPS,\n          isMulti: true,\n          menuIsOpen: true,\n          isOptionDisabled: (option: Option) =>\n            ['zero', 'two', 'five', 'ten'].indexOf(option.value) > -1,\n        },\n        expectedEnabledOption: ['1', '3', '11'],\n        expectedDisabledOption: ['0', '2', '5'],\n      },\n  }\n);\n\ncases(\n  'isDisabled prop',\n  ({ props }) => {\n    let { container } = render(<Select {...props} />);\n\n    let control = container.querySelector('.react-select__control');\n    expect(\n      control!.classList.contains('react-select__control--is-disabled')\n    ).toBeTruthy();\n\n    let input = container.querySelector<HTMLInputElement>(\n      '.react-select__control input'\n    );\n    expect(input!.disabled).toBeTruthy();\n  },\n  {\n    'single select > should add isDisabled prop to select components': {\n      props: {\n        ...BASIC_PROPS,\n        isDisabled: true,\n      },\n    },\n    'multi select > should add isDisabled prop to select components': {\n      props: {\n        ...BASIC_PROPS,\n        isDisabled: true,\n        isMulti: true,\n      },\n    },\n  }\n);\n\ntest('hitting Enter on option should not call onChange if the event comes from IME', () => {\n  let spy = jest.fn();\n  let { container } = render(\n    <Select\n      className=\"react-select\"\n      classNamePrefix=\"react-select\"\n      menuIsOpen\n      onChange={spy}\n      onInputChange={jest.fn()}\n      onMenuClose={jest.fn()}\n      onMenuOpen={jest.fn()}\n      options={OPTIONS}\n      tabSelectsValue={false}\n      inputValue=\"\"\n      value={null}\n    />\n  );\n\n  let selectOption = container.querySelector('div.react-select__option');\n  let menu = container.querySelector('.react-select__menu');\n  fireEvent.keyDown(menu!, { keyCode: 40, key: 'ArrowDown' });\n  fireEvent.keyDown(menu!, { keyCode: 40, key: 'ArrowDown' });\n\n  fireEvent.keyDown(selectOption!, { keyCode: 229, key: 'Enter' });\n\n  expect(spy).not.toHaveBeenCalled();\n});\n\ntest('hitting tab on option should not call onChange if tabSelectsValue is false', () => {\n  let spy = jest.fn();\n  let { container } = render(\n    <Select\n      className=\"react-select\"\n      classNamePrefix=\"react-select\"\n      menuIsOpen\n      onChange={spy}\n      onInputChange={jest.fn()}\n      onMenuClose={jest.fn()}\n      onMenuOpen={jest.fn()}\n      options={OPTIONS}\n      tabSelectsValue={false}\n      inputValue=\"\"\n      value={null}\n    />\n  );\n\n  let selectOption = container.querySelector('div.react-select__option');\n  let menu = container.querySelector('.react-select__menu');\n  fireEvent.keyDown(menu!, { keyCode: 40, key: 'ArrowDown' });\n  fireEvent.keyDown(menu!, { keyCode: 40, key: 'ArrowDown' });\n\n  fireEvent.keyDown(selectOption!, { keyCode: 9, key: 'Tab' });\n  expect(spy).not.toHaveBeenCalled();\n});\n\ntest('multi select > to not show selected value in options', () => {\n  let onInputChangeSpy = jest.fn();\n  let onMenuCloseSpy = jest.fn();\n  let { container, rerender } = render(\n    <Select\n      {...BASIC_PROPS}\n      isMulti\n      menuIsOpen\n      onInputChange={onInputChangeSpy}\n      onMenuClose={onMenuCloseSpy}\n    />\n  );\n\n  let availableOptions = [\n    ...container.querySelectorAll('.react-select__option'),\n  ].map((option) => option.textContent);\n  expect(availableOptions.indexOf('0') > -1).toBeTruthy();\n\n  rerender(\n    <Select\n      {...BASIC_PROPS}\n      isMulti\n      menuIsOpen\n      onInputChange={onInputChangeSpy}\n      onMenuClose={onMenuCloseSpy}\n      value={OPTIONS[0]}\n    />\n  );\n\n  // Re-open Menu\n  fireEvent.mouseDown(\n    container.querySelector('div.react-select__dropdown-indicator')!,\n    {\n      button: 0,\n    }\n  );\n  availableOptions = [\n    ...container.querySelectorAll('.react-select__option'),\n  ].map((option) => option.textContent);\n\n  expect(availableOptions.indexOf('0') > -1).toBeFalsy();\n});\n\ntest('multi select > to not hide the selected options from the menu if hideSelectedOptions is false', () => {\n  let { container } = render(\n    <Select\n      className=\"react-select\"\n      classNamePrefix=\"react-select\"\n      hideSelectedOptions={false}\n      isMulti\n      menuIsOpen\n      onChange={jest.fn()}\n      onInputChange={jest.fn()}\n      onMenuClose={jest.fn()}\n      onMenuOpen={jest.fn()}\n      options={OPTIONS}\n      inputValue=\"\"\n      value={null}\n    />\n  );\n  let firstOption = container.querySelectorAll('.react-select__option')[0];\n  let secondoption = container.querySelectorAll('.react-select__option')[1];\n  expect(firstOption.textContent).toBe('0');\n  expect(secondoption.textContent).toBe('1');\n\n  userEvent.click(firstOption);\n\n  expect(firstOption.textContent).toBe('0');\n  expect(secondoption.textContent).toBe('1');\n});\n\ntest('multi select > call onChange with all values but last selected value and remove event on hitting backspace', () => {\n  let onChangeSpy = jest.fn();\n  let { container } = render(\n    <Select\n      {...BASIC_PROPS}\n      isMulti\n      onChange={onChangeSpy}\n      value={[OPTIONS[0], OPTIONS[1], OPTIONS[2]]}\n    />\n  );\n  expect(container.querySelector('.react-select__control')!.textContent).toBe(\n    '012'\n  );\n\n  fireEvent.keyDown(container.querySelector('.react-select__control')!, {\n    keyCode: 8,\n    key: 'Backspace',\n  });\n  expect(onChangeSpy).toHaveBeenCalledWith(\n    [\n      { label: '0', value: 'zero' },\n      { label: '1', value: 'one' },\n    ],\n    {\n      action: 'pop-value',\n      removedValue: { label: '2', value: 'two' },\n      name: BASIC_PROPS.name,\n    }\n  );\n});\n\ntest('should not call onChange on hitting backspace when backspaceRemovesValue is false', () => {\n  let onChangeSpy = jest.fn();\n  let { container } = render(\n    <Select\n      {...BASIC_PROPS}\n      backspaceRemovesValue={false}\n      onChange={onChangeSpy}\n    />\n  );\n  fireEvent.keyDown(container.querySelector('.react-select__control')!, {\n    keyCode: 8,\n    key: 'Backspace',\n  });\n  expect(onChangeSpy).not.toHaveBeenCalled();\n});\n\ntest('should not call onChange on hitting backspace even when backspaceRemovesValue is true if isClearable is false', () => {\n  let onChangeSpy = jest.fn();\n  let { container } = render(\n    <Select\n      {...BASIC_PROPS}\n      backspaceRemovesValue\n      isClearable={false}\n      onChange={onChangeSpy}\n    />\n  );\n  fireEvent.keyDown(container.querySelector('.react-select__control')!, {\n    keyCode: 8,\n    key: 'Backspace',\n  });\n  expect(onChangeSpy).not.toHaveBeenCalled();\n});\n\ntest('should call onChange with `null` on hitting backspace when backspaceRemovesValue is true and isMulti is false', () => {\n  let onChangeSpy = jest.fn();\n  let { container } = render(\n    <Select\n      {...BASIC_PROPS}\n      backspaceRemovesValue\n      isClearable\n      isMulti={false}\n      onChange={onChangeSpy}\n    />\n  );\n  fireEvent.keyDown(container.querySelector('.react-select__control')!, {\n    keyCode: 8,\n    key: 'Backspace',\n  });\n  expect(onChangeSpy).toHaveBeenCalledWith(null, {\n    action: 'clear',\n    name: 'test-input-name',\n    removedValues: [],\n  });\n});\n\ntest('should call onChange with an array on hitting backspace when backspaceRemovesValue is true and isMulti is true', () => {\n  let onChangeSpy = jest.fn();\n  let { container } = render(\n    <Select\n      {...BASIC_PROPS}\n      backspaceRemovesValue\n      isClearable\n      isMulti\n      onChange={onChangeSpy}\n      value={[OPTIONS[0]]}\n    />\n  );\n  fireEvent.keyDown(container.querySelector('.react-select__control')!, {\n    keyCode: 8,\n    key: 'Backspace',\n  });\n  expect(onChangeSpy).toHaveBeenCalledWith([], {\n    action: 'pop-value',\n    name: 'test-input-name',\n    removedValue: OPTIONS[0],\n  });\n});\n\ntest('should call not call onChange on hitting backspace when backspaceRemovesValue is true and isMulti is true and there are no values', () => {\n  let onChangeSpy = jest.fn();\n  let { container } = render(\n    <Select\n      {...BASIC_PROPS}\n      backspaceRemovesValue\n      isClearable\n      isMulti\n      onChange={onChangeSpy}\n    />\n  );\n  fireEvent.keyDown(container.querySelector('.react-select__control')!, {\n    keyCode: 8,\n    key: 'Backspace',\n  });\n  expect(onChangeSpy).not.toHaveBeenCalled();\n});\n\ntest('multi select > clicking on X next to option will call onChange with all options other that the clicked option', () => {\n  let onChangeSpy = jest.fn();\n  let { container } = render(\n    <Select\n      {...BASIC_PROPS}\n      isMulti\n      onChange={onChangeSpy}\n      value={[OPTIONS[0], OPTIONS[2], OPTIONS[4]]}\n    />\n  );\n  // there are 3 values in select\n  expect(container.querySelectorAll('.react-select__multi-value').length).toBe(\n    3\n  );\n\n  const selectValueElement = [\n    ...container.querySelectorAll('.react-select__multi-value'),\n  ].find((multiValue) => multiValue.textContent === '4');\n  userEvent.click(\n    selectValueElement!.querySelector('div.react-select__multi-value__remove')!\n  );\n\n  expect(onChangeSpy).toHaveBeenCalledWith(\n    [\n      { label: '0', value: 'zero' },\n      { label: '2', value: 'two' },\n    ],\n    {\n      action: 'remove-value',\n      removedValue: { label: '4', value: 'four' },\n      name: BASIC_PROPS.name,\n    }\n  );\n});\n\ncases(\n  'accessibility > aria-activedescendant for basic options',\n  (props: BasicProps) => {\n    const renderProps = {\n      ...props,\n      instanceId: 1000,\n      value: BASIC_PROPS.options[2],\n      menuIsOpen: true,\n      hideSelectedOptions: false,\n    };\n\n    const { container, rerender } = render(<Select {...renderProps} />);\n\n    // aria-activedescendant should be set if menu is open initially and selected options are not hidden\n    expect(\n      container\n        .querySelector('input.react-select__input')!\n        .getAttribute('aria-activedescendant')\n    ).toBe('react-select-1000-option-2');\n\n    // aria-activedescendant is updated during keyboard navigation\n    fireEvent.keyDown(container.querySelector('.react-select__menu')!, {\n      keyCode: 40,\n      key: 'ArrowDown',\n    });\n\n    expect(\n      container\n        .querySelector('input.react-select__input')!\n        .getAttribute('aria-activedescendant')\n    ).toBe('react-select-1000-option-3');\n\n    fireEvent.keyDown(container.querySelector('.react-select__menu')!, {\n      keyCode: 38,\n      key: 'ArrowUp',\n    });\n\n    expect(\n      container\n        .querySelector('input.react-select__input')!\n        .getAttribute('aria-activedescendant')\n    ).toBe('react-select-1000-option-2');\n\n    fireEvent.keyDown(container.querySelector('.react-select__menu')!, {\n      keyCode: 36,\n      key: 'Home',\n    });\n\n    expect(\n      container\n        .querySelector('input.react-select__input')!\n        .getAttribute('aria-activedescendant')\n    ).toBe('react-select-1000-option-0');\n\n    fireEvent.keyDown(container.querySelector('.react-select__menu')!, {\n      keyCode: 35,\n      key: 'End',\n    });\n\n    expect(\n      container\n        .querySelector('input.react-select__input')!\n        .getAttribute('aria-activedescendant')\n    ).toBe('react-select-1000-option-16');\n\n    rerender(<Select {...renderProps} menuIsOpen={false} />);\n\n    expect(\n      container\n        .querySelector('input.react-select__input')!\n        .getAttribute('aria-activedescendant')\n    ).toBe('');\n\n    // searching should update activedescendant\n    rerender(<Select {...renderProps} isSearchable />);\n\n    const setInputValue = (val: string) => {\n      rerender(<Select {...renderProps} autoFocus inputValue={val} />);\n    };\n\n    setInputValue('four');\n\n    expect(\n      container\n        .querySelector('input.react-select__input')!\n        .getAttribute('aria-activedescendant')\n    ).toBe('react-select-1000-option-4');\n\n    setInputValue('fourt');\n\n    expect(\n      container\n        .querySelector('input.react-select__input')!\n        .getAttribute('aria-activedescendant')\n    ).toBe('react-select-1000-option-14');\n\n    setInputValue('fourt1');\n\n    expect(\n      container\n        .querySelector('input.react-select__input')!\n        .getAttribute('aria-activedescendant')\n    ).toBe('');\n  },\n  {\n    'single select > should update aria-activedescendant as per focused option':\n      {\n        ...BASIC_PROPS,\n      },\n    'multi select > should update aria-activedescendant as per focused option':\n      {\n        ...BASIC_PROPS,\n        isMulti: true,\n      },\n  }\n);\n\ncases(\n  'accessibility > aria-activedescendant for grouped options',\n  (props: BasicProps) => {\n    const renderProps = {\n      ...props,\n      instanceId: 1000,\n      options: OPTIONS_GROUPED,\n      value: OPTIONS_GROUPED[0].options[2],\n      menuIsOpen: true,\n      hideSelectedOptions: false,\n    };\n\n    let { container, rerender } = render(\n      <Select<OptionNumberValue | OptionBooleanValue, false, GroupedOption>\n        {...renderProps}\n      />\n    );\n\n    // aria-activedescendant should be set if menu is open initially and selected options are not hidden\n    expect(\n      container\n        .querySelector('input.react-select__input')!\n        .getAttribute('aria-activedescendant')\n    ).toBe('react-select-1000-option-0-2');\n\n    // aria-activedescendant is updated during keyboard navigation\n    fireEvent.keyDown(container.querySelector('.react-select__menu')!, {\n      keyCode: 40,\n      key: 'ArrowDown',\n    });\n\n    expect(\n      container\n        .querySelector('input.react-select__input')!\n        .getAttribute('aria-activedescendant')\n    ).toBe('react-select-1000-option-0-3');\n\n    fireEvent.keyDown(container.querySelector('.react-select__menu')!, {\n      keyCode: 38,\n      key: 'ArrowUp',\n    });\n\n    expect(\n      container\n        .querySelector('input.react-select__input')!\n        .getAttribute('aria-activedescendant')\n    ).toBe('react-select-1000-option-0-2');\n\n    fireEvent.keyDown(container.querySelector('.react-select__menu')!, {\n      keyCode: 36,\n      key: 'Home',\n    });\n\n    expect(\n      container\n        .querySelector('input.react-select__input')!\n        .getAttribute('aria-activedescendant')\n    ).toBe('react-select-1000-option-0-0');\n\n    fireEvent.keyDown(container.querySelector('.react-select__menu')!, {\n      keyCode: 35,\n      key: 'End',\n    });\n\n    expect(\n      container\n        .querySelector('input.react-select__input')!\n        .getAttribute('aria-activedescendant')\n    ).toBe('react-select-1000-option-1-1');\n\n    rerender(<Select {...renderProps} menuIsOpen={false} />);\n\n    expect(\n      container\n        .querySelector('input.react-select__input')!\n        .getAttribute('aria-activedescendant')\n    ).toBe('');\n\n    // searching should update activedescendant\n    rerender(<Select {...renderProps} isSearchable />);\n\n    const setInputValue = (val: string) => {\n      rerender(<Select {...renderProps} autoFocus inputValue={val} />);\n    };\n\n    setInputValue('1');\n\n    expect(\n      container\n        .querySelector('input.react-select__input')!\n        .getAttribute('aria-activedescendant')\n    ).toBe('react-select-1000-option-0-1');\n\n    setInputValue('10');\n\n    expect(\n      container\n        .querySelector('input.react-select__input')!\n        .getAttribute('aria-activedescendant')\n    ).toBe('react-select-1000-option-0-10');\n\n    setInputValue('102');\n\n    expect(\n      container\n        .querySelector('input.react-select__input')!\n        .getAttribute('aria-activedescendant')\n    ).toBe('');\n  },\n  {\n    'single select > should update aria-activedescendant as per focused option':\n      {\n        ...BASIC_PROPS,\n      },\n    'multi select > should update aria-activedescendant as per focused option':\n      {\n        ...BASIC_PROPS,\n        isMulti: true,\n      },\n  }\n);\n\ntest('accessibility > aria-activedescendant should not exist if hideSelectedOptions=true', () => {\n  const { container } = render(\n    <Select\n      {...BASIC_PROPS}\n      instanceId=\"1000\"\n      value={BASIC_PROPS.options[2]}\n      isMulti\n      menuIsOpen\n    />\n  );\n\n  expect(\n    container\n      .querySelector('input.react-select__input')!\n      .getAttribute('aria-activedescendant')\n  ).toBe('');\n});\n\ncases(\n  'accessibility > passes through aria-labelledby prop',\n  ({ props = { ...BASIC_PROPS, 'aria-labelledby': 'testing' } }) => {\n    let { container } = render(<Select {...props} />);\n    expect(\n      container\n        .querySelector('input.react-select__input')!\n        .getAttribute('aria-labelledby')\n    ).toBe('testing');\n  },\n  {\n    'single select > should pass aria-labelledby prop down to input': {},\n    'multi select > should pass aria-labelledby prop down to input': {\n      props: {\n        ...BASIC_PROPS,\n        'aria-labelledby': 'testing',\n        isMulti: true,\n      },\n    },\n  }\n);\n\ncases(\n  'accessibility > passes through aria-errormessage prop',\n  ({ props = { ...BASIC_PROPS, 'aria-errormessage': 'error-message' } }) => {\n    let { container } = render(<Select {...props} />);\n    expect(\n      container\n        .querySelector('input.react-select__input')!\n        .getAttribute('aria-errormessage')\n    ).toBe('error-message');\n  },\n  {\n    'single select > should pass aria-errormessage prop down to input': {},\n    'multi select > should pass aria-errormessage prop down to input': {\n      props: {\n        ...BASIC_PROPS,\n        'aria-errormessage': 'error-message',\n        isMulti: true,\n      },\n    },\n  }\n);\n\ncases(\n  'accessibility > passes through aria-invalid prop',\n  ({ props = { ...BASIC_PROPS, 'aria-invalid': true } }) => {\n    let { container } = render(<Select {...props} />);\n    expect(\n      container\n        .querySelector('input.react-select__input')!\n        .getAttribute('aria-invalid')\n    ).toBe('true');\n  },\n  {\n    'single select > should pass aria-invalid prop down to input': {},\n    'multi select > should pass aria-invalid prop down to input': {\n      props: {\n        ...BASIC_PROPS,\n        'aria-invalid': true,\n        isMulti: true,\n      },\n    },\n  }\n);\n\ncases(\n  'accessibility > passes through aria-label prop',\n  ({ props = { ...BASIC_PROPS, 'aria-label': 'testing' } }) => {\n    let { container } = render(<Select {...props} />);\n    expect(\n      container\n        .querySelector('input.react-select__input')!\n        .getAttribute('aria-label')\n    ).toBe('testing');\n  },\n  {\n    'single select > should pass aria-labelledby prop down to input': {},\n    'multi select > should pass aria-labelledby prop down to input': {\n      props: {\n        ...BASIC_PROPS,\n        'aria-label': 'testing',\n        isMulti: true,\n      },\n    },\n  }\n);\n\ntest('accessibility > to show the number of options available in A11yText when the menu is Open', () => {\n  let { container, rerender } = render(\n    <Select {...BASIC_PROPS} inputValue={''} autoFocus menuIsOpen />\n  );\n\n  let setInputValue = (val: string) => {\n    rerender(<Select {...BASIC_PROPS} autoFocus menuIsOpen inputValue={val} />);\n  };\n\n  const liveRegionResultsId = '#aria-results';\n  fireEvent.focus(container.querySelector('input.react-select__input')!);\n\n  expect(container.querySelector(liveRegionResultsId)!.textContent).toMatch(\n    /17 results available/\n  );\n\n  setInputValue('0');\n  expect(container.querySelector(liveRegionResultsId)!.textContent).toMatch(\n    /2 results available/\n  );\n\n  setInputValue('10');\n  expect(container.querySelector(liveRegionResultsId)!.textContent).toMatch(\n    /1 result available/\n  );\n\n  setInputValue('100');\n  expect(container.querySelector(liveRegionResultsId)!.textContent).toMatch(\n    /0 results available/\n  );\n});\n\ntest('accessibility > interacting with disabled options shows correct A11yText', () => {\n  let { container } = render(\n    <Select\n      {...BASIC_PROPS}\n      options={OPTIONS_DISABLED}\n      inputValue={''}\n      menuIsOpen\n    />\n  );\n  const liveRegionEventId = '#aria-selection';\n  fireEvent.focus(container.querySelector('input.react-select__input')!);\n\n  // navigate to disabled option\n  let menu = container.querySelector('.react-select__menu');\n  fireEvent.keyDown(menu!, { keyCode: 40, key: 'ArrowDown' });\n  fireEvent.keyDown(menu!, { keyCode: 40, key: 'ArrowDown' });\n\n  // attempt to select disabled option\n  fireEvent.keyDown(container.querySelector('.react-select__menu')!, {\n    keyCode: 13,\n    key: 'Enter',\n  });\n\n  expect(container.querySelector(liveRegionEventId)!.textContent).toMatch(\n    'option 1 is disabled. Select another option.'\n  );\n});\n\ntest('accessibility > interacting with multi values options shows correct A11yText', () => {\n  let renderProps = {\n    ...BASIC_PROPS,\n    options: OPTIONS_DISABLED,\n    isMulti: true,\n    value: [OPTIONS_DISABLED[0], OPTIONS_DISABLED[1]],\n    hideSelectedOptions: false,\n  };\n\n  let { container, rerender } = render(<Select {...renderProps} />);\n\n  let openMenu = () => {\n    rerender(<Select {...renderProps} menuIsOpen />);\n  };\n\n  const liveRegionGuidanceId = '#aria-guidance';\n  const liveRegionFocusedId = '#aria-focused';\n  let input = container.querySelector('.react-select__value-container input')!;\n\n  fireEvent.focus(container.querySelector('input.react-select__input')!);\n\n  expect(container.querySelector(liveRegionGuidanceId)!.textContent).toMatch(\n    'Select is focused ,type to refine list, press Down to open the menu,  press left to focus selected values'\n  );\n\n  fireEvent.keyDown(input, { keyCode: 37, key: 'ArrowLeft' });\n  expect(container.querySelector(liveRegionFocusedId)!.textContent).toMatch(\n    'value 1 focused, 2 of 2.'\n  );\n  expect(container.querySelector(liveRegionGuidanceId)!.textContent).toMatch(\n    'Use left and right to toggle between focused values, press Backspace to remove the currently focused value'\n  );\n\n  fireEvent.keyDown(input, { keyCode: 37, key: 'ArrowLeft' });\n  expect(container.querySelector(liveRegionFocusedId)!.textContent).toMatch(\n    'value 0 focused, 1 of 2.'\n  );\n  expect(container.querySelector(liveRegionGuidanceId)!.textContent).toMatch(\n    'Use left and right to toggle between focused values, press Backspace to remove the currently focused value'\n  );\n\n  openMenu();\n\n  // user will be notified if option is disabled by screen reader because of correct aria-attributes, so this message will be announce only once after menu opens\n  expect(container.querySelector(liveRegionGuidanceId)!.textContent).toMatch(\n    'Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu, press Tab to select the option and exit the menu.'\n  );\n});\n\ntest('accessibility > screenReaderStatus function prop > to pass custom text to A11yText', () => {\n  const screenReaderStatus = ({ count }: { count: number }) =>\n    `There are ${count} options available`;\n\n  const liveRegionResultsId = '#aria-results';\n  let { container, rerender } = render(\n    <Select\n      {...BASIC_PROPS}\n      inputValue={''}\n      screenReaderStatus={screenReaderStatus}\n      menuIsOpen\n    />\n  );\n\n  let setInputValue = (val: string) => {\n    rerender(\n      <Select\n        {...BASIC_PROPS}\n        screenReaderStatus={screenReaderStatus}\n        menuIsOpen\n        inputValue={val}\n      />\n    );\n  };\n\n  fireEvent.focus(container.querySelector('input.react-select__input')!);\n\n  expect(container.querySelector(liveRegionResultsId)!.textContent).toMatch(\n    'There are 17 options available'\n  );\n\n  setInputValue('0');\n  expect(container.querySelector(liveRegionResultsId)!.textContent).toMatch(\n    'There are 2 options available'\n  );\n\n  setInputValue('10');\n  expect(container.querySelector(liveRegionResultsId)!.textContent).toMatch(\n    'There are 1 options available'\n  );\n\n  setInputValue('100');\n  expect(container.querySelector(liveRegionResultsId)!.textContent).toMatch(\n    'There are 0 options available'\n  );\n});\n\ntest('accessibility > A11yTexts can be provided through ariaLiveMessages prop', () => {\n  const ariaLiveMessages: AriaLiveMessages<Option, boolean, GroupBase<Option>> =\n    {\n      onChange: (props) => {\n        const { action, isDisabled, label } = props;\n        if (action === 'select-option' && !isDisabled) {\n          return `CUSTOM: option ${label} is selected.`;\n        }\n        return '';\n      },\n    };\n\n  let { container } = render(\n    <Select\n      {...BASIC_PROPS}\n      ariaLiveMessages={ariaLiveMessages}\n      options={OPTIONS}\n      inputValue={''}\n      menuIsOpen\n    />\n  );\n  const liveRegionEventId = '#aria-selection';\n\n  expect(container.querySelector(liveRegionEventId)!).toBeNull();\n\n  fireEvent.focus(container.querySelector('input.react-select__input')!);\n\n  let menu = container.querySelector('.react-select__menu')!;\n  fireEvent.keyDown(menu, { keyCode: 40, key: 'ArrowDown' });\n  fireEvent.keyDown(container.querySelector('.react-select__menu')!, {\n    keyCode: 13,\n    key: 'Enter',\n  });\n\n  expect(container.querySelector(liveRegionEventId)!.textContent).toMatch(\n    'CUSTOM: option 0 is selected.'\n  );\n});\n\ntest('accessibility > announces already selected values when focused', () => {\n  let { container } = render(\n    <Select {...BASIC_PROPS} options={OPTIONS} value={OPTIONS[0]} />\n  );\n  const liveRegionSelectionId = '#aria-selection';\n  const liveRegionContextId = '#aria-guidance';\n\n  // the live region should not be mounted yet\n  expect(container.querySelector(liveRegionSelectionId)!).toBeNull();\n\n  fireEvent.focus(container.querySelector('input.react-select__input')!);\n\n  expect(container.querySelector(liveRegionContextId)!.textContent).toMatch(\n    'Select is focused ,type to refine list, press Down to open the menu, '\n  );\n  expect(container.querySelector(liveRegionSelectionId)!.textContent).toMatch(\n    'option 0, selected.'\n  );\n});\n\ntest('accessibility > announces cleared values', () => {\n  let { container } = render(\n    <Select {...BASIC_PROPS} options={OPTIONS} value={OPTIONS[0]} isClearable />\n  );\n  const liveRegionSelectionId = '#aria-selection';\n  /**\n   * announce deselected value\n   */\n  fireEvent.focus(container.querySelector('input.react-select__input')!);\n  fireEvent.mouseDown(\n    container.querySelector('.react-select__clear-indicator')!\n  );\n  expect(container.querySelector(liveRegionSelectionId)!.textContent).toMatch(\n    'All selected options have been cleared.'\n  );\n});\n\ntest('closeMenuOnSelect prop > when passed as false it should not call onMenuClose on selecting option', () => {\n  let onMenuCloseSpy = jest.fn();\n  let { container } = render(\n    <Select\n      {...BASIC_PROPS}\n      onMenuClose={onMenuCloseSpy}\n      menuIsOpen\n      closeMenuOnSelect={false}\n      blurInputOnSelect={false}\n    />\n  );\n  userEvent.click(container.querySelector('div.react-select__option')!);\n  expect(onMenuCloseSpy).not.toHaveBeenCalled();\n});\n\ncases(\n  'autoFocus',\n  ({ props = { ...BASIC_PROPS, autoFocus: true } }) => {\n    let { container } = render(<Select {...props} />);\n    expect(container.querySelector('input.react-select__input')).toBe(\n      document.activeElement\n    );\n  },\n  {\n    'single select > should focus select on mount': {},\n    'multi select > should focus select on mount': {\n      props: {\n        ...BASIC_PROPS,\n        isMulti: true,\n        autoFocus: true,\n      },\n    },\n  }\n);\n\ncases(\n  'onFocus prop with autoFocus',\n  ({ props = { ...BASIC_PROPS, autoFocus: true } }) => {\n    let onFocusSpy = jest.fn();\n    let { container } = render(<Select {...props} onFocus={onFocusSpy} />);\n    expect(container.querySelector('input.react-select__input')).toBe(\n      document.activeElement\n    );\n    expect(onFocusSpy).toHaveBeenCalledTimes(1);\n  },\n  {\n    'single select > should call auto focus only once when select is autoFocus':\n      {\n        props: {\n          ...BASIC_PROPS,\n          autoFocus: true,\n        },\n      },\n    'multi select > should call auto focus only once when select is autoFocus':\n      {\n        props: {\n          ...BASIC_PROPS,\n          autoFocus: true,\n          isMulti: true,\n        },\n      },\n  }\n);\n\ncases(\n  'onFocus prop is called on on focus of input',\n  ({ props = { ...BASIC_PROPS } }) => {\n    let onFocusSpy = jest.fn();\n    let { container } = render(<Select {...props} onFocus={onFocusSpy} />);\n    fireEvent.focus(container.querySelector('input.react-select__input')!);\n    expect(onFocusSpy).toHaveBeenCalledTimes(1);\n  },\n  {\n    'single select > should call onFocus handler on focus on input': {},\n    'multi select > should call onFocus handler on focus on input': {\n      props: {\n        ...BASIC_PROPS,\n        isMulti: true,\n      },\n    },\n  }\n);\n\ncases(\n  'onBlur prop',\n  ({ props = { ...BASIC_PROPS } }) => {\n    let onBlurSpy = jest.fn();\n    let { container } = render(\n      <Select\n        {...props}\n        onBlur={onBlurSpy}\n        onInputChange={jest.fn()}\n        onMenuClose={jest.fn()}\n      />\n    );\n    fireEvent.blur(container.querySelector('input.react-select__input')!);\n    expect(onBlurSpy).toHaveBeenCalledTimes(1);\n  },\n  {\n    'single select > should call onBlur handler on blur on input': {},\n    'multi select > should call onBlur handler on blur on input': {\n      props: {\n        ...BASIC_PROPS,\n        isMulti: true,\n      },\n    },\n  }\n);\n\ntest('onInputChange() function prop to be called on blur', () => {\n  let onInputChangeSpy = jest.fn();\n  let { container } = render(\n    <Select\n      {...BASIC_PROPS}\n      onBlur={jest.fn()}\n      onInputChange={onInputChangeSpy}\n      onMenuClose={jest.fn()}\n    />\n  );\n  fireEvent.blur(container.querySelector('input.react-select__input')!);\n  // Once by blur and other time by menu-close\n  expect(onInputChangeSpy).toHaveBeenCalledTimes(2);\n});\n\ntest('onMenuClose() function prop to be called on blur', () => {\n  let onMenuCloseSpy = jest.fn();\n  let { container } = render(\n    <Select\n      {...BASIC_PROPS}\n      onBlur={jest.fn()}\n      onInputChange={jest.fn()}\n      onMenuClose={onMenuCloseSpy}\n    />\n  );\n  fireEvent.blur(container.querySelector('input.react-select__input')!);\n  expect(onMenuCloseSpy).toHaveBeenCalledTimes(1);\n});\n\ncases(\n  'placeholder',\n  ({ props, expectPlaceholder = 'Select...' }) => {\n    let { container } = render(<Select {...props} />);\n    expect(container.querySelector('.react-select__control')!.textContent).toBe(\n      expectPlaceholder\n    );\n  },\n  {\n    'single select > should display default placeholder \"Select...\"': {\n      props: BASIC_PROPS,\n    },\n    'single select > should display provided string placeholder': {\n      props: {\n        ...BASIC_PROPS,\n        placeholder: 'single Select...',\n      },\n      expectPlaceholder: 'single Select...',\n    },\n    'single select > should display provided node placeholder': {\n      props: {\n        ...BASIC_PROPS,\n        placeholder: <span>single Select...</span>,\n      },\n      expectPlaceholder: 'single Select...',\n    },\n    'multi select > should display default placeholder \"Select...\"': {\n      props: {\n        ...BASIC_PROPS,\n        isMulti: true,\n      },\n    },\n    'multi select > should display provided placeholder': {\n      props: {\n        ...BASIC_PROPS,\n        isMulti: true,\n        placeholder: 'multi Select...',\n      },\n      expectPlaceholder: 'multi Select...',\n    },\n  }\n);\n\ncases(\n  'display placeholder once value is removed',\n  ({ props }) => {\n    let { container, rerender } = render(<Select {...props} />);\n    expect(\n      container.querySelector('.react-select__placeholder')\n    ).not.toBeInTheDocument();\n    rerender(<Select {...props} value={null} />);\n    expect(\n      container.querySelector('.react-select__placeholder')\n    ).toBeInTheDocument();\n  },\n  {\n    'single select > should display placeholder once the value is removed from select':\n      {\n        props: {\n          ...BASIC_PROPS,\n          value: OPTIONS[0],\n        },\n      },\n    'multi select > should display placeholder once the value is removed from select':\n      {\n        props: {\n          ...BASIC_PROPS,\n          value: OPTIONS[0],\n        },\n      },\n  }\n);\n\ntest('sets inputMode=\"none\" when isSearchable is false', () => {\n  let { container } = render(\n    <Select\n      classNamePrefix=\"react-select\"\n      options={OPTIONS}\n      isSearchable={false}\n      onChange={noop}\n      onInputChange={noop}\n      onMenuOpen={noop}\n      onMenuClose={noop}\n      inputValue=\"\"\n      value={null}\n    />\n  );\n  let input = container.querySelector<HTMLInputElement>(\n    '.react-select__value-container input'\n  );\n  expect(input!.inputMode).toBe('none');\n  expect(\n    window.getComputedStyle(input!).getPropertyValue('caret-color')\n  ).toEqual('transparent');\n});\n\ncases(\n  'clicking on disabled option',\n  ({ props = BASIC_PROPS, optionsSelected }) => {\n    let onChangeSpy = jest.fn();\n    props = { ...props, onChange: onChangeSpy };\n    let { container } = render(<Select {...props} menuIsOpen />);\n    let selectOption = [\n      ...container.querySelectorAll('div.react-select__option'),\n    ].find((n) => n.textContent === optionsSelected);\n    userEvent.click(selectOption!);\n    expect(onChangeSpy).not.toHaveBeenCalled();\n  },\n  {\n    'single select > should not select the disabled option': {\n      props: {\n        ...BASIC_PROPS,\n        options: [\n          { label: 'option 1', value: 'opt1' },\n          { label: 'option 2', value: 'opt2', isDisabled: true },\n        ],\n      },\n      optionsSelected: 'option 2',\n    },\n    'multi select > should not select the disabled option': {\n      props: {\n        ...BASIC_PROPS,\n        options: [\n          { label: 'option 1', value: 'opt1' },\n          { label: 'option 2', value: 'opt2', isDisabled: true },\n        ],\n      },\n      optionsSelected: 'option 2',\n    },\n  }\n);\n\ncases(\n  'pressing enter on disabled option',\n  ({ props = BASIC_PROPS, optionsSelected }) => {\n    let onChangeSpy = jest.fn();\n    props = { ...props, onChange: onChangeSpy };\n    let { container } = render(<Select {...props} menuIsOpen />);\n    let selectOption = [\n      ...container.querySelectorAll('div.react-select__option'),\n    ].find((n) => n.textContent === optionsSelected);\n    fireEvent.keyDown(selectOption!, { keyCode: 13, key: 'Enter' });\n    expect(onChangeSpy).not.toHaveBeenCalled();\n  },\n  {\n    'single select > should not select the disabled option': {\n      props: {\n        ...BASIC_PROPS,\n        options: [\n          { label: 'option 1', value: 'opt1' },\n          { label: 'option 2', value: 'opt2', isDisabled: true },\n        ],\n      },\n      optionsSelected: 'option 2',\n    },\n    'multi select > should not select the disabled option': {\n      props: {\n        ...BASIC_PROPS,\n        options: [\n          { label: 'option 1', value: 'opt1' },\n          { label: 'option 2', value: 'opt2', isDisabled: true },\n        ],\n      },\n      optionsSelected: 'option 2',\n    },\n  }\n);\n\ntest('does not select anything when a disabled option is the only item in the list after a search', () => {\n  let onChangeSpy = jest.fn();\n  const options = [\n    { label: 'opt', value: 'opt1', isDisabled: true },\n    ...OPTIONS,\n  ];\n  const props = { ...BASIC_PROPS, onChange: onChangeSpy, options };\n  let { container, rerender } = render(\n    <Select {...props} menuIsOpen inputValue=\"\" />\n  );\n  rerender(<Select {...props} menuIsOpen inputValue=\"opt\" />);\n\n  fireEvent.keyDown(container.querySelector('.react-select__menu')!, {\n    keyCode: 13,\n    key: 'Enter',\n  });\n\n  expect(onChangeSpy).not.toHaveBeenCalled();\n  // Menu is still open\n  expect(container.querySelector('.react-select__option')!.textContent).toBe(\n    'opt'\n  );\n});\n\ntest('render custom Input Component', () => {\n  const InputComponent = () => <div className=\"my-input-component\" />;\n  let { container } = render(\n    <Select {...BASIC_PROPS} components={{ Input: InputComponent }} />\n  );\n\n  expect(\n    container.querySelector('input.react-select__input')\n  ).not.toBeInTheDocument();\n  expect(container.querySelector('.my-input-component')).toBeInTheDocument();\n});\n\ntest('render custom Menu Component', () => {\n  const MenuComponent = () => <div className=\"my-menu-component\" />;\n  let { container } = render(\n    <Select {...BASIC_PROPS} menuIsOpen components={{ Menu: MenuComponent }} />\n  );\n\n  expect(\n    container.querySelector('.react-select__menu')\n  ).not.toBeInTheDocument();\n  expect(container.querySelector('.my-menu-component')).toBeInTheDocument();\n});\n\ntest('render custom Option Component', () => {\n  const OptionComponent = () => <div className=\"my-option-component\" />;\n  let { container } = render(\n    <Select\n      {...BASIC_PROPS}\n      components={{ Option: OptionComponent }}\n      menuIsOpen\n    />\n  );\n\n  expect(\n    container.querySelector('.react-select__option')\n  ).not.toBeInTheDocument();\n  expect(container.querySelector('.my-option-component')).toBeInTheDocument();\n});\n\ncases(\n  'isClearable is false',\n  ({ props = BASIC_PROPS }) => {\n    let { container } = render(<Select {...props} />);\n    expect(\n      container.querySelector('react-select__clear-indicator')\n    ).not.toBeInTheDocument();\n  },\n  {\n    'single select > should not show the X (clear) button': {\n      props: {\n        ...BASIC_PROPS,\n        isClearable: false,\n        value: OPTIONS[0],\n      },\n    },\n    'multi select > should not show X (clear) button': {\n      ...BASIC_PROPS,\n      isMulti: true,\n      isClearable: false,\n      value: [OPTIONS[0]],\n    },\n  }\n);\n\ntest('clear select by clicking on clear button > should not call onMenuOpen', () => {\n  let onChangeSpy = jest.fn();\n  let props = { ...BASIC_PROPS, onChange: onChangeSpy };\n  let { container } = render(\n    <Select {...props} isMulti value={[OPTIONS[0]]} />\n  );\n\n  expect(container.querySelectorAll('.react-select__multi-value').length).toBe(\n    1\n  );\n  fireEvent.mouseDown(\n    container.querySelector('.react-select__clear-indicator')!,\n    { button: 0 }\n  );\n  expect(onChangeSpy).toBeCalledWith([], {\n    action: 'clear',\n    name: BASIC_PROPS.name,\n    removedValues: [{ label: '0', value: 'zero' }],\n  });\n});\n\ntest('clearing select using clear button to not call onMenuOpen or onMenuClose', () => {\n  let onMenuCloseSpy = jest.fn();\n  let onMenuOpenSpy = jest.fn();\n  let props = {\n    ...BASIC_PROPS,\n    onMenuClose: onMenuCloseSpy,\n    onMenuOpen: onMenuOpenSpy,\n  };\n  let { container } = render(\n    <Select {...props} isMulti value={[OPTIONS[0]]} />\n  );\n  expect(container.querySelectorAll('.react-select__multi-value').length).toBe(\n    1\n  );\n  fireEvent.mouseDown(\n    container.querySelector('.react-select__clear-indicator')!,\n    { button: 0 }\n  );\n  expect(onMenuOpenSpy).not.toHaveBeenCalled();\n  expect(onMenuCloseSpy).not.toHaveBeenCalled();\n});\n\ntest('multi select >  calls onChange when option is selected and isSearchable is false', () => {\n  let onChangeSpy = jest.fn();\n  let props = { ...BASIC_PROPS, onChange: onChangeSpy };\n  let { container } = render(\n    <Select {...props} isMulti menuIsOpen delimiter=\",\" isSearchable={false} />\n  );\n  userEvent.click(container.querySelector('.react-select__option')!);\n  const selectedOption = { label: '0', value: 'zero' };\n  expect(onChangeSpy).toHaveBeenCalledWith([selectedOption], {\n    action: 'select-option',\n    option: selectedOption,\n    name: BASIC_PROPS.name,\n  });\n});\n\ntest('getOptionLabel() prop > to format the option label', () => {\n  const getOptionLabel = (option: Option) =>\n    `This a custom option ${option.label} label`;\n  const { container } = render(\n    <Select {...BASIC_PROPS} menuIsOpen getOptionLabel={getOptionLabel} />\n  );\n  expect(container.querySelector('.react-select__option')!.textContent).toBe(\n    'This a custom option 0 label'\n  );\n});\n\ntest('formatGroupLabel function prop > to format Group label', () => {\n  const formatGroupLabel = (group: Group) =>\n    `This is custom ${group.label} header`;\n  interface GroupOption {\n    readonly value: number;\n    readonly label: string;\n  }\n  interface Group {\n    readonly label: string;\n    readonly options: readonly GroupOption[];\n  }\n  const options = [\n    {\n      label: 'group 1',\n      options: [\n        { value: 1, label: '1' },\n        { value: 2, label: '2' },\n      ],\n    },\n  ];\n  const { container } = render(\n    <Select<GroupOption, false, Group>\n      classNamePrefix=\"react-select\"\n      options={options}\n      menuIsOpen\n      formatGroupLabel={formatGroupLabel}\n      onChange={noop}\n      onInputChange={noop}\n      onMenuOpen={noop}\n      onMenuClose={noop}\n      inputValue=\"\"\n      value={null}\n    />\n  );\n  expect(\n    container.querySelector('.react-select__group-heading')!.textContent\n  ).toBe('This is custom group 1 header');\n});\n\ntest('to only render groups with at least one match when filtering', () => {\n  const options = [\n    {\n      label: 'group 1',\n      options: [\n        { value: 1, label: '1' },\n        { value: 2, label: '2' },\n      ],\n    },\n    {\n      label: 'group 2',\n      options: [\n        { value: 3, label: '3' },\n        { value: 4, label: '4' },\n      ],\n    },\n  ];\n  const { container } = render(\n    <Select\n      classNamePrefix=\"react-select\"\n      options={options}\n      menuIsOpen\n      inputValue=\"1\"\n      onChange={noop}\n      onInputChange={noop}\n      onMenuOpen={noop}\n      onMenuClose={noop}\n      value={null}\n    />\n  );\n\n  expect(container.querySelectorAll('.react-select__group').length).toBe(1);\n  expect(\n    container\n      .querySelector('.react-select__group')!\n      .querySelectorAll('.react-select__option').length\n  ).toBe(1);\n});\n\ntest('not render any groups when there is not a single match when filtering', () => {\n  const options = [\n    {\n      label: 'group 1',\n      options: [\n        { value: 1, label: '1' },\n        { value: 2, label: '2' },\n      ],\n    },\n    {\n      label: 'group 2',\n      options: [\n        { value: 3, label: '3' },\n        { value: 4, label: '4' },\n      ],\n    },\n  ];\n  const { container } = render(\n    <Select\n      classNamePrefix=\"react-select\"\n      options={options}\n      menuIsOpen\n      inputValue=\"5\"\n      onChange={noop}\n      onInputChange={noop}\n      onMenuOpen={noop}\n      onMenuClose={noop}\n      value={null}\n    />\n  );\n\n  expect(container.querySelectorAll('.react-select__group').length).toBe(0);\n});\n\ntest('multi select > have default value delimiter seperated', () => {\n  let { container } = render(\n    <Select\n      {...BASIC_PROPS}\n      delimiter={';'}\n      isMulti\n      value={[OPTIONS[0], OPTIONS[1]]}\n    />\n  );\n  expect(\n    container.querySelector<HTMLInputElement>('input[type=\"hidden\"]')!.value\n  ).toBe('zero;one');\n});\n\ntest('multi select > with multi character delimiter', () => {\n  let { container } = render(\n    <Select\n      {...BASIC_PROPS}\n      delimiter={'===&==='}\n      isMulti\n      value={[OPTIONS[0], OPTIONS[1]]}\n    />\n  );\n  expect(\n    container.querySelector<HTMLInputElement>('input[type=\"hidden\"]')!.value\n  ).toBe('zero===&===one');\n});\n\ntest('hitting spacebar should select option if isSearchable is false', () => {\n  let onChangeSpy = jest.fn();\n  let props = { ...BASIC_PROPS, onChange: onChangeSpy };\n  let { container } = render(<Select {...props} isSearchable menuIsOpen />);\n  // focus the first option\n  fireEvent.keyDown(container.querySelector('.react-select__menu')!, {\n    keyCode: 40,\n    key: 'ArrowDown',\n  });\n  fireEvent.keyDown(container.querySelector('.react-select')!, {\n    keyCode: 32,\n    key: ' ',\n  });\n  expect(onChangeSpy).toHaveBeenCalledWith(\n    { label: '0', value: 'zero' },\n    { action: 'select-option', name: BASIC_PROPS.name }\n  );\n});\n\ntest('hitting escape does not call onChange if menu is Open', () => {\n  let onChangeSpy = jest.fn();\n  let props = { ...BASIC_PROPS, onChange: onChangeSpy };\n  let { container } = render(\n    <Select {...props} menuIsOpen escapeClearsValue isClearable />\n  );\n\n  // focus the first option\n  fireEvent.keyDown(container.querySelector('.react-select__menu')!, {\n    keyCode: 40,\n    key: 'ArrowDown',\n  });\n  expect(onChangeSpy).not.toHaveBeenCalled();\n});\n\ntest('multi select > removes the selected option from the menu options when isSearchable is false', () => {\n  let { container, rerender } = render(\n    <Select\n      {...BASIC_PROPS}\n      delimiter=\",\"\n      isMulti\n      isSearchable={false}\n      menuIsOpen\n    />\n  );\n  expect(container.querySelectorAll('.react-select__option').length).toBe(17);\n  rerender(\n    <Select\n      {...BASIC_PROPS}\n      delimiter=\",\"\n      isMulti\n      isSearchable={false}\n      menuIsOpen\n      value={OPTIONS[0]}\n    />\n  );\n  // expect '0' to not be options\n  container.querySelectorAll('.react-select__option').forEach((option) => {\n    expect(option.textContent).not.toBe('0');\n  });\n  expect(container.querySelectorAll('.react-select__option').length).toBe(16);\n});\n\ntest('hitting ArrowUp key on closed select should focus last element', () => {\n  let { container } = render(<Select {...BASIC_PROPS} menuIsOpen />);\n\n  fireEvent.keyDown(container.querySelector('.react-select__control')!, {\n    keyCode: 38,\n    key: 'ArrowUp',\n  });\n\n  expect(\n    container.querySelector('.react-select__option--is-focused')!.textContent\n  ).toEqual('16');\n});\n\ntest('close menu on hitting escape and clear input value if menu is open even if escapeClearsValue and isClearable are true', () => {\n  let onMenuCloseSpy = jest.fn();\n  let onInputChangeSpy = jest.fn();\n  let props = {\n    ...BASIC_PROPS,\n    onInputChange: onInputChangeSpy,\n    onMenuClose: onMenuCloseSpy,\n    value: OPTIONS[0],\n  };\n  let { container } = render(\n    <Select {...props} menuIsOpen escapeClearsValue isClearable />\n  );\n  fireEvent.keyDown(container.querySelector('.react-select')!, {\n    keyCode: 27,\n    key: 'Escape',\n  });\n  expect(\n    container.querySelector('.react-select__single-value')!.textContent\n  ).toEqual('0');\n\n  expect(onMenuCloseSpy).toHaveBeenCalled();\n  // once by onMenuClose and other is direct\n  expect(onInputChangeSpy).toHaveBeenCalledTimes(2);\n  expect(onInputChangeSpy).toHaveBeenCalledWith('', {\n    action: 'menu-close',\n    prevInputValue: '',\n  });\n  expect(onInputChangeSpy).toHaveBeenLastCalledWith('', {\n    action: 'menu-close',\n    prevInputValue: '',\n  });\n});\n\ntest('to not clear value when hitting escape if escapeClearsValue is false (default) and isClearable is false', () => {\n  let onChangeSpy = jest.fn();\n  let props = { ...BASIC_PROPS, onChange: onChangeSpy, value: OPTIONS[0] };\n  let { container } = render(\n    <Select {...props} escapeClearsValue isClearable={false} />\n  );\n\n  fireEvent.keyDown(container.querySelector('.react-select')!, {\n    keyCode: 27,\n    key: 'Escape',\n  });\n  expect(onChangeSpy).not.toHaveBeenCalled();\n});\n\ntest('to not clear value when hitting escape if escapeClearsValue is true and isClearable is false', () => {\n  let onChangeSpy = jest.fn();\n  let props = { ...BASIC_PROPS, onChange: onChangeSpy, value: OPTIONS[0] };\n  let { container } = render(\n    <Select {...props} escapeClearsValue isClearable={false} />\n  );\n\n  fireEvent.keyDown(container.querySelector('.react-select')!, {\n    keyCode: 27,\n    key: 'Escape',\n  });\n  expect(onChangeSpy).not.toHaveBeenCalled();\n});\n\ntest('to not clear value when hitting escape if escapeClearsValue is false (default) and isClearable is true', () => {\n  let onChangeSpy = jest.fn();\n  let props = { ...BASIC_PROPS, onChange: onChangeSpy, value: OPTIONS[0] };\n  let { container } = render(<Select {...props} isClearable />);\n\n  fireEvent.keyDown(container.querySelector('.react-select')!, {\n    keyCode: 27,\n    key: 'Escape',\n  });\n  expect(onChangeSpy).not.toHaveBeenCalled();\n});\n\ntest('to clear value when hitting escape if escapeClearsValue and isClearable are true', () => {\n  let onInputChangeSpy = jest.fn();\n  let props = { ...BASIC_PROPS, onChange: onInputChangeSpy, value: OPTIONS[0] };\n  let { container } = render(\n    <Select {...props} isClearable escapeClearsValue />\n  );\n\n  fireEvent.keyDown(container.querySelector('.react-select')!, {\n    keyCode: 27,\n    key: 'Escape',\n  });\n  expect(onInputChangeSpy).toHaveBeenCalledWith(null, {\n    action: 'clear',\n    name: BASIC_PROPS.name,\n    removedValues: [{ label: '0', value: 'zero' }],\n  });\n});\n\ntest('hitting spacebar should not select option if isSearchable is true (default)', () => {\n  let onChangeSpy = jest.fn();\n  let props = { ...BASIC_PROPS, onChange: onChangeSpy };\n  let { container } = render(<Select {...props} menuIsOpen />);\n  // Open Menu\n  fireEvent.keyDown(container, { keyCode: 32, key: ' ' });\n  expect(onChangeSpy).not.toHaveBeenCalled();\n});\n\ntest('renders with custom theme', () => {\n  const primary = 'rgb(255, 164, 83)';\n  const { container } = render(\n    <Select\n      {...BASIC_PROPS}\n      value={OPTIONS[0]}\n      menuIsOpen\n      theme={(theme) => ({\n        ...theme,\n        borderRadius: 180,\n        colors: {\n          ...theme.colors,\n          primary,\n        },\n      })}\n    />\n  );\n  const menu = container.querySelector('.react-select__menu');\n  expect(\n    window.getComputedStyle(menu!).getPropertyValue('border-radius')\n  ).toEqual('180px');\n  const firstOption = container.querySelector('.react-select__option');\n  expect(\n    window.getComputedStyle(firstOption!).getPropertyValue('background-color')\n  ).toEqual(primary);\n});\n\ncases(\n  '`required` prop',\n  ({ props = BASIC_PROPS }) => {\n    const components = (value: Option | null | undefined = null) => (\n      <form id=\"formTest\">\n        <Select {...props} required value={value} />\n      </form>\n    );\n\n    const { container, rerender } = render(components());\n\n    expect(\n      container.querySelector<HTMLFormElement>('#formTest')?.checkValidity()\n    ).toEqual(false);\n    rerender(components(props.options[0]));\n    expect(\n      container.querySelector<HTMLFormElement>('#formTest')?.checkValidity()\n    ).toEqual(true);\n  },\n  {\n    'single select > should validate with value': {\n      props: {\n        ...BASIC_PROPS,\n      },\n    },\n    'single select (isSearchable is false) > should validate with value': {\n      props: {\n        ...BASIC_PROPS,\n        isSearchable: false,\n      },\n    },\n    'multi select > should validate with value': {\n      props: {\n        ...BASIC_PROPS,\n        isMulti: true,\n      },\n    },\n  }\n);\n"
  },
  {
    "path": "packages/react-select/src/__tests__/StateManaged.test.tsx",
    "content": "import React from 'react';\nimport { render, fireEvent, EventType } from '@testing-library/react';\nimport userEvent from '@testing-library/user-event';\n\nimport cases from 'jest-in-case';\n\nimport { Option, OPTIONS } from './constants';\nimport Select from '../';\n\nfunction openMenu(container: HTMLElement) {\n  expect(\n    container.querySelector('.react-select__menu')\n  ).not.toBeInTheDocument();\n\n  toggleMenuOpen(container);\n\n  expect(container.querySelector('.react-select__menu')).toBeInTheDocument();\n}\n\nfunction toggleMenuOpen(container: HTMLElement) {\n  fireEvent.mouseDown(\n    container.querySelector('.react-select__dropdown-indicator')!,\n    { button: 0 }\n  );\n}\n\nfunction closeMenu(container: HTMLElement) {\n  expect(container.querySelector('.react-select__menu')).toBeInTheDocument();\n  toggleMenuOpen(container);\n  expect(\n    container.querySelector('.react-select__menu')\n  ).not.toBeInTheDocument();\n}\n\ninterface BasicProps {\n  readonly className: string;\n  readonly classNamePrefix: string;\n  readonly onChange: () => void;\n  readonly onInputChange: () => void;\n  readonly onMenuClose: () => void;\n  readonly onMenuOpen: () => void;\n  readonly name: string;\n  readonly options: readonly Option[];\n}\n\nconst BASIC_PROPS: BasicProps = {\n  className: 'react-select',\n  classNamePrefix: 'react-select',\n  onChange: jest.fn(),\n  onInputChange: jest.fn(),\n  onMenuClose: jest.fn(),\n  onMenuOpen: jest.fn(),\n  name: 'test-input-name',\n  options: OPTIONS,\n};\n\ntest('defaults > snapshot', () => {\n  const { container } = render(<Select />);\n  expect(container).toMatchSnapshot();\n});\n\ntest('passes down the className prop', () => {\n  const { container } = render(<Select {...BASIC_PROPS} />);\n  expect(container.querySelector('.react-select')).toBeTruthy();\n});\n\ncases(\n  'click on dropdown indicator',\n  ({ props }) => {\n    let { container } = render(<Select {...props} />);\n    // Menu not open by default\n    expect(\n      container.querySelector('.react-select__menu')\n    ).not.toBeInTheDocument();\n    openMenu(container);\n    closeMenu(container);\n  },\n  {\n    'single select > should toggle Menu': { props: BASIC_PROPS },\n    'multi select > should toggle Menu': {\n      props: {\n        ...BASIC_PROPS,\n        isMulti: true,\n      },\n    },\n  }\n);\n\ntest('If menuIsOpen prop is passed Menu should not close on clicking Dropdown Indicator', () => {\n  const { container } = render(<Select menuIsOpen {...BASIC_PROPS} />);\n  expect(container.querySelector('.react-select__menu')).toBeTruthy();\n\n  toggleMenuOpen(container);\n  expect(container.querySelector('.react-select__menu')).toBeTruthy();\n});\n\ntest('defaultMenuIsOpen prop > should open by menu default and clicking on Dropdown Indicator should toggle menu', () => {\n  const { container } = render(<Select defaultMenuIsOpen {...BASIC_PROPS} />);\n  expect(container.querySelector('.react-select__menu')).toBeTruthy();\n\n  toggleMenuOpen(container);\n  expect(container.querySelector('.react-select__menu')).toBeFalsy();\n});\n\ntest('Menu is controllable by menuIsOpen prop', () => {\n  const menuClass = `.${BASIC_PROPS.classNamePrefix}__menu`;\n  const { container, rerender } = render(<Select {...BASIC_PROPS} />);\n  expect(container.querySelector(menuClass)).toBeFalsy();\n\n  rerender(<Select menuIsOpen {...BASIC_PROPS} />);\n  expect(container.querySelector(menuClass)).toBeTruthy();\n\n  rerender(<Select menuIsOpen={false} {...BASIC_PROPS} />);\n  expect(container.querySelector(menuClass)).toBeFalsy();\n});\n\ninterface MenuToOpenByDefaultOptsProps extends Partial<BasicProps> {\n  readonly isMulti?: boolean;\n  readonly menuIsOpen?: boolean;\n}\n\ninterface MenuToOpenByDefaultOpts {\n  readonly props?: MenuToOpenByDefaultOptsProps;\n}\n\ncases<MenuToOpenByDefaultOpts>(\n  'Menu to open by default if menuIsOpen prop is true',\n  ({ props }) => {\n    props = { ...BASIC_PROPS, ...props, menuIsOpen: true };\n    const menuClass = `.${BASIC_PROPS.classNamePrefix}__menu`;\n    const { container } = render(<Select {...props} />);\n    expect(container.querySelector(menuClass)).toBeTruthy();\n\n    userEvent.click(\n      container.querySelector('div.react-select__dropdown-indicator')!\n    );\n\n    expect(container.querySelector(menuClass)).toBeTruthy();\n  },\n  {\n    'single select > should keep Menu open by default if true is passed for menuIsOpen prop':\n      {},\n    'multi select > should keep Menu open by default if true is passed for menuIsOpen prop':\n      {\n        props: {\n          ...BASIC_PROPS,\n          isMulti: true,\n          menuIsOpen: true,\n        },\n      },\n  }\n);\n\ntest('multi select > selecting multiple values', () => {\n  let { container } = render(<Select {...BASIC_PROPS} isMulti />);\n  openMenu(container);\n  fireEvent.keyDown(container.querySelector('.react-select__menu')!, {\n    keyCode: 13,\n    key: 'Enter',\n  });\n  expect(container.querySelector('.react-select__control')!.textContent).toBe(\n    '0'\n  );\n\n  openMenu(container);\n  fireEvent.keyDown(container.querySelector('.react-select__menu')!, {\n    keyCode: 13,\n    key: 'Enter',\n  });\n  expect(container.querySelector('.react-select__control')!.textContent).toBe(\n    '01'\n  );\n});\n\ntest('defaultInputValue prop > should update the inputValue on change of input if defaultInputValue prop is provided', () => {\n  const props = { ...BASIC_PROPS, defaultInputValue: '0' };\n  let { container } = render(<Select {...props} />);\n  let input = container.querySelector<HTMLInputElement>(\n    '.react-select__control input'\n  );\n\n  expect(input!.value).toBe('0');\n  userEvent.type(input!, 'A');\n  expect(input!.value).toBe('0A');\n});\n\ntest('inputValue prop > should not update the inputValue when on change of input if inputValue prop is provided', () => {\n  const props = { ...BASIC_PROPS, inputValue: '0' };\n  let { container } = render(<Select {...props} />);\n  let input = container.querySelector<HTMLInputElement>(\n    '.react-select__control input'\n  );\n  expect(input!.value).toBe('0');\n  userEvent.type(input!, 'A');\n  expect(input!.value).toBe('0');\n});\n\ntest('defaultValue prop > should update the value on selecting option', () => {\n  const props = { ...BASIC_PROPS, defaultValue: [OPTIONS[0]] };\n  let { container } = render(<Select {...props} menuIsOpen />);\n  expect(\n    container.querySelector<HTMLInputElement>('input[type=\"hidden\"]')!.value\n  ).toBe('zero');\n  userEvent.click(container.querySelectorAll('div.react-select__option')[1]);\n  expect(\n    container.querySelector<HTMLInputElement>('input[type=\"hidden\"]')!.value\n  ).toBe('one');\n});\n\ntest('value prop > should not update the value on selecting option', () => {\n  const props = { ...BASIC_PROPS, value: [OPTIONS[0]] };\n  let { container } = render(<Select {...props} menuIsOpen />);\n  expect(\n    container.querySelector<HTMLInputElement>('input[type=\"hidden\"]')!.value\n  ).toBe('zero');\n  userEvent.click(container.querySelectorAll('div.react-select__option')[1]);\n  expect(\n    container.querySelector<HTMLInputElement>('input[type=\"hidden\"]')!.value\n  ).toBe('zero');\n});\n\ncases(\n  'Integration tests > selecting an option > mouse interaction',\n  ({\n    props = { ...BASIC_PROPS },\n    event: [eventName, eventArgs],\n    selectOption,\n    expectSelectedOption,\n  }) => {\n    let { container, getByText } = render(<Select {...props} />);\n    let toSelectOption = getByText(selectOption.label);\n    fireEvent[eventName](toSelectOption, eventArgs);\n    expect(\n      container.querySelector<HTMLInputElement>('input[type=\"hidden\"]')!.value\n    ).toBe(expectSelectedOption);\n  },\n  {\n    'single select > clicking on an option > should select the clicked option':\n      {\n        props: {\n          ...BASIC_PROPS,\n          menuIsOpen: true,\n        },\n        event: ['click' as const, { button: 0 }] as const,\n        selectOption: OPTIONS[2],\n        expectSelectedOption: 'two',\n      },\n    'multi select > clicking on an option > should select the clicked option': {\n      props: {\n        ...BASIC_PROPS,\n        delimiter: ', ',\n        isMulti: true,\n        menuIsOpen: true,\n      },\n      event: ['click' as const, { button: 0 }] as const,\n      selectOption: OPTIONS[2],\n      expectSelectedOption: 'two',\n    },\n  }\n);\n\ninterface KeyboardInteractionOptsProps extends BasicProps {\n  readonly isMulti?: boolean;\n}\n\ninterface KeyboardInteractionOpts {\n  readonly props?: KeyboardInteractionOptsProps;\n  readonly eventsToSimulate: readonly [EventType, {}][];\n  readonly expectedSelectedOption: string;\n}\n\ncases<KeyboardInteractionOpts>(\n  'Integration tests > selection an option > keyboard interaction',\n  ({\n    props = { ...BASIC_PROPS },\n    eventsToSimulate,\n    expectedSelectedOption,\n  }) => {\n    let { container } = render(<Select {...props} />);\n    openMenu(container);\n    eventsToSimulate.map(([eventName, eventArgs]) => {\n      fireEvent[eventName](\n        container.querySelector('.react-select__menu')!,\n        eventArgs\n      );\n    });\n    fireEvent.keyDown(container.querySelector('.react-select__menu')!, {\n      keyCode: 13,\n      key: 'Enter',\n    });\n    expect(\n      container.querySelector<HTMLInputElement>('input[type=\"hidden\"]')!.value\n    ).toBe(expectedSelectedOption);\n  },\n  {\n    'single select > open select and hit enter > should select first option': {\n      eventsToSimulate: [],\n      expectedSelectedOption: OPTIONS[0].value,\n    },\n    'single select > (open select -> 3 x ArrowDown -> Enter) > should select the forth option in the select':\n      {\n        eventsToSimulate: [\n          ['keyDown', { keyCode: 40, key: 'ArrowDown' }],\n          ['keyDown', { keyCode: 40, key: 'ArrowDown' }],\n          ['keyDown', { keyCode: 40, key: 'ArrowDown' }],\n        ],\n        expectedSelectedOption: OPTIONS[3].value,\n      },\n    'single select > (open select -> 2 x ArrowDown -> 2 x ArrowUp -> Enter) > should select the first option in the select':\n      {\n        eventsToSimulate: [\n          ['keyDown', { keyCode: 40, key: 'ArrowDown' }],\n          ['keyDown', { keyCode: 40, key: 'ArrowDown' }],\n          ['keyDown', { keyCode: 38, key: 'ArrowUp' }],\n          ['keyDown', { keyCode: 38, key: 'ArrowUp' }],\n        ],\n        expectedSelectedOption: OPTIONS[0].value,\n      },\n    'single select > (open select -> 1 x ArrowUp -> Enter) > should select the last option in the select':\n      {\n        eventsToSimulate: [['keyDown', { keyCode: 38, key: 'ArrowUp' }]],\n        expectedSelectedOption: OPTIONS[OPTIONS.length - 1].value,\n      },\n    'single select > (open select -> 1 x PageDown -> Enter) > should select the first option on next page - default pageSize 5':\n      {\n        eventsToSimulate: [['keyDown', { keyCode: 34, key: 'PageDown' }]],\n        expectedSelectedOption: OPTIONS[5].value,\n      },\n    'single select > (open select -> 1 x PageDown -> 1 x ArrowDown -> 1 x PageUp -> Enter) > should select the second option - default pageSize 5':\n      {\n        eventsToSimulate: [\n          ['keyDown', { keyCode: 34, key: 'PageDown' }],\n          ['keyDown', { keyCode: 40, key: 'ArrowDown' }],\n          ['keyDown', { keyCode: 33, key: 'PageUp' }],\n        ],\n        expectedSelectedOption: OPTIONS[1].value,\n      },\n    'single select > (open select -> End -> Enter) > should select the last option':\n      {\n        eventsToSimulate: [['keyDown', { keyCode: 35, key: 'End' }]],\n        expectedSelectedOption: OPTIONS[OPTIONS.length - 1].value,\n      },\n    'single select > (open select -> 3 x PageDown -> Home -> Enter) > should select the last option':\n      {\n        eventsToSimulate: [\n          ['keyDown', { keyCode: 34, key: 'PageDown' }],\n          ['keyDown', { keyCode: 34, key: 'PageDown' }],\n          ['keyDown', { keyCode: 34, key: 'PageDown' }],\n          ['keyDown', { keyCode: 36, key: 'Home' }],\n        ],\n        expectedSelectedOption: OPTIONS[0].value,\n      },\n    'single select > cycle options > ( open select -> End -> ArrowDown -> Enter) > should select the first option':\n      {\n        eventsToSimulate: [\n          ['keyDown', { keyCode: 35, key: 'End' }],\n          ['keyDown', { keyCode: 40, key: 'ArrowDown' }],\n        ],\n        expectedSelectedOption: OPTIONS[0].value,\n      },\n    'single select > cycle options > (open select -> ArrowUp -> Enter) > should select the last option':\n      {\n        eventsToSimulate: [['keyDown', { keyCode: 38, key: 'ArrowUp' }]],\n        expectedSelectedOption: OPTIONS[OPTIONS.length - 1].value,\n      },\n    'multi select > open select and hit enter > should select first option': {\n      props: {\n        ...BASIC_PROPS,\n        isMulti: true,\n      },\n      eventsToSimulate: [],\n      expectedSelectedOption: OPTIONS[0].value,\n    },\n    'multi select > (open select -> 3 x ArrowDown -> Enter) > should select the forth option in the select':\n      {\n        props: {\n          ...BASIC_PROPS,\n          isMulti: true,\n        },\n        eventsToSimulate: [\n          ['keyDown', { keyCode: 40, key: 'ArrowDown' }],\n          ['keyDown', { keyCode: 40, key: 'ArrowDown' }],\n          ['keyDown', { keyCode: 40, key: 'ArrowDown' }],\n        ],\n        expectedSelectedOption: OPTIONS[3].value,\n      },\n    'multi select > (open select -> 2 x ArrowDown -> 2 x ArrowUp -> Enter) > should select the first option in the select':\n      {\n        props: {\n          ...BASIC_PROPS,\n          isMulti: true,\n        },\n        eventsToSimulate: [\n          ['keyDown', { keyCode: 40, key: 'ArrowDown' }],\n          ['keyDown', { keyCode: 40, key: 'ArrowDown' }],\n          ['keyDown', { keyCode: 38, key: 'ArrowUp' }],\n          ['keyDown', { keyCode: 38, key: 'ArrowUp' }],\n        ],\n        expectedSelectedOption: OPTIONS[0].value,\n      },\n    'multi select > (open select -> 1 x ArrowUp -> Enter) > should select the last option in the select':\n      {\n        props: {\n          ...BASIC_PROPS,\n          isMulti: true,\n        },\n        eventsToSimulate: [['keyDown', { keyCode: 38, key: 'ArrowUp' }]],\n        expectedSelectedOption: OPTIONS[OPTIONS.length - 1].value,\n      },\n    'multi select > (open select -> 1 x PageDown -> Enter) > should select the first option on next page - default pageSize 5':\n      {\n        props: {\n          ...BASIC_PROPS,\n          isMulti: true,\n        },\n        eventsToSimulate: [['keyDown', { keyCode: 34, key: 'PageDown' }]],\n        expectedSelectedOption: OPTIONS[5].value,\n      },\n    'multi select > (open select -> 1 x PageDown -> 1 x ArrowDown -> 1 x PageUp -> Enter) > should select the second option - default pageSize 5':\n      {\n        props: {\n          ...BASIC_PROPS,\n          isMulti: true,\n        },\n        eventsToSimulate: [\n          ['keyDown', { keyCode: 34, key: 'PageDown' }],\n          ['keyDown', { keyCode: 40, key: 'ArrowDown' }],\n          ['keyDown', { keyCode: 33, key: 'PageUp' }],\n        ],\n        expectedSelectedOption: OPTIONS[1].value,\n      },\n    'multi select > (open select -> End -> Enter) > should select the last option':\n      {\n        props: {\n          ...BASIC_PROPS,\n          isMulti: true,\n        },\n        eventsToSimulate: [['keyDown', { keyCode: 35, key: 'End' }]],\n        expectedSelectedOption: OPTIONS[OPTIONS.length - 1].value,\n      },\n    'multi select > (open select -> 3 x PageDown -> Home -> Enter) > should select the last option':\n      {\n        props: {\n          ...BASIC_PROPS,\n          isMulti: true,\n        },\n        eventsToSimulate: [\n          ['keyDown', { keyCode: 34, key: 'PageDown' }],\n          ['keyDown', { keyCode: 34, key: 'PageDown' }],\n          ['keyDown', { keyCode: 34, key: 'PageDown' }],\n          ['keyDown', { keyCode: 36, key: 'Home' }],\n        ],\n        expectedSelectedOption: OPTIONS[0].value,\n      },\n    'multi select > cycle options > ( open select -> End -> ArrowDown -> Enter) > should select the first option':\n      {\n        props: {\n          ...BASIC_PROPS,\n          isMulti: true,\n        },\n        eventsToSimulate: [\n          ['keyDown', { keyCode: 35, key: 'End' }],\n          ['keyDown', { keyCode: 40, key: 'ArrowDown' }],\n        ],\n        expectedSelectedOption: OPTIONS[0].value,\n      },\n    'multi select > cycle options > (open select -> ArrowUp -> Enter) > should select the last option':\n      {\n        props: {\n          ...BASIC_PROPS,\n          isMulti: true,\n        },\n        eventsToSimulate: [['keyDown', { keyCode: 38, key: 'ArrowUp' }]],\n        expectedSelectedOption: OPTIONS[OPTIONS.length - 1].value,\n      },\n  }\n);\n\ntest('`required` prop > should validate', () => {\n  const { container } = render(\n    <form id=\"formTest\">\n      <Select {...BASIC_PROPS} menuIsOpen required />\n    </form>\n  );\n\n  expect(\n    container.querySelector<HTMLFormElement>('#formTest')?.checkValidity()\n  ).toEqual(false);\n\n  let selectOption = container.querySelectorAll('div.react-select__option')[3];\n\n  userEvent.click(selectOption);\n\n  expect(\n    container.querySelector<HTMLFormElement>('#formTest')?.checkValidity()\n  ).toEqual(true);\n});\n"
  },
  {
    "path": "packages/react-select/src/__tests__/__snapshots__/Async.test.tsx.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`defaults - snapshot 1`] = `\n.emotion-0 {\n  position: relative;\n  box-sizing: border-box;\n}\n\n.emotion-1 {\n  z-index: 9999;\n  border: 0;\n  clip: rect(1px, 1px, 1px, 1px);\n  height: 1px;\n  width: 1px;\n  position: absolute;\n  overflow: hidden;\n  padding: 0;\n  white-space: nowrap;\n}\n\n.emotion-3 {\n  -webkit-align-items: center;\n  -webkit-box-align: center;\n  -ms-flex-align: center;\n  align-items: center;\n  cursor: default;\n  display: -webkit-box;\n  display: -webkit-flex;\n  display: -ms-flexbox;\n  display: flex;\n  -webkit-box-flex-wrap: wrap;\n  -webkit-flex-wrap: wrap;\n  -ms-flex-wrap: wrap;\n  flex-wrap: wrap;\n  -webkit-box-pack: justify;\n  -webkit-justify-content: space-between;\n  justify-content: space-between;\n  min-height: 38px;\n  outline: 0!important;\n  position: relative;\n  -webkit-transition: all 100ms;\n  transition: all 100ms;\n  background-color: hsl(0, 0%, 100%);\n  border-color: hsl(0, 0%, 80%);\n  border-radius: 4px;\n  border-style: solid;\n  border-width: 1px;\n  box-sizing: border-box;\n}\n\n.emotion-3:hover {\n  border-color: hsl(0, 0%, 70%);\n}\n\n.emotion-4 {\n  -webkit-align-items: center;\n  -webkit-box-align: center;\n  -ms-flex-align: center;\n  align-items: center;\n  display: grid;\n  -webkit-flex: 1;\n  -ms-flex: 1;\n  flex: 1;\n  -webkit-box-flex-wrap: wrap;\n  -webkit-flex-wrap: wrap;\n  -ms-flex-wrap: wrap;\n  flex-wrap: wrap;\n  -webkit-overflow-scrolling: touch;\n  position: relative;\n  overflow: hidden;\n  padding: 2px 8px;\n  box-sizing: border-box;\n}\n\n.emotion-5 {\n  grid-area: 1/1/2/3;\n  color: hsl(0, 0%, 50%);\n  margin-left: 2px;\n  margin-right: 2px;\n  box-sizing: border-box;\n}\n\n.emotion-6 {\n  visibility: visible;\n  -webkit-flex: 1 1 auto;\n  -ms-flex: 1 1 auto;\n  flex: 1 1 auto;\n  display: inline-grid;\n  grid-area: 1/1/2/3;\n  grid-template-columns: 0 min-content;\n  margin: 2px;\n  padding-bottom: 2px;\n  padding-top: 2px;\n  color: hsl(0, 0%, 20%);\n  box-sizing: border-box;\n}\n\n.emotion-6:after {\n  content: attr(data-value) \" \";\n  visibility: hidden;\n  white-space: pre;\n  grid-area: 1/2;\n  font: inherit;\n  min-width: 2px;\n  border: 0;\n  margin: 0;\n  outline: 0;\n  padding: 0;\n}\n\n.emotion-7 {\n  -webkit-align-items: center;\n  -webkit-box-align: center;\n  -ms-flex-align: center;\n  align-items: center;\n  -webkit-align-self: stretch;\n  -ms-flex-item-align: stretch;\n  align-self: stretch;\n  display: -webkit-box;\n  display: -webkit-flex;\n  display: -ms-flexbox;\n  display: flex;\n  -webkit-flex-shrink: 0;\n  -ms-flex-negative: 0;\n  flex-shrink: 0;\n  box-sizing: border-box;\n}\n\n.emotion-8 {\n  -webkit-align-self: stretch;\n  -ms-flex-item-align: stretch;\n  align-self: stretch;\n  width: 1px;\n  background-color: hsl(0, 0%, 80%);\n  margin-bottom: 8px;\n  margin-top: 8px;\n  box-sizing: border-box;\n}\n\n.emotion-9 {\n  display: -webkit-box;\n  display: -webkit-flex;\n  display: -ms-flexbox;\n  display: flex;\n  -webkit-transition: color 150ms;\n  transition: color 150ms;\n  color: hsl(0, 0%, 80%);\n  padding: 8px;\n  box-sizing: border-box;\n}\n\n.emotion-9:hover {\n  color: hsl(0, 0%, 60%);\n}\n\n.emotion-10 {\n  display: inline-block;\n  fill: currentColor;\n  line-height: 1;\n  stroke: currentColor;\n  stroke-width: 0;\n}\n\n<div>\n  <div\n    class=\" emotion-0\"\n  >\n    <span\n      class=\"emotion-1\"\n      id=\"react-select-2-live-region\"\n    />\n    <span\n      aria-atomic=\"false\"\n      aria-live=\"polite\"\n      aria-relevant=\"additions text\"\n      class=\"emotion-1\"\n      role=\"log\"\n    />\n    <div\n      class=\" emotion-3\"\n    >\n      <div\n        class=\" emotion-4\"\n      >\n        <div\n          class=\" emotion-5\"\n          id=\"react-select-2-placeholder\"\n        >\n          Select...\n        </div>\n        <div\n          class=\" emotion-6\"\n          data-value=\"\"\n        >\n          <input\n            aria-activedescendant=\"\"\n            aria-autocomplete=\"list\"\n            aria-describedby=\"react-select-2-placeholder\"\n            aria-expanded=\"false\"\n            aria-haspopup=\"true\"\n            autocapitalize=\"none\"\n            autocomplete=\"off\"\n            autocorrect=\"off\"\n            class=\"\"\n            id=\"react-select-2-input\"\n            role=\"combobox\"\n            spellcheck=\"false\"\n            style=\"opacity: 1; width: 100%; grid-area: 1 / 2; min-width: 2px; border: 0px; margin: 0px; outline: 0; padding: 0px;\"\n            tabindex=\"0\"\n            type=\"text\"\n            value=\"\"\n          />\n        </div>\n      </div>\n      <div\n        class=\" emotion-7\"\n      >\n        <span\n          class=\" emotion-8\"\n        />\n        <div\n          aria-hidden=\"true\"\n          class=\" emotion-9\"\n        >\n          <svg\n            aria-hidden=\"true\"\n            class=\"emotion-10\"\n            focusable=\"false\"\n            height=\"20\"\n            viewBox=\"0 0 20 20\"\n            width=\"20\"\n          >\n            <path\n              d=\"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z\"\n            />\n          </svg>\n        </div>\n      </div>\n    </div>\n  </div>\n</div>\n`;\n"
  },
  {
    "path": "packages/react-select/src/__tests__/__snapshots__/AsyncCreatable.test.tsx.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`defaults - snapshot 1`] = `\n.emotion-0 {\n  position: relative;\n  box-sizing: border-box;\n}\n\n.emotion-1 {\n  z-index: 9999;\n  border: 0;\n  clip: rect(1px, 1px, 1px, 1px);\n  height: 1px;\n  width: 1px;\n  position: absolute;\n  overflow: hidden;\n  padding: 0;\n  white-space: nowrap;\n}\n\n.emotion-3 {\n  -webkit-align-items: center;\n  -webkit-box-align: center;\n  -ms-flex-align: center;\n  align-items: center;\n  cursor: default;\n  display: -webkit-box;\n  display: -webkit-flex;\n  display: -ms-flexbox;\n  display: flex;\n  -webkit-box-flex-wrap: wrap;\n  -webkit-flex-wrap: wrap;\n  -ms-flex-wrap: wrap;\n  flex-wrap: wrap;\n  -webkit-box-pack: justify;\n  -webkit-justify-content: space-between;\n  justify-content: space-between;\n  min-height: 38px;\n  outline: 0!important;\n  position: relative;\n  -webkit-transition: all 100ms;\n  transition: all 100ms;\n  background-color: hsl(0, 0%, 100%);\n  border-color: hsl(0, 0%, 80%);\n  border-radius: 4px;\n  border-style: solid;\n  border-width: 1px;\n  box-sizing: border-box;\n}\n\n.emotion-3:hover {\n  border-color: hsl(0, 0%, 70%);\n}\n\n.emotion-4 {\n  -webkit-align-items: center;\n  -webkit-box-align: center;\n  -ms-flex-align: center;\n  align-items: center;\n  display: grid;\n  -webkit-flex: 1;\n  -ms-flex: 1;\n  flex: 1;\n  -webkit-box-flex-wrap: wrap;\n  -webkit-flex-wrap: wrap;\n  -ms-flex-wrap: wrap;\n  flex-wrap: wrap;\n  -webkit-overflow-scrolling: touch;\n  position: relative;\n  overflow: hidden;\n  padding: 2px 8px;\n  box-sizing: border-box;\n}\n\n.emotion-5 {\n  grid-area: 1/1/2/3;\n  color: hsl(0, 0%, 50%);\n  margin-left: 2px;\n  margin-right: 2px;\n  box-sizing: border-box;\n}\n\n.emotion-6 {\n  visibility: visible;\n  -webkit-flex: 1 1 auto;\n  -ms-flex: 1 1 auto;\n  flex: 1 1 auto;\n  display: inline-grid;\n  grid-area: 1/1/2/3;\n  grid-template-columns: 0 min-content;\n  margin: 2px;\n  padding-bottom: 2px;\n  padding-top: 2px;\n  color: hsl(0, 0%, 20%);\n  box-sizing: border-box;\n}\n\n.emotion-6:after {\n  content: attr(data-value) \" \";\n  visibility: hidden;\n  white-space: pre;\n  grid-area: 1/2;\n  font: inherit;\n  min-width: 2px;\n  border: 0;\n  margin: 0;\n  outline: 0;\n  padding: 0;\n}\n\n.emotion-7 {\n  -webkit-align-items: center;\n  -webkit-box-align: center;\n  -ms-flex-align: center;\n  align-items: center;\n  -webkit-align-self: stretch;\n  -ms-flex-item-align: stretch;\n  align-self: stretch;\n  display: -webkit-box;\n  display: -webkit-flex;\n  display: -ms-flexbox;\n  display: flex;\n  -webkit-flex-shrink: 0;\n  -ms-flex-negative: 0;\n  flex-shrink: 0;\n  box-sizing: border-box;\n}\n\n.emotion-8 {\n  -webkit-align-self: stretch;\n  -ms-flex-item-align: stretch;\n  align-self: stretch;\n  width: 1px;\n  background-color: hsl(0, 0%, 80%);\n  margin-bottom: 8px;\n  margin-top: 8px;\n  box-sizing: border-box;\n}\n\n.emotion-9 {\n  display: -webkit-box;\n  display: -webkit-flex;\n  display: -ms-flexbox;\n  display: flex;\n  -webkit-transition: color 150ms;\n  transition: color 150ms;\n  color: hsl(0, 0%, 80%);\n  padding: 8px;\n  box-sizing: border-box;\n}\n\n.emotion-9:hover {\n  color: hsl(0, 0%, 60%);\n}\n\n.emotion-10 {\n  display: inline-block;\n  fill: currentColor;\n  line-height: 1;\n  stroke: currentColor;\n  stroke-width: 0;\n}\n\n<div>\n  <div\n    class=\" emotion-0\"\n  >\n    <span\n      class=\"emotion-1\"\n      id=\"react-select-2-live-region\"\n    />\n    <span\n      aria-atomic=\"false\"\n      aria-live=\"polite\"\n      aria-relevant=\"additions text\"\n      class=\"emotion-1\"\n      role=\"log\"\n    />\n    <div\n      class=\" emotion-3\"\n    >\n      <div\n        class=\" emotion-4\"\n      >\n        <div\n          class=\" emotion-5\"\n          id=\"react-select-2-placeholder\"\n        >\n          Select...\n        </div>\n        <div\n          class=\" emotion-6\"\n          data-value=\"\"\n        >\n          <input\n            aria-activedescendant=\"\"\n            aria-autocomplete=\"list\"\n            aria-describedby=\"react-select-2-placeholder\"\n            aria-expanded=\"false\"\n            aria-haspopup=\"true\"\n            autocapitalize=\"none\"\n            autocomplete=\"off\"\n            autocorrect=\"off\"\n            class=\"\"\n            id=\"react-select-2-input\"\n            role=\"combobox\"\n            spellcheck=\"false\"\n            style=\"opacity: 1; width: 100%; grid-area: 1 / 2; min-width: 2px; border: 0px; margin: 0px; outline: 0; padding: 0px;\"\n            tabindex=\"0\"\n            type=\"text\"\n            value=\"\"\n          />\n        </div>\n      </div>\n      <div\n        class=\" emotion-7\"\n      >\n        <span\n          class=\" emotion-8\"\n        />\n        <div\n          aria-hidden=\"true\"\n          class=\" emotion-9\"\n        >\n          <svg\n            aria-hidden=\"true\"\n            class=\"emotion-10\"\n            focusable=\"false\"\n            height=\"20\"\n            viewBox=\"0 0 20 20\"\n            width=\"20\"\n          >\n            <path\n              d=\"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z\"\n            />\n          </svg>\n        </div>\n      </div>\n    </div>\n  </div>\n</div>\n`;\n"
  },
  {
    "path": "packages/react-select/src/__tests__/__snapshots__/Creatable.test.tsx.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`defaults - snapshot 1`] = `\n.emotion-0 {\n  position: relative;\n  box-sizing: border-box;\n}\n\n.emotion-1 {\n  z-index: 9999;\n  border: 0;\n  clip: rect(1px, 1px, 1px, 1px);\n  height: 1px;\n  width: 1px;\n  position: absolute;\n  overflow: hidden;\n  padding: 0;\n  white-space: nowrap;\n}\n\n.emotion-3 {\n  -webkit-align-items: center;\n  -webkit-box-align: center;\n  -ms-flex-align: center;\n  align-items: center;\n  cursor: default;\n  display: -webkit-box;\n  display: -webkit-flex;\n  display: -ms-flexbox;\n  display: flex;\n  -webkit-box-flex-wrap: wrap;\n  -webkit-flex-wrap: wrap;\n  -ms-flex-wrap: wrap;\n  flex-wrap: wrap;\n  -webkit-box-pack: justify;\n  -webkit-justify-content: space-between;\n  justify-content: space-between;\n  min-height: 38px;\n  outline: 0!important;\n  position: relative;\n  -webkit-transition: all 100ms;\n  transition: all 100ms;\n  background-color: hsl(0, 0%, 100%);\n  border-color: hsl(0, 0%, 80%);\n  border-radius: 4px;\n  border-style: solid;\n  border-width: 1px;\n  box-sizing: border-box;\n}\n\n.emotion-3:hover {\n  border-color: hsl(0, 0%, 70%);\n}\n\n.emotion-4 {\n  -webkit-align-items: center;\n  -webkit-box-align: center;\n  -ms-flex-align: center;\n  align-items: center;\n  display: grid;\n  -webkit-flex: 1;\n  -ms-flex: 1;\n  flex: 1;\n  -webkit-box-flex-wrap: wrap;\n  -webkit-flex-wrap: wrap;\n  -ms-flex-wrap: wrap;\n  flex-wrap: wrap;\n  -webkit-overflow-scrolling: touch;\n  position: relative;\n  overflow: hidden;\n  padding: 2px 8px;\n  box-sizing: border-box;\n}\n\n.emotion-5 {\n  grid-area: 1/1/2/3;\n  color: hsl(0, 0%, 50%);\n  margin-left: 2px;\n  margin-right: 2px;\n  box-sizing: border-box;\n}\n\n.emotion-6 {\n  visibility: visible;\n  -webkit-flex: 1 1 auto;\n  -ms-flex: 1 1 auto;\n  flex: 1 1 auto;\n  display: inline-grid;\n  grid-area: 1/1/2/3;\n  grid-template-columns: 0 min-content;\n  margin: 2px;\n  padding-bottom: 2px;\n  padding-top: 2px;\n  color: hsl(0, 0%, 20%);\n  box-sizing: border-box;\n}\n\n.emotion-6:after {\n  content: attr(data-value) \" \";\n  visibility: hidden;\n  white-space: pre;\n  grid-area: 1/2;\n  font: inherit;\n  min-width: 2px;\n  border: 0;\n  margin: 0;\n  outline: 0;\n  padding: 0;\n}\n\n.emotion-7 {\n  -webkit-align-items: center;\n  -webkit-box-align: center;\n  -ms-flex-align: center;\n  align-items: center;\n  -webkit-align-self: stretch;\n  -ms-flex-item-align: stretch;\n  align-self: stretch;\n  display: -webkit-box;\n  display: -webkit-flex;\n  display: -ms-flexbox;\n  display: flex;\n  -webkit-flex-shrink: 0;\n  -ms-flex-negative: 0;\n  flex-shrink: 0;\n  box-sizing: border-box;\n}\n\n.emotion-8 {\n  -webkit-align-self: stretch;\n  -ms-flex-item-align: stretch;\n  align-self: stretch;\n  width: 1px;\n  background-color: hsl(0, 0%, 80%);\n  margin-bottom: 8px;\n  margin-top: 8px;\n  box-sizing: border-box;\n}\n\n.emotion-9 {\n  display: -webkit-box;\n  display: -webkit-flex;\n  display: -ms-flexbox;\n  display: flex;\n  -webkit-transition: color 150ms;\n  transition: color 150ms;\n  color: hsl(0, 0%, 80%);\n  padding: 8px;\n  box-sizing: border-box;\n}\n\n.emotion-9:hover {\n  color: hsl(0, 0%, 60%);\n}\n\n.emotion-10 {\n  display: inline-block;\n  fill: currentColor;\n  line-height: 1;\n  stroke: currentColor;\n  stroke-width: 0;\n}\n\n<div>\n  <div\n    class=\" emotion-0\"\n  >\n    <span\n      class=\"emotion-1\"\n      id=\"react-select-2-live-region\"\n    />\n    <span\n      aria-atomic=\"false\"\n      aria-live=\"polite\"\n      aria-relevant=\"additions text\"\n      class=\"emotion-1\"\n      role=\"log\"\n    />\n    <div\n      class=\" emotion-3\"\n    >\n      <div\n        class=\" emotion-4\"\n      >\n        <div\n          class=\" emotion-5\"\n          id=\"react-select-2-placeholder\"\n        >\n          Select...\n        </div>\n        <div\n          class=\" emotion-6\"\n          data-value=\"\"\n        >\n          <input\n            aria-activedescendant=\"\"\n            aria-autocomplete=\"list\"\n            aria-describedby=\"react-select-2-placeholder\"\n            aria-expanded=\"false\"\n            aria-haspopup=\"true\"\n            autocapitalize=\"none\"\n            autocomplete=\"off\"\n            autocorrect=\"off\"\n            class=\"\"\n            id=\"react-select-2-input\"\n            role=\"combobox\"\n            spellcheck=\"false\"\n            style=\"opacity: 1; width: 100%; grid-area: 1 / 2; min-width: 2px; border: 0px; margin: 0px; outline: 0; padding: 0px;\"\n            tabindex=\"0\"\n            type=\"text\"\n            value=\"\"\n          />\n        </div>\n      </div>\n      <div\n        class=\" emotion-7\"\n      >\n        <span\n          class=\" emotion-8\"\n        />\n        <div\n          aria-hidden=\"true\"\n          class=\" emotion-9\"\n        >\n          <svg\n            aria-hidden=\"true\"\n            class=\"emotion-10\"\n            focusable=\"false\"\n            height=\"20\"\n            viewBox=\"0 0 20 20\"\n            width=\"20\"\n          >\n            <path\n              d=\"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z\"\n            />\n          </svg>\n        </div>\n      </div>\n    </div>\n  </div>\n</div>\n`;\n"
  },
  {
    "path": "packages/react-select/src/__tests__/__snapshots__/Select.test.tsx.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`snapshot - defaults 1`] = `\n.emotion-0 {\n  position: relative;\n  box-sizing: border-box;\n}\n\n.emotion-1 {\n  z-index: 9999;\n  border: 0;\n  clip: rect(1px, 1px, 1px, 1px);\n  height: 1px;\n  width: 1px;\n  position: absolute;\n  overflow: hidden;\n  padding: 0;\n  white-space: nowrap;\n}\n\n.emotion-3 {\n  -webkit-align-items: center;\n  -webkit-box-align: center;\n  -ms-flex-align: center;\n  align-items: center;\n  cursor: default;\n  display: -webkit-box;\n  display: -webkit-flex;\n  display: -ms-flexbox;\n  display: flex;\n  -webkit-box-flex-wrap: wrap;\n  -webkit-flex-wrap: wrap;\n  -ms-flex-wrap: wrap;\n  flex-wrap: wrap;\n  -webkit-box-pack: justify;\n  -webkit-justify-content: space-between;\n  justify-content: space-between;\n  min-height: 38px;\n  outline: 0!important;\n  position: relative;\n  -webkit-transition: all 100ms;\n  transition: all 100ms;\n  background-color: hsl(0, 0%, 100%);\n  border-color: hsl(0, 0%, 80%);\n  border-radius: 4px;\n  border-style: solid;\n  border-width: 1px;\n  box-sizing: border-box;\n}\n\n.emotion-3:hover {\n  border-color: hsl(0, 0%, 70%);\n}\n\n.emotion-4 {\n  -webkit-align-items: center;\n  -webkit-box-align: center;\n  -ms-flex-align: center;\n  align-items: center;\n  display: grid;\n  -webkit-flex: 1;\n  -ms-flex: 1;\n  flex: 1;\n  -webkit-box-flex-wrap: wrap;\n  -webkit-flex-wrap: wrap;\n  -ms-flex-wrap: wrap;\n  flex-wrap: wrap;\n  -webkit-overflow-scrolling: touch;\n  position: relative;\n  overflow: hidden;\n  padding: 2px 8px;\n  box-sizing: border-box;\n}\n\n.emotion-5 {\n  grid-area: 1/1/2/3;\n  color: hsl(0, 0%, 50%);\n  margin-left: 2px;\n  margin-right: 2px;\n  box-sizing: border-box;\n}\n\n.emotion-6 {\n  visibility: visible;\n  -webkit-flex: 1 1 auto;\n  -ms-flex: 1 1 auto;\n  flex: 1 1 auto;\n  display: inline-grid;\n  grid-area: 1/1/2/3;\n  grid-template-columns: 0 min-content;\n  margin: 2px;\n  padding-bottom: 2px;\n  padding-top: 2px;\n  color: hsl(0, 0%, 20%);\n  box-sizing: border-box;\n}\n\n.emotion-6:after {\n  content: attr(data-value) \" \";\n  visibility: hidden;\n  white-space: pre;\n  grid-area: 1/2;\n  font: inherit;\n  min-width: 2px;\n  border: 0;\n  margin: 0;\n  outline: 0;\n  padding: 0;\n}\n\n.emotion-7 {\n  -webkit-align-items: center;\n  -webkit-box-align: center;\n  -ms-flex-align: center;\n  align-items: center;\n  -webkit-align-self: stretch;\n  -ms-flex-item-align: stretch;\n  align-self: stretch;\n  display: -webkit-box;\n  display: -webkit-flex;\n  display: -ms-flexbox;\n  display: flex;\n  -webkit-flex-shrink: 0;\n  -ms-flex-negative: 0;\n  flex-shrink: 0;\n  box-sizing: border-box;\n}\n\n.emotion-8 {\n  -webkit-align-self: stretch;\n  -ms-flex-item-align: stretch;\n  align-self: stretch;\n  width: 1px;\n  background-color: hsl(0, 0%, 80%);\n  margin-bottom: 8px;\n  margin-top: 8px;\n  box-sizing: border-box;\n}\n\n.emotion-9 {\n  display: -webkit-box;\n  display: -webkit-flex;\n  display: -ms-flexbox;\n  display: flex;\n  -webkit-transition: color 150ms;\n  transition: color 150ms;\n  color: hsl(0, 0%, 80%);\n  padding: 8px;\n  box-sizing: border-box;\n}\n\n.emotion-9:hover {\n  color: hsl(0, 0%, 60%);\n}\n\n.emotion-10 {\n  display: inline-block;\n  fill: currentColor;\n  line-height: 1;\n  stroke: currentColor;\n  stroke-width: 0;\n}\n\n<div>\n  <div\n    class=\" emotion-0\"\n  >\n    <span\n      class=\"emotion-1\"\n      id=\"react-select-2-live-region\"\n    />\n    <span\n      aria-atomic=\"false\"\n      aria-live=\"polite\"\n      aria-relevant=\"additions text\"\n      class=\"emotion-1\"\n      role=\"log\"\n    />\n    <div\n      class=\" emotion-3\"\n    >\n      <div\n        class=\" emotion-4\"\n      >\n        <div\n          class=\" emotion-5\"\n          id=\"react-select-2-placeholder\"\n        >\n          Select...\n        </div>\n        <div\n          class=\" emotion-6\"\n          data-value=\"\"\n        >\n          <input\n            aria-activedescendant=\"\"\n            aria-autocomplete=\"list\"\n            aria-describedby=\"react-select-2-placeholder\"\n            aria-expanded=\"false\"\n            aria-haspopup=\"true\"\n            autocapitalize=\"none\"\n            autocomplete=\"off\"\n            autocorrect=\"off\"\n            class=\"\"\n            id=\"react-select-2-input\"\n            role=\"combobox\"\n            spellcheck=\"false\"\n            style=\"opacity: 1; width: 100%; grid-area: 1 / 2; min-width: 2px; border: 0px; margin: 0px; outline: 0; padding: 0px;\"\n            tabindex=\"0\"\n            type=\"text\"\n            value=\"\"\n          />\n        </div>\n      </div>\n      <div\n        class=\" emotion-7\"\n      >\n        <span\n          class=\" emotion-8\"\n        />\n        <div\n          aria-hidden=\"true\"\n          class=\" emotion-9\"\n        >\n          <svg\n            aria-hidden=\"true\"\n            class=\"emotion-10\"\n            focusable=\"false\"\n            height=\"20\"\n            viewBox=\"0 0 20 20\"\n            width=\"20\"\n          >\n            <path\n              d=\"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z\"\n            />\n          </svg>\n        </div>\n      </div>\n    </div>\n  </div>\n</div>\n`;\n"
  },
  {
    "path": "packages/react-select/src/__tests__/__snapshots__/StateManaged.test.tsx.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`defaults > snapshot 1`] = `\n.emotion-0 {\n  position: relative;\n  box-sizing: border-box;\n}\n\n.emotion-1 {\n  z-index: 9999;\n  border: 0;\n  clip: rect(1px, 1px, 1px, 1px);\n  height: 1px;\n  width: 1px;\n  position: absolute;\n  overflow: hidden;\n  padding: 0;\n  white-space: nowrap;\n}\n\n.emotion-3 {\n  -webkit-align-items: center;\n  -webkit-box-align: center;\n  -ms-flex-align: center;\n  align-items: center;\n  cursor: default;\n  display: -webkit-box;\n  display: -webkit-flex;\n  display: -ms-flexbox;\n  display: flex;\n  -webkit-box-flex-wrap: wrap;\n  -webkit-flex-wrap: wrap;\n  -ms-flex-wrap: wrap;\n  flex-wrap: wrap;\n  -webkit-box-pack: justify;\n  -webkit-justify-content: space-between;\n  justify-content: space-between;\n  min-height: 38px;\n  outline: 0!important;\n  position: relative;\n  -webkit-transition: all 100ms;\n  transition: all 100ms;\n  background-color: hsl(0, 0%, 100%);\n  border-color: hsl(0, 0%, 80%);\n  border-radius: 4px;\n  border-style: solid;\n  border-width: 1px;\n  box-sizing: border-box;\n}\n\n.emotion-3:hover {\n  border-color: hsl(0, 0%, 70%);\n}\n\n.emotion-4 {\n  -webkit-align-items: center;\n  -webkit-box-align: center;\n  -ms-flex-align: center;\n  align-items: center;\n  display: grid;\n  -webkit-flex: 1;\n  -ms-flex: 1;\n  flex: 1;\n  -webkit-box-flex-wrap: wrap;\n  -webkit-flex-wrap: wrap;\n  -ms-flex-wrap: wrap;\n  flex-wrap: wrap;\n  -webkit-overflow-scrolling: touch;\n  position: relative;\n  overflow: hidden;\n  padding: 2px 8px;\n  box-sizing: border-box;\n}\n\n.emotion-5 {\n  grid-area: 1/1/2/3;\n  color: hsl(0, 0%, 50%);\n  margin-left: 2px;\n  margin-right: 2px;\n  box-sizing: border-box;\n}\n\n.emotion-6 {\n  visibility: visible;\n  -webkit-flex: 1 1 auto;\n  -ms-flex: 1 1 auto;\n  flex: 1 1 auto;\n  display: inline-grid;\n  grid-area: 1/1/2/3;\n  grid-template-columns: 0 min-content;\n  margin: 2px;\n  padding-bottom: 2px;\n  padding-top: 2px;\n  color: hsl(0, 0%, 20%);\n  box-sizing: border-box;\n}\n\n.emotion-6:after {\n  content: attr(data-value) \" \";\n  visibility: hidden;\n  white-space: pre;\n  grid-area: 1/2;\n  font: inherit;\n  min-width: 2px;\n  border: 0;\n  margin: 0;\n  outline: 0;\n  padding: 0;\n}\n\n.emotion-7 {\n  -webkit-align-items: center;\n  -webkit-box-align: center;\n  -ms-flex-align: center;\n  align-items: center;\n  -webkit-align-self: stretch;\n  -ms-flex-item-align: stretch;\n  align-self: stretch;\n  display: -webkit-box;\n  display: -webkit-flex;\n  display: -ms-flexbox;\n  display: flex;\n  -webkit-flex-shrink: 0;\n  -ms-flex-negative: 0;\n  flex-shrink: 0;\n  box-sizing: border-box;\n}\n\n.emotion-8 {\n  -webkit-align-self: stretch;\n  -ms-flex-item-align: stretch;\n  align-self: stretch;\n  width: 1px;\n  background-color: hsl(0, 0%, 80%);\n  margin-bottom: 8px;\n  margin-top: 8px;\n  box-sizing: border-box;\n}\n\n.emotion-9 {\n  display: -webkit-box;\n  display: -webkit-flex;\n  display: -ms-flexbox;\n  display: flex;\n  -webkit-transition: color 150ms;\n  transition: color 150ms;\n  color: hsl(0, 0%, 80%);\n  padding: 8px;\n  box-sizing: border-box;\n}\n\n.emotion-9:hover {\n  color: hsl(0, 0%, 60%);\n}\n\n.emotion-10 {\n  display: inline-block;\n  fill: currentColor;\n  line-height: 1;\n  stroke: currentColor;\n  stroke-width: 0;\n}\n\n<div>\n  <div\n    class=\" emotion-0\"\n  >\n    <span\n      class=\"emotion-1\"\n      id=\"react-select-2-live-region\"\n    />\n    <span\n      aria-atomic=\"false\"\n      aria-live=\"polite\"\n      aria-relevant=\"additions text\"\n      class=\"emotion-1\"\n      role=\"log\"\n    />\n    <div\n      class=\" emotion-3\"\n    >\n      <div\n        class=\" emotion-4\"\n      >\n        <div\n          class=\" emotion-5\"\n          id=\"react-select-2-placeholder\"\n        >\n          Select...\n        </div>\n        <div\n          class=\" emotion-6\"\n          data-value=\"\"\n        >\n          <input\n            aria-activedescendant=\"\"\n            aria-autocomplete=\"list\"\n            aria-describedby=\"react-select-2-placeholder\"\n            aria-expanded=\"false\"\n            aria-haspopup=\"true\"\n            autocapitalize=\"none\"\n            autocomplete=\"off\"\n            autocorrect=\"off\"\n            class=\"\"\n            id=\"react-select-2-input\"\n            role=\"combobox\"\n            spellcheck=\"false\"\n            style=\"opacity: 1; width: 100%; grid-area: 1 / 2; min-width: 2px; border: 0px; margin: 0px; outline: 0; padding: 0px;\"\n            tabindex=\"0\"\n            type=\"text\"\n            value=\"\"\n          />\n        </div>\n      </div>\n      <div\n        class=\" emotion-7\"\n      >\n        <span\n          class=\" emotion-8\"\n        />\n        <div\n          aria-hidden=\"true\"\n          class=\" emotion-9\"\n        >\n          <svg\n            aria-hidden=\"true\"\n            class=\"emotion-10\"\n            focusable=\"false\"\n            height=\"20\"\n            viewBox=\"0 0 20 20\"\n            width=\"20\"\n          >\n            <path\n              d=\"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z\"\n            />\n          </svg>\n        </div>\n      </div>\n    </div>\n  </div>\n</div>\n`;\n"
  },
  {
    "path": "packages/react-select/src/__tests__/constants.ts",
    "content": "export interface Option {\n  readonly label: string;\n  readonly value: string;\n}\n\nexport const OPTIONS: readonly Option[] = [\n  { label: '0', value: 'zero' },\n  { label: '1', value: 'one' },\n  { label: '2', value: 'two' },\n  { label: '3', value: 'three' },\n  { label: '4', value: 'four' },\n  { label: '5', value: 'five' },\n  { label: '6', value: 'six' },\n  { label: '7', value: 'seven' },\n  { label: '8', value: 'eight' },\n  { label: '9', value: 'nine' },\n  { label: '10', value: 'ten' },\n  { label: '11', value: 'eleven' },\n  { label: '12', value: 'twelve' },\n  { label: '13', value: 'thirteen' },\n  { label: '14', value: 'fourteen' },\n  { label: '15', value: 'fifteen' },\n  { label: '16', value: 'sixteen' },\n];\n\nexport interface OptionDisabled {\n  readonly label: string;\n  readonly value: string;\n  readonly isDisabled?: boolean;\n}\n\nexport const OPTIONS_DISABLED: readonly OptionDisabled[] = [\n  { label: '0', value: 'zero' },\n  { label: '1', value: 'one', isDisabled: true },\n  { label: '2', value: 'two' },\n  { label: '3', value: 'three' },\n  { label: '4', value: 'four' },\n  { label: '5', value: 'five' },\n  { label: '6', value: 'six' },\n  { label: '7', value: 'seven' },\n  { label: '8', value: 'eight' },\n  { label: '9', value: 'nine' },\n  { label: '10', value: 'ten' },\n  { label: '11', value: 'eleven' },\n  { label: '12', value: 'twelve' },\n  { label: '13', value: 'thirteen' },\n  { label: '14', value: 'fourteen' },\n  { label: '15', value: 'fifteen' },\n  { label: '16', value: 'sixteen' },\n];\n\nexport interface OptionNumberValue {\n  readonly label: string;\n  readonly value: number;\n}\n\nexport const OPTIONS_NUMBER_VALUE: readonly OptionNumberValue[] = [\n  { label: '0', value: 0 },\n  { label: '1', value: 1 },\n  { label: '2', value: 2 },\n  { label: '3', value: 3 },\n  { label: '4', value: 4 },\n  { label: '5', value: 5 },\n  { label: '6', value: 6 },\n  { label: '7', value: 7 },\n  { label: '8', value: 8 },\n  { label: '9', value: 9 },\n  { label: '10', value: 10 },\n];\n\nexport interface OptionBooleanValue {\n  readonly label: string;\n  readonly value: boolean;\n}\n\nexport const OPTIONS_BOOLEAN_VALUE: readonly OptionBooleanValue[] = [\n  { label: 'true', value: true },\n  { label: 'false', value: false },\n];\n\nexport interface OptionAccented {\n  readonly label: string;\n  readonly value: string;\n}\n\nexport const OPTIONS_ACCENTED: readonly OptionAccented[] = [\n  { label: 'school', value: 'en' },\n  { label: 'école', value: 'fr' },\n];\n\nexport interface GroupedOption {\n  readonly label: string;\n  readonly options:\n    | readonly OptionNumberValue[]\n    | readonly OptionBooleanValue[];\n}\n\nexport const OPTIONS_GROUPED: readonly GroupedOption[] = [\n  {\n    label: 'Numbers',\n    options: OPTIONS_NUMBER_VALUE,\n  },\n  {\n    label: 'Booleans',\n    options: OPTIONS_BOOLEAN_VALUE,\n  },\n];\n"
  },
  {
    "path": "packages/react-select/src/__tests__/tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"target\": \"es6\",\n    \"module\": \"commonjs\",\n    \"jsx\": \"react\",\n    \"noEmit\": true,\n    \"strict\": true,\n    \"esModuleInterop\": true,\n    \"forceConsistentCasingInFileNames\": true,\n    \"resolveJsonModule\": true\n  }\n}\n"
  },
  {
    "path": "packages/react-select/src/accessibility/helpers.ts",
    "content": "/// <reference types=\"user-agent-data-types\" />\n\nfunction testPlatform(re: RegExp) {\n  return typeof window !== 'undefined' && window.navigator != null\n    ? re.test(\n        window.navigator['userAgentData']?.platform || window.navigator.platform\n      )\n    : false;\n}\n\nexport function isIPhone() {\n  return testPlatform(/^iPhone/i);\n}\n\nexport function isMac() {\n  return testPlatform(/^Mac/i);\n}\n\nexport function isIPad() {\n  return (\n    testPlatform(/^iPad/i) ||\n    // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.\n    (isMac() && navigator.maxTouchPoints > 1)\n  );\n}\n\nexport function isIOS() {\n  return isIPhone() || isIPad();\n}\n\nexport function isAppleDevice() {\n  return isMac() || isIOS();\n}\n"
  },
  {
    "path": "packages/react-select/src/accessibility/index.ts",
    "content": "import type { AriaAttributes } from 'react';\nimport {\n  ActionMeta,\n  GroupBase,\n  InitialInputFocusedActionMeta,\n  OnChangeValue,\n  Options,\n  OptionsOrGroups,\n} from '../types';\n\nexport type OptionContext = 'menu' | 'value';\n\nexport type GuidanceContext = 'menu' | 'input' | 'value';\n\nexport type AriaSelection<Option, IsMulti extends boolean> =\n  | InitialInputFocusedActionMeta<Option, IsMulti>\n  | (ActionMeta<Option> & {\n      value: OnChangeValue<Option, IsMulti>;\n      option?: Option;\n      options?: Options<Option>;\n    });\n\nexport interface AriaGuidanceProps {\n  /** String value of selectProp aria-label */\n  'aria-label': AriaAttributes['aria-label'];\n  /** String indicating user's current context and available keyboard interactivity */\n  context: GuidanceContext;\n  /** Boolean value of selectProp isSearchable */\n  isSearchable: boolean;\n  /** Boolean value of selectProp isMulti */\n  isMulti: boolean;\n  /** Boolean value of selectProp isDisabled */\n  isDisabled: boolean | null;\n  /** Boolean value of selectProp tabSelectsValue */\n  tabSelectsValue: boolean;\n  /** Boolean value indicating if user focused the input for the first time */\n  isInitialFocus: boolean;\n}\n\nexport type AriaOnChangeProps<Option, IsMulti extends boolean> = AriaSelection<\n  Option,\n  IsMulti\n> & {\n  /** String derived label from selected or removed option/value */\n  label: string;\n  /** Array of labels derived from multiple selected or cleared options */\n  labels: string[];\n  /** Boolean indicating if the selected menu option is disabled */\n  isDisabled: boolean | null;\n};\n\nexport interface AriaOnFilterProps {\n  /** String indicating current inputValue of the input */\n  inputValue: string;\n  /** String derived from selectProp screenReaderStatus */\n  resultsMessage: string;\n}\n\nexport interface AriaOnFocusProps<Option, Group extends GroupBase<Option>> {\n  /** String indicating whether the option was focused in the menu or as (multi-) value */\n  context: OptionContext;\n  /** Option that is being focused */\n  focused: Option;\n  /** Boolean indicating whether focused menu option has been disabled */\n  isDisabled: boolean;\n  /** Boolean indicating whether focused menu option is an already selected option */\n  isSelected: boolean;\n  /** String derived label from focused option/value */\n  label: string;\n  /** Options provided as props to Select used to determine indexing */\n  options: OptionsOrGroups<Option, Group>;\n  /** selected option(s) of the Select */\n  selectValue: Options<Option>;\n  /** Boolean indicating whether user uses Apple device */\n  isAppleDevice: boolean;\n}\n\nexport type AriaGuidance = (props: AriaGuidanceProps) => string;\nexport type AriaOnChange<Option, IsMulti extends boolean> = (\n  props: AriaOnChangeProps<Option, IsMulti>\n) => string;\nexport type AriaOnFilter = (props: AriaOnFilterProps) => string;\nexport type AriaOnFocus<\n  Option,\n  Group extends GroupBase<Option> = GroupBase<Option>\n> = (props: AriaOnFocusProps<Option, Group>) => string;\n\nexport interface AriaLiveMessages<\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n> {\n  /** Guidance message used to convey component state and specific keyboard interactivity */\n  guidance?: (props: AriaGuidanceProps) => string;\n  /** OnChange message used to convey changes to value but also called when user selects disabled option */\n  onChange?: (props: AriaOnChangeProps<Option, IsMulti>) => string;\n  /** OnFilter message used to convey information about filtered results displayed in the menu */\n  onFilter?: (props: AriaOnFilterProps) => string;\n  /** OnFocus message used to convey information about the currently focused option or value */\n  onFocus?: (props: AriaOnFocusProps<Option, Group>) => string;\n}\n\nexport const defaultAriaLiveMessages = {\n  guidance: (props: AriaGuidanceProps) => {\n    const { isSearchable, isMulti, tabSelectsValue, context, isInitialFocus } =\n      props;\n    switch (context) {\n      case 'menu':\n        return `Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu${\n          tabSelectsValue\n            ? ', press Tab to select the option and exit the menu'\n            : ''\n        }.`;\n      case 'input':\n        return isInitialFocus\n          ? `${props['aria-label'] || 'Select'} is focused ${\n              isSearchable ? ',type to refine list' : ''\n            }, press Down to open the menu, ${\n              isMulti ? ' press left to focus selected values' : ''\n            }`\n          : '';\n      case 'value':\n        return 'Use left and right to toggle between focused values, press Backspace to remove the currently focused value';\n      default:\n        return '';\n    }\n  },\n\n  onChange: <Option, IsMulti extends boolean>(\n    props: AriaOnChangeProps<Option, IsMulti>\n  ) => {\n    const { action, label = '', labels, isDisabled } = props;\n    switch (action) {\n      case 'deselect-option':\n      case 'pop-value':\n      case 'remove-value':\n        return `option ${label}, deselected.`;\n      case 'clear':\n        return 'All selected options have been cleared.';\n      case 'initial-input-focus':\n        return `option${labels.length > 1 ? 's' : ''} ${labels.join(\n          ','\n        )}, selected.`;\n      case 'select-option':\n        return isDisabled\n          ? `option ${label} is disabled. Select another option.`\n          : `option ${label}, selected.`;\n      default:\n        return '';\n    }\n  },\n\n  onFocus: <Option, Group extends GroupBase<Option>>(\n    props: AriaOnFocusProps<Option, Group>\n  ) => {\n    const {\n      context,\n      focused,\n      options,\n      label = '',\n      selectValue,\n      isDisabled,\n      isSelected,\n      isAppleDevice,\n    } = props;\n\n    const getArrayIndex = (arr: OptionsOrGroups<Option, Group>, item: Option) =>\n      arr && arr.length ? `${arr.indexOf(item) + 1} of ${arr.length}` : '';\n\n    if (context === 'value' && selectValue) {\n      return `value ${label} focused, ${getArrayIndex(selectValue, focused)}.`;\n    }\n\n    if (context === 'menu' && isAppleDevice) {\n      const disabled = isDisabled ? ' disabled' : '';\n      const status = `${isSelected ? ' selected' : ''}${disabled}`;\n      return `${label}${status}, ${getArrayIndex(options, focused)}.`;\n    }\n    return '';\n  },\n\n  onFilter: (props: AriaOnFilterProps) => {\n    const { inputValue, resultsMessage } = props;\n    return `${resultsMessage}${\n      inputValue ? ' for search term ' + inputValue : ''\n    }.`;\n  },\n};\n"
  },
  {
    "path": "packages/react-select/src/animated/Input.tsx",
    "content": "import * as React from 'react';\nimport { ReactElement } from 'react';\nimport { TransitionProps } from 'react-transition-group/Transition';\nimport { InputProps } from '../components/Input';\nimport { GroupBase } from '../types';\n\nexport type InputComponent = <\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>(\n  props: InputProps<Option, IsMulti, Group>\n) => ReactElement;\n\nexport type AnimatedInputProps<\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n> = InputProps<Option, IsMulti, Group> & Partial<TransitionProps>;\n\n// strip transition props off before spreading onto select component\nconst AnimatedInput = (WrappedComponent: InputComponent): InputComponent => {\n  return <Option, IsMulti extends boolean, Group extends GroupBase<Option>>({\n    in: inProp,\n    onExited,\n    appear,\n    enter,\n    exit,\n    ...props\n  }: AnimatedInputProps<Option, IsMulti, Group>) => (\n    <WrappedComponent {...props} />\n  );\n};\n\nexport default AnimatedInput;\n"
  },
  {
    "path": "packages/react-select/src/animated/MultiValue.tsx",
    "content": "import * as React from 'react';\nimport { ReactElement } from 'react';\nimport { TransitionProps } from 'react-transition-group/Transition';\nimport { MultiValueProps } from '../components/MultiValue';\nimport { Collapse } from './transitions';\nimport { GroupBase } from '../types';\n\nexport type MultiValueComponent = <\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>(\n  props: MultiValueProps<Option, IsMulti, Group>\n) => ReactElement;\n\nexport type AnimatedMultiValueProps<\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n> = MultiValueProps<Option, IsMulti, Group> & Partial<TransitionProps>;\n\n// strip transition props off before spreading onto actual component\n\nconst AnimatedMultiValue = (WrappedComponent: MultiValueComponent) => {\n  return <Option, IsMulti extends boolean, Group extends GroupBase<Option>>({\n    in: inProp,\n    onExited,\n    ...props\n  }: AnimatedMultiValueProps<Option, IsMulti, Group>) => (\n    <Collapse in={inProp} onExited={onExited}>\n      <WrappedComponent cropWithEllipsis={inProp} {...props} />\n    </Collapse>\n  );\n};\n\nexport default AnimatedMultiValue;\n"
  },
  {
    "path": "packages/react-select/src/animated/Placeholder.tsx",
    "content": "import * as React from 'react';\nimport { ReactElement } from 'react';\nimport { PlaceholderProps } from '../components/Placeholder';\nimport { Fade, collapseDuration } from './transitions';\nimport { GroupBase } from '../types';\n\nexport type PlaceholderComponent = <\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>(\n  props: PlaceholderProps<Option, IsMulti, Group>\n) => ReactElement;\n\n// fade in when last multi-value removed, otherwise instant\nconst AnimatedPlaceholder =\n  (WrappedComponent: PlaceholderComponent) =>\n  <Option, IsMulti extends boolean, Group extends GroupBase<Option>>(\n    props: PlaceholderProps<Option, IsMulti, Group>\n  ) =>\n    (\n      <Fade<PlaceholderProps<Option, IsMulti, Group>>\n        component={WrappedComponent}\n        duration={props.isMulti ? collapseDuration : 1}\n        {...props}\n      />\n    );\n\nexport default AnimatedPlaceholder;\n"
  },
  {
    "path": "packages/react-select/src/animated/SingleValue.tsx",
    "content": "import * as React from 'react';\nimport { ReactElement } from 'react';\nimport { SingleValueProps } from '../components/SingleValue';\nimport { Fade } from './transitions';\nimport { GroupBase } from '../types';\n\nexport type SingleValueComponent = <\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>(\n  props: SingleValueProps<Option, IsMulti, Group>\n) => ReactElement;\n\n// instant fade; all transition-group children must be transitions\n\nconst AnimatedSingleValue =\n  (WrappedComponent: SingleValueComponent) =>\n  <Option, IsMulti extends boolean, Group extends GroupBase<Option>>(\n    props: SingleValueProps<Option, IsMulti, Group>\n  ) =>\n    (\n      <Fade<SingleValueProps<Option, IsMulti, Group>>\n        component={WrappedComponent}\n        {...props}\n      />\n    );\n\nexport default AnimatedSingleValue;\n"
  },
  {
    "path": "packages/react-select/src/animated/ValueContainer.tsx",
    "content": "import * as React from 'react';\nimport { useEffect, useState, ReactElement, ReactNode } from 'react';\nimport { TransitionGroup } from 'react-transition-group';\nimport { ValueContainerProps } from '../components/containers';\nimport { GroupBase } from '../types';\n\nexport type ValueContainerComponent = <\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>(\n  props: ValueContainerProps<Option, IsMulti, Group>\n) => ReactElement;\n\ninterface IsMultiValueContainerProps extends ValueContainerProps {\n  component: ValueContainerComponent;\n}\n\n// make ValueContainer a transition group\nconst AnimatedValueContainer =\n  (WrappedComponent: ValueContainerComponent) =>\n  <Option, IsMulti extends boolean, Group extends GroupBase<Option>>(\n    props: ValueContainerProps<Option, IsMulti, Group>\n  ) =>\n    props.isMulti ? (\n      <IsMultiValueContainer component={WrappedComponent} {...(props as any)} />\n    ) : (\n      <TransitionGroup component={WrappedComponent} {...(props as any)} />\n    );\n\nconst IsMultiValueContainer = ({\n  component,\n  ...restProps\n}: IsMultiValueContainerProps) => {\n  const multiProps = useIsMultiValueContainer(restProps);\n\n  return <TransitionGroup component={component} {...(multiProps as any)} />;\n};\n\nconst useIsMultiValueContainer = ({\n  children,\n  ...props\n}: ValueContainerProps) => {\n  const {\n    isMulti,\n    hasValue,\n    innerProps,\n    selectProps: { components, controlShouldRenderValue },\n  } = props;\n\n  const [cssDisplayFlex, setCssDisplayFlex] = useState(\n    isMulti && controlShouldRenderValue && hasValue\n  );\n  const [removingValue, setRemovingValue] = useState(false);\n\n  useEffect(() => {\n    if (hasValue && !cssDisplayFlex) {\n      setCssDisplayFlex(true);\n    }\n  }, [hasValue, cssDisplayFlex]);\n\n  useEffect(() => {\n    if (removingValue && !hasValue && cssDisplayFlex) {\n      setCssDisplayFlex(false);\n    }\n    setRemovingValue(false);\n  }, [removingValue, hasValue, cssDisplayFlex]);\n\n  const onExited = () => setRemovingValue(true);\n\n  const childMapper = (child: ReactNode) => {\n    if (isMulti && React.isValidElement(child)) {\n      // Add onExited callback to MultiValues\n      if (child.type === components.MultiValue) {\n        return React.cloneElement(child, { onExited });\n      }\n      // While container flexed, Input cursor is shown after Placeholder text,\n      // so remove Placeholder until display is set back to grid\n      if (child.type === components.Placeholder && cssDisplayFlex) {\n        return null;\n      }\n    }\n    return child;\n  };\n\n  const newInnerProps = {\n    ...innerProps,\n    style: {\n      ...innerProps?.style,\n      display: (isMulti && hasValue) || cssDisplayFlex ? 'flex' : 'grid',\n    },\n  };\n\n  const newProps = {\n    ...props,\n    innerProps: newInnerProps,\n    children: React.Children.toArray(children).map(childMapper),\n  };\n\n  return newProps;\n};\n\nexport default AnimatedValueContainer;\n"
  },
  {
    "path": "packages/react-select/src/animated/index.ts",
    "content": "import memoize from 'memoize-one';\nimport {\n  defaultComponents,\n  SelectComponentsGeneric,\n} from '../components/index';\nimport { default as AnimatedInput } from './Input';\nimport { default as AnimatedMultiValue } from './MultiValue';\nimport { default as AnimatedPlaceholder } from './Placeholder';\nimport { default as AnimatedSingleValue } from './SingleValue';\nimport { default as AnimatedValueContainer } from './ValueContainer';\n\nconst makeAnimated = (\n  externalComponents: Partial<SelectComponentsGeneric> = {}\n): Partial<SelectComponentsGeneric> => {\n  const components = defaultComponents({ components: externalComponents });\n  const {\n    Input,\n    MultiValue,\n    Placeholder,\n    SingleValue,\n    ValueContainer,\n    ...rest\n  } = components;\n  return {\n    Input: AnimatedInput(Input),\n    MultiValue: AnimatedMultiValue(MultiValue),\n    Placeholder: AnimatedPlaceholder(Placeholder),\n    SingleValue: AnimatedSingleValue(SingleValue),\n    ValueContainer: AnimatedValueContainer(ValueContainer),\n    ...rest,\n  };\n};\n\nconst AnimatedComponents = makeAnimated();\n\nexport const Input = AnimatedComponents.Input;\nexport const MultiValue = AnimatedComponents.MultiValue;\nexport const Placeholder = AnimatedComponents.Placeholder;\nexport const SingleValue = AnimatedComponents.SingleValue;\nexport const ValueContainer = AnimatedComponents.ValueContainer;\n\nexport default memoize(makeAnimated);\n"
  },
  {
    "path": "packages/react-select/src/animated/transitions.tsx",
    "content": "import * as React from 'react';\nimport { useEffect, useState } from 'react';\nimport { ComponentType, CSSProperties, ReactNode, useRef } from 'react';\nimport { Transition } from 'react-transition-group';\nimport {\n  ExitHandler,\n  TransitionStatus,\n} from 'react-transition-group/Transition';\n\n// ==============================\n// Fade Transition\n// ==============================\n\ntype FadeProps<ComponentProps> = {\n  component: ComponentType<ComponentProps>;\n  in?: boolean;\n  onExited?: ExitHandler<undefined | HTMLElement>;\n  duration?: number;\n} & ComponentProps;\nexport const Fade = <ComponentProps extends {}>({\n  component: Tag,\n  duration = 1,\n  in: inProp,\n  onExited,\n  ...props\n}: FadeProps<ComponentProps>) => {\n  const nodeRef = useRef<HTMLElement>(null);\n\n  const transition: { [K in TransitionStatus]?: CSSProperties } = {\n    entering: { opacity: 0 },\n    entered: { opacity: 1, transition: `opacity ${duration}ms` },\n    exiting: { opacity: 0 },\n    exited: { opacity: 0 },\n  };\n\n  return (\n    <Transition\n      mountOnEnter\n      unmountOnExit\n      in={inProp}\n      timeout={duration}\n      nodeRef={nodeRef}\n    >\n      {(state) => {\n        const innerProps = {\n          style: {\n            ...transition[state],\n          },\n          ref: nodeRef,\n        };\n        return <Tag innerProps={innerProps} {...(props as any)} />;\n      }}\n    </Transition>\n  );\n};\n\n// ==============================\n// Collapse Transition\n// ==============================\n\nexport const collapseDuration = 260;\n\ntype Width = number | 'auto';\ninterface CollapseProps {\n  children: ReactNode;\n  in?: boolean;\n  onExited?: ExitHandler<undefined | HTMLElement>;\n}\n\n// wrap each MultiValue with a collapse transition; decreases width until\n// finally removing from DOM\nexport const Collapse = ({ children, in: _in, onExited }: CollapseProps) => {\n  const ref = useRef<HTMLDivElement>(null);\n  const [width, setWidth] = useState<Width>('auto');\n\n  useEffect(() => {\n    const el = ref.current;\n    if (!el) return;\n\n    /*\n      Here we're invoking requestAnimationFrame with a callback invoking our\n      call to getBoundingClientRect and setState in order to resolve an edge case\n      around portalling. Certain portalling solutions briefly remove children from the DOM\n      before appending them to the target node. This is to avoid us trying to call getBoundingClientrect\n      while the Select component is in this state.\n    */\n    // cannot use `offsetWidth` because it is rounded\n    const rafId = window.requestAnimationFrame(() =>\n      setWidth(el.getBoundingClientRect().width)\n    );\n\n    return () => window.cancelAnimationFrame(rafId);\n  }, []);\n\n  const getStyleFromStatus = (status: TransitionStatus) => {\n    switch (status) {\n      default:\n        return { width };\n      case 'exiting':\n        return { width: 0, transition: `width ${collapseDuration}ms ease-out` };\n      case 'exited':\n        return { width: 0 };\n    }\n  };\n\n  return (\n    <Transition\n      enter={false}\n      mountOnEnter\n      unmountOnExit\n      in={_in}\n      onExited={() => {\n        const el = ref.current;\n        if (!el) return;\n        onExited?.(el);\n      }}\n      timeout={collapseDuration}\n      nodeRef={ref}\n    >\n      {(status) => (\n        <div\n          ref={ref}\n          style={{\n            overflow: 'hidden',\n            whiteSpace: 'nowrap',\n            ...getStyleFromStatus(status),\n          }}\n        >\n          {children}\n        </div>\n      )}\n    </Transition>\n  );\n};\n"
  },
  {
    "path": "packages/react-select/src/async/index.ts",
    "content": "export * from '../Async';\nexport { default } from '../Async';\n"
  },
  {
    "path": "packages/react-select/src/async-creatable/index.ts",
    "content": "export * from '../AsyncCreatable';\nexport { default } from '../AsyncCreatable';\n"
  },
  {
    "path": "packages/react-select/src/base/index.ts",
    "content": "export * from '../Select';\nexport { default } from '../Select';\n"
  },
  {
    "path": "packages/react-select/src/builtins.ts",
    "content": "import { GroupBase } from './types';\n\nexport const formatGroupLabel = <Option, Group extends GroupBase<Option>>(\n  group: Group\n): string => group.label as string;\n\nexport const getOptionLabel = <Option>(option: Option): string =>\n  (option as { label?: unknown }).label as string;\n\nexport const getOptionValue = <Option>(option: Option): string =>\n  (option as { value?: unknown }).value as string;\n\nexport const isOptionDisabled = <Option>(option: Option): boolean =>\n  !!(option as { isDisabled?: unknown }).isDisabled;\n"
  },
  {
    "path": "packages/react-select/src/components/Control.tsx",
    "content": "/** @jsx jsx */\nimport { JSX, ReactNode, Ref } from 'react';\nimport { jsx } from '@emotion/react';\n\nimport {\n  CommonPropsAndClassName,\n  CSSObjectWithLabel,\n  GroupBase,\n} from '../types';\nimport { getStyleProps } from '../utils';\n\nexport interface ControlProps<\n  Option = unknown,\n  IsMulti extends boolean = boolean,\n  Group extends GroupBase<Option> = GroupBase<Option>\n> extends CommonPropsAndClassName<Option, IsMulti, Group> {\n  /** Children to render. */\n  children: ReactNode;\n  innerRef: Ref<HTMLDivElement>;\n  /** The mouse down event and the innerRef to pass down to the controller element. */\n  innerProps: JSX.IntrinsicElements['div'];\n  /** Whether the select is disabled. */\n  isDisabled: boolean;\n  /** Whether the select is focused. */\n  isFocused: boolean;\n  /** Whether the select is expanded. */\n  menuIsOpen: boolean;\n}\n\nexport const css = <\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>(\n  {\n    isDisabled,\n    isFocused,\n    theme: { colors, borderRadius, spacing },\n  }: ControlProps<Option, IsMulti, Group>,\n  unstyled: boolean\n): CSSObjectWithLabel => ({\n  label: 'control',\n  alignItems: 'center',\n  cursor: 'default',\n  display: 'flex',\n  flexWrap: 'wrap',\n  justifyContent: 'space-between',\n  minHeight: spacing.controlHeight,\n  outline: '0 !important',\n  position: 'relative',\n  transition: 'all 100ms',\n  ...(unstyled\n    ? {}\n    : {\n        backgroundColor: isDisabled ? colors.neutral5 : colors.neutral0,\n        borderColor: isDisabled\n          ? colors.neutral10\n          : isFocused\n          ? colors.primary\n          : colors.neutral20,\n        borderRadius: borderRadius,\n        borderStyle: 'solid',\n        borderWidth: 1,\n        boxShadow: isFocused ? `0 0 0 1px ${colors.primary}` : undefined,\n        '&:hover': {\n          borderColor: isFocused ? colors.primary : colors.neutral30,\n        },\n      }),\n});\n\nconst Control = <\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>(\n  props: ControlProps<Option, IsMulti, Group>\n) => {\n  const { children, isDisabled, isFocused, innerRef, innerProps, menuIsOpen } =\n    props;\n  return (\n    <div\n      ref={innerRef}\n      {...getStyleProps(props, 'control', {\n        control: true,\n        'control--is-disabled': isDisabled,\n        'control--is-focused': isFocused,\n        'control--menu-is-open': menuIsOpen,\n      })}\n      {...innerProps}\n      aria-disabled={isDisabled || undefined}\n    >\n      {children}\n    </div>\n  );\n};\n\nexport default Control;\n"
  },
  {
    "path": "packages/react-select/src/components/Group.tsx",
    "content": "/** @jsx jsx */\nimport { ComponentType, JSX, ReactNode } from 'react';\nimport { jsx } from '@emotion/react';\nimport { cleanCommonProps, getStyleProps } from '../utils';\n\nimport {\n  CommonProps,\n  CommonPropsAndClassName,\n  CSSObjectWithLabel,\n  CX,\n  GetStyles,\n  GroupBase,\n  Options,\n  Theme,\n} from '../types';\nimport { Props } from '../Select';\n\nexport interface ForwardedHeadingProps<\n  Option,\n  Group extends GroupBase<Option>\n> {\n  id: string;\n  data: Group;\n}\n\nexport interface GroupProps<\n  Option = unknown,\n  IsMulti extends boolean = boolean,\n  Group extends GroupBase<Option> = GroupBase<Option>\n> extends CommonPropsAndClassName<Option, IsMulti, Group> {\n  /** The children to be rendered. */\n  children: ReactNode;\n  /** Component to wrap the label, receives headingProps. */\n  Heading: ComponentType<GroupHeadingProps<Option, IsMulti, Group>>;\n  /** Props to pass to Heading. */\n  headingProps: ForwardedHeadingProps<Option, Group>;\n  /** Props to be passed to the group element. */\n  innerProps: JSX.IntrinsicElements['div'];\n  /** Label to be displayed in the heading component. */\n  label: ReactNode;\n  /** The data of the group. */\n  data: Group;\n  options: Options<Option>;\n}\n\nexport const groupCSS = <\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>(\n  { theme: { spacing } }: GroupProps<Option, IsMulti, Group>,\n  unstyled: boolean\n): CSSObjectWithLabel =>\n  unstyled\n    ? {}\n    : {\n        paddingBottom: spacing.baseUnit * 2,\n        paddingTop: spacing.baseUnit * 2,\n      };\n\nconst Group = <\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>(\n  props: GroupProps<Option, IsMulti, Group>\n) => {\n  const {\n    children,\n    cx,\n    getStyles,\n    getClassNames,\n    Heading,\n    headingProps,\n    innerProps,\n    label,\n    theme,\n    selectProps,\n  } = props;\n  return (\n    <div {...getStyleProps(props, 'group', { group: true })} {...innerProps}>\n      <Heading\n        {...headingProps}\n        selectProps={selectProps}\n        theme={theme}\n        getStyles={getStyles}\n        getClassNames={getClassNames}\n        cx={cx}\n      >\n        {label}\n      </Heading>\n      <div>{children}</div>\n    </div>\n  );\n};\n\ninterface GroupHeadingPropsDefinedProps<\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n> extends ForwardedHeadingProps<Option, Group> {\n  className?: string | undefined;\n  selectProps: Props<Option, IsMulti, Group>;\n  theme: Theme;\n  getStyles: GetStyles<Option, IsMulti, Group>;\n  getClassNames: CommonProps<Option, IsMulti, Group>['getClassNames'];\n  cx: CX;\n}\n\nexport type GroupHeadingProps<\n  Option = unknown,\n  IsMulti extends boolean = boolean,\n  Group extends GroupBase<Option> = GroupBase<Option>\n> = GroupHeadingPropsDefinedProps<Option, IsMulti, Group> &\n  JSX.IntrinsicElements['div'];\n\nexport const groupHeadingCSS = <\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>(\n  { theme: { colors, spacing } }: GroupHeadingProps<Option, IsMulti, Group>,\n  unstyled: boolean\n): CSSObjectWithLabel => ({\n  label: 'group',\n  cursor: 'default',\n  display: 'block',\n  ...(unstyled\n    ? {}\n    : {\n        color: colors.neutral40,\n        fontSize: '75%',\n        fontWeight: 500,\n        marginBottom: '0.25em',\n        paddingLeft: spacing.baseUnit * 3,\n        paddingRight: spacing.baseUnit * 3,\n        textTransform: 'uppercase',\n      }),\n});\n\nexport const GroupHeading = <\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>(\n  props: GroupHeadingProps<Option, IsMulti, Group>\n) => {\n  const { data, ...innerProps } = cleanCommonProps(props);\n  return (\n    <div\n      {...getStyleProps(props, 'groupHeading', { 'group-heading': true })}\n      {...innerProps}\n    />\n  );\n};\n\nexport default Group;\n"
  },
  {
    "path": "packages/react-select/src/components/Input.tsx",
    "content": "/** @jsx jsx */\nimport { InputHTMLAttributes } from 'react';\nimport { jsx } from '@emotion/react';\n\nimport {\n  CommonPropsAndClassName,\n  CSSObjectWithLabel,\n  GroupBase,\n} from '../types';\nimport { cleanCommonProps, getStyleProps } from '../utils';\n\nexport interface InputSpecificProps<\n  Option = unknown,\n  IsMulti extends boolean = boolean,\n  Group extends GroupBase<Option> = GroupBase<Option>\n> extends InputHTMLAttributes<HTMLInputElement>,\n    CommonPropsAndClassName<Option, IsMulti, Group> {\n  /** Reference to the internal element */\n  innerRef?: (instance: HTMLInputElement | null) => void;\n  /** Set whether the input should be visible. Does not affect input size. */\n  isHidden: boolean;\n  /** Whether the input is disabled */\n  isDisabled?: boolean;\n  /** The ID of the form that the input belongs to */\n  form?: string;\n  /** Set className for the input element */\n  inputClassName?: string;\n}\n\nexport type InputProps<\n  Option = unknown,\n  IsMulti extends boolean = boolean,\n  Group extends GroupBase<Option> = GroupBase<Option>\n> = InputSpecificProps<Option, IsMulti, Group>;\n\nexport const inputCSS = <\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>(\n  {\n    isDisabled,\n    value,\n    theme: { spacing, colors },\n  }: InputProps<Option, IsMulti, Group>,\n  unstyled: boolean\n): CSSObjectWithLabel => ({\n  visibility: isDisabled ? 'hidden' : 'visible',\n  // force css to recompute when value change due to @emotion bug.\n  // We can remove it whenever the bug is fixed.\n  transform: value ? 'translateZ(0)' : '',\n  ...containerStyle,\n  ...(unstyled\n    ? {}\n    : {\n        margin: spacing.baseUnit / 2,\n        paddingBottom: spacing.baseUnit / 2,\n        paddingTop: spacing.baseUnit / 2,\n        color: colors.neutral80,\n      }),\n});\n\nconst spacingStyle = {\n  gridArea: '1 / 2',\n  font: 'inherit',\n  minWidth: '2px',\n  border: 0,\n  margin: 0,\n  outline: 0,\n  padding: 0,\n} as const;\n\nconst containerStyle = {\n  flex: '1 1 auto',\n  display: 'inline-grid',\n  gridArea: '1 / 1 / 2 / 3',\n  gridTemplateColumns: '0 min-content',\n\n  '&:after': {\n    content: 'attr(data-value) \" \"',\n    visibility: 'hidden',\n    whiteSpace: 'pre',\n    ...spacingStyle,\n  },\n} as const;\n\nconst inputStyle = (isHidden: boolean) => ({\n  label: 'input',\n  color: 'inherit',\n  background: 0,\n  opacity: isHidden ? 0 : 1,\n  width: '100%',\n  ...spacingStyle,\n});\n\nconst Input = <\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>(\n  props: InputProps<Option, IsMulti, Group>\n) => {\n  const { cx, value } = props;\n  const { innerRef, isDisabled, isHidden, inputClassName, ...innerProps } =\n    cleanCommonProps(props);\n  return (\n    <div\n      {...getStyleProps(props, 'input', { 'input-container': true })}\n      data-value={value || ''}\n    >\n      <input\n        className={cx({ input: true }, inputClassName)}\n        ref={innerRef}\n        style={inputStyle(isHidden)}\n        disabled={isDisabled}\n        {...innerProps}\n      />\n    </div>\n  );\n};\n\nexport default Input;\n"
  },
  {
    "path": "packages/react-select/src/components/LiveRegion.tsx",
    "content": "/** @jsx jsx */\nimport { Fragment, ReactNode, useMemo } from 'react';\nimport { jsx } from '@emotion/react';\nimport A11yText from '../internal/A11yText';\nimport { defaultAriaLiveMessages, AriaSelection } from '../accessibility';\n\nimport { CommonProps, GroupBase, OnChangeValue, Options } from '../types';\n\n// ==============================\n// Root Container\n// ==============================\n\nexport interface LiveRegionProps<\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n> extends CommonProps<Option, IsMulti, Group> {\n  children: ReactNode;\n  innerProps: { className?: string };\n  // Select state variables\n  ariaSelection: AriaSelection<Option, IsMulti>;\n  focusedOption: Option | null;\n  focusedValue: Option | null;\n  selectValue: Options<Option>;\n  focusableOptions: Options<Option>;\n  isFocused: boolean;\n  id: string;\n  isAppleDevice: boolean;\n}\n\nconst LiveRegion = <\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>(\n  props: LiveRegionProps<Option, IsMulti, Group>\n) => {\n  const {\n    ariaSelection,\n    focusedOption,\n    focusedValue,\n    focusableOptions,\n    isFocused,\n    selectValue,\n    selectProps,\n    id,\n    isAppleDevice,\n  } = props;\n\n  const {\n    ariaLiveMessages,\n    getOptionLabel,\n    inputValue,\n    isMulti,\n    isOptionDisabled,\n    isSearchable,\n    menuIsOpen,\n    options,\n    screenReaderStatus,\n    tabSelectsValue,\n    isLoading,\n  } = selectProps;\n  const ariaLabel = selectProps['aria-label'];\n  const ariaLive = selectProps['aria-live'];\n\n  // Update aria live message configuration when prop changes\n  const messages = useMemo(\n    () => ({\n      ...defaultAriaLiveMessages,\n      ...(ariaLiveMessages || {}),\n    }),\n    [ariaLiveMessages]\n  );\n\n  // Update aria live selected option when prop changes\n  const ariaSelected = useMemo(() => {\n    let message = '';\n    if (ariaSelection && messages.onChange) {\n      const {\n        option,\n        options: selectedOptions,\n        removedValue,\n        removedValues,\n        value,\n      } = ariaSelection;\n      // select-option when !isMulti does not return option so we assume selected option is value\n      const asOption = (val: OnChangeValue<Option, IsMulti>): Option | null =>\n        !Array.isArray(val) ? (val as Option) : null;\n\n      // If there is just one item from the action then get its label\n      const selected = removedValue || option || asOption(value);\n      const label = selected ? getOptionLabel(selected) : '';\n\n      // If there are multiple items from the action then return an array of labels\n      const multiSelected = selectedOptions || removedValues || undefined;\n      const labels = multiSelected ? multiSelected.map(getOptionLabel) : [];\n\n      const onChangeProps = {\n        // multiSelected items are usually items that have already been selected\n        // or set by the user as a default value so we assume they are not disabled\n        isDisabled: selected && isOptionDisabled(selected, selectValue),\n        label,\n        labels,\n        ...ariaSelection,\n      };\n\n      message = messages.onChange(onChangeProps);\n    }\n    return message;\n  }, [ariaSelection, messages, isOptionDisabled, selectValue, getOptionLabel]);\n\n  const ariaFocused = useMemo(() => {\n    let focusMsg = '';\n    const focused = focusedOption || focusedValue;\n    const isSelected = !!(\n      focusedOption &&\n      selectValue &&\n      selectValue.includes(focusedOption)\n    );\n\n    if (focused && messages.onFocus) {\n      const onFocusProps = {\n        focused,\n        label: getOptionLabel(focused),\n        isDisabled: isOptionDisabled(focused, selectValue),\n        isSelected,\n        options: focusableOptions,\n        context:\n          focused === focusedOption ? ('menu' as const) : ('value' as const),\n        selectValue,\n        isAppleDevice,\n      };\n\n      focusMsg = messages.onFocus(onFocusProps);\n    }\n    return focusMsg;\n  }, [\n    focusedOption,\n    focusedValue,\n    getOptionLabel,\n    isOptionDisabled,\n    messages,\n    focusableOptions,\n    selectValue,\n    isAppleDevice,\n  ]);\n\n  const ariaResults = useMemo(() => {\n    let resultsMsg = '';\n    if (menuIsOpen && options.length && !isLoading && messages.onFilter) {\n      const resultsMessage = screenReaderStatus({\n        count: focusableOptions.length,\n      });\n      resultsMsg = messages.onFilter({ inputValue, resultsMessage });\n    }\n    return resultsMsg;\n  }, [\n    focusableOptions,\n    inputValue,\n    menuIsOpen,\n    messages,\n    options,\n    screenReaderStatus,\n    isLoading,\n  ]);\n\n  const isInitialFocus = ariaSelection?.action === 'initial-input-focus';\n\n  const ariaGuidance = useMemo(() => {\n    let guidanceMsg = '';\n    if (messages.guidance) {\n      const context = focusedValue ? 'value' : menuIsOpen ? 'menu' : 'input';\n      guidanceMsg = messages.guidance({\n        'aria-label': ariaLabel,\n        context,\n        isDisabled:\n          focusedOption && isOptionDisabled(focusedOption, selectValue),\n        isMulti,\n        isSearchable,\n        tabSelectsValue,\n        isInitialFocus,\n      });\n    }\n    return guidanceMsg;\n  }, [\n    ariaLabel,\n    focusedOption,\n    focusedValue,\n    isMulti,\n    isOptionDisabled,\n    isSearchable,\n    menuIsOpen,\n    messages,\n    selectValue,\n    tabSelectsValue,\n    isInitialFocus,\n  ]);\n\n  const ScreenReaderText = (\n    <Fragment>\n      <span id=\"aria-selection\">{ariaSelected}</span>\n      <span id=\"aria-focused\">{ariaFocused}</span>\n      <span id=\"aria-results\">{ariaResults}</span>\n      <span id=\"aria-guidance\">{ariaGuidance}</span>\n    </Fragment>\n  );\n\n  return (\n    <Fragment>\n      {/* We use 'aria-describedby' linked to this component for the initial focus */}\n      {/* action, then for all other actions we use the live region below */}\n      <A11yText id={id}>{isInitialFocus && ScreenReaderText}</A11yText>\n      <A11yText\n        aria-live={ariaLive}\n        aria-atomic=\"false\"\n        aria-relevant=\"additions text\"\n        role=\"log\"\n      >\n        {isFocused && !isInitialFocus && ScreenReaderText}\n      </A11yText>\n    </Fragment>\n  );\n};\n\nexport default LiveRegion;\n"
  },
  {
    "path": "packages/react-select/src/components/Menu.tsx",
    "content": "/** @jsx jsx */\nimport {\n  createContext,\n  JSX,\n  ReactElement,\n  ReactNode,\n  Ref,\n  useCallback,\n  useContext,\n  useMemo,\n  useRef,\n  useState,\n} from 'react';\nimport { jsx } from '@emotion/react';\nimport { createPortal } from 'react-dom';\nimport { autoUpdate } from '@floating-ui/dom';\nimport useLayoutEffect from 'use-isomorphic-layout-effect';\n\nimport {\n  animatedScrollTo,\n  getBoundingClientObj,\n  getScrollParent,\n  getScrollTop,\n  getStyleProps,\n  normalizedHeight,\n  scrollTo,\n} from '../utils';\nimport {\n  MenuPlacement,\n  MenuPosition,\n  CommonProps,\n  GroupBase,\n  CommonPropsAndClassName,\n  CoercedMenuPlacement,\n  CSSObjectWithLabel,\n} from '../types';\n\n// ==============================\n// Menu\n// ==============================\n\n// Get Menu Placement\n// ------------------------------\n\ninterface CalculatedMenuPlacementAndHeight {\n  placement: CoercedMenuPlacement;\n  maxHeight: number;\n}\ninterface PlacementArgs {\n  maxHeight: number;\n  menuEl: HTMLDivElement | null;\n  minHeight: number;\n  placement: MenuPlacement;\n  shouldScroll: boolean;\n  isFixedPosition: boolean;\n  controlHeight: number;\n}\n\nexport function getMenuPlacement({\n  maxHeight: preferredMaxHeight,\n  menuEl,\n  minHeight,\n  placement: preferredPlacement,\n  shouldScroll,\n  isFixedPosition,\n  controlHeight,\n}: PlacementArgs): CalculatedMenuPlacementAndHeight {\n  const scrollParent = getScrollParent(menuEl!);\n  const defaultState: CalculatedMenuPlacementAndHeight = {\n    placement: 'bottom',\n    maxHeight: preferredMaxHeight,\n  };\n\n  // something went wrong, return default state\n  if (!menuEl || !menuEl.offsetParent) return defaultState;\n\n  // we can't trust `scrollParent.scrollHeight` --> it may increase when\n  // the menu is rendered\n  const { height: scrollHeight } = scrollParent.getBoundingClientRect();\n  const {\n    bottom: menuBottom,\n    height: menuHeight,\n    top: menuTop,\n  } = menuEl.getBoundingClientRect();\n\n  const { top: containerTop } = menuEl.offsetParent.getBoundingClientRect();\n  const viewHeight = isFixedPosition\n    ? window.innerHeight\n    : normalizedHeight(scrollParent);\n  const scrollTop = getScrollTop(scrollParent);\n\n  const marginBottom = parseInt(getComputedStyle(menuEl).marginBottom, 10);\n  const marginTop = parseInt(getComputedStyle(menuEl).marginTop, 10);\n  const viewSpaceAbove = containerTop - marginTop;\n  const viewSpaceBelow = viewHeight - menuTop;\n  const scrollSpaceAbove = viewSpaceAbove + scrollTop;\n  const scrollSpaceBelow = scrollHeight - scrollTop - menuTop;\n\n  const scrollDown = menuBottom - viewHeight + scrollTop + marginBottom;\n  const scrollUp = scrollTop + menuTop - marginTop;\n  const scrollDuration = 160;\n\n  switch (preferredPlacement) {\n    case 'auto':\n    case 'bottom':\n      // 1: the menu will fit, do nothing\n      if (viewSpaceBelow >= menuHeight) {\n        return { placement: 'bottom', maxHeight: preferredMaxHeight };\n      }\n\n      // 2: the menu will fit, if scrolled\n      if (scrollSpaceBelow >= menuHeight && !isFixedPosition) {\n        if (shouldScroll) {\n          animatedScrollTo(scrollParent, scrollDown, scrollDuration);\n        }\n\n        return { placement: 'bottom', maxHeight: preferredMaxHeight };\n      }\n\n      // 3: the menu will fit, if constrained\n      if (\n        (!isFixedPosition && scrollSpaceBelow >= minHeight) ||\n        (isFixedPosition && viewSpaceBelow >= minHeight)\n      ) {\n        if (shouldScroll) {\n          animatedScrollTo(scrollParent, scrollDown, scrollDuration);\n        }\n\n        // we want to provide as much of the menu as possible to the user,\n        // so give them whatever is available below rather than the minHeight.\n        const constrainedHeight = isFixedPosition\n          ? viewSpaceBelow - marginBottom\n          : scrollSpaceBelow - marginBottom;\n\n        return {\n          placement: 'bottom',\n          maxHeight: constrainedHeight,\n        };\n      }\n\n      // 4. Forked beviour when there isn't enough space below\n\n      // AUTO: flip the menu, render above\n      if (preferredPlacement === 'auto' || isFixedPosition) {\n        // may need to be constrained after flipping\n        let constrainedHeight = preferredMaxHeight;\n        const spaceAbove = isFixedPosition ? viewSpaceAbove : scrollSpaceAbove;\n\n        if (spaceAbove >= minHeight) {\n          constrainedHeight = Math.min(\n            spaceAbove - marginBottom - controlHeight,\n            preferredMaxHeight\n          );\n        }\n\n        return { placement: 'top', maxHeight: constrainedHeight };\n      }\n\n      // BOTTOM: allow browser to increase scrollable area and immediately set scroll\n      if (preferredPlacement === 'bottom') {\n        if (shouldScroll) {\n          scrollTo(scrollParent, scrollDown);\n        }\n        return { placement: 'bottom', maxHeight: preferredMaxHeight };\n      }\n      break;\n    case 'top':\n      // 1: the menu will fit, do nothing\n      if (viewSpaceAbove >= menuHeight) {\n        return { placement: 'top', maxHeight: preferredMaxHeight };\n      }\n\n      // 2: the menu will fit, if scrolled\n      if (scrollSpaceAbove >= menuHeight && !isFixedPosition) {\n        if (shouldScroll) {\n          animatedScrollTo(scrollParent, scrollUp, scrollDuration);\n        }\n\n        return { placement: 'top', maxHeight: preferredMaxHeight };\n      }\n\n      // 3: the menu will fit, if constrained\n      if (\n        (!isFixedPosition && scrollSpaceAbove >= minHeight) ||\n        (isFixedPosition && viewSpaceAbove >= minHeight)\n      ) {\n        let constrainedHeight = preferredMaxHeight;\n\n        // we want to provide as much of the menu as possible to the user,\n        // so give them whatever is available below rather than the minHeight.\n        if (\n          (!isFixedPosition && scrollSpaceAbove >= minHeight) ||\n          (isFixedPosition && viewSpaceAbove >= minHeight)\n        ) {\n          constrainedHeight = isFixedPosition\n            ? viewSpaceAbove - marginTop\n            : scrollSpaceAbove - marginTop;\n        }\n\n        if (shouldScroll) {\n          animatedScrollTo(scrollParent, scrollUp, scrollDuration);\n        }\n\n        return {\n          placement: 'top',\n          maxHeight: constrainedHeight,\n        };\n      }\n\n      // 4. not enough space, the browser WILL NOT increase scrollable area when\n      // absolutely positioned element rendered above the viewport (only below).\n      // Flip the menu, render below\n      return { placement: 'bottom', maxHeight: preferredMaxHeight };\n    default:\n      throw new Error(`Invalid placement provided \"${preferredPlacement}\".`);\n  }\n\n  return defaultState;\n}\n\n// Menu Component\n// ------------------------------\n\nexport interface MenuPlacementProps {\n  /** Set the minimum height of the menu. */\n  minMenuHeight: number;\n  /** Set the maximum height of the menu. */\n  maxMenuHeight: number;\n  /** Set whether the menu should be at the top, at the bottom. The auto options sets it to bottom. */\n  menuPlacement: MenuPlacement;\n  /** The CSS position value of the menu, when \"fixed\" extra layout management is required */\n  menuPosition: MenuPosition;\n  /** Set whether the page should scroll to show the menu. */\n  menuShouldScrollIntoView: boolean;\n}\n\nexport interface MenuProps<\n  Option = unknown,\n  IsMulti extends boolean = boolean,\n  Group extends GroupBase<Option> = GroupBase<Option>\n> extends CommonPropsAndClassName<Option, IsMulti, Group>,\n    MenuPlacementProps {\n  /** Reference to the internal element, consumed by the MenuPlacer component */\n  innerRef: Ref<HTMLDivElement>;\n  innerProps: JSX.IntrinsicElements['div'];\n  isLoading: boolean;\n  placement: CoercedMenuPlacement;\n  /** The children to be rendered. */\n  children: ReactNode;\n}\n\ninterface PlacerProps {\n  placement: CoercedMenuPlacement;\n  maxHeight: number;\n}\n\ninterface ChildrenProps {\n  ref: Ref<HTMLDivElement>;\n  placerProps: PlacerProps;\n}\n\nexport interface MenuPlacerProps<\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n> extends CommonProps<Option, IsMulti, Group>,\n    MenuPlacementProps {\n  /** The children to be rendered. */\n  children: (childrenProps: ChildrenProps) => ReactElement;\n}\n\nfunction alignToControl(placement: CoercedMenuPlacement) {\n  const placementToCSSProp = { bottom: 'top', top: 'bottom' };\n  return placement ? placementToCSSProp[placement] : 'bottom';\n}\nconst coercePlacement = (p: MenuPlacement) => (p === 'auto' ? 'bottom' : p);\n\nexport const menuCSS = <\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>(\n  {\n    placement,\n    theme: { borderRadius, spacing, colors },\n  }: MenuProps<Option, IsMulti, Group>,\n  unstyled: boolean\n): CSSObjectWithLabel => ({\n  label: 'menu',\n  [alignToControl(placement)]: '100%',\n  position: 'absolute',\n  width: '100%',\n  zIndex: 1,\n  ...(unstyled\n    ? {}\n    : {\n        backgroundColor: colors.neutral0,\n        borderRadius: borderRadius,\n        boxShadow:\n          '0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)',\n        marginBottom: spacing.menuGutter,\n        marginTop: spacing.menuGutter,\n      }),\n});\n\nconst PortalPlacementContext =\n  createContext<{\n    setPortalPlacement: (placement: CoercedMenuPlacement) => void;\n  } | null>(null);\n\n// NOTE: internal only\nexport const MenuPlacer = <\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>(\n  props: MenuPlacerProps<Option, IsMulti, Group>\n) => {\n  const {\n    children,\n    minMenuHeight,\n    maxMenuHeight,\n    menuPlacement,\n    menuPosition,\n    menuShouldScrollIntoView,\n    theme,\n  } = props;\n\n  const { setPortalPlacement } = useContext(PortalPlacementContext) || {};\n  const ref = useRef<HTMLDivElement | null>(null);\n  const [maxHeight, setMaxHeight] = useState(maxMenuHeight);\n  const [placement, setPlacement] = useState<CoercedMenuPlacement | null>(null);\n  const { controlHeight } = theme.spacing;\n\n  useLayoutEffect(() => {\n    const menuEl = ref.current;\n    if (!menuEl) return;\n\n    // DO NOT scroll if position is fixed\n    const isFixedPosition = menuPosition === 'fixed';\n    const shouldScroll = menuShouldScrollIntoView && !isFixedPosition;\n\n    const state = getMenuPlacement({\n      maxHeight: maxMenuHeight,\n      menuEl,\n      minHeight: minMenuHeight,\n      placement: menuPlacement,\n      shouldScroll,\n      isFixedPosition,\n      controlHeight,\n    });\n\n    setMaxHeight(state.maxHeight);\n    setPlacement(state.placement);\n    setPortalPlacement?.(state.placement);\n  }, [\n    maxMenuHeight,\n    menuPlacement,\n    menuPosition,\n    menuShouldScrollIntoView,\n    minMenuHeight,\n    setPortalPlacement,\n    controlHeight,\n  ]);\n\n  return children({\n    ref,\n    placerProps: {\n      ...props,\n      placement: placement || coercePlacement(menuPlacement),\n      maxHeight,\n    },\n  });\n};\n\nconst Menu = <Option, IsMulti extends boolean, Group extends GroupBase<Option>>(\n  props: MenuProps<Option, IsMulti, Group>\n) => {\n  const { children, innerRef, innerProps } = props;\n  return (\n    <div\n      {...getStyleProps(props, 'menu', { menu: true })}\n      ref={innerRef}\n      {...innerProps}\n    >\n      {children}\n    </div>\n  );\n};\n\nexport default Menu;\n\n// ==============================\n// Menu List\n// ==============================\n\nexport interface MenuListProps<\n  Option = unknown,\n  IsMulti extends boolean = boolean,\n  Group extends GroupBase<Option> = GroupBase<Option>\n> extends CommonPropsAndClassName<Option, IsMulti, Group> {\n  /** Set the max height of the Menu component  */\n  maxHeight: number;\n  /** The children to be rendered. */\n  children: ReactNode;\n  /** Inner ref to DOM ReactNode */\n  innerRef: Ref<HTMLDivElement>;\n  /** The currently focused option */\n  focusedOption: Option;\n  /** Props to be passed to the menu-list wrapper. */\n  innerProps: JSX.IntrinsicElements['div'];\n}\nexport const menuListCSS = <\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>(\n  {\n    maxHeight,\n    theme: {\n      spacing: { baseUnit },\n    },\n  }: MenuListProps<Option, IsMulti, Group>,\n  unstyled: boolean\n): CSSObjectWithLabel => ({\n  maxHeight,\n  overflowY: 'auto',\n  position: 'relative', // required for offset[Height, Top] > keyboard scroll\n  WebkitOverflowScrolling: 'touch',\n  ...(unstyled\n    ? {}\n    : {\n        paddingBottom: baseUnit,\n        paddingTop: baseUnit,\n      }),\n});\nexport const MenuList = <\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>(\n  props: MenuListProps<Option, IsMulti, Group>\n) => {\n  const { children, innerProps, innerRef, isMulti } = props;\n  return (\n    <div\n      {...getStyleProps(props, 'menuList', {\n        'menu-list': true,\n        'menu-list--is-multi': isMulti,\n      })}\n      ref={innerRef}\n      {...innerProps}\n    >\n      {children}\n    </div>\n  );\n};\n\n// ==============================\n// Menu Notices\n// ==============================\n\nconst noticeCSS = <\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>(\n  {\n    theme: {\n      spacing: { baseUnit },\n      colors,\n    },\n  }: NoticeProps<Option, IsMulti, Group>,\n  unstyled: boolean\n): CSSObjectWithLabel => ({\n  textAlign: 'center',\n  ...(unstyled\n    ? {}\n    : {\n        color: colors.neutral40,\n        padding: `${baseUnit * 2}px ${baseUnit * 3}px`,\n      }),\n});\nexport const noOptionsMessageCSS = noticeCSS;\nexport const loadingMessageCSS = noticeCSS;\n\nexport interface NoticeProps<\n  Option = unknown,\n  IsMulti extends boolean = boolean,\n  Group extends GroupBase<Option> = GroupBase<Option>\n> extends CommonPropsAndClassName<Option, IsMulti, Group> {\n  /** The children to be rendered. */\n  children: ReactNode;\n  /** Props to be passed on to the wrapper. */\n  innerProps: JSX.IntrinsicElements['div'];\n}\n\nexport const NoOptionsMessage = <\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>({\n  children = 'No options',\n  innerProps,\n  ...restProps\n}: NoticeProps<Option, IsMulti, Group>) => {\n  return (\n    <div\n      {...getStyleProps(\n        { ...restProps, children, innerProps },\n        'noOptionsMessage',\n        {\n          'menu-notice': true,\n          'menu-notice--no-options': true,\n        }\n      )}\n      {...innerProps}\n    >\n      {children}\n    </div>\n  );\n};\n\nexport const LoadingMessage = <\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>({\n  children = 'Loading...',\n  innerProps,\n  ...restProps\n}: NoticeProps<Option, IsMulti, Group>) => {\n  return (\n    <div\n      {...getStyleProps(\n        { ...restProps, children, innerProps },\n        'loadingMessage',\n        {\n          'menu-notice': true,\n          'menu-notice--loading': true,\n        }\n      )}\n      {...innerProps}\n    >\n      {children}\n    </div>\n  );\n};\n\n// ==============================\n// Menu Portal\n// ==============================\n\nexport interface MenuPortalProps<\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n> extends CommonPropsAndClassName<Option, IsMulti, Group> {\n  appendTo: HTMLElement | undefined;\n  children: ReactNode; // ideally Menu<MenuProps>\n  controlElement: HTMLDivElement | null;\n  innerProps: JSX.IntrinsicElements['div'];\n  menuPlacement: MenuPlacement;\n  menuPosition: MenuPosition;\n}\n\nexport interface PortalStyleArgs {\n  offset: number;\n  position: MenuPosition;\n  rect: { left: number; width: number };\n}\n\nexport const menuPortalCSS = ({\n  rect,\n  offset,\n  position,\n}: PortalStyleArgs): CSSObjectWithLabel => ({\n  left: rect.left,\n  position: position,\n  top: offset,\n  width: rect.width,\n  zIndex: 1,\n});\n\ninterface ComputedPosition {\n  offset: number;\n  rect: { left: number; width: number };\n}\n\nexport const MenuPortal = <\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>(\n  props: MenuPortalProps<Option, IsMulti, Group>\n) => {\n  const {\n    appendTo,\n    children,\n    controlElement,\n    innerProps,\n    menuPlacement,\n    menuPosition,\n  } = props;\n\n  const menuPortalRef = useRef<HTMLDivElement | null>(null);\n  const cleanupRef = useRef<(() => void) | void | null>(null);\n\n  const [placement, setPortalPlacement] = useState<'bottom' | 'top'>(\n    coercePlacement(menuPlacement)\n  );\n  const portalPlacementContext = useMemo(\n    () => ({\n      setPortalPlacement,\n    }),\n    []\n  );\n  const [computedPosition, setComputedPosition] =\n    useState<ComputedPosition | null>(null);\n\n  const updateComputedPosition = useCallback(() => {\n    if (!controlElement) return;\n\n    const rect = getBoundingClientObj(controlElement);\n    const scrollDistance = menuPosition === 'fixed' ? 0 : window.pageYOffset;\n    const offset = rect[placement] + scrollDistance;\n    if (\n      offset !== computedPosition?.offset ||\n      rect.left !== computedPosition?.rect.left ||\n      rect.width !== computedPosition?.rect.width\n    ) {\n      setComputedPosition({ offset, rect });\n    }\n  }, [\n    controlElement,\n    menuPosition,\n    placement,\n    computedPosition?.offset,\n    computedPosition?.rect.left,\n    computedPosition?.rect.width,\n  ]);\n\n  useLayoutEffect(() => {\n    updateComputedPosition();\n  }, [updateComputedPosition]);\n\n  const runAutoUpdate = useCallback(() => {\n    if (typeof cleanupRef.current === 'function') {\n      cleanupRef.current();\n      cleanupRef.current = null;\n    }\n\n    if (controlElement && menuPortalRef.current) {\n      cleanupRef.current = autoUpdate(\n        controlElement,\n        menuPortalRef.current,\n        updateComputedPosition,\n        { elementResize: 'ResizeObserver' in window }\n      );\n    }\n  }, [controlElement, updateComputedPosition]);\n\n  useLayoutEffect(() => {\n    runAutoUpdate();\n  }, [runAutoUpdate]);\n\n  const setMenuPortalElement = useCallback(\n    (menuPortalElement: HTMLDivElement) => {\n      menuPortalRef.current = menuPortalElement;\n      runAutoUpdate();\n    },\n    [runAutoUpdate]\n  );\n\n  // bail early if required elements aren't present\n  if ((!appendTo && menuPosition !== 'fixed') || !computedPosition) return null;\n\n  // same wrapper element whether fixed or portalled\n  const menuWrapper = (\n    <div\n      ref={setMenuPortalElement}\n      {...getStyleProps(\n        {\n          ...props,\n          offset: computedPosition.offset,\n          position: menuPosition,\n          rect: computedPosition.rect,\n        },\n        'menuPortal',\n        {\n          'menu-portal': true,\n        }\n      )}\n      {...innerProps}\n    >\n      {children}\n    </div>\n  );\n\n  return (\n    <PortalPlacementContext.Provider value={portalPlacementContext}>\n      {appendTo ? createPortal(menuWrapper, appendTo) : menuWrapper}\n    </PortalPlacementContext.Provider>\n  );\n};\n"
  },
  {
    "path": "packages/react-select/src/components/MultiValue.tsx",
    "content": "/** @jsx jsx */\nimport { ComponentType, JSX, ReactNode } from 'react';\nimport { jsx } from '@emotion/react';\nimport { CrossIcon } from './indicators';\nimport {\n  CommonPropsAndClassName,\n  CSSObjectWithLabel,\n  GroupBase,\n} from '../types';\nimport { Props } from '../Select';\nimport { getStyleProps } from '../utils';\n\ninterface MultiValueComponents<\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n> {\n  Container: ComponentType<MultiValueGenericProps<Option, IsMulti, Group>>;\n  Label: ComponentType<MultiValueGenericProps<Option, IsMulti, Group>>;\n  Remove: ComponentType<MultiValueRemoveProps<Option, IsMulti, Group>>;\n}\n\nexport interface MultiValueProps<\n  Option = unknown,\n  IsMulti extends boolean = boolean,\n  Group extends GroupBase<Option> = GroupBase<Option>\n> extends CommonPropsAndClassName<Option, IsMulti, Group> {\n  children: ReactNode;\n  components: MultiValueComponents<Option, IsMulti, Group>;\n  cropWithEllipsis?: boolean;\n  data: Option;\n  innerProps: JSX.IntrinsicElements['div'];\n  isFocused: boolean;\n  isDisabled: boolean;\n  removeProps: JSX.IntrinsicElements['div'];\n  index: number;\n}\n\nexport const multiValueCSS = <\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>(\n  {\n    theme: { spacing, borderRadius, colors },\n  }: MultiValueProps<Option, IsMulti, Group>,\n  unstyled: boolean\n): CSSObjectWithLabel => ({\n  label: 'multiValue',\n  display: 'flex',\n  minWidth: 0, // resolves flex/text-overflow bug\n  ...(unstyled\n    ? {}\n    : {\n        backgroundColor: colors.neutral10,\n        borderRadius: borderRadius / 2,\n        margin: spacing.baseUnit / 2,\n      }),\n});\n\nexport const multiValueLabelCSS = <\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>(\n  {\n    theme: { borderRadius, colors },\n    cropWithEllipsis,\n  }: MultiValueProps<Option, IsMulti, Group>,\n  unstyled: boolean\n): CSSObjectWithLabel => ({\n  overflow: 'hidden',\n  textOverflow:\n    cropWithEllipsis || cropWithEllipsis === undefined ? 'ellipsis' : undefined,\n  whiteSpace: 'nowrap',\n  ...(unstyled\n    ? {}\n    : {\n        borderRadius: borderRadius / 2,\n        color: colors.neutral80,\n        fontSize: '85%',\n        padding: 3,\n        paddingLeft: 6,\n      }),\n});\n\nexport const multiValueRemoveCSS = <\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>(\n  {\n    theme: { spacing, borderRadius, colors },\n    isFocused,\n  }: MultiValueProps<Option, IsMulti, Group>,\n  unstyled: boolean\n): CSSObjectWithLabel => ({\n  alignItems: 'center',\n  display: 'flex',\n  ...(unstyled\n    ? {}\n    : {\n        borderRadius: borderRadius / 2,\n        backgroundColor: isFocused ? colors.dangerLight : undefined,\n        paddingLeft: spacing.baseUnit,\n        paddingRight: spacing.baseUnit,\n        ':hover': {\n          backgroundColor: colors.dangerLight,\n          color: colors.danger,\n        },\n      }),\n});\n\nexport interface MultiValueGenericProps<\n  Option = unknown,\n  IsMulti extends boolean = boolean,\n  Group extends GroupBase<Option> = GroupBase<Option>\n> {\n  children: ReactNode;\n  data: any;\n  innerProps: { className?: string };\n  selectProps: Props<Option, IsMulti, Group>;\n}\nexport const MultiValueGeneric = <\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>({\n  children,\n  innerProps,\n}: MultiValueGenericProps<Option, IsMulti, Group>) => (\n  <div {...innerProps}>{children}</div>\n);\n\nexport const MultiValueContainer = MultiValueGeneric;\nexport const MultiValueLabel = MultiValueGeneric;\nexport interface MultiValueRemoveProps<\n  Option = unknown,\n  IsMulti extends boolean = boolean,\n  Group extends GroupBase<Option> = GroupBase<Option>\n> {\n  children?: ReactNode;\n  data: Option;\n  innerProps: JSX.IntrinsicElements['div'];\n  selectProps: Props<Option, IsMulti, Group>;\n}\nexport function MultiValueRemove<\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>({ children, innerProps }: MultiValueRemoveProps<Option, IsMulti, Group>) {\n  return (\n    <div role=\"button\" {...innerProps}>\n      {children || <CrossIcon size={14} />}\n    </div>\n  );\n}\n\nconst MultiValue = <\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>(\n  props: MultiValueProps<Option, IsMulti, Group>\n) => {\n  const {\n    children,\n    components,\n    data,\n    innerProps,\n    isDisabled,\n    removeProps,\n    selectProps,\n  } = props;\n\n  const { Container, Label, Remove } = components;\n\n  return (\n    <Container\n      data={data}\n      innerProps={{\n        ...getStyleProps(props, 'multiValue', {\n          'multi-value': true,\n          'multi-value--is-disabled': isDisabled,\n        }),\n        ...innerProps,\n      }}\n      selectProps={selectProps}\n    >\n      <Label\n        data={data}\n        innerProps={{\n          ...getStyleProps(props, 'multiValueLabel', {\n            'multi-value__label': true,\n          }),\n        }}\n        selectProps={selectProps}\n      >\n        {children}\n      </Label>\n      <Remove\n        data={data}\n        innerProps={{\n          ...getStyleProps(props, 'multiValueRemove', {\n            'multi-value__remove': true,\n          }),\n          'aria-label': `Remove ${children || 'option'}`,\n          ...removeProps,\n        }}\n        selectProps={selectProps}\n      />\n    </Container>\n  );\n};\n\nexport default MultiValue;\n"
  },
  {
    "path": "packages/react-select/src/components/Option.tsx",
    "content": "/** @jsx jsx */\nimport { JSX, ReactNode, RefCallback } from 'react';\nimport { jsx } from '@emotion/react';\n\nimport {\n  CommonPropsAndClassName,\n  CSSObjectWithLabel,\n  GroupBase,\n} from '../types';\nimport { getStyleProps } from '../utils';\n\nexport interface OptionProps<\n  Option = unknown,\n  IsMulti extends boolean = boolean,\n  Group extends GroupBase<Option> = GroupBase<Option>\n> extends CommonPropsAndClassName<Option, IsMulti, Group> {\n  /** The children to be rendered. */\n  children: ReactNode;\n  /** Inner ref to DOM Node */\n  innerRef: RefCallback<HTMLDivElement>;\n  /** props passed to the wrapping element for the group. */\n  innerProps: JSX.IntrinsicElements['div'];\n  /** Text to be displayed representing the option. */\n  label: string;\n  /** Type is used by the menu to determine whether this is an option or a group.\n    In the case of option this is always `option`. **/\n  type: 'option';\n  /** The data of the selected option. */\n  data: Option;\n  /** Whether the option is disabled. */\n  isDisabled: boolean;\n  /** Whether the option is focused. */\n  isFocused: boolean;\n  /** Whether the option is selected. */\n  isSelected: boolean;\n}\n\nexport const optionCSS = <\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>(\n  {\n    isDisabled,\n    isFocused,\n    isSelected,\n    theme: { spacing, colors },\n  }: OptionProps<Option, IsMulti, Group>,\n  unstyled: boolean\n): CSSObjectWithLabel => ({\n  label: 'option',\n  cursor: 'default',\n  display: 'block',\n  fontSize: 'inherit',\n  width: '100%',\n  userSelect: 'none',\n  WebkitTapHighlightColor: 'rgba(0, 0, 0, 0)',\n  ...(unstyled\n    ? {}\n    : {\n        backgroundColor: isSelected\n          ? colors.primary\n          : isFocused\n          ? colors.primary25\n          : 'transparent',\n        color: isDisabled\n          ? colors.neutral20\n          : isSelected\n          ? colors.neutral0\n          : 'inherit',\n        padding: `${spacing.baseUnit * 2}px ${spacing.baseUnit * 3}px`,\n        // provide some affordance on touch devices\n        ':active': {\n          backgroundColor: !isDisabled\n            ? isSelected\n              ? colors.primary\n              : colors.primary50\n            : undefined,\n        },\n      }),\n});\n\nconst Option = <\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>(\n  props: OptionProps<Option, IsMulti, Group>\n) => {\n  const { children, isDisabled, isFocused, isSelected, innerRef, innerProps } =\n    props;\n  return (\n    <div\n      {...getStyleProps(props, 'option', {\n        option: true,\n        'option--is-disabled': isDisabled,\n        'option--is-focused': isFocused,\n        'option--is-selected': isSelected,\n      })}\n      ref={innerRef}\n      aria-disabled={isDisabled}\n      {...innerProps}\n    >\n      {children}\n    </div>\n  );\n};\n\nexport default Option;\n"
  },
  {
    "path": "packages/react-select/src/components/Placeholder.tsx",
    "content": "/** @jsx jsx */\nimport { JSX, ReactNode } from 'react';\nimport { jsx } from '@emotion/react';\nimport {\n  CommonPropsAndClassName,\n  CSSObjectWithLabel,\n  GroupBase,\n} from '../types';\nimport { getStyleProps } from '../utils';\n\nexport interface PlaceholderProps<\n  Option = unknown,\n  IsMulti extends boolean = boolean,\n  Group extends GroupBase<Option> = GroupBase<Option>\n> extends CommonPropsAndClassName<Option, IsMulti, Group> {\n  /** The children to be rendered. */\n  children: ReactNode;\n  /** props passed to the wrapping element for the group. */\n  innerProps: JSX.IntrinsicElements['div'];\n  isDisabled: boolean;\n  isFocused: boolean;\n}\n\nexport const placeholderCSS = <\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>(\n  { theme: { spacing, colors } }: PlaceholderProps<Option, IsMulti, Group>,\n  unstyled: boolean\n): CSSObjectWithLabel => ({\n  label: 'placeholder',\n  gridArea: '1 / 1 / 2 / 3',\n  ...(unstyled\n    ? {}\n    : {\n        color: colors.neutral50,\n        marginLeft: spacing.baseUnit / 2,\n        marginRight: spacing.baseUnit / 2,\n      }),\n});\n\nconst Placeholder = <\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>(\n  props: PlaceholderProps<Option, IsMulti, Group>\n) => {\n  const { children, innerProps } = props;\n  return (\n    <div\n      {...getStyleProps(props, 'placeholder', {\n        placeholder: true,\n      })}\n      {...innerProps}\n    >\n      {children}\n    </div>\n  );\n};\n\nexport default Placeholder;\n"
  },
  {
    "path": "packages/react-select/src/components/SingleValue.tsx",
    "content": "/** @jsx jsx */\nimport { JSX, ReactNode } from 'react';\nimport { jsx } from '@emotion/react';\nimport {\n  CommonPropsAndClassName,\n  CSSObjectWithLabel,\n  GroupBase,\n} from '../types';\nimport { getStyleProps } from '../utils';\n\nexport interface SingleValueProps<\n  Option = unknown,\n  IsMulti extends boolean = boolean,\n  Group extends GroupBase<Option> = GroupBase<Option>\n> extends CommonPropsAndClassName<Option, IsMulti, Group> {\n  /** The children to be rendered. */\n  children: ReactNode;\n  /** The data of the selected option rendered in the Single Value component. */\n  data: Option;\n  /** Props passed to the wrapping element for the group. */\n  innerProps: JSX.IntrinsicElements['div'];\n  /** Whether this is disabled. */\n  isDisabled: boolean;\n}\n\nexport const css = <\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>(\n  {\n    isDisabled,\n    theme: { spacing, colors },\n  }: SingleValueProps<Option, IsMulti, Group>,\n  unstyled: boolean\n): CSSObjectWithLabel => ({\n  label: 'singleValue',\n  gridArea: '1 / 1 / 2 / 3',\n  maxWidth: '100%',\n  overflow: 'hidden',\n  textOverflow: 'ellipsis',\n  whiteSpace: 'nowrap',\n  ...(unstyled\n    ? {}\n    : {\n        color: isDisabled ? colors.neutral40 : colors.neutral80,\n        marginLeft: spacing.baseUnit / 2,\n        marginRight: spacing.baseUnit / 2,\n      }),\n});\n\nconst SingleValue = <\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>(\n  props: SingleValueProps<Option, IsMulti, Group>\n) => {\n  const { children, isDisabled, innerProps } = props;\n  return (\n    <div\n      {...getStyleProps(props, 'singleValue', {\n        'single-value': true,\n        'single-value--is-disabled': isDisabled,\n      })}\n      {...innerProps}\n    >\n      {children}\n    </div>\n  );\n};\n\nexport default SingleValue;\n"
  },
  {
    "path": "packages/react-select/src/components/containers.tsx",
    "content": "/** @jsx jsx */\nimport { JSX, ReactNode } from 'react';\nimport { jsx } from '@emotion/react';\nimport {\n  CommonPropsAndClassName,\n  CSSObjectWithLabel,\n  GroupBase,\n} from '../types';\nimport { getStyleProps } from '../utils';\n\n// ==============================\n// Root Container\n// ==============================\n\nexport interface ContainerProps<\n  Option = unknown,\n  IsMulti extends boolean = boolean,\n  Group extends GroupBase<Option> = GroupBase<Option>\n> extends CommonPropsAndClassName<Option, IsMulti, Group> {\n  /** Whether the select is disabled. */\n  isDisabled: boolean;\n  isFocused: boolean;\n  /** The children to be rendered. */\n  children: ReactNode;\n  /** Inner props to be passed down to the container. */\n  innerProps: JSX.IntrinsicElements['div'];\n}\nexport const containerCSS = <\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>({\n  isDisabled,\n  isRtl,\n}: ContainerProps<Option, IsMulti, Group>): CSSObjectWithLabel => ({\n  label: 'container',\n  direction: isRtl ? 'rtl' : undefined,\n  pointerEvents: isDisabled ? 'none' : undefined, // cancel mouse events when disabled\n  position: 'relative',\n});\nexport const SelectContainer = <\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>(\n  props: ContainerProps<Option, IsMulti, Group>\n) => {\n  const { children, innerProps, isDisabled, isRtl } = props;\n  return (\n    <div\n      {...getStyleProps(props, 'container', {\n        '--is-disabled': isDisabled,\n        '--is-rtl': isRtl,\n      })}\n      {...innerProps}\n    >\n      {children}\n    </div>\n  );\n};\n\n// ==============================\n// Value Container\n// ==============================\n\nexport interface ValueContainerProps<\n  Option = unknown,\n  IsMulti extends boolean = boolean,\n  Group extends GroupBase<Option> = GroupBase<Option>\n> extends CommonPropsAndClassName<Option, IsMulti, Group> {\n  /** Props to be passed to the value container element. */\n  innerProps?: JSX.IntrinsicElements['div'];\n  /** The children to be rendered. */\n  children: ReactNode;\n  isDisabled: boolean;\n}\nexport const valueContainerCSS = <\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>(\n  {\n    theme: { spacing },\n    isMulti,\n    hasValue,\n    selectProps: { controlShouldRenderValue },\n  }: ValueContainerProps<Option, IsMulti, Group>,\n  unstyled: boolean\n): CSSObjectWithLabel => ({\n  alignItems: 'center',\n  display: isMulti && hasValue && controlShouldRenderValue ? 'flex' : 'grid',\n  flex: 1,\n  flexWrap: 'wrap',\n  WebkitOverflowScrolling: 'touch',\n  position: 'relative',\n  overflow: 'hidden',\n  ...(unstyled\n    ? {}\n    : {\n        padding: `${spacing.baseUnit / 2}px ${spacing.baseUnit * 2}px`,\n      }),\n});\nexport const ValueContainer = <\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>(\n  props: ValueContainerProps<Option, IsMulti, Group>\n) => {\n  const { children, innerProps, isMulti, hasValue } = props;\n\n  return (\n    <div\n      {...getStyleProps(props, 'valueContainer', {\n        'value-container': true,\n        'value-container--is-multi': isMulti,\n        'value-container--has-value': hasValue,\n      })}\n      {...innerProps}\n    >\n      {children}\n    </div>\n  );\n};\n\n// ==============================\n// Indicator Container\n// ==============================\n\nexport interface IndicatorsContainerProps<\n  Option = unknown,\n  IsMulti extends boolean = boolean,\n  Group extends GroupBase<Option> = GroupBase<Option>\n> extends CommonPropsAndClassName<Option, IsMulti, Group> {\n  isDisabled: boolean;\n  /** The children to be rendered. */\n  children: ReactNode;\n  /** Props to be passed to the indicators container element. */\n  innerProps?: {};\n}\n\nexport const indicatorsContainerCSS = (): CSSObjectWithLabel => ({\n  alignItems: 'center',\n  alignSelf: 'stretch',\n  display: 'flex',\n  flexShrink: 0,\n});\nexport const IndicatorsContainer = <\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>(\n  props: IndicatorsContainerProps<Option, IsMulti, Group>\n) => {\n  const { children, innerProps } = props;\n\n  return (\n    <div\n      {...getStyleProps(props, 'indicatorsContainer', {\n        indicators: true,\n      })}\n      {...innerProps}\n    >\n      {children}\n    </div>\n  );\n};\n"
  },
  {
    "path": "packages/react-select/src/components/index.ts",
    "content": "import { ComponentType } from 'react';\nimport {\n  ContainerProps,\n  IndicatorsContainer,\n  IndicatorsContainerProps,\n  SelectContainer,\n  ValueContainer,\n  ValueContainerProps,\n} from './containers';\nimport {\n  ClearIndicator,\n  ClearIndicatorProps,\n  CrossIcon,\n  CrossIconProps,\n  DownChevron,\n  DownChevronProps,\n  DropdownIndicator,\n  DropdownIndicatorProps,\n  IndicatorSeparator,\n  IndicatorSeparatorProps,\n  LoadingIndicator,\n  LoadingIndicatorProps,\n} from './indicators';\n\nimport Control, { ControlProps } from './Control';\nimport Group, { GroupHeading, GroupHeadingProps, GroupProps } from './Group';\nimport Input, { InputProps } from './Input';\nimport Menu, {\n  LoadingMessage,\n  MenuList,\n  MenuListProps,\n  MenuPortal,\n  MenuPortalProps,\n  MenuProps,\n  NoOptionsMessage,\n  NoticeProps,\n} from './Menu';\nimport MultiValue, {\n  MultiValueContainer,\n  MultiValueGenericProps,\n  MultiValueLabel,\n  MultiValueProps,\n  MultiValueRemove,\n  MultiValueRemoveProps,\n} from './MultiValue';\nimport Option, { OptionProps } from './Option';\nimport Placeholder, { PlaceholderProps } from './Placeholder';\nimport SingleValue, { SingleValueProps } from './SingleValue';\nimport { GroupBase } from '../types';\n\nexport interface SelectComponents<\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n> {\n  ClearIndicator: ComponentType<ClearIndicatorProps<Option, IsMulti, Group>>;\n  Control: ComponentType<ControlProps<Option, IsMulti, Group>>;\n  DropdownIndicator: ComponentType<\n    DropdownIndicatorProps<Option, IsMulti, Group>\n  > | null;\n  DownChevron: ComponentType<DownChevronProps>;\n  CrossIcon: ComponentType<CrossIconProps>;\n  Group: ComponentType<GroupProps<Option, IsMulti, Group>>;\n  GroupHeading: ComponentType<GroupHeadingProps<Option, IsMulti, Group>>;\n  IndicatorsContainer: ComponentType<\n    IndicatorsContainerProps<Option, IsMulti, Group>\n  >;\n  IndicatorSeparator: ComponentType<\n    IndicatorSeparatorProps<Option, IsMulti, Group>\n  > | null;\n  Input: ComponentType<InputProps<Option, IsMulti, Group>>;\n  LoadingIndicator: ComponentType<\n    LoadingIndicatorProps<Option, IsMulti, Group>\n  >;\n  Menu: ComponentType<MenuProps<Option, IsMulti, Group>>;\n  MenuList: ComponentType<MenuListProps<Option, IsMulti, Group>>;\n  MenuPortal: ComponentType<MenuPortalProps<Option, IsMulti, Group>>;\n  LoadingMessage: ComponentType<NoticeProps<Option, IsMulti, Group>>;\n  NoOptionsMessage: ComponentType<NoticeProps<Option, IsMulti, Group>>;\n  MultiValue: ComponentType<MultiValueProps<Option, IsMulti, Group>>;\n  MultiValueContainer: ComponentType<\n    MultiValueGenericProps<Option, IsMulti, Group>\n  >;\n  MultiValueLabel: ComponentType<\n    MultiValueGenericProps<Option, IsMulti, Group>\n  >;\n  MultiValueRemove: ComponentType<\n    MultiValueRemoveProps<Option, IsMulti, Group>\n  >;\n  Option: ComponentType<OptionProps<Option, IsMulti, Group>>;\n  Placeholder: ComponentType<PlaceholderProps<Option, IsMulti, Group>>;\n  SelectContainer: ComponentType<ContainerProps<Option, IsMulti, Group>>;\n  SingleValue: ComponentType<SingleValueProps<Option, IsMulti, Group>>;\n  ValueContainer: ComponentType<ValueContainerProps<Option, IsMulti, Group>>;\n}\n\nexport type SelectComponentsConfig<\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n> = Partial<SelectComponents<Option, IsMulti, Group>>;\n\nexport const components = {\n  ClearIndicator: ClearIndicator,\n  Control: Control,\n  DropdownIndicator: DropdownIndicator,\n  DownChevron: DownChevron,\n  CrossIcon: CrossIcon,\n  Group: Group,\n  GroupHeading: GroupHeading,\n  IndicatorsContainer: IndicatorsContainer,\n  IndicatorSeparator: IndicatorSeparator,\n  Input: Input,\n  LoadingIndicator: LoadingIndicator,\n  Menu: Menu,\n  MenuList: MenuList,\n  MenuPortal: MenuPortal,\n  LoadingMessage: LoadingMessage,\n  NoOptionsMessage: NoOptionsMessage,\n  MultiValue: MultiValue,\n  MultiValueContainer: MultiValueContainer,\n  MultiValueLabel: MultiValueLabel,\n  MultiValueRemove: MultiValueRemove,\n  Option: Option,\n  Placeholder: Placeholder,\n  SelectContainer: SelectContainer,\n  SingleValue: SingleValue,\n  ValueContainer: ValueContainer,\n};\n\nexport type SelectComponentsGeneric = typeof components;\n\ninterface Props<\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n> {\n  components: SelectComponentsConfig<Option, IsMulti, Group>;\n}\n\nexport const defaultComponents = <\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>(\n  props: Props<Option, IsMulti, Group>\n): SelectComponentsGeneric =>\n  ({\n    ...components,\n    ...props.components,\n  } as SelectComponentsGeneric);\n"
  },
  {
    "path": "packages/react-select/src/components/indicators.tsx",
    "content": "/** @jsx jsx */\nimport { JSX, ReactNode } from 'react';\nimport { jsx, keyframes } from '@emotion/react';\n\nimport {\n  CommonPropsAndClassName,\n  CSSObjectWithLabel,\n  GroupBase,\n} from '../types';\nimport { getStyleProps } from '../utils';\n\n// ==============================\n// Dropdown & Clear Icons\n// ==============================\n\nconst Svg = ({\n  size,\n  ...props\n}: JSX.IntrinsicElements['svg'] & { size: number }) => (\n  <svg\n    height={size}\n    width={size}\n    viewBox=\"0 0 20 20\"\n    aria-hidden=\"true\"\n    focusable=\"false\"\n    css={{\n      display: 'inline-block',\n      fill: 'currentColor',\n      lineHeight: 1,\n      stroke: 'currentColor',\n      strokeWidth: 0,\n    }}\n    {...props}\n  />\n);\n\nexport type CrossIconProps = JSX.IntrinsicElements['svg'] & { size?: number };\nexport const CrossIcon = (props: CrossIconProps) => (\n  <Svg size={20} {...props}>\n    <path d=\"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z\" />\n  </Svg>\n);\nexport type DownChevronProps = JSX.IntrinsicElements['svg'] & { size?: number };\nexport const DownChevron = (props: DownChevronProps) => (\n  <Svg size={20} {...props}>\n    <path d=\"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z\" />\n  </Svg>\n);\n\n// ==============================\n// Dropdown & Clear Buttons\n// ==============================\n\nexport interface DropdownIndicatorProps<\n  Option = unknown,\n  IsMulti extends boolean = boolean,\n  Group extends GroupBase<Option> = GroupBase<Option>\n> extends CommonPropsAndClassName<Option, IsMulti, Group> {\n  /** The children to be rendered inside the indicator. */\n  children?: ReactNode;\n  /** Props that will be passed on to the children. */\n  innerProps: JSX.IntrinsicElements['div'];\n  /** The focused state of the select. */\n  isFocused: boolean;\n  isDisabled: boolean;\n}\n\nconst baseCSS = <\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>(\n  {\n    isFocused,\n    theme: {\n      spacing: { baseUnit },\n      colors,\n    },\n  }:\n    | DropdownIndicatorProps<Option, IsMulti, Group>\n    | ClearIndicatorProps<Option, IsMulti, Group>,\n  unstyled: boolean\n): CSSObjectWithLabel => ({\n  label: 'indicatorContainer',\n  display: 'flex',\n  transition: 'color 150ms',\n  ...(unstyled\n    ? {}\n    : {\n        color: isFocused ? colors.neutral60 : colors.neutral20,\n        padding: baseUnit * 2,\n        ':hover': {\n          color: isFocused ? colors.neutral80 : colors.neutral40,\n        },\n      }),\n});\n\nexport const dropdownIndicatorCSS = baseCSS;\nexport const DropdownIndicator = <\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>(\n  props: DropdownIndicatorProps<Option, IsMulti, Group>\n) => {\n  const { children, innerProps } = props;\n  return (\n    <div\n      {...getStyleProps(props, 'dropdownIndicator', {\n        indicator: true,\n        'dropdown-indicator': true,\n      })}\n      {...innerProps}\n    >\n      {children || <DownChevron />}\n    </div>\n  );\n};\n\nexport interface ClearIndicatorProps<\n  Option = unknown,\n  IsMulti extends boolean = boolean,\n  Group extends GroupBase<Option> = GroupBase<Option>\n> extends CommonPropsAndClassName<Option, IsMulti, Group> {\n  /** The children to be rendered inside the indicator. */\n  children?: ReactNode;\n  /** Props that will be passed on to the children. */\n  innerProps: JSX.IntrinsicElements['div'];\n  /** The focused state of the select. */\n  isFocused: boolean;\n}\n\nexport const clearIndicatorCSS = baseCSS;\nexport const ClearIndicator = <\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>(\n  props: ClearIndicatorProps<Option, IsMulti, Group>\n) => {\n  const { children, innerProps } = props;\n  return (\n    <div\n      {...getStyleProps(props, 'clearIndicator', {\n        indicator: true,\n        'clear-indicator': true,\n      })}\n      {...innerProps}\n    >\n      {children || <CrossIcon />}\n    </div>\n  );\n};\n\n// ==============================\n// Separator\n// ==============================\n\nexport interface IndicatorSeparatorProps<\n  Option = unknown,\n  IsMulti extends boolean = boolean,\n  Group extends GroupBase<Option> = GroupBase<Option>\n> extends CommonPropsAndClassName<Option, IsMulti, Group> {\n  isDisabled: boolean;\n  isFocused: boolean;\n  innerProps?: JSX.IntrinsicElements['span'];\n}\n\nexport const indicatorSeparatorCSS = <\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>(\n  {\n    isDisabled,\n    theme: {\n      spacing: { baseUnit },\n      colors,\n    },\n  }: IndicatorSeparatorProps<Option, IsMulti, Group>,\n  unstyled: boolean\n): CSSObjectWithLabel => ({\n  label: 'indicatorSeparator',\n  alignSelf: 'stretch',\n  width: 1,\n  ...(unstyled\n    ? {}\n    : {\n        backgroundColor: isDisabled ? colors.neutral10 : colors.neutral20,\n        marginBottom: baseUnit * 2,\n        marginTop: baseUnit * 2,\n      }),\n});\n\nexport const IndicatorSeparator = <\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>(\n  props: IndicatorSeparatorProps<Option, IsMulti, Group>\n) => {\n  const { innerProps } = props;\n  return (\n    <span\n      {...innerProps}\n      {...getStyleProps(props, 'indicatorSeparator', {\n        'indicator-separator': true,\n      })}\n    />\n  );\n};\n\n// ==============================\n// Loading\n// ==============================\n\nconst loadingDotAnimations = keyframes`\n  0%, 80%, 100% { opacity: 0; }\n  40% { opacity: 1; }\n`;\n\nexport const loadingIndicatorCSS = <\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>(\n  {\n    isFocused,\n    size,\n    theme: {\n      colors,\n      spacing: { baseUnit },\n    },\n  }: LoadingIndicatorProps<Option, IsMulti, Group>,\n  unstyled: boolean\n): CSSObjectWithLabel => ({\n  label: 'loadingIndicator',\n  display: 'flex',\n  transition: 'color 150ms',\n  alignSelf: 'center',\n  fontSize: size,\n  lineHeight: 1,\n  marginRight: size,\n  textAlign: 'center',\n  verticalAlign: 'middle',\n  ...(unstyled\n    ? {}\n    : {\n        color: isFocused ? colors.neutral60 : colors.neutral20,\n        padding: baseUnit * 2,\n      }),\n});\n\ninterface LoadingDotProps {\n  delay: number;\n  offset: boolean;\n}\nconst LoadingDot = ({ delay, offset }: LoadingDotProps) => (\n  <span\n    css={{\n      animation: `${loadingDotAnimations} 1s ease-in-out ${delay}ms infinite;`,\n      backgroundColor: 'currentColor',\n      borderRadius: '1em',\n      display: 'inline-block',\n      marginLeft: offset ? '1em' : undefined,\n      height: '1em',\n      verticalAlign: 'top',\n      width: '1em',\n    }}\n  />\n);\n\nexport interface LoadingIndicatorProps<\n  Option = unknown,\n  IsMulti extends boolean = boolean,\n  Group extends GroupBase<Option> = GroupBase<Option>\n> extends CommonPropsAndClassName<Option, IsMulti, Group> {\n  /** Props that will be passed on to the children. */\n  innerProps: JSX.IntrinsicElements['div'];\n  /** The focused state of the select. */\n  isFocused: boolean;\n  isDisabled: boolean;\n  /** Set size of the container. */\n  size: number;\n}\nexport const LoadingIndicator = <\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>({\n  innerProps,\n  isRtl,\n  size = 4,\n  ...restProps\n}: LoadingIndicatorProps<Option, IsMulti, Group>) => {\n  return (\n    <div\n      {...getStyleProps(\n        { ...restProps, innerProps, isRtl, size },\n        'loadingIndicator',\n        {\n          indicator: true,\n          'loading-indicator': true,\n        }\n      )}\n      {...innerProps}\n    >\n      <LoadingDot delay={0} offset={isRtl} />\n      <LoadingDot delay={160} offset />\n      <LoadingDot delay={320} offset={!isRtl} />\n    </div>\n  );\n};\n"
  },
  {
    "path": "packages/react-select/src/creatable/index.ts",
    "content": "export * from '../Creatable';\nexport { default } from '../Creatable';\n"
  },
  {
    "path": "packages/react-select/src/diacritics.ts",
    "content": "const diacritics = [\n  {\n    base: 'A',\n    letters:\n      '\\u0041\\u24B6\\uFF21\\u00C0\\u00C1\\u00C2\\u1EA6\\u1EA4\\u1EAA\\u1EA8\\u00C3\\u0100\\u0102\\u1EB0\\u1EAE\\u1EB4\\u1EB2\\u0226\\u01E0\\u00C4\\u01DE\\u1EA2\\u00C5\\u01FA\\u01CD\\u0200\\u0202\\u1EA0\\u1EAC\\u1EB6\\u1E00\\u0104\\u023A\\u2C6F',\n  },\n  { base: 'AA', letters: '\\uA732' },\n  { base: 'AE', letters: '\\u00C6\\u01FC\\u01E2' },\n  { base: 'AO', letters: '\\uA734' },\n  { base: 'AU', letters: '\\uA736' },\n  { base: 'AV', letters: '\\uA738\\uA73A' },\n  { base: 'AY', letters: '\\uA73C' },\n  {\n    base: 'B',\n    letters: '\\u0042\\u24B7\\uFF22\\u1E02\\u1E04\\u1E06\\u0243\\u0182\\u0181',\n  },\n  {\n    base: 'C',\n    letters:\n      '\\u0043\\u24B8\\uFF23\\u0106\\u0108\\u010A\\u010C\\u00C7\\u1E08\\u0187\\u023B\\uA73E',\n  },\n  {\n    base: 'D',\n    letters:\n      '\\u0044\\u24B9\\uFF24\\u1E0A\\u010E\\u1E0C\\u1E10\\u1E12\\u1E0E\\u0110\\u018B\\u018A\\u0189\\uA779',\n  },\n  { base: 'DZ', letters: '\\u01F1\\u01C4' },\n  { base: 'Dz', letters: '\\u01F2\\u01C5' },\n  {\n    base: 'E',\n    letters:\n      '\\u0045\\u24BA\\uFF25\\u00C8\\u00C9\\u00CA\\u1EC0\\u1EBE\\u1EC4\\u1EC2\\u1EBC\\u0112\\u1E14\\u1E16\\u0114\\u0116\\u00CB\\u1EBA\\u011A\\u0204\\u0206\\u1EB8\\u1EC6\\u0228\\u1E1C\\u0118\\u1E18\\u1E1A\\u0190\\u018E',\n  },\n  { base: 'F', letters: '\\u0046\\u24BB\\uFF26\\u1E1E\\u0191\\uA77B' },\n  {\n    base: 'G',\n    letters:\n      '\\u0047\\u24BC\\uFF27\\u01F4\\u011C\\u1E20\\u011E\\u0120\\u01E6\\u0122\\u01E4\\u0193\\uA7A0\\uA77D\\uA77E',\n  },\n  {\n    base: 'H',\n    letters:\n      '\\u0048\\u24BD\\uFF28\\u0124\\u1E22\\u1E26\\u021E\\u1E24\\u1E28\\u1E2A\\u0126\\u2C67\\u2C75\\uA78D',\n  },\n  {\n    base: 'I',\n    letters:\n      '\\u0049\\u24BE\\uFF29\\u00CC\\u00CD\\u00CE\\u0128\\u012A\\u012C\\u0130\\u00CF\\u1E2E\\u1EC8\\u01CF\\u0208\\u020A\\u1ECA\\u012E\\u1E2C\\u0197',\n  },\n  { base: 'J', letters: '\\u004A\\u24BF\\uFF2A\\u0134\\u0248' },\n  {\n    base: 'K',\n    letters:\n      '\\u004B\\u24C0\\uFF2B\\u1E30\\u01E8\\u1E32\\u0136\\u1E34\\u0198\\u2C69\\uA740\\uA742\\uA744\\uA7A2',\n  },\n  {\n    base: 'L',\n    letters:\n      '\\u004C\\u24C1\\uFF2C\\u013F\\u0139\\u013D\\u1E36\\u1E38\\u013B\\u1E3C\\u1E3A\\u0141\\u023D\\u2C62\\u2C60\\uA748\\uA746\\uA780',\n  },\n  { base: 'LJ', letters: '\\u01C7' },\n  { base: 'Lj', letters: '\\u01C8' },\n  { base: 'M', letters: '\\u004D\\u24C2\\uFF2D\\u1E3E\\u1E40\\u1E42\\u2C6E\\u019C' },\n  {\n    base: 'N',\n    letters:\n      '\\u004E\\u24C3\\uFF2E\\u01F8\\u0143\\u00D1\\u1E44\\u0147\\u1E46\\u0145\\u1E4A\\u1E48\\u0220\\u019D\\uA790\\uA7A4',\n  },\n  { base: 'NJ', letters: '\\u01CA' },\n  { base: 'Nj', letters: '\\u01CB' },\n  {\n    base: 'O',\n    letters:\n      '\\u004F\\u24C4\\uFF2F\\u00D2\\u00D3\\u00D4\\u1ED2\\u1ED0\\u1ED6\\u1ED4\\u00D5\\u1E4C\\u022C\\u1E4E\\u014C\\u1E50\\u1E52\\u014E\\u022E\\u0230\\u00D6\\u022A\\u1ECE\\u0150\\u01D1\\u020C\\u020E\\u01A0\\u1EDC\\u1EDA\\u1EE0\\u1EDE\\u1EE2\\u1ECC\\u1ED8\\u01EA\\u01EC\\u00D8\\u01FE\\u0186\\u019F\\uA74A\\uA74C',\n  },\n  { base: 'OI', letters: '\\u01A2' },\n  { base: 'OO', letters: '\\uA74E' },\n  { base: 'OU', letters: '\\u0222' },\n  {\n    base: 'P',\n    letters: '\\u0050\\u24C5\\uFF30\\u1E54\\u1E56\\u01A4\\u2C63\\uA750\\uA752\\uA754',\n  },\n  { base: 'Q', letters: '\\u0051\\u24C6\\uFF31\\uA756\\uA758\\u024A' },\n  {\n    base: 'R',\n    letters:\n      '\\u0052\\u24C7\\uFF32\\u0154\\u1E58\\u0158\\u0210\\u0212\\u1E5A\\u1E5C\\u0156\\u1E5E\\u024C\\u2C64\\uA75A\\uA7A6\\uA782',\n  },\n  {\n    base: 'S',\n    letters:\n      '\\u0053\\u24C8\\uFF33\\u1E9E\\u015A\\u1E64\\u015C\\u1E60\\u0160\\u1E66\\u1E62\\u1E68\\u0218\\u015E\\u2C7E\\uA7A8\\uA784',\n  },\n  {\n    base: 'T',\n    letters:\n      '\\u0054\\u24C9\\uFF34\\u1E6A\\u0164\\u1E6C\\u021A\\u0162\\u1E70\\u1E6E\\u0166\\u01AC\\u01AE\\u023E\\uA786',\n  },\n  { base: 'TZ', letters: '\\uA728' },\n  {\n    base: 'U',\n    letters:\n      '\\u0055\\u24CA\\uFF35\\u00D9\\u00DA\\u00DB\\u0168\\u1E78\\u016A\\u1E7A\\u016C\\u00DC\\u01DB\\u01D7\\u01D5\\u01D9\\u1EE6\\u016E\\u0170\\u01D3\\u0214\\u0216\\u01AF\\u1EEA\\u1EE8\\u1EEE\\u1EEC\\u1EF0\\u1EE4\\u1E72\\u0172\\u1E76\\u1E74\\u0244',\n  },\n  { base: 'V', letters: '\\u0056\\u24CB\\uFF36\\u1E7C\\u1E7E\\u01B2\\uA75E\\u0245' },\n  { base: 'VY', letters: '\\uA760' },\n  {\n    base: 'W',\n    letters: '\\u0057\\u24CC\\uFF37\\u1E80\\u1E82\\u0174\\u1E86\\u1E84\\u1E88\\u2C72',\n  },\n  { base: 'X', letters: '\\u0058\\u24CD\\uFF38\\u1E8A\\u1E8C' },\n  {\n    base: 'Y',\n    letters:\n      '\\u0059\\u24CE\\uFF39\\u1EF2\\u00DD\\u0176\\u1EF8\\u0232\\u1E8E\\u0178\\u1EF6\\u1EF4\\u01B3\\u024E\\u1EFE',\n  },\n  {\n    base: 'Z',\n    letters:\n      '\\u005A\\u24CF\\uFF3A\\u0179\\u1E90\\u017B\\u017D\\u1E92\\u1E94\\u01B5\\u0224\\u2C7F\\u2C6B\\uA762',\n  },\n  {\n    base: 'a',\n    letters:\n      '\\u0061\\u24D0\\uFF41\\u1E9A\\u00E0\\u00E1\\u00E2\\u1EA7\\u1EA5\\u1EAB\\u1EA9\\u00E3\\u0101\\u0103\\u1EB1\\u1EAF\\u1EB5\\u1EB3\\u0227\\u01E1\\u00E4\\u01DF\\u1EA3\\u00E5\\u01FB\\u01CE\\u0201\\u0203\\u1EA1\\u1EAD\\u1EB7\\u1E01\\u0105\\u2C65\\u0250',\n  },\n  { base: 'aa', letters: '\\uA733' },\n  { base: 'ae', letters: '\\u00E6\\u01FD\\u01E3' },\n  { base: 'ao', letters: '\\uA735' },\n  { base: 'au', letters: '\\uA737' },\n  { base: 'av', letters: '\\uA739\\uA73B' },\n  { base: 'ay', letters: '\\uA73D' },\n  {\n    base: 'b',\n    letters: '\\u0062\\u24D1\\uFF42\\u1E03\\u1E05\\u1E07\\u0180\\u0183\\u0253',\n  },\n  {\n    base: 'c',\n    letters:\n      '\\u0063\\u24D2\\uFF43\\u0107\\u0109\\u010B\\u010D\\u00E7\\u1E09\\u0188\\u023C\\uA73F\\u2184',\n  },\n  {\n    base: 'd',\n    letters:\n      '\\u0064\\u24D3\\uFF44\\u1E0B\\u010F\\u1E0D\\u1E11\\u1E13\\u1E0F\\u0111\\u018C\\u0256\\u0257\\uA77A',\n  },\n  { base: 'dz', letters: '\\u01F3\\u01C6' },\n  {\n    base: 'e',\n    letters:\n      '\\u0065\\u24D4\\uFF45\\u00E8\\u00E9\\u00EA\\u1EC1\\u1EBF\\u1EC5\\u1EC3\\u1EBD\\u0113\\u1E15\\u1E17\\u0115\\u0117\\u00EB\\u1EBB\\u011B\\u0205\\u0207\\u1EB9\\u1EC7\\u0229\\u1E1D\\u0119\\u1E19\\u1E1B\\u0247\\u025B\\u01DD',\n  },\n  { base: 'f', letters: '\\u0066\\u24D5\\uFF46\\u1E1F\\u0192\\uA77C' },\n  {\n    base: 'g',\n    letters:\n      '\\u0067\\u24D6\\uFF47\\u01F5\\u011D\\u1E21\\u011F\\u0121\\u01E7\\u0123\\u01E5\\u0260\\uA7A1\\u1D79\\uA77F',\n  },\n  {\n    base: 'h',\n    letters:\n      '\\u0068\\u24D7\\uFF48\\u0125\\u1E23\\u1E27\\u021F\\u1E25\\u1E29\\u1E2B\\u1E96\\u0127\\u2C68\\u2C76\\u0265',\n  },\n  { base: 'hv', letters: '\\u0195' },\n  {\n    base: 'i',\n    letters:\n      '\\u0069\\u24D8\\uFF49\\u00EC\\u00ED\\u00EE\\u0129\\u012B\\u012D\\u00EF\\u1E2F\\u1EC9\\u01D0\\u0209\\u020B\\u1ECB\\u012F\\u1E2D\\u0268\\u0131',\n  },\n  { base: 'j', letters: '\\u006A\\u24D9\\uFF4A\\u0135\\u01F0\\u0249' },\n  {\n    base: 'k',\n    letters:\n      '\\u006B\\u24DA\\uFF4B\\u1E31\\u01E9\\u1E33\\u0137\\u1E35\\u0199\\u2C6A\\uA741\\uA743\\uA745\\uA7A3',\n  },\n  {\n    base: 'l',\n    letters:\n      '\\u006C\\u24DB\\uFF4C\\u0140\\u013A\\u013E\\u1E37\\u1E39\\u013C\\u1E3D\\u1E3B\\u017F\\u0142\\u019A\\u026B\\u2C61\\uA749\\uA781\\uA747',\n  },\n  { base: 'lj', letters: '\\u01C9' },\n  { base: 'm', letters: '\\u006D\\u24DC\\uFF4D\\u1E3F\\u1E41\\u1E43\\u0271\\u026F' },\n  {\n    base: 'n',\n    letters:\n      '\\u006E\\u24DD\\uFF4E\\u01F9\\u0144\\u00F1\\u1E45\\u0148\\u1E47\\u0146\\u1E4B\\u1E49\\u019E\\u0272\\u0149\\uA791\\uA7A5',\n  },\n  { base: 'nj', letters: '\\u01CC' },\n  {\n    base: 'o',\n    letters:\n      '\\u006F\\u24DE\\uFF4F\\u00F2\\u00F3\\u00F4\\u1ED3\\u1ED1\\u1ED7\\u1ED5\\u00F5\\u1E4D\\u022D\\u1E4F\\u014D\\u1E51\\u1E53\\u014F\\u022F\\u0231\\u00F6\\u022B\\u1ECF\\u0151\\u01D2\\u020D\\u020F\\u01A1\\u1EDD\\u1EDB\\u1EE1\\u1EDF\\u1EE3\\u1ECD\\u1ED9\\u01EB\\u01ED\\u00F8\\u01FF\\u0254\\uA74B\\uA74D\\u0275',\n  },\n  { base: 'oi', letters: '\\u01A3' },\n  { base: 'ou', letters: '\\u0223' },\n  { base: 'oo', letters: '\\uA74F' },\n  {\n    base: 'p',\n    letters: '\\u0070\\u24DF\\uFF50\\u1E55\\u1E57\\u01A5\\u1D7D\\uA751\\uA753\\uA755',\n  },\n  { base: 'q', letters: '\\u0071\\u24E0\\uFF51\\u024B\\uA757\\uA759' },\n  {\n    base: 'r',\n    letters:\n      '\\u0072\\u24E1\\uFF52\\u0155\\u1E59\\u0159\\u0211\\u0213\\u1E5B\\u1E5D\\u0157\\u1E5F\\u024D\\u027D\\uA75B\\uA7A7\\uA783',\n  },\n  {\n    base: 's',\n    letters:\n      '\\u0073\\u24E2\\uFF53\\u00DF\\u015B\\u1E65\\u015D\\u1E61\\u0161\\u1E67\\u1E63\\u1E69\\u0219\\u015F\\u023F\\uA7A9\\uA785\\u1E9B',\n  },\n  {\n    base: 't',\n    letters:\n      '\\u0074\\u24E3\\uFF54\\u1E6B\\u1E97\\u0165\\u1E6D\\u021B\\u0163\\u1E71\\u1E6F\\u0167\\u01AD\\u0288\\u2C66\\uA787',\n  },\n  { base: 'tz', letters: '\\uA729' },\n  {\n    base: 'u',\n    letters:\n      '\\u0075\\u24E4\\uFF55\\u00F9\\u00FA\\u00FB\\u0169\\u1E79\\u016B\\u1E7B\\u016D\\u00FC\\u01DC\\u01D8\\u01D6\\u01DA\\u1EE7\\u016F\\u0171\\u01D4\\u0215\\u0217\\u01B0\\u1EEB\\u1EE9\\u1EEF\\u1EED\\u1EF1\\u1EE5\\u1E73\\u0173\\u1E77\\u1E75\\u0289',\n  },\n  { base: 'v', letters: '\\u0076\\u24E5\\uFF56\\u1E7D\\u1E7F\\u028B\\uA75F\\u028C' },\n  { base: 'vy', letters: '\\uA761' },\n  {\n    base: 'w',\n    letters:\n      '\\u0077\\u24E6\\uFF57\\u1E81\\u1E83\\u0175\\u1E87\\u1E85\\u1E98\\u1E89\\u2C73',\n  },\n  { base: 'x', letters: '\\u0078\\u24E7\\uFF58\\u1E8B\\u1E8D' },\n  {\n    base: 'y',\n    letters:\n      '\\u0079\\u24E8\\uFF59\\u1EF3\\u00FD\\u0177\\u1EF9\\u0233\\u1E8F\\u00FF\\u1EF7\\u1E99\\u1EF5\\u01B4\\u024F\\u1EFF',\n  },\n  {\n    base: 'z',\n    letters:\n      '\\u007A\\u24E9\\uFF5A\\u017A\\u1E91\\u017C\\u017E\\u1E93\\u1E95\\u01B6\\u0225\\u0240\\u2C6C\\uA763',\n  },\n];\n\nconst anyDiacritic = new RegExp(\n  '[' + diacritics.map((d) => d.letters).join('') + ']',\n  'g'\n);\nconst diacriticToBase: { [letters: string]: string } = {};\n\nfor (let i = 0; i < diacritics.length; i++) {\n  let diacritic = diacritics[i];\n  for (let j = 0; j < diacritic.letters.length; j++) {\n    diacriticToBase[diacritic.letters[j]] = diacritic.base;\n  }\n}\n\nexport const stripDiacritics = (str: string) => {\n  return str.replace(anyDiacritic, (match) => diacriticToBase[match]);\n};\n"
  },
  {
    "path": "packages/react-select/src/filters.ts",
    "content": "import memoizeOne from 'memoize-one';\nimport { stripDiacritics } from './diacritics';\n\nexport interface FilterOptionOption<Option> {\n  readonly label: string;\n  readonly value: string;\n  readonly data: Option;\n}\n\ninterface Config<Option> {\n  readonly ignoreCase?: boolean;\n  readonly ignoreAccents?: boolean;\n  readonly stringify?: (option: FilterOptionOption<Option>) => string;\n  readonly trim?: boolean;\n  readonly matchFrom?: 'any' | 'start';\n}\n\nconst memoizedStripDiacriticsForInput = memoizeOne(stripDiacritics);\n\nconst trimString = (str: string) => str.replace(/^\\s+|\\s+$/g, '');\nconst defaultStringify = <Option>(option: FilterOptionOption<Option>) =>\n  `${option.label} ${option.value}`;\n\nexport const createFilter =\n  <Option>(config?: Config<Option>) =>\n  (option: FilterOptionOption<Option>, rawInput: string): boolean => {\n    // eslint-disable-next-line no-underscore-dangle\n    if ((option.data as { __isNew__?: unknown }).__isNew__) return true;\n    const { ignoreCase, ignoreAccents, stringify, trim, matchFrom } = {\n      ignoreCase: true,\n      ignoreAccents: true,\n      stringify: defaultStringify,\n      trim: true,\n      matchFrom: 'any',\n      ...config,\n    };\n    let input = trim ? trimString(rawInput) : rawInput;\n    let candidate = trim ? trimString(stringify(option)) : stringify(option);\n    if (ignoreCase) {\n      input = input.toLowerCase();\n      candidate = candidate.toLowerCase();\n    }\n    if (ignoreAccents) {\n      input = memoizedStripDiacriticsForInput(input);\n      candidate = stripDiacritics(candidate);\n    }\n    return matchFrom === 'start'\n      ? candidate.substr(0, input.length) === input\n      : candidate.indexOf(input) > -1;\n  };\n"
  },
  {
    "path": "packages/react-select/src/index.ts",
    "content": "import Select from './Select';\nimport type { GroupBase } from './types';\nexport type { FilterOptionOption } from './filters';\nimport useStateManager from './useStateManager';\n\nexport { default } from './stateManager';\nexport { default as NonceProvider } from './NonceProvider';\nexport { mergeStyles } from './styles';\nexport { defaultTheme } from './theme';\nexport { createFilter } from './filters';\nexport { components } from './components';\nexport type SelectInstance<\n  Option = unknown,\n  IsMulti extends boolean = false,\n  Group extends GroupBase<Option> = GroupBase<Option>\n> = Select<Option, IsMulti, Group>;\nexport type { StateManagerProps as Props } from './useStateManager';\nexport { useStateManager };\n\nexport type { SelectComponentsConfig } from './components';\nexport type {\n  ContainerProps,\n  IndicatorsContainerProps,\n  ValueContainerProps,\n} from './components/containers';\nexport type { ControlProps } from './components/Control';\nexport type { GroupProps, GroupHeadingProps } from './components/Group';\nexport type {\n  ClearIndicatorProps,\n  DropdownIndicatorProps,\n  IndicatorSeparatorProps,\n  LoadingIndicatorProps,\n} from './components/indicators';\nexport type { InputProps } from './components/Input';\nexport type { MenuListProps, MenuProps, NoticeProps } from './components/Menu';\nexport type {\n  MultiValueGenericProps,\n  MultiValueProps,\n  MultiValueRemoveProps,\n} from './components/MultiValue';\nexport type { OptionProps } from './components/Option';\nexport type { PlaceholderProps } from './components/Placeholder';\nexport type { SingleValueProps } from './components/SingleValue';\nexport type { ThemeConfig } from './theme';\nexport type { ClassNamesConfig, StylesConfig } from './styles';\nexport * from './types';\nexport type {\n  OptionContext,\n  GuidanceContext,\n  AriaGuidanceProps,\n  AriaOnChangeProps,\n  AriaOnFilterProps,\n  AriaOnFocusProps,\n  AriaLiveMessages,\n  AriaGuidance,\n  AriaOnChange,\n  AriaOnFilter,\n  AriaOnFocus,\n} from './accessibility';\nexport type { FormatOptionLabelContext, FormatOptionLabelMeta } from './Select';\n"
  },
  {
    "path": "packages/react-select/src/internal/A11yText.tsx",
    "content": "/** @jsx jsx */\nimport { JSX } from 'react';\nimport { jsx } from '@emotion/react';\n\n// Assistive text to describe visual elements. Hidden for sighted users.\nconst A11yText = (props: JSX.IntrinsicElements['span']) => (\n  <span\n    css={{\n      label: 'a11yText',\n      zIndex: 9999,\n      border: 0,\n      clip: 'rect(1px, 1px, 1px, 1px)',\n      height: 1,\n      width: 1,\n      position: 'absolute',\n      overflow: 'hidden',\n      padding: 0,\n      whiteSpace: 'nowrap',\n    }}\n    {...props}\n  />\n);\n\nexport default A11yText;\n"
  },
  {
    "path": "packages/react-select/src/internal/DummyInput.tsx",
    "content": "/** @jsx jsx */\nimport { JSX, Ref } from 'react';\nimport { jsx } from '@emotion/react';\nimport { removeProps } from '../utils';\n\nexport default function DummyInput({\n  innerRef,\n  ...props\n}: JSX.IntrinsicElements['input'] & {\n  readonly innerRef: Ref<HTMLInputElement>;\n}) {\n  // Remove animation props not meant for HTML elements\n  const filteredProps = removeProps(\n    props,\n    'onExited',\n    'in',\n    'enter',\n    'exit',\n    'appear'\n  );\n\n  return (\n    <input\n      ref={innerRef}\n      {...filteredProps}\n      css={{\n        label: 'dummyInput',\n        // get rid of any default styles\n        background: 0,\n        border: 0,\n        // important! this hides the flashing cursor\n        caretColor: 'transparent',\n        fontSize: 'inherit',\n        gridArea: '1 / 1 / 2 / 3',\n        outline: 0,\n        padding: 0,\n        // important! without `width` browsers won't allow focus\n        width: 1,\n\n        // remove cursor on desktop\n        color: 'transparent',\n\n        // remove cursor on mobile whilst maintaining \"scroll into view\" behaviour\n        left: -100,\n        opacity: 0,\n        position: 'relative',\n        transform: 'scale(.01)',\n      }}\n    />\n  );\n}\n"
  },
  {
    "path": "packages/react-select/src/internal/RequiredInput.tsx",
    "content": "/** @jsx jsx */\nimport { FocusEventHandler, FunctionComponent } from 'react';\nimport { jsx } from '@emotion/react';\n\nconst RequiredInput: FunctionComponent<{\n  readonly name?: string;\n  readonly onFocus: FocusEventHandler<HTMLInputElement>;\n}> = ({ name, onFocus }) => (\n  <input\n    required\n    name={name}\n    tabIndex={-1}\n    aria-hidden=\"true\"\n    onFocus={onFocus}\n    css={{\n      label: 'requiredInput',\n      opacity: 0,\n      pointerEvents: 'none',\n      position: 'absolute',\n      bottom: 0,\n      left: 0,\n      right: 0,\n      width: '100%',\n    }}\n    // Prevent `Switching from uncontrolled to controlled` error\n    value=\"\"\n    onChange={() => {}}\n  />\n);\n\nexport default RequiredInput;\n"
  },
  {
    "path": "packages/react-select/src/internal/ScrollManager.tsx",
    "content": "/** @jsx jsx */\nimport { jsx } from '@emotion/react';\nimport { Fragment, ReactElement, RefCallback, MouseEvent } from 'react';\nimport useScrollCapture from './useScrollCapture';\nimport useScrollLock from './useScrollLock';\n\ninterface Props {\n  readonly children: (ref: RefCallback<HTMLElement>) => ReactElement;\n  readonly lockEnabled: boolean;\n  readonly captureEnabled: boolean;\n  readonly onBottomArrive?: (event: WheelEvent | TouchEvent) => void;\n  readonly onBottomLeave?: (event: WheelEvent | TouchEvent) => void;\n  readonly onTopArrive?: (event: WheelEvent | TouchEvent) => void;\n  readonly onTopLeave?: (event: WheelEvent | TouchEvent) => void;\n}\n\nconst blurSelectInput = (event: MouseEvent<HTMLDivElement>) => {\n  const element = event.target as HTMLDivElement;\n  return (\n    element.ownerDocument.activeElement &&\n    (element.ownerDocument.activeElement as HTMLElement).blur()\n  );\n};\n\nexport default function ScrollManager({\n  children,\n  lockEnabled,\n  captureEnabled = true,\n  onBottomArrive,\n  onBottomLeave,\n  onTopArrive,\n  onTopLeave,\n}: Props) {\n  const setScrollCaptureTarget = useScrollCapture({\n    isEnabled: captureEnabled,\n    onBottomArrive,\n    onBottomLeave,\n    onTopArrive,\n    onTopLeave,\n  });\n  const setScrollLockTarget = useScrollLock({ isEnabled: lockEnabled });\n\n  const targetRef: RefCallback<HTMLElement> = (element) => {\n    setScrollCaptureTarget(element);\n    setScrollLockTarget(element);\n  };\n\n  return (\n    <Fragment>\n      {lockEnabled && (\n        <div\n          onClick={blurSelectInput}\n          css={{ position: 'fixed', left: 0, bottom: 0, right: 0, top: 0 }}\n        />\n      )}\n      {children(targetRef)}\n    </Fragment>\n  );\n}\n"
  },
  {
    "path": "packages/react-select/src/internal/index.ts",
    "content": "export { default as A11yText } from './A11yText';\nexport { default as DummyInput } from './DummyInput';\nexport { default as ScrollManager } from './ScrollManager';\nexport { default as RequiredInput } from './RequiredInput';\n"
  },
  {
    "path": "packages/react-select/src/internal/useScrollCapture.ts",
    "content": "import { useCallback, useEffect, useRef } from 'react';\nimport { supportsPassiveEvents } from '../utils';\n\nconst cancelScroll = (event: WheelEvent | TouchEvent) => {\n  if (event.cancelable) event.preventDefault();\n  event.stopPropagation();\n};\n\ninterface Options {\n  readonly isEnabled: boolean;\n  readonly onBottomArrive?: (event: WheelEvent | TouchEvent) => void;\n  readonly onBottomLeave?: (event: WheelEvent | TouchEvent) => void;\n  readonly onTopArrive?: (event: WheelEvent | TouchEvent) => void;\n  readonly onTopLeave?: (event: WheelEvent | TouchEvent) => void;\n}\n\nexport default function useScrollCapture({\n  isEnabled,\n  onBottomArrive,\n  onBottomLeave,\n  onTopArrive,\n  onTopLeave,\n}: Options) {\n  const isBottom = useRef(false);\n  const isTop = useRef(false);\n  const touchStart = useRef(0);\n  const scrollTarget = useRef<HTMLElement | null>(null);\n\n  const handleEventDelta = useCallback(\n    (event: WheelEvent | TouchEvent, delta: number) => {\n      if (scrollTarget.current === null) return;\n\n      const { scrollTop, scrollHeight, clientHeight } = scrollTarget.current;\n      const target = scrollTarget.current;\n      const isDeltaPositive = delta > 0;\n      const availableScroll = scrollHeight - clientHeight - scrollTop;\n      let shouldCancelScroll = false;\n\n      // reset bottom/top flags\n      if (availableScroll > delta && isBottom.current) {\n        if (onBottomLeave) onBottomLeave(event);\n        isBottom.current = false;\n      }\n      if (isDeltaPositive && isTop.current) {\n        if (onTopLeave) onTopLeave(event);\n        isTop.current = false;\n      }\n\n      // bottom limit\n      if (isDeltaPositive && delta > availableScroll) {\n        if (onBottomArrive && !isBottom.current) {\n          onBottomArrive(event);\n        }\n        target.scrollTop = scrollHeight;\n        shouldCancelScroll = true;\n        isBottom.current = true;\n\n        // top limit\n      } else if (!isDeltaPositive && -delta > scrollTop) {\n        if (onTopArrive && !isTop.current) {\n          onTopArrive(event);\n        }\n        target.scrollTop = 0;\n        shouldCancelScroll = true;\n        isTop.current = true;\n      }\n\n      // cancel scroll\n      if (shouldCancelScroll) {\n        cancelScroll(event);\n      }\n    },\n    [onBottomArrive, onBottomLeave, onTopArrive, onTopLeave]\n  );\n\n  const onWheel = useCallback(\n    (event: WheelEvent) => {\n      handleEventDelta(event, event.deltaY);\n    },\n    [handleEventDelta]\n  );\n  const onTouchStart = useCallback((event: TouchEvent) => {\n    // set touch start so we can calculate touchmove delta\n    touchStart.current = event.changedTouches[0].clientY;\n  }, []);\n  const onTouchMove = useCallback(\n    (event: TouchEvent) => {\n      const deltaY = touchStart.current - event.changedTouches[0].clientY;\n      handleEventDelta(event, deltaY);\n    },\n    [handleEventDelta]\n  );\n\n  const startListening = useCallback(\n    (el) => {\n      // bail early if no element is available to attach to\n      if (!el) return;\n\n      const notPassive = supportsPassiveEvents ? { passive: false } : false;\n      el.addEventListener('wheel', onWheel, notPassive);\n      el.addEventListener('touchstart', onTouchStart, notPassive);\n      el.addEventListener('touchmove', onTouchMove, notPassive);\n    },\n    [onTouchMove, onTouchStart, onWheel]\n  );\n\n  const stopListening = useCallback(\n    (el) => {\n      // bail early if no element is available to detach from\n      if (!el) return;\n\n      el.removeEventListener('wheel', onWheel, false);\n      el.removeEventListener('touchstart', onTouchStart, false);\n      el.removeEventListener('touchmove', onTouchMove, false);\n    },\n    [onTouchMove, onTouchStart, onWheel]\n  );\n\n  useEffect(() => {\n    if (!isEnabled) return;\n\n    const element = scrollTarget.current;\n    startListening(element);\n\n    return () => {\n      stopListening(element);\n    };\n  }, [isEnabled, startListening, stopListening]);\n\n  return (element: HTMLElement | null) => {\n    scrollTarget.current = element;\n  };\n}\n"
  },
  {
    "path": "packages/react-select/src/internal/useScrollLock.ts",
    "content": "import { useCallback, useEffect, useRef } from 'react';\n\nconst STYLE_KEYS = [\n  'boxSizing',\n  'height',\n  'overflow',\n  'paddingRight',\n  'position',\n] as const;\n\nconst LOCK_STYLES = {\n  boxSizing: 'border-box', // account for possible declaration `width: 100%;` on body\n  overflow: 'hidden',\n  position: 'relative',\n  height: '100%',\n};\n\nfunction preventTouchMove(e: TouchEvent) {\n  if (e.cancelable) e.preventDefault();\n}\n\nfunction allowTouchMove(e: TouchEvent) {\n  e.stopPropagation();\n}\n\nfunction preventInertiaScroll(this: HTMLElement) {\n  const top = this.scrollTop;\n  const totalScroll = this.scrollHeight;\n  const currentScroll = top + this.offsetHeight;\n\n  if (top === 0) {\n    this.scrollTop = 1;\n  } else if (currentScroll === totalScroll) {\n    this.scrollTop = top - 1;\n  }\n}\n\n// `ontouchstart` check works on most browsers\n// `maxTouchPoints` works on IE10/11 and Surface\nfunction isTouchDevice() {\n  return 'ontouchstart' in window || navigator.maxTouchPoints;\n}\n\nconst canUseDOM = !!(\n  typeof window !== 'undefined' &&\n  window.document &&\n  window.document.createElement\n);\n\nlet activeScrollLocks = 0;\n\ninterface Options {\n  readonly isEnabled: boolean;\n  readonly accountForScrollbars?: boolean;\n}\n\nconst listenerOptions = {\n  capture: false,\n  passive: false,\n};\n\nexport default function useScrollLock({\n  isEnabled,\n  accountForScrollbars = true,\n}: Options) {\n  const originalStyles = useRef<{ [key: string]: string }>({});\n  const scrollTarget = useRef<HTMLElement | null>(null);\n\n  const addScrollLock = useCallback(\n    (touchScrollTarget: HTMLElement | null) => {\n      if (!canUseDOM) return;\n\n      const target = document.body;\n      const targetStyle = target && target.style;\n\n      if (accountForScrollbars) {\n        // store any styles already applied to the body\n        STYLE_KEYS.forEach((key) => {\n          const val = targetStyle && targetStyle[key];\n          originalStyles.current[key] = val;\n        });\n      }\n\n      // apply the lock styles and padding if this is the first scroll lock\n      if (accountForScrollbars && activeScrollLocks < 1) {\n        const currentPadding =\n          parseInt(originalStyles.current.paddingRight, 10) || 0;\n        const clientWidth = document.body ? document.body.clientWidth : 0;\n        const adjustedPadding =\n          window.innerWidth - clientWidth + currentPadding || 0;\n\n        Object.keys(LOCK_STYLES).forEach((key) => {\n          const val = LOCK_STYLES[key as keyof typeof LOCK_STYLES];\n          if (targetStyle) {\n            targetStyle[key as keyof typeof LOCK_STYLES] = val;\n          }\n        });\n\n        if (targetStyle) {\n          targetStyle.paddingRight = `${adjustedPadding}px`;\n        }\n      }\n\n      // account for touch devices\n      if (target && isTouchDevice()) {\n        // Mobile Safari ignores { overflow: hidden } declaration on the body.\n        target.addEventListener('touchmove', preventTouchMove, listenerOptions);\n\n        // Allow scroll on provided target\n        if (touchScrollTarget) {\n          touchScrollTarget.addEventListener(\n            'touchstart',\n            preventInertiaScroll,\n            listenerOptions\n          );\n          touchScrollTarget.addEventListener(\n            'touchmove',\n            allowTouchMove,\n            listenerOptions\n          );\n        }\n      }\n\n      // increment active scroll locks\n      activeScrollLocks += 1;\n    },\n    [accountForScrollbars]\n  );\n\n  const removeScrollLock = useCallback(\n    (touchScrollTarget: HTMLElement | null) => {\n      if (!canUseDOM) return;\n\n      const target = document.body;\n      const targetStyle = target && target.style;\n\n      // safely decrement active scroll locks\n      activeScrollLocks = Math.max(activeScrollLocks - 1, 0);\n\n      // reapply original body styles, if any\n      if (accountForScrollbars && activeScrollLocks < 1) {\n        STYLE_KEYS.forEach((key) => {\n          const val = originalStyles.current[key];\n          if (targetStyle) {\n            targetStyle[key] = val;\n          }\n        });\n      }\n\n      // remove touch listeners\n      if (target && isTouchDevice()) {\n        target.removeEventListener(\n          'touchmove',\n          preventTouchMove,\n          listenerOptions\n        );\n\n        if (touchScrollTarget) {\n          touchScrollTarget.removeEventListener(\n            'touchstart',\n            preventInertiaScroll,\n            listenerOptions\n          );\n          touchScrollTarget.removeEventListener(\n            'touchmove',\n            allowTouchMove,\n            listenerOptions\n          );\n        }\n      }\n    },\n    [accountForScrollbars]\n  );\n\n  useEffect(() => {\n    if (!isEnabled) return;\n\n    const element = scrollTarget.current;\n    addScrollLock(element);\n\n    return () => {\n      removeScrollLock(element);\n    };\n  }, [isEnabled, addScrollLock, removeScrollLock]);\n\n  return (element: HTMLElement | null) => {\n    scrollTarget.current = element;\n  };\n}\n"
  },
  {
    "path": "packages/react-select/src/stateManager.tsx",
    "content": "import * as React from 'react';\nimport {\n  forwardRef,\n  MutableRefObject,\n  ReactElement,\n  RefAttributes,\n} from 'react';\n\nimport { GroupBase } from './types';\nimport Select from './Select';\nimport useStateManager from './useStateManager';\nimport type { StateManagerProps } from './useStateManager';\nexport type { StateManagerProps };\n\ntype StateManagedSelect = <\n  Option = unknown,\n  IsMulti extends boolean = false,\n  Group extends GroupBase<Option> = GroupBase<Option>\n>(\n  props: StateManagerProps<Option, IsMulti, Group> &\n    RefAttributes<Select<Option, IsMulti, Group>>\n) => ReactElement;\n\nconst StateManagedSelect = forwardRef(\n  <Option, IsMulti extends boolean, Group extends GroupBase<Option>>(\n    props: StateManagerProps<Option, IsMulti, Group>,\n    ref:\n      | ((instance: Select<Option, IsMulti, Group> | null) => void)\n      | MutableRefObject<Select<Option, IsMulti, Group> | null>\n      | null\n  ) => {\n    const baseSelectProps = useStateManager(props);\n\n    return <Select ref={ref} {...baseSelectProps} />;\n  }\n) as StateManagedSelect;\n\nexport default StateManagedSelect;\n"
  },
  {
    "path": "packages/react-select/src/styles.ts",
    "content": "import {\n  containerCSS,\n  ContainerProps,\n  indicatorsContainerCSS,\n  IndicatorsContainerProps,\n  valueContainerCSS,\n  ValueContainerProps,\n} from './components/containers';\nimport { ControlProps, css as controlCSS } from './components/Control';\nimport {\n  groupCSS,\n  groupHeadingCSS,\n  GroupHeadingProps,\n  GroupProps,\n} from './components/Group';\nimport {\n  clearIndicatorCSS,\n  dropdownIndicatorCSS,\n  loadingIndicatorCSS,\n  indicatorSeparatorCSS,\n  ClearIndicatorProps,\n  DropdownIndicatorProps,\n  IndicatorSeparatorProps,\n  LoadingIndicatorProps,\n} from './components/indicators';\nimport { inputCSS, InputProps } from './components/Input';\nimport { placeholderCSS, PlaceholderProps } from './components/Placeholder';\nimport { optionCSS, OptionProps } from './components/Option';\nimport {\n  menuCSS,\n  menuListCSS,\n  menuPortalCSS,\n  noOptionsMessageCSS,\n  loadingMessageCSS,\n  NoticeProps,\n  MenuProps,\n  MenuListProps,\n  PortalStyleArgs,\n} from './components/Menu';\nimport {\n  css as singleValueCSS,\n  SingleValueProps,\n} from './components/SingleValue';\nimport {\n  multiValueCSS,\n  multiValueLabelCSS,\n  MultiValueProps,\n  multiValueRemoveCSS,\n} from './components/MultiValue';\nimport { CSSObjectWithLabel, GroupBase } from './types';\n\nexport interface StylesProps<\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n> {\n  clearIndicator: ClearIndicatorProps<Option, IsMulti, Group>;\n  container: ContainerProps<Option, IsMulti, Group>;\n  control: ControlProps<Option, IsMulti, Group>;\n  dropdownIndicator: DropdownIndicatorProps<Option, IsMulti, Group>;\n  group: GroupProps<Option, IsMulti, Group>;\n  groupHeading: GroupHeadingProps<Option, IsMulti, Group>;\n  indicatorsContainer: IndicatorsContainerProps<Option, IsMulti, Group>;\n  indicatorSeparator: IndicatorSeparatorProps<Option, IsMulti, Group>;\n  input: InputProps<Option, IsMulti, Group>;\n  loadingIndicator: LoadingIndicatorProps<Option, IsMulti, Group>;\n  loadingMessage: NoticeProps<Option, IsMulti, Group>;\n  menu: MenuProps<Option, IsMulti, Group>;\n  menuList: MenuListProps<Option, IsMulti, Group>;\n  menuPortal: PortalStyleArgs;\n  multiValue: MultiValueProps<Option, IsMulti, Group>;\n  multiValueLabel: MultiValueProps<Option, IsMulti, Group>;\n  multiValueRemove: MultiValueProps<Option, IsMulti, Group>;\n  noOptionsMessage: NoticeProps<Option, IsMulti, Group>;\n  option: OptionProps<Option, IsMulti, Group>;\n  placeholder: PlaceholderProps<Option, IsMulti, Group>;\n  singleValue: SingleValueProps<Option, IsMulti, Group>;\n  valueContainer: ValueContainerProps<Option, IsMulti, Group>;\n}\n\nexport const defaultStyles: {\n  [K in keyof StylesProps<any, any, any>]: (\n    props: StylesProps<unknown, boolean, GroupBase<unknown>>[K],\n    unstyled: boolean\n  ) => CSSObjectWithLabel;\n} = {\n  clearIndicator: clearIndicatorCSS,\n  container: containerCSS,\n  control: controlCSS,\n  dropdownIndicator: dropdownIndicatorCSS,\n  group: groupCSS,\n  groupHeading: groupHeadingCSS,\n  indicatorsContainer: indicatorsContainerCSS,\n  indicatorSeparator: indicatorSeparatorCSS,\n  input: inputCSS,\n  loadingIndicator: loadingIndicatorCSS,\n  loadingMessage: loadingMessageCSS,\n  menu: menuCSS,\n  menuList: menuListCSS,\n  menuPortal: menuPortalCSS,\n  multiValue: multiValueCSS,\n  multiValueLabel: multiValueLabelCSS,\n  multiValueRemove: multiValueRemoveCSS,\n  noOptionsMessage: noOptionsMessageCSS,\n  option: optionCSS,\n  placeholder: placeholderCSS,\n  singleValue: singleValueCSS,\n  valueContainer: valueContainerCSS,\n};\n\nexport type StylesConfig<\n  Option = unknown,\n  IsMulti extends boolean = boolean,\n  Group extends GroupBase<Option> = GroupBase<Option>\n> = {\n  [K in keyof StylesProps<Option, IsMulti, Group>]?: (\n    base: CSSObjectWithLabel,\n    props: StylesProps<Option, IsMulti, Group>[K]\n  ) => CSSObjectWithLabel;\n};\n\nexport type ClassNamesConfig<\n  Option = unknown,\n  IsMulti extends boolean = boolean,\n  Group extends GroupBase<Option> = GroupBase<Option>\n> = {\n  [K in keyof StylesProps<Option, IsMulti, Group>]?: (\n    props: StylesProps<Option, IsMulti, Group>[K]\n  ) => string;\n};\n\n// Merge Utility\n// Allows consumers to extend a base Select with additional styles\n\nexport function mergeStyles<\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>(\n  source: StylesConfig<Option, IsMulti, Group>,\n  target: StylesConfig<Option, IsMulti, Group> = {}\n) {\n  // initialize with source styles\n  const styles = { ...source };\n\n  // massage in target styles\n  Object.keys(target).forEach((keyAsString) => {\n    const key = keyAsString as keyof StylesConfig<Option, IsMulti, Group>;\n    if (source[key]) {\n      styles[key] = (rsCss: any, props: any) => {\n        return target[key]!(source[key]!(rsCss, props), props);\n      };\n    } else {\n      styles[key] = target[key] as any;\n    }\n  });\n\n  return styles;\n}\n"
  },
  {
    "path": "packages/react-select/src/theme.ts",
    "content": "import { Theme } from './types';\n\nexport const colors = {\n  primary: '#2684FF',\n  primary75: '#4C9AFF',\n  primary50: '#B2D4FF',\n  primary25: '#DEEBFF',\n\n  danger: '#DE350B',\n  dangerLight: '#FFBDAD',\n\n  neutral0: 'hsl(0, 0%, 100%)',\n  neutral5: 'hsl(0, 0%, 95%)',\n  neutral10: 'hsl(0, 0%, 90%)',\n  neutral20: 'hsl(0, 0%, 80%)',\n  neutral30: 'hsl(0, 0%, 70%)',\n  neutral40: 'hsl(0, 0%, 60%)',\n  neutral50: 'hsl(0, 0%, 50%)',\n  neutral60: 'hsl(0, 0%, 40%)',\n  neutral70: 'hsl(0, 0%, 30%)',\n  neutral80: 'hsl(0, 0%, 20%)',\n  neutral90: 'hsl(0, 0%, 10%)',\n};\n\nconst borderRadius = 4;\n// Used to calculate consistent margin/padding on elements\nconst baseUnit = 4;\n// The minimum height of the control\nconst controlHeight = 38;\n// The amount of space between the control and menu */\nconst menuGutter = baseUnit * 2;\n\nexport const spacing = {\n  baseUnit,\n  controlHeight,\n  menuGutter,\n};\n\nexport const defaultTheme: Theme = {\n  borderRadius,\n  colors,\n  spacing,\n};\n\nexport type ThemeConfig = Theme | ((theme: Theme) => Theme);\n"
  },
  {
    "path": "packages/react-select/src/types.ts",
    "content": "import { CSSObject } from '@emotion/react';\nimport { Props } from './Select';\nimport { StylesProps } from './styles';\n\nexport interface GroupBase<Option> {\n  readonly options: readonly Option[];\n  readonly label?: string;\n}\n\nexport type OptionsOrGroups<Option, Group extends GroupBase<Option>> =\n  readonly (Option | Group)[];\n\nexport type Options<Option> = readonly Option[];\n\nexport type SingleValue<Option> = Option | null;\nexport type MultiValue<Option> = readonly Option[];\n\nexport type PropsValue<Option> = MultiValue<Option> | SingleValue<Option>;\n\nexport type OnChangeValue<Option, IsMulti extends boolean> =\n  IsMulti extends true ? MultiValue<Option> : SingleValue<Option>;\n\nexport interface Colors {\n  primary: string;\n  primary75: string;\n  primary50: string;\n  primary25: string;\n\n  danger: string;\n  dangerLight: string;\n\n  neutral0: string;\n  neutral5: string;\n  neutral10: string;\n  neutral20: string;\n  neutral30: string;\n  neutral40: string;\n  neutral50: string;\n  neutral60: string;\n  neutral70: string;\n  neutral80: string;\n  neutral90: string;\n}\n\nexport interface ThemeSpacing {\n  baseUnit: number;\n  controlHeight: number;\n  menuGutter: number;\n}\n\nexport interface Theme {\n  borderRadius: number;\n  colors: Colors;\n  spacing: ThemeSpacing;\n}\n\nexport type ClassNamesState = { [key: string]: boolean };\n\nexport type CX = (\n  state: ClassNamesState,\n  ...classNames: (string | undefined)[]\n) => string;\nexport type GetStyles<\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n> = <Key extends keyof StylesProps<Option, IsMulti, Group>>(\n  propertyName: Key,\n  props: StylesProps<Option, IsMulti, Group>[Key]\n) => CSSObjectWithLabel;\n\nexport interface CommonProps<\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n> {\n  clearValue: () => void;\n  cx: CX;\n  /**\n    Get the styles of a particular part of the select. Pass in the name of the\n    property as the first argument, and the current props as the second argument.\n    See the `styles` object for the properties available.\n  */\n  getStyles: GetStyles<Option, IsMulti, Group>;\n  getClassNames: <Key extends keyof StylesProps<Option, IsMulti, Group>>(\n    propertyName: Key,\n    props: StylesProps<Option, IsMulti, Group>[Key]\n  ) => string | undefined;\n  getValue: () => Options<Option>;\n  hasValue: boolean;\n  isMulti: boolean;\n  isRtl: boolean;\n  options: OptionsOrGroups<Option, Group>;\n  selectOption: (newValue: Option) => void;\n  selectProps: Props<Option, IsMulti, Group>;\n  setValue: (\n    newValue: OnChangeValue<Option, IsMulti>,\n    action: SetValueAction,\n    option?: Option\n  ) => void;\n  theme: Theme;\n}\n\nexport interface CommonPropsAndClassName<\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n> extends CommonProps<Option, IsMulti, Group> {\n  className?: string | undefined;\n}\n\nexport interface ActionMetaBase<Option> {\n  option?: Option | undefined;\n  removedValue?: Option;\n  removedValues?: Options<Option>;\n  name?: string;\n}\n\nexport interface SelectOptionActionMeta<Option> extends ActionMetaBase<Option> {\n  action: 'select-option';\n  option: Option | undefined;\n  name?: string;\n}\n\nexport interface DeselectOptionActionMeta<Option>\n  extends ActionMetaBase<Option> {\n  action: 'deselect-option';\n  option: Option | undefined;\n  name?: string;\n}\n\nexport interface RemoveValueActionMeta<Option> extends ActionMetaBase<Option> {\n  action: 'remove-value';\n  removedValue: Option;\n  name?: string;\n}\n\nexport interface PopValueActionMeta<Option> extends ActionMetaBase<Option> {\n  action: 'pop-value';\n  removedValue: Option;\n  name?: string;\n}\n\nexport interface ClearActionMeta<Option> extends ActionMetaBase<Option> {\n  action: 'clear';\n  removedValues: Options<Option>;\n  name?: string;\n}\n\nexport interface CreateOptionActionMeta<Option> extends ActionMetaBase<Option> {\n  action: 'create-option';\n  name?: string;\n  option: Option;\n}\n\nexport interface InitialInputFocusedActionMeta<Option, IsMulti extends boolean>\n  extends ActionMetaBase<Option> {\n  action: 'initial-input-focus';\n  value: OnChangeValue<Option, IsMulti>;\n  options?: Options<Option>;\n}\n\nexport type ActionMeta<Option> =\n  | SelectOptionActionMeta<Option>\n  | DeselectOptionActionMeta<Option>\n  | RemoveValueActionMeta<Option>\n  | PopValueActionMeta<Option>\n  | ClearActionMeta<Option>\n  | CreateOptionActionMeta<Option>;\n\nexport type SetValueAction = 'select-option' | 'deselect-option';\n\nexport type InputAction =\n  | 'set-value'\n  | 'input-change'\n  | 'input-blur'\n  | 'menu-close';\n\nexport interface InputActionMeta {\n  action: InputAction;\n  /** The previous value of the search input. */\n  prevInputValue: string;\n}\n\nexport type MenuPlacement = 'auto' | 'bottom' | 'top';\nexport type CoercedMenuPlacement = 'bottom' | 'top';\nexport type MenuPosition = 'absolute' | 'fixed';\n\nexport type FocusDirection =\n  | 'up'\n  | 'down'\n  | 'pageup'\n  | 'pagedown'\n  | 'first'\n  | 'last';\n\nexport type GetOptionLabel<Option> = (option: Option) => string;\nexport type GetOptionValue<Option> = (option: Option) => string;\n\nexport type CSSObjectWithLabel = CSSObject & { label?: string };\n"
  },
  {
    "path": "packages/react-select/src/useAsync.ts",
    "content": "import { useCallback, useEffect, useRef, useState } from 'react';\nimport { handleInputChange } from './utils';\nimport { StateManagerProps } from './useStateManager';\nimport { GroupBase, InputActionMeta, OptionsOrGroups } from './types';\n\ntype AsyncManagedPropKeys =\n  | 'options'\n  | 'isLoading'\n  | 'onInputChange'\n  | 'filterOption';\n\nexport interface AsyncAdditionalProps<Option, Group extends GroupBase<Option>> {\n  /**\n   * The default set of options to show before the user starts searching. When\n   * set to `true`, the results for loadOptions('') will be autoloaded.\n   */\n  defaultOptions?: OptionsOrGroups<Option, Group> | boolean;\n  /**\n   * If cacheOptions is truthy, then the loaded data will be cached. The cache\n   * will remain until `cacheOptions` changes value.\n   */\n  cacheOptions?: any;\n  /**\n   * Function that returns a promise, which is the set of options to be used\n   * once the promise resolves.\n   */\n  loadOptions?: (\n    inputValue: string,\n    callback: (options: OptionsOrGroups<Option, Group>) => void\n  ) => Promise<OptionsOrGroups<Option, Group>> | void;\n  /**\n   * Will cause the select to be displayed in the loading state, even if the\n   * Async select is not currently waiting for loadOptions to resolve\n   */\n  isLoading?: boolean;\n}\n\nexport type AsyncProps<\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n> = StateManagerProps<Option, IsMulti, Group> &\n  AsyncAdditionalProps<Option, Group>;\n\nexport default function useAsync<\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>,\n  AdditionalProps\n>({\n  defaultOptions: propsDefaultOptions = false,\n  cacheOptions = false,\n  loadOptions: propsLoadOptions,\n  options: propsOptions,\n  isLoading: propsIsLoading = false,\n  onInputChange: propsOnInputChange,\n  filterOption = null,\n  ...restSelectProps\n}: AsyncProps<Option, IsMulti, Group> & AdditionalProps): StateManagerProps<\n  Option,\n  IsMulti,\n  Group\n> &\n  Omit<\n    AdditionalProps,\n    keyof AsyncAdditionalProps<Option, Group> | AsyncManagedPropKeys\n  > {\n  const { inputValue: propsInputValue } = restSelectProps;\n\n  const lastRequest = useRef<unknown>(undefined);\n  const mounted = useRef(false);\n\n  const [defaultOptions, setDefaultOptions] = useState<\n    OptionsOrGroups<Option, Group> | boolean | undefined\n  >(Array.isArray(propsDefaultOptions) ? propsDefaultOptions : undefined);\n  const [stateInputValue, setStateInputValue] = useState<string>(\n    typeof propsInputValue !== 'undefined' ? (propsInputValue as string) : ''\n  );\n  const [isLoading, setIsLoading] = useState(propsDefaultOptions === true);\n  const [loadedInputValue, setLoadedInputValue] =\n    useState<string | undefined>(undefined);\n  const [loadedOptions, setLoadedOptions] = useState<\n    OptionsOrGroups<Option, Group>\n  >([]);\n  const [passEmptyOptions, setPassEmptyOptions] = useState(false);\n  const [optionsCache, setOptionsCache] = useState<\n    Record<string, OptionsOrGroups<Option, Group>>\n  >({});\n  const [prevDefaultOptions, setPrevDefaultOptions] =\n    useState<OptionsOrGroups<Option, Group> | boolean | undefined>(undefined);\n  const [prevCacheOptions, setPrevCacheOptions] = useState(undefined);\n\n  if (cacheOptions !== prevCacheOptions) {\n    setOptionsCache({});\n    setPrevCacheOptions(cacheOptions);\n  }\n\n  if (propsDefaultOptions !== prevDefaultOptions) {\n    setDefaultOptions(\n      Array.isArray(propsDefaultOptions) ? propsDefaultOptions : undefined\n    );\n    setPrevDefaultOptions(propsDefaultOptions);\n  }\n\n  useEffect(() => {\n    mounted.current = true;\n    return () => {\n      mounted.current = false;\n    };\n  }, []);\n\n  const loadOptions = useCallback(\n    (\n      inputValue: string,\n      callback: (options?: OptionsOrGroups<Option, Group>) => void\n    ) => {\n      if (!propsLoadOptions) return callback();\n      const loader = propsLoadOptions(inputValue, callback);\n      if (loader && typeof loader.then === 'function') {\n        loader.then(callback, () => callback());\n      }\n    },\n    [propsLoadOptions]\n  );\n\n  useEffect(() => {\n    if (propsDefaultOptions === true) {\n      loadOptions(stateInputValue, (options) => {\n        if (!mounted.current) return;\n        setDefaultOptions(options || []);\n        setIsLoading(!!lastRequest.current);\n      });\n    }\n    // NOTE: this effect is designed to only run when the component mounts,\n    // so we don't want to include any hook dependencies\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, []);\n\n  const onInputChange = useCallback(\n    (newValue: string, actionMeta: InputActionMeta) => {\n      const inputValue = handleInputChange(\n        newValue,\n        actionMeta,\n        propsOnInputChange\n      );\n      if (!inputValue) {\n        lastRequest.current = undefined;\n        setStateInputValue('');\n        setLoadedInputValue('');\n        setLoadedOptions([]);\n        setIsLoading(false);\n        setPassEmptyOptions(false);\n        return;\n      }\n      if (cacheOptions && optionsCache[inputValue]) {\n        setStateInputValue(inputValue);\n        setLoadedInputValue(inputValue);\n        setLoadedOptions(optionsCache[inputValue]);\n        setIsLoading(false);\n        setPassEmptyOptions(false);\n      } else {\n        const request = (lastRequest.current = {});\n        setStateInputValue(inputValue);\n        setIsLoading(true);\n        setPassEmptyOptions(!loadedInputValue);\n        loadOptions(inputValue, (options) => {\n          if (!mounted) return;\n          if (request !== lastRequest.current) return;\n          lastRequest.current = undefined;\n          setIsLoading(false);\n          setLoadedInputValue(inputValue);\n          setLoadedOptions(options || []);\n          setPassEmptyOptions(false);\n          setOptionsCache(\n            options ? { ...optionsCache, [inputValue]: options } : optionsCache\n          );\n        });\n      }\n    },\n    [\n      cacheOptions,\n      loadOptions,\n      loadedInputValue,\n      optionsCache,\n      propsOnInputChange,\n    ]\n  );\n\n  const options = passEmptyOptions\n    ? []\n    : stateInputValue && loadedInputValue\n    ? loadedOptions\n    : ((defaultOptions || []) as OptionsOrGroups<Option, Group>);\n\n  return {\n    ...restSelectProps,\n    options,\n    isLoading: isLoading || propsIsLoading,\n    onInputChange,\n    filterOption,\n  };\n}\n"
  },
  {
    "path": "packages/react-select/src/useCreatable.ts",
    "content": "import { ReactNode, useCallback, useMemo } from 'react';\nimport { PublicBaseSelectProps } from './Select';\nimport {\n  ActionMeta,\n  GetOptionLabel,\n  GetOptionValue,\n  GroupBase,\n  OnChangeValue,\n  Options,\n  OptionsOrGroups,\n} from './types';\nimport { cleanValue, valueTernary } from './utils';\nimport {\n  getOptionValue as baseGetOptionValue,\n  getOptionLabel as baseGetOptionLabel,\n} from './builtins';\n\nexport interface Accessors<Option> {\n  getOptionValue: GetOptionValue<Option>;\n  getOptionLabel: GetOptionLabel<Option>;\n}\n\nexport interface CreatableAdditionalProps<\n  Option,\n  Group extends GroupBase<Option>\n> {\n  /**\n   * Allow options to be created while the `isLoading` prop is true. Useful to\n   * prevent the \"create new ...\" option being displayed while async results are\n   * still being loaded.\n   */\n  allowCreateWhileLoading?: boolean;\n  /** Sets the position of the createOption element in your options list. Defaults to 'last' */\n  createOptionPosition?: 'first' | 'last';\n  /**\n   * Gets the label for the \"create new ...\" option in the menu. Is given the\n   * current input value.\n   */\n  formatCreateLabel?: (inputValue: string) => ReactNode;\n  /**\n   * Determines whether the \"create new ...\" option should be displayed based on\n   * the current input value, select value and options array.\n   */\n  isValidNewOption?: (\n    inputValue: string,\n    value: Options<Option>,\n    options: OptionsOrGroups<Option, Group>,\n    accessors: Accessors<Option>\n  ) => boolean;\n  /**\n   * Returns the data for the new option when it is created. Used to display the\n   * value, and is passed to `onChange`.\n   */\n  getNewOptionData?: (inputValue: string, optionLabel: ReactNode) => Option;\n  /**\n   * If provided, this will be called with the input value when a new option is\n   * created, and `onChange` will **not** be called. Use this when you need more\n   * control over what happens when new options are created.\n   */\n  onCreateOption?: (inputValue: string) => void;\n}\n\ntype BaseCreatableProps<\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n> = PublicBaseSelectProps<Option, IsMulti, Group> &\n  CreatableAdditionalProps<Option, Group>;\n\nconst compareOption = <Option>(\n  inputValue = '',\n  option: Option,\n  accessors: Accessors<Option>\n) => {\n  const candidate = String(inputValue).toLowerCase();\n  const optionValue = String(accessors.getOptionValue(option)).toLowerCase();\n  const optionLabel = String(accessors.getOptionLabel(option)).toLowerCase();\n  return optionValue === candidate || optionLabel === candidate;\n};\n\nconst builtins = {\n  formatCreateLabel: (inputValue: string) => `Create \"${inputValue}\"`,\n  isValidNewOption: <Option, Group extends GroupBase<Option>>(\n    inputValue: string,\n    selectValue: Options<Option>,\n    selectOptions: OptionsOrGroups<Option, Group>,\n    accessors: Accessors<Option>\n  ) =>\n    !(\n      !inputValue ||\n      selectValue.some((option) =>\n        compareOption(inputValue, option, accessors)\n      ) ||\n      selectOptions.some((option) =>\n        compareOption(inputValue, option as Option, accessors)\n      )\n    ),\n  getNewOptionData: (inputValue: string, optionLabel: ReactNode) => ({\n    label: optionLabel,\n    value: inputValue,\n    __isNew__: true,\n  }),\n};\n\nexport default function useCreatable<\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n>({\n  allowCreateWhileLoading = false,\n  createOptionPosition = 'last',\n  formatCreateLabel = builtins.formatCreateLabel,\n  isValidNewOption = builtins.isValidNewOption,\n  // @ts-ignore\n  getNewOptionData = builtins.getNewOptionData,\n  onCreateOption,\n  options: propsOptions = [],\n  onChange: propsOnChange,\n  ...restSelectProps\n}: BaseCreatableProps<Option, IsMulti, Group>): PublicBaseSelectProps<\n  Option,\n  IsMulti,\n  Group\n> {\n  const {\n    getOptionValue = baseGetOptionValue,\n    getOptionLabel = baseGetOptionLabel,\n    inputValue,\n    isLoading,\n    isMulti,\n    value,\n    name,\n  } = restSelectProps;\n\n  const newOption = useMemo(\n    () =>\n      isValidNewOption(inputValue, cleanValue(value), propsOptions, {\n        getOptionValue,\n        getOptionLabel,\n      })\n        ? getNewOptionData(inputValue, formatCreateLabel(inputValue))\n        : undefined,\n    [\n      formatCreateLabel,\n      getNewOptionData,\n      getOptionLabel,\n      getOptionValue,\n      inputValue,\n      isValidNewOption,\n      propsOptions,\n      value,\n    ]\n  );\n\n  const options = useMemo(\n    () =>\n      (allowCreateWhileLoading || !isLoading) && newOption\n        ? createOptionPosition === 'first'\n          ? [newOption, ...propsOptions]\n          : [...propsOptions, newOption]\n        : propsOptions,\n    [\n      allowCreateWhileLoading,\n      createOptionPosition,\n      isLoading,\n      newOption,\n      propsOptions,\n    ]\n  );\n\n  const onChange = useCallback(\n    (\n      newValue: OnChangeValue<Option, IsMulti>,\n      actionMeta: ActionMeta<Option>\n    ) => {\n      if (actionMeta.action !== 'select-option') {\n        return propsOnChange(newValue, actionMeta);\n      }\n      const valueArray = Array.isArray(newValue) ? newValue : [newValue];\n\n      if (valueArray[valueArray.length - 1] === newOption) {\n        if (onCreateOption) onCreateOption(inputValue);\n        else {\n          const newOptionData = getNewOptionData(inputValue, inputValue);\n          const newActionMeta: ActionMeta<Option> = {\n            action: 'create-option',\n            name,\n            option: newOptionData,\n          };\n          propsOnChange(\n            valueTernary(\n              isMulti,\n              [...cleanValue(value), newOptionData],\n              newOptionData\n            ),\n            newActionMeta\n          );\n        }\n        return;\n      }\n      propsOnChange(newValue, actionMeta);\n    },\n    [\n      getNewOptionData,\n      inputValue,\n      isMulti,\n      name,\n      newOption,\n      onCreateOption,\n      propsOnChange,\n      value,\n    ]\n  );\n\n  return {\n    ...restSelectProps,\n    options,\n    onChange,\n  };\n}\n"
  },
  {
    "path": "packages/react-select/src/useStateManager.ts",
    "content": "import {\n  ActionMeta,\n  GroupBase,\n  InputActionMeta,\n  OnChangeValue,\n  PropsValue,\n} from './types';\nimport { PublicBaseSelectProps } from './Select';\nimport { useCallback, useState } from 'react';\n\ntype StateManagedPropKeys =\n  | 'inputValue'\n  | 'menuIsOpen'\n  | 'onChange'\n  | 'onInputChange'\n  | 'onMenuClose'\n  | 'onMenuOpen'\n  | 'value';\n\ntype SelectPropsWithOptionalStateManagedProps<\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>\n> = Omit<PublicBaseSelectProps<Option, IsMulti, Group>, StateManagedPropKeys> &\n  Partial<PublicBaseSelectProps<Option, IsMulti, Group>>;\n\nexport interface StateManagerAdditionalProps<Option> {\n  defaultInputValue?: string;\n  defaultMenuIsOpen?: boolean;\n  defaultValue?: PropsValue<Option>;\n}\n\nexport type StateManagerProps<\n  Option = unknown,\n  IsMulti extends boolean = boolean,\n  Group extends GroupBase<Option> = GroupBase<Option>\n> = SelectPropsWithOptionalStateManagedProps<Option, IsMulti, Group> &\n  StateManagerAdditionalProps<Option>;\n\nexport default function useStateManager<\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>,\n  AdditionalProps\n>({\n  defaultInputValue = '',\n  defaultMenuIsOpen = false,\n  defaultValue = null,\n  inputValue: propsInputValue,\n  menuIsOpen: propsMenuIsOpen,\n  onChange: propsOnChange,\n  onInputChange: propsOnInputChange,\n  onMenuClose: propsOnMenuClose,\n  onMenuOpen: propsOnMenuOpen,\n  value: propsValue,\n  ...restSelectProps\n}: StateManagerProps<Option, IsMulti, Group> &\n  AdditionalProps): PublicBaseSelectProps<Option, IsMulti, Group> &\n  Omit<\n    AdditionalProps,\n    keyof StateManagerAdditionalProps<Option> | StateManagedPropKeys\n  > {\n  const [stateInputValue, setStateInputValue] = useState(\n    propsInputValue !== undefined ? propsInputValue : defaultInputValue\n  );\n  const [stateMenuIsOpen, setStateMenuIsOpen] = useState(\n    propsMenuIsOpen !== undefined ? propsMenuIsOpen : defaultMenuIsOpen\n  );\n  const [stateValue, setStateValue] = useState(\n    propsValue !== undefined ? propsValue : defaultValue\n  );\n\n  const onChange = useCallback(\n    (value: OnChangeValue<Option, IsMulti>, actionMeta: ActionMeta<Option>) => {\n      if (typeof propsOnChange === 'function') {\n        propsOnChange(value, actionMeta);\n      }\n      setStateValue(value);\n    },\n    [propsOnChange]\n  );\n  const onInputChange = useCallback(\n    (value: string, actionMeta: InputActionMeta) => {\n      let newValue;\n      if (typeof propsOnInputChange === 'function') {\n        newValue = propsOnInputChange(value, actionMeta);\n      }\n      setStateInputValue(newValue !== undefined ? newValue : value);\n    },\n    [propsOnInputChange]\n  );\n  const onMenuOpen = useCallback(() => {\n    if (typeof propsOnMenuOpen === 'function') {\n      propsOnMenuOpen();\n    }\n    setStateMenuIsOpen(true);\n  }, [propsOnMenuOpen]);\n  const onMenuClose = useCallback(() => {\n    if (typeof propsOnMenuClose === 'function') {\n      propsOnMenuClose();\n    }\n    setStateMenuIsOpen(false);\n  }, [propsOnMenuClose]);\n\n  const inputValue =\n    propsInputValue !== undefined ? propsInputValue : stateInputValue;\n  const menuIsOpen =\n    propsMenuIsOpen !== undefined ? propsMenuIsOpen : stateMenuIsOpen;\n  const value = propsValue !== undefined ? propsValue : stateValue;\n\n  return {\n    ...restSelectProps,\n    inputValue,\n    menuIsOpen,\n    onChange,\n    onInputChange,\n    onMenuClose,\n    onMenuOpen,\n    value,\n  };\n}\n"
  },
  {
    "path": "packages/react-select/src/utils.ts",
    "content": "import type { StylesProps } from './styles';\nimport type {\n  ClassNamesState,\n  CommonPropsAndClassName,\n  GroupBase,\n  InputActionMeta,\n  MultiValue,\n  OnChangeValue,\n  Options,\n  PropsValue,\n  SingleValue,\n} from './types';\n\n// ==============================\n// NO OP\n// ==============================\n\nexport const noop = () => {};\nexport const emptyString = () => '';\n\n// ==============================\n// Class Name Prefixer\n// ==============================\n\n/**\n String representation of component state for styling with class names.\n\n Expects an array of strings OR a string/object pair:\n - className(['comp', 'comp-arg', 'comp-arg-2'])\n   @returns 'react-select__comp react-select__comp-arg react-select__comp-arg-2'\n - className('comp', { some: true, state: false })\n   @returns 'react-select__comp react-select__comp--some'\n*/\nfunction applyPrefixToName(prefix: string, name: string) {\n  if (!name) {\n    return prefix;\n  } else if (name[0] === '-') {\n    return prefix + name;\n  } else {\n    return prefix + '__' + name;\n  }\n}\n\nexport function classNames(\n  prefix?: string | null,\n  state?: ClassNamesState,\n  ...classNameList: string[]\n) {\n  const arr = [...classNameList];\n  if (state && prefix) {\n    for (let key in state) {\n      if (state.hasOwnProperty(key) && state[key]) {\n        arr.push(`${applyPrefixToName(prefix, key)}`);\n      }\n    }\n  }\n\n  return arr\n    .filter((i) => i)\n    .map((i) => String(i).trim())\n    .join(' ');\n}\n// ==============================\n// Clean Value\n// ==============================\n\nexport const cleanValue = <Option>(\n  value: PropsValue<Option>\n): Options<Option> => {\n  if (isArray(value)) return value.filter(Boolean);\n  if (typeof value === 'object' && value !== null) return [value];\n  return [];\n};\n\n// ==============================\n// Clean Common Props\n// ==============================\n\nexport const cleanCommonProps = <\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>,\n  AdditionalProps\n>(\n  props: Partial<CommonPropsAndClassName<Option, IsMulti, Group>> &\n    AdditionalProps\n): Omit<\n  AdditionalProps,\n  keyof CommonPropsAndClassName<Option, IsMulti, Group>\n> => {\n  //className\n  const {\n    className, // not listed in commonProps documentation, needs to be removed to allow Emotion to generate classNames\n    clearValue,\n    cx,\n    getStyles,\n    getClassNames,\n    getValue,\n    hasValue,\n    isMulti,\n    isRtl,\n    options, // not listed in commonProps documentation\n    selectOption,\n    selectProps,\n    setValue,\n    theme, // not listed in commonProps documentation\n    ...innerProps\n  } = props;\n  return { ...innerProps };\n};\n\n// ==============================\n// Get Style Props\n// ==============================\n\nexport const getStyleProps = <\n  Option,\n  IsMulti extends boolean,\n  Group extends GroupBase<Option>,\n  Key extends keyof StylesProps<Option, IsMulti, Group>\n>(\n  props: Pick<\n    CommonPropsAndClassName<Option, IsMulti, Group>,\n    'cx' | 'getStyles' | 'getClassNames' | 'className'\n  > &\n    StylesProps<Option, IsMulti, Group>[Key],\n  name: Key,\n  classNamesState?: ClassNamesState\n) => {\n  const { cx, getStyles, getClassNames, className } = props;\n  return {\n    css: getStyles(name, props),\n    className: cx(classNamesState ?? {}, getClassNames(name, props), className),\n  };\n};\n\n// ==============================\n// Handle Input Change\n// ==============================\n\nexport function handleInputChange(\n  inputValue: string,\n  actionMeta: InputActionMeta,\n  onInputChange?: (\n    newValue: string,\n    actionMeta: InputActionMeta\n  ) => string | void\n) {\n  if (onInputChange) {\n    const newValue = onInputChange(inputValue, actionMeta);\n    if (typeof newValue === 'string') return newValue;\n  }\n  return inputValue;\n}\n\n// ==============================\n// Scroll Helpers\n// ==============================\n\nexport function isDocumentElement(\n  el: HTMLElement | typeof window\n): el is typeof window {\n  return [document.documentElement, document.body, window].indexOf(el) > -1;\n}\n\n// Normalized Scroll Top\n// ------------------------------\n\nexport function normalizedHeight(el: HTMLElement | typeof window): number {\n  if (isDocumentElement(el)) {\n    return window.innerHeight;\n  }\n\n  return el.clientHeight;\n}\n\n// Normalized scrollTo & scrollTop\n// ------------------------------\n\nexport function getScrollTop(el: HTMLElement | typeof window): number {\n  if (isDocumentElement(el)) {\n    return window.pageYOffset;\n  }\n  return el.scrollTop;\n}\n\nexport function scrollTo(el: HTMLElement | typeof window, top: number): void {\n  // with a scroll distance, we perform scroll on the element\n  if (isDocumentElement(el)) {\n    window.scrollTo(0, top);\n    return;\n  }\n\n  el.scrollTop = top;\n}\n\n// Get Scroll Parent\n// ------------------------------\n\nexport function getScrollParent(element: HTMLElement) {\n  let style = getComputedStyle(element);\n  const excludeStaticParent = style.position === 'absolute';\n  const overflowRx = /(auto|scroll)/;\n\n  if (style.position === 'fixed') return document.documentElement;\n\n  for (\n    let parent: HTMLElement | null = element;\n    (parent = parent.parentElement);\n\n  ) {\n    style = getComputedStyle(parent);\n    if (excludeStaticParent && style.position === 'static') {\n      continue;\n    }\n    if (overflowRx.test(style.overflow + style.overflowY + style.overflowX)) {\n      return parent;\n    }\n  }\n\n  return document.documentElement;\n}\n\n// Animated Scroll To\n// ------------------------------\n\n/**\n  @param t: time (elapsed)\n  @param b: initial value\n  @param c: amount of change\n  @param d: duration\n*/\nfunction easeOutCubic(t: number, b: number, c: number, d: number): number {\n  return c * ((t = t / d - 1) * t * t + 1) + b;\n}\n\nexport function animatedScrollTo(\n  element: HTMLElement | typeof window,\n  to: number,\n  duration = 200,\n  callback: (element: HTMLElement | typeof window) => void = noop\n) {\n  const start = getScrollTop(element);\n  const change = to - start;\n  const increment = 10;\n  let currentTime = 0;\n\n  function animateScroll() {\n    currentTime += increment;\n    const val = easeOutCubic(currentTime, start, change, duration);\n    scrollTo(element, val);\n    if (currentTime < duration) {\n      window.requestAnimationFrame(animateScroll);\n    } else {\n      callback(element);\n    }\n  }\n  animateScroll();\n}\n\n// Scroll Into View\n// ------------------------------\n\nexport function scrollIntoView(\n  menuEl: HTMLElement,\n  focusedEl: HTMLElement\n): void {\n  const menuRect = menuEl.getBoundingClientRect();\n  const focusedRect = focusedEl.getBoundingClientRect();\n  const overScroll = focusedEl.offsetHeight / 3;\n\n  if (focusedRect.bottom + overScroll > menuRect.bottom) {\n    scrollTo(\n      menuEl,\n      Math.min(\n        focusedEl.offsetTop +\n          focusedEl.clientHeight -\n          menuEl.offsetHeight +\n          overScroll,\n        menuEl.scrollHeight\n      )\n    );\n  } else if (focusedRect.top - overScroll < menuRect.top) {\n    scrollTo(menuEl, Math.max(focusedEl.offsetTop - overScroll, 0));\n  }\n}\n\n// ==============================\n// Get bounding client object\n// ==============================\n\n// cannot get keys using array notation with DOMRect\nexport function getBoundingClientObj(element: HTMLElement) {\n  const rect = element.getBoundingClientRect();\n  return {\n    bottom: rect.bottom,\n    height: rect.height,\n    left: rect.left,\n    right: rect.right,\n    top: rect.top,\n    width: rect.width,\n  };\n}\nexport interface RectType {\n  left: number;\n  right: number;\n  bottom: number;\n  height: number;\n  width: number;\n}\n\n// ==============================\n// String to Key (kebabify)\n// ==============================\n\nexport function toKey(str: string) {\n  return str.replace(/\\W/g, '-');\n}\n\n// ==============================\n// Touch Capability Detector\n// ==============================\n\nexport function isTouchCapable() {\n  try {\n    document.createEvent('TouchEvent');\n    return true;\n  } catch (e) {\n    return false;\n  }\n}\n\n// ==============================\n// Mobile Device Detector\n// ==============================\n\nexport function isMobileDevice() {\n  try {\n    return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n      navigator.userAgent\n    );\n  } catch (e) {\n    return false;\n  }\n}\n\n// ==============================\n// Passive Event Detector\n// ==============================\n\n// https://github.com/rafgraph/detect-it/blob/main/src/index.ts#L19-L36\nlet passiveOptionAccessed = false;\nconst options = {\n  get passive() {\n    return (passiveOptionAccessed = true);\n  },\n};\n// check for SSR\nconst w:\n  | typeof window\n  | { addEventListener?: never; removeEventListener?: never } =\n  typeof window !== 'undefined' ? window : {};\nif (w.addEventListener && w.removeEventListener) {\n  w.addEventListener('p', noop, options);\n  w.removeEventListener('p', noop, false);\n}\n\nexport const supportsPassiveEvents: boolean = passiveOptionAccessed;\n\nexport function notNullish<T>(item: T | null | undefined): item is T {\n  return item != null;\n}\n\nexport function isArray<T>(arg: unknown): arg is readonly T[] {\n  return Array.isArray(arg);\n}\n\nexport function valueTernary<Option, IsMulti extends boolean>(\n  isMulti: IsMulti | undefined,\n  multiValue: MultiValue<Option>,\n  singleValue: SingleValue<Option>\n): OnChangeValue<Option, IsMulti> {\n  return (isMulti ? multiValue : singleValue) as OnChangeValue<Option, IsMulti>;\n}\n\nexport function singleValueAsValue<Option, IsMulti extends boolean>(\n  singleValue: SingleValue<Option>\n): OnChangeValue<Option, IsMulti> {\n  return singleValue as OnChangeValue<Option, IsMulti>;\n}\n\nexport function multiValueAsValue<Option, IsMulti extends boolean>(\n  multiValue: MultiValue<Option>\n): OnChangeValue<Option, IsMulti> {\n  return multiValue as OnChangeValue<Option, IsMulti>;\n}\n\nexport const removeProps = <Props extends object, K extends string[]>(\n  propsObj: Props,\n  ...properties: K\n): Omit<Props, K[number]> => {\n  let propsMap = Object.entries(propsObj).filter(\n    ([key]) => !properties.includes(key)\n  );\n\n  return propsMap.reduce((newProps: { [key: string]: any }, [key, val]) => {\n    newProps[key] = val;\n    return newProps;\n  }, {}) as Omit<Props, K[number]>;\n};\n"
  },
  {
    "path": "packages/react-select/tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"target\": \"es6\",\n    \"module\": \"commonjs\",\n    \"jsx\": \"react\",\n    \"noEmit\": true,\n    \"strict\": true,\n    \"forceConsistentCasingInFileNames\": true,\n    \"resolveJsonModule\": true\n  },\n  \"exclude\": [\"src/__tests__\"]\n}\n"
  },
  {
    "path": "storybook/.gitignore",
    "content": "# Storybook\nstorybook-static\n"
  },
  {
    "path": "storybook/.storybook/.babelrc",
    "content": "{\n  \"presets\": [\n    \"@babel/preset-env\",\n    \"@babel/preset-typescript\",\n    \"@emotion/babel-preset-css-prop\"\n  ],\n  \"plugins\": [\"@emotion\"]\n}\n"
  },
  {
    "path": "storybook/.storybook/main.ts",
    "content": "import type { StorybookConfig } from '@storybook/core-common';\nimport postcss from 'postcss';\n\nconst config: StorybookConfig = {\n  addons: [\n    '@storybook/addon-a11y',\n    '@storybook/addon-essentials',\n    {\n      name: '@storybook/addon-postcss',\n      options: {\n        postcssLoaderOptions: {\n          implementation: postcss,\n        },\n      },\n    },\n  ],\n  core: {\n    builder: 'webpack4',\n  },\n  features: {\n    /**\n     * Enable code splitting\n     * @see https://storybook.js.org/docs/react/builders/webpack#code-splitting\n     */\n    storyStoreV7: true,\n  },\n  framework: '@storybook/react',\n  stories: ['../stories/**/*.stories.@(js|jsx|ts|tsx)'],\n};\n\nexport default config;\n"
  },
  {
    "path": "storybook/.storybook/preview.tsx",
    "content": "/** @jsx jsx */\nimport { jsx, Global, css } from '@emotion/react';\nimport type { DecoratorFn } from '@storybook/react';\nimport { Fragment } from 'react';\n\nexport const parameters = {\n  options: {\n    storySort: {\n      order: [\n        'Select',\n        ['BasicSingle', 'BasicMulti', 'AnimatedMulti', 'Grouped', 'Creatable'],\n      ],\n    },\n  },\n  docs: {\n    source: {\n      type: 'code',\n    },\n  },\n};\n\nconst globalStyles = css`\n  *,\n  *::before,\n  *::after {\n    box-sizing: border-box;\n    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,\n      'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif,\n      'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',\n      'Noto Color Emoji';\n  }\n`;\n\nconst withCssReset: DecoratorFn = (Story) => {\n  return (\n    <Fragment>\n      <Global styles={globalStyles} />\n      <Story />\n    </Fragment>\n  );\n};\n\nexport const decorators = [withCssReset];\n"
  },
  {
    "path": "storybook/components/field.tsx",
    "content": "import * as React from 'react';\n\ntype FieldProps = {\n  label?: string;\n  secondaryLabel?: string;\n  children: React.ReactNode;\n  htmlFor: string;\n};\n\nexport function Field({\n  children,\n  htmlFor,\n  label = 'Select',\n  secondaryLabel,\n}: FieldProps) {\n  return (\n    <div\n      style={{\n        display: 'flex',\n        flexDirection: 'column',\n        gap: '0.5rem',\n      }}\n    >\n      <label\n        htmlFor={htmlFor}\n        style={{\n          fontWeight: 500,\n          display: 'flex',\n          flexDirection: 'column',\n          gap: '0.5rem',\n        }}\n      >\n        <span>{label}</span>\n        {secondaryLabel && (\n          <span style={{ fontWeight: 400, opacity: 0.7 }}>\n            {secondaryLabel}\n          </span>\n        )}\n      </label>\n      {children}\n    </div>\n  );\n}\n"
  },
  {
    "path": "storybook/components/index.ts",
    "content": "export * from './field';\nexport * from './inline';\nexport * from './stack';\nexport * from './svg';\n"
  },
  {
    "path": "storybook/components/inline.tsx",
    "content": "import * as React from 'react';\n\ntype InlineProps = React.HTMLAttributes<HTMLDivElement> & {\n  gap?: keyof typeof gapSize;\n};\n\nexport function Inline({\n  children,\n  gap = 'small',\n  style,\n  ...consumerProps\n}: InlineProps) {\n  return (\n    <div\n      style={{\n        display: 'inline-flex',\n        flexWrap: 'wrap',\n        gap: gapSize[gap],\n        ...style,\n      }}\n      {...consumerProps}\n    >\n      {children}\n    </div>\n  );\n}\n\nconst gapSize = {\n  small: '0.5rem',\n  medium: '1rem',\n  large: '2rem',\n};\n"
  },
  {
    "path": "storybook/components/stack.tsx",
    "content": "import * as React from 'react';\n\ntype StackProps = React.HTMLAttributes<HTMLDivElement> & {\n  gap?: keyof typeof gapSize;\n};\n\nexport function Stack({\n  children,\n  gap = 'small',\n  style,\n  ...consumerProps\n}: StackProps) {\n  return (\n    <div\n      style={{\n        display: 'flex',\n        flexDirection: 'column',\n        gap: gapSize[gap],\n        ...style,\n      }}\n      {...consumerProps}\n    >\n      {children}\n    </div>\n  );\n}\n\nconst gapSize = {\n  small: '0.5rem',\n  medium: '1rem',\n  large: '2rem',\n};\n"
  },
  {
    "path": "storybook/components/svg.tsx",
    "content": "import * as React from 'react';\n\nexport function Svg(props: JSX.IntrinsicElements['svg']) {\n  return (\n    <svg\n      width=\"24\"\n      height=\"24\"\n      viewBox=\"0 0 24 24\"\n      focusable=\"false\"\n      role=\"presentation\"\n      {...props}\n    />\n  );\n}\n\nexport function ChevronDown(props: JSX.IntrinsicElements['svg']) {\n  return (\n    <Svg style={{ marginRight: -6 }} {...props}>\n      <path\n        d=\"M8.292 10.293a1.009 1.009 0 0 0 0 1.419l2.939 2.965c.218.215.5.322.779.322s.556-.107.769-.322l2.93-2.955a1.01 1.01 0 0 0 0-1.419.987.987 0 0 0-1.406 0l-2.298 2.317-2.307-2.327a.99.99 0 0 0-1.406 0z\"\n        fill=\"currentColor\"\n        fillRule=\"evenodd\"\n      />\n    </Svg>\n  );\n}\n"
  },
  {
    "path": "storybook/data.ts",
    "content": "export type ColourOption = {\n  readonly value: string;\n  readonly label: string;\n  readonly color: string;\n  readonly isFixed?: boolean;\n  readonly isDisabled?: boolean;\n};\n\nexport const colourOptions: readonly ColourOption[] = [\n  { value: 'ocean', label: 'Ocean', color: '#00B8D9', isFixed: true },\n  { value: 'blue', label: 'Blue', color: '#0052CC', isDisabled: true },\n  { value: 'purple', label: 'Purple', color: '#5243AA' },\n  { value: 'red', label: 'Red', color: '#FF5630', isFixed: true },\n  { value: 'orange', label: 'Orange', color: '#FF8B00' },\n  { value: 'yellow', label: 'Yellow', color: '#FFC400' },\n  { value: 'green', label: 'Green', color: '#36B37E' },\n  { value: 'forest', label: 'Forest', color: '#00875A' },\n  { value: 'slate', label: 'Slate', color: '#253858' },\n  { value: 'silver', label: 'Silver', color: '#666666' },\n];\n\nexport type FlavourOption = {\n  readonly value: string;\n  readonly label: string;\n  readonly rating: string;\n};\n\nexport const flavourOptions: readonly FlavourOption[] = [\n  { value: 'vanilla', label: 'Vanilla', rating: 'safe' },\n  { value: 'chocolate', label: 'Chocolate', rating: 'good' },\n  { value: 'strawberry', label: 'Strawberry', rating: 'wild' },\n  { value: 'salted-caramel', label: 'Salted Caramel', rating: 'crazy' },\n];\n\nexport type StateOption = {\n  readonly value: string;\n  readonly label: string;\n};\n\nexport const stateOptions: readonly StateOption[] = [\n  { value: 'AL', label: 'Alabama' },\n  { value: 'AK', label: 'Alaska' },\n  { value: 'AS', label: 'American Samoa' },\n  { value: 'AZ', label: 'Arizona' },\n  { value: 'AR', label: 'Arkansas' },\n  { value: 'CA', label: 'California' },\n  { value: 'CO', label: 'Colorado' },\n  { value: 'CT', label: 'Connecticut' },\n  { value: 'DE', label: 'Delaware' },\n  { value: 'DC', label: 'District Of Columbia' },\n  { value: 'FM', label: 'Federated States Of Micronesia' },\n  { value: 'FL', label: 'Florida' },\n  { value: 'GA', label: 'Georgia' },\n  { value: 'GU', label: 'Guam' },\n  { value: 'HI', label: 'Hawaii' },\n  { value: 'ID', label: 'Idaho' },\n  { value: 'IL', label: 'Illinois' },\n  { value: 'IN', label: 'Indiana' },\n  { value: 'IA', label: 'Iowa' },\n  { value: 'KS', label: 'Kansas' },\n  { value: 'KY', label: 'Kentucky' },\n  { value: 'LA', label: 'Louisiana' },\n  { value: 'ME', label: 'Maine' },\n  { value: 'MH', label: 'Marshall Islands' },\n  { value: 'MD', label: 'Maryland' },\n  { value: 'MA', label: 'Massachusetts' },\n  { value: 'MI', label: 'Michigan' },\n  { value: 'MN', label: 'Minnesota' },\n  { value: 'MS', label: 'Mississippi' },\n  { value: 'MO', label: 'Missouri' },\n  { value: 'MT', label: 'Montana' },\n  { value: 'NE', label: 'Nebraska' },\n  { value: 'NV', label: 'Nevada' },\n  { value: 'NH', label: 'New Hampshire' },\n  { value: 'NJ', label: 'New Jersey' },\n  { value: 'NM', label: 'New Mexico' },\n  { value: 'NY', label: 'New York' },\n  { value: 'NC', label: 'North Carolina' },\n  { value: 'ND', label: 'North Dakota' },\n  { value: 'MP', label: 'Northern Mariana Islands' },\n  { value: 'OH', label: 'Ohio' },\n  { value: 'OK', label: 'Oklahoma' },\n  { value: 'OR', label: 'Oregon' },\n  { value: 'PW', label: 'Palau' },\n  { value: 'PA', label: 'Pennsylvania' },\n  { value: 'PR', label: 'Puerto Rico' },\n  { value: 'RI', label: 'Rhode Island' },\n  { value: 'SC', label: 'South Carolina' },\n  { value: 'SD', label: 'South Dakota' },\n  { value: 'TN', label: 'Tennessee' },\n  { value: 'TX', label: 'Texas' },\n  { value: 'UT', label: 'Utah' },\n  { value: 'VT', label: 'Vermont' },\n  { value: 'VI', label: 'Virgin Islands' },\n  { value: 'VA', label: 'Virginia' },\n  { value: 'WA', label: 'Washington' },\n  { value: 'WV', label: 'West Virginia' },\n  { value: 'WI', label: 'Wisconsin' },\n  { value: 'WY', label: 'Wyoming' },\n];\n\nexport const optionLength = [\n  { value: 1, label: 'general' },\n  {\n    value: 2,\n    label:\n      'Evil is the moment when I lack the strength to be true to the Good that compels me.',\n  },\n  {\n    value: 3,\n    label:\n      \"It is now an easy matter to spell out the ethic of a truth: 'Do all that you can to persevere in that which exceeds your perseverance. Persevere in the interruption. Seize in your being that which has seized and broken you.\",\n  },\n];\n\nexport const dogOptions = [\n  { id: 1, label: 'Chihuahua' },\n  { id: 2, label: 'Bulldog' },\n  { id: 3, label: 'Dachshund' },\n  { id: 4, label: 'Akita' },\n];\n\nexport type GroupedOption = {\n  readonly label: string;\n  readonly options: readonly ColourOption[] | readonly FlavourOption[];\n};\n\nexport const groupedOptions: readonly GroupedOption[] = [\n  {\n    label: 'Colours',\n    options: colourOptions,\n  },\n  {\n    label: 'Flavours',\n    options: flavourOptions,\n  },\n];\n\nexport type PersonOption = {\n  readonly id: number;\n  readonly name: string;\n  readonly online: boolean;\n};\n\nexport const people: readonly PersonOption[] = [\n  { id: 1, name: 'Carla Conroy', online: true },\n  { id: 2, name: 'Beverly Wehner', online: false },\n  { id: 3, name: 'Clifton Schimmel', online: true },\n  { id: 4, name: 'Charles Greenfelder', online: true },\n  { id: 5, name: 'Nadine Hoeger', online: false },\n  { id: 6, name: 'Freddie Klocko', online: false },\n  { id: 7, name: 'Della Crona', online: false },\n  { id: 8, name: 'Leigh Herzog', online: false },\n  { id: 9, name: 'Winston Schultz', online: true },\n  { id: 10, name: 'Andrew Ryan', online: true },\n];\n\nexport type NumberOption = {\n  readonly label: string;\n  readonly value: string;\n};\n\nexport const numbers: NumberOption[] = [\n  { label: 'One', value: 'one' },\n  { label: 'Two', value: 'two' },\n  { label: 'Three', value: 'three' },\n];\n\nexport const EMOJIS = ['👍', '🤙', '👏', '👌', '🙌', '✌️', '🖖', '👐'];\n\nexport const defaultArgs = {\n  defaultMenuIsOpen: false,\n  defaultValue: undefined,\n  inputId: 'react-select-id',\n  isClearable: true,\n  isDisabled: false,\n  isLoading: false,\n  isMulti: false,\n  isRtl: false,\n  isSearchable: true,\n  menuPlacement: 'bottom',\n  menuPortalTarget: undefined,\n  options: colourOptions,\n  placeholder: 'Select...',\n} as const;\n"
  },
  {
    "path": "storybook/package.json",
    "content": "{\n  \"name\": \"storybook\",\n  \"version\": \"0.0.0\",\n  \"private\": true,\n  \"license\": \"MIT\",\n  \"scripts\": {\n    \"build\": \"build-storybook\",\n    \"dev\": \"start-storybook -p 6006\"\n  },\n  \"dependencies\": {\n    \"@atlaskit/button\": \"^15.1.4\",\n    \"@atlaskit/icon\": \"^11.0.1\",\n    \"@atlaskit/modal-dialog\": \"^11.2.5\",\n    \"@atlaskit/tooltip\": \"^17.1.2\",\n    \"@babel/core\": \"^7.19.6\",\n    \"@babel/preset-env\": \"^7.19.4\",\n    \"@babel/preset-typescript\": \"^7.18.6\",\n    \"@emotion/babel-plugin\": \"^11.10.2\",\n    \"@emotion/babel-preset-css-prop\": \"^11.10.0\",\n    \"@emotion/react\": \"^11.8.1\",\n    \"babel-loader\": \"^8.2.5\",\n    \"chroma-js\": \"^2.4.2\",\n    \"chrono-node\": \"^2.1.11\",\n    \"classnames\": \"^2.3.2\",\n    \"moment\": \"^2.29.4\",\n    \"react\": \"^16.13.0\",\n    \"react-dom\": \"^16.13.0\",\n    \"react-select\": \"^5.5.9\",\n    \"remeda\": \"^1.1.0\",\n    \"webpack\": \"^4.30.0\"\n  },\n  \"devDependencies\": {\n    \"@storybook/addon-a11y\": \"^6.5.13\",\n    \"@storybook/addon-essentials\": \"^6.5.13\",\n    \"@storybook/addon-postcss\": \"^2.0.0\",\n    \"@storybook/builder-webpack4\": \"^6.5.13\",\n    \"@storybook/manager-webpack4\": \"^6.5.13\",\n    \"@storybook/react\": \"^6.5.13\",\n    \"autoprefixer\": \"^10.4.12\",\n    \"postcss\": \"^8.4.18\",\n    \"tailwindcss\": \"^3.2.1\",\n    \"typescript\": \"^4.1.3\"\n  }\n}\n"
  },
  {
    "path": "storybook/postcss.config.js",
    "content": "module.exports = {\n  plugins: [require('tailwindcss'), require('autoprefixer')],\n};\n"
  },
  {
    "path": "storybook/stories/AccessingInternalsViaRef.stories.tsx",
    "content": "import Button from '@atlaskit/button/standard-button';\nimport type { ComponentMeta } from '@storybook/react';\nimport React, { useRef } from 'react';\nimport Select, { SelectInstance } from 'react-select';\nimport AsyncSelect from 'react-select/async';\nimport CreatableSelect from 'react-select/creatable';\n\nimport { Field, Inline, Stack } from '../components';\nimport { ColourOption, colourOptions } from '../data';\n\nexport default {\n  title: 'Select/AccessingInternalsViaRef',\n  component: Select,\n  argTypes: {},\n} as ComponentMeta<typeof Select>;\n\nexport function AccessingInternalsViaRef() {\n  const selectRef = useRef<SelectInstance<ColourOption> | null>(null);\n  const asyncRef = useRef<SelectInstance<ColourOption> | null>(null);\n  const creatableRef = useRef<SelectInstance<ColourOption> | null>(null);\n\n  // Focus handlers\n  const focus = () => {\n    selectRef.current?.focus();\n  };\n  const focusAsync = () => {\n    asyncRef.current?.focus();\n  };\n  const focusCreatable = () => {\n    creatableRef.current?.focus();\n  };\n\n  // Blur handlers\n  const blur = () => {\n    selectRef.current?.blur();\n  };\n  const blurAsync = () => {\n    asyncRef.current?.blur();\n  };\n  const blurCreatable = () => {\n    creatableRef.current?.blur();\n  };\n\n  return (\n    <Stack gap=\"large\">\n      <Stack>\n        <Field label=\"Select\" htmlFor=\"select-id\">\n          <Select ref={selectRef} inputId=\"select-id\" options={colourOptions} />\n        </Field>\n        <Inline>\n          <Button onClick={focus}>Focus</Button>\n          <Button onClick={blur}>Blur</Button>\n        </Inline>\n      </Stack>\n\n      {/* Async Select */}\n      <Stack>\n        <Field label=\"Async Select\" htmlFor=\"async-select-id\">\n          <AsyncSelect\n            ref={asyncRef}\n            inputId=\"async-select-id\"\n            cacheOptions\n            defaultOptions\n            loadOptions={promiseOptions}\n          />\n        </Field>\n        <Inline>\n          <Button onClick={focusAsync}>Focus</Button>\n          <Button onClick={blurAsync}>Blur</Button>\n        </Inline>\n      </Stack>\n\n      {/* Creatable */}\n      <Stack>\n        <Field label=\"Creatable Select\" htmlFor=\"creatable-select-id\">\n          <CreatableSelect\n            ref={creatableRef}\n            inputId=\"creatable-select-id\"\n            isClearable\n            options={colourOptions}\n          />\n        </Field>\n        <Inline>\n          <Button onClick={focusCreatable}>Focus</Button>\n          <Button onClick={blurCreatable}>Blur</Button>\n        </Inline>\n      </Stack>\n    </Stack>\n  );\n}\n\n// =============================================================================\n// Utils\n// =============================================================================\n\nfunction filterColors(inputValue: string) {\n  return colourOptions.filter((i) =>\n    i.label.toLowerCase().includes(inputValue.toLowerCase())\n  );\n}\n\nfunction promiseOptions(inputValue: string) {\n  return new Promise<ColourOption[]>((resolve) => {\n    setTimeout(() => {\n      resolve(filterColors(inputValue));\n    }, 1000);\n  });\n}\n"
  },
  {
    "path": "storybook/stories/AnimatedMulti.stories.tsx",
    "content": "import { ComponentMeta, ComponentStory } from '@storybook/react';\nimport * as React from 'react';\nimport Select from 'react-select';\nimport makeAnimated from 'react-select/animated';\n\nimport { Field } from '../components';\nimport { colourOptions, defaultArgs } from '../data';\n\nexport default {\n  title: 'Select/AnimatedMulti',\n  component: Select,\n} as ComponentMeta<typeof Select>;\n\nconst animatedComponents = makeAnimated();\n\nconst Template: ComponentStory<typeof Select> = ({\n  inputId = 'react-select',\n  ...props\n}) => {\n  return (\n    <Field\n      htmlFor={inputId}\n      label=\"Animated Multi Select\"\n      secondaryLabel=\"Removing an item from this list will trigger an exit animation.\"\n    >\n      <Select components={animatedComponents} inputId={inputId} {...props} />\n    </Field>\n  );\n};\n\nexport const AnimatedMulti = Template.bind({});\nAnimatedMulti.args = {\n  ...defaultArgs,\n  defaultValue: [colourOptions[0], colourOptions[1], colourOptions[2]],\n  isMulti: true,\n};\n"
  },
  {
    "path": "storybook/stories/AsyncCallbacks.stories.tsx",
    "content": "import type { ComponentMeta } from '@storybook/react';\nimport * as React from 'react';\nimport AsyncSelect from 'react-select/async';\n\nimport { Field } from '../components';\nimport { ColourOption, colourOptions } from '../data';\n\nexport default {\n  title: 'Select/AsyncCallbacks',\n  component: AsyncSelect,\n} as ComponentMeta<typeof AsyncSelect>;\n\nexport function AsyncCallbacks() {\n  return (\n    <Field label=\"Async Callbacks\" htmlFor=\"async-callbacks-id\">\n      <AsyncSelect\n        inputId=\"async-callbacks-id\"\n        cacheOptions\n        defaultOptions\n        loadOptions={loadOptions}\n      />\n    </Field>\n  );\n}\n\n// =============================================================================\n// Utils\n// =============================================================================\n\nfunction filterColors(inputValue: string) {\n  return colourOptions.filter((i) =>\n    i.label.toLowerCase().includes(inputValue.toLowerCase())\n  );\n}\n\nfunction loadOptions(\n  inputValue: string,\n  callback: (options: ColourOption[]) => void\n) {\n  setTimeout(() => {\n    callback(filterColors(inputValue));\n  }, 1000);\n}\n"
  },
  {
    "path": "storybook/stories/AsyncCreatable.stories.tsx",
    "content": "import type { ComponentMeta } from '@storybook/react';\nimport * as React from 'react';\nimport AsyncCreatableSelect from 'react-select/async-creatable';\n\nimport { Field } from '../components';\nimport { ColourOption, colourOptions } from '../data';\n\nexport default {\n  title: 'Select/AsyncCreatable',\n  component: AsyncCreatableSelect,\n} as ComponentMeta<typeof AsyncCreatableSelect>;\n\nexport function AsyncCreatable() {\n  return (\n    <Field label=\"Async Creatable\" htmlFor=\"async-creatable-id\">\n      <AsyncCreatableSelect\n        inputId=\"async-creatable-id\"\n        cacheOptions\n        defaultOptions\n        loadOptions={promiseOptions}\n      />\n    </Field>\n  );\n}\n\n// =============================================================================\n// Utils\n// =============================================================================\n\nfunction filterColors(inputValue: string) {\n  return colourOptions.filter((i) =>\n    i.label.toLowerCase().includes(inputValue.toLowerCase())\n  );\n}\n\nfunction promiseOptions(inputValue: string) {\n  return new Promise<ColourOption[]>((resolve) => {\n    setTimeout(() => {\n      resolve(filterColors(inputValue));\n    }, 1000);\n  });\n}\n"
  },
  {
    "path": "storybook/stories/AsyncMulti.stories.tsx",
    "content": "import type { ComponentMeta } from '@storybook/react';\nimport * as React from 'react';\nimport AsyncSelect from 'react-select/async';\n\nimport { Field } from '../components';\nimport { ColourOption, colourOptions } from '../data';\n\nexport default {\n  title: 'Select/AsyncMulti',\n  component: AsyncSelect,\n} as ComponentMeta<typeof AsyncSelect>;\n\nexport function AsyncMulti() {\n  return (\n    <Field label=\"Async Multi\" htmlFor=\"async-multi-id\">\n      <AsyncSelect\n        inputId=\"async-multi-id\"\n        isMulti\n        cacheOptions\n        defaultOptions\n        loadOptions={promiseOptions}\n      />\n    </Field>\n  );\n}\n\n// =============================================================================\n// Utils\n// =============================================================================\n\nfunction filterColors(inputValue: string) {\n  return colourOptions.filter((i) =>\n    i.label.toLowerCase().includes(inputValue.toLowerCase())\n  );\n}\n\nfunction promiseOptions(inputValue: string) {\n  return new Promise<ColourOption[]>((resolve) => {\n    setTimeout(() => {\n      resolve(filterColors(inputValue));\n    }, 1000);\n  });\n}\n"
  },
  {
    "path": "storybook/stories/AsyncPromises.stories.tsx",
    "content": "import type { ComponentMeta } from '@storybook/react';\nimport * as React from 'react';\nimport AsyncSelect from 'react-select/async';\n\nimport { Field } from '../components';\nimport { ColourOption, colourOptions } from '../data';\n\nexport default {\n  title: 'Select/AsyncPromises',\n  component: AsyncSelect,\n  argTypes: {},\n} as ComponentMeta<typeof AsyncSelect>;\n\nexport function AsyncPromises() {\n  return (\n    <Field label=\"Async Promises\" htmlFor=\"async-promises\">\n      <AsyncSelect\n        inputId=\"async-promises\"\n        cacheOptions\n        defaultOptions\n        loadOptions={promiseOptions}\n      />\n    </Field>\n  );\n}\n\n// =============================================================================\n// Utils\n// =============================================================================\n\nfunction filterColors(inputValue: string) {\n  return colourOptions.filter((i) =>\n    i.label.toLowerCase().includes(inputValue.toLowerCase())\n  );\n}\n\nfunction promiseOptions(inputValue: string) {\n  return new Promise<ColourOption[]>((resolve) => {\n    setTimeout(() => {\n      resolve(filterColors(inputValue));\n    }, 1000);\n  });\n}\n"
  },
  {
    "path": "storybook/stories/AsyncSelectWithDefaultOptions.stories.tsx",
    "content": "import type { ComponentMeta } from '@storybook/react';\nimport * as React from 'react';\nimport AsyncSelect from 'react-select/async';\nimport { Field } from '../components';\n\nimport { ColourOption, colourOptions } from '../data';\n\nexport default {\n  title: 'Select/AsyncSelectWithDefaultOptions',\n  component: AsyncSelect,\n  argTypes: {},\n} as ComponentMeta<typeof AsyncSelect>;\n\nexport function AsyncSelectWithDefaultOptions() {\n  return (\n    <Field\n      label=\"Async Select With Default Options\"\n      htmlFor=\"async-select-with-default-options-id\"\n    >\n      <AsyncSelect\n        inputId=\"async-select-with-default-options-id\"\n        cacheOptions={false}\n        defaultOptions={colourOptions}\n        loadOptions={promiseOptions}\n      />\n    </Field>\n  );\n}\n\n// =============================================================================\n// Utils\n// =============================================================================\n\nfunction filterColors(inputValue: string) {\n  return colourOptions.filter((i) =>\n    i.label.toLowerCase().includes(inputValue.toLowerCase())\n  );\n}\n\nfunction promiseOptions(inputValue: string) {\n  return new Promise<ColourOption[]>((resolve) => {\n    setTimeout(() => {\n      resolve(filterColors(inputValue));\n    }, 1000);\n  });\n}\n"
  },
  {
    "path": "storybook/stories/BasicGrouped.stories.tsx",
    "content": "import type { ComponentMeta } from '@storybook/react';\nimport * as React from 'react';\nimport Select from 'react-select';\n\nimport { Field } from '../components';\nimport {\n  ColourOption,\n  colourOptions,\n  FlavourOption,\n  GroupedOption,\n  groupedOptions,\n} from '../data';\n\nexport default {\n  title: 'Select/BasicGrouped',\n  component: Select,\n} as ComponentMeta<typeof Select>;\n\nexport function BasicGrouped() {\n  return (\n    <Field label=\"Basic Grouped\" htmlFor=\"basic-grouped-id\">\n      <Select<ColourOption | FlavourOption, false, GroupedOption>\n        inputId=\"basic-grouped-id\"\n        defaultValue={colourOptions[1]}\n        options={groupedOptions}\n        formatGroupLabel={FormatGroupLabel}\n      />\n    </Field>\n  );\n}\n\nfunction FormatGroupLabel({ label, options }: GroupedOption) {\n  return (\n    <div\n      style={{\n        display: 'flex',\n        alignItems: 'center',\n        justifyContent: 'space-between',\n      }}\n    >\n      <span>{label}</span>\n      <span\n        style={{\n          backgroundColor: colourOptions[2].color,\n          borderRadius: '2em',\n          color: '#fff',\n          display: 'inline-block',\n          fontSize: 12,\n          fontWeight: 'normal',\n          lineHeight: '1',\n          minWidth: 1,\n          padding: '0.16666666666667em 0.5em',\n          textAlign: 'center',\n        }}\n      >\n        {options.length}\n      </span>\n    </div>\n  );\n}\n"
  },
  {
    "path": "storybook/stories/BasicMulti.stories.tsx",
    "content": "import { ComponentMeta, ComponentStory } from '@storybook/react';\nimport * as React from 'react';\nimport Select from 'react-select';\n\nimport { Field } from '../components';\nimport { colourOptions, defaultArgs } from '../data';\n\nexport default {\n  title: 'Select/BasicMulti',\n  component: Select,\n  argTypes: {},\n} as ComponentMeta<typeof Select>;\n\nconst Template: ComponentStory<typeof Select> = ({\n  inputId = 'react-select',\n  ...props\n}) => {\n  return (\n    <Field htmlFor={inputId} label=\"Basic Multi Select\">\n      <Select inputId={inputId} {...props} />\n    </Field>\n  );\n};\n\nexport const BasicMulti = Template.bind({});\nBasicMulti.args = {\n  ...defaultArgs,\n  defaultValue: [colourOptions[0], colourOptions[1], colourOptions[2]],\n  isMulti: true,\n};\n"
  },
  {
    "path": "storybook/stories/BasicSingle.stories.tsx",
    "content": "import { ComponentMeta, ComponentStory } from '@storybook/react';\nimport * as React from 'react';\nimport Select from 'react-select';\n\nimport { Field } from '../components';\nimport { defaultArgs } from '../data';\n\n/**\n * More on default export:\n * @see https://storybook.js.org/docs/react/writing-stories/introduction#default-export\n */\nexport default {\n  title: 'Select/BasicSingle',\n  component: Select,\n  /**\n   * More on argTypes:\n   * @see https://storybook.js.org/docs/react/api/argtypes\n   */\n  argTypes: {},\n} as ComponentMeta<typeof Select>;\n\n/**\n * More on component templates:\n * @see https://storybook.js.org/docs/react/writing-stories/introduction#using-args\n */\nconst Template: ComponentStory<typeof Select> = ({\n  inputId = 'react-select',\n  ...props\n}) => {\n  return (\n    <Field htmlFor={inputId}>\n      <Select inputId={inputId} {...props} />\n    </Field>\n  );\n};\n\nexport const BasicSingle = Template.bind({});\n/**\n * More on args:\n * @see https://storybook.js.org/docs/react/writing-stories/args\n */\nBasicSingle.args = {\n  ...defaultArgs,\n};\n"
  },
  {
    "path": "storybook/stories/ClassNamesWithTailwind.stories.tsx",
    "content": "import '../styles/tailwind.css';\n\nimport createCache from '@emotion/cache';\nimport { CacheProvider } from '@emotion/react';\nimport { ComponentMeta, ComponentStory } from '@storybook/react';\nimport classNames from 'classnames';\nimport * as React from 'react';\nimport Select from 'react-select';\n\nimport { Field } from '../components/field';\nimport { defaultArgs } from '../data';\n\nexport default {\n  title: 'Select/ClassNamesWithTailwind',\n  component: Select,\n  argTypes: {},\n} as ComponentMeta<typeof Select>;\n\n// This ensures that Emotion's styles are inserted before Tailwind's styles so that Tailwind classes have precedence over Emotion\nconst EmotionCacheProvider = ({ children }: { children: React.ReactNode }) => {\n  const cache = React.useMemo(\n    () =>\n      createCache({\n        key: 'with-tailwind',\n        insertionPoint: document.querySelector('title')!,\n      }),\n    []\n  );\n\n  return <CacheProvider value={cache}>{children}</CacheProvider>;\n};\n\nconst Template: ComponentStory<typeof Select> = ({\n  inputId = 'react-select',\n  ...props\n}) => {\n  return (\n    <EmotionCacheProvider>\n      <Field htmlFor={inputId} label=\"ClassNames With Tailwind\">\n        <Select\n          inputId={inputId}\n          {...props}\n          classNames={{\n            control: ({ isDisabled, isFocused }) =>\n              classNames(\n                !isDisabled && isFocused && 'border-purple-800',\n                isFocused && 'shadow-[0_0_0_1px] shadow-purple-800',\n                isFocused && 'hover:border-purple-800'\n              ),\n            option: ({ isDisabled, isFocused, isSelected }) =>\n              classNames(\n                isSelected && 'bg-purple-800',\n                !isSelected && isFocused && 'bg-purple-300',\n                !isDisabled && isSelected && 'active:bg-purple-800',\n                !isDisabled && !isSelected && 'active:bg-purple-500'\n              ),\n          }}\n        />\n      </Field>\n    </EmotionCacheProvider>\n  );\n};\n\nexport const ClassNamesWithTailwind = Template.bind({});\nClassNamesWithTailwind.args = {\n  ...defaultArgs,\n};\n"
  },
  {
    "path": "storybook/stories/ControlledMenu.stories.tsx",
    "content": "import type { ComponentMeta } from '@storybook/react';\nimport * as React from 'react';\nimport Select, { SelectInstance, StylesConfig } from 'react-select';\n\nimport { Field, Inline, Stack } from '../components';\nimport { ColourOption, colourOptions } from '../data';\n\nexport default {\n  title: 'Select/ControlledMenu',\n  component: Select,\n} as ComponentMeta<typeof Select>;\n\nexport function ControlledMenu() {\n  const inputRef = React.useRef<SelectInstance<ColourOption>>(null);\n  const [menuIsOpen, setMenuIsOpen] = React.useState<boolean>(false);\n\n  function toggleMenuIsOpen() {\n    setMenuIsOpen((value) => !value);\n    const selectEl = inputRef.current;\n    if (!selectEl) return;\n    if (menuIsOpen) selectEl.blur();\n    else selectEl.focus();\n  }\n\n  return (\n    <Stack>\n      <Inline>\n        <input\n          id=\"menu-toggle\"\n          type=\"checkbox\"\n          checked={menuIsOpen}\n          onChange={toggleMenuIsOpen}\n        />\n        <label htmlFor=\"menu-toggle\">Click to toggle menu</label>\n      </Inline>\n      <Field label=\"Controlled Menu\" htmlFor=\"controlled-menu-id\">\n        <Select\n          inputId=\"controlled-menu-id\"\n          ref={inputRef}\n          defaultValue={colourOptions[0]}\n          menuIsOpen={menuIsOpen}\n          options={colourOptions}\n          styles={styles}\n        />\n      </Field>\n    </Stack>\n  );\n}\n\n// =============================================================================\n// Styles\n// =============================================================================\n\nconst styles: StylesConfig<ColourOption, false> = {\n  menu: (base) => ({ ...base, position: 'relative' }),\n};\n"
  },
  {
    "path": "storybook/stories/Creatable.stories.tsx",
    "content": "import { ComponentMeta, ComponentStory } from '@storybook/react';\nimport * as React from 'react';\nimport type { SelectInstance } from 'react-select';\nimport CreatableSelect from 'react-select/creatable';\n\nimport { Field } from '../components';\nimport { defaultArgs } from '../data';\n\nexport default {\n  title: 'Select/Creatable',\n  component: CreatableSelect,\n} as ComponentMeta<typeof CreatableSelect>;\n\ntype Option = {\n  label: string;\n  value: string;\n};\n\nfunction createOption(label: string): Option {\n  return {\n    label,\n    value: label.toLowerCase(),\n  };\n}\n\nconst defaultOptions: Option[] = [\n  createOption('One'),\n  createOption('Two'),\n  createOption('Three'),\n];\n\nconst Template: ComponentStory<typeof CreatableSelect> = ({\n  inputId = 'react-select',\n  ...props\n}) => {\n  const creatableRef = React.useRef<SelectInstance<Option> | null>(null);\n  const [isLoading, setIsLoading] = React.useState(false);\n  const [options, setOptions] = React.useState(props.options as Option[]);\n  const [value, setValue] = React.useState<Option | null>();\n\n  /** Uses a setTimeout to simulate making a network request. */\n  function handleCreate(inputValue: string) {\n    setIsLoading(true);\n    setTimeout(() => {\n      const newOption = createOption(inputValue);\n      setOptions((prev) => [...prev, newOption]);\n      setValue(newOption);\n      setIsLoading(false);\n      creatableRef.current?.focus();\n    }, 1000);\n  }\n\n  return (\n    <Field\n      htmlFor={inputId}\n      label=\"Creatable\"\n      secondaryLabel=\"The Creatable API lets users add their own options to the list.\"\n    >\n      <CreatableSelect\n        {...(props /** Casting as `unknown` here so types for `ref` are correct */ as unknown)}\n        inputId={inputId}\n        isDisabled={isLoading}\n        isLoading={isLoading}\n        onCreateOption={handleCreate}\n        options={options}\n        value={value}\n        ref={creatableRef}\n      />\n    </Field>\n  );\n};\n\nexport const Creatable = Template.bind({});\nCreatable.args = {\n  ...defaultArgs,\n  options: defaultOptions,\n  isClearable: true,\n};\n"
  },
  {
    "path": "storybook/stories/CreatableAdvanced.stories.tsx",
    "content": "import type { ComponentMeta } from '@storybook/react';\nimport * as React from 'react';\nimport CreatableSelect from 'react-select/creatable';\n\nimport { Field } from '../components';\nimport { NumberOption, numbers } from '../data';\n\nexport default {\n  title: 'Select/CreatableAdvanced',\n  component: CreatableSelect,\n} as ComponentMeta<typeof CreatableSelect>;\n\nexport function CreatableAdvanced() {\n  const [isLoading, setIsLoading] = React.useState(false);\n  const [options, setOptions] = React.useState(numbers);\n  const [value, setValue] = React.useState<NumberOption | null>(null);\n\n  function handleCreate(inputValue: string) {\n    setIsLoading(true);\n    setTimeout(() => {\n      const newOption = {\n        label: inputValue,\n        value: slugify(inputValue),\n      };\n      setIsLoading(false);\n      setOptions((prev) => [...prev, newOption]);\n      setValue(newOption);\n    }, 1000);\n  }\n\n  return (\n    <Field label=\"Creatable Advanced\" htmlFor=\"creatable-advanced-id\">\n      <CreatableSelect\n        inputId=\"creatable-advanced-id\"\n        isDisabled={isLoading}\n        isLoading={isLoading}\n        onChange={(newValue) => setValue(newValue)}\n        onCreateOption={handleCreate}\n        options={options}\n        value={value}\n      />\n    </Field>\n  );\n}\n\nfunction slugify(text: string) {\n  return text\n    .toLowerCase()\n    .replace(/[^a-z0-9 -]/g, '')\n    .replace(/\\s+/g, '-')\n    .replace(/-+/g, '-');\n}\n"
  },
  {
    "path": "storybook/stories/CreatableInputOnly.stories.tsx",
    "content": "import type { ComponentMeta } from '@storybook/react';\nimport * as React from 'react';\nimport CreatableSelect from 'react-select/creatable';\nimport { Field } from '../components';\n\nexport default {\n  title: 'Select/CreatableInputOnly',\n  component: CreatableSelect,\n} as ComponentMeta<typeof CreatableSelect>;\n\nexport function CreatableInputOnly() {\n  const [inputValue, setInputValue] = React.useState('');\n  const [value, setValue] = React.useState<readonly Option[]>([]);\n\n  function handleKeyDown(event: React.KeyboardEvent<Element>) {\n    if (!inputValue) return;\n    switch (event.key) {\n      case 'Enter':\n      case 'Tab':\n        setValue((prev) => [...prev, { label: inputValue, value: inputValue }]);\n        setInputValue('');\n        event.preventDefault();\n    }\n  }\n\n  return (\n    <Field label=\"Creatable Input Only\" htmlFor=\"creatable-input-only-id\">\n      <CreatableSelect\n        inputId=\"creatable-input-only-id\"\n        components={{ DropdownIndicator: null }}\n        inputValue={inputValue}\n        isMulti\n        onChange={(newValue) => setValue(newValue)}\n        onInputChange={(newValue) => setInputValue(newValue)}\n        onKeyDown={handleKeyDown}\n        placeholder=\"Type something and press enter...\"\n        value={value}\n      />\n    </Field>\n  );\n}\n\ninterface Option {\n  readonly label: string;\n  readonly value: string;\n}\n"
  },
  {
    "path": "storybook/stories/CreateFilter.stories.tsx",
    "content": "import type { ComponentMeta } from '@storybook/react';\nimport * as React from 'react';\nimport Select, { createFilter } from 'react-select';\nimport { Field, Inline, Stack } from '../components';\nimport { colourOptions } from '../data';\n\nexport default {\n  title: 'Select/CreateFilter',\n  component: Select,\n  argTypes: {},\n} as ComponentMeta<typeof Select>;\n\nexport function CreateFilter() {\n  const [ignoreCase, setIgnoreCase] = React.useState(true);\n  const [ignoreAccents, setIgnoreAccents] = React.useState(true);\n  const [trim, setTrim] = React.useState(true);\n  const [matchFromStart, setMatchFromStart] = React.useState(false);\n\n  const filterConfig = {\n    ignoreCase,\n    ignoreAccents,\n    trim,\n    matchFrom: matchFromStart ? ('start' as const) : ('any' as const),\n  };\n\n  const options = React.useMemo(() => {\n    return [\n      {\n        id: 'ignore-case',\n        label: 'Ignore Case',\n        checked: ignoreCase,\n        onChange: () => setIgnoreCase((prev) => !prev),\n      },\n      {\n        id: 'ignore-accents',\n        label: 'Ignore Accents',\n        checked: ignoreAccents,\n        onChange: () => setIgnoreAccents((prev) => !prev),\n      },\n      {\n        id: 'trim',\n        label: 'Trim',\n        checked: trim,\n        onChange: () => setTrim((prev) => !prev),\n      },\n      {\n        id: 'match-from-start',\n        label: 'Match From Start',\n        checked: matchFromStart,\n        onChange: () => setMatchFromStart((prev) => !prev),\n      },\n    ];\n  }, [ignoreAccents, ignoreCase, matchFromStart, trim]);\n\n  return (\n    <Stack>\n      <Field label=\"Create Filter\" htmlFor=\"create-filter-id\">\n        <Select\n          inputId=\"create-filter-id\"\n          defaultValue={colourOptions[0]}\n          options={colourOptions}\n          filterOption={createFilter(filterConfig)}\n        />\n      </Field>\n      <Inline gap=\"medium\">\n        {options.map((option) => (\n          <Inline key={option.id}>\n            <input\n              type=\"checkbox\"\n              id={option.id}\n              checked={option.checked}\n              onChange={option.onChange}\n            />\n            <label htmlFor={option.id}>{option.label}</label>\n          </Inline>\n        ))}\n      </Inline>\n    </Stack>\n  );\n}\n"
  },
  {
    "path": "storybook/stories/CustomAriaLive.stories.tsx",
    "content": "import type { ComponentMeta } from '@storybook/react';\nimport * as React from 'react';\nimport Select, { AriaOnFocus } from 'react-select';\nimport { ColourOption, colourOptions } from '../data';\n\nexport default {\n  title: 'Select/CustomAriaLive',\n  component: Select,\n  argTypes: {},\n} as ComponentMeta<typeof Select>;\n\nexport function CustomAriaLive() {\n  const [isMenuOpen, setIsMenuOpen] = React.useState(false);\n  const handleMenuOpen = () => setIsMenuOpen(true);\n  const handleMenuClose = () => setIsMenuOpen(false);\n\n  const [ariaFocusMessage, setAriaFocusMessage] = React.useState('');\n  const onFocus: AriaOnFocus<ColourOption> = ({ focused, isDisabled }) => {\n    const message = `You are currently focused on option \"${focused.label}\"${\n      isDisabled ? ', disabled' : ''\n    }`;\n    setAriaFocusMessage(message);\n    return message;\n  };\n\n  return (\n    <form style={styles.form}>\n      <label style={styles.label} id=\"aria-label\" htmlFor=\"aria-example-input\">\n        Select a color\n      </label>\n\n      {!!ariaFocusMessage && !!isMenuOpen && (\n        <blockquote style={styles.blockquote}>{ariaFocusMessage}</blockquote>\n      )}\n\n      <Select\n        inputId=\"aria-example-input\"\n        aria-labelledby=\"aria-label\"\n        ariaLiveMessages={{ onFocus }}\n        onMenuClose={handleMenuClose}\n        onMenuOpen={handleMenuOpen}\n        options={colourOptions}\n      />\n    </form>\n  );\n}\n\n// =============================================================================\n// Styles\n// =============================================================================\n\nconst styles = {\n  form: {\n    display: 'flex',\n    flexDirection: 'column',\n    gap: '0.5rem',\n  },\n  blockquote: {\n    fontStyle: 'italic',\n    margin: 0,\n  },\n  label: {\n    fontWeight: 500,\n    display: 'flex',\n    flexDirection: 'column',\n    gap: '0.5rem',\n  },\n} as const;\n"
  },
  {
    "path": "storybook/stories/CustomClearIndicator.stories.tsx",
    "content": "import type { ComponentMeta } from '@storybook/react';\nimport * as React from 'react';\nimport Select, { ClearIndicatorProps, StylesConfig } from 'react-select';\n\nimport { Field } from '../components';\nimport { ColourOption, colourOptions } from '../data';\n\nexport default {\n  title: 'Select/CustomClearIndicator',\n  component: Select,\n  argTypes: {},\n} as ComponentMeta<typeof Select>;\n\nexport function CustomClearIndicator() {\n  return (\n    <Field label=\"Custom Clear Indicator\" htmlFor=\"custom-clear-indicator-id\">\n      <Select\n        id=\"custom-clear-indicator-id\"\n        components={{ ClearIndicator }}\n        defaultValue={[colourOptions[4], colourOptions[5]]}\n        isMulti\n        options={colourOptions}\n        styles={styles}\n      />\n    </Field>\n  );\n}\n\n// =============================================================================\n// Styles\n// =============================================================================\n\nconst styles: StylesConfig<ColourOption> = {\n  clearIndicator: (base, state) => ({\n    ...base,\n    cursor: 'pointer',\n    color: state.isFocused ? 'blue' : 'black',\n  }),\n};\n\n// =============================================================================\n// Components\n// =============================================================================\n\nfunction ClearIndicator(props: ClearIndicatorProps<ColourOption, true>) {\n  const {\n    getStyles,\n    innerProps: { ref, ...restInnerProps },\n  } = props;\n  return (\n    <div\n      {...restInnerProps}\n      ref={ref}\n      style={getStyles('clearIndicator', props) as React.CSSProperties}\n    >\n      <span style={{ padding: '0px 5px', color: colourOptions[2].color }}>\n        clear all\n      </span>\n    </div>\n  );\n}\n"
  },
  {
    "path": "storybook/stories/CustomControl.stories.tsx",
    "content": "import type { ComponentMeta } from '@storybook/react';\nimport * as React from 'react';\nimport Select, { components, ControlProps } from 'react-select';\n\nimport { Field } from '../components';\nimport { ColourOption, colourOptions } from '../data';\n\nexport default {\n  title: 'Select/CustomControl',\n  component: Select,\n  argTypes: {},\n} as ComponentMeta<typeof Select>;\n\nexport function CustomControl() {\n  return (\n    <Field label=\"Custom Control\" htmlFor=\"custom-control-id\">\n      <Select\n        inputId=\"custom-control-id\"\n        components={{ Control: ControlComponent }}\n        defaultValue={colourOptions[0]}\n        options={colourOptions}\n      />\n    </Field>\n  );\n}\n\n// =============================================================================\n// Components\n// =============================================================================\n\nfunction ControlComponent(props: ControlProps<ColourOption, false>) {\n  return (\n    <div\n      style={{\n        border: '1px solid black',\n        padding: '5px',\n        background: colourOptions[2].color,\n        color: 'white',\n      }}\n    >\n      <components.Control {...props} />\n      <p>This is the Custom Control</p>\n    </div>\n  );\n}\n"
  },
  {
    "path": "storybook/stories/CustomDropdownIndicator.stories.tsx",
    "content": "import EmojiIcon from '@atlaskit/icon/glyph/emoji';\nimport type { ComponentMeta } from '@storybook/react';\nimport * as React from 'react';\nimport Select, { components, DropdownIndicatorProps } from 'react-select';\n\nimport { Field } from '../components';\nimport { ColourOption, colourOptions } from '../data';\n\nexport default {\n  title: 'Select/CustomDropdownIndicator',\n  component: Select,\n  argTypes: {},\n} as ComponentMeta<typeof Select>;\n\nexport function CustomDropdownIndicator() {\n  return (\n    <Field label=\"Custom Menu List\" htmlFor=\"custom-menu-list-id\">\n      <Select\n        inputId=\"custom-menu-list-id\"\n        components={{ DropdownIndicator }}\n        options={colourOptions}\n      />\n    </Field>\n  );\n}\n\n// =============================================================================\n// Components\n// =============================================================================\n\nfunction DropdownIndicator(props: DropdownIndicatorProps<ColourOption, true>) {\n  return (\n    <components.DropdownIndicator {...props}>\n      <EmojiIcon label=\"Emoji\" primaryColor={colourOptions[2].color} />\n    </components.DropdownIndicator>\n  );\n}\n"
  },
  {
    "path": "storybook/stories/CustomFilterOptions.stories.tsx",
    "content": "import { ComponentMeta } from '@storybook/react';\nimport * as React from 'react';\nimport Select from 'react-select';\nimport { Field } from '../components';\n\nimport { colourOptions } from '../data';\n\nexport default {\n  title: 'Select/CustomFilterOptions',\n  component: Select,\n  argTypes: {},\n} as ComponentMeta<typeof Select>;\n\nexport function CustomFilterOptions() {\n  return (\n    <Field label=\"Custom Filter Options\" htmlFor=\"custom-filter-options-id\">\n      <Select\n        inputId=\"custom-filter-options-id\"\n        defaultValue={customOptions[0]}\n        options={customOptions}\n        filterOption={filterOptions}\n      />\n    </Field>\n  );\n}\n\nconst filterOptions = (\n  candidate: { label: string; value: string },\n  input: string\n) => {\n  if (input) {\n    return candidate.value === customOptions[0].value;\n  }\n  return true;\n};\n\nconst customOptions = [\n  {\n    value: 'custom',\n    label: 'Using a custom filter to always display this option on search',\n  },\n  ...colourOptions,\n];\n"
  },
  {
    "path": "storybook/stories/CustomFormatOptionLabel.stories.tsx",
    "content": "import type { ComponentMeta } from '@storybook/react';\nimport * as React from 'react';\nimport Select from 'react-select';\nimport { Field } from '../components';\n\nimport { colourOptions } from '../data';\n\nexport default {\n  title: 'Select/CustomFormatOptionLabel',\n  component: Select,\n  argTypes: {},\n} as ComponentMeta<typeof Select>;\n\nexport function CustomFormatOptionLabel() {\n  return (\n    <Field\n      label=\"Custom Format Option Label\"\n      htmlFor=\"custom-format-option-label-id\"\n    >\n      <Select\n        inputId=\"custom-format-option-label-id\"\n        defaultValue={colourOptions[2]}\n        options={colourOptions}\n        formatOptionLabel={formatOptionLabel}\n      />\n    </Field>\n  );\n}\n\nfunction formatOptionLabel(option: typeof colourOptions[number]) {\n  return (\n    <div style={{ display: 'flex', alignItems: 'center', gap: '0.25rem' }}>\n      <div\n        style={{\n          backgroundColor: option.color,\n          borderRadius: 9999,\n          height: 8,\n          width: 8,\n        }}\n      />\n      <div>{option.label}</div>\n    </div>\n  );\n}\n"
  },
  {
    "path": "storybook/stories/CustomGetOptionLabel.stories.tsx",
    "content": "import type { ComponentMeta } from '@storybook/react';\nimport * as React from 'react';\nimport Select from 'react-select';\n\nimport { Field } from '../components';\nimport { flavourOptions } from '../data';\n\nexport default {\n  title: 'Select/CustomGetOptionLabel',\n  component: Select,\n  argTypes: {},\n} as ComponentMeta<typeof Select>;\n\nexport function CustomGetOptionLabel() {\n  return (\n    <Field\n      label=\"Custom Get Option Label\"\n      secondaryLabel=\"Composing a display label from the label property and rating property in the options object.\"\n      htmlFor=\"custom-get-option-label-id\"\n    >\n      <Select\n        inputId=\"custom-get-option-label-id\"\n        options={flavourOptions}\n        getOptionLabel={(option) => `${option.label}: ${option.rating}`}\n      />\n    </Field>\n  );\n}\n"
  },
  {
    "path": "storybook/stories/CustomGetOptionValue.stories.tsx",
    "content": "import type { ComponentMeta } from '@storybook/react';\nimport * as React from 'react';\nimport Select from 'react-select';\n\nimport { Field } from '../components';\nimport { dogOptions } from '../data';\n\nexport default {\n  title: 'Select/CustomGetOptionValue',\n  component: Select,\n  argTypes: {},\n} as ComponentMeta<typeof Select>;\n\nexport function CustomGetOptionValue() {\n  return (\n    <Field\n      label=\"Custom Get Option Value\"\n      secondaryLabel=\"Using id property, instead of value property.\"\n      htmlFor=\"custom-get-option-value-id\"\n    >\n      <Select\n        inputId=\"custom-get-option-value-id\"\n        options={dogOptions}\n        getOptionValue={(option) => `${option['id']}`}\n      />\n    </Field>\n  );\n}\n"
  },
  {
    "path": "storybook/stories/CustomGroup.stories.tsx",
    "content": "import type { ComponentMeta } from '@storybook/react';\nimport * as React from 'react';\nimport Select, { components, GroupProps } from 'react-select';\n\nimport { Field } from '../components';\nimport {\n  ColourOption,\n  colourOptions,\n  FlavourOption,\n  groupedOptions,\n} from '../data';\n\nexport default {\n  title: 'Select/CustomGroup',\n  component: Select,\n  argTypes: {},\n} as ComponentMeta<typeof Select>;\n\nexport function CustomGroup() {\n  return (\n    <Field label=\"Custom Group\" htmlFor=\"custom-group-id\">\n      <Select<ColourOption | FlavourOption>\n        inputId=\"custom-group-id\"\n        defaultValue={colourOptions[1]}\n        options={groupedOptions}\n        components={{ Group }}\n      />\n    </Field>\n  );\n}\n\n// =============================================================================\n// Components\n// =============================================================================\n\nfunction Group(props: GroupProps<ColourOption | FlavourOption, false>) {\n  return (\n    <div\n      style={{\n        border: `2px dotted ${colourOptions[2].color}`,\n        borderRadius: '5px',\n        background: '#f2fcff',\n      }}\n    >\n      <components.Group {...props} />\n    </div>\n  );\n}\n"
  },
  {
    "path": "storybook/stories/CustomGroupHeading.stories.tsx",
    "content": "import EditorPanelIcon from '@atlaskit/icon/glyph/editor/panel';\nimport Tooltip from '@atlaskit/tooltip';\nimport type { ComponentMeta } from '@storybook/react';\nimport * as React from 'react';\nimport Select, {\n  components,\n  GroupHeadingProps,\n  StylesConfig,\n} from 'react-select';\nimport { Field } from '../components';\nimport {\n  ColourOption,\n  colourOptions,\n  FlavourOption,\n  groupedOptions,\n} from '../data';\n\nexport default {\n  title: 'Select/CustomGroupHeading',\n  component: Select,\n  argTypes: {},\n} as ComponentMeta<typeof Select>;\n\nexport function CustomGroupHeading() {\n  return (\n    <Field label=\"Custom Group Heading\" htmlFor=\"custom-group-heading-id\">\n      <Select<ColourOption | FlavourOption>\n        inputId=\"custom-group-heading-id\"\n        defaultValue={colourOptions[1]}\n        options={groupedOptions}\n        components={{ GroupHeading }}\n        styles={styles}\n      />\n    </Field>\n  );\n}\n\n// =============================================================================\n// Styles\n// =============================================================================\n\nconst styles: StylesConfig<ColourOption | FlavourOption> = {\n  groupHeading: (base) => ({\n    ...base,\n    flex: '1 1',\n    color: 'white',\n    margin: 0,\n  }),\n};\n\n// =============================================================================\n// Components\n// =============================================================================\n\nfunction GroupHeading(props: GroupHeadingProps<ColourOption | FlavourOption>) {\n  return (\n    <div\n      style={{\n        border: `2px dotted ${colourOptions[2].color}`,\n        color: 'white',\n        background: colourOptions[2].color,\n        padding: '5px 0px',\n        display: 'flex',\n      }}\n    >\n      <components.GroupHeading {...props} />\n      <Tooltip content=\"Custom GroupHeading Component\">\n        <EditorPanelIcon label=\"Editor Panel\" />\n      </Tooltip>\n    </div>\n  );\n}\n"
  },
  {
    "path": "storybook/stories/CustomIndicatorSeparator.stories.tsx",
    "content": "import type { ComponentMeta } from '@storybook/react';\nimport * as React from 'react';\nimport Select, { IndicatorSeparatorProps } from 'react-select';\n\nimport { Field } from '../components';\nimport { ColourOption, colourOptions } from '../data';\n\nexport default {\n  title: 'Select/CustomIndicatorSeparator',\n  component: Select,\n  argTypes: {},\n} as ComponentMeta<typeof Select>;\n\nexport function CustomIndicatorSeparator() {\n  return (\n    <Field\n      label=\"Custom Indicator Separator\"\n      htmlFor=\"custom-indicator-separator-id\"\n    >\n      <Select\n        inputId=\"custom-indicator-separator-id\"\n        components={{ IndicatorSeparator }}\n        defaultValue={[colourOptions[4], colourOptions[5]]}\n        isMulti\n        options={colourOptions}\n      />\n    </Field>\n  );\n}\n\n// =============================================================================\n// Components\n// =============================================================================\n\nfunction IndicatorSeparator({\n  innerProps,\n}: IndicatorSeparatorProps<ColourOption, true>) {\n  return (\n    <span\n      style={{\n        alignSelf: 'stretch',\n        backgroundColor: colourOptions[2].color,\n        marginBottom: 8,\n        marginTop: 8,\n        width: 2,\n      }}\n      {...innerProps}\n    />\n  );\n}\n"
  },
  {
    "path": "storybook/stories/CustomIndicatorsContainer.stories.tsx",
    "content": "import type { ComponentMeta } from '@storybook/react';\nimport * as React from 'react';\nimport Select, { components, IndicatorsContainerProps } from 'react-select';\n\nimport { Field } from '../components';\nimport { ColourOption, colourOptions } from '../data';\n\nexport default {\n  title: 'Select/CustomIndicatorsContainer',\n  component: Select,\n  argTypes: {},\n} as ComponentMeta<typeof Select>;\n\nexport function CustomIndicatorsContainer() {\n  return (\n    <Field\n      label=\"Custom Indicators Container\"\n      htmlFor=\"custom-indicators-container-id\"\n    >\n      <Select\n        inputId=\"custom-indicators-container-id\"\n        closeMenuOnSelect={false}\n        components={{ IndicatorsContainer, IndicatorSeparator: null }}\n        defaultValue={[colourOptions[4], colourOptions[5]]}\n        isMulti\n        options={colourOptions}\n      />\n    </Field>\n  );\n}\n\n// =============================================================================\n// Components\n// =============================================================================\n\nfunction IndicatorsContainer(\n  props: IndicatorsContainerProps<ColourOption, true>\n) {\n  return (\n    <div style={{ background: colourOptions[2].color }}>\n      <components.IndicatorsContainer {...props} />\n    </div>\n  );\n}\n"
  },
  {
    "path": "storybook/stories/CustomInput.stories.tsx",
    "content": "import Tooltip from '@atlaskit/tooltip';\nimport { ComponentMeta } from '@storybook/react';\nimport * as React from 'react';\nimport Select, { components, InputProps } from 'react-select';\n\nimport { Field } from '../components';\nimport { ColourOption, colourOptions } from '../data';\n\nexport default {\n  title: 'Select/CustomInput',\n  component: Select,\n  argTypes: {},\n} as ComponentMeta<typeof Select>;\n\nexport function CustomInput() {\n  return (\n    <Field label=\"Custom Input\" htmlFor=\"custom-input-id\">\n      <Select\n        inputId=\"custom-input-id\"\n        components={{ Input }}\n        defaultValue={[colourOptions[4], colourOptions[5]]}\n        isMulti\n        options={colourOptions}\n      />\n    </Field>\n  );\n}\n\n// =============================================================================\n// Components\n// =============================================================================\n\nfunction Input(props: InputProps<ColourOption, true>) {\n  const component = <components.Input {...props} />;\n  if (props.isHidden) return component;\n  return (\n    <div style={{ border: `1px dotted ${colourOptions[2].color}` }}>\n      <Tooltip content=\"Custom Input\" position=\"top\">\n        {component}\n      </Tooltip>\n    </div>\n  );\n}\n"
  },
  {
    "path": "storybook/stories/CustomIsOptionDisabled.stories.tsx",
    "content": "import type { ComponentMeta } from '@storybook/react';\nimport * as React from 'react';\nimport Select from 'react-select';\n\nimport { Field } from '../components';\nimport { flavourOptions } from '../data';\n\nexport default {\n  title: 'Select/CustomIsOptionDisabled',\n  component: Select,\n  argTypes: {},\n} as ComponentMeta<typeof Select>;\n\nexport function CustomIsOptionDisabled() {\n  return (\n    <Field\n      label=\"Custom isOptionDisabled\"\n      secondaryLabel=\"Disable all options that do not have a 'safe' rating, via the isOptionsDisabled prop.\"\n      htmlFor=\"custom-is-option-disabled-id\"\n    >\n      <Select\n        inputId=\"custom-is-option-disabled-id\"\n        defaultValue={flavourOptions[0]}\n        isOptionDisabled={(option) => option.rating !== 'safe'}\n        options={flavourOptions}\n      />\n    </Field>\n  );\n}\n"
  },
  {
    "path": "storybook/stories/CustomLoadingIndicator.stories.tsx",
    "content": "import Spinner from '@atlaskit/spinner';\nimport Tooltip from '@atlaskit/tooltip';\nimport type { ComponentMeta } from '@storybook/react';\nimport * as React from 'react';\nimport { LoadingIndicatorProps } from 'react-select';\nimport AsyncSelect from 'react-select/async';\nimport { Field } from '../components';\nimport { ColourOption, colourOptions } from '../data';\n\nexport default {\n  title: 'Select/CustomLoadingIndicator',\n  component: AsyncSelect,\n  argTypes: {},\n} as ComponentMeta<typeof AsyncSelect>;\n\nexport function CustomLoadingIndicator() {\n  return (\n    <Field\n      label=\"Custom Loading Indicator\"\n      htmlFor=\"custom-loading-indicator-id\"\n    >\n      <AsyncSelect\n        inputId=\"custom-loading-indicator-id\"\n        cacheOptions\n        defaultOptions\n        loadOptions={promiseOptions}\n        components={{ LoadingIndicator }}\n      />\n    </Field>\n  );\n}\n\n// =============================================================================\n// Components\n// =============================================================================\n\nfunction LoadingIndicator(props: LoadingIndicatorProps<ColourOption>) {\n  return (\n    <Tooltip content=\"Custom Loader\">\n      <Spinner {...props} delay={0} />\n    </Tooltip>\n  );\n}\n\n// =============================================================================\n// Utils\n// =============================================================================\n\nfunction filterColors(inputValue: string) {\n  return colourOptions.filter((i) =>\n    i.label.toLowerCase().includes(inputValue.toLowerCase())\n  );\n}\n\nfunction promiseOptions(inputValue: string) {\n  return new Promise<ColourOption[]>((resolve) => {\n    setTimeout(() => {\n      resolve(filterColors(inputValue));\n    }, 1000);\n  });\n}\n"
  },
  {
    "path": "storybook/stories/CustomLoadingMessage.stories.tsx",
    "content": "import Tooltip from '@atlaskit/tooltip';\nimport type { ComponentMeta } from '@storybook/react';\nimport * as React from 'react';\nimport { NoticeProps, StylesConfig } from 'react-select';\nimport AsyncSelect from 'react-select/async';\nimport { Field } from '../components';\n\nimport { ColourOption, colourOptions } from '../data';\n\nexport default {\n  title: 'Select/CustomLoadingMessage',\n  component: AsyncSelect,\n  argTypes: {},\n} as ComponentMeta<typeof AsyncSelect>;\n\nexport function CustomLoadingMessage() {\n  return (\n    <Field label=\"Custom Loading Message\" htmlFor=\"custom-loading-message-id\">\n      <AsyncSelect\n        inputId=\"custom-loading-message-id\"\n        cacheOptions\n        components={{ LoadingMessage }}\n        defaultOptions\n        loadOptions={promiseOptions}\n        styles={styles}\n      />\n    </Field>\n  );\n}\n\n// =============================================================================\n// Styles\n// =============================================================================\n\nconst styles: StylesConfig<ColourOption> = {\n  loadingMessage: (base) => ({\n    ...base,\n    backgroundColor: colourOptions[2].color,\n    color: 'white',\n  }),\n};\n\n// =============================================================================\n// Components\n// =============================================================================\n\nfunction LoadingMessage(props: NoticeProps<ColourOption, false>) {\n  return (\n    <Tooltip content={'Custom Loading Message'}>\n      <div\n        {...props.innerProps}\n        style={props.getStyles('loadingMessage', props) as React.CSSProperties}\n      >\n        {props.children}\n      </div>\n    </Tooltip>\n  );\n}\n\n// =============================================================================\n// Utils\n// =============================================================================\n\nfunction filterColors(inputValue: string) {\n  return colourOptions.filter((i) =>\n    i.label.toLowerCase().includes(inputValue.toLowerCase())\n  );\n}\n\nfunction promiseOptions(inputValue: string) {\n  return new Promise<ColourOption[]>((resolve) => {\n    setTimeout(() => {\n      resolve(filterColors(inputValue));\n    }, 1000);\n  });\n}\n"
  },
  {
    "path": "storybook/stories/CustomMenu.stories.tsx",
    "content": "import type { ComponentMeta } from '@storybook/react';\nimport * as React from 'react';\nimport Select, { components, MenuProps } from 'react-select';\n\nimport { Field } from '../components';\nimport {\n  ColourOption,\n  colourOptions,\n  FlavourOption,\n  GroupedOption,\n  groupedOptions,\n} from '../data';\n\nexport default {\n  title: 'Select/CustomMenu',\n  component: Select,\n  argTypes: {},\n} as ComponentMeta<typeof Select>;\n\nexport function CustomMenu() {\n  return (\n    <Field label=\"Custom Menu\" htmlFor=\"custom-menu-id\">\n      <Select<ColourOption | FlavourOption, false, GroupedOption>\n        inputId=\"custom-menu-id\"\n        defaultValue={colourOptions[1]}\n        options={groupedOptions}\n        components={{ Menu }}\n      />\n    </Field>\n  );\n}\n\n// =============================================================================\n// Components\n// =============================================================================\n\nfunction Menu(\n  props: MenuProps<ColourOption | FlavourOption, false, GroupedOption>\n) {\n  const optionsLength = getLength(props.options);\n  return (\n    <React.Fragment>\n      <div\n        style={{\n          padding: '8px 12px',\n        }}\n      >\n        Custom Menu with {optionsLength} options\n      </div>\n      <components.Menu<ColourOption | FlavourOption, false, GroupedOption>\n        {...props}\n      >\n        {props.children}\n      </components.Menu>\n    </React.Fragment>\n  );\n}\n\n// =============================================================================\n// Utils\n// =============================================================================\n\nfunction getLength(\n  options: readonly (GroupedOption | ColourOption | FlavourOption)[]\n): number {\n  return options.reduce((acc, curr) => {\n    if ('options' in curr) return acc + getLength(curr.options);\n    return acc + 1;\n  }, 0);\n}\n"
  },
  {
    "path": "storybook/stories/CustomMenuList.stories.tsx",
    "content": "import type { ComponentMeta } from '@storybook/react';\nimport * as React from 'react';\nimport Select, { components, MenuListProps } from 'react-select';\n\nimport { Field } from '../components';\nimport {\n  ColourOption,\n  colourOptions,\n  FlavourOption,\n  GroupedOption,\n  groupedOptions,\n} from '../data';\n\nexport default {\n  title: 'Select/CustomMenuList',\n  component: Select,\n  argTypes: {},\n} as ComponentMeta<typeof Select>;\n\nexport function CustomMenuList() {\n  return (\n    <Field label=\"Custom Menu List\" htmlFor=\"custom-menu-list-id\">\n      <Select<ColourOption | FlavourOption, false, GroupedOption>\n        inputId=\"custom-menu-list-id\"\n        defaultValue={colourOptions[1]}\n        options={groupedOptions}\n        components={{ MenuList }}\n      />\n    </Field>\n  );\n}\n\n// =============================================================================\n// Components\n// =============================================================================\n\nfunction MenuList(\n  props: MenuListProps<ColourOption | FlavourOption, false, GroupedOption>\n) {\n  return (\n    <components.MenuList {...props}>\n      <div\n        style={{\n          background: colourOptions[2].color,\n          color: 'white',\n          padding: '8px 12px',\n        }}\n      >\n        Custom Menu List\n      </div>\n      {props.children}\n    </components.MenuList>\n  );\n}\n"
  },
  {
    "path": "storybook/stories/CustomMultiValueContainer.stories.tsx",
    "content": "import type { ComponentMeta } from '@storybook/react';\nimport * as React from 'react';\nimport Tooltip from '@atlaskit/tooltip';\nimport Select, {\n  components,\n  MultiValueGenericProps,\n  StylesConfig,\n} from 'react-select';\n\nimport { Field } from '../components';\nimport { ColourOption, colourOptions } from '../data';\n\nexport default {\n  title: 'Select/CustomMultiValueContainer',\n  component: Select,\n  argTypes: {},\n} as ComponentMeta<typeof Select>;\n\nexport function CustomMultiValueContainer() {\n  return (\n    <Field\n      label=\"CustomMultiValueContainer\"\n      htmlFor=\"custom-multi-value-container-id\"\n    >\n      <Select\n        inputId=\"custom-multi-value-container-id\"\n        closeMenuOnSelect={false}\n        components={{ MultiValueContainer }}\n        defaultValue={[colourOptions[4], colourOptions[5]]}\n        isMulti\n        options={colourOptions}\n        styles={styles}\n      />\n    </Field>\n  );\n}\n\n// =============================================================================\n// Styles\n// =============================================================================\n\nconst styles: StylesConfig<ColourOption> = {\n  multiValue: (base) => ({\n    ...base,\n    border: `2px dotted ${colourOptions[2].color}`,\n  }),\n};\n\n// =============================================================================\n// Components\n// =============================================================================\n\nfunction MultiValueContainer(props: MultiValueGenericProps<ColourOption>) {\n  return (\n    <Tooltip content=\"Customise your multi-value container!\">\n      <components.MultiValueContainer {...props} />\n    </Tooltip>\n  );\n}\n"
  },
  {
    "path": "storybook/stories/CustomMultiValueLabel.stories.tsx",
    "content": "import Tooltip from '@atlaskit/tooltip';\nimport type { ComponentMeta } from '@storybook/react';\nimport * as React from 'react';\nimport Select, {\n  components,\n  MultiValueGenericProps,\n  StylesConfig,\n} from 'react-select';\n\nimport { Field } from '../components';\nimport { ColourOption, colourOptions } from '../data';\n\nexport default {\n  title: 'Select/CustomMultiValueLabel',\n  component: Select,\n  argTypes: {},\n} as ComponentMeta<typeof Select>;\n\nexport function CustomMultiValueLabel() {\n  return (\n    <Field\n      label=\"Custom Multi Value Remove\"\n      htmlFor=\"custom-multi-value-remove-id\"\n    >\n      <Select\n        inputId=\"custom-multi-value-remove-id\"\n        components={{ MultiValueLabel }}\n        defaultValue={[colourOptions[4], colourOptions[5]]}\n        isMulti\n        options={colourOptions}\n        styles={styles}\n      />\n    </Field>\n  );\n}\n\n// =============================================================================\n// Styles\n// =============================================================================\n\nconst styles: StylesConfig<ColourOption> = {\n  multiValueLabel: (base) => ({\n    ...base,\n    backgroundColor: colourOptions[2].color,\n    color: 'white',\n  }),\n};\n\n// =============================================================================\n// Components\n// =============================================================================\n\nfunction MultiValueLabel(props: MultiValueGenericProps<ColourOption>) {\n  return (\n    <Tooltip content=\"Customise your multi-value label component!\">\n      <components.MultiValueLabel {...props} />\n    </Tooltip>\n  );\n}\n"
  },
  {
    "path": "storybook/stories/CustomMultiValueRemove.stories.tsx",
    "content": "import EmojiIcon from '@atlaskit/icon/glyph/emoji';\nimport Tooltip from '@atlaskit/tooltip';\nimport type { ComponentMeta } from '@storybook/react';\nimport * as React from 'react';\nimport Select, {\n  components,\n  MultiValueRemoveProps,\n  StylesConfig,\n} from 'react-select';\nimport { ColourOption, colourOptions } from '../data';\nimport { Field } from '../components';\n\nexport default {\n  title: 'Select/CustomMultiValueRemove',\n  component: Select,\n  argTypes: {},\n} as ComponentMeta<typeof Select>;\n\nexport function CustomMultiValueRemove() {\n  return (\n    <Field\n      label=\"Custom Multi Value Remove\"\n      htmlFor=\"custom-multi-value-remove-id\"\n    >\n      <Select\n        inputId=\"custom-multi-value-remove-id\"\n        components={{ MultiValueRemove }}\n        defaultValue={[colourOptions[4], colourOptions[5]]}\n        isMulti\n        options={colourOptions}\n        styles={styles}\n      />\n    </Field>\n  );\n}\n\n// =============================================================================\n// Styles\n// =============================================================================\n\nconst styles: StylesConfig<ColourOption> = {\n  multiValueRemove: (base) => ({\n    ...base,\n    border: `1px dotted ${colourOptions[2].color}`,\n    height: '100%',\n  }),\n};\n\n// =============================================================================\n// Components\n// =============================================================================\n\nfunction MultiValueRemove(props: MultiValueRemoveProps<ColourOption>) {\n  return (\n    <Tooltip content={'Customise your multi-value remove component!'} truncate>\n      <components.MultiValueRemove {...props}>\n        <EmojiIcon label=\"Emoji\" primaryColor={colourOptions[2].color} />\n      </components.MultiValueRemove>\n    </Tooltip>\n  );\n}\n"
  },
  {
    "path": "storybook/stories/CustomNoOptionsMessage.stories.tsx",
    "content": "import Tooltip from '@atlaskit/tooltip';\nimport { ComponentMeta } from '@storybook/react';\nimport * as React from 'react';\nimport Select, { components, NoticeProps, StylesConfig } from 'react-select';\n\nimport { Field } from '../components';\nimport { colourOptions } from '../data';\n\nexport default {\n  title: 'Select/CustomNoOptionsMessage',\n  component: Select,\n  argTypes: {},\n} as ComponentMeta<typeof Select>;\n\nexport function CustomNoOptionsMessage() {\n  return (\n    <Field\n      label=\"Custom No Options Message\"\n      htmlFor=\"custom-no-options-message-id\"\n    >\n      <Select\n        inputId=\"custom-no-options-message-id\"\n        components={{ NoOptionsMessage }}\n        styles={styles}\n        options={[]}\n      />\n    </Field>\n  );\n}\n\n// =============================================================================\n// Styles\n// =============================================================================\n\nconst styles: StylesConfig = {\n  noOptionsMessage: (base) => ({\n    ...base,\n    background: colourOptions[2].color,\n    color: 'white',\n  }),\n};\n\n// =============================================================================\n// Components\n// =============================================================================\n\nfunction NoOptionsMessage(props: NoticeProps) {\n  return (\n    <Tooltip content=\"Custom NoOptionsMessage Component\">\n      <components.NoOptionsMessage {...props} />\n    </Tooltip>\n  );\n}\n"
  },
  {
    "path": "storybook/stories/CustomOption.stories.tsx",
    "content": "import Tooltip from '@atlaskit/tooltip';\nimport { ComponentMeta } from '@storybook/react';\nimport * as React from 'react';\nimport Select, { components, OptionProps, StylesConfig } from 'react-select';\n\nimport { Field } from '../components';\nimport { ColourOption, colourOptions } from '../data';\n\nexport default {\n  title: 'Select/CustomOption',\n  component: Select,\n  argTypes: {},\n} as ComponentMeta<typeof Select>;\n\nexport function CustomOption() {\n  return (\n    <Field label=\"Custom Option\" htmlFor=\"custom-option-id\">\n      <Select\n        inputId=\"custom-option-id\"\n        components={{ Option }}\n        options={colourOptions}\n        styles={styles}\n      />\n    </Field>\n  );\n}\n\n// =============================================================================\n// Styles\n// =============================================================================\n\nconst styles: StylesConfig<ColourOption> = {\n  option: (base) => ({\n    ...base,\n    border: `1px dotted ${colourOptions[2].color}`,\n    height: '100%',\n  }),\n};\n\n// =============================================================================\n// Components\n// =============================================================================\n\nfunction Option(props: OptionProps<ColourOption>) {\n  return (\n    <Tooltip content=\"Customise your option component!\" position=\"top\" truncate>\n      <components.Option {...props} />\n    </Tooltip>\n  );\n}\n"
  },
  {
    "path": "storybook/stories/CustomPlaceholder.stories.tsx",
    "content": "import type { ComponentMeta } from '@storybook/react';\nimport * as React from 'react';\nimport Select, {\n  components,\n  PlaceholderProps,\n  StylesConfig,\n} from 'react-select';\n\nimport { Field } from '../components';\nimport { ColourOption, colourOptions } from '../data';\n\nexport default {\n  title: 'Select/CustomPlaceholder',\n  component: Select,\n  argTypes: {},\n} as ComponentMeta<typeof Select>;\n\nexport function CustomPlaceholder() {\n  return (\n    <Field label=\"Custom Placeholder\" htmlFor=\"custom-placeholder-id\">\n      <Select\n        inputId=\"custom-placeholder-id\"\n        components={{ Placeholder }}\n        options={colourOptions}\n        placeholder={'custom placeholder component'}\n        styles={styles}\n      />\n    </Field>\n  );\n}\n\n// =============================================================================\n// Styles\n// =============================================================================\n\nconst styles: StylesConfig<ColourOption> = {\n  placeholder: (base) => ({\n    ...base,\n    fontSize: '1em',\n    color: colourOptions[2].color,\n    fontWeight: 400,\n  }),\n};\n\n// =============================================================================\n// Components\n// =============================================================================\n\nfunction Placeholder(props: PlaceholderProps<ColourOption>) {\n  return <components.Placeholder {...props} />;\n}\n"
  },
  {
    "path": "storybook/stories/CustomSelectContainer.stories.tsx",
    "content": "import Tooltip from '@atlaskit/tooltip';\nimport type { ComponentMeta } from '@storybook/react';\nimport * as React from 'react';\nimport Select, { components, ContainerProps, StylesConfig } from 'react-select';\nimport { Field } from '../components';\nimport { ColourOption, colourOptions } from '../data';\n\nexport default {\n  title: 'Select/CustomSelectContainer',\n  component: Select,\n  argTypes: {},\n} as ComponentMeta<typeof Select>;\n\nexport function CustomSelectContainer() {\n  return (\n    <Field label=\"Custom Select Container\" htmlFor=\"custom-select-container-id\">\n      <Select\n        inputId=\"custom-select-container-id\"\n        components={{ SelectContainer }}\n        options={colourOptions}\n        styles={styles}\n      />\n    </Field>\n  );\n}\n\n// =============================================================================\n// Styles\n// =============================================================================\n\nconst styles: StylesConfig<ColourOption> = {\n  container: (base) => ({\n    ...base,\n    backgroundColor: colourOptions[2].color,\n    padding: 5,\n  }),\n};\n\n// =============================================================================\n// Components\n// =============================================================================\n\nfunction SelectContainer({ children, ...props }: ContainerProps<ColourOption>) {\n  return (\n    <Tooltip content={'customise your select container'} delay={0}>\n      <components.SelectContainer {...props}>\n        {children}\n      </components.SelectContainer>\n    </Tooltip>\n  );\n}\n"
  },
  {
    "path": "storybook/stories/CustomSelectProps.stories.tsx",
    "content": "import type { ComponentMeta } from '@storybook/react';\nimport * as React from 'react';\nimport Select, {\n  components,\n  ControlProps,\n  Props,\n  StylesConfig,\n} from 'react-select';\nimport { Field } from '../components';\nimport { ColourOption, colourOptions, EMOJIS } from '../data';\n\nexport default {\n  title: 'Select/CustomSelectProps',\n  component: Select,\n  argTypes: {},\n} as ComponentMeta<typeof Select>;\n\nexport function CustomSelectProps(props: Props<ColourOption>) {\n  const [clickCount, setClickCount] = React.useState(0);\n\n  function onClick(event: React.MouseEvent<HTMLSpanElement, MouseEvent>) {\n    setClickCount(clickCount + 1);\n    event.preventDefault();\n    event.stopPropagation();\n  }\n\n  const emoji = EMOJIS[clickCount % EMOJIS.length];\n\n  return (\n    <Field label=\"Custom Select Props\" htmlFor=\"custom-select-props-id\">\n      <Select\n        {...props}\n        components={{ Control }}\n        inputId=\"custom-select-props-id\"\n        isSearchable\n        options={colourOptions}\n        styles={styles}\n        // @ts-ignore\n        emoji={emoji}\n        onEmojiClick={onClick}\n      />\n    </Field>\n  );\n}\n\n// =============================================================================\n// Styles\n// =============================================================================\n\nconst styles: StylesConfig<ColourOption> = {\n  control: (css) => ({ ...css, paddingLeft: '1rem' }),\n};\n\n// =============================================================================\n// Components\n// =============================================================================\n\nfunction Control({ children, ...props }: ControlProps<ColourOption>) {\n  // @ts-ignore\n  const { emoji, onEmojiClick } = props.selectProps;\n  const style = { cursor: 'pointer' };\n\n  return (\n    <components.Control {...props}>\n      <span onMouseDown={onEmojiClick} style={style}>\n        {emoji}\n      </span>\n      {children}\n    </components.Control>\n  );\n}\n"
  },
  {
    "path": "storybook/stories/CustomSingleValue.stories.tsx",
    "content": "import { ComponentMeta } from '@storybook/react';\nimport * as React from 'react';\nimport Select, {\n  components,\n  SingleValueProps,\n  StylesConfig,\n} from 'react-select';\nimport { Field } from '../components';\nimport { ColourOption, colourOptions } from '../data';\n\nexport default {\n  title: 'Select/CustomSingleValue',\n  component: Select,\n  argTypes: {},\n} as ComponentMeta<typeof Select>;\n\nexport function CustomSingleValue() {\n  return (\n    <Field label=\"Custom Single Value\" htmlFor=\"custom-single-value-id\">\n      <Select\n        inputId=\"custom-single-value-id\"\n        components={{ SingleValue }}\n        defaultValue={colourOptions[0]}\n        isClearable\n        isSearchable\n        options={colourOptions}\n        styles={styles}\n      />\n    </Field>\n  );\n}\n\n// =============================================================================\n// Styles\n// =============================================================================\n\nconst styles: StylesConfig<ColourOption> = {\n  singleValue: (base) => ({\n    ...base,\n    padding: 5,\n    borderRadius: 5,\n    background: colourOptions[2].color,\n    color: 'white',\n    display: 'flex',\n  }),\n};\n\n// =============================================================================\n// Components\n// =============================================================================\n\nfunction SingleValue({ children, ...props }: SingleValueProps<ColourOption>) {\n  return <components.SingleValue {...props}>{children}</components.SingleValue>;\n}\n"
  },
  {
    "path": "storybook/stories/CustomValueContainer.stories.tsx",
    "content": "import type { ComponentMeta } from '@storybook/react';\nimport * as React from 'react';\nimport Select, {\n  components,\n  StylesConfig,\n  ValueContainerProps,\n} from 'react-select';\n\nimport { Field } from '../components';\nimport { ColourOption, colourOptions } from '../data';\n\nexport default {\n  title: 'Select/CustomValueContainer',\n  component: Select,\n  argTypes: {},\n} as ComponentMeta<typeof Select>;\n\nexport function CustomValueContainer() {\n  return (\n    <Field label=\"Custom Value Container\" htmlFor=\"custom-value-container-id\">\n      <Select\n        inputId=\"custom-value-container-id\"\n        components={{ ValueContainer }}\n        defaultValue={colourOptions[0]}\n        isClearable\n        isSearchable\n        options={colourOptions}\n        styles={styles}\n      />\n    </Field>\n  );\n}\n\n// =============================================================================\n// Styles\n// =============================================================================\n\nconst styles: StylesConfig<ColourOption> = {\n  singleValue: (base) => ({ ...base, color: 'white' }),\n  valueContainer: (base) => ({\n    ...base,\n    background: colourOptions[2].color,\n    color: 'white',\n    width: '100%',\n  }),\n};\n\n// =============================================================================\n// Components\n// =============================================================================\n\nfunction ValueContainer({\n  children,\n  ...props\n}: ValueContainerProps<ColourOption>) {\n  return (\n    <components.ValueContainer {...props}>{children}</components.ValueContainer>\n  );\n}\n"
  },
  {
    "path": "storybook/stories/ExperimentalDatePicker.stories.tsx",
    "content": "/** @jsx jsx */\nimport { jsx } from '@emotion/react';\nimport { CSSObject } from '@emotion/serialize';\nimport type { ComponentMeta } from '@storybook/react';\nimport * as chrono from 'chrono-node';\nimport moment, { Moment } from 'moment';\nimport { useState } from 'react';\nimport Select, {\n  components as SelectComponents,\n  GroupProps,\n  OptionProps,\n} from 'react-select';\nimport { Field } from '../components';\n\nexport default {\n  title: 'Select/ExperimentalDatePicker',\n  component: Select,\n  argTypes: {},\n} as ComponentMeta<typeof Select>;\n\nexport function ExperimentalDatePicker() {\n  const [value, setValue] = useState<DateOption | null>(\n    defaultOptions[0] as DateOption\n  );\n  const [options, setOptions] = useState(defaultOptions);\n\n  function handleInputChange(val: string) {\n    if (!val) {\n      setOptions(defaultOptions);\n      return;\n    }\n    const date = chrono.parseDate(suggest(val.toLowerCase()));\n    if (!date) {\n      setOptions([]);\n      return;\n    }\n    setOptions([createOptionForDate(date), createCalendarOptions(date)]);\n  }\n\n  return (\n    <Field label=\"ExperimentalDatePicker\" htmlFor=\"experimental-date-picker-id\">\n      <Select<DateOption, false>\n        inputId=\"experimental-date-picker-id\"\n        components={{ Group, Option }}\n        filterOption={null}\n        isMulti={false}\n        isOptionSelected={(o, v) => v.some((i) => i.date.isSame(o.date, 'day'))}\n        maxMenuHeight={380}\n        onChange={(newValue) => setValue(newValue)}\n        onInputChange={handleInputChange}\n        options={options}\n        value={value}\n      />\n    </Field>\n  );\n}\n\n// =============================================================================\n// Components\n// =============================================================================\n\nfunction Group(props: GroupProps<DateOption, false>) {\n  const {\n    Heading,\n    getStyles,\n    children,\n    label,\n    headingProps,\n    cx,\n    theme,\n    selectProps,\n  } = props;\n  return (\n    <div aria-label={label as string} css={getStyles('group', props)}>\n      <Heading\n        selectProps={selectProps}\n        theme={theme}\n        getStyles={getStyles}\n        cx={cx}\n        {...headingProps}\n      >\n        {label}\n      </Heading>\n      <div css={daysHeaderStyles}>\n        {days.map((day, i) => (\n          <span key={`${i}-${day}`} css={daysHeaderItemStyles}>\n            {day}\n          </span>\n        ))}\n      </div>\n      <div css={daysContainerStyles}>{children}</div>\n    </div>\n  );\n}\n\nfunction Option(props: OptionProps<DateOption, false>) {\n  const { data, getStyles, innerRef, innerProps } = props;\n  if (data.display === 'calendar') {\n    const defaultStyles = getStyles('option', props);\n    const styles = getOptionStyles(defaultStyles);\n\n    if (data.date.date() === 1) {\n      const indentBy = data.date.day();\n      if (indentBy) {\n        styles.marginLeft = `${indentBy * 14 + 1}%`;\n      }\n    }\n\n    return (\n      <span {...innerProps} css={styles} ref={innerRef}>\n        {data.date.format('D')}\n      </span>\n    );\n  }\n  return <SelectComponents.Option {...props} />;\n}\n\n// =============================================================================\n// Utils\n// =============================================================================\n\nfunction createOptionForDate(d: Moment | Date) {\n  const date = moment.isMoment(d) ? d : moment(d);\n  return {\n    date,\n    value: date.toDate(),\n    label: date.calendar(null, {\n      sameDay: '[Today] (Do MMM YYYY)',\n      nextDay: '[Tomorrow] (Do MMM YYYY)',\n      nextWeek: '[Next] dddd (Do MMM YYYY)',\n      lastDay: '[Yesterday] (Do MMM YYYY)',\n      lastWeek: '[Last] dddd (Do MMM YYYY)',\n      sameElse: 'Do MMMM YYYY',\n    }),\n  };\n}\n\nconst defaultOptions: (DateOption | CalendarGroup)[] = [\n  'today',\n  'tomorrow',\n  'yesterday',\n].map((i) => createOptionForDate(chrono.parseDate(i)));\n\nfunction createCalendarOptions(date = new Date()) {\n  const daysInMonth = Array.apply(null, Array(moment(date).daysInMonth())).map(\n    (x, i) => {\n      const d = moment(date).date(i + 1);\n      return { ...createOptionForDate(d), display: 'calendar' };\n    }\n  );\n  return {\n    label: moment(date).format('MMMM YYYY'),\n    options: daysInMonth,\n  };\n}\n\ndefaultOptions.push(createCalendarOptions());\n\nconst suggestions = [\n  'sunday',\n  'saturday',\n  'friday',\n  'thursday',\n  'wednesday',\n  'tuesday',\n  'monday',\n  'december',\n  'november',\n  'october',\n  'september',\n  'august',\n  'july',\n  'june',\n  'may',\n  'april',\n  'march',\n  'february',\n  'january',\n  'yesterday',\n  'tomorrow',\n  'today',\n].reduce<{ [key: string]: string }>((acc, str) => {\n  for (let i = 1; i < str.length; i++) {\n    acc[str.substr(0, i)] = str;\n  }\n  return acc;\n}, {});\n\nfunction suggest(str: string) {\n  return str\n    .split(/\\b/)\n    .map((i) => suggestions[i] || i)\n    .join('');\n}\n\nconst days = ['S', 'M', 'T', 'W', 'T', 'F', 'S'];\n\nconst daysHeaderStyles: CSSObject = {\n  marginTop: '5px',\n  paddingTop: '5px',\n  paddingLeft: '2%',\n  borderTop: '1px solid #eee',\n};\nconst daysHeaderItemStyles: CSSObject = {\n  color: '#999',\n  cursor: 'default',\n  fontSize: '75%',\n  fontWeight: 500,\n  display: 'inline-block',\n  width: '12%',\n  margin: '0 1%',\n  textAlign: 'center',\n};\nconst daysContainerStyles: CSSObject = {\n  paddingTop: '5px',\n  paddingLeft: '2%',\n};\n\nfunction getOptionStyles(defaultStyles: CSSObject): CSSObject {\n  return {\n    ...defaultStyles,\n    display: 'inline-block',\n    width: '12%',\n    margin: '0 1%',\n    textAlign: 'center',\n    borderRadius: '4px',\n  };\n}\n\n// =============================================================================\n// Types\n// =============================================================================\n\ninterface DateOption {\n  date: Moment;\n  value: Date;\n  label: string;\n  display?: string;\n}\n\ninterface CalendarGroup {\n  label: string;\n  options: readonly DateOption[];\n}\n"
  },
  {
    "path": "storybook/stories/FixedOptions.stories.tsx",
    "content": "import { ComponentMeta } from '@storybook/react';\nimport * as React from 'react';\nimport Select, { ActionMeta, OnChangeValue, StylesConfig } from 'react-select';\nimport { Field } from '../components';\n\nimport { ColourOption, colourOptions } from '../data';\n\nexport default {\n  title: 'Select/FixedOptions',\n  component: Select,\n  argTypes: {},\n} as ComponentMeta<typeof Select>;\n\nexport function FixedOptions() {\n  const [value, setValue] = React.useState<readonly ColourOption[]>(\n    orderOptions([colourOptions[0], colourOptions[1], colourOptions[3]])\n  );\n\n  function handleChange(\n    newValue: OnChangeValue<ColourOption, true>,\n    actionMeta: ActionMeta<ColourOption>\n  ) {\n    switch (actionMeta.action) {\n      case 'remove-value':\n      case 'pop-value':\n        if (actionMeta.removedValue.isFixed) {\n          return;\n        }\n        break;\n      case 'clear':\n        newValue = colourOptions.filter((v) => v.isFixed);\n        break;\n    }\n\n    setValue(orderOptions(newValue));\n  }\n\n  return (\n    <Field label=\"Fixed options\" htmlFor=\"fixed-options-id\">\n      <Select\n        inputId=\"fixed-options-id\"\n        isClearable={value.some((v) => !v.isFixed)}\n        isMulti\n        onChange={handleChange}\n        options={colourOptions}\n        styles={styles}\n        value={value}\n      />\n    </Field>\n  );\n}\n\n// =============================================================================\n// Styles\n// =============================================================================\n\nconst styles: StylesConfig<ColourOption, true> = {\n  multiValue: (base, state) => {\n    return state.data.isFixed ? { ...base, backgroundColor: 'gray' } : base;\n  },\n  multiValueLabel: (base, state) => {\n    return state.data.isFixed\n      ? { ...base, fontWeight: 'bold', color: 'white', paddingRight: 6 }\n      : base;\n  },\n  multiValueRemove: (base, state) => {\n    return state.data.isFixed ? { ...base, display: 'none' } : base;\n  },\n};\n\n// =============================================================================\n// Utils\n// =============================================================================\n\nfunction orderOptions(values: readonly ColourOption[]) {\n  return values\n    .filter((v) => v.isFixed)\n    .concat(values.filter((v) => !v.isFixed));\n}\n"
  },
  {
    "path": "storybook/stories/Grouped.stories.tsx",
    "content": "import { ComponentMeta, ComponentStory } from '@storybook/react';\nimport * as React from 'react';\nimport Select from 'react-select';\n\nimport { Field } from '../components';\nimport { defaultArgs, groupedOptions } from '../data';\n\nexport default {\n  title: 'Select/Grouped',\n  component: Select,\n  argTypes: {},\n} as ComponentMeta<typeof Select>;\n\nconst Template: ComponentStory<typeof Select> = ({\n  inputId = 'react-select',\n  ...props\n}) => {\n  return (\n    <Field\n      htmlFor={inputId}\n      label=\"Grouped\"\n      secondaryLabel=\"Options can be grouped if the value of the option key is an array of options instead of a string.\"\n    >\n      <Select {...props} inputId={inputId} />\n    </Field>\n  );\n};\n\nexport const Grouped = Template.bind({});\nGrouped.args = {\n  ...defaultArgs,\n  options: groupedOptions,\n};\n"
  },
  {
    "path": "storybook/stories/MenuBuffer.stories.tsx",
    "content": "import type { ComponentMeta } from '@storybook/react';\nimport * as React from 'react';\nimport Select, { StylesConfig } from 'react-select';\nimport { Field } from '../components';\n\nimport { colourOptions, StateOption } from '../data';\n\nexport default {\n  title: 'Select/MenuBuffer',\n  component: Select,\n  argTypes: {},\n} as ComponentMeta<typeof Select>;\n\nexport function MenuBuffer() {\n  return (\n    <Field\n      label=\"Menu Buffer\"\n      secondaryLabel=\"Using the style API to replace `menuBuffer`\"\n      htmlFor=\"menu-buffer-id\"\n    >\n      <Select\n        defaultValue={colourOptions[0]}\n        options={colourOptions}\n        styles={selectStyles}\n      />\n    </Field>\n  );\n}\n\nconst selectStyles: StylesConfig<StateOption, false> = {\n  menu: (base) => ({ ...base, marginBottom: 76 }),\n};\n"
  },
  {
    "path": "storybook/stories/MenuPortal.stories.tsx",
    "content": "import Button from '@atlaskit/button/standard-button';\nimport Modal from '@atlaskit/modal-dialog';\nimport type { ComponentMeta } from '@storybook/react';\nimport * as React from 'react';\nimport Select, {\n  defaultTheme,\n  MenuPlacement,\n  StylesConfig,\n} from 'react-select';\n\nimport { ChevronDown, Field, Inline, Stack } from '../components';\nimport { ColourOption, colourOptions } from '../data';\n\nexport default {\n  title: 'Select/MenuPortal',\n  component: Select,\n  argTypes: {},\n} as ComponentMeta<typeof Select>;\n\nexport function MenuPortal() {\n  const [isModalOpen, setIsModalOpen] = React.useState(false);\n  const [isFixed, setIsFixed] = React.useState(false);\n  const [menuPlacement, setMenuPlacement] =\n    React.useState<MenuPlacement>('bottom');\n\n  const component = React.useMemo(() => {\n    if (!isModalOpen) return null;\n    return (\n      <Modal onClose={() => setIsModalOpen(false)}>\n        <Stack\n          style={{\n            fontFamily: 'system-ui',\n            paddingTop: '6rem',\n            paddingBottom: '6rem',\n          }}\n        >\n          <Field\n            label=\"Portaled Menu Element\"\n            htmlFor=\"portaled-menu-element-id\"\n          >\n            <Select\n              inputId=\"portaled-menu-element-id\"\n              defaultValue={colourOptions[0]}\n              options={colourOptions}\n              isClearable\n              isSearchable\n              menuPlacement={menuPlacement}\n              menuPortalTarget={document.body}\n              menuPosition={isFixed ? 'fixed' : 'absolute'}\n              menuShouldScrollIntoView={false}\n              styles={styles}\n            />\n          </Field>\n          <Inline gap=\"large\">\n            {/* Menu placement */}\n            <Field label=\"Menu Placement\" htmlFor=\"menu-placement-id\">\n              <Inline style={{ position: 'relative', alignItems: 'center' }}>\n                <ChevronDown\n                  style={{\n                    position: 'absolute',\n                    right: '0.75rem',\n                    top: '50%',\n                    transform: 'translateY(-50%)',\n                    pointerEvents: 'none',\n                    height: '1.5rem',\n                    width: '1.5rem',\n                  }}\n                />\n                <select\n                  id=\"menu-placement-id\"\n                  style={{\n                    fontSize: '1rem',\n                    display: 'block',\n                    appearance: 'none',\n                    border: `1px solid ${defaultTheme.colors.neutral20}`,\n                    width: '100%',\n                    borderRadius: '4px',\n                    height: '2.5rem',\n                    paddingLeft: '0.75rem',\n                    paddingRight: '2.5rem',\n                  }}\n                  onChange={(e) =>\n                    setMenuPlacement(e.currentTarget.value as MenuPlacement)\n                  }\n                  value={menuPlacement}\n                >\n                  <option value=\"auto\">auto</option>\n                  <option value=\"bottom\">bottom</option>\n                  <option value=\"top\">top</option>\n                </select>\n              </Inline>\n            </Field>\n            {/* Menu Position */}\n            <fieldset style={{ padding: 0, margin: 0, border: 'none' }}>\n              <legend\n                style={{\n                  fontWeight: 500,\n                  marginBottom: '0.5rem',\n                }}\n              >\n                Menu position\n              </legend>\n              <Inline gap=\"medium\">\n                {(['fixed', 'absolute'] as const).map((menuPosition) => (\n                  <Inline\n                    key={menuPosition}\n                    gap=\"small\"\n                    style={{ alignItems: 'center' }}\n                  >\n                    <input\n                      id={menuPosition}\n                      checked={menuPosition === 'fixed' ? isFixed : !isFixed}\n                      onChange={() => setIsFixed((prev) => !prev)}\n                      style={{\n                        borderRadius: '100%',\n                        height: '1.25rem',\n                        width: '1.25rem',\n                        margin: 0,\n                      }}\n                      type=\"radio\"\n                    />\n                    <label htmlFor={menuPosition} style={{ display: 'block' }}>\n                      {menuPosition}\n                    </label>\n                  </Inline>\n                ))}\n              </Inline>\n            </fieldset>\n          </Inline>\n        </Stack>\n      </Modal>\n    );\n  }, [isFixed, isModalOpen, menuPlacement]);\n\n  return (\n    <React.Fragment>\n      <Button onClick={() => setIsModalOpen(true)}>Open Modal</Button>\n      {component}\n    </React.Fragment>\n  );\n}\n\n// =============================================================================\n// Utils\n// =============================================================================\n\nconst styles: StylesConfig<ColourOption> = {\n  menuPortal: (base) => ({ ...base, zIndex: 9999 }),\n};\n"
  },
  {
    "path": "storybook/stories/MultiSelectSort.stories.tsx",
    "content": "import type { ComponentMeta } from '@storybook/react';\nimport * as React from 'react';\nimport Select, {\n  components,\n  MultiValueGenericProps,\n  MultiValueProps,\n  OnChangeValue,\n  Props,\n} from 'react-select';\nimport {\n  SortableContainer,\n  SortableContainerProps,\n  SortableElement,\n  SortableHandle,\n  SortEndHandler,\n} from 'react-sortable-hoc';\nimport { ColourOption, colourOptions } from '../data';\n\nexport default {\n  title: 'Select/MultiSelectSort',\n  component: Select,\n  argTypes: {},\n} as ComponentMeta<typeof Select>;\n\nexport function MultiSelectSort() {\n  const [selected, setSelected] = React.useState<readonly ColourOption[]>([\n    colourOptions[4],\n    colourOptions[5],\n  ]);\n\n  const onChange = (selectedOptions: OnChangeValue<ColourOption, true>) => {\n    setSelected(selectedOptions);\n  };\n\n  const onSortEnd: SortEndHandler = ({ oldIndex, newIndex }) => {\n    const newValue = arrayMove(selected, oldIndex, newIndex);\n    setSelected(newValue);\n    console.log(\n      'Values sorted:',\n      newValue.map((i) => i.value)\n    );\n  };\n\n  return (\n    <SortableSelect\n      useDragHandle\n      // react-sortable-hoc props:\n      axis=\"xy\"\n      onSortEnd={onSortEnd}\n      distance={4}\n      // small fix for https://github.com/clauderic/react-sortable-hoc/pull/352:\n      getHelperDimensions={({ node }) => node.getBoundingClientRect()}\n      // react-select props:\n      isMulti\n      options={colourOptions}\n      value={selected}\n      onChange={onChange}\n      components={{\n        // @ts-ignore We're failing to provide a required index prop to SortableElement\n        MultiValue: SortableMultiValue,\n        MultiValueLabel: SortableMultiValueLabel,\n      }}\n      closeMenuOnSelect={false}\n    />\n  );\n}\n\n// =============================================================================\n// Utils\n// =============================================================================\n\nfunction arrayMove<T>(array: readonly T[], from: number, to: number) {\n  const slicedArray = array.slice();\n  slicedArray.splice(\n    to < 0 ? array.length + to : to,\n    0,\n    slicedArray.splice(from, 1)[0]\n  );\n  return slicedArray;\n}\n\n// =============================================================================\n// Styled components\n// =============================================================================\n\nconst SortableMultiValue = SortableElement(\n  (props: MultiValueProps<ColourOption>) => {\n    // this prevents the menu from being opened/closed when the user clicks\n    // on a value to begin dragging it. ideally, detecting a click (instead of\n    // a drag) would still focus the control and toggle the menu, but that\n    // requires some magic with refs that are out of scope for this example\n    function onMouseDown(event: React.MouseEvent<HTMLDivElement, MouseEvent>) {\n      event.preventDefault();\n      event.stopPropagation();\n    }\n    const innerProps = { ...props.innerProps, onMouseDown };\n    return <components.MultiValue {...props} innerProps={innerProps} />;\n  }\n);\n\nconst SortableMultiValueLabel = SortableHandle(\n  (props: MultiValueGenericProps) => <components.MultiValueLabel {...props} />\n);\n\nconst SortableSelect = SortableContainer(Select) as React.ComponentClass<\n  Props<ColourOption, true> & SortableContainerProps\n>;\n"
  },
  {
    "path": "storybook/stories/OnSelectKeepsInput.stories.tsx",
    "content": "import type { ComponentMeta } from '@storybook/react';\nimport * as React from 'react';\nimport Select, { InputActionMeta } from 'react-select';\n\nimport { Field } from '../components';\nimport { colourOptions } from '../data';\n\nexport default {\n  title: 'Select/OnSelectKeepsInput',\n  component: Select,\n  argTypes: {},\n} as ComponentMeta<typeof Select>;\n\nexport function OnSelectKeepsInput() {\n  const [menuIsOpen, setMenuIsOpen] = React.useState<boolean>();\n\n  function handleInputChange(\n    inputValue: string,\n    { action, prevInputValue }: InputActionMeta\n  ) {\n    if (action === 'input-change') return inputValue;\n    if (action === 'menu-close') {\n      if (prevInputValue) {\n        setMenuIsOpen(true);\n      } else {\n        setMenuIsOpen(undefined);\n      }\n    }\n    return prevInputValue;\n  }\n\n  return (\n    <Field\n      htmlFor=\"on-select-keeps-input\"\n      label=\"On Select Keeps Input\"\n      secondaryLabel=\"In this example, if you type in the input and then select an option, your search query will not be cleared.\"\n    >\n      <Select\n        inputId=\"on-select-keeps-input\"\n        isMulti\n        defaultValue={colourOptions[0]}\n        isClearable\n        isSearchable\n        onInputChange={handleInputChange}\n        name=\"color\"\n        options={colourOptions}\n        menuIsOpen={menuIsOpen}\n      />\n    </Field>\n  );\n}\n"
  },
  {
    "path": "storybook/stories/Popout.stories.tsx",
    "content": "import Button from '@atlaskit/button/standard-button';\nimport type { ComponentMeta } from '@storybook/react';\nimport * as React from 'react';\nimport Select, { defaultTheme, StylesConfig } from 'react-select';\n\nimport { ChevronDown, Svg } from '../components';\nimport { StateOption, stateOptions } from '../data';\n\nexport default {\n  title: 'Select/Popout',\n  component: Select,\n  argTypes: {},\n} as ComponentMeta<typeof Select>;\n\nexport function Popout() {\n  const [isOpen, setIsOpen] = React.useState(false);\n  const [value, setValue] = React.useState<StateOption | null>(null);\n\n  return (\n    <Dropdown\n      isOpen={isOpen}\n      onClose={() => setIsOpen(false)}\n      target={\n        <Button\n          iconAfter={<ChevronDown />}\n          onClick={() => setIsOpen((prev) => !prev)}\n        >\n          {value ? `State: ${value.label}` : 'Select a State'}\n        </Button>\n      }\n    >\n      <Select\n        autoFocus\n        backspaceRemovesValue={false}\n        components={{ DropdownIndicator, IndicatorSeparator: null }}\n        controlShouldRenderValue={false}\n        hideSelectedOptions={false}\n        isClearable={false}\n        menuIsOpen\n        onChange={(newValue) => {\n          setValue(newValue);\n          setIsOpen(false);\n        }}\n        options={stateOptions}\n        placeholder=\"Search...\"\n        styles={selectStyles}\n        tabSelectsValue={false}\n        value={value}\n      />\n    </Dropdown>\n  );\n}\n\n// =============================================================================\n// Styles\n// =============================================================================\n\nconst selectStyles: StylesConfig<StateOption, false> = {\n  control: (provided) => ({\n    ...provided,\n    minWidth: 240,\n    margin: 8,\n  }),\n  menu: () => ({ boxShadow: 'inset 0 1px 0 rgba(0, 0, 0, 0.1)' }),\n};\n\n// =============================================================================\n// Styled components\n// =============================================================================\n\nfunction Menu(props: JSX.IntrinsicElements['div']) {\n  const shadow = 'hsla(218, 50%, 10%, 0.1)';\n  return (\n    <div\n      style={{\n        backgroundColor: '#fff',\n        borderRadius: 4,\n        boxShadow: `0 0 0 1px ${shadow}, 0 4px 11px ${shadow}`,\n        marginTop: 8,\n        position: 'absolute',\n        zIndex: 1,\n      }}\n      {...props}\n    />\n  );\n}\n\nfunction Blanket(props: JSX.IntrinsicElements['div']) {\n  return (\n    <div\n      style={{\n        bottom: 0,\n        left: 0,\n        top: 0,\n        right: 0,\n        position: 'fixed',\n        zIndex: 1,\n      }}\n      {...props}\n    />\n  );\n}\n\nfunction Dropdown({\n  children,\n  isOpen,\n  target,\n  onClose,\n}: {\n  children?: React.ReactNode;\n  readonly isOpen: boolean;\n  readonly target: React.ReactNode;\n  readonly onClose: () => void;\n}) {\n  return (\n    <div className=\"relative\">\n      {target}\n      {isOpen ? <Blanket onClick={onClose} /> : null}\n      {isOpen ? <Menu>{children}</Menu> : null}\n    </div>\n  );\n}\n\nfunction DropdownIndicator() {\n  return (\n    <div\n      style={{ color: defaultTheme.colors.neutral20, height: 24, width: 32 }}\n    >\n      <Svg>\n        <path\n          d=\"M16.436 15.085l3.94 4.01a1 1 0 0 1-1.425 1.402l-3.938-4.006a7.5 7.5 0 1 1 1.423-1.406zM10.5 16a5.5 5.5 0 1 0 0-11 5.5 5.5 0 0 0 0 11z\"\n          fill=\"currentColor\"\n          fillRule=\"evenodd\"\n        />\n      </Svg>\n    </div>\n  );\n}\n"
  },
  {
    "path": "storybook/stories/StyleCompositionExample.stories.tsx",
    "content": "/** @jsx jsx */\nimport { jsx } from '@emotion/react';\nimport type { ComponentMeta } from '@storybook/react';\nimport Select, { OptionProps, StylesConfig } from 'react-select';\n\nimport { Field } from '../components';\nimport { ColourOption, colourOptions } from '../data';\n\nexport default {\n  title: 'Select/StyleCompositionExample',\n  component: Select,\n  argTypes: {},\n} as ComponentMeta<typeof Select>;\n\nexport function StyleCompositionExample() {\n  return (\n    <Field label=\"Style Composition\" htmlFor=\"style-composition-id\">\n      <Select\n        inputId=\"style-composition-id\"\n        closeMenuOnSelect={false}\n        components={{ Option }}\n        styles={styles}\n        defaultValue={colourOptions[4]}\n        options={colourOptions}\n      />\n    </Field>\n  );\n}\n\n// =============================================================================\n// Styles\n// =============================================================================\n\nconst styles: StylesConfig<ColourOption> = {\n  option: (base) => ({\n    ...base,\n    border: `1px dotted ${colourOptions[2].color}`,\n    height: '100%',\n  }),\n};\n\n// =============================================================================\n// Components\n// =============================================================================\n\nfunction Option(props: OptionProps<ColourOption>) {\n  return (\n    <div\n      ref={props.innerRef}\n      css={props.getStyles('option', props)}\n      className={props.cx(\n        {\n          option: true,\n          'option--is-disabled': props.isDisabled,\n          'option--is-focused': props.isFocused,\n          'option--is-selected': props.isSelected,\n        },\n        props.className\n      )}\n      {...props.innerProps}\n    >\n      {props.children}\n    </div>\n  );\n}\n"
  },
  {
    "path": "storybook/stories/StyledMulti.stories.tsx",
    "content": "import type { ComponentMeta } from '@storybook/react';\nimport chroma from 'chroma-js';\nimport * as React from 'react';\nimport Select, { StylesConfig } from 'react-select';\n\nimport { Field } from '../components';\nimport { ColourOption, colourOptions } from '../data';\n\nexport default {\n  title: 'Select/StyledMulti',\n  component: Select,\n  argTypes: {},\n} as ComponentMeta<typeof Select>;\n\nconst colourStyles: StylesConfig<ColourOption, true> = {\n  control: (styles) => ({ ...styles, backgroundColor: 'white' }),\n  option: (styles, { data, isDisabled, isFocused, isSelected }) => {\n    const color = chroma(data.color);\n    return {\n      ...styles,\n      backgroundColor: isDisabled\n        ? undefined\n        : isSelected\n        ? data.color\n        : isFocused\n        ? color.alpha(0.1).css()\n        : undefined,\n      color: isDisabled\n        ? '#ccc'\n        : isSelected\n        ? chroma.contrast(color, 'white') > 2\n          ? 'white'\n          : 'black'\n        : data.color,\n      cursor: isDisabled ? 'not-allowed' : 'default',\n\n      ':active': {\n        ...styles[':active'],\n        backgroundColor: !isDisabled\n          ? isSelected\n            ? data.color\n            : color.alpha(0.3).css()\n          : undefined,\n      },\n    };\n  },\n  multiValue: (styles, { data }) => {\n    const color = chroma(data.color);\n    return {\n      ...styles,\n      backgroundColor: color.alpha(0.1).css(),\n    };\n  },\n  multiValueLabel: (styles, { data }) => ({\n    ...styles,\n    color: data.color,\n  }),\n  multiValueRemove: (styles, { data }) => ({\n    ...styles,\n    color: data.color,\n    ':hover': {\n      backgroundColor: data.color,\n      color: 'white',\n    },\n  }),\n};\n\nexport function StyledMulti() {\n  return (\n    <Field label=\"Styled Multi\" htmlFor=\"styled-multi-id\">\n      <Select\n        id=\"styled-multi-id\"\n        closeMenuOnSelect={false}\n        defaultValue={[colourOptions[0], colourOptions[1]]}\n        isMulti\n        options={colourOptions}\n        styles={colourStyles}\n      />\n    </Field>\n  );\n}\n"
  },
  {
    "path": "storybook/stories/StyledSingle.stories.tsx",
    "content": "import type { ComponentMeta } from '@storybook/react';\nimport chroma from 'chroma-js';\nimport * as React from 'react';\nimport Select, { StylesConfig } from 'react-select';\n\nimport { Field } from '../components';\nimport { ColourOption, colourOptions } from '../data';\n\nexport default {\n  title: 'Select/StyledSingle',\n  component: Select,\n  argTypes: {},\n} as ComponentMeta<typeof Select>;\n\nfunction dot(color = 'transparent') {\n  return {\n    alignItems: 'center',\n    display: 'flex',\n\n    ':before': {\n      backgroundColor: color,\n      borderRadius: 10,\n      content: '\" \"',\n      display: 'block',\n      marginRight: 8,\n      height: 10,\n      width: 10,\n    },\n  };\n}\n\nconst colourStyles: StylesConfig<ColourOption> = {\n  control: (styles) => ({ ...styles, backgroundColor: 'white' }),\n  option: (styles, { data, isDisabled, isFocused, isSelected }) => {\n    const color = chroma(data.color);\n    return {\n      ...styles,\n      backgroundColor: isDisabled\n        ? undefined\n        : isSelected\n        ? data.color\n        : isFocused\n        ? color.alpha(0.1).css()\n        : undefined,\n      color: isDisabled\n        ? '#ccc'\n        : isSelected\n        ? chroma.contrast(color, 'white') > 2\n          ? 'white'\n          : 'black'\n        : data.color,\n      cursor: isDisabled ? 'not-allowed' : 'default',\n\n      ':active': {\n        ...styles[':active'],\n        backgroundColor: !isDisabled\n          ? isSelected\n            ? data.color\n            : color.alpha(0.3).css()\n          : undefined,\n      },\n    };\n  },\n  input: (styles) => ({ ...styles, ...dot() }),\n  placeholder: (styles) => ({ ...styles, ...dot('#ccc') }),\n  singleValue: (styles, { data }) => ({ ...styles, ...dot(data.color) }),\n};\n\nexport function StyledSingle() {\n  return (\n    <Field label=\"Styled Single\" htmlFor=\"styled-single-id\">\n      <Select\n        inputId=\"styled-single-id\"\n        defaultValue={colourOptions[2]}\n        options={colourOptions}\n        styles={colourStyles}\n      />\n    </Field>\n  );\n}\n"
  },
  {
    "path": "storybook/stories/Tailwind.stories.tsx",
    "content": "import '../styles/tailwind.css';\n\nimport { ComponentMeta, ComponentStory } from '@storybook/react';\nimport classNames from 'classnames';\nimport * as React from 'react';\nimport type { GroupBase, OptionProps, ValueContainerProps } from 'react-select';\nimport Select, { components } from 'react-select';\nimport { omit } from 'remeda';\n\nimport { Field } from '../components';\nimport type { PersonOption } from '../data';\nimport { defaultArgs, people } from '../data';\n\nexport default {\n  title: 'Select/Tailwind',\n  component: Select,\n  argTypes: {},\n} as ComponentMeta<typeof Select>;\n\nfunction StatusCircle({ online }: { online?: boolean }) {\n  return (\n    <div\n      className={classNames(\n        online ? 'bg-green-500' : 'bg-gray-200',\n        'h-2 w-2 rounded-full'\n      )}\n    />\n  );\n}\n\nfunction CheckIcon(props: React.SVGProps<SVGSVGElement>) {\n  return (\n    <svg\n      xmlns=\"http://www.w3.org/2000/svg\"\n      viewBox=\"0 0 20 20\"\n      fill=\"currentColor\"\n      aria-hidden=\"true\"\n      {...props}\n    >\n      <path\n        fillRule=\"evenodd\"\n        d=\"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z\"\n        clipRule=\"evenodd\"\n      />\n    </svg>\n  );\n}\n\nfunction ValueContainer<\n  IsMulti extends boolean = false,\n  Group extends GroupBase<PersonOption> = GroupBase<PersonOption>\n>({ children, ...props }: ValueContainerProps<PersonOption, IsMulti, Group>) {\n  const { value, isMulti } = props.selectProps;\n  // @ts-expect-error selectProps can't infer `online` here.\n  const online: boolean = value?.online;\n\n  return (\n    <components.ValueContainer {...props}>\n      <span className=\"flex flex-1 items-center gap-2 text-left\">\n        {isMulti ? null : <StatusCircle online={online} />}\n        <span className=\"flex w-full items-center\">{children}</span>\n      </span>\n    </components.ValueContainer>\n  );\n}\n\nfunction Option<\n  IsMulti extends boolean = false,\n  Group extends GroupBase<PersonOption> = GroupBase<PersonOption>\n>({ children, ...props }: OptionProps<PersonOption, IsMulti, Group>) {\n  return (\n    <components.Option {...props}>\n      <span className=\"flex flex-1 items-center gap-2 text-left\">\n        <StatusCircle online={Boolean(props.data?.online)} />\n        <span className=\"flex w-full items-center\">{children}</span>\n        {/* @ts-expect-error selectProps can't infer `value` here. */}\n        {props.selectProps.value?.id === props.data.id && (\n          <CheckIcon className=\"h-5 w-5\" aria-hidden=\"true\" />\n        )}\n      </span>\n    </components.Option>\n  );\n}\n\nconst Template: ComponentStory<typeof Select> = ({\n  inputId = 'react-select',\n  ...props\n}) => {\n  const [value, setValue] = React.useState<PersonOption | null>(people[0]);\n\n  return (\n    <div className=\"p-4 bg-gray-100 flex flex-col gap-2\">\n      <Field htmlFor={inputId} label=\"Assigned to\">\n        {/* @ts-ignore */}\n        <Select<PersonOption>\n          {...props}\n          inputId={inputId}\n          components={{ ValueContainer, Option }}\n          options={people}\n          getOptionLabel={(option) => option.name}\n          getOptionValue={(option) => String(option.id)}\n          value={value}\n          onChange={(newValue) => setValue(newValue)}\n        />\n      </Field>\n      {value && !value.online ? (\n        <p className=\"text-gray-700\">User {value.name} is currently offline.</p>\n      ) : undefined}\n    </div>\n  );\n};\n\nexport const Tailwind = Template.bind({});\nTailwind.args = {\n  ...omit(defaultArgs, ['defaultValue', 'isMulti', 'options']),\n};\n"
  },
  {
    "path": "storybook/stories/Theme.stories.tsx",
    "content": "import type { ComponentMeta } from '@storybook/react';\nimport * as React from 'react';\nimport Select from 'react-select';\n\nimport { Field } from '../components';\nimport { flavourOptions } from '../data';\n\nexport default {\n  title: 'Select/Theme',\n  component: Select,\n  argTypes: {},\n} as ComponentMeta<typeof Select>;\n\nexport function Theme() {\n  return (\n    <Field label=\"Themed Select\" htmlFor=\"themed-select-id\">\n      <Select\n        inputId=\"themed-select-id\"\n        defaultValue={flavourOptions[2]}\n        options={flavourOptions}\n        theme={(theme) => ({\n          ...theme,\n          borderRadius: 0,\n          colors: {\n            ...theme.colors,\n            primary25: 'hotpink',\n            primary: 'black',\n          },\n        })}\n      />\n    </Field>\n  );\n}\n"
  },
  {
    "path": "storybook/stories/UnstyledWithTailwind.stories.tsx",
    "content": "import '../styles/tailwind.css';\n\nimport { ComponentMeta, ComponentStory } from '@storybook/react';\nimport classNames from 'classnames';\nimport * as React from 'react';\nimport Select from 'react-select';\n\nimport { Field } from '../components/field';\nimport { defaultArgs } from '../data';\n\nexport default {\n  title: 'Select/UnstyledWithTailwind',\n  component: Select,\n  argTypes: {},\n} as ComponentMeta<typeof Select>;\n\nconst Template: ComponentStory<typeof Select> = ({\n  inputId = 'react-select',\n  ...props\n}) => {\n  return (\n    <Field htmlFor={inputId} label=\"Unstyled With Tailwind\">\n      <Select\n        inputId={inputId}\n        {...props}\n        unstyled // Remove all non-essential styles\n        classNames={{\n          clearIndicator: ({ isFocused }) =>\n            classNames(\n              isFocused ? 'text-neutral-600' : 'text-neutral-200',\n              'p-2',\n              isFocused ? 'hover:text-neutral-800' : 'hover:text-neutral-400'\n            ),\n          // container: () => classNames(),\n          control: ({ isDisabled, isFocused }) =>\n            classNames(\n              isDisabled ? 'bg-neutral-50' : 'bg-white',\n              isDisabled\n                ? 'border-neutral-100'\n                : isFocused\n                ? 'border-purple-800'\n                : 'border-neutral-200',\n              'rounded',\n              'border-solid',\n              'border',\n              isFocused && 'shadow-[0_0_0_1px] shadow-purple-800',\n              isFocused ? 'hover:border-purple-800' : 'hover:border-neutral-300'\n            ),\n          dropdownIndicator: ({ isFocused }) =>\n            classNames(\n              isFocused ? 'text-neutral-600' : 'text-neutral-200',\n              'p-2',\n              isFocused ? 'hover:text-neutral-800' : 'hover:text-neutral-400'\n            ),\n          group: () => classNames('py-2'),\n          groupHeading: () =>\n            classNames(\n              'text-neutral-400',\n              'text-xs',\n              'font-medium',\n              'mb-1',\n              'px-3',\n              'uppercase'\n            ),\n          // indicatorsContainer: () => classNames(),\n          indicatorSeparator: ({ isDisabled }) =>\n            classNames(\n              isDisabled ? 'bg-neutral-100' : 'bg-neutral-200',\n              'my-2'\n            ),\n          input: () => classNames('m-0.5', 'py-0.5', 'text-neutral-800'),\n          loadingIndicator: ({ isFocused }) =>\n            classNames(\n              isFocused ? 'text-neutral-600' : 'text-neutral-200',\n              'p-2'\n            ),\n          loadingMessage: () => classNames('text-neutral-400', 'py-2', 'px-3'),\n          menu: () =>\n            classNames(\n              'bg-white',\n              'rounded',\n              'shadow-[0_0_0_1px_rgba(0,0,0,0.1)]',\n              'my-1'\n            ),\n          menuList: () => classNames('py-1'),\n          // menuPortal: () => classNames(),\n          multiValue: () => classNames('bg-neutral-100', 'rounded-sm', 'm-0.5'),\n          multiValueLabel: () =>\n            classNames(\n              'rounded-sm',\n              'text-neutral-800',\n              'text-sm',\n              'p-[3]',\n              'pl-[6]'\n            ),\n          multiValueRemove: ({ isFocused }) =>\n            classNames(\n              'rounded-sm',\n              isFocused && 'bg-red-500',\n              'px-1',\n              'hover:bg-red-500',\n              'hover:text-red-800'\n            ),\n          noOptionsMessage: () =>\n            classNames('text-neutral-400', 'py-2', 'px-3'),\n          option: ({ isDisabled, isFocused, isSelected }) =>\n            classNames(\n              isSelected\n                ? 'bg-purple-800'\n                : isFocused\n                ? 'bg-purple-300'\n                : 'bg-transparent',\n              isDisabled\n                ? 'text-neutral-200'\n                : isSelected\n                ? 'text-white'\n                : 'text-inherit',\n              'py-2',\n              'px-3',\n              !isDisabled &&\n                (isSelected ? 'active:bg-purple-800' : 'active:bg-purple-500')\n            ),\n          placeholder: () => classNames('text-neutral-500', 'mx-0.5'),\n          singleValue: ({ isDisabled }) =>\n            classNames(\n              isDisabled ? 'text-neutral-400' : 'text-neutral-800',\n              'mx-0.5'\n            ),\n          valueContainer: () => classNames('py-0.5', 'px-2'),\n        }}\n      />\n    </Field>\n  );\n};\n\nexport const UnstyledWithTailwind = Template.bind({});\nUnstyledWithTailwind.args = {\n  ...defaultArgs,\n};\n"
  },
  {
    "path": "storybook/styles/tailwind.css",
    "content": "@tailwind base;\n@tailwind components;\n@tailwind utilities;\n"
  },
  {
    "path": "storybook/tailwind.config.js",
    "content": "/** @type {import('tailwindcss').Config} */\nmodule.exports = {\n  content: [\n    './components/**/*.{js,ts,jsx,tsx}',\n    './stories/**/*.{js,ts,jsx,tsx}',\n  ],\n  theme: {\n    extend: {},\n  },\n  plugins: [],\n};\n"
  },
  {
    "path": "test-setup.js",
    "content": "import '@testing-library/jest-dom';\n"
  },
  {
    "path": "tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"target\": \"es6\",\n    \"module\": \"commonjs\",\n    \"jsx\": \"react\",\n    \"noEmit\": true,\n    \"strict\": true,\n    \"esModuleInterop\": true,\n    \"forceConsistentCasingInFileNames\": true,\n    \"resolveJsonModule\": true\n  }\n}\n"
  }
]