@transferwise/components 0.0.0-experimental-a18466a → 0.0.0-experimental-e789c10

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 (257) hide show
  1. package/build/criticalBanner/CriticalCommsBanner.js +68 -3
  2. package/build/criticalBanner/CriticalCommsBanner.js.map +1 -1
  3. package/build/criticalBanner/CriticalCommsBanner.mjs +69 -4
  4. package/build/criticalBanner/CriticalCommsBanner.mjs.map +1 -1
  5. package/build/dateInput/DateInput.js +12 -5
  6. package/build/dateInput/DateInput.js.map +1 -1
  7. package/build/dateInput/DateInput.mjs +11 -4
  8. package/build/dateInput/DateInput.mjs.map +1 -1
  9. package/build/expressiveMoneyInput/currencySelector/CurrencySelector.js +16 -8
  10. package/build/expressiveMoneyInput/currencySelector/CurrencySelector.js.map +1 -1
  11. package/build/expressiveMoneyInput/currencySelector/CurrencySelector.mjs +14 -6
  12. package/build/expressiveMoneyInput/currencySelector/CurrencySelector.mjs.map +1 -1
  13. package/build/index.js +12 -7
  14. package/build/index.js.map +1 -1
  15. package/build/index.mjs +9 -3
  16. package/build/index.mjs.map +1 -1
  17. package/build/inputs/{_BottomSheet.js → SelectInput/BottomSheet/SelectInputBottomSheet.js} +7 -7
  18. package/build/inputs/SelectInput/BottomSheet/SelectInputBottomSheet.js.map +1 -0
  19. package/build/inputs/{_BottomSheet.mjs → SelectInput/BottomSheet/SelectInputBottomSheet.mjs} +7 -7
  20. package/build/inputs/SelectInput/BottomSheet/SelectInputBottomSheet.mjs.map +1 -0
  21. package/build/inputs/{_ButtonInput.js → SelectInput/ButtonInput/SelectInputButtonInput.js} +5 -5
  22. package/build/inputs/SelectInput/ButtonInput/SelectInputButtonInput.js.map +1 -0
  23. package/build/inputs/{_ButtonInput.mjs → SelectInput/ButtonInput/SelectInputButtonInput.mjs} +5 -5
  24. package/build/inputs/SelectInput/ButtonInput/SelectInputButtonInput.mjs.map +1 -0
  25. package/build/inputs/SelectInput/ClearButton/SelectInputClearButton.js +26 -0
  26. package/build/inputs/SelectInput/ClearButton/SelectInputClearButton.js.map +1 -0
  27. package/build/inputs/SelectInput/ClearButton/SelectInputClearButton.mjs +24 -0
  28. package/build/inputs/SelectInput/ClearButton/SelectInputClearButton.mjs.map +1 -0
  29. package/build/inputs/SelectInput/DefaultRenderTrigger/SelectInputDefaultRenderTrigger.js +59 -0
  30. package/build/inputs/SelectInput/DefaultRenderTrigger/SelectInputDefaultRenderTrigger.js.map +1 -0
  31. package/build/inputs/SelectInput/DefaultRenderTrigger/SelectInputDefaultRenderTrigger.mjs +56 -0
  32. package/build/inputs/SelectInput/DefaultRenderTrigger/SelectInputDefaultRenderTrigger.mjs.map +1 -0
  33. package/build/inputs/SelectInput/ItemView/GroupItemView/SelectInputGroupItemView.js +50 -0
  34. package/build/inputs/SelectInput/ItemView/GroupItemView/SelectInputGroupItemView.js.map +1 -0
  35. package/build/inputs/SelectInput/ItemView/GroupItemView/SelectInputGroupItemView.mjs +48 -0
  36. package/build/inputs/SelectInput/ItemView/GroupItemView/SelectInputGroupItemView.mjs.map +1 -0
  37. package/build/inputs/SelectInput/ItemView/SelectInputItemView.js +47 -0
  38. package/build/inputs/SelectInput/ItemView/SelectInputItemView.js.map +1 -0
  39. package/build/inputs/SelectInput/ItemView/SelectInputItemView.mjs +45 -0
  40. package/build/inputs/SelectInput/ItemView/SelectInputItemView.mjs.map +1 -0
  41. package/build/inputs/SelectInput/Option/SelectInputOption.js +42 -0
  42. package/build/inputs/SelectInput/Option/SelectInputOption.js.map +1 -0
  43. package/build/inputs/SelectInput/Option/SelectInputOption.mjs +40 -0
  44. package/build/inputs/SelectInput/Option/SelectInputOption.mjs.map +1 -0
  45. package/build/inputs/SelectInput/OptionContent/SelectInputOptionContent.js +40 -0
  46. package/build/inputs/SelectInput/OptionContent/SelectInputOptionContent.js.map +1 -0
  47. package/build/inputs/SelectInput/OptionContent/SelectInputOptionContent.mjs +38 -0
  48. package/build/inputs/SelectInput/OptionContent/SelectInputOptionContent.mjs.map +1 -0
  49. package/build/inputs/SelectInput/Options/OptionsContainer/SelectInputOptionsContainer.js +48 -0
  50. package/build/inputs/SelectInput/Options/OptionsContainer/SelectInputOptionsContainer.js.map +1 -0
  51. package/build/inputs/SelectInput/Options/OptionsContainer/SelectInputOptionsContainer.mjs +46 -0
  52. package/build/inputs/SelectInput/Options/OptionsContainer/SelectInputOptionsContainer.mjs.map +1 -0
  53. package/build/inputs/SelectInput/Options/SelectInputOptions.js +300 -0
  54. package/build/inputs/SelectInput/Options/SelectInputOptions.js.map +1 -0
  55. package/build/inputs/SelectInput/Options/SelectInputOptions.mjs +298 -0
  56. package/build/inputs/SelectInput/Options/SelectInputOptions.mjs.map +1 -0
  57. package/build/inputs/{_Popover.js → SelectInput/Popover/SelectInputPopover.js} +7 -7
  58. package/build/inputs/SelectInput/Popover/SelectInputPopover.js.map +1 -0
  59. package/build/inputs/{_Popover.mjs → SelectInput/Popover/SelectInputPopover.mjs} +7 -7
  60. package/build/inputs/SelectInput/Popover/SelectInputPopover.mjs.map +1 -0
  61. package/build/inputs/SelectInput/SelectInput.contexts.js +29 -0
  62. package/build/inputs/SelectInput/SelectInput.contexts.js.map +1 -0
  63. package/build/inputs/SelectInput/SelectInput.contexts.mjs +24 -0
  64. package/build/inputs/SelectInput/SelectInput.contexts.mjs.map +1 -0
  65. package/build/inputs/SelectInput/SelectInput.js +222 -0
  66. package/build/inputs/SelectInput/SelectInput.js.map +1 -0
  67. package/build/inputs/SelectInput/SelectInput.messages.js.map +1 -0
  68. package/build/inputs/SelectInput/SelectInput.messages.mjs.map +1 -0
  69. package/build/inputs/SelectInput/SelectInput.mjs +216 -0
  70. package/build/inputs/SelectInput/SelectInput.mjs.map +1 -0
  71. package/build/inputs/SelectInput/SelectInput.utils.js +164 -0
  72. package/build/inputs/SelectInput/SelectInput.utils.js.map +1 -0
  73. package/build/inputs/SelectInput/SelectInput.utils.mjs +154 -0
  74. package/build/inputs/SelectInput/SelectInput.utils.mjs.map +1 -0
  75. package/build/inputs/SelectInput/TriggerButton/SelectInputTriggerButton.js +42 -0
  76. package/build/inputs/SelectInput/TriggerButton/SelectInputTriggerButton.js.map +1 -0
  77. package/build/inputs/SelectInput/TriggerButton/SelectInputTriggerButton.mjs +36 -0
  78. package/build/inputs/SelectInput/TriggerButton/SelectInputTriggerButton.mjs.map +1 -0
  79. package/build/main.css +123 -105
  80. package/build/moneyInput/MoneyInput.js +9 -2
  81. package/build/moneyInput/MoneyInput.js.map +1 -1
  82. package/build/moneyInput/MoneyInput.mjs +8 -1
  83. package/build/moneyInput/MoneyInput.mjs.map +1 -1
  84. package/build/phoneNumberInput/PhoneNumberInput.js +10 -3
  85. package/build/phoneNumberInput/PhoneNumberInput.js.map +1 -1
  86. package/build/phoneNumberInput/PhoneNumberInput.mjs +9 -2
  87. package/build/phoneNumberInput/PhoneNumberInput.mjs.map +1 -1
  88. package/build/styles/criticalBanner/CriticalCommsBanner.css +33 -15
  89. package/build/styles/inputs/SelectInput/BottomSheet/SelectInputBottomSheet.css +96 -0
  90. package/build/styles/inputs/SelectInput/ButtonInput/SelectInputButtonInput.css +16 -0
  91. package/build/styles/inputs/SelectInput/ClearButton/SelectInputClearButton.css +46 -0
  92. package/build/styles/inputs/SelectInput/ItemView/SelectInputItemView.css +16 -0
  93. package/build/styles/inputs/SelectInput/Option/SelectInputOption.css +33 -0
  94. package/build/styles/inputs/SelectInput/OptionContent/SelectInputOptionContent.css +37 -0
  95. package/build/styles/inputs/SelectInput/Options/SelectInputOptions.css +81 -0
  96. package/build/styles/inputs/SelectInput/Popover/SelectInputPopover.css +46 -0
  97. package/build/styles/main.css +123 -105
  98. package/build/types/criticalBanner/CriticalCommsBanner.d.ts +4 -1
  99. package/build/types/criticalBanner/CriticalCommsBanner.d.ts.map +1 -1
  100. package/build/types/criticalBanner/index.d.ts +1 -0
  101. package/build/types/criticalBanner/index.d.ts.map +1 -1
  102. package/build/types/index.d.ts +2 -1
  103. package/build/types/index.d.ts.map +1 -1
  104. package/build/types/inputs/{_BottomSheet.d.ts → SelectInput/BottomSheet/SelectInputBottomSheet.d.ts} +3 -3
  105. package/build/types/inputs/SelectInput/BottomSheet/SelectInputBottomSheet.d.ts.map +1 -0
  106. package/build/types/inputs/SelectInput/BottomSheet/index.d.ts +3 -0
  107. package/build/types/inputs/SelectInput/BottomSheet/index.d.ts.map +1 -0
  108. package/build/types/inputs/SelectInput/ButtonInput/SelectInputButtonInput.d.ts +5 -0
  109. package/build/types/inputs/SelectInput/ButtonInput/SelectInputButtonInput.d.ts.map +1 -0
  110. package/build/types/inputs/SelectInput/ButtonInput/index.d.ts +3 -0
  111. package/build/types/inputs/SelectInput/ButtonInput/index.d.ts.map +1 -0
  112. package/build/types/inputs/SelectInput/ClearButton/SelectInputClearButton.d.ts +7 -0
  113. package/build/types/inputs/SelectInput/ClearButton/SelectInputClearButton.d.ts.map +1 -0
  114. package/build/types/inputs/SelectInput/ClearButton/index.d.ts +3 -0
  115. package/build/types/inputs/SelectInput/ClearButton/index.d.ts.map +1 -0
  116. package/build/types/inputs/SelectInput/DefaultRenderTrigger/SelectInputDefaultRenderTrigger.d.ts +16 -0
  117. package/build/types/inputs/SelectInput/DefaultRenderTrigger/SelectInputDefaultRenderTrigger.d.ts.map +1 -0
  118. package/build/types/inputs/SelectInput/DefaultRenderTrigger/index.d.ts +2 -0
  119. package/build/types/inputs/SelectInput/DefaultRenderTrigger/index.d.ts.map +1 -0
  120. package/build/types/inputs/SelectInput/ItemView/GroupItemView/SelectInputGroupItemView.d.ts +9 -0
  121. package/build/types/inputs/SelectInput/ItemView/GroupItemView/SelectInputGroupItemView.d.ts.map +1 -0
  122. package/build/types/inputs/SelectInput/ItemView/GroupItemView/index.d.ts +3 -0
  123. package/build/types/inputs/SelectInput/ItemView/GroupItemView/index.d.ts.map +1 -0
  124. package/build/types/inputs/SelectInput/ItemView/SelectInputItemView.d.ts +11 -0
  125. package/build/types/inputs/SelectInput/ItemView/SelectInputItemView.d.ts.map +1 -0
  126. package/build/types/inputs/SelectInput/ItemView/index.d.ts +4 -0
  127. package/build/types/inputs/SelectInput/ItemView/index.d.ts.map +1 -0
  128. package/build/types/inputs/SelectInput/Option/SelectInputOption.d.ts +11 -0
  129. package/build/types/inputs/SelectInput/Option/SelectInputOption.d.ts.map +1 -0
  130. package/build/types/inputs/SelectInput/Option/index.d.ts +3 -0
  131. package/build/types/inputs/SelectInput/Option/index.d.ts.map +1 -0
  132. package/build/types/inputs/SelectInput/OptionContent/SelectInputOptionContent.d.ts +13 -0
  133. package/build/types/inputs/SelectInput/OptionContent/SelectInputOptionContent.d.ts.map +1 -0
  134. package/build/types/inputs/SelectInput/OptionContent/index.d.ts +3 -0
  135. package/build/types/inputs/SelectInput/OptionContent/index.d.ts.map +1 -0
  136. package/build/types/inputs/SelectInput/Options/OptionsContainer/SelectInputOptionsContainer.d.ts +9 -0
  137. package/build/types/inputs/SelectInput/Options/OptionsContainer/SelectInputOptionsContainer.d.ts.map +1 -0
  138. package/build/types/inputs/SelectInput/Options/OptionsContainer/index.d.ts +3 -0
  139. package/build/types/inputs/SelectInput/Options/OptionsContainer/index.d.ts.map +1 -0
  140. package/build/types/inputs/SelectInput/Options/SelectInputOptions.d.ts +21 -0
  141. package/build/types/inputs/SelectInput/Options/SelectInputOptions.d.ts.map +1 -0
  142. package/build/types/inputs/SelectInput/Options/index.d.ts +4 -0
  143. package/build/types/inputs/SelectInput/Options/index.d.ts.map +1 -0
  144. package/build/types/inputs/{_Popover.d.ts → SelectInput/Popover/SelectInputPopover.d.ts} +3 -3
  145. package/build/types/inputs/SelectInput/Popover/SelectInputPopover.d.ts.map +1 -0
  146. package/build/types/inputs/SelectInput/Popover/index.d.ts +3 -0
  147. package/build/types/inputs/SelectInput/Popover/index.d.ts.map +1 -0
  148. package/build/types/inputs/SelectInput/SelectInput.contexts.d.ts +33 -0
  149. package/build/types/inputs/SelectInput/SelectInput.contexts.d.ts.map +1 -0
  150. package/build/types/inputs/SelectInput/SelectInput.d.ts +10 -0
  151. package/build/types/inputs/SelectInput/SelectInput.d.ts.map +1 -0
  152. package/build/types/inputs/SelectInput/SelectInput.messages.d.ts.map +1 -0
  153. package/build/types/inputs/{SelectInput.d.ts → SelectInput/SelectInput.types.d.ts} +12 -38
  154. package/build/types/inputs/SelectInput/SelectInput.types.d.ts.map +1 -0
  155. package/build/types/inputs/SelectInput/SelectInput.utils.d.ts +60 -0
  156. package/build/types/inputs/SelectInput/SelectInput.utils.d.ts.map +1 -0
  157. package/build/types/inputs/SelectInput/TriggerButton/SelectInputTriggerButton.d.ts +12 -0
  158. package/build/types/inputs/SelectInput/TriggerButton/SelectInputTriggerButton.d.ts.map +1 -0
  159. package/build/types/inputs/SelectInput/TriggerButton/index.d.ts +3 -0
  160. package/build/types/inputs/SelectInput/TriggerButton/index.d.ts.map +1 -0
  161. package/build/types/inputs/SelectInput/components.d.ts +10 -0
  162. package/build/types/inputs/SelectInput/components.d.ts.map +1 -0
  163. package/build/types/inputs/SelectInput/index.d.ts +10 -0
  164. package/build/types/inputs/SelectInput/index.d.ts.map +1 -0
  165. package/build/types/uploadInput/UploadInput.d.ts +2 -2
  166. package/build/types/uploadInput/UploadInput.d.ts.map +1 -1
  167. package/build/uploadInput/UploadInput.js.map +1 -1
  168. package/build/uploadInput/UploadInput.mjs.map +1 -1
  169. package/package.json +1 -1
  170. package/src/criticalBanner/CriticalCommsBanner.css +33 -15
  171. package/src/criticalBanner/CriticalCommsBanner.less +46 -36
  172. package/src/criticalBanner/CriticalCommsBanner.story.tsx +9 -15
  173. package/src/criticalBanner/CriticalCommsBanner.test.story.tsx +70 -0
  174. package/src/criticalBanner/CriticalCommsBanner.test.tsx +66 -0
  175. package/src/criticalBanner/CriticalCommsBanner.tsx +54 -5
  176. package/src/criticalBanner/index.ts +1 -0
  177. package/src/index.ts +1 -1
  178. package/src/inputs/SelectInput/BottomSheet/SelectInputBottomSheet.css +96 -0
  179. package/src/inputs/{_BottomSheet.tsx → SelectInput/BottomSheet/SelectInputBottomSheet.tsx} +7 -7
  180. package/src/inputs/SelectInput/BottomSheet/index.ts +2 -0
  181. package/src/inputs/SelectInput/ButtonInput/SelectInputButtonInput.css +16 -0
  182. package/src/inputs/{_ButtonInput.tsx → SelectInput/ButtonInput/SelectInputButtonInput.tsx} +5 -5
  183. package/src/inputs/SelectInput/ButtonInput/index.ts +2 -0
  184. package/src/inputs/SelectInput/ClearButton/SelectInputClearButton.css +46 -0
  185. package/src/inputs/SelectInput/ClearButton/SelectInputClearButton.less +39 -0
  186. package/src/inputs/SelectInput/ClearButton/SelectInputClearButton.tsx +27 -0
  187. package/src/inputs/SelectInput/ClearButton/index.ts +2 -0
  188. package/src/inputs/SelectInput/DefaultRenderTrigger/SelectInputDefaultRenderTrigger.tsx +74 -0
  189. package/src/inputs/SelectInput/DefaultRenderTrigger/index.ts +5 -0
  190. package/src/inputs/SelectInput/ItemView/GroupItemView/SelectInputGroupItemView.tsx +61 -0
  191. package/src/inputs/SelectInput/ItemView/GroupItemView/index.ts +2 -0
  192. package/src/inputs/SelectInput/ItemView/SelectInputItemView.css +16 -0
  193. package/src/inputs/SelectInput/ItemView/SelectInputItemView.less +17 -0
  194. package/src/inputs/SelectInput/ItemView/SelectInputItemView.tsx +48 -0
  195. package/src/inputs/SelectInput/ItemView/index.ts +3 -0
  196. package/src/inputs/SelectInput/Option/SelectInputOption.css +33 -0
  197. package/src/inputs/SelectInput/Option/SelectInputOption.less +32 -0
  198. package/src/inputs/SelectInput/Option/SelectInputOption.tsx +57 -0
  199. package/src/inputs/SelectInput/Option/index.ts +2 -0
  200. package/src/inputs/SelectInput/OptionContent/SelectInputOptionContent.css +37 -0
  201. package/src/inputs/SelectInput/OptionContent/SelectInputOptionContent.less +38 -0
  202. package/src/inputs/SelectInput/OptionContent/SelectInputOptionContent.tsx +72 -0
  203. package/src/inputs/SelectInput/OptionContent/index.ts +2 -0
  204. package/src/inputs/SelectInput/Options/OptionsContainer/SelectInputOptionsContainer.tsx +59 -0
  205. package/src/inputs/SelectInput/Options/OptionsContainer/index.ts +2 -0
  206. package/src/inputs/SelectInput/Options/SelectInputOptions.css +81 -0
  207. package/src/inputs/SelectInput/Options/SelectInputOptions.less +77 -0
  208. package/src/inputs/SelectInput/Options/SelectInputOptions.tsx +411 -0
  209. package/src/inputs/SelectInput/Options/index.ts +3 -0
  210. package/src/inputs/SelectInput/Popover/SelectInputPopover.css +46 -0
  211. package/src/inputs/{_Popover.tsx → SelectInput/Popover/SelectInputPopover.tsx} +7 -7
  212. package/src/inputs/SelectInput/Popover/index.ts +2 -0
  213. package/src/inputs/SelectInput/SelectInput.contexts.tsx +40 -0
  214. package/src/inputs/SelectInput/SelectInput.less +22 -0
  215. package/src/inputs/{SelectInput.test.tsx → SelectInput/SelectInput.test.tsx} +9 -11
  216. package/src/inputs/SelectInput/SelectInput.tsx +257 -0
  217. package/src/inputs/SelectInput/SelectInput.types.ts +113 -0
  218. package/src/inputs/SelectInput/SelectInput.utils.ts +205 -0
  219. package/src/inputs/SelectInput/TriggerButton/SelectInputTriggerButton.tsx +36 -0
  220. package/src/inputs/SelectInput/TriggerButton/index.ts +5 -0
  221. package/src/inputs/{SelectInput.docs.mdx → SelectInput/_stories/SelectInput.docs.mdx} +0 -1
  222. package/src/inputs/{SelectInput.story.tsx → SelectInput/_stories/SelectInput.story.tsx} +11 -8
  223. package/src/inputs/{SelectInput.test.story.tsx → SelectInput/_stories/SelectInput.test.story.tsx} +6 -10
  224. package/src/inputs/SelectInput/components.ts +10 -0
  225. package/src/inputs/SelectInput/index.ts +12 -0
  226. package/src/main.css +123 -105
  227. package/src/main.less +1 -1
  228. package/src/uploadInput/UploadInput.tsx +2 -2
  229. package/build/inputs/SelectInput.js +0 -890
  230. package/build/inputs/SelectInput.js.map +0 -1
  231. package/build/inputs/SelectInput.messages.js.map +0 -1
  232. package/build/inputs/SelectInput.messages.mjs.map +0 -1
  233. package/build/inputs/SelectInput.mjs +0 -881
  234. package/build/inputs/SelectInput.mjs.map +0 -1
  235. package/build/inputs/_BottomSheet.js.map +0 -1
  236. package/build/inputs/_BottomSheet.mjs.map +0 -1
  237. package/build/inputs/_ButtonInput.js.map +0 -1
  238. package/build/inputs/_ButtonInput.mjs.map +0 -1
  239. package/build/inputs/_Popover.js.map +0 -1
  240. package/build/inputs/_Popover.mjs.map +0 -1
  241. package/build/types/inputs/SelectInput.d.ts.map +0 -1
  242. package/build/types/inputs/SelectInput.messages.d.ts.map +0 -1
  243. package/build/types/inputs/_BottomSheet.d.ts.map +0 -1
  244. package/build/types/inputs/_ButtonInput.d.ts +0 -5
  245. package/build/types/inputs/_ButtonInput.d.ts.map +0 -1
  246. package/build/types/inputs/_Popover.d.ts.map +0 -1
  247. package/src/inputs/SelectInput.less +0 -219
  248. package/src/inputs/SelectInput.tsx +0 -1269
  249. package/build/inputs/{SelectInput.messages.js → SelectInput/SelectInput.messages.js} +0 -0
  250. package/build/inputs/{SelectInput.messages.mjs → SelectInput/SelectInput.messages.mjs} +0 -0
  251. package/build/styles/inputs/{SelectInput.css → SelectInput/SelectInput.css} +90 -90
  252. package/build/types/inputs/{SelectInput.messages.d.ts → SelectInput/SelectInput.messages.d.ts} +0 -0
  253. package/src/inputs/{_BottomSheet.less → SelectInput/BottomSheet/SelectInputBottomSheet.less} +0 -0
  254. package/src/inputs/{_ButtonInput.less → SelectInput/ButtonInput/SelectInputButtonInput.less} +0 -0
  255. package/src/inputs/{_Popover.less → SelectInput/Popover/SelectInputPopover.less} +0 -0
  256. package/src/inputs/{SelectInput.css → SelectInput/SelectInput.css} +90 -90
  257. /package/src/inputs/{SelectInput.messages.ts → SelectInput/SelectInput.messages.ts} +0 -0
@@ -0,0 +1,37 @@
1
+ .np-select-input-option-content-container {
2
+ display: flex;
3
+ align-items: center;
4
+ -moz-column-gap: 8px;
5
+ column-gap: 8px;
6
+ -moz-column-gap: var(--size-8);
7
+ column-gap: var(--size-8);
8
+ color: #37517e;
9
+ color: var(--color-content-primary);
10
+ }
11
+ .np-select-input-option-content-icon {
12
+ display: flex;
13
+ }
14
+ .np-select-input-option-content-icon--not-within-trigger {
15
+ align-self: flex-start;
16
+ }
17
+ .np-select-input-option-content-text {
18
+ display: flex;
19
+ flex: 1;
20
+ flex-direction: column;
21
+ overflow: hidden;
22
+ }
23
+ .np-select-input-option-content-text-secondary {
24
+ color: #5d7079;
25
+ color: var(--color-content-secondary);
26
+ }
27
+ .np-select-input-option-content-text-within-trigger {
28
+ overflow: hidden;
29
+ text-overflow: ellipsis;
30
+ white-space: nowrap;
31
+ }
32
+ .np-select-input-option-content-text-line-1 > :not([hidden]) ~ :not([hidden]) {
33
+ margin-right: 8px;
34
+ margin-right: var(--size-8);
35
+ margin-left: 8px;
36
+ margin-left: var(--size-8);
37
+ }
@@ -0,0 +1,38 @@
1
+ .np-select-input-option-content-container {
2
+ display: flex;
3
+ align-items: center;
4
+ column-gap: var(--size-8);
5
+ color: var(--color-content-primary);
6
+ }
7
+
8
+ .np-select-input-option-content-icon {
9
+ display: flex;
10
+
11
+ &--not-within-trigger {
12
+ align-self: flex-start;
13
+ }
14
+ }
15
+
16
+ .np-select-input-option-content-text {
17
+ display: flex;
18
+ flex: 1;
19
+ flex-direction: column;
20
+ overflow: hidden;
21
+ }
22
+
23
+ .np-select-input-option-content-text-secondary {
24
+ color: var(--color-content-secondary);
25
+ }
26
+
27
+ .np-select-input-option-content-text-within-trigger {
28
+ overflow: hidden;
29
+ text-overflow: ellipsis;
30
+ white-space: nowrap;
31
+ }
32
+
33
+ .np-select-input-option-content-text-line-1 {
34
+ > :not([hidden]) ~ :not([hidden]) {
35
+ margin-right: var(--size-8);
36
+ margin-left: var(--size-8);
37
+ }
38
+ }
@@ -0,0 +1,72 @@
1
+ import { clsx } from 'clsx';
2
+ import { useContext } from 'react';
3
+ import { SelectInputOptionContentWithinTriggerContext } from '../SelectInput.contexts';
4
+
5
+ export interface SelectInputOptionContentProps {
6
+ title: React.ReactNode;
7
+ note?: string;
8
+ description?: string;
9
+ icon?: React.ReactNode;
10
+ }
11
+
12
+ /**
13
+ * Component for rendering structured content within a SelectInput option.
14
+ * Supports title, optional note, description, and icon with different styling
15
+ * based on whether it's rendered within the trigger button or the dropdown.
16
+ */
17
+ export function SelectInputOptionContent({
18
+ title,
19
+ note,
20
+ description,
21
+ icon,
22
+ }: SelectInputOptionContentProps) {
23
+ const withinTrigger = useContext(SelectInputOptionContentWithinTriggerContext);
24
+
25
+ return (
26
+ <div
27
+ className={clsx(
28
+ 'np-select-input-option-content-container',
29
+ (note || description) && 'np-text-body-large',
30
+ )}
31
+ >
32
+ {icon ? (
33
+ <div
34
+ className={clsx(
35
+ 'np-select-input-option-content-icon',
36
+ !withinTrigger && 'np-select-input-option-content-icon--not-within-trigger',
37
+ )}
38
+ >
39
+ {icon}
40
+ </div>
41
+ ) : null}
42
+
43
+ <div className="np-select-input-option-content-text">
44
+ <div
45
+ className={clsx(
46
+ 'np-select-input-option-content-text-line-1',
47
+ withinTrigger && 'np-select-input-option-content-text-within-trigger',
48
+ )}
49
+ >
50
+ <div className="d-inline">{title}</div>
51
+ {note ? (
52
+ <span className="np-select-input-option-content-text-secondary np-text-body-default">
53
+ {note}
54
+ </span>
55
+ ) : null}
56
+ </div>
57
+
58
+ {description ? (
59
+ <div
60
+ className={clsx(
61
+ 'np-select-input-option-content-text-secondary np-text-body-default',
62
+ withinTrigger &&
63
+ 'np-select-input-option-content-text-within-trigger np-select-input-option-description-in-trigger',
64
+ )}
65
+ >
66
+ {description}
67
+ </div>
68
+ ) : null}
69
+ </div>
70
+ </div>
71
+ );
72
+ }
@@ -0,0 +1,2 @@
1
+ export { SelectInputOptionContent } from './SelectInputOptionContent';
2
+ export type { SelectInputOptionContentProps } from './SelectInputOptionContent';
@@ -0,0 +1,59 @@
1
+ import { forwardRef, useEffect } from 'react';
2
+ import { useEffectEvent } from '../../../../common/hooks/useEffectEvent';
3
+
4
+ export interface SelectInputOptionsContainerProps extends React.ComponentPropsWithRef<'div'> {
5
+ onAriaActiveDescendantChange: (value: React.AriaAttributes['aria-activedescendant']) => void;
6
+ }
7
+
8
+ /**
9
+ * Container component for SelectInput options.
10
+ * Handles keyboard navigation and accessibility features.
11
+ */
12
+ export const SelectInputOptionsContainer = forwardRef(function SelectInputOptionsContainer(
13
+ {
14
+ 'aria-orientation': ariaOrientation,
15
+ 'aria-activedescendant': ariaActiveDescendant,
16
+ role,
17
+ tabIndex,
18
+ onAriaActiveDescendantChange,
19
+ onKeyDown,
20
+ ...restProps
21
+ }: SelectInputOptionsContainerProps,
22
+ ref: React.ForwardedRef<HTMLDivElement | null>,
23
+ ) {
24
+ const handleAriaActiveDescendantChange = useEffectEvent(onAriaActiveDescendantChange);
25
+ useEffect(() => {
26
+ handleAriaActiveDescendantChange(ariaActiveDescendant);
27
+ }, [ariaActiveDescendant, handleAriaActiveDescendantChange]);
28
+
29
+ return (
30
+ <div
31
+ ref={ref}
32
+ role="none"
33
+ onKeyDown={(event) => {
34
+ // Prevent confirmation close without an active item
35
+ if (event.key === 'Enter' && ariaActiveDescendant == null) {
36
+ return;
37
+ }
38
+
39
+ // Required to make ListBox focusable
40
+ if (event.key === 'Tab') {
41
+ return;
42
+ }
43
+
44
+ // Prevent absorbing Escape early
45
+ if (event.key === 'Escape') {
46
+ onKeyDown?.({
47
+ ...event,
48
+ preventDefault: () => {},
49
+ stopPropagation: () => {},
50
+ });
51
+ return;
52
+ }
53
+
54
+ onKeyDown?.(event);
55
+ }}
56
+ {...restProps}
57
+ />
58
+ );
59
+ });
@@ -0,0 +1,2 @@
1
+ export { SelectInputOptionsContainer } from './SelectInputOptionsContainer';
2
+ export type { SelectInputOptionsContainerProps } from './SelectInputOptionsContainer';
@@ -0,0 +1,81 @@
1
+ .np-select-input-options-container {
2
+ display: flex;
3
+ height: 100%;
4
+ flex-direction: column;
5
+ }
6
+ .np-select-input-options-container:focus {
7
+ outline: none;
8
+ }
9
+ @media (min-width: 576px) {
10
+ .np-select-input-options-container {
11
+ max-height: 28rem /* 448px */;
12
+ }
13
+ }
14
+ .np-select-input-options-status {
15
+ display: flex;
16
+ align-items: center;
17
+ -moz-column-gap: 8px;
18
+ column-gap: 8px;
19
+ -moz-column-gap: var(--size-8);
20
+ column-gap: var(--size-8);
21
+ padding: 8px 24px 0px;
22
+ padding: var(--size-8) var(--size-24) 0px;
23
+ }
24
+ .np-select-input-options-status-icon {
25
+ padding: 0 4px;
26
+ padding: 0 var(--size-4);
27
+ color: #768e9c;
28
+ color: var(--color-content-tertiary);
29
+ }
30
+ .np-select-input-query-container {
31
+ display: flex;
32
+ flex-direction: column;
33
+ padding: 8px;
34
+ padding: var(--size-8);
35
+ }
36
+ .np-select-input-listbox-container {
37
+ position: relative;
38
+ height: var(--initial-height);
39
+ scroll-padding-top: 8px;
40
+ scroll-padding-top: var(--size-8);
41
+ scroll-padding-bottom: 8px;
42
+ scroll-padding-bottom: var(--size-8);
43
+ overflow-y: auto;
44
+ }
45
+ @media (min-width: 576px) {
46
+ .np-select-input-listbox-container {
47
+ height: auto;
48
+ }
49
+ }
50
+ .np-select-input-listbox-container--virtualized {
51
+ /* The wrapping element shrinks this as needed */
52
+ height: 100vh;
53
+ }
54
+ .np-select-input-listbox-container--has-group {
55
+ scroll-padding-top: 32px;
56
+ scroll-padding-top: var(--size-32);
57
+ }
58
+ .np-select-input-listbox {
59
+ border-radius: 10px;
60
+ border-radius: var(--radius-small);
61
+ padding: 8px;
62
+ padding: var(--size-8);
63
+ --ring-outline-offset: calc(-1 * var(--ring-outline-width));
64
+ }
65
+ .np-select-input-listbox:focus {
66
+ outline: none;
67
+ }
68
+ .np-select-input-listbox:focus-visible {
69
+ outline: var(--ring-outline-color) solid var(--ring-outline-width);
70
+ outline-offset: var(--ring-outline-offset);
71
+ }
72
+ .np-select-input-listbox-container--virtualized .np-select-input-listbox {
73
+ /* Adopted from `VList` in virtua: https://github.com/inokawa/virtua/blob/7f6ed5b37df6b480d4ff350f3960067c5b3519d2/src/react/VList.tsx#L113-L116 */
74
+ overflow-y: auto;
75
+ contain: strict;
76
+ height: 100%;
77
+ }
78
+ .np-select-input-footer {
79
+ padding: 4px 24px 16px;
80
+ padding: var(--size-4) var(--size-24) var(--size-16);
81
+ }
@@ -0,0 +1,77 @@
1
+ @import (reference) "../../../../node_modules/@transferwise/neptune-css/src/less/ring.less";
2
+
3
+ .np-select-input-options-container {
4
+ display: flex;
5
+ height: 100%;
6
+ flex-direction: column;
7
+
8
+ &:focus {
9
+ outline: none;
10
+ }
11
+
12
+ @media (--screen-sm) {
13
+ & {
14
+ max-height: 28rem /* 448px */;
15
+ }
16
+ }
17
+ }
18
+
19
+ .np-select-input-options-status {
20
+ display: flex;
21
+ align-items: center;
22
+ column-gap: var(--size-8);
23
+ padding: var(--size-8) var(--size-24) 0px;
24
+ }
25
+
26
+ .np-select-input-options-status-icon {
27
+ padding: 0 var(--size-4);
28
+ color: var(--color-content-tertiary);
29
+ }
30
+
31
+ .np-select-input-query-container {
32
+ display: flex;
33
+ flex-direction: column;
34
+ padding: var(--size-8);
35
+ }
36
+
37
+ .np-select-input-listbox-container {
38
+ position: relative;
39
+ height: var(--initial-height);
40
+ scroll-padding-top: var(--size-8);
41
+ scroll-padding-bottom: var(--size-8);
42
+ overflow-y: auto;
43
+
44
+ @media (--screen-sm) {
45
+ & {
46
+ height: auto;
47
+ }
48
+ }
49
+
50
+ &--virtualized {
51
+ /* The wrapping element shrinks this as needed */
52
+ height: 100vh;
53
+ }
54
+
55
+ &--has-group {
56
+ scroll-padding-top: var(--size-32);
57
+ }
58
+ }
59
+
60
+ .np-select-input-listbox {
61
+ border-radius: var(--radius-small);
62
+ padding: var(--size-8);
63
+
64
+ .focus-ring();
65
+ --ring-outline-offset: calc(-1 * var(--ring-outline-width));
66
+
67
+ .np-select-input-listbox-container--virtualized & {
68
+ /* Adopted from `VList` in virtua: https://github.com/inokawa/virtua/blob/7f6ed5b37df6b480d4ff350f3960067c5b3519d2/src/react/VList.tsx#L113-L116 */
69
+ overflow-y: auto;
70
+ contain: strict;
71
+ height: 100%;
72
+ }
73
+ }
74
+
75
+ .np-select-input-footer {
76
+ padding: var(--size-4) var(--size-24) var(--size-16);
77
+ }