@transferwise/components 0.0.0-experimental-bcfa03a → 0.0.0-experimental-5cd0315

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (180) hide show
  1. package/build/dateInput/DateInput.js +3 -6
  2. package/build/dateInput/DateInput.js.map +1 -1
  3. package/build/dateInput/DateInput.mjs +2 -5
  4. package/build/dateInput/DateInput.mjs.map +1 -1
  5. package/build/expressiveMoneyInput/currencySelector/CurrencySelector.js +3 -5
  6. package/build/expressiveMoneyInput/currencySelector/CurrencySelector.js.map +1 -1
  7. package/build/expressiveMoneyInput/currencySelector/CurrencySelector.mjs +1 -3
  8. package/build/expressiveMoneyInput/currencySelector/CurrencySelector.mjs.map +1 -1
  9. package/build/index.js +3 -5
  10. package/build/index.js.map +1 -1
  11. package/build/index.mjs +1 -3
  12. package/build/index.mjs.map +1 -1
  13. package/build/inputs/SelectInput.js +840 -0
  14. package/build/inputs/SelectInput.js.map +1 -0
  15. package/build/inputs/SelectInput.messages.js.map +1 -0
  16. package/build/inputs/SelectInput.messages.mjs.map +1 -0
  17. package/build/inputs/SelectInput.mjs +832 -0
  18. package/build/inputs/SelectInput.mjs.map +1 -0
  19. package/build/main.css +70 -65
  20. package/build/moneyInput/MoneyInput.js +2 -5
  21. package/build/moneyInput/MoneyInput.js.map +1 -1
  22. package/build/moneyInput/MoneyInput.mjs +1 -4
  23. package/build/moneyInput/MoneyInput.mjs.map +1 -1
  24. package/build/phoneNumberInput/PhoneNumberInput.js +2 -5
  25. package/build/phoneNumberInput/PhoneNumberInput.js.map +1 -1
  26. package/build/phoneNumberInput/PhoneNumberInput.mjs +1 -4
  27. package/build/phoneNumberInput/PhoneNumberInput.mjs.map +1 -1
  28. package/build/styles/inputs/{SelectInput/SelectInput.css → SelectInput.css} +70 -65
  29. package/build/styles/main.css +70 -65
  30. package/build/types/inputs/{SelectInput/SelectInput.types.d.ts → SelectInput.d.ts} +7 -10
  31. package/build/types/inputs/SelectInput.d.ts.map +1 -0
  32. package/build/types/inputs/SelectInput.messages.d.ts.map +1 -0
  33. package/package.json +2 -2
  34. package/src/inputs/{SelectInput/SelectInput.css → SelectInput.css} +70 -65
  35. package/src/inputs/{SelectInput/SelectInput.docs.mdx → SelectInput.docs.mdx} +1 -0
  36. package/src/inputs/SelectInput.less +219 -0
  37. package/src/inputs/{SelectInput/SelectInput.story.tsx → SelectInput.story.tsx} +7 -7
  38. package/src/inputs/SelectInput.tsx +1209 -0
  39. package/src/main.css +70 -65
  40. package/src/main.less +1 -1
  41. package/build/inputs/SelectInput/DefaultTrigger/ClearButton/SelectInputClearButton.js +0 -26
  42. package/build/inputs/SelectInput/DefaultTrigger/ClearButton/SelectInputClearButton.js.map +0 -1
  43. package/build/inputs/SelectInput/DefaultTrigger/ClearButton/SelectInputClearButton.mjs +0 -24
  44. package/build/inputs/SelectInput/DefaultTrigger/ClearButton/SelectInputClearButton.mjs.map +0 -1
  45. package/build/inputs/SelectInput/DefaultTrigger/SelectInputDefaultTrigger.js +0 -54
  46. package/build/inputs/SelectInput/DefaultTrigger/SelectInputDefaultTrigger.js.map +0 -1
  47. package/build/inputs/SelectInput/DefaultTrigger/SelectInputDefaultTrigger.mjs +0 -52
  48. package/build/inputs/SelectInput/DefaultTrigger/SelectInputDefaultTrigger.mjs.map +0 -1
  49. package/build/inputs/SelectInput/OptionContent/SelectInputOptionContent.js +0 -41
  50. package/build/inputs/SelectInput/OptionContent/SelectInputOptionContent.js.map +0 -1
  51. package/build/inputs/SelectInput/OptionContent/SelectInputOptionContent.mjs +0 -38
  52. package/build/inputs/SelectInput/OptionContent/SelectInputOptionContent.mjs.map +0 -1
  53. package/build/inputs/SelectInput/Options/GroupItemView/SelectInputGroupItemView.js +0 -50
  54. package/build/inputs/SelectInput/Options/GroupItemView/SelectInputGroupItemView.js.map +0 -1
  55. package/build/inputs/SelectInput/Options/GroupItemView/SelectInputGroupItemView.mjs +0 -48
  56. package/build/inputs/SelectInput/Options/GroupItemView/SelectInputGroupItemView.mjs.map +0 -1
  57. package/build/inputs/SelectInput/Options/ItemView/Option/SelectInputOption.js +0 -45
  58. package/build/inputs/SelectInput/Options/ItemView/Option/SelectInputOption.js.map +0 -1
  59. package/build/inputs/SelectInput/Options/ItemView/Option/SelectInputOption.mjs +0 -41
  60. package/build/inputs/SelectInput/Options/ItemView/Option/SelectInputOption.mjs.map +0 -1
  61. package/build/inputs/SelectInput/Options/ItemView/SelectInputItemView.js +0 -50
  62. package/build/inputs/SelectInput/Options/ItemView/SelectInputItemView.js.map +0 -1
  63. package/build/inputs/SelectInput/Options/ItemView/SelectInputItemView.mjs +0 -48
  64. package/build/inputs/SelectInput/Options/ItemView/SelectInputItemView.mjs.map +0 -1
  65. package/build/inputs/SelectInput/Options/OptionsContainer/SelectInputOptionsContainer.js +0 -48
  66. package/build/inputs/SelectInput/Options/OptionsContainer/SelectInputOptionsContainer.js.map +0 -1
  67. package/build/inputs/SelectInput/Options/OptionsContainer/SelectInputOptionsContainer.mjs +0 -46
  68. package/build/inputs/SelectInput/Options/OptionsContainer/SelectInputOptionsContainer.mjs.map +0 -1
  69. package/build/inputs/SelectInput/Options/SelectInputOptions.js +0 -270
  70. package/build/inputs/SelectInput/Options/SelectInputOptions.js.map +0 -1
  71. package/build/inputs/SelectInput/Options/SelectInputOptions.mjs +0 -268
  72. package/build/inputs/SelectInput/Options/SelectInputOptions.mjs.map +0 -1
  73. package/build/inputs/SelectInput/SelectInput.constants.js +0 -6
  74. package/build/inputs/SelectInput/SelectInput.constants.js.map +0 -1
  75. package/build/inputs/SelectInput/SelectInput.constants.mjs +0 -4
  76. package/build/inputs/SelectInput/SelectInput.constants.mjs.map +0 -1
  77. package/build/inputs/SelectInput/SelectInput.helpers.js +0 -115
  78. package/build/inputs/SelectInput/SelectInput.helpers.js.map +0 -1
  79. package/build/inputs/SelectInput/SelectInput.helpers.mjs +0 -109
  80. package/build/inputs/SelectInput/SelectInput.helpers.mjs.map +0 -1
  81. package/build/inputs/SelectInput/SelectInput.js +0 -216
  82. package/build/inputs/SelectInput/SelectInput.js.map +0 -1
  83. package/build/inputs/SelectInput/SelectInput.messages.js.map +0 -1
  84. package/build/inputs/SelectInput/SelectInput.messages.mjs.map +0 -1
  85. package/build/inputs/SelectInput/SelectInput.mjs +0 -210
  86. package/build/inputs/SelectInput/SelectInput.mjs.map +0 -1
  87. package/build/inputs/SelectInput/TriggerButton/SelectInputTriggerButton.js +0 -41
  88. package/build/inputs/SelectInput/TriggerButton/SelectInputTriggerButton.js.map +0 -1
  89. package/build/inputs/SelectInput/TriggerButton/SelectInputTriggerButton.mjs +0 -34
  90. package/build/inputs/SelectInput/TriggerButton/SelectInputTriggerButton.mjs.map +0 -1
  91. package/build/styles/inputs/SelectInput/DefaultTrigger/SelectInputDefaultTrigger.css +0 -17
  92. package/build/styles/inputs/SelectInput/OptionContent/SelectInputOptionContent.css +0 -37
  93. package/build/styles/inputs/SelectInput/Options/ItemView/Option/SelectInputOption.css +0 -33
  94. package/build/styles/inputs/SelectInput/Options/ItemView/SelectInputItemView.css +0 -44
  95. package/build/styles/inputs/SelectInput/Options/SelectInputOptions.css +0 -125
  96. package/build/types/inputs/SelectInput/DefaultTrigger/ClearButton/SelectInputClearButton.d.ts +0 -5
  97. package/build/types/inputs/SelectInput/DefaultTrigger/ClearButton/SelectInputClearButton.d.ts.map +0 -1
  98. package/build/types/inputs/SelectInput/DefaultTrigger/ClearButton/index.d.ts +0 -2
  99. package/build/types/inputs/SelectInput/DefaultTrigger/ClearButton/index.d.ts.map +0 -1
  100. package/build/types/inputs/SelectInput/DefaultTrigger/SelectInputDefaultTrigger.d.ts +0 -9
  101. package/build/types/inputs/SelectInput/DefaultTrigger/SelectInputDefaultTrigger.d.ts.map +0 -1
  102. package/build/types/inputs/SelectInput/DefaultTrigger/index.d.ts +0 -2
  103. package/build/types/inputs/SelectInput/DefaultTrigger/index.d.ts.map +0 -1
  104. package/build/types/inputs/SelectInput/OptionContent/SelectInputOptionContent.d.ts +0 -9
  105. package/build/types/inputs/SelectInput/OptionContent/SelectInputOptionContent.d.ts.map +0 -1
  106. package/build/types/inputs/SelectInput/OptionContent/index.d.ts +0 -3
  107. package/build/types/inputs/SelectInput/OptionContent/index.d.ts.map +0 -1
  108. package/build/types/inputs/SelectInput/Options/GroupItemView/SelectInputGroupItemView.d.ts +0 -3
  109. package/build/types/inputs/SelectInput/Options/GroupItemView/SelectInputGroupItemView.d.ts.map +0 -1
  110. package/build/types/inputs/SelectInput/Options/GroupItemView/index.d.ts +0 -2
  111. package/build/types/inputs/SelectInput/Options/GroupItemView/index.d.ts.map +0 -1
  112. package/build/types/inputs/SelectInput/Options/ItemView/Option/SelectInputOption.d.ts +0 -10
  113. package/build/types/inputs/SelectInput/Options/ItemView/Option/SelectInputOption.d.ts.map +0 -1
  114. package/build/types/inputs/SelectInput/Options/ItemView/Option/index.d.ts +0 -2
  115. package/build/types/inputs/SelectInput/Options/ItemView/Option/index.d.ts.map +0 -1
  116. package/build/types/inputs/SelectInput/Options/ItemView/SelectInputItemView.d.ts +0 -3
  117. package/build/types/inputs/SelectInput/Options/ItemView/SelectInputItemView.d.ts.map +0 -1
  118. package/build/types/inputs/SelectInput/Options/ItemView/index.d.ts +0 -2
  119. package/build/types/inputs/SelectInput/Options/ItemView/index.d.ts.map +0 -1
  120. package/build/types/inputs/SelectInput/Options/OptionsContainer/SelectInputOptionsContainer.d.ts +0 -6
  121. package/build/types/inputs/SelectInput/Options/OptionsContainer/SelectInputOptionsContainer.d.ts.map +0 -1
  122. package/build/types/inputs/SelectInput/Options/OptionsContainer/index.d.ts +0 -2
  123. package/build/types/inputs/SelectInput/Options/OptionsContainer/index.d.ts.map +0 -1
  124. package/build/types/inputs/SelectInput/Options/SelectInputOptions.d.ts +0 -15
  125. package/build/types/inputs/SelectInput/Options/SelectInputOptions.d.ts.map +0 -1
  126. package/build/types/inputs/SelectInput/Options/index.d.ts +0 -2
  127. package/build/types/inputs/SelectInput/Options/index.d.ts.map +0 -1
  128. package/build/types/inputs/SelectInput/SelectInput.constants.d.ts +0 -2
  129. package/build/types/inputs/SelectInput/SelectInput.constants.d.ts.map +0 -1
  130. package/build/types/inputs/SelectInput/SelectInput.d.ts +0 -3
  131. package/build/types/inputs/SelectInput/SelectInput.d.ts.map +0 -1
  132. package/build/types/inputs/SelectInput/SelectInput.helpers.d.ts +0 -28
  133. package/build/types/inputs/SelectInput/SelectInput.helpers.d.ts.map +0 -1
  134. package/build/types/inputs/SelectInput/SelectInput.messages.d.ts.map +0 -1
  135. package/build/types/inputs/SelectInput/SelectInput.types.d.ts.map +0 -1
  136. package/build/types/inputs/SelectInput/TriggerButton/SelectInputTriggerButton.d.ts +0 -15
  137. package/build/types/inputs/SelectInput/TriggerButton/SelectInputTriggerButton.d.ts.map +0 -1
  138. package/build/types/inputs/SelectInput/TriggerButton/index.d.ts +0 -3
  139. package/build/types/inputs/SelectInput/TriggerButton/index.d.ts.map +0 -1
  140. package/build/types/inputs/SelectInput/index.d.ts +0 -5
  141. package/build/types/inputs/SelectInput/index.d.ts.map +0 -1
  142. package/src/inputs/SelectInput/DefaultTrigger/ClearButton/SelectInputClearButton.tsx +0 -25
  143. package/src/inputs/SelectInput/DefaultTrigger/ClearButton/index.ts +0 -1
  144. package/src/inputs/SelectInput/DefaultTrigger/SelectInputDefaultTrigger.css +0 -17
  145. package/src/inputs/SelectInput/DefaultTrigger/SelectInputDefaultTrigger.less +0 -15
  146. package/src/inputs/SelectInput/DefaultTrigger/SelectInputDefaultTrigger.tsx +0 -56
  147. package/src/inputs/SelectInput/DefaultTrigger/index.ts +0 -1
  148. package/src/inputs/SelectInput/OptionContent/SelectInputOptionContent.css +0 -37
  149. package/src/inputs/SelectInput/OptionContent/SelectInputOptionContent.less +0 -38
  150. package/src/inputs/SelectInput/OptionContent/SelectInputOptionContent.tsx +0 -67
  151. package/src/inputs/SelectInput/OptionContent/index.ts +0 -5
  152. package/src/inputs/SelectInput/Options/GroupItemView/SelectInputGroupItemView.tsx +0 -53
  153. package/src/inputs/SelectInput/Options/GroupItemView/index.ts +0 -1
  154. package/src/inputs/SelectInput/Options/ItemView/Option/SelectInputOption.css +0 -33
  155. package/src/inputs/SelectInput/Options/ItemView/Option/SelectInputOption.less +0 -32
  156. package/src/inputs/SelectInput/Options/ItemView/Option/SelectInputOption.tsx +0 -51
  157. package/src/inputs/SelectInput/Options/ItemView/Option/index.ts +0 -5
  158. package/src/inputs/SelectInput/Options/ItemView/SelectInputItemView.css +0 -44
  159. package/src/inputs/SelectInput/Options/ItemView/SelectInputItemView.less +0 -14
  160. package/src/inputs/SelectInput/Options/ItemView/SelectInputItemView.tsx +0 -37
  161. package/src/inputs/SelectInput/Options/ItemView/index.ts +0 -1
  162. package/src/inputs/SelectInput/Options/OptionsContainer/SelectInputOptionsContainer.tsx +0 -55
  163. package/src/inputs/SelectInput/Options/OptionsContainer/index.ts +0 -1
  164. package/src/inputs/SelectInput/Options/SelectInputOptions.css +0 -125
  165. package/src/inputs/SelectInput/Options/SelectInputOptions.less +0 -78
  166. package/src/inputs/SelectInput/Options/SelectInputOptions.tsx +0 -372
  167. package/src/inputs/SelectInput/Options/index.ts +0 -1
  168. package/src/inputs/SelectInput/SelectInput.constants.ts +0 -1
  169. package/src/inputs/SelectInput/SelectInput.helpers.ts +0 -152
  170. package/src/inputs/SelectInput/SelectInput.less +0 -40
  171. package/src/inputs/SelectInput/SelectInput.test.tsx +0 -606
  172. package/src/inputs/SelectInput/SelectInput.tsx +0 -247
  173. package/src/inputs/SelectInput/SelectInput.types.ts +0 -127
  174. package/src/inputs/SelectInput/TriggerButton/SelectInputTriggerButton.tsx +0 -39
  175. package/src/inputs/SelectInput/TriggerButton/index.ts +0 -5
  176. package/src/inputs/SelectInput/index.ts +0 -13
  177. /package/build/inputs/{SelectInput/SelectInput.messages.js → SelectInput.messages.js} +0 -0
  178. /package/build/inputs/{SelectInput/SelectInput.messages.mjs → SelectInput.messages.mjs} +0 -0
  179. /package/build/types/inputs/{SelectInput/SelectInput.messages.d.ts → SelectInput.messages.d.ts} +0 -0
  180. /package/src/inputs/{SelectInput/SelectInput.messages.ts → SelectInput.messages.ts} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"file":"SelectInputOption.js","sources":["../../../../../../src/inputs/SelectInput/Options/ItemView/Option/SelectInputOption.tsx"],"sourcesContent":["import { useContext, createContext } from 'react';\nimport { ListboxOption } from '@headlessui/react';\nimport { Check } from '@transferwise/icons';\nimport { clsx } from 'clsx';\n\nexport const SelectInputItemsCountContext = createContext<number | undefined>(undefined);\nexport const SelectInputItemPositionContext = createContext<number | undefined>(undefined);\n\ninterface SelectInputOptionProps<T = string> {\n value: T;\n disabled?: boolean;\n children?: React.ReactNode;\n}\n\nexport function SelectInputOption<T = string>({\n value,\n disabled,\n children,\n}: SelectInputOptionProps<T>) {\n const itemsCount = useContext(SelectInputItemsCountContext);\n const itemPosition = useContext(SelectInputItemPositionContext);\n return (\n <ListboxOption\n as=\"div\"\n value={value}\n aria-setsize={itemsCount}\n aria-posinset={itemPosition}\n disabled={disabled}\n className={({ active, disabled: uiDisabled }) =>\n clsx(\n 'np-select-input-option-container np-text-body-large',\n active && 'np-select-input-option-container--active',\n uiDisabled && 'np-select-input-option-container--disabled',\n )\n }\n >\n {({ selected }) => (\n <>\n <div className=\"np-select-input-option\">{children}</div>\n <Check\n size={16}\n className={clsx(\n 'np-select-input-option-check',\n !selected && 'np-select-input-option-check--not-selected',\n )}\n />\n </>\n )}\n </ListboxOption>\n );\n}\n"],"names":["SelectInputItemsCountContext","createContext","undefined","SelectInputItemPositionContext","SelectInputOption","value","disabled","children","itemsCount","useContext","itemPosition","_jsx","ListboxOption","as","className","active","uiDisabled","clsx","selected","_jsxs","_Fragment","Check","size"],"mappings":";;;;;;;;MAKaA,4BAA4B,gBAAGC,mBAAa,CAAqBC,SAAS;MAC1EC,8BAA8B,gBAAGF,mBAAa,CAAqBC,SAAS;AAQnF,SAAUE,iBAAiBA,CAAa;EAC5CC,KAAK;EACLC,QAAQ;AACRC,EAAAA;AAAQ,CACkB,EAAA;AAC1B,EAAA,MAAMC,UAAU,GAAGC,gBAAU,CAACT,4BAA4B,CAAC;AAC3D,EAAA,MAAMU,YAAY,GAAGD,gBAAU,CAACN,8BAA8B,CAAC;EAC/D,oBACEQ,cAAA,CAACC,mBAAa,EAAA;AACZC,IAAAA,EAAE,EAAC,KAAK;AACRR,IAAAA,KAAK,EAAEA,KAAM;AACb,IAAA,cAAA,EAAcG,UAAW;AACzB,IAAA,eAAA,EAAeE,YAAa;AAC5BJ,IAAAA,QAAQ,EAAEA,QAAS;AACnBQ,IAAAA,SAAS,EAAEA,CAAC;MAAEC,MAAM;AAAET,MAAAA,QAAQ,EAAEU;AAAU,KAAE,KAC1CC,SAAI,CACF,qDAAqD,EACrDF,MAAM,IAAI,0CAA0C,EACpDC,UAAU,IAAI,4CAA4C,CAE7D;AAAAT,IAAAA,QAAA,EAEAA,CAAC;AAAEW,MAAAA;KAAU,kBACZC,eAAA,CAAAC,mBAAA,EAAA;AAAAb,MAAAA,QAAA,gBACEI,cAAA,CAAA,KAAA,EAAA;AAAKG,QAAAA,SAAS,EAAC,wBAAwB;AAAAP,QAAAA,QAAA,EAAEA;AAAQ,OAAM,CACvD,eAAAI,cAAA,CAACU,WAAK,EAAA;AACJC,QAAAA,IAAI,EAAE,EAAG;QACTR,SAAS,EAAEG,SAAI,CACb,8BAA8B,EAC9B,CAACC,QAAQ,IAAI,4CAA4C;AACzD,OAAA,CAEN;KAAA;AACD,GACY,CAAC;AAEpB;;;;;;"}
@@ -1,41 +0,0 @@
1
- import { createContext, useContext } from 'react';
2
- import { ListboxOption } from '@headlessui/react';
3
- import { Check } from '@transferwise/icons';
4
- import { clsx } from 'clsx';
5
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
6
-
7
- const SelectInputItemsCountContext = /*#__PURE__*/createContext(undefined);
8
- const SelectInputItemPositionContext = /*#__PURE__*/createContext(undefined);
9
- function SelectInputOption({
10
- value,
11
- disabled,
12
- children
13
- }) {
14
- const itemsCount = useContext(SelectInputItemsCountContext);
15
- const itemPosition = useContext(SelectInputItemPositionContext);
16
- return /*#__PURE__*/jsx(ListboxOption, {
17
- as: "div",
18
- value: value,
19
- "aria-setsize": itemsCount,
20
- "aria-posinset": itemPosition,
21
- disabled: disabled,
22
- className: ({
23
- active,
24
- disabled: uiDisabled
25
- }) => clsx('np-select-input-option-container np-text-body-large', active && 'np-select-input-option-container--active', uiDisabled && 'np-select-input-option-container--disabled'),
26
- children: ({
27
- selected
28
- }) => /*#__PURE__*/jsxs(Fragment, {
29
- children: [/*#__PURE__*/jsx("div", {
30
- className: "np-select-input-option",
31
- children: children
32
- }), /*#__PURE__*/jsx(Check, {
33
- size: 16,
34
- className: clsx('np-select-input-option-check', !selected && 'np-select-input-option-check--not-selected')
35
- })]
36
- })
37
- });
38
- }
39
-
40
- export { SelectInputItemPositionContext, SelectInputItemsCountContext, SelectInputOption };
41
- //# sourceMappingURL=SelectInputOption.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SelectInputOption.mjs","sources":["../../../../../../src/inputs/SelectInput/Options/ItemView/Option/SelectInputOption.tsx"],"sourcesContent":["import { useContext, createContext } from 'react';\nimport { ListboxOption } from '@headlessui/react';\nimport { Check } from '@transferwise/icons';\nimport { clsx } from 'clsx';\n\nexport const SelectInputItemsCountContext = createContext<number | undefined>(undefined);\nexport const SelectInputItemPositionContext = createContext<number | undefined>(undefined);\n\ninterface SelectInputOptionProps<T = string> {\n value: T;\n disabled?: boolean;\n children?: React.ReactNode;\n}\n\nexport function SelectInputOption<T = string>({\n value,\n disabled,\n children,\n}: SelectInputOptionProps<T>) {\n const itemsCount = useContext(SelectInputItemsCountContext);\n const itemPosition = useContext(SelectInputItemPositionContext);\n return (\n <ListboxOption\n as=\"div\"\n value={value}\n aria-setsize={itemsCount}\n aria-posinset={itemPosition}\n disabled={disabled}\n className={({ active, disabled: uiDisabled }) =>\n clsx(\n 'np-select-input-option-container np-text-body-large',\n active && 'np-select-input-option-container--active',\n uiDisabled && 'np-select-input-option-container--disabled',\n )\n }\n >\n {({ selected }) => (\n <>\n <div className=\"np-select-input-option\">{children}</div>\n <Check\n size={16}\n className={clsx(\n 'np-select-input-option-check',\n !selected && 'np-select-input-option-check--not-selected',\n )}\n />\n </>\n )}\n </ListboxOption>\n );\n}\n"],"names":["SelectInputItemsCountContext","createContext","undefined","SelectInputItemPositionContext","SelectInputOption","value","disabled","children","itemsCount","useContext","itemPosition","_jsx","ListboxOption","as","className","active","uiDisabled","clsx","selected","_jsxs","_Fragment","Check","size"],"mappings":";;;;;;MAKaA,4BAA4B,gBAAGC,aAAa,CAAqBC,SAAS;MAC1EC,8BAA8B,gBAAGF,aAAa,CAAqBC,SAAS;AAQnF,SAAUE,iBAAiBA,CAAa;EAC5CC,KAAK;EACLC,QAAQ;AACRC,EAAAA;AAAQ,CACkB,EAAA;AAC1B,EAAA,MAAMC,UAAU,GAAGC,UAAU,CAACT,4BAA4B,CAAC;AAC3D,EAAA,MAAMU,YAAY,GAAGD,UAAU,CAACN,8BAA8B,CAAC;EAC/D,oBACEQ,GAAA,CAACC,aAAa,EAAA;AACZC,IAAAA,EAAE,EAAC,KAAK;AACRR,IAAAA,KAAK,EAAEA,KAAM;AACb,IAAA,cAAA,EAAcG,UAAW;AACzB,IAAA,eAAA,EAAeE,YAAa;AAC5BJ,IAAAA,QAAQ,EAAEA,QAAS;AACnBQ,IAAAA,SAAS,EAAEA,CAAC;MAAEC,MAAM;AAAET,MAAAA,QAAQ,EAAEU;AAAU,KAAE,KAC1CC,IAAI,CACF,qDAAqD,EACrDF,MAAM,IAAI,0CAA0C,EACpDC,UAAU,IAAI,4CAA4C,CAE7D;AAAAT,IAAAA,QAAA,EAEAA,CAAC;AAAEW,MAAAA;KAAU,kBACZC,IAAA,CAAAC,QAAA,EAAA;AAAAb,MAAAA,QAAA,gBACEI,GAAA,CAAA,KAAA,EAAA;AAAKG,QAAAA,SAAS,EAAC,wBAAwB;AAAAP,QAAAA,QAAA,EAAEA;AAAQ,OAAM,CACvD,eAAAI,GAAA,CAACU,KAAK,EAAA;AACJC,QAAAA,IAAI,EAAE,EAAG;QACTR,SAAS,EAAEG,IAAI,CACb,8BAA8B,EAC9B,CAACC,QAAQ,IAAI,4CAA4C;AACzD,OAAA,CAEN;KAAA;AACD,GACY,CAAC;AAEpB;;;;"}
@@ -1,50 +0,0 @@
1
- 'use strict';
2
-
3
- var Divider = require('../../../../divider/Divider.js');
4
- var SelectInput_helpers = require('../../SelectInput.helpers.js');
5
- var SelectInputGroupItemView = require('../GroupItemView/SelectInputGroupItemView.js');
6
- var SelectInputOption = require('./Option/SelectInputOption.js');
7
- var jsxRuntime = require('react/jsx-runtime');
8
-
9
- function SelectInputItemView({
10
- item,
11
- renderValue,
12
- needle
13
- }) {
14
- switch (item.type) {
15
- case 'option':
16
- {
17
- if (item.value != null && (needle == null || SelectInput_helpers.selectInputOptionItemIncludesNeedle(item, needle))) {
18
- return /*#__PURE__*/jsxRuntime.jsx(SelectInputOption.SelectInputOption, {
19
- value: item.value,
20
- disabled: item.disabled,
21
- children: renderValue(item.value, false)
22
- });
23
- }
24
- break;
25
- }
26
- case 'group':
27
- {
28
- return /*#__PURE__*/jsxRuntime.jsx(SelectInputGroupItemView.SelectInputGroupItemView, {
29
- item: item,
30
- renderValue: renderValue,
31
- needle: needle
32
- });
33
- }
34
- case 'separator':
35
- {
36
- if (needle == null) {
37
- return /*#__PURE__*/jsxRuntime.jsx(Divider.default, {
38
- isContent: true,
39
- level: "subsection",
40
- className: "m-y-1"
41
- });
42
- }
43
- break;
44
- }
45
- }
46
- return null;
47
- }
48
-
49
- exports.SelectInputItemView = SelectInputItemView;
50
- //# sourceMappingURL=SelectInputItemView.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SelectInputItemView.js","sources":["../../../../../src/inputs/SelectInput/Options/ItemView/SelectInputItemView.tsx"],"sourcesContent":["import Divider from '../../../../divider';\nimport { selectInputOptionItemIncludesNeedle } from '../../SelectInput.helpers';\nimport type { SelectInputItemViewProps } from '../../SelectInput.types';\nimport { SelectInputGroupItemView } from '../GroupItemView';\nimport { SelectInputOption } from './Option';\n\nexport function SelectInputItemView<T = string>({\n item,\n renderValue,\n needle,\n}: SelectInputItemViewProps<T>) {\n switch (item.type) {\n case 'option': {\n if (\n item.value != null &&\n (needle == null || selectInputOptionItemIncludesNeedle(item, needle))\n ) {\n return (\n <SelectInputOption value={item.value} disabled={item.disabled}>\n {renderValue(item.value, false)}\n </SelectInputOption>\n );\n }\n break;\n }\n case 'group': {\n return <SelectInputGroupItemView item={item} renderValue={renderValue} needle={needle} />;\n }\n case 'separator': {\n if (needle == null) {\n return <Divider isContent level=\"subsection\" className=\"m-y-1\" />;\n }\n break;\n }\n }\n return null;\n}\n"],"names":["SelectInputItemView","item","renderValue","needle","type","value","selectInputOptionItemIncludesNeedle","_jsx","SelectInputOption","disabled","children","SelectInputGroupItemView","Divider","isContent","level","className"],"mappings":";;;;;;;;AAMM,SAAUA,mBAAmBA,CAAa;EAC9CC,IAAI;EACJC,WAAW;AACXC,EAAAA;AAAM,CACsB,EAAA;EAC5B,QAAQF,IAAI,CAACG,IAAI;AACf,IAAA,KAAK,QAAQ;AAAE,MAAA;AACb,QAAA,IACEH,IAAI,CAACI,KAAK,IAAI,IAAI,KACjBF,MAAM,IAAI,IAAI,IAAIG,uDAAmC,CAACL,IAAI,EAAEE,MAAM,CAAC,CAAC,EACrE;UACA,oBACEI,cAAA,CAACC,mCAAiB,EAAA;YAACH,KAAK,EAAEJ,IAAI,CAACI,KAAM;YAACI,QAAQ,EAAER,IAAI,CAACQ,QAAS;AAAAC,YAAAA,QAAA,EAC3DR,WAAW,CAACD,IAAI,CAACI,KAAK,EAAE,KAAK;AAAC,WACd,CAAC;AAExB,QAAA;AACA,QAAA;AACF,MAAA;AACA,IAAA,KAAK,OAAO;AAAE,MAAA;QACZ,oBAAOE,cAAA,CAACI,iDAAwB,EAAA;AAACV,UAAAA,IAAI,EAAEA,IAAK;AAACC,UAAAA,WAAW,EAAEA,WAAY;AAACC,UAAAA,MAAM,EAAEA;AAAO,SAAA,CAAG;AAC3F,MAAA;AACA,IAAA,KAAK,WAAW;AAAE,MAAA;QAChB,IAAIA,MAAM,IAAI,IAAI,EAAE;UAClB,oBAAOI,cAAA,CAACK,eAAO,EAAA;YAACC,SAAS,EAAA,IAAA;AAACC,YAAAA,KAAK,EAAC,YAAY;AAACC,YAAAA,SAAS,EAAC;AAAO,YAAG;AACnE,QAAA;AACA,QAAA;AACF,MAAA;AACF;AACA,EAAA,OAAO,IAAI;AACb;;;;"}
@@ -1,48 +0,0 @@
1
- import Divider from '../../../../divider/Divider.mjs';
2
- import { selectInputOptionItemIncludesNeedle } from '../../SelectInput.helpers.mjs';
3
- import { SelectInputGroupItemView } from '../GroupItemView/SelectInputGroupItemView.mjs';
4
- import { SelectInputOption } from './Option/SelectInputOption.mjs';
5
- import { jsx } from 'react/jsx-runtime';
6
-
7
- function SelectInputItemView({
8
- item,
9
- renderValue,
10
- needle
11
- }) {
12
- switch (item.type) {
13
- case 'option':
14
- {
15
- if (item.value != null && (needle == null || selectInputOptionItemIncludesNeedle(item, needle))) {
16
- return /*#__PURE__*/jsx(SelectInputOption, {
17
- value: item.value,
18
- disabled: item.disabled,
19
- children: renderValue(item.value, false)
20
- });
21
- }
22
- break;
23
- }
24
- case 'group':
25
- {
26
- return /*#__PURE__*/jsx(SelectInputGroupItemView, {
27
- item: item,
28
- renderValue: renderValue,
29
- needle: needle
30
- });
31
- }
32
- case 'separator':
33
- {
34
- if (needle == null) {
35
- return /*#__PURE__*/jsx(Divider, {
36
- isContent: true,
37
- level: "subsection",
38
- className: "m-y-1"
39
- });
40
- }
41
- break;
42
- }
43
- }
44
- return null;
45
- }
46
-
47
- export { SelectInputItemView };
48
- //# sourceMappingURL=SelectInputItemView.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SelectInputItemView.mjs","sources":["../../../../../src/inputs/SelectInput/Options/ItemView/SelectInputItemView.tsx"],"sourcesContent":["import Divider from '../../../../divider';\nimport { selectInputOptionItemIncludesNeedle } from '../../SelectInput.helpers';\nimport type { SelectInputItemViewProps } from '../../SelectInput.types';\nimport { SelectInputGroupItemView } from '../GroupItemView';\nimport { SelectInputOption } from './Option';\n\nexport function SelectInputItemView<T = string>({\n item,\n renderValue,\n needle,\n}: SelectInputItemViewProps<T>) {\n switch (item.type) {\n case 'option': {\n if (\n item.value != null &&\n (needle == null || selectInputOptionItemIncludesNeedle(item, needle))\n ) {\n return (\n <SelectInputOption value={item.value} disabled={item.disabled}>\n {renderValue(item.value, false)}\n </SelectInputOption>\n );\n }\n break;\n }\n case 'group': {\n return <SelectInputGroupItemView item={item} renderValue={renderValue} needle={needle} />;\n }\n case 'separator': {\n if (needle == null) {\n return <Divider isContent level=\"subsection\" className=\"m-y-1\" />;\n }\n break;\n }\n }\n return null;\n}\n"],"names":["SelectInputItemView","item","renderValue","needle","type","value","selectInputOptionItemIncludesNeedle","_jsx","SelectInputOption","disabled","children","SelectInputGroupItemView","Divider","isContent","level","className"],"mappings":";;;;;;AAMM,SAAUA,mBAAmBA,CAAa;EAC9CC,IAAI;EACJC,WAAW;AACXC,EAAAA;AAAM,CACsB,EAAA;EAC5B,QAAQF,IAAI,CAACG,IAAI;AACf,IAAA,KAAK,QAAQ;AAAE,MAAA;AACb,QAAA,IACEH,IAAI,CAACI,KAAK,IAAI,IAAI,KACjBF,MAAM,IAAI,IAAI,IAAIG,mCAAmC,CAACL,IAAI,EAAEE,MAAM,CAAC,CAAC,EACrE;UACA,oBACEI,GAAA,CAACC,iBAAiB,EAAA;YAACH,KAAK,EAAEJ,IAAI,CAACI,KAAM;YAACI,QAAQ,EAAER,IAAI,CAACQ,QAAS;AAAAC,YAAAA,QAAA,EAC3DR,WAAW,CAACD,IAAI,CAACI,KAAK,EAAE,KAAK;AAAC,WACd,CAAC;AAExB,QAAA;AACA,QAAA;AACF,MAAA;AACA,IAAA,KAAK,OAAO;AAAE,MAAA;QACZ,oBAAOE,GAAA,CAACI,wBAAwB,EAAA;AAACV,UAAAA,IAAI,EAAEA,IAAK;AAACC,UAAAA,WAAW,EAAEA,WAAY;AAACC,UAAAA,MAAM,EAAEA;AAAO,SAAA,CAAG;AAC3F,MAAA;AACA,IAAA,KAAK,WAAW;AAAE,MAAA;QAChB,IAAIA,MAAM,IAAI,IAAI,EAAE;UAClB,oBAAOI,GAAA,CAACK,OAAO,EAAA;YAACC,SAAS,EAAA,IAAA;AAACC,YAAAA,KAAK,EAAC,YAAY;AAACC,YAAAA,SAAS,EAAC;AAAO,YAAG;AACnE,QAAA;AACA,QAAA;AACF,MAAA;AACF;AACA,EAAA,OAAO,IAAI;AACb;;;;"}
@@ -1,48 +0,0 @@
1
- 'use strict';
2
-
3
- var React = require('react');
4
- var useEffectEvent = require('../../../../common/hooks/useEffectEvent.js');
5
- var jsxRuntime = require('react/jsx-runtime');
6
-
7
- const SelectInputOptionsContainer = /*#__PURE__*/React.forwardRef(function SelectInputOptionsContainer({
8
- 'aria-orientation': ariaOrientation,
9
- 'aria-activedescendant': ariaActiveDescendant,
10
- role,
11
- tabIndex,
12
- onAriaActiveDescendantChange,
13
- onKeyDown,
14
- ...restProps
15
- }, ref) {
16
- const handleAriaActiveDescendantChange = useEffectEvent.useEffectEvent(onAriaActiveDescendantChange);
17
- React.useEffect(() => {
18
- handleAriaActiveDescendantChange(ariaActiveDescendant);
19
- }, [ariaActiveDescendant, handleAriaActiveDescendantChange]);
20
- return /*#__PURE__*/jsxRuntime.jsx("div", {
21
- ref: ref,
22
- role: "none",
23
- onKeyDown: event => {
24
- // Prevent confirmation close without an active item
25
- if (event.key === 'Enter' && ariaActiveDescendant == null) {
26
- return;
27
- }
28
- // Required to make ListBox focusable
29
- if (event.key === 'Tab') {
30
- return;
31
- }
32
- // Prevent absorbing Escape early
33
- if (event.key === 'Escape') {
34
- onKeyDown?.({
35
- ...event,
36
- preventDefault: () => {},
37
- stopPropagation: () => {}
38
- });
39
- return;
40
- }
41
- onKeyDown?.(event);
42
- },
43
- ...restProps
44
- });
45
- });
46
-
47
- exports.SelectInputOptionsContainer = SelectInputOptionsContainer;
48
- //# sourceMappingURL=SelectInputOptionsContainer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SelectInputOptionsContainer.js","sources":["../../../../../src/inputs/SelectInput/Options/OptionsContainer/SelectInputOptionsContainer.tsx"],"sourcesContent":["import { forwardRef, useEffect } from 'react';\nimport { useEffectEvent } from '../../../../common/hooks/useEffectEvent';\n\ninterface SelectInputOptionsContainerProps extends React.ComponentPropsWithRef<'div'> {\n onAriaActiveDescendantChange: (value: React.AriaAttributes['aria-activedescendant']) => void;\n}\n\nexport const SelectInputOptionsContainer = forwardRef(function SelectInputOptionsContainer(\n {\n 'aria-orientation': ariaOrientation,\n 'aria-activedescendant': ariaActiveDescendant,\n role,\n tabIndex,\n onAriaActiveDescendantChange,\n onKeyDown,\n ...restProps\n }: SelectInputOptionsContainerProps,\n ref: React.ForwardedRef<HTMLDivElement | null>,\n) {\n const handleAriaActiveDescendantChange = useEffectEvent(onAriaActiveDescendantChange);\n useEffect(() => {\n handleAriaActiveDescendantChange(ariaActiveDescendant);\n }, [ariaActiveDescendant, handleAriaActiveDescendantChange]);\n\n return (\n <div\n ref={ref}\n role=\"none\"\n onKeyDown={(event) => {\n // Prevent confirmation close without an active item\n if (event.key === 'Enter' && ariaActiveDescendant == null) {\n return;\n }\n\n // Required to make ListBox focusable\n if (event.key === 'Tab') {\n return;\n }\n\n // Prevent absorbing Escape early\n if (event.key === 'Escape') {\n onKeyDown?.({\n ...event,\n preventDefault: () => {},\n stopPropagation: () => {},\n });\n return;\n }\n\n onKeyDown?.(event);\n }}\n {...restProps}\n />\n );\n});\n"],"names":["SelectInputOptionsContainer","forwardRef","ariaOrientation","ariaActiveDescendant","role","tabIndex","onAriaActiveDescendantChange","onKeyDown","restProps","ref","handleAriaActiveDescendantChange","useEffectEvent","useEffect","_jsx","event","key","preventDefault","stopPropagation"],"mappings":";;;;;;MAOaA,2BAA2B,gBAAGC,gBAAU,CAAC,SAASD,2BAA2BA,CACxF;AACE,EAAA,kBAAkB,EAAEE,eAAe;AACnC,EAAA,uBAAuB,EAAEC,oBAAoB;EAC7CC,IAAI;EACJC,QAAQ;EACRC,4BAA4B;EAC5BC,SAAS;EACT,GAAGC;AAAS,CACqB,EACnCC,GAA8C,EAAA;AAE9C,EAAA,MAAMC,gCAAgC,GAAGC,6BAAc,CAACL,4BAA4B,CAAC;AACrFM,EAAAA,eAAS,CAAC,MAAK;IACbF,gCAAgC,CAACP,oBAAoB,CAAC;AACxD,EAAA,CAAC,EAAE,CAACA,oBAAoB,EAAEO,gCAAgC,CAAC,CAAC;AAE5D,EAAA,oBACEG,cAAA,CAAA,KAAA,EAAA;AACEJ,IAAAA,GAAG,EAAEA,GAAI;AACTL,IAAAA,IAAI,EAAC,MAAM;IACXG,SAAS,EAAGO,KAAK,IAAI;AACnB;MACA,IAAIA,KAAK,CAACC,GAAG,KAAK,OAAO,IAAIZ,oBAAoB,IAAI,IAAI,EAAE;AACzD,QAAA;AACF,MAAA;AAEA;AACA,MAAA,IAAIW,KAAK,CAACC,GAAG,KAAK,KAAK,EAAE;AACvB,QAAA;AACF,MAAA;AAEA;AACA,MAAA,IAAID,KAAK,CAACC,GAAG,KAAK,QAAQ,EAAE;AAC1BR,QAAAA,SAAS,GAAG;AACV,UAAA,GAAGO,KAAK;AACRE,UAAAA,cAAc,EAAEA,MAAK,CAAE,CAAC;UACxBC,eAAe,EAAEA,MAAK,CAAE;AACzB,SAAA,CAAC;AACF,QAAA;AACF,MAAA;MAEAV,SAAS,GAAGO,KAAK,CAAC;IACpB,CAAE;IAAA,GACEN;AAAS,GAAC,CACd;AAEN,CAAC;;;;"}
@@ -1,46 +0,0 @@
1
- import { forwardRef, useEffect } from 'react';
2
- import { useEffectEvent } from '../../../../common/hooks/useEffectEvent.mjs';
3
- import { jsx } from 'react/jsx-runtime';
4
-
5
- const SelectInputOptionsContainer = /*#__PURE__*/forwardRef(function SelectInputOptionsContainer({
6
- 'aria-orientation': ariaOrientation,
7
- 'aria-activedescendant': ariaActiveDescendant,
8
- role,
9
- tabIndex,
10
- onAriaActiveDescendantChange,
11
- onKeyDown,
12
- ...restProps
13
- }, ref) {
14
- const handleAriaActiveDescendantChange = useEffectEvent(onAriaActiveDescendantChange);
15
- useEffect(() => {
16
- handleAriaActiveDescendantChange(ariaActiveDescendant);
17
- }, [ariaActiveDescendant, handleAriaActiveDescendantChange]);
18
- return /*#__PURE__*/jsx("div", {
19
- ref: ref,
20
- role: "none",
21
- onKeyDown: event => {
22
- // Prevent confirmation close without an active item
23
- if (event.key === 'Enter' && ariaActiveDescendant == null) {
24
- return;
25
- }
26
- // Required to make ListBox focusable
27
- if (event.key === 'Tab') {
28
- return;
29
- }
30
- // Prevent absorbing Escape early
31
- if (event.key === 'Escape') {
32
- onKeyDown?.({
33
- ...event,
34
- preventDefault: () => {},
35
- stopPropagation: () => {}
36
- });
37
- return;
38
- }
39
- onKeyDown?.(event);
40
- },
41
- ...restProps
42
- });
43
- });
44
-
45
- export { SelectInputOptionsContainer };
46
- //# sourceMappingURL=SelectInputOptionsContainer.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SelectInputOptionsContainer.mjs","sources":["../../../../../src/inputs/SelectInput/Options/OptionsContainer/SelectInputOptionsContainer.tsx"],"sourcesContent":["import { forwardRef, useEffect } from 'react';\nimport { useEffectEvent } from '../../../../common/hooks/useEffectEvent';\n\ninterface SelectInputOptionsContainerProps extends React.ComponentPropsWithRef<'div'> {\n onAriaActiveDescendantChange: (value: React.AriaAttributes['aria-activedescendant']) => void;\n}\n\nexport const SelectInputOptionsContainer = forwardRef(function SelectInputOptionsContainer(\n {\n 'aria-orientation': ariaOrientation,\n 'aria-activedescendant': ariaActiveDescendant,\n role,\n tabIndex,\n onAriaActiveDescendantChange,\n onKeyDown,\n ...restProps\n }: SelectInputOptionsContainerProps,\n ref: React.ForwardedRef<HTMLDivElement | null>,\n) {\n const handleAriaActiveDescendantChange = useEffectEvent(onAriaActiveDescendantChange);\n useEffect(() => {\n handleAriaActiveDescendantChange(ariaActiveDescendant);\n }, [ariaActiveDescendant, handleAriaActiveDescendantChange]);\n\n return (\n <div\n ref={ref}\n role=\"none\"\n onKeyDown={(event) => {\n // Prevent confirmation close without an active item\n if (event.key === 'Enter' && ariaActiveDescendant == null) {\n return;\n }\n\n // Required to make ListBox focusable\n if (event.key === 'Tab') {\n return;\n }\n\n // Prevent absorbing Escape early\n if (event.key === 'Escape') {\n onKeyDown?.({\n ...event,\n preventDefault: () => {},\n stopPropagation: () => {},\n });\n return;\n }\n\n onKeyDown?.(event);\n }}\n {...restProps}\n />\n );\n});\n"],"names":["SelectInputOptionsContainer","forwardRef","ariaOrientation","ariaActiveDescendant","role","tabIndex","onAriaActiveDescendantChange","onKeyDown","restProps","ref","handleAriaActiveDescendantChange","useEffectEvent","useEffect","_jsx","event","key","preventDefault","stopPropagation"],"mappings":";;;;MAOaA,2BAA2B,gBAAGC,UAAU,CAAC,SAASD,2BAA2BA,CACxF;AACE,EAAA,kBAAkB,EAAEE,eAAe;AACnC,EAAA,uBAAuB,EAAEC,oBAAoB;EAC7CC,IAAI;EACJC,QAAQ;EACRC,4BAA4B;EAC5BC,SAAS;EACT,GAAGC;AAAS,CACqB,EACnCC,GAA8C,EAAA;AAE9C,EAAA,MAAMC,gCAAgC,GAAGC,cAAc,CAACL,4BAA4B,CAAC;AACrFM,EAAAA,SAAS,CAAC,MAAK;IACbF,gCAAgC,CAACP,oBAAoB,CAAC;AACxD,EAAA,CAAC,EAAE,CAACA,oBAAoB,EAAEO,gCAAgC,CAAC,CAAC;AAE5D,EAAA,oBACEG,GAAA,CAAA,KAAA,EAAA;AACEJ,IAAAA,GAAG,EAAEA,GAAI;AACTL,IAAAA,IAAI,EAAC,MAAM;IACXG,SAAS,EAAGO,KAAK,IAAI;AACnB;MACA,IAAIA,KAAK,CAACC,GAAG,KAAK,OAAO,IAAIZ,oBAAoB,IAAI,IAAI,EAAE;AACzD,QAAA;AACF,MAAA;AAEA;AACA,MAAA,IAAIW,KAAK,CAACC,GAAG,KAAK,KAAK,EAAE;AACvB,QAAA;AACF,MAAA;AAEA;AACA,MAAA,IAAID,KAAK,CAACC,GAAG,KAAK,QAAQ,EAAE;AAC1BR,QAAAA,SAAS,GAAG;AACV,UAAA,GAAGO,KAAK;AACRE,UAAAA,cAAc,EAAEA,MAAK,CAAE,CAAC;UACxBC,eAAe,EAAEA,MAAK,CAAE;AACzB,SAAA,CAAC;AACF,QAAA;AACF,MAAA;MAEAV,SAAS,GAAGO,KAAK,CAAC;IACpB,CAAE;IAAA,GACEN;AAAS,GAAC,CACd;AAEN,CAAC;;;;"}
@@ -1,270 +0,0 @@
1
- 'use strict';
2
-
3
- var React = require('react');
4
- var virtua = require('virtua');
5
- var react = require('@headlessui/react');
6
- var icons = require('@transferwise/icons');
7
- var reactIntl = require('react-intl');
8
- var clsx = require('clsx');
9
- var SearchInput = require('../../SearchInput.js');
10
- var SelectInput_messages = require('../SelectInput.messages.js');
11
- var SelectInput_helpers = require('../SelectInput.helpers.js');
12
- var SelectInput_constants = require('../SelectInput.constants.js');
13
- var SelectInputOptionsContainer = require('./OptionsContainer/SelectInputOptionsContainer.js');
14
- var SelectInputItemView = require('./ItemView/SelectInputItemView.js');
15
- var SelectInputOption = require('./ItemView/Option/SelectInputOption.js');
16
- var jsxRuntime = require('react/jsx-runtime');
17
-
18
- function SelectInputOptions({
19
- id,
20
- parentId,
21
- items,
22
- compareValues: compareValuesProp,
23
- renderValue = String,
24
- renderFooter,
25
- filterable = false,
26
- filterPlaceholder,
27
- sortFilteredOptions,
28
- searchInputRef,
29
- listboxRef,
30
- filterQuery,
31
- onFilterChange,
32
- listBoxLabel,
33
- listBoxLabelledBy,
34
- autocomplete,
35
- name,
36
- onAutocompleteSelect
37
- }) {
38
- const intl = reactIntl.useIntl();
39
- const virtualiserHandlerRef = React.useRef(null);
40
- const controllerRef = filterable ? searchInputRef : listboxRef;
41
- const [initialRender, setInitialRender] = React.useState(true);
42
- const needle = React.useMemo(() => {
43
- if (filterable) {
44
- return filterQuery ? SelectInput_helpers.searchableString(filterQuery) : null;
45
- }
46
- return undefined;
47
- }, [filterQuery, filterable]);
48
- React.useEffect(() => {
49
- if (needle) {
50
- // Ensure having an active option while filtering.
51
- // Without `requestAnimationFrame` upon which React depends for scheduling
52
- // updates, the active status would only show for a split second and then
53
- // disappear inadvertently.
54
- requestAnimationFrame(() => {
55
- if (controllerRef.current != null && !controllerRef.current.hasAttribute('aria-activedescendant')) {
56
- // Activate first option via synthetic key press
57
- controllerRef.current.dispatchEvent(new KeyboardEvent('keydown', {
58
- key: 'Home',
59
- bubbles: true
60
- }));
61
- }
62
- });
63
- }
64
- }, [controllerRef, needle]);
65
- const compareValues = React.useMemo(() => {
66
- if (!compareValuesProp) {
67
- return undefined;
68
- }
69
- if (typeof compareValuesProp === 'function') {
70
- return (a, b) => compareValuesProp(a, b);
71
- }
72
- const key = compareValuesProp;
73
- return (a, b) => {
74
- if (typeof a === 'object' && a != null && typeof b === 'object' && b != null) {
75
- return a[key] === b[key];
76
- }
77
- return a === b;
78
- };
79
- }, [compareValuesProp]);
80
- const filteredItems = React.useMemo(() => {
81
- if (needle == null) {
82
- return items;
83
- }
84
- const filtered = SelectInput_helpers.filterSelectInputItems(SelectInput_helpers.dedupeSelectInputItems(items, compareValues), item => SelectInput_helpers.selectInputOptionItemIncludesNeedle(item, needle));
85
- if (sortFilteredOptions) {
86
- return SelectInput_helpers.sortSelectInputItems(filtered, sortFilteredOptions, filterQuery);
87
- }
88
- return filtered;
89
- // eslint-disable-next-line react-hooks/exhaustive-deps
90
- }, [needle, items, compareValues]);
91
- const resultsEmpty = needle != null && filteredItems.length === 0;
92
- const virtualized = filteredItems.length > SelectInput_constants.SELECT_INPUT_MAX_ITEMS_WITHOUT_VIRTUALIZATION;
93
- // Items shown once shall be kept mounted until the needle changes, otherwise
94
- // the scroll position may jump around inadvertently. Pattern adopted from:
95
- // https://inokawa.github.io/virtua/?path=/story/advanced-keep-offscreen-items--append-only
96
- const [mountedIndexes, setMountedIndexes] = React.useState([]);
97
- React.useEffect(() => {
98
- // Ensure the 'End' key works as intended by keeping the last item mounted
99
- setMountedIndexes(prevMountedIndexes => {
100
- const indexes = new Set(prevMountedIndexes);
101
- indexes.add(filteredItems.length - 1);
102
- return [...indexes]; // Sorting is redundant by nature here
103
- });
104
- }, [needle,
105
- // Needed as `filteredItems.length` may be equal between two updates
106
- filteredItems.length]);
107
- const listboxContainerRef = React.useRef(null);
108
- React.useEffect(() => {
109
- if (listboxContainerRef.current != null) {
110
- listboxContainerRef.current.style.setProperty('--initial-height', `${listboxContainerRef.current.offsetHeight}px`);
111
- }
112
- }, []);
113
- React.useEffect(() => {
114
- setInitialRender(false);
115
- }, []);
116
- const showStatus = resultsEmpty;
117
- const statusId = React.useId();
118
- const listboxId = React.useId();
119
- const getItemNode = index => {
120
- const item = filteredItems[index];
121
- return /*#__PURE__*/jsxRuntime.jsx(SelectInputItemView.SelectInputItemView, {
122
- item: item,
123
- renderValue: renderValue,
124
- needle: needle
125
- }, index);
126
- };
127
- const findMatchingItem = autocompleteValue => {
128
- const flatOptions = items.flatMap(item => item.type === 'group' ? item.options : item.type === 'option' ? [item] : []).filter(item => item.type === 'option' && item.value != null);
129
- const exactMatch = flatOptions.find(option => String(option.value) === autocompleteValue || option.filterMatchers?.some(matcher => matcher === autocompleteValue));
130
- if (exactMatch) {
131
- return exactMatch.value;
132
- }
133
- const fuzzyMatch = flatOptions.find(option => option.filterMatchers?.some(matcher => matcher.toLowerCase().includes(autocompleteValue.toLowerCase())));
134
- return fuzzyMatch ? fuzzyMatch.value : null;
135
- };
136
- return /*#__PURE__*/jsxRuntime.jsxs(react.ListboxOptions, {
137
- modal: true,
138
- as: SelectInputOptionsContainer.SelectInputOptionsContainer,
139
- static: true,
140
- className: "np-select-input-options-container",
141
- onAriaActiveDescendantChange: value => {
142
- if (controllerRef.current != null) {
143
- if (!initialRender && value != null) {
144
- controllerRef.current.setAttribute('aria-activedescendant', value);
145
- } else {
146
- controllerRef.current.removeAttribute('aria-activedescendant');
147
- }
148
- }
149
- },
150
- children: [filterable ? /*#__PURE__*/jsxRuntime.jsx("div", {
151
- className: "np-select-input-query-container",
152
- children: /*#__PURE__*/jsxRuntime.jsx(SearchInput.SearchInput, {
153
- ref: searchInputRef,
154
- id: id,
155
- name: name,
156
- autoComplete: autocomplete,
157
- role: "combobox",
158
- shape: "rectangle",
159
- placeholder: filterPlaceholder,
160
- "aria-label": filterPlaceholder,
161
- defaultValue: filterQuery,
162
- "aria-autocomplete": "list",
163
- "aria-expanded": true,
164
- "aria-controls": listboxId,
165
- "aria-describedby": showStatus ? statusId : undefined,
166
- onKeyDown: event => {
167
- // Prevent interfering with the matcher of Headless UI
168
- // https://mathiasbynens.be/notes/javascript-unicode#regex
169
- if (/^.$/u.test(event.key)) {
170
- event.stopPropagation();
171
- }
172
- },
173
- onChange: event => {
174
- // Free up resources and ensure not to go out of bounds when the
175
- // resulting item count is less than before
176
- const inputValue = event.currentTarget.value;
177
- // Free up resources and ensure not to go out of bounds
178
- setMountedIndexes([]);
179
- onFilterChange(inputValue);
180
- },
181
- onInput: event => {
182
- const inputValue = event.currentTarget.value;
183
- const inputElement = event.currentTarget;
184
- if (autocomplete && onAutocompleteSelect && inputValue) {
185
- setTimeout(() => {
186
- if (inputElement.value === inputValue && inputValue.length > 2) {
187
- const matchedValue = findMatchingItem(inputValue);
188
- if (matchedValue !== null) {
189
- onAutocompleteSelect(matchedValue);
190
- }
191
- }
192
- }, 50);
193
- }
194
- }
195
- })
196
- }) : null, /*#__PURE__*/jsxRuntime.jsxs("section", {
197
- ref: listboxContainerRef,
198
- tabIndex: -1,
199
- className: clsx.clsx('np-select-input-listbox-container', virtualized && 'np-select-input-listbox-container--virtualized', needle == null &&
200
- // Groups aren't shown when filtering
201
- items.some(item => item.type === 'group') && 'np-select-input-listbox-container--has-group'),
202
- "data-wds-parent": parentId ?? undefined,
203
- children: [resultsEmpty ? /*#__PURE__*/jsxRuntime.jsxs("div", {
204
- id: statusId,
205
- className: "np-select-input-options-status",
206
- children: [/*#__PURE__*/jsxRuntime.jsx(icons.CrossCircle, {
207
- size: 16,
208
- className: "np-select-input-options-status-icon"
209
- }), intl.formatMessage(SelectInput_messages.default.noResultsFound)]
210
- }) : null, /*#__PURE__*/jsxRuntime.jsx("div", {
211
- ref: listboxRef,
212
- id: listboxId,
213
- role: "listbox",
214
- "aria-orientation": "vertical",
215
- "aria-label": listBoxLabel,
216
- "aria-labelledby": listBoxLabelledBy,
217
- tabIndex: 0,
218
- className: "np-select-input-listbox",
219
- children: !virtualized ? filteredItems.map((_, index) => getItemNode(index)) : /*#__PURE__*/jsxRuntime.jsx(virtua.Virtualizer, {
220
- ref: virtualiserHandlerRef,
221
- data: filteredItems,
222
- keepMounted: mountedIndexes,
223
- scrollRef: listboxRef // `VList` doesn't expose this
224
- ,
225
- onScroll: async () => {
226
- if (!virtualiserHandlerRef.current) return;
227
- const startIndex = virtualiserHandlerRef.current.findItemIndex(virtualiserHandlerRef.current.scrollOffset);
228
- const endIndex = virtualiserHandlerRef.current.findItemIndex(virtualiserHandlerRef.current.scrollOffset + virtualiserHandlerRef.current.viewportSize);
229
- setMountedIndexes(prevMountedIndexes => {
230
- const indexes = new Set(prevMountedIndexes);
231
- for (let index = startIndex; index <= endIndex; index += 1) {
232
- indexes.add(index);
233
- }
234
- return [...indexes].sort((a, b) => a - b);
235
- });
236
- },
237
- children: (item, index) =>
238
- /*#__PURE__*/
239
- // The position of each item can't be inferred by browsers when
240
- // virtualizing, as some of the items may not be in the DOM
241
- jsxRuntime.jsx(SelectInputOption.SelectInputItemsCountContext.Provider, {
242
- value: filteredItems.length,
243
- children: /*#__PURE__*/jsxRuntime.jsx(SelectInputOption.SelectInputItemPositionContext.Provider, {
244
- value: index + 1,
245
- children: getItemNode(index)
246
- })
247
- })
248
- }, needle)
249
- }), renderFooter != null ? /*#__PURE__*/jsxRuntime.jsx("footer", {
250
- className: "np-select-input-footer",
251
- children: /*#__PURE__*/jsxRuntime.jsx("div", {
252
- role: "none",
253
- onKeyDown: event => {
254
- // Prevent interfering with Headless UI
255
- if (event.key !== 'Escape') {
256
- event.stopPropagation();
257
- }
258
- },
259
- children: renderFooter({
260
- resultsEmpty,
261
- queryNormalized: needle
262
- })
263
- })
264
- }) : null]
265
- })]
266
- });
267
- }
268
-
269
- exports.SelectInputOptions = SelectInputOptions;
270
- //# sourceMappingURL=SelectInputOptions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SelectInputOptions.js","sources":["../../../../src/inputs/SelectInput/Options/SelectInputOptions.tsx"],"sourcesContent":["import { useEffect, useId, useMemo, useRef, useState } from 'react';\nimport { Virtualizer, type VirtualizerHandle } from 'virtua';\nimport { ListboxOptions } from '@headlessui/react';\nimport { CrossCircle } from '@transferwise/icons';\nimport { useIntl } from 'react-intl';\nimport { clsx } from 'clsx';\n\nimport { SearchInput } from '../../SearchInput';\nimport messages from '../SelectInput.messages';\nimport type {\n SelectInputProps,\n SelectInputOptionItem,\n SelectInputItem,\n} from '../SelectInput.types';\nimport {\n searchableString,\n dedupeSelectInputItems,\n filterSelectInputItems,\n selectInputOptionItemIncludesNeedle,\n sortSelectInputItems,\n} from '../SelectInput.helpers';\nimport { SELECT_INPUT_MAX_ITEMS_WITHOUT_VIRTUALIZATION } from '../SelectInput.constants';\n\nimport { SelectInputOptionsContainer } from './OptionsContainer';\nimport { SelectInputItemView } from './ItemView';\nimport { SelectInputItemsCountContext, SelectInputItemPositionContext } from './ItemView/Option';\n\ninterface SelectInputOptionsProps<T = string> extends Pick<\n SelectInputProps<T>,\n | 'items'\n | 'renderValue'\n | 'renderFooter'\n | 'filterable'\n | 'filterPlaceholder'\n | 'id'\n | 'parentId'\n | 'compareValues'\n | 'sortFilteredOptions'\n> {\n searchInputRef: React.MutableRefObject<HTMLInputElement | null>;\n listboxRef: React.MutableRefObject<HTMLDivElement | null>;\n filterQuery: string;\n onFilterChange: (query: string) => void;\n listBoxLabel?: string;\n listBoxLabelledBy?: string;\n autocomplete?: string;\n name?: string;\n onAutocompleteSelect?: (value: T) => void;\n}\n\nexport function SelectInputOptions<T = string>({\n id,\n parentId,\n items,\n compareValues: compareValuesProp,\n renderValue = String,\n renderFooter,\n filterable = false,\n filterPlaceholder,\n sortFilteredOptions,\n searchInputRef,\n listboxRef,\n filterQuery,\n onFilterChange,\n listBoxLabel,\n listBoxLabelledBy,\n autocomplete,\n name,\n onAutocompleteSelect,\n}: SelectInputOptionsProps<T>) {\n const intl = useIntl();\n const virtualiserHandlerRef = useRef<VirtualizerHandle>(null);\n const controllerRef = filterable ? searchInputRef : listboxRef;\n const [initialRender, setInitialRender] = useState(true);\n\n const needle = useMemo(() => {\n if (filterable) {\n return filterQuery ? searchableString(filterQuery) : null;\n }\n return undefined;\n }, [filterQuery, filterable]);\n\n useEffect(() => {\n if (needle) {\n // Ensure having an active option while filtering.\n // Without `requestAnimationFrame` upon which React depends for scheduling\n // updates, the active status would only show for a split second and then\n // disappear inadvertently.\n requestAnimationFrame(() => {\n if (\n controllerRef.current != null &&\n !controllerRef.current.hasAttribute('aria-activedescendant')\n ) {\n // Activate first option via synthetic key press\n controllerRef.current.dispatchEvent(\n new KeyboardEvent('keydown', { key: 'Home', bubbles: true }),\n );\n }\n });\n }\n }, [controllerRef, needle]);\n\n const compareValues = useMemo(() => {\n if (!compareValuesProp) {\n return undefined;\n }\n\n if (typeof compareValuesProp === 'function') {\n return (a: NonNullable<T>, b: NonNullable<T>) => compareValuesProp(a, b);\n }\n\n const key = compareValuesProp;\n return (a: NonNullable<T>, b: NonNullable<T>) => {\n if (typeof a === 'object' && a != null && typeof b === 'object' && b != null) {\n return (a as Record<string, unknown>)[key] === (b as Record<string, unknown>)[key];\n }\n return a === b;\n };\n }, [compareValuesProp]);\n\n const filteredItems: readonly SelectInputItem<NonNullable<T> | undefined>[] = useMemo(() => {\n if (needle == null) {\n return items;\n }\n\n const filtered = filterSelectInputItems(dedupeSelectInputItems(items, compareValues), (item) =>\n selectInputOptionItemIncludesNeedle(item, needle),\n );\n\n if (sortFilteredOptions) {\n return sortSelectInputItems(filtered, sortFilteredOptions, filterQuery);\n }\n\n return filtered;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [needle, items, compareValues]);\n const resultsEmpty = needle != null && filteredItems.length === 0;\n\n const virtualized = filteredItems.length > SELECT_INPUT_MAX_ITEMS_WITHOUT_VIRTUALIZATION;\n\n // Items shown once shall be kept mounted until the needle changes, otherwise\n // the scroll position may jump around inadvertently. Pattern adopted from:\n // https://inokawa.github.io/virtua/?path=/story/advanced-keep-offscreen-items--append-only\n const [mountedIndexes, setMountedIndexes] = useState<number[]>([]);\n useEffect(() => {\n // Ensure the 'End' key works as intended by keeping the last item mounted\n setMountedIndexes((prevMountedIndexes) => {\n const indexes = new Set(prevMountedIndexes);\n indexes.add(filteredItems.length - 1);\n return [...indexes]; // Sorting is redundant by nature here\n });\n }, [\n needle, // Needed as `filteredItems.length` may be equal between two updates\n filteredItems.length,\n ]);\n\n const listboxContainerRef = useRef<HTMLDivElement>(null);\n useEffect(() => {\n if (listboxContainerRef.current != null) {\n listboxContainerRef.current.style.setProperty(\n '--initial-height',\n `${listboxContainerRef.current.offsetHeight}px`,\n );\n }\n }, []);\n\n useEffect(() => {\n setInitialRender(false);\n }, []);\n\n const showStatus = resultsEmpty;\n const statusId = useId();\n const listboxId = useId();\n\n const getItemNode = (index: number) => {\n const item = filteredItems[index];\n return (\n <SelectInputItemView key={index} item={item} renderValue={renderValue} needle={needle} />\n );\n };\n\n const findMatchingItem = (autocompleteValue: string): T | null => {\n const flatOptions = items\n .flatMap((item) =>\n item.type === 'group' ? item.options : item.type === 'option' ? [item] : [],\n )\n .filter(\n (item): item is SelectInputOptionItem<NonNullable<T>> =>\n item.type === 'option' && item.value != null,\n );\n\n const exactMatch = flatOptions.find(\n (option) =>\n String(option.value) === autocompleteValue ||\n option.filterMatchers?.some((matcher) => matcher === autocompleteValue),\n );\n\n if (exactMatch) {\n return exactMatch.value;\n }\n\n const fuzzyMatch = flatOptions.find((option) =>\n option.filterMatchers?.some((matcher) =>\n matcher.toLowerCase().includes(autocompleteValue.toLowerCase()),\n ),\n );\n\n return fuzzyMatch ? fuzzyMatch.value : null;\n };\n\n return (\n <ListboxOptions\n modal\n as={SelectInputOptionsContainer}\n static\n className=\"np-select-input-options-container\"\n onAriaActiveDescendantChange={(value: React.AriaAttributes['aria-activedescendant']) => {\n if (controllerRef.current != null) {\n if (!initialRender && value != null) {\n controllerRef.current.setAttribute('aria-activedescendant', value);\n } else {\n controllerRef.current.removeAttribute('aria-activedescendant');\n }\n }\n }}\n >\n {filterable ? (\n <div className=\"np-select-input-query-container\">\n <SearchInput\n ref={searchInputRef}\n id={id}\n name={name}\n autoComplete={autocomplete}\n role=\"combobox\"\n shape=\"rectangle\"\n placeholder={filterPlaceholder}\n aria-label={filterPlaceholder}\n defaultValue={filterQuery}\n aria-autocomplete=\"list\"\n aria-expanded\n aria-controls={listboxId}\n aria-describedby={showStatus ? statusId : undefined}\n onKeyDown={(event) => {\n // Prevent interfering with the matcher of Headless UI\n // https://mathiasbynens.be/notes/javascript-unicode#regex\n if (/^.$/u.test(event.key)) {\n event.stopPropagation();\n }\n }}\n onChange={(event) => {\n // Free up resources and ensure not to go out of bounds when the\n // resulting item count is less than before\n const inputValue = event.currentTarget.value;\n\n // Free up resources and ensure not to go out of bounds\n setMountedIndexes([]);\n onFilterChange(inputValue);\n }}\n onInput={(event) => {\n const inputValue = event.currentTarget.value;\n const inputElement = event.currentTarget;\n\n if (autocomplete && onAutocompleteSelect && inputValue) {\n setTimeout(() => {\n if (inputElement.value === inputValue && inputValue.length > 2) {\n const matchedValue = findMatchingItem(inputValue);\n if (matchedValue !== null) {\n onAutocompleteSelect(matchedValue);\n }\n }\n }, 50);\n }\n }}\n />\n </div>\n ) : null}\n\n <section\n ref={listboxContainerRef}\n tabIndex={-1}\n className={clsx(\n 'np-select-input-listbox-container',\n virtualized && 'np-select-input-listbox-container--virtualized',\n needle == null && // Groups aren't shown when filtering\n items.some((item) => item.type === 'group') &&\n 'np-select-input-listbox-container--has-group',\n )}\n data-wds-parent={parentId ?? undefined}\n >\n {resultsEmpty ? (\n <div id={statusId} className=\"np-select-input-options-status\">\n <CrossCircle size={16} className=\"np-select-input-options-status-icon\" />\n {intl.formatMessage(messages.noResultsFound)}\n </div>\n ) : null}\n\n <div\n ref={listboxRef}\n id={listboxId}\n role=\"listbox\"\n aria-orientation=\"vertical\"\n aria-label={listBoxLabel}\n aria-labelledby={listBoxLabelledBy}\n tabIndex={0}\n className=\"np-select-input-listbox\"\n >\n {!virtualized ? (\n filteredItems.map((_, index) => getItemNode(index))\n ) : (\n <Virtualizer\n ref={virtualiserHandlerRef}\n key={needle}\n data={filteredItems}\n keepMounted={mountedIndexes}\n scrollRef={listboxRef} // `VList` doesn't expose this\n onScroll={async () => {\n if (!virtualiserHandlerRef.current) return;\n\n const startIndex = virtualiserHandlerRef.current.findItemIndex(\n virtualiserHandlerRef.current.scrollOffset,\n );\n const endIndex = virtualiserHandlerRef.current.findItemIndex(\n virtualiserHandlerRef.current.scrollOffset +\n virtualiserHandlerRef.current.viewportSize,\n );\n\n setMountedIndexes((prevMountedIndexes) => {\n const indexes = new Set(prevMountedIndexes);\n\n for (let index = startIndex; index <= endIndex; index += 1) {\n indexes.add(index);\n }\n\n return [...indexes].sort((a, b) => a - b);\n });\n }}\n >\n {(item, index) => (\n // The position of each item can't be inferred by browsers when\n // virtualizing, as some of the items may not be in the DOM\n <SelectInputItemsCountContext.Provider value={filteredItems.length}>\n <SelectInputItemPositionContext.Provider value={index + 1}>\n {getItemNode(index)}\n </SelectInputItemPositionContext.Provider>\n </SelectInputItemsCountContext.Provider>\n )}\n </Virtualizer>\n )}\n </div>\n\n {renderFooter != null ? (\n <footer className=\"np-select-input-footer\">\n <div\n role=\"none\"\n onKeyDown={(event) => {\n // Prevent interfering with Headless UI\n if (event.key !== 'Escape') {\n event.stopPropagation();\n }\n }}\n >\n {renderFooter({\n resultsEmpty,\n queryNormalized: needle,\n })}\n </div>\n </footer>\n ) : null}\n </section>\n </ListboxOptions>\n );\n}\n"],"names":["SelectInputOptions","id","parentId","items","compareValues","compareValuesProp","renderValue","String","renderFooter","filterable","filterPlaceholder","sortFilteredOptions","searchInputRef","listboxRef","filterQuery","onFilterChange","listBoxLabel","listBoxLabelledBy","autocomplete","name","onAutocompleteSelect","intl","useIntl","virtualiserHandlerRef","useRef","controllerRef","initialRender","setInitialRender","useState","needle","useMemo","searchableString","undefined","useEffect","requestAnimationFrame","current","hasAttribute","dispatchEvent","KeyboardEvent","key","bubbles","a","b","filteredItems","filtered","filterSelectInputItems","dedupeSelectInputItems","item","selectInputOptionItemIncludesNeedle","sortSelectInputItems","resultsEmpty","length","virtualized","SELECT_INPUT_MAX_ITEMS_WITHOUT_VIRTUALIZATION","mountedIndexes","setMountedIndexes","prevMountedIndexes","indexes","Set","add","listboxContainerRef","style","setProperty","offsetHeight","showStatus","statusId","useId","listboxId","getItemNode","index","_jsx","SelectInputItemView","findMatchingItem","autocompleteValue","flatOptions","flatMap","type","options","filter","value","exactMatch","find","option","filterMatchers","some","matcher","fuzzyMatch","toLowerCase","includes","_jsxs","ListboxOptions","modal","as","SelectInputOptionsContainer","static","className","onAriaActiveDescendantChange","setAttribute","removeAttribute","children","SearchInput","ref","autoComplete","role","shape","placeholder","defaultValue","onKeyDown","event","test","stopPropagation","onChange","inputValue","currentTarget","onInput","inputElement","setTimeout","matchedValue","tabIndex","clsx","CrossCircle","size","formatMessage","messages","noResultsFound","map","_","Virtualizer","data","keepMounted","scrollRef","onScroll","startIndex","findItemIndex","scrollOffset","endIndex","viewportSize","sort","SelectInputItemsCountContext","Provider","SelectInputItemPositionContext","queryNormalized"],"mappings":";;;;;;;;;;;;;;;;;AAkDM,SAAUA,kBAAkBA,CAAa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