@transferwise/components 46.130.2 → 46.130.3

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 (236) hide show
  1. package/build/dateInput/DateInput.js +12 -5
  2. package/build/dateInput/DateInput.js.map +1 -1
  3. package/build/dateInput/DateInput.mjs +11 -4
  4. package/build/dateInput/DateInput.mjs.map +1 -1
  5. package/build/expressiveMoneyInput/currencySelector/CurrencySelector.js +16 -8
  6. package/build/expressiveMoneyInput/currencySelector/CurrencySelector.js.map +1 -1
  7. package/build/expressiveMoneyInput/currencySelector/CurrencySelector.mjs +14 -6
  8. package/build/expressiveMoneyInput/currencySelector/CurrencySelector.mjs.map +1 -1
  9. package/build/index.js +12 -7
  10. package/build/index.js.map +1 -1
  11. package/build/index.mjs +9 -3
  12. package/build/index.mjs.map +1 -1
  13. package/build/inputs/{_BottomSheet.js → SelectInput/BottomSheet/SelectInputBottomSheet.js} +7 -7
  14. package/build/inputs/SelectInput/BottomSheet/SelectInputBottomSheet.js.map +1 -0
  15. package/build/inputs/{_BottomSheet.mjs → SelectInput/BottomSheet/SelectInputBottomSheet.mjs} +7 -7
  16. package/build/inputs/SelectInput/BottomSheet/SelectInputBottomSheet.mjs.map +1 -0
  17. package/build/inputs/{_ButtonInput.js → SelectInput/ButtonInput/SelectInputButtonInput.js} +5 -5
  18. package/build/inputs/SelectInput/ButtonInput/SelectInputButtonInput.js.map +1 -0
  19. package/build/inputs/{_ButtonInput.mjs → SelectInput/ButtonInput/SelectInputButtonInput.mjs} +5 -5
  20. package/build/inputs/SelectInput/ButtonInput/SelectInputButtonInput.mjs.map +1 -0
  21. package/build/inputs/SelectInput/ClearButton/SelectInputClearButton.js +26 -0
  22. package/build/inputs/SelectInput/ClearButton/SelectInputClearButton.js.map +1 -0
  23. package/build/inputs/SelectInput/ClearButton/SelectInputClearButton.mjs +24 -0
  24. package/build/inputs/SelectInput/ClearButton/SelectInputClearButton.mjs.map +1 -0
  25. package/build/inputs/SelectInput/DefaultRenderTrigger/SelectInputDefaultRenderTrigger.js +59 -0
  26. package/build/inputs/SelectInput/DefaultRenderTrigger/SelectInputDefaultRenderTrigger.js.map +1 -0
  27. package/build/inputs/SelectInput/DefaultRenderTrigger/SelectInputDefaultRenderTrigger.mjs +56 -0
  28. package/build/inputs/SelectInput/DefaultRenderTrigger/SelectInputDefaultRenderTrigger.mjs.map +1 -0
  29. package/build/inputs/SelectInput/ItemView/GroupItemView/SelectInputGroupItemView.js +50 -0
  30. package/build/inputs/SelectInput/ItemView/GroupItemView/SelectInputGroupItemView.js.map +1 -0
  31. package/build/inputs/SelectInput/ItemView/GroupItemView/SelectInputGroupItemView.mjs +48 -0
  32. package/build/inputs/SelectInput/ItemView/GroupItemView/SelectInputGroupItemView.mjs.map +1 -0
  33. package/build/inputs/SelectInput/ItemView/SelectInputItemView.js +47 -0
  34. package/build/inputs/SelectInput/ItemView/SelectInputItemView.js.map +1 -0
  35. package/build/inputs/SelectInput/ItemView/SelectInputItemView.mjs +45 -0
  36. package/build/inputs/SelectInput/ItemView/SelectInputItemView.mjs.map +1 -0
  37. package/build/inputs/SelectInput/Option/SelectInputOption.js +42 -0
  38. package/build/inputs/SelectInput/Option/SelectInputOption.js.map +1 -0
  39. package/build/inputs/SelectInput/Option/SelectInputOption.mjs +40 -0
  40. package/build/inputs/SelectInput/Option/SelectInputOption.mjs.map +1 -0
  41. package/build/inputs/SelectInput/OptionContent/SelectInputOptionContent.js +40 -0
  42. package/build/inputs/SelectInput/OptionContent/SelectInputOptionContent.js.map +1 -0
  43. package/build/inputs/SelectInput/OptionContent/SelectInputOptionContent.mjs +38 -0
  44. package/build/inputs/SelectInput/OptionContent/SelectInputOptionContent.mjs.map +1 -0
  45. package/build/inputs/SelectInput/Options/OptionsContainer/SelectInputOptionsContainer.js +48 -0
  46. package/build/inputs/SelectInput/Options/OptionsContainer/SelectInputOptionsContainer.js.map +1 -0
  47. package/build/inputs/SelectInput/Options/OptionsContainer/SelectInputOptionsContainer.mjs +46 -0
  48. package/build/inputs/SelectInput/Options/OptionsContainer/SelectInputOptionsContainer.mjs.map +1 -0
  49. package/build/inputs/SelectInput/Options/SelectInputOptions.js +300 -0
  50. package/build/inputs/SelectInput/Options/SelectInputOptions.js.map +1 -0
  51. package/build/inputs/SelectInput/Options/SelectInputOptions.mjs +298 -0
  52. package/build/inputs/SelectInput/Options/SelectInputOptions.mjs.map +1 -0
  53. package/build/inputs/{_Popover.js → SelectInput/Popover/SelectInputPopover.js} +7 -7
  54. package/build/inputs/SelectInput/Popover/SelectInputPopover.js.map +1 -0
  55. package/build/inputs/{_Popover.mjs → SelectInput/Popover/SelectInputPopover.mjs} +7 -7
  56. package/build/inputs/SelectInput/Popover/SelectInputPopover.mjs.map +1 -0
  57. package/build/inputs/SelectInput/SelectInput.contexts.js +29 -0
  58. package/build/inputs/SelectInput/SelectInput.contexts.js.map +1 -0
  59. package/build/inputs/SelectInput/SelectInput.contexts.mjs +24 -0
  60. package/build/inputs/SelectInput/SelectInput.contexts.mjs.map +1 -0
  61. package/build/inputs/SelectInput/SelectInput.js +222 -0
  62. package/build/inputs/SelectInput/SelectInput.js.map +1 -0
  63. package/build/inputs/SelectInput/SelectInput.messages.js.map +1 -0
  64. package/build/inputs/SelectInput/SelectInput.messages.mjs.map +1 -0
  65. package/build/inputs/SelectInput/SelectInput.mjs +216 -0
  66. package/build/inputs/SelectInput/SelectInput.mjs.map +1 -0
  67. package/build/inputs/SelectInput/SelectInput.utils.js +164 -0
  68. package/build/inputs/SelectInput/SelectInput.utils.js.map +1 -0
  69. package/build/inputs/SelectInput/SelectInput.utils.mjs +154 -0
  70. package/build/inputs/SelectInput/SelectInput.utils.mjs.map +1 -0
  71. package/build/inputs/SelectInput/TriggerButton/SelectInputTriggerButton.js +42 -0
  72. package/build/inputs/SelectInput/TriggerButton/SelectInputTriggerButton.js.map +1 -0
  73. package/build/inputs/SelectInput/TriggerButton/SelectInputTriggerButton.mjs +36 -0
  74. package/build/inputs/SelectInput/TriggerButton/SelectInputTriggerButton.mjs.map +1 -0
  75. package/build/main.css +90 -90
  76. package/build/moneyInput/MoneyInput.js +9 -2
  77. package/build/moneyInput/MoneyInput.js.map +1 -1
  78. package/build/moneyInput/MoneyInput.mjs +8 -1
  79. package/build/moneyInput/MoneyInput.mjs.map +1 -1
  80. package/build/phoneNumberInput/PhoneNumberInput.js +10 -3
  81. package/build/phoneNumberInput/PhoneNumberInput.js.map +1 -1
  82. package/build/phoneNumberInput/PhoneNumberInput.mjs +9 -2
  83. package/build/phoneNumberInput/PhoneNumberInput.mjs.map +1 -1
  84. package/build/styles/inputs/SelectInput/BottomSheet/SelectInputBottomSheet.css +96 -0
  85. package/build/styles/inputs/SelectInput/ButtonInput/SelectInputButtonInput.css +16 -0
  86. package/build/styles/inputs/SelectInput/ClearButton/SelectInputClearButton.css +46 -0
  87. package/build/styles/inputs/SelectInput/ItemView/SelectInputItemView.css +16 -0
  88. package/build/styles/inputs/SelectInput/Option/SelectInputOption.css +33 -0
  89. package/build/styles/inputs/SelectInput/OptionContent/SelectInputOptionContent.css +37 -0
  90. package/build/styles/inputs/SelectInput/Options/SelectInputOptions.css +81 -0
  91. package/build/styles/inputs/SelectInput/Popover/SelectInputPopover.css +46 -0
  92. package/build/styles/main.css +90 -90
  93. package/build/types/index.d.ts +1 -1
  94. package/build/types/index.d.ts.map +1 -1
  95. package/build/types/inputs/{_BottomSheet.d.ts → SelectInput/BottomSheet/SelectInputBottomSheet.d.ts} +3 -3
  96. package/build/types/inputs/SelectInput/BottomSheet/SelectInputBottomSheet.d.ts.map +1 -0
  97. package/build/types/inputs/SelectInput/BottomSheet/index.d.ts +3 -0
  98. package/build/types/inputs/SelectInput/BottomSheet/index.d.ts.map +1 -0
  99. package/build/types/inputs/SelectInput/ButtonInput/SelectInputButtonInput.d.ts +5 -0
  100. package/build/types/inputs/SelectInput/ButtonInput/SelectInputButtonInput.d.ts.map +1 -0
  101. package/build/types/inputs/SelectInput/ButtonInput/index.d.ts +3 -0
  102. package/build/types/inputs/SelectInput/ButtonInput/index.d.ts.map +1 -0
  103. package/build/types/inputs/SelectInput/ClearButton/SelectInputClearButton.d.ts +7 -0
  104. package/build/types/inputs/SelectInput/ClearButton/SelectInputClearButton.d.ts.map +1 -0
  105. package/build/types/inputs/SelectInput/ClearButton/index.d.ts +3 -0
  106. package/build/types/inputs/SelectInput/ClearButton/index.d.ts.map +1 -0
  107. package/build/types/inputs/SelectInput/DefaultRenderTrigger/SelectInputDefaultRenderTrigger.d.ts +16 -0
  108. package/build/types/inputs/SelectInput/DefaultRenderTrigger/SelectInputDefaultRenderTrigger.d.ts.map +1 -0
  109. package/build/types/inputs/SelectInput/DefaultRenderTrigger/index.d.ts +2 -0
  110. package/build/types/inputs/SelectInput/DefaultRenderTrigger/index.d.ts.map +1 -0
  111. package/build/types/inputs/SelectInput/ItemView/GroupItemView/SelectInputGroupItemView.d.ts +9 -0
  112. package/build/types/inputs/SelectInput/ItemView/GroupItemView/SelectInputGroupItemView.d.ts.map +1 -0
  113. package/build/types/inputs/SelectInput/ItemView/GroupItemView/index.d.ts +3 -0
  114. package/build/types/inputs/SelectInput/ItemView/GroupItemView/index.d.ts.map +1 -0
  115. package/build/types/inputs/SelectInput/ItemView/SelectInputItemView.d.ts +11 -0
  116. package/build/types/inputs/SelectInput/ItemView/SelectInputItemView.d.ts.map +1 -0
  117. package/build/types/inputs/SelectInput/ItemView/index.d.ts +4 -0
  118. package/build/types/inputs/SelectInput/ItemView/index.d.ts.map +1 -0
  119. package/build/types/inputs/SelectInput/Option/SelectInputOption.d.ts +11 -0
  120. package/build/types/inputs/SelectInput/Option/SelectInputOption.d.ts.map +1 -0
  121. package/build/types/inputs/SelectInput/Option/index.d.ts +3 -0
  122. package/build/types/inputs/SelectInput/Option/index.d.ts.map +1 -0
  123. package/build/types/inputs/SelectInput/OptionContent/SelectInputOptionContent.d.ts +13 -0
  124. package/build/types/inputs/SelectInput/OptionContent/SelectInputOptionContent.d.ts.map +1 -0
  125. package/build/types/inputs/SelectInput/OptionContent/index.d.ts +3 -0
  126. package/build/types/inputs/SelectInput/OptionContent/index.d.ts.map +1 -0
  127. package/build/types/inputs/SelectInput/Options/OptionsContainer/SelectInputOptionsContainer.d.ts +9 -0
  128. package/build/types/inputs/SelectInput/Options/OptionsContainer/SelectInputOptionsContainer.d.ts.map +1 -0
  129. package/build/types/inputs/SelectInput/Options/OptionsContainer/index.d.ts +3 -0
  130. package/build/types/inputs/SelectInput/Options/OptionsContainer/index.d.ts.map +1 -0
  131. package/build/types/inputs/SelectInput/Options/SelectInputOptions.d.ts +21 -0
  132. package/build/types/inputs/SelectInput/Options/SelectInputOptions.d.ts.map +1 -0
  133. package/build/types/inputs/SelectInput/Options/index.d.ts +4 -0
  134. package/build/types/inputs/SelectInput/Options/index.d.ts.map +1 -0
  135. package/build/types/inputs/{_Popover.d.ts → SelectInput/Popover/SelectInputPopover.d.ts} +3 -3
  136. package/build/types/inputs/SelectInput/Popover/SelectInputPopover.d.ts.map +1 -0
  137. package/build/types/inputs/SelectInput/Popover/index.d.ts +3 -0
  138. package/build/types/inputs/SelectInput/Popover/index.d.ts.map +1 -0
  139. package/build/types/inputs/SelectInput/SelectInput.contexts.d.ts +33 -0
  140. package/build/types/inputs/SelectInput/SelectInput.contexts.d.ts.map +1 -0
  141. package/build/types/inputs/SelectInput/SelectInput.d.ts +10 -0
  142. package/build/types/inputs/SelectInput/SelectInput.d.ts.map +1 -0
  143. package/build/types/inputs/SelectInput/SelectInput.messages.d.ts.map +1 -0
  144. package/build/types/inputs/{SelectInput.d.ts → SelectInput/SelectInput.types.d.ts} +12 -38
  145. package/build/types/inputs/SelectInput/SelectInput.types.d.ts.map +1 -0
  146. package/build/types/inputs/SelectInput/SelectInput.utils.d.ts +60 -0
  147. package/build/types/inputs/SelectInput/SelectInput.utils.d.ts.map +1 -0
  148. package/build/types/inputs/SelectInput/TriggerButton/SelectInputTriggerButton.d.ts +12 -0
  149. package/build/types/inputs/SelectInput/TriggerButton/SelectInputTriggerButton.d.ts.map +1 -0
  150. package/build/types/inputs/SelectInput/TriggerButton/index.d.ts +3 -0
  151. package/build/types/inputs/SelectInput/TriggerButton/index.d.ts.map +1 -0
  152. package/build/types/inputs/SelectInput/components.d.ts +10 -0
  153. package/build/types/inputs/SelectInput/components.d.ts.map +1 -0
  154. package/build/types/inputs/SelectInput/index.d.ts +10 -0
  155. package/build/types/inputs/SelectInput/index.d.ts.map +1 -0
  156. package/package.json +1 -1
  157. package/src/index.ts +0 -1
  158. package/src/inputs/SelectInput/BottomSheet/SelectInputBottomSheet.css +96 -0
  159. package/src/inputs/{_BottomSheet.tsx → SelectInput/BottomSheet/SelectInputBottomSheet.tsx} +7 -7
  160. package/src/inputs/SelectInput/BottomSheet/index.ts +2 -0
  161. package/src/inputs/SelectInput/ButtonInput/SelectInputButtonInput.css +16 -0
  162. package/src/inputs/{_ButtonInput.tsx → SelectInput/ButtonInput/SelectInputButtonInput.tsx} +5 -5
  163. package/src/inputs/SelectInput/ButtonInput/index.ts +2 -0
  164. package/src/inputs/SelectInput/ClearButton/SelectInputClearButton.css +46 -0
  165. package/src/inputs/SelectInput/ClearButton/SelectInputClearButton.less +39 -0
  166. package/src/inputs/SelectInput/ClearButton/SelectInputClearButton.tsx +27 -0
  167. package/src/inputs/SelectInput/ClearButton/index.ts +2 -0
  168. package/src/inputs/SelectInput/DefaultRenderTrigger/SelectInputDefaultRenderTrigger.tsx +74 -0
  169. package/src/inputs/SelectInput/DefaultRenderTrigger/index.ts +5 -0
  170. package/src/inputs/SelectInput/ItemView/GroupItemView/SelectInputGroupItemView.tsx +61 -0
  171. package/src/inputs/SelectInput/ItemView/GroupItemView/index.ts +2 -0
  172. package/src/inputs/SelectInput/ItemView/SelectInputItemView.css +16 -0
  173. package/src/inputs/SelectInput/ItemView/SelectInputItemView.less +17 -0
  174. package/src/inputs/SelectInput/ItemView/SelectInputItemView.tsx +48 -0
  175. package/src/inputs/SelectInput/ItemView/index.ts +3 -0
  176. package/src/inputs/SelectInput/Option/SelectInputOption.css +33 -0
  177. package/src/inputs/SelectInput/Option/SelectInputOption.less +32 -0
  178. package/src/inputs/SelectInput/Option/SelectInputOption.tsx +57 -0
  179. package/src/inputs/SelectInput/Option/index.ts +2 -0
  180. package/src/inputs/SelectInput/OptionContent/SelectInputOptionContent.css +37 -0
  181. package/src/inputs/SelectInput/OptionContent/SelectInputOptionContent.less +38 -0
  182. package/src/inputs/SelectInput/OptionContent/SelectInputOptionContent.tsx +72 -0
  183. package/src/inputs/SelectInput/OptionContent/index.ts +2 -0
  184. package/src/inputs/SelectInput/Options/OptionsContainer/SelectInputOptionsContainer.tsx +59 -0
  185. package/src/inputs/SelectInput/Options/OptionsContainer/index.ts +2 -0
  186. package/src/inputs/SelectInput/Options/SelectInputOptions.css +81 -0
  187. package/src/inputs/SelectInput/Options/SelectInputOptions.less +77 -0
  188. package/src/inputs/SelectInput/Options/SelectInputOptions.tsx +411 -0
  189. package/src/inputs/SelectInput/Options/index.ts +3 -0
  190. package/src/inputs/SelectInput/Popover/SelectInputPopover.css +46 -0
  191. package/src/inputs/{_Popover.tsx → SelectInput/Popover/SelectInputPopover.tsx} +7 -7
  192. package/src/inputs/SelectInput/Popover/index.ts +2 -0
  193. package/src/inputs/SelectInput/SelectInput.contexts.tsx +40 -0
  194. package/src/inputs/SelectInput/SelectInput.less +22 -0
  195. package/src/inputs/{SelectInput.test.tsx → SelectInput/SelectInput.test.tsx} +9 -11
  196. package/src/inputs/SelectInput/SelectInput.tsx +257 -0
  197. package/src/inputs/SelectInput/SelectInput.types.ts +113 -0
  198. package/src/inputs/SelectInput/SelectInput.utils.ts +205 -0
  199. package/src/inputs/SelectInput/TriggerButton/SelectInputTriggerButton.tsx +36 -0
  200. package/src/inputs/SelectInput/TriggerButton/index.ts +5 -0
  201. package/src/inputs/{SelectInput.docs.mdx → SelectInput/_stories/SelectInput.docs.mdx} +0 -1
  202. package/src/inputs/{SelectInput.story.tsx → SelectInput/_stories/SelectInput.story.tsx} +11 -8
  203. package/src/inputs/{SelectInput.test.story.tsx → SelectInput/_stories/SelectInput.test.story.tsx} +6 -10
  204. package/src/inputs/SelectInput/components.ts +10 -0
  205. package/src/inputs/SelectInput/index.ts +12 -0
  206. package/src/main.css +90 -90
  207. package/src/main.less +1 -1
  208. package/build/inputs/SelectInput.js +0 -890
  209. package/build/inputs/SelectInput.js.map +0 -1
  210. package/build/inputs/SelectInput.messages.js.map +0 -1
  211. package/build/inputs/SelectInput.messages.mjs.map +0 -1
  212. package/build/inputs/SelectInput.mjs +0 -881
  213. package/build/inputs/SelectInput.mjs.map +0 -1
  214. package/build/inputs/_BottomSheet.js.map +0 -1
  215. package/build/inputs/_BottomSheet.mjs.map +0 -1
  216. package/build/inputs/_ButtonInput.js.map +0 -1
  217. package/build/inputs/_ButtonInput.mjs.map +0 -1
  218. package/build/inputs/_Popover.js.map +0 -1
  219. package/build/inputs/_Popover.mjs.map +0 -1
  220. package/build/types/inputs/SelectInput.d.ts.map +0 -1
  221. package/build/types/inputs/SelectInput.messages.d.ts.map +0 -1
  222. package/build/types/inputs/_BottomSheet.d.ts.map +0 -1
  223. package/build/types/inputs/_ButtonInput.d.ts +0 -5
  224. package/build/types/inputs/_ButtonInput.d.ts.map +0 -1
  225. package/build/types/inputs/_Popover.d.ts.map +0 -1
  226. package/src/inputs/SelectInput.less +0 -219
  227. package/src/inputs/SelectInput.tsx +0 -1269
  228. package/build/inputs/{SelectInput.messages.js → SelectInput/SelectInput.messages.js} +0 -0
  229. package/build/inputs/{SelectInput.messages.mjs → SelectInput/SelectInput.messages.mjs} +0 -0
  230. package/build/styles/inputs/{SelectInput.css → SelectInput/SelectInput.css} +90 -90
  231. package/build/types/inputs/{SelectInput.messages.d.ts → SelectInput/SelectInput.messages.d.ts} +0 -0
  232. package/src/inputs/{_BottomSheet.less → SelectInput/BottomSheet/SelectInputBottomSheet.less} +0 -0
  233. package/src/inputs/{_ButtonInput.less → SelectInput/ButtonInput/SelectInputButtonInput.less} +0 -0
  234. package/src/inputs/{_Popover.less → SelectInput/Popover/SelectInputPopover.less} +0 -0
  235. package/src/inputs/{SelectInput.css → SelectInput/SelectInput.css} +90 -90
  236. /package/src/inputs/{SelectInput.messages.ts → SelectInput/SelectInput.messages.ts} +0 -0
@@ -0,0 +1,47 @@
1
+ 'use strict';
2
+
3
+ var SelectInput_utils = require('../SelectInput.utils.js');
4
+ var SelectInputOption = require('../Option/SelectInputOption.js');
5
+ var SelectInputGroupItemView = require('./GroupItemView/SelectInputGroupItemView.js');
6
+ var jsxRuntime = require('react/jsx-runtime');
7
+
8
+ function SelectInputItemView({
9
+ item,
10
+ renderValue,
11
+ needle
12
+ }) {
13
+ switch (item.type) {
14
+ case 'option':
15
+ {
16
+ if (item.value != null && (needle == null || SelectInput_utils.selectInputOptionItemIncludesNeedle(item, needle))) {
17
+ return /*#__PURE__*/jsxRuntime.jsx(SelectInputOption.SelectInputOption, {
18
+ value: item.value,
19
+ disabled: item.disabled,
20
+ children: renderValue(item.value, false)
21
+ });
22
+ }
23
+ break;
24
+ }
25
+ case 'group':
26
+ {
27
+ return /*#__PURE__*/jsxRuntime.jsx(SelectInputGroupItemView.SelectInputGroupItemView, {
28
+ item: item,
29
+ renderValue: renderValue,
30
+ needle: needle
31
+ });
32
+ }
33
+ case 'separator':
34
+ {
35
+ if (needle == null) {
36
+ return /*#__PURE__*/jsxRuntime.jsx("hr", {
37
+ className: "np-select-input-separator-item"
38
+ });
39
+ }
40
+ break;
41
+ }
42
+ }
43
+ return null;
44
+ }
45
+
46
+ exports.SelectInputItemView = SelectInputItemView;
47
+ //# sourceMappingURL=SelectInputItemView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SelectInputItemView.js","sources":["../../../../src/inputs/SelectInput/ItemView/SelectInputItemView.tsx"],"sourcesContent":["import { selectInputOptionItemIncludesNeedle } from '../SelectInput.utils';\nimport { SelectInputItem, SelectInputProps } from '../SelectInput.types';\nimport { SelectInputOption } from '../Option';\nimport { SelectInputGroupItemView } from './GroupItemView';\n\nexport interface SelectInputItemViewProps<\n T = string,\n I extends SelectInputItem<T | undefined> = SelectInputItem<T | undefined>,\n> extends Required<Pick<SelectInputProps<T>, 'renderValue'>> {\n item: I;\n needle: string | null | undefined;\n}\n\n/**\n * Component that renders different types of SelectInput items:\n * options, groups, or separators.\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 <hr className=\"np-select-input-separator-item\" />;\n }\n break;\n }\n }\n return null;\n}\n"],"names":["SelectInputItemView","item","renderValue","needle","type","value","selectInputOptionItemIncludesNeedle","_jsx","SelectInputOption","disabled","children","SelectInputGroupItemView","className"],"mappings":";;;;;;;AAiBM,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,qDAAmC,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;AAClB,UAAA,oBAAOI,cAAA,CAAA,IAAA,EAAA;AAAIK,YAAAA,SAAS,EAAC;AAAgC,YAAG;AAC1D,QAAA;AACA,QAAA;AACF,MAAA;AACF;AACA,EAAA,OAAO,IAAI;AACb;;;;"}
@@ -0,0 +1,45 @@
1
+ import { selectInputOptionItemIncludesNeedle } from '../SelectInput.utils.mjs';
2
+ import { SelectInputOption } from '../Option/SelectInputOption.mjs';
3
+ import { SelectInputGroupItemView } from './GroupItemView/SelectInputGroupItemView.mjs';
4
+ import { jsx } from 'react/jsx-runtime';
5
+
6
+ function SelectInputItemView({
7
+ item,
8
+ renderValue,
9
+ needle
10
+ }) {
11
+ switch (item.type) {
12
+ case 'option':
13
+ {
14
+ if (item.value != null && (needle == null || selectInputOptionItemIncludesNeedle(item, needle))) {
15
+ return /*#__PURE__*/jsx(SelectInputOption, {
16
+ value: item.value,
17
+ disabled: item.disabled,
18
+ children: renderValue(item.value, false)
19
+ });
20
+ }
21
+ break;
22
+ }
23
+ case 'group':
24
+ {
25
+ return /*#__PURE__*/jsx(SelectInputGroupItemView, {
26
+ item: item,
27
+ renderValue: renderValue,
28
+ needle: needle
29
+ });
30
+ }
31
+ case 'separator':
32
+ {
33
+ if (needle == null) {
34
+ return /*#__PURE__*/jsx("hr", {
35
+ className: "np-select-input-separator-item"
36
+ });
37
+ }
38
+ break;
39
+ }
40
+ }
41
+ return null;
42
+ }
43
+
44
+ export { SelectInputItemView };
45
+ //# sourceMappingURL=SelectInputItemView.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SelectInputItemView.mjs","sources":["../../../../src/inputs/SelectInput/ItemView/SelectInputItemView.tsx"],"sourcesContent":["import { selectInputOptionItemIncludesNeedle } from '../SelectInput.utils';\nimport { SelectInputItem, SelectInputProps } from '../SelectInput.types';\nimport { SelectInputOption } from '../Option';\nimport { SelectInputGroupItemView } from './GroupItemView';\n\nexport interface SelectInputItemViewProps<\n T = string,\n I extends SelectInputItem<T | undefined> = SelectInputItem<T | undefined>,\n> extends Required<Pick<SelectInputProps<T>, 'renderValue'>> {\n item: I;\n needle: string | null | undefined;\n}\n\n/**\n * Component that renders different types of SelectInput items:\n * options, groups, or separators.\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 <hr className=\"np-select-input-separator-item\" />;\n }\n break;\n }\n }\n return null;\n}\n"],"names":["SelectInputItemView","item","renderValue","needle","type","value","selectInputOptionItemIncludesNeedle","_jsx","SelectInputOption","disabled","children","SelectInputGroupItemView","className"],"mappings":";;;;;AAiBM,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;AAClB,UAAA,oBAAOI,GAAA,CAAA,IAAA,EAAA;AAAIK,YAAAA,SAAS,EAAC;AAAgC,YAAG;AAC1D,QAAA;AACA,QAAA;AACF,MAAA;AACF;AACA,EAAA,OAAO,IAAI;AACb;;;;"}
@@ -0,0 +1,42 @@
1
+ 'use strict';
2
+
3
+ var icons = require('@transferwise/icons');
4
+ var clsx = require('clsx');
5
+ var React = require('react');
6
+ var react = require('@headlessui/react');
7
+ var SelectInput_contexts = require('../SelectInput.contexts.js');
8
+ var jsxRuntime = require('react/jsx-runtime');
9
+
10
+ function SelectInputOption({
11
+ value,
12
+ disabled,
13
+ children
14
+ }) {
15
+ const itemsCount = React.useContext(SelectInput_contexts.SelectInputItemsCountContext);
16
+ const itemPosition = React.useContext(SelectInput_contexts.SelectInputItemPositionContext);
17
+ return /*#__PURE__*/jsxRuntime.jsx(react.ListboxOption, {
18
+ as: "div",
19
+ value: value,
20
+ "aria-setsize": itemsCount,
21
+ "aria-posinset": itemPosition,
22
+ disabled: disabled,
23
+ className: ({
24
+ active,
25
+ disabled: uiDisabled
26
+ }) => clsx.clsx('np-select-input-option-container np-text-body-large', active && 'np-select-input-option-container--active', uiDisabled && 'np-select-input-option-container--disabled'),
27
+ children: ({
28
+ selected
29
+ }) => /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
30
+ children: [/*#__PURE__*/jsxRuntime.jsx("div", {
31
+ className: "np-select-input-option",
32
+ children: children
33
+ }), /*#__PURE__*/jsxRuntime.jsx(icons.Check, {
34
+ size: 16,
35
+ className: clsx.clsx('np-select-input-option-check', !selected && 'np-select-input-option-check--not-selected')
36
+ })]
37
+ })
38
+ });
39
+ }
40
+
41
+ exports.SelectInputOption = SelectInputOption;
42
+ //# sourceMappingURL=SelectInputOption.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SelectInputOption.js","sources":["../../../../src/inputs/SelectInput/Option/SelectInputOption.tsx"],"sourcesContent":["import { Check } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { useContext } from 'react';\nimport { ListboxOption } from '@headlessui/react';\nimport {\n SelectInputItemsCountContext,\n SelectInputItemPositionContext,\n} from '../SelectInput.contexts';\n\nexport interface SelectInputOptionProps<T = string> {\n value: T;\n disabled?: boolean;\n children?: React.ReactNode;\n}\n\n/**\n * A selectable option in a SelectInput dropdown.\n * Includes accessibility support and styling for selected, active, and disabled states.\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\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":["SelectInputOption","value","disabled","children","itemsCount","useContext","SelectInputItemsCountContext","itemPosition","SelectInputItemPositionContext","_jsx","ListboxOption","as","className","active","uiDisabled","clsx","selected","_jsxs","_Fragment","Check","size"],"mappings":";;;;;;;;;AAmBM,SAAUA,iBAAiBA,CAAa;EAC5CC,KAAK;EACLC,QAAQ;AACRC,EAAAA;AAAQ,CACkB,EAAA;AAC1B,EAAA,MAAMC,UAAU,GAAGC,gBAAU,CAACC,iDAA4B,CAAC;AAC3D,EAAA,MAAMC,YAAY,GAAGF,gBAAU,CAACG,mDAA8B,CAAC;EAE/D,oBACEC,cAAA,CAACC,mBAAa,EAAA;AACZC,IAAAA,EAAE,EAAC,KAAK;AACRV,IAAAA,KAAK,EAAEA,KAAM;AACb,IAAA,cAAA,EAAcG,UAAW;AACzB,IAAA,eAAA,EAAeG,YAAa;AAC5BL,IAAAA,QAAQ,EAAEA,QAAS;AACnBU,IAAAA,SAAS,EAAEA,CAAC;MAAEC,MAAM;AAAEX,MAAAA,QAAQ,EAAEY;AAAU,KAAE,KAC1CC,SAAI,CACF,qDAAqD,EACrDF,MAAM,IAAI,0CAA0C,EACpDC,UAAU,IAAI,4CAA4C,CAE7D;AAAAX,IAAAA,QAAA,EAEAA,CAAC;AAAEa,MAAAA;KAAU,kBACZC,eAAA,CAAAC,mBAAA,EAAA;AAAAf,MAAAA,QAAA,gBACEM,cAAA,CAAA,KAAA,EAAA;AAAKG,QAAAA,SAAS,EAAC,wBAAwB;AAAAT,QAAAA,QAAA,EAAEA;AAAQ,OAAM,CACvD,eAAAM,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;;;;"}
@@ -0,0 +1,40 @@
1
+ import { Check } from '@transferwise/icons';
2
+ import { clsx } from 'clsx';
3
+ import { useContext } from 'react';
4
+ import { ListboxOption } from '@headlessui/react';
5
+ import { SelectInputItemsCountContext, SelectInputItemPositionContext } from '../SelectInput.contexts.mjs';
6
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
7
+
8
+ function SelectInputOption({
9
+ value,
10
+ disabled,
11
+ children
12
+ }) {
13
+ const itemsCount = useContext(SelectInputItemsCountContext);
14
+ const itemPosition = useContext(SelectInputItemPositionContext);
15
+ return /*#__PURE__*/jsx(ListboxOption, {
16
+ as: "div",
17
+ value: value,
18
+ "aria-setsize": itemsCount,
19
+ "aria-posinset": itemPosition,
20
+ disabled: disabled,
21
+ className: ({
22
+ active,
23
+ disabled: uiDisabled
24
+ }) => clsx('np-select-input-option-container np-text-body-large', active && 'np-select-input-option-container--active', uiDisabled && 'np-select-input-option-container--disabled'),
25
+ children: ({
26
+ selected
27
+ }) => /*#__PURE__*/jsxs(Fragment, {
28
+ children: [/*#__PURE__*/jsx("div", {
29
+ className: "np-select-input-option",
30
+ children: children
31
+ }), /*#__PURE__*/jsx(Check, {
32
+ size: 16,
33
+ className: clsx('np-select-input-option-check', !selected && 'np-select-input-option-check--not-selected')
34
+ })]
35
+ })
36
+ });
37
+ }
38
+
39
+ export { SelectInputOption };
40
+ //# sourceMappingURL=SelectInputOption.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SelectInputOption.mjs","sources":["../../../../src/inputs/SelectInput/Option/SelectInputOption.tsx"],"sourcesContent":["import { Check } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { useContext } from 'react';\nimport { ListboxOption } from '@headlessui/react';\nimport {\n SelectInputItemsCountContext,\n SelectInputItemPositionContext,\n} from '../SelectInput.contexts';\n\nexport interface SelectInputOptionProps<T = string> {\n value: T;\n disabled?: boolean;\n children?: React.ReactNode;\n}\n\n/**\n * A selectable option in a SelectInput dropdown.\n * Includes accessibility support and styling for selected, active, and disabled states.\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\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":["SelectInputOption","value","disabled","children","itemsCount","useContext","SelectInputItemsCountContext","itemPosition","SelectInputItemPositionContext","_jsx","ListboxOption","as","className","active","uiDisabled","clsx","selected","_jsxs","_Fragment","Check","size"],"mappings":";;;;;;;AAmBM,SAAUA,iBAAiBA,CAAa;EAC5CC,KAAK;EACLC,QAAQ;AACRC,EAAAA;AAAQ,CACkB,EAAA;AAC1B,EAAA,MAAMC,UAAU,GAAGC,UAAU,CAACC,4BAA4B,CAAC;AAC3D,EAAA,MAAMC,YAAY,GAAGF,UAAU,CAACG,8BAA8B,CAAC;EAE/D,oBACEC,GAAA,CAACC,aAAa,EAAA;AACZC,IAAAA,EAAE,EAAC,KAAK;AACRV,IAAAA,KAAK,EAAEA,KAAM;AACb,IAAA,cAAA,EAAcG,UAAW;AACzB,IAAA,eAAA,EAAeG,YAAa;AAC5BL,IAAAA,QAAQ,EAAEA,QAAS;AACnBU,IAAAA,SAAS,EAAEA,CAAC;MAAEC,MAAM;AAAEX,MAAAA,QAAQ,EAAEY;AAAU,KAAE,KAC1CC,IAAI,CACF,qDAAqD,EACrDF,MAAM,IAAI,0CAA0C,EACpDC,UAAU,IAAI,4CAA4C,CAE7D;AAAAX,IAAAA,QAAA,EAEAA,CAAC;AAAEa,MAAAA;KAAU,kBACZC,IAAA,CAAAC,QAAA,EAAA;AAAAf,MAAAA,QAAA,gBACEM,GAAA,CAAA,KAAA,EAAA;AAAKG,QAAAA,SAAS,EAAC,wBAAwB;AAAAT,QAAAA,QAAA,EAAEA;AAAQ,OAAM,CACvD,eAAAM,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;;;;"}
@@ -0,0 +1,40 @@
1
+ 'use strict';
2
+
3
+ var clsx = require('clsx');
4
+ var React = require('react');
5
+ var SelectInput_contexts = require('../SelectInput.contexts.js');
6
+ var jsxRuntime = require('react/jsx-runtime');
7
+
8
+ function SelectInputOptionContent({
9
+ title,
10
+ note,
11
+ description,
12
+ icon
13
+ }) {
14
+ const withinTrigger = React.useContext(SelectInput_contexts.SelectInputOptionContentWithinTriggerContext);
15
+ return /*#__PURE__*/jsxRuntime.jsxs("div", {
16
+ className: clsx.clsx('np-select-input-option-content-container', (note || description) && 'np-text-body-large'),
17
+ children: [icon ? /*#__PURE__*/jsxRuntime.jsx("div", {
18
+ className: clsx.clsx('np-select-input-option-content-icon', !withinTrigger && 'np-select-input-option-content-icon--not-within-trigger'),
19
+ children: icon
20
+ }) : null, /*#__PURE__*/jsxRuntime.jsxs("div", {
21
+ className: "np-select-input-option-content-text",
22
+ children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
23
+ className: clsx.clsx('np-select-input-option-content-text-line-1', withinTrigger && 'np-select-input-option-content-text-within-trigger'),
24
+ children: [/*#__PURE__*/jsxRuntime.jsx("div", {
25
+ className: "d-inline",
26
+ children: title
27
+ }), note ? /*#__PURE__*/jsxRuntime.jsx("span", {
28
+ className: "np-select-input-option-content-text-secondary np-text-body-default",
29
+ children: note
30
+ }) : null]
31
+ }), description ? /*#__PURE__*/jsxRuntime.jsx("div", {
32
+ className: clsx.clsx('np-select-input-option-content-text-secondary np-text-body-default', withinTrigger && 'np-select-input-option-content-text-within-trigger np-select-input-option-description-in-trigger'),
33
+ children: description
34
+ }) : null]
35
+ })]
36
+ });
37
+ }
38
+
39
+ exports.SelectInputOptionContent = SelectInputOptionContent;
40
+ //# sourceMappingURL=SelectInputOptionContent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SelectInputOptionContent.js","sources":["../../../../src/inputs/SelectInput/OptionContent/SelectInputOptionContent.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useContext } from 'react';\nimport { SelectInputOptionContentWithinTriggerContext } from '../SelectInput.contexts';\n\nexport interface SelectInputOptionContentProps {\n title: React.ReactNode;\n note?: string;\n description?: string;\n icon?: React.ReactNode;\n}\n\n/**\n * Component for rendering structured content within a SelectInput option.\n * Supports title, optional note, description, and icon with different styling\n * based on whether it's rendered within the trigger button or the dropdown.\n */\nexport function SelectInputOptionContent({\n title,\n note,\n description,\n icon,\n}: SelectInputOptionContentProps) {\n const withinTrigger = useContext(SelectInputOptionContentWithinTriggerContext);\n\n return (\n <div\n className={clsx(\n 'np-select-input-option-content-container',\n (note || description) && 'np-text-body-large',\n )}\n >\n {icon ? (\n <div\n className={clsx(\n 'np-select-input-option-content-icon',\n !withinTrigger && 'np-select-input-option-content-icon--not-within-trigger',\n )}\n >\n {icon}\n </div>\n ) : null}\n\n <div className=\"np-select-input-option-content-text\">\n <div\n className={clsx(\n 'np-select-input-option-content-text-line-1',\n withinTrigger && 'np-select-input-option-content-text-within-trigger',\n )}\n >\n <div className=\"d-inline\">{title}</div>\n {note ? (\n <span className=\"np-select-input-option-content-text-secondary np-text-body-default\">\n {note}\n </span>\n ) : null}\n </div>\n\n {description ? (\n <div\n className={clsx(\n 'np-select-input-option-content-text-secondary np-text-body-default',\n withinTrigger &&\n 'np-select-input-option-content-text-within-trigger np-select-input-option-description-in-trigger',\n )}\n >\n {description}\n </div>\n ) : null}\n </div>\n </div>\n );\n}\n"],"names":["SelectInputOptionContent","title","note","description","icon","withinTrigger","useContext","SelectInputOptionContentWithinTriggerContext","_jsxs","className","clsx","children","_jsx"],"mappings":";;;;;;;AAgBM,SAAUA,wBAAwBA,CAAC;EACvCC,KAAK;EACLC,IAAI;EACJC,WAAW;AACXC,EAAAA;AAAI,CAC0B,EAAA;AAC9B,EAAA,MAAMC,aAAa,GAAGC,gBAAU,CAACC,iEAA4C,CAAC;AAE9E,EAAA,oBACEC,eAAA,CAAA,KAAA,EAAA;IACEC,SAAS,EAAEC,SAAI,CACb,0CAA0C,EAC1C,CAACR,IAAI,IAAIC,WAAW,KAAK,oBAAoB,CAC7C;IAAAQ,QAAA,EAAA,CAEDP,IAAI,gBACHQ,cAAA,CAAA,KAAA,EAAA;MACEH,SAAS,EAAEC,SAAI,CACb,qCAAqC,EACrC,CAACL,aAAa,IAAI,yDAAyD,CAC3E;AAAAM,MAAAA,QAAA,EAEDP;AAAI,KACF,CAAC,GACJ,IAAI,eAERI,eAAA,CAAA,KAAA,EAAA;AAAKC,MAAAA,SAAS,EAAC,qCAAqC;AAAAE,MAAAA,QAAA,gBAClDH,eAAA,CAAA,KAAA,EAAA;QACEC,SAAS,EAAEC,SAAI,CACb,4CAA4C,EAC5CL,aAAa,IAAI,oDAAoD,CACrE;AAAAM,QAAAA,QAAA,gBAEFC,cAAA,CAAA,KAAA,EAAA;AAAKH,UAAAA,SAAS,EAAC,UAAU;AAAAE,UAAAA,QAAA,EAAEV;AAAK,SAAM,CACtC,EAACC,IAAI,gBACHU,cAAA,CAAA,MAAA,EAAA;AAAMH,UAAAA,SAAS,EAAC,oEAAoE;AAAAE,UAAAA,QAAA,EACjFT;SACG,CAAC,GACL,IAAI;AAAA,OACL,CAEL,EAACC,WAAW,gBACVS,cAAA,CAAA,KAAA,EAAA;QACEH,SAAS,EAAEC,SAAI,CACb,oEAAoE,EACpEL,aAAa,IACX,kGAAkG,CACpG;AAAAM,QAAAA,QAAA,EAEDR;OACE,CAAC,GACJ,IAAI;AAAA,KACL,CACP;AAAA,GAAK,CAAC;AAEV;;;;"}
@@ -0,0 +1,38 @@
1
+ import { clsx } from 'clsx';
2
+ import { useContext } from 'react';
3
+ import { SelectInputOptionContentWithinTriggerContext } from '../SelectInput.contexts.mjs';
4
+ import { jsxs, jsx } from 'react/jsx-runtime';
5
+
6
+ function SelectInputOptionContent({
7
+ title,
8
+ note,
9
+ description,
10
+ icon
11
+ }) {
12
+ const withinTrigger = useContext(SelectInputOptionContentWithinTriggerContext);
13
+ return /*#__PURE__*/jsxs("div", {
14
+ className: clsx('np-select-input-option-content-container', (note || description) && 'np-text-body-large'),
15
+ children: [icon ? /*#__PURE__*/jsx("div", {
16
+ className: clsx('np-select-input-option-content-icon', !withinTrigger && 'np-select-input-option-content-icon--not-within-trigger'),
17
+ children: icon
18
+ }) : null, /*#__PURE__*/jsxs("div", {
19
+ className: "np-select-input-option-content-text",
20
+ children: [/*#__PURE__*/jsxs("div", {
21
+ className: clsx('np-select-input-option-content-text-line-1', withinTrigger && 'np-select-input-option-content-text-within-trigger'),
22
+ children: [/*#__PURE__*/jsx("div", {
23
+ className: "d-inline",
24
+ children: title
25
+ }), note ? /*#__PURE__*/jsx("span", {
26
+ className: "np-select-input-option-content-text-secondary np-text-body-default",
27
+ children: note
28
+ }) : null]
29
+ }), description ? /*#__PURE__*/jsx("div", {
30
+ className: clsx('np-select-input-option-content-text-secondary np-text-body-default', withinTrigger && 'np-select-input-option-content-text-within-trigger np-select-input-option-description-in-trigger'),
31
+ children: description
32
+ }) : null]
33
+ })]
34
+ });
35
+ }
36
+
37
+ export { SelectInputOptionContent };
38
+ //# sourceMappingURL=SelectInputOptionContent.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SelectInputOptionContent.mjs","sources":["../../../../src/inputs/SelectInput/OptionContent/SelectInputOptionContent.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useContext } from 'react';\nimport { SelectInputOptionContentWithinTriggerContext } from '../SelectInput.contexts';\n\nexport interface SelectInputOptionContentProps {\n title: React.ReactNode;\n note?: string;\n description?: string;\n icon?: React.ReactNode;\n}\n\n/**\n * Component for rendering structured content within a SelectInput option.\n * Supports title, optional note, description, and icon with different styling\n * based on whether it's rendered within the trigger button or the dropdown.\n */\nexport function SelectInputOptionContent({\n title,\n note,\n description,\n icon,\n}: SelectInputOptionContentProps) {\n const withinTrigger = useContext(SelectInputOptionContentWithinTriggerContext);\n\n return (\n <div\n className={clsx(\n 'np-select-input-option-content-container',\n (note || description) && 'np-text-body-large',\n )}\n >\n {icon ? (\n <div\n className={clsx(\n 'np-select-input-option-content-icon',\n !withinTrigger && 'np-select-input-option-content-icon--not-within-trigger',\n )}\n >\n {icon}\n </div>\n ) : null}\n\n <div className=\"np-select-input-option-content-text\">\n <div\n className={clsx(\n 'np-select-input-option-content-text-line-1',\n withinTrigger && 'np-select-input-option-content-text-within-trigger',\n )}\n >\n <div className=\"d-inline\">{title}</div>\n {note ? (\n <span className=\"np-select-input-option-content-text-secondary np-text-body-default\">\n {note}\n </span>\n ) : null}\n </div>\n\n {description ? (\n <div\n className={clsx(\n 'np-select-input-option-content-text-secondary np-text-body-default',\n withinTrigger &&\n 'np-select-input-option-content-text-within-trigger np-select-input-option-description-in-trigger',\n )}\n >\n {description}\n </div>\n ) : null}\n </div>\n </div>\n );\n}\n"],"names":["SelectInputOptionContent","title","note","description","icon","withinTrigger","useContext","SelectInputOptionContentWithinTriggerContext","_jsxs","className","clsx","children","_jsx"],"mappings":";;;;;AAgBM,SAAUA,wBAAwBA,CAAC;EACvCC,KAAK;EACLC,IAAI;EACJC,WAAW;AACXC,EAAAA;AAAI,CAC0B,EAAA;AAC9B,EAAA,MAAMC,aAAa,GAAGC,UAAU,CAACC,4CAA4C,CAAC;AAE9E,EAAA,oBACEC,IAAA,CAAA,KAAA,EAAA;IACEC,SAAS,EAAEC,IAAI,CACb,0CAA0C,EAC1C,CAACR,IAAI,IAAIC,WAAW,KAAK,oBAAoB,CAC7C;IAAAQ,QAAA,EAAA,CAEDP,IAAI,gBACHQ,GAAA,CAAA,KAAA,EAAA;MACEH,SAAS,EAAEC,IAAI,CACb,qCAAqC,EACrC,CAACL,aAAa,IAAI,yDAAyD,CAC3E;AAAAM,MAAAA,QAAA,EAEDP;AAAI,KACF,CAAC,GACJ,IAAI,eAERI,IAAA,CAAA,KAAA,EAAA;AAAKC,MAAAA,SAAS,EAAC,qCAAqC;AAAAE,MAAAA,QAAA,gBAClDH,IAAA,CAAA,KAAA,EAAA;QACEC,SAAS,EAAEC,IAAI,CACb,4CAA4C,EAC5CL,aAAa,IAAI,oDAAoD,CACrE;AAAAM,QAAAA,QAAA,gBAEFC,GAAA,CAAA,KAAA,EAAA;AAAKH,UAAAA,SAAS,EAAC,UAAU;AAAAE,UAAAA,QAAA,EAAEV;AAAK,SAAM,CACtC,EAACC,IAAI,gBACHU,GAAA,CAAA,MAAA,EAAA;AAAMH,UAAAA,SAAS,EAAC,oEAAoE;AAAAE,UAAAA,QAAA,EACjFT;SACG,CAAC,GACL,IAAI;AAAA,OACL,CAEL,EAACC,WAAW,gBACVS,GAAA,CAAA,KAAA,EAAA;QACEH,SAAS,EAAEC,IAAI,CACb,oEAAoE,EACpEL,aAAa,IACX,kGAAkG,CACpG;AAAAM,QAAAA,QAAA,EAEDR;OACE,CAAC,GACJ,IAAI;AAAA,KACL,CACP;AAAA,GAAK,CAAC;AAEV;;;;"}
@@ -0,0 +1,48 @@
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
@@ -0,0 +1 @@
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\nexport interface SelectInputOptionsContainerProps extends React.ComponentPropsWithRef<'div'> {\n onAriaActiveDescendantChange: (value: React.AriaAttributes['aria-activedescendant']) => void;\n}\n\n/**\n * Container component for SelectInput options.\n * Handles keyboard navigation and accessibility features.\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":";;;;;;MAWaA,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;;;;"}
@@ -0,0 +1,46 @@
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
@@ -0,0 +1 @@
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\nexport interface SelectInputOptionsContainerProps extends React.ComponentPropsWithRef<'div'> {\n onAriaActiveDescendantChange: (value: React.AriaAttributes['aria-activedescendant']) => void;\n}\n\n/**\n * Container component for SelectInput options.\n * Handles keyboard navigation and accessibility features.\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":";;;;MAWaA,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;;;;"}