@sprinklrjs/spaceweb 10.1.0 → 12.14.4

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 (855) hide show
  1. package/allComponentsAndUtilities.d.ts +1 -0
  2. package/allComponentsAndUtilities.js +2 -1
  3. package/asyncSelect/asyncSelect.d.ts +4 -2
  4. package/asyncSelect/asyncSelect.js +43 -108
  5. package/asyncSelect/groupedAsyncSelect.d.ts +5 -0
  6. package/asyncSelect/groupedAsyncSelect.js +41 -0
  7. package/asyncSelect/helpers.d.ts +9 -3
  8. package/asyncSelect/helpers.js +35 -4
  9. package/asyncSelect/hooks/useAsyncOptionHandlers.d.ts +17 -12
  10. package/asyncSelect/hooks/useAsyncOptionHandlers.js +73 -26
  11. package/asyncSelect/hooks/useAsyncSelect.d.ts +10 -0
  12. package/asyncSelect/hooks/useAsyncSelect.js +182 -0
  13. package/asyncSelect/hooks/useResolveSelectedOptions.d.ts +10 -7
  14. package/asyncSelect/hooks/useResolveSelectedOptions.js +59 -47
  15. package/asyncSelect/index.d.ts +4 -1
  16. package/asyncSelect/index.js +8 -0
  17. package/asyncSelect/types.d.ts +63 -12
  18. package/avatar/avatar.js +12 -2
  19. package/avatar/index.d.ts +1 -1
  20. package/avatar/styled-component.js +7 -22
  21. package/avatar/types.d.ts +1 -1
  22. package/badge/styled-component.js +10 -8
  23. package/banner/banner-item.d.ts +12 -0
  24. package/banner/banner-item.js +14 -0
  25. package/banner/banner.d.ts +19 -0
  26. package/banner/banner.js +56 -0
  27. package/banner/index.d.ts +5 -0
  28. package/banner/index.js +14 -0
  29. package/banner/locale.d.ts +6 -0
  30. package/banner/locale.js +2 -0
  31. package/banner/package.json +4 -0
  32. package/banner/styled-component.d.ts +6 -0
  33. package/banner/styled-component.js +39 -0
  34. package/banner/types.d.ts +26 -0
  35. package/banner/types.js +2 -0
  36. package/breadcrumb/breadcrumb-item.d.ts +7 -0
  37. package/breadcrumb/breadcrumb-item.js +41 -0
  38. package/breadcrumb/breadcrumb.d.ts +7 -0
  39. package/breadcrumb/breadcrumb.js +29 -0
  40. package/breadcrumb/index.d.ts +4 -0
  41. package/breadcrumb/index.js +17 -0
  42. package/breadcrumb/package.json +4 -0
  43. package/breadcrumb/styled-components.d.ts +7 -0
  44. package/breadcrumb/styled-components.js +19 -0
  45. package/breadcrumb/types.d.ts +38 -0
  46. package/breadcrumb/types.js +2 -0
  47. package/button/Button.d.ts +3 -3
  48. package/button/Button.js +14 -2
  49. package/button/IconButton/IconButton.d.ts +2 -4
  50. package/button/IconButton/IconButton.js +5 -2
  51. package/button/IconButton/types.d.ts +10 -1
  52. package/button/basewebAdapter.d.ts +9 -6
  53. package/button/basewebAdapter.js +1 -1
  54. package/button/styled-components.js +30 -25
  55. package/button/types.d.ts +4 -1
  56. package/button-group/ButtonGroup.d.ts +1 -0
  57. package/button-group/ButtonGroup.js +9 -5
  58. package/button-group/StatefulButtonGroup.d.ts +1 -0
  59. package/button-group/index.d.ts +1 -2
  60. package/button-group/index.js +1 -5
  61. package/button-group/styled-components.d.ts +34 -0
  62. package/button-group/styled-components.js +60 -12
  63. package/button-group/types.d.ts +3 -0
  64. package/checkbox/basewebAdapters.d.ts +5 -2
  65. package/checkbox/basewebAdapters.js +9 -2
  66. package/checkbox/index.d.ts +1 -1
  67. package/checkbox/index.js +1 -2
  68. package/checkbox/styled-components.js +1 -1
  69. package/checkbox/types.d.ts +15 -8
  70. package/color-picker/ColorPalette.d.ts +9 -0
  71. package/color-picker/ColorPalette.js +26 -0
  72. package/color-picker/ColorPicker.d.ts +3 -0
  73. package/color-picker/ColorPicker.js +35 -0
  74. package/color-picker/Swatch.d.ts +12 -0
  75. package/color-picker/Swatch.js +40 -0
  76. package/color-picker/colors.d.ts +1 -0
  77. package/color-picker/colors.js +109 -0
  78. package/color-picker/getContrastRatio.d.ts +1 -0
  79. package/color-picker/getContrastRatio.js +23 -0
  80. package/color-picker/index.d.ts +3 -0
  81. package/color-picker/index.js +7 -0
  82. package/color-picker/locale.d.ts +3 -0
  83. package/color-picker/locale.js +2 -0
  84. package/color-picker/package.json +4 -0
  85. package/color-picker/styled-component.d.ts +1 -0
  86. package/color-picker/styled-component.js +5 -0
  87. package/color-picker/types.d.ts +15 -0
  88. package/color-picker/types.js +2 -0
  89. package/currency/Currency.d.ts +3 -0
  90. package/currency/Currency.js +14 -0
  91. package/currency/constants.d.ts +3 -0
  92. package/currency/constants.js +8 -0
  93. package/currency/index.d.ts +5 -0
  94. package/currency/index.js +12 -0
  95. package/currency/package.json +4 -0
  96. package/currency/types.d.ts +7 -0
  97. package/currency/types.js +2 -0
  98. package/currency/useCurrency.d.ts +2 -0
  99. package/currency/useCurrency.js +12 -0
  100. package/currency/utils.d.ts +8 -0
  101. package/currency/utils.js +11 -0
  102. package/date-input/Before.d.ts +4 -2
  103. package/date-input/Before.js +4 -4
  104. package/date-input/CalendarIconButton.js +7 -1
  105. package/date-input/DateInput.d.ts +1 -1
  106. package/date-input/DateInput.js +47 -26
  107. package/date-input/styled-components.d.ts +2 -2
  108. package/date-input/styled-components.js +10 -8
  109. package/date-input/types.d.ts +4 -2
  110. package/date-picker/Calendar.d.ts +1 -1
  111. package/date-picker/Calendar.js +16 -6
  112. package/date-picker/DateInput.d.ts +3 -2
  113. package/date-picker/DateInput.js +19 -17
  114. package/date-picker/DatePickerContent.d.ts +9 -3
  115. package/date-picker/DatePickerContent.js +59 -8
  116. package/date-picker/DatePickerInput.js +13 -16
  117. package/date-picker/DateTimeContainer.d.ts +4 -2
  118. package/date-picker/DateTimeContainer.js +5 -5
  119. package/date-picker/StatelessDatePicker.d.ts +1 -1
  120. package/date-picker/StatelessDatePicker.js +40 -20
  121. package/date-picker/TimeInput.d.ts +5 -2
  122. package/date-picker/TimeInput.js +4 -2
  123. package/date-picker/index.d.ts +1 -0
  124. package/date-picker/index.js +3 -1
  125. package/date-picker/locale.d.ts +2 -0
  126. package/date-picker/stateful-container.d.ts +1 -1
  127. package/date-picker/stateful-container.js +11 -8
  128. package/date-picker/styled-components.d.ts +0 -1
  129. package/date-picker/styled-components.js +54 -27
  130. package/date-picker/types.d.ts +10 -1
  131. package/date-picker/utils.d.ts +10 -7
  132. package/date-picker/utils.js +12 -4
  133. package/date-time/DateTime.d.ts +3 -0
  134. package/date-time/DateTime.js +12 -0
  135. package/date-time/index.d.ts +3 -0
  136. package/date-time/index.js +9 -0
  137. package/date-time/package.json +4 -0
  138. package/date-time/types.d.ts +21 -0
  139. package/date-time/types.js +18 -0
  140. package/date-time/useDateTime.d.ts +2 -0
  141. package/date-time/useDateTime.js +13 -0
  142. package/date-time/variants.d.ts +4 -0
  143. package/date-time/variants.js +87 -0
  144. package/esm/allComponentsAndUtilities.d.ts +1 -0
  145. package/esm/allComponentsAndUtilities.js +2 -0
  146. package/esm/asyncSelect/asyncSelect.d.ts +4 -2
  147. package/esm/asyncSelect/asyncSelect.js +46 -111
  148. package/esm/asyncSelect/groupedAsyncSelect.d.ts +5 -0
  149. package/esm/asyncSelect/groupedAsyncSelect.js +37 -0
  150. package/esm/asyncSelect/helpers.d.ts +9 -3
  151. package/esm/asyncSelect/helpers.js +31 -3
  152. package/esm/asyncSelect/hooks/useAsyncOptionHandlers.d.ts +17 -12
  153. package/esm/asyncSelect/hooks/useAsyncOptionHandlers.js +76 -29
  154. package/esm/asyncSelect/hooks/useAsyncSelect.d.ts +10 -0
  155. package/esm/asyncSelect/hooks/useAsyncSelect.js +178 -0
  156. package/esm/asyncSelect/hooks/useResolveSelectedOptions.d.ts +10 -7
  157. package/esm/asyncSelect/hooks/useResolveSelectedOptions.js +62 -50
  158. package/esm/asyncSelect/index.d.ts +4 -1
  159. package/esm/asyncSelect/index.js +3 -0
  160. package/esm/asyncSelect/types.d.ts +63 -12
  161. package/esm/avatar/avatar.js +12 -2
  162. package/esm/avatar/index.d.ts +1 -1
  163. package/esm/avatar/styled-component.js +7 -22
  164. package/esm/avatar/types.d.ts +1 -1
  165. package/esm/badge/styled-component.js +10 -8
  166. package/esm/banner/banner-item.d.ts +12 -0
  167. package/esm/banner/banner-item.js +12 -0
  168. package/esm/banner/banner.d.ts +19 -0
  169. package/esm/banner/banner.js +54 -0
  170. package/esm/banner/index.d.ts +5 -0
  171. package/esm/banner/index.js +3 -0
  172. package/esm/banner/locale.d.ts +6 -0
  173. package/esm/banner/locale.js +1 -0
  174. package/esm/banner/styled-component.d.ts +6 -0
  175. package/esm/banner/styled-component.js +35 -0
  176. package/esm/banner/types.d.ts +26 -0
  177. package/esm/banner/types.js +1 -0
  178. package/esm/breadcrumb/breadcrumb-item.d.ts +7 -0
  179. package/esm/breadcrumb/breadcrumb-item.js +39 -0
  180. package/esm/breadcrumb/breadcrumb.d.ts +7 -0
  181. package/esm/breadcrumb/breadcrumb.js +27 -0
  182. package/esm/breadcrumb/index.d.ts +4 -0
  183. package/esm/breadcrumb/index.js +3 -0
  184. package/esm/breadcrumb/styled-components.d.ts +7 -0
  185. package/esm/breadcrumb/styled-components.js +15 -0
  186. package/esm/breadcrumb/types.d.ts +38 -0
  187. package/esm/breadcrumb/types.js +1 -0
  188. package/esm/button/Button.d.ts +3 -3
  189. package/esm/button/Button.js +14 -2
  190. package/esm/button/IconButton/IconButton.d.ts +2 -4
  191. package/esm/button/IconButton/IconButton.js +5 -2
  192. package/esm/button/IconButton/types.d.ts +10 -1
  193. package/esm/button/basewebAdapter.d.ts +9 -6
  194. package/esm/button/basewebAdapter.js +1 -1
  195. package/esm/button/styled-components.js +30 -25
  196. package/esm/button/types.d.ts +4 -1
  197. package/esm/button-group/ButtonGroup.d.ts +1 -0
  198. package/esm/button-group/ButtonGroup.js +9 -5
  199. package/esm/button-group/StatefulButtonGroup.d.ts +1 -0
  200. package/esm/button-group/index.d.ts +1 -2
  201. package/esm/button-group/index.js +0 -1
  202. package/esm/button-group/styled-components.d.ts +34 -0
  203. package/esm/button-group/styled-components.js +58 -11
  204. package/esm/button-group/types.d.ts +3 -0
  205. package/esm/checkbox/basewebAdapters.d.ts +5 -2
  206. package/esm/checkbox/basewebAdapters.js +9 -2
  207. package/esm/checkbox/index.d.ts +1 -1
  208. package/esm/checkbox/index.js +1 -1
  209. package/esm/checkbox/styled-components.js +1 -1
  210. package/esm/checkbox/types.d.ts +15 -8
  211. package/esm/color-picker/ColorPalette.d.ts +9 -0
  212. package/esm/color-picker/ColorPalette.js +22 -0
  213. package/esm/color-picker/ColorPicker.d.ts +3 -0
  214. package/esm/color-picker/ColorPicker.js +31 -0
  215. package/esm/color-picker/Swatch.d.ts +12 -0
  216. package/esm/color-picker/Swatch.js +37 -0
  217. package/esm/color-picker/colors.d.ts +1 -0
  218. package/esm/color-picker/colors.js +106 -0
  219. package/esm/color-picker/getContrastRatio.d.ts +1 -0
  220. package/esm/color-picker/getContrastRatio.js +19 -0
  221. package/esm/color-picker/index.d.ts +3 -0
  222. package/esm/color-picker/index.js +2 -0
  223. package/esm/color-picker/locale.d.ts +3 -0
  224. package/esm/color-picker/locale.js +1 -0
  225. package/esm/color-picker/styled-component.d.ts +1 -0
  226. package/esm/color-picker/styled-component.js +2 -0
  227. package/esm/color-picker/types.d.ts +15 -0
  228. package/esm/color-picker/types.js +1 -0
  229. package/esm/currency/Currency.d.ts +3 -0
  230. package/esm/currency/Currency.js +10 -0
  231. package/esm/currency/constants.d.ts +3 -0
  232. package/esm/currency/constants.js +5 -0
  233. package/esm/currency/index.d.ts +5 -0
  234. package/esm/currency/index.js +5 -0
  235. package/esm/currency/types.d.ts +7 -0
  236. package/esm/currency/types.js +1 -0
  237. package/esm/currency/useCurrency.d.ts +2 -0
  238. package/esm/currency/useCurrency.js +8 -0
  239. package/esm/currency/utils.d.ts +8 -0
  240. package/esm/currency/utils.js +7 -0
  241. package/esm/date-input/Before.d.ts +4 -2
  242. package/esm/date-input/Before.js +4 -4
  243. package/esm/date-input/CalendarIconButton.js +7 -1
  244. package/esm/date-input/DateInput.d.ts +1 -1
  245. package/esm/date-input/DateInput.js +48 -27
  246. package/esm/date-input/styled-components.d.ts +2 -2
  247. package/esm/date-input/styled-components.js +10 -7
  248. package/esm/date-input/types.d.ts +4 -2
  249. package/esm/date-picker/Calendar.d.ts +1 -1
  250. package/esm/date-picker/Calendar.js +17 -7
  251. package/esm/date-picker/DateInput.d.ts +3 -2
  252. package/esm/date-picker/DateInput.js +20 -18
  253. package/esm/date-picker/DatePickerContent.d.ts +9 -3
  254. package/esm/date-picker/DatePickerContent.js +60 -9
  255. package/esm/date-picker/DatePickerInput.js +13 -16
  256. package/esm/date-picker/DateTimeContainer.d.ts +4 -2
  257. package/esm/date-picker/DateTimeContainer.js +5 -5
  258. package/esm/date-picker/StatelessDatePicker.d.ts +1 -1
  259. package/esm/date-picker/StatelessDatePicker.js +40 -20
  260. package/esm/date-picker/TimeInput.d.ts +5 -2
  261. package/esm/date-picker/TimeInput.js +4 -2
  262. package/esm/date-picker/index.d.ts +1 -0
  263. package/esm/date-picker/index.js +1 -0
  264. package/esm/date-picker/locale.d.ts +2 -0
  265. package/esm/date-picker/stateful-container.d.ts +1 -1
  266. package/esm/date-picker/stateful-container.js +11 -8
  267. package/esm/date-picker/styled-components.d.ts +0 -1
  268. package/esm/date-picker/styled-components.js +53 -26
  269. package/esm/date-picker/types.d.ts +10 -1
  270. package/esm/date-picker/utils.d.ts +10 -7
  271. package/esm/date-picker/utils.js +13 -5
  272. package/esm/date-time/DateTime.d.ts +3 -0
  273. package/esm/date-time/DateTime.js +8 -0
  274. package/esm/date-time/index.d.ts +3 -0
  275. package/esm/date-time/index.js +3 -0
  276. package/esm/date-time/types.d.ts +21 -0
  277. package/esm/date-time/types.js +15 -0
  278. package/esm/date-time/useDateTime.d.ts +2 -0
  279. package/esm/date-time/useDateTime.js +9 -0
  280. package/esm/date-time/variants.d.ts +4 -0
  281. package/esm/date-time/variants.js +84 -0
  282. package/esm/form-control/context.d.ts +6 -13
  283. package/esm/form-control/context.js +10 -9
  284. package/esm/form-control/form-control.d.ts +1 -1
  285. package/esm/form-control/form-control.js +17 -12
  286. package/esm/form-control/styled-component.js +18 -7
  287. package/esm/helpers/ClearIconButton.js +3 -1
  288. package/esm/helpers/StyledTombstone.d.ts +1 -0
  289. package/esm/helpers/StyledTombstone.js +17 -0
  290. package/esm/helpers/baseui/useConvertOverrides.js +6 -1
  291. package/esm/helpers/baseui/withThemeOverride.js +1 -1
  292. package/esm/helpers/commonStyles.d.ts +2 -2
  293. package/esm/helpers/commonStyles.js +3 -6
  294. package/esm/helpers/index.d.ts +1 -0
  295. package/esm/helpers/index.js +8 -0
  296. package/esm/helpers/styletron.d.ts +14 -3
  297. package/esm/helpers/themeHelpers.d.ts +1 -0
  298. package/esm/helpers/themeHelpers.js +13 -0
  299. package/esm/hooks/useAutoFocus.d.ts +6 -7
  300. package/esm/hooks/useAutoFocus.js +19 -13
  301. package/esm/hooks/useCombinedRef.d.ts +1 -0
  302. package/esm/hooks/useCombinedRef.js +33 -0
  303. package/esm/hooks/useIsMobileDevice.d.ts +1 -0
  304. package/esm/hooks/useIsMobileDevice.js +6 -0
  305. package/esm/hooks/useMatchMedia.d.ts +3 -0
  306. package/esm/hooks/useMatchMedia.js +49 -0
  307. package/esm/icon/components/alert-solid.js +2 -0
  308. package/esm/icon/components/alert.js +2 -0
  309. package/esm/icon/components/calendar-solid.js +2 -0
  310. package/esm/icon/components/chevron-down.js +2 -0
  311. package/esm/icon/components/chevron-left.d.ts +3 -0
  312. package/esm/icon/components/chevron-left.js +8 -0
  313. package/esm/icon/components/chevron-right.d.ts +3 -0
  314. package/esm/icon/components/chevron-right.js +8 -0
  315. package/esm/icon/components/close.js +2 -0
  316. package/esm/icon/components/error-clr.js +2 -0
  317. package/esm/icon/components/error-solid.js +2 -0
  318. package/esm/icon/components/error.js +2 -0
  319. package/esm/icon/components/imagePreview.js +2 -0
  320. package/esm/icon/components/info.js +2 -0
  321. package/esm/icon/components/play-video.js +2 -0
  322. package/esm/icon/components/reset-color.d.ts +3 -0
  323. package/esm/icon/components/reset-color.js +8 -0
  324. package/esm/icon/components/search.js +2 -0
  325. package/esm/icon/components/tick.js +2 -0
  326. package/esm/icon/components/tickCircle-solid.js +2 -0
  327. package/esm/icon/components/user.js +2 -0
  328. package/esm/icon/components/video-non-playable.js +2 -0
  329. package/esm/index.d.ts +2 -0
  330. package/esm/index.js +2 -0
  331. package/esm/input/basewebAdapters.d.ts +1 -1
  332. package/esm/input/basewebAdapters.js +18 -3
  333. package/esm/input/index.d.ts +2 -1
  334. package/esm/input/index.js +1 -0
  335. package/esm/input/styled-components.d.ts +1 -1
  336. package/esm/input/styled-components.js +8 -6
  337. package/esm/input/types.d.ts +10 -4
  338. package/esm/layer/useLayersContextValue.js +3 -2
  339. package/esm/list/avatar-list-item.d.ts +12 -22
  340. package/esm/list/avatar-list-item.js +8 -10
  341. package/esm/list/divider.js +6 -3
  342. package/esm/list/index.d.ts +1 -1
  343. package/esm/list/index.js +1 -1
  344. package/esm/list/list-item.d.ts +3 -1
  345. package/esm/list/list-item.js +9 -6
  346. package/esm/list/list.d.ts +10 -5
  347. package/esm/list/list.js +47 -6
  348. package/esm/list/styled-component.d.ts +1 -0
  349. package/esm/list/styled-component.js +23 -17
  350. package/esm/list/types.d.ts +8 -0
  351. package/esm/list/utils.d.ts +2 -0
  352. package/esm/list/utils.js +10 -0
  353. package/esm/locale/en_US.js +35 -0
  354. package/esm/locale/types.d.ts +21 -0
  355. package/esm/menu/MenuContext.d.ts +2 -1
  356. package/esm/menu/MenuContext.js +1 -0
  357. package/esm/menu/menu-item.d.ts +8 -2
  358. package/esm/menu/menu-item.js +11 -11
  359. package/esm/menu/menu.d.ts +6 -0
  360. package/esm/menu/menu.js +11 -11
  361. package/esm/menu/types.d.ts +1 -0
  362. package/esm/menu/useKeyboardNavigation.d.ts +6 -3
  363. package/esm/menu/useKeyboardNavigation.js +21 -14
  364. package/esm/menu/useStatefulMenu.d.ts +5 -2
  365. package/esm/menu/useStatefulMenu.js +14 -8
  366. package/esm/modal/adapter.d.ts +1 -1
  367. package/esm/modal/index.d.ts +1 -1
  368. package/esm/modal/index.js +1 -1
  369. package/esm/modal/modal.js +5 -5
  370. package/esm/modal/overrides.d.ts +2 -3
  371. package/esm/modal/overrides.js +6 -8
  372. package/esm/modal/styled-components.d.ts +1 -1
  373. package/esm/modal/styled-components.js +8 -8
  374. package/esm/number/Number.d.ts +3 -0
  375. package/esm/number/Number.js +10 -0
  376. package/esm/number/constants.d.ts +2 -0
  377. package/esm/number/constants.js +4 -0
  378. package/esm/number/index.d.ts +5 -0
  379. package/esm/number/index.js +5 -0
  380. package/esm/number/types.d.ts +6 -0
  381. package/esm/number/types.js +1 -0
  382. package/esm/number/useNumber.d.ts +2 -0
  383. package/esm/number/useNumber.js +8 -0
  384. package/esm/overrides/index.d.ts +1 -1
  385. package/esm/overrides/index.js +1 -1
  386. package/esm/overrides/mergeOverrides.d.ts +3 -2
  387. package/esm/overrides/mergeOverrides.js +5 -4
  388. package/esm/payment-card/basewebAdapters.d.ts +2 -0
  389. package/esm/payment-card/basewebAdapters.js +27 -4
  390. package/esm/payment-card/styled-components.js +25 -6
  391. package/esm/payment-card/types.d.ts +4 -2
  392. package/esm/phone-input/country-select-container.js +1 -1
  393. package/esm/phone-input/country-select.js +4 -6
  394. package/esm/phone-input/default-props.d.ts +6 -9
  395. package/esm/phone-input/default-props.js +7 -9
  396. package/esm/phone-input/flag-container.js +1 -1
  397. package/esm/phone-input/phone-input.d.ts +0 -6
  398. package/esm/phone-input/phone-input.js +21 -12
  399. package/esm/phone-input/stateful-phone-input-container.js +4 -3
  400. package/esm/phone-input/stateful-phone-input.d.ts +0 -6
  401. package/esm/phone-input/styled-components.d.ts +9 -1
  402. package/esm/phone-input/styled-components.js +21 -7
  403. package/esm/phone-input/types.d.ts +2 -1
  404. package/esm/phone-input/utils.d.ts +10 -3
  405. package/esm/phone-input/utils.js +10 -5
  406. package/esm/popover/adapter.d.ts +4 -3
  407. package/esm/popover/adapter.js +15 -0
  408. package/esm/popover/overrides.js +8 -19
  409. package/esm/popover/popover.d.ts +6 -3
  410. package/esm/popover/popover.js +13 -6
  411. package/esm/popover/stateful-popover.js +2 -2
  412. package/esm/popover/types.d.ts +10 -2
  413. package/esm/popover/types.js +2 -1
  414. package/esm/popover/utils.d.ts +12 -0
  415. package/esm/popover/utils.js +9 -0
  416. package/esm/progress/circular/styled-component.d.ts +1 -1
  417. package/esm/progress/circular/styled-component.js +3 -3
  418. package/esm/progress/linear/styled-component.d.ts +1 -1
  419. package/esm/progress/linear/styled-component.js +5 -5
  420. package/esm/radio/basewebAdapters.d.ts +8 -11
  421. package/esm/radio/basewebAdapters.js +6 -3
  422. package/esm/radio/radio.js +6 -5
  423. package/esm/radio/styled-components.js +9 -11
  424. package/esm/radio/types.d.ts +13 -6
  425. package/esm/search/index.d.ts +1 -0
  426. package/esm/search/index.js +1 -0
  427. package/esm/search/search.d.ts +1 -1
  428. package/esm/search/search.js +15 -6
  429. package/esm/search/stateful-search.d.ts +3 -0
  430. package/esm/search/stateful-search.js +15 -0
  431. package/esm/search/styled-components.d.ts +1 -10
  432. package/esm/search/styled-components.js +54 -24
  433. package/esm/search/types.d.ts +8 -2
  434. package/esm/select/adaptor.d.ts +1 -1
  435. package/esm/select/base-select.d.ts +36 -16
  436. package/esm/select/base-select.js +185 -88
  437. package/esm/select/constants.d.ts +3 -0
  438. package/esm/select/constants.js +3 -1
  439. package/esm/select/default-props.d.ts +9 -5
  440. package/esm/select/default-props.js +4 -1
  441. package/esm/select/index.d.ts +4 -4
  442. package/esm/select/index.js +3 -3
  443. package/esm/select/locale.d.ts +4 -0
  444. package/esm/select/mobileSelect/MobileSelect.js +3 -5
  445. package/esm/select/mobileSelect/MobileSheet.js +3 -1
  446. package/esm/select/multi-value.js +22 -12
  447. package/esm/select/overlaySelect/OverlaySelect.js +10 -18
  448. package/esm/select/overlaySelect/hooks/useControlRef.d.ts +9 -0
  449. package/esm/select/overlaySelect/hooks/useControlRef.js +33 -0
  450. package/esm/select/overlaySelect/hooks/useOverlaySelectOverrides.d.ts +24 -0
  451. package/esm/select/overlaySelect/{useOverlaySelectOverrides.js → hooks/useOverlaySelectOverrides.js} +31 -28
  452. package/esm/select/overlaySelect/{usePopover.d.ts → hooks/usePopover.d.ts} +1 -1
  453. package/esm/select/overlaySelect/{usePopover.js → hooks/usePopover.js} +2 -2
  454. package/esm/select/overrides.d.ts +3 -1
  455. package/esm/select/overrides.js +19 -13
  456. package/esm/select/select-variants.js +2 -2
  457. package/esm/select/select.d.ts +9 -5
  458. package/esm/select/select.js +9 -3
  459. package/esm/select/selectMenuAdapter/CollapsibleSelectMenu.d.ts +118 -0
  460. package/esm/select/selectMenuAdapter/CollapsibleSelectMenu.js +70 -0
  461. package/esm/select/selectMenuAdapter/SelectMenuAdapter.d.ts +2 -32
  462. package/esm/select/selectMenuAdapter/SelectMenuAdapter.js +11 -5
  463. package/esm/select/selectMenuAdapter/SelectMenuItem.d.ts +8 -2
  464. package/esm/select/selectMenuAdapter/SelectMenuItem.js +2 -4
  465. package/esm/select/selectMenuAdapter/hooks/useGetExpandedGroup.d.ts +6 -0
  466. package/esm/select/selectMenuAdapter/hooks/useGetExpandedGroup.js +16 -0
  467. package/esm/select/selectMenuAdapter/types.d.ts +42 -0
  468. package/esm/select/selectMenuAdapter/types.js +1 -0
  469. package/esm/select/stateful-select.d.ts +9 -5
  470. package/esm/select/stateful-select.js +3 -3
  471. package/esm/select/styled-component.d.ts +15 -4
  472. package/esm/select/styled-component.js +60 -10
  473. package/esm/select/types.d.ts +36 -9
  474. package/esm/select/types.js +1 -0
  475. package/esm/select/utils/default-filter-options.d.ts +2 -1
  476. package/esm/select/utils/default-filter-options.js +5 -1
  477. package/esm/select/utils/hidden-element.d.ts +6 -0
  478. package/esm/select/utils/hidden-element.js +16 -0
  479. package/esm/select/utils/merge-options.d.ts +2 -0
  480. package/esm/select/utils/merge-options.js +18 -0
  481. package/esm/select/utils/test-utils.d.ts +1 -0
  482. package/esm/select/utils/test-utils.js +7 -0
  483. package/esm/slider/mark.d.ts +3 -3
  484. package/esm/slider/slider.js +2 -1
  485. package/esm/slider/stateful-slider.js +1 -1
  486. package/esm/slider/styled-components.js +4 -4
  487. package/esm/slider/types.d.ts +9 -2
  488. package/esm/snackbar/Snackbar.js +12 -12
  489. package/esm/snackbar/styled-component.js +9 -6
  490. package/esm/spacewebProvider/CustomBaseProvider.js +1 -0
  491. package/esm/spacewebProvider/SpacewebProvider.d.ts +3 -1
  492. package/esm/spacewebProvider/SpacewebProvider.js +9 -9
  493. package/esm/stack/stack.js +6 -13
  494. package/esm/style/_buildUtils.d.ts +1 -1
  495. package/esm/style/_buildUtils.js +3 -1
  496. package/esm/style/_parseStyle.js +12 -7
  497. package/esm/style/useMemoizedStyletron.d.ts +1 -1
  498. package/esm/style/useMemoizedStyletron.js +6 -1
  499. package/esm/styleEngine/styleEngine.d.ts +1 -2
  500. package/esm/switch/__test__/switch.spec.js +13 -0
  501. package/esm/switch/styled-components.js +14 -21
  502. package/esm/switch/switch.js +5 -2
  503. package/esm/switch/types.d.ts +8 -11
  504. package/esm/tag/avatar-tag.js +23 -16
  505. package/esm/tag/styled-components.js +32 -27
  506. package/esm/tag/tag.js +20 -12
  507. package/esm/tag/types.d.ts +2 -2
  508. package/esm/tag/utils.d.ts +50 -0
  509. package/esm/tag/utils.js +64 -0
  510. package/esm/textarea/basewebAdapters.js +4 -4
  511. package/esm/textarea/styled-components.d.ts +1 -1
  512. package/esm/textarea/textarea.js +4 -8
  513. package/esm/textarea/types.d.ts +7 -5
  514. package/esm/theme/Provider.d.ts +10 -0
  515. package/esm/theme/Provider.js +61 -0
  516. package/esm/theme/context.d.ts +1 -10
  517. package/esm/theme/context.js +1 -61
  518. package/esm/theme/index.d.ts +1 -0
  519. package/esm/theme/index.js +1 -0
  520. package/esm/themes/index.js +1 -1
  521. package/esm/themes/responsive-theme.d.ts +2 -2
  522. package/esm/time-picker/TimePicker.d.ts +1 -6
  523. package/esm/time-picker/TimePicker.js +4 -4
  524. package/esm/time-picker/types.d.ts +3 -1
  525. package/esm/time-range-picker/RangeSelector.js +6 -5
  526. package/esm/time-range-picker/RangeSelectorContainer.js +27 -27
  527. package/esm/time-range-picker/TimeRangeList.js +8 -1
  528. package/esm/time-range-picker/TimeRangePicker.js +26 -17
  529. package/esm/time-range-picker/index.d.ts +1 -1
  530. package/esm/time-range-picker/index.js +1 -1
  531. package/esm/time-range-picker/locale.d.ts +3 -0
  532. package/esm/time-range-picker/types.d.ts +17 -3
  533. package/esm/time-range-picker/utils.d.ts +47 -18
  534. package/esm/time-range-picker/utils.js +94 -16
  535. package/esm/time-zone-picker/TimezonePicker.d.ts +1 -6
  536. package/esm/time-zone-picker/TimezonePicker.js +5 -7
  537. package/esm/time-zone-picker/types.d.ts +2 -0
  538. package/esm/tooltip/disabled-tooltip-container.d.ts +26 -1
  539. package/esm/tooltip/overrides.js +1 -2
  540. package/esm/tooltip/stateful-tooltip-container.d.ts +26 -1
  541. package/esm/tooltip/stateful-tooltip.d.ts +27 -1
  542. package/esm/tooltip/stateful-tooltip.js +2 -2
  543. package/esm/tooltip/tooltip.d.ts +1 -1
  544. package/esm/tooltip/tooltip.js +7 -4
  545. package/esm/tooltip/types.d.ts +12 -2
  546. package/esm/types.d.ts +5 -3
  547. package/esm/typography/Typography.js +14 -1
  548. package/esm/typography/constants.d.ts +56 -0
  549. package/esm/typography/constants.js +56 -0
  550. package/esm/typography/index.d.ts +1 -0
  551. package/esm/typography/index.js +1 -0
  552. package/esm/typography/styled-components.js +12 -4
  553. package/esm/typography/types.d.ts +1 -1
  554. package/esm/utils/intlNumberFormatUtils/index.d.ts +7 -0
  555. package/esm/utils/intlNumberFormatUtils/index.js +36 -0
  556. package/esm/utils/intlNumberFormatUtils/types.d.ts +21 -0
  557. package/esm/utils/intlNumberFormatUtils/types.js +6 -0
  558. package/esm/video/Video.js +4 -2
  559. package/esm/video/types.d.ts +2 -0
  560. package/form-control/context.d.ts +6 -13
  561. package/form-control/context.js +11 -10
  562. package/form-control/form-control.d.ts +1 -1
  563. package/form-control/form-control.js +16 -11
  564. package/form-control/styled-component.js +18 -7
  565. package/helpers/ClearIconButton.js +3 -1
  566. package/helpers/StyledTombstone.d.ts +1 -0
  567. package/helpers/StyledTombstone.js +21 -0
  568. package/helpers/baseui/useConvertOverrides.js +6 -1
  569. package/helpers/baseui/withThemeOverride.js +1 -1
  570. package/helpers/commonStyles.d.ts +2 -2
  571. package/helpers/commonStyles.js +3 -6
  572. package/helpers/index.d.ts +1 -0
  573. package/helpers/index.js +10 -1
  574. package/helpers/styletron.d.ts +14 -3
  575. package/helpers/themeHelpers.d.ts +1 -0
  576. package/helpers/themeHelpers.js +15 -1
  577. package/hooks/useAutoFocus.d.ts +6 -7
  578. package/hooks/useAutoFocus.js +19 -14
  579. package/hooks/useCombinedRef.d.ts +1 -0
  580. package/hooks/useCombinedRef.js +35 -1
  581. package/hooks/useIsMobileDevice.d.ts +1 -0
  582. package/hooks/useIsMobileDevice.js +11 -0
  583. package/hooks/useMatchMedia.d.ts +3 -0
  584. package/hooks/useMatchMedia.js +52 -0
  585. package/icon/components/alert-solid.js +2 -0
  586. package/icon/components/alert.js +2 -0
  587. package/icon/components/calendar-solid.js +2 -0
  588. package/icon/components/chevron-down.js +2 -0
  589. package/icon/components/chevron-left.d.ts +3 -0
  590. package/icon/components/chevron-left.js +11 -0
  591. package/icon/components/chevron-right.d.ts +3 -0
  592. package/icon/components/chevron-right.js +11 -0
  593. package/icon/components/close.js +2 -0
  594. package/icon/components/error-clr.js +2 -0
  595. package/icon/components/error-solid.js +2 -0
  596. package/icon/components/error.js +2 -0
  597. package/icon/components/imagePreview.js +2 -0
  598. package/icon/components/info.js +2 -0
  599. package/icon/components/play-video.js +2 -0
  600. package/icon/components/reset-color.d.ts +3 -0
  601. package/icon/components/reset-color.js +11 -0
  602. package/icon/components/search.js +2 -0
  603. package/icon/components/tick.js +2 -0
  604. package/icon/components/tickCircle-solid.js +2 -0
  605. package/icon/components/user.js +2 -0
  606. package/icon/components/video-non-playable.js +2 -0
  607. package/index.d.ts +2 -0
  608. package/index.js +3 -0
  609. package/input/basewebAdapters.d.ts +1 -1
  610. package/input/basewebAdapters.js +18 -3
  611. package/input/index.d.ts +2 -1
  612. package/input/index.js +3 -1
  613. package/input/styled-components.d.ts +1 -1
  614. package/input/styled-components.js +7 -5
  615. package/input/types.d.ts +10 -4
  616. package/layer/useLayersContextValue.js +2 -1
  617. package/list/avatar-list-item.d.ts +12 -22
  618. package/list/avatar-list-item.js +6 -8
  619. package/list/divider.js +6 -3
  620. package/list/index.d.ts +1 -1
  621. package/list/index.js +2 -1
  622. package/list/list-item.d.ts +3 -1
  623. package/list/list-item.js +9 -6
  624. package/list/list.d.ts +10 -5
  625. package/list/list.js +47 -6
  626. package/list/styled-component.d.ts +1 -0
  627. package/list/styled-component.js +24 -18
  628. package/list/types.d.ts +8 -0
  629. package/list/utils.d.ts +2 -0
  630. package/list/utils.js +14 -0
  631. package/locale/en_US.js +35 -0
  632. package/locale/types.d.ts +21 -0
  633. package/menu/MenuContext.d.ts +2 -1
  634. package/menu/MenuContext.js +1 -0
  635. package/menu/menu-item.d.ts +8 -2
  636. package/menu/menu-item.js +11 -11
  637. package/menu/menu.d.ts +6 -0
  638. package/menu/menu.js +11 -11
  639. package/menu/types.d.ts +1 -0
  640. package/menu/useKeyboardNavigation.d.ts +6 -3
  641. package/menu/useKeyboardNavigation.js +21 -14
  642. package/menu/useStatefulMenu.d.ts +5 -2
  643. package/menu/useStatefulMenu.js +14 -8
  644. package/modal/adapter.d.ts +1 -1
  645. package/modal/index.d.ts +1 -1
  646. package/modal/index.js +1 -2
  647. package/modal/modal.js +4 -4
  648. package/modal/overrides.d.ts +2 -3
  649. package/modal/overrides.js +7 -9
  650. package/modal/styled-components.d.ts +1 -1
  651. package/modal/styled-components.js +8 -9
  652. package/number/Number.d.ts +3 -0
  653. package/number/Number.js +14 -0
  654. package/number/constants.d.ts +2 -0
  655. package/number/constants.js +7 -0
  656. package/number/index.d.ts +5 -0
  657. package/number/index.js +12 -0
  658. package/number/package.json +4 -0
  659. package/number/types.d.ts +6 -0
  660. package/number/types.js +2 -0
  661. package/number/useNumber.d.ts +2 -0
  662. package/number/useNumber.js +12 -0
  663. package/overrides/index.d.ts +1 -1
  664. package/overrides/index.js +2 -1
  665. package/overrides/mergeOverrides.d.ts +3 -2
  666. package/overrides/mergeOverrides.js +6 -4
  667. package/package.json +18 -12
  668. package/payment-card/basewebAdapters.d.ts +2 -0
  669. package/payment-card/basewebAdapters.js +27 -4
  670. package/payment-card/styled-components.js +24 -5
  671. package/payment-card/types.d.ts +4 -2
  672. package/phone-input/country-select-container.js +1 -1
  673. package/phone-input/country-select.js +4 -6
  674. package/phone-input/default-props.d.ts +6 -9
  675. package/phone-input/default-props.js +8 -9
  676. package/phone-input/flag-container.js +1 -1
  677. package/phone-input/phone-input.d.ts +0 -6
  678. package/phone-input/phone-input.js +20 -11
  679. package/phone-input/stateful-phone-input-container.js +4 -3
  680. package/phone-input/stateful-phone-input.d.ts +0 -6
  681. package/phone-input/styled-components.d.ts +9 -1
  682. package/phone-input/styled-components.js +22 -7
  683. package/phone-input/types.d.ts +2 -1
  684. package/phone-input/utils.d.ts +10 -3
  685. package/phone-input/utils.js +11 -5
  686. package/popover/adapter.d.ts +4 -3
  687. package/popover/adapter.js +16 -1
  688. package/popover/overrides.js +8 -19
  689. package/popover/popover.d.ts +6 -3
  690. package/popover/popover.js +12 -5
  691. package/popover/stateful-popover.js +2 -2
  692. package/popover/types.d.ts +10 -2
  693. package/popover/types.js +5 -4
  694. package/popover/utils.d.ts +12 -0
  695. package/popover/utils.js +11 -1
  696. package/progress/circular/styled-component.d.ts +1 -1
  697. package/progress/circular/styled-component.js +4 -4
  698. package/progress/linear/styled-component.d.ts +1 -1
  699. package/progress/linear/styled-component.js +5 -5
  700. package/radio/basewebAdapters.d.ts +8 -11
  701. package/radio/basewebAdapters.js +6 -3
  702. package/radio/radio.js +6 -5
  703. package/radio/styled-components.js +9 -11
  704. package/radio/types.d.ts +13 -6
  705. package/search/index.d.ts +1 -0
  706. package/search/index.js +3 -1
  707. package/search/search.d.ts +1 -1
  708. package/search/search.js +14 -5
  709. package/search/stateful-search.d.ts +3 -0
  710. package/search/stateful-search.js +19 -0
  711. package/search/styled-components.d.ts +1 -10
  712. package/search/styled-components.js +56 -25
  713. package/search/types.d.ts +8 -2
  714. package/select/adaptor.d.ts +1 -1
  715. package/select/base-select.d.ts +36 -16
  716. package/select/base-select.js +183 -86
  717. package/select/constants.d.ts +3 -0
  718. package/select/constants.js +4 -2
  719. package/select/default-props.d.ts +9 -5
  720. package/select/default-props.js +4 -1
  721. package/select/index.d.ts +4 -4
  722. package/select/index.js +4 -2
  723. package/select/locale.d.ts +4 -0
  724. package/select/mobileSelect/MobileSelect.js +3 -5
  725. package/select/mobileSelect/MobileSheet.js +3 -1
  726. package/select/multi-value.js +21 -11
  727. package/select/overlaySelect/OverlaySelect.js +9 -17
  728. package/select/overlaySelect/hooks/useControlRef.d.ts +9 -0
  729. package/select/overlaySelect/hooks/useControlRef.js +37 -0
  730. package/select/overlaySelect/hooks/useOverlaySelectOverrides.d.ts +24 -0
  731. package/select/overlaySelect/{useOverlaySelectOverrides.js → hooks/useOverlaySelectOverrides.js} +31 -28
  732. package/select/overlaySelect/{usePopover.d.ts → hooks/usePopover.d.ts} +1 -1
  733. package/select/overlaySelect/{usePopover.js → hooks/usePopover.js} +2 -2
  734. package/select/overrides.d.ts +3 -1
  735. package/select/overrides.js +20 -14
  736. package/select/select-variants.js +2 -2
  737. package/select/select.d.ts +9 -5
  738. package/select/select.js +9 -3
  739. package/select/selectMenuAdapter/CollapsibleSelectMenu.d.ts +118 -0
  740. package/select/selectMenuAdapter/CollapsibleSelectMenu.js +74 -0
  741. package/select/selectMenuAdapter/SelectMenuAdapter.d.ts +2 -32
  742. package/select/selectMenuAdapter/SelectMenuAdapter.js +11 -5
  743. package/select/selectMenuAdapter/SelectMenuItem.d.ts +8 -2
  744. package/select/selectMenuAdapter/SelectMenuItem.js +2 -4
  745. package/select/selectMenuAdapter/hooks/useGetExpandedGroup.d.ts +6 -0
  746. package/select/selectMenuAdapter/hooks/useGetExpandedGroup.js +20 -0
  747. package/select/selectMenuAdapter/types.d.ts +42 -0
  748. package/select/selectMenuAdapter/types.js +2 -0
  749. package/select/stateful-select.d.ts +9 -5
  750. package/select/stateful-select.js +3 -3
  751. package/select/styled-component.d.ts +15 -4
  752. package/select/styled-component.js +58 -11
  753. package/select/types.d.ts +36 -9
  754. package/select/types.js +2 -1
  755. package/select/utils/default-filter-options.d.ts +2 -1
  756. package/select/utils/default-filter-options.js +6 -5
  757. package/select/utils/hidden-element.d.ts +6 -0
  758. package/select/utils/hidden-element.js +19 -0
  759. package/select/utils/merge-options.d.ts +2 -0
  760. package/select/utils/merge-options.js +22 -0
  761. package/select/utils/test-utils.d.ts +1 -0
  762. package/select/utils/test-utils.js +11 -0
  763. package/slider/mark.d.ts +3 -3
  764. package/slider/slider.js +2 -1
  765. package/slider/stateful-slider.js +1 -1
  766. package/slider/styled-components.js +4 -4
  767. package/slider/types.d.ts +9 -2
  768. package/snackbar/Snackbar.js +12 -12
  769. package/snackbar/styled-component.js +9 -6
  770. package/spacewebProvider/CustomBaseProvider.js +1 -0
  771. package/spacewebProvider/SpacewebProvider.d.ts +3 -1
  772. package/spacewebProvider/SpacewebProvider.js +8 -8
  773. package/stack/stack.js +6 -13
  774. package/style/_buildUtils.d.ts +1 -1
  775. package/style/_buildUtils.js +3 -1
  776. package/style/_parseStyle.js +12 -7
  777. package/style/useMemoizedStyletron.d.ts +1 -1
  778. package/style/useMemoizedStyletron.js +6 -1
  779. package/styleEngine/styleEngine.d.ts +1 -2
  780. package/switch/__test__/switch.spec.js +13 -0
  781. package/switch/styled-components.js +14 -21
  782. package/switch/switch.js +5 -2
  783. package/switch/types.d.ts +8 -11
  784. package/tag/avatar-tag.js +23 -16
  785. package/tag/styled-components.js +32 -27
  786. package/tag/tag.js +19 -11
  787. package/tag/types.d.ts +2 -2
  788. package/tag/utils.d.ts +50 -0
  789. package/tag/utils.js +67 -1
  790. package/textarea/basewebAdapters.js +3 -3
  791. package/textarea/styled-components.d.ts +1 -1
  792. package/textarea/textarea.js +3 -7
  793. package/textarea/types.d.ts +7 -5
  794. package/theme/Provider.d.ts +10 -0
  795. package/theme/Provider.js +65 -0
  796. package/theme/context.d.ts +1 -10
  797. package/theme/context.js +1 -61
  798. package/theme/index.d.ts +1 -0
  799. package/theme/index.js +1 -0
  800. package/themes/index.js +1 -1
  801. package/themes/responsive-theme.d.ts +2 -2
  802. package/time-picker/TimePicker.d.ts +1 -6
  803. package/time-picker/TimePicker.js +4 -4
  804. package/time-picker/types.d.ts +3 -1
  805. package/time-range-picker/RangeSelector.js +5 -4
  806. package/time-range-picker/RangeSelectorContainer.js +26 -26
  807. package/time-range-picker/TimeRangeList.js +8 -1
  808. package/time-range-picker/TimeRangePicker.js +25 -16
  809. package/time-range-picker/index.d.ts +1 -1
  810. package/time-range-picker/index.js +4 -1
  811. package/time-range-picker/locale.d.ts +3 -0
  812. package/time-range-picker/types.d.ts +17 -3
  813. package/time-range-picker/utils.d.ts +47 -18
  814. package/time-range-picker/utils.js +98 -17
  815. package/time-zone-picker/TimezonePicker.d.ts +1 -6
  816. package/time-zone-picker/TimezonePicker.js +5 -7
  817. package/time-zone-picker/types.d.ts +2 -0
  818. package/tooltip/disabled-tooltip-container.d.ts +26 -1
  819. package/tooltip/overrides.js +1 -2
  820. package/tooltip/stateful-tooltip-container.d.ts +26 -1
  821. package/tooltip/stateful-tooltip.d.ts +27 -1
  822. package/tooltip/stateful-tooltip.js +2 -2
  823. package/tooltip/tooltip.d.ts +1 -1
  824. package/tooltip/tooltip.js +7 -4
  825. package/tooltip/types.d.ts +12 -2
  826. package/tsconfig.tsbuildinfo +1 -1
  827. package/types.d.ts +5 -3
  828. package/typography/Typography.js +14 -1
  829. package/typography/constants.d.ts +56 -0
  830. package/typography/constants.js +57 -1
  831. package/typography/index.d.ts +1 -0
  832. package/typography/index.js +3 -1
  833. package/typography/styled-components.js +11 -3
  834. package/typography/types.d.ts +1 -1
  835. package/utils/intlNumberFormatUtils/index.d.ts +7 -0
  836. package/utils/intlNumberFormatUtils/index.js +40 -0
  837. package/utils/intlNumberFormatUtils/types.d.ts +21 -0
  838. package/utils/intlNumberFormatUtils/types.js +9 -0
  839. package/utils/package.json +4 -0
  840. package/video/Video.js +4 -2
  841. package/video/types.d.ts +2 -0
  842. package/esm/icon/components/chevron-right-solid.d.ts +0 -3
  843. package/esm/icon/components/chevron-right-solid.js +0 -6
  844. package/esm/phone-input/virtualized-country-select-dropdown.d.ts +0 -31
  845. package/esm/phone-input/virtualized-country-select-dropdown.js +0 -33
  846. package/esm/select/overlaySelect/useOverlaySelectOverrides.d.ts +0 -14
  847. package/esm/style/_escapeClassName.d.ts +0 -6
  848. package/esm/style/_escapeClassName.js +0 -6
  849. package/icon/components/chevron-right-solid.d.ts +0 -3
  850. package/icon/components/chevron-right-solid.js +0 -9
  851. package/phone-input/virtualized-country-select-dropdown.d.ts +0 -31
  852. package/phone-input/virtualized-country-select-dropdown.js +0 -35
  853. package/select/overlaySelect/useOverlaySelectOverrides.d.ts +0 -14
  854. package/style/_escapeClassName.d.ts +0 -6
  855. package/style/_escapeClassName.js +0 -9
@@ -1,9 +1,9 @@
1
1
  import { __assign, __awaiter, __extends, __generator, __read, __spreadArray } from "tslib";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
- import { normalizeOptions } from 'baseui/select/utils';
4
3
  import _noop from 'lodash/noop';
5
4
  import _pick from 'lodash/pick';
6
5
  import _omit from 'lodash/omit';
6
+ import _keyBy from 'lodash/keyBy';
7
7
  import memoizeOne from 'memoize-one';
8
8
  import { Component } from 'react';
9
9
  import * as React from 'react';
@@ -18,40 +18,52 @@ import { typeAdaptor } from './adaptor';
18
18
  import { STATE_CHANGE_TYPE } from './constants';
19
19
  import defaultProps from './default-props';
20
20
  import MultiValue from './multi-value';
21
- import { getControlContainerStyles, getSelectInputStyles, getSearchIconContainerStyles, getSearchIconStyles, getValueContainerStyles, getValueTypography, SelectArrow, } from './overrides';
21
+ import { getControlContainerStyles, getSearchIconContainerStyles, getSearchIconStyles, getValueContainerStyles, getValueTypography, SelectArrow, SingleValueTombstone, } from './overrides';
22
22
  import { getPlaceholderTypography } from '../input/styled-components';
23
23
  import SelectMenuAdapter from './selectMenuAdapter';
24
24
  import ClearIconButton from '../helpers/ClearIconButton';
25
25
  import { Input, InputContainer, StyledSelect } from './styled-component';
26
- import { SELECT_ALL_ID } from './types';
26
+ import { SELECT_ALL_ID, CLEAR_OPTION_ID, } from './types';
27
27
  import { add$props } from '../helpers';
28
28
  import { combineRefs } from '../hooks/useCombinedRef';
29
29
  import { getUniqueId } from '../hooks/useUniqueId';
30
+ import { mergeOptions } from './utils/merge-options';
30
31
  var BaseSelect = /** @class */ (function (_super) {
31
32
  __extends(BaseSelect, _super);
32
33
  function BaseSelect() {
33
34
  var _this = _super !== null && _super.apply(this, arguments) || this;
35
+ _this.state = {
36
+ isContainerFocused: false,
37
+ };
38
+ _this.lastSelectedValue = _this.props.value;
34
39
  _this.id = getUniqueId();
35
40
  _this.menuId = getUniqueId();
41
+ _this.getMemoizedNormalizedOptions = memoizeOne(function (valueKey, options1, options2) { return mergeOptions(valueKey, options1, options2); });
42
+ _this.getValueByIdMap = memoizeOne(function (value, valueKey) { return _keyBy(value, valueKey); });
36
43
  _this.shouldDisplaySelectAll = function () {
37
- var _a = _this.props, multi = _a.multi, hideSelectAll = _a.hideSelectAll, options = _a.options;
38
- return (multi && !hideSelectAll && _this.getNormalizedOptions(_this.mergeOptions(options, _this.createdOptions)).length > 0);
44
+ var _a = _this.props, multi = _a.multi, hideSelectAll = _a.hideSelectAll, options = _a.options, valueKey = _a.valueKey;
45
+ return (multi && !hideSelectAll && _this.getMemoizedNormalizedOptions(valueKey, options, _this.createdOptions).length > 0);
39
46
  };
40
- _this.getNormalizedOptions = memoizeOne(function (options) { return normalizeOptions(options); });
41
- _this.isSelectAllChecked = memoizeOne(
42
47
  // in creatable select, value length can be more than length of options
43
- function (value, options) {
44
- return (value === null || value === void 0 ? void 0 : value.length) >= _this.getNormalizedOptions(_this.mergeOptions(options, _this.createdOptions)).length;
45
- });
48
+ _this.isSelectAllChecked = function (value, options) {
49
+ return _this.props.__selectAllShouldReturnAllOptions
50
+ ? _this.props.__selectAllSelected
51
+ : (value === null || value === void 0 ? void 0 : value.length) >=
52
+ _this.getMemoizedNormalizedOptions(_this.props.valueKey, options, _this.createdOptions).filter(function (opt) { return !opt.disabled; }).length;
53
+ };
46
54
  _this.getSelectOverrides =
47
55
  // FIXME: Remove use of any
48
56
  function () {
49
- var _a = _this.props, _b = _a.id, id = _b === void 0 ? _this.id : _b, valueKey = _a.valueKey, labelKey = _a.labelKey, value = _a.value, multi = _a.multi, overrides = _a.overrides, noResultsMsg = _a.noResultsMsg, options = _a.options, className = _a.className, style = _a.style, intent = _a.intent, size = _a.size, disabled = _a.disabled, captureScroll = _a.captureScroll, placement = _a.placement, popoverMinWidth = _a.popoverMinWidth, searchable = _a.searchable;
57
+ var _a;
58
+ var _b = _this.props, _c = _b.id, id = _c === void 0 ? _this.id : _c, valueKey = _b.valueKey, labelKey = _b.labelKey, value = _b.value, multi = _b.multi, overrides = _b.overrides, noResultsMsg = _b.noResultsMsg, options = _b.options, className = _b.className, style = _b.style, intent = _b.intent, size = _b.size, disabled = _b.disabled, captureScroll = _b.captureScroll, placement = _b.placement, popoverMinWidth = _b.popoverMinWidth, searchable = _b.searchable, virtual = _b.virtual, ignoreBoundary = _b.ignoreBoundary, clearAsOption = _b.clearAsOption, selectOnTab = _b.selectOnTab;
50
59
  return {
51
60
  Root: {
52
61
  style: [className, style],
53
62
  // https://github.com/uber/baseweb/issues/3702#issuecomment-792665393
54
- props: { tabIndex: -1 },
63
+ props: {
64
+ tabIndex: -1,
65
+ onFocus: function () { return _this.setState({ isContainerFocused: true }); },
66
+ },
55
67
  },
56
68
  StatefulMenu: {
57
69
  component: SelectMenuAdapter,
@@ -63,8 +75,12 @@ var BaseSelect = /** @class */ (function (_super) {
63
75
  labelKey: labelKey,
64
76
  multi: multi,
65
77
  selectAllSelected: _this.isSelectAllChecked(value, options),
78
+ shouldDisplaySelectAll: _this.shouldDisplaySelectAll(),
66
79
  noResultsMsg: noResultsMsg,
67
80
  captureScroll: captureScroll,
81
+ virtual: virtual,
82
+ overscanCount: 20,
83
+ selectOnTab: selectOnTab,
68
84
  },
69
85
  },
70
86
  DropdownContainer: {
@@ -74,32 +90,72 @@ var BaseSelect = /** @class */ (function (_super) {
74
90
  },
75
91
  style: __assign(__assign({}, (popoverMinWidth ? { minWidth: popoverMinWidth } : {})), borderRadius('inherit')),
76
92
  },
77
- OptionContent: { style: { fontWeight: 'inherit' } },
93
+ // aria-selected is applied on SelectMenuItem. No need to apply it on OptionContent
94
+ OptionContent: {
95
+ style: { fontWeight: 'inherit', wordBreak: 'break-word' },
96
+ props: { 'aria-selected': undefined },
97
+ },
78
98
  ControlContainer: { style: getControlContainerStyles, props: add$props({ intent: intent, size: size, disabled: disabled }) },
79
- ValueContainer: { style: getValueContainerStyles, props: add$props({ intent: intent, size: size, disabled: disabled }) },
80
- MultiValue: { component: MultiValue, props: { selectSize: size } },
81
- SingleValue: { style: getValueTypography, props: { $selectSize: size } },
99
+ ValueContainer: {
100
+ style: getValueContainerStyles,
101
+ props: __assign({}, add$props({ intent: intent, size: size, disabled: disabled })),
102
+ },
103
+ MultiValue: {
104
+ component: MultiValue,
105
+ props: {
106
+ 'data-testid': 'combobox-selected-value',
107
+ selectSize: size,
108
+ $value: value,
109
+ $valueByIdMap: _this.getValueByIdMap(value, valueKey),
110
+ $valueKey: valueKey,
111
+ $isContainerFocused: _this.state.isContainerFocused,
112
+ },
113
+ },
114
+ SingleValue: {
115
+ component: ((_a = value === null || value === void 0 ? void 0 : value[0]) === null || _a === void 0 ? void 0 : _a.__loading) ? SingleValueTombstone : undefined,
116
+ style: getValueTypography,
117
+ props: { 'data-testid': 'combobox-selected-value', $selectSize: size, $value: value },
118
+ },
82
119
  InputContainer: {
83
120
  component: InputContainer,
84
- props: { menuId: _this.menuId, size: size },
85
- style: getValueTypography,
121
+ props: { menuId: _this.menuId, size: size, $value: value, $labelKey: labelKey, placeholder: _this.props.placeholder },
86
122
  },
87
123
  Input: {
88
124
  component: Input,
89
- props: { id: id, menuId: searchable ? _this.menuId : null, onPaste: _this.handlePaste },
90
- style: getSelectInputStyles,
125
+ props: {
126
+ id: id,
127
+ 'aria-required': _this.props['aria-required'],
128
+ menuId: searchable ? _this.menuId : null,
129
+ onPaste: _this.handlePaste,
130
+ placeholder: _this.props.placeholder,
131
+ $value: value,
132
+ $labelKey: labelKey,
133
+ 'aria-label': _this.props['aria-label'],
134
+ },
91
135
  },
92
136
  Placeholder: {
93
137
  style: getPlaceholderTypography,
94
138
  },
95
- IconsContainer: { style: 'cursor-pointer pr-0 sticky top-0' },
139
+ IconsContainer: { style: 'cursor-pointer px-0 sticky top-0' },
96
140
  SelectArrow: { component: SelectArrow },
97
- ClearIcon: { component: ClearIconButton },
98
- SearchIcon: { component: Search, style: getSearchIconStyles },
141
+ ClearIcon: {
142
+ component: clearAsOption ? function () { return null; } : ClearIconButton,
143
+ props: { tabIndex: _this.state.isContainerFocused ? 0 : -1 },
144
+ },
145
+ SearchIcon: {
146
+ component: Search,
147
+ style: getSearchIconStyles,
148
+ },
99
149
  SearchIconContainer: { style: getSearchIconContainerStyles },
100
150
  Popover: {
101
151
  component: Popover,
102
- props: { placement: placement, showArrow: false, returnFocus: false, overrides: { Body: { style: 'mt-2' } } },
152
+ props: {
153
+ placement: placement,
154
+ showArrow: false,
155
+ returnFocus: false,
156
+ overrides: { Body: { style: 'mt-2' } },
157
+ ignoreBoundary: ignoreBoundary,
158
+ },
103
159
  },
104
160
  LoadingIndicator: {
105
161
  component: function () { return (_jsx(Loader, { size: 16, variant: "clip", className: "mx-1", overrides: {
@@ -110,65 +166,38 @@ var BaseSelect = /** @class */ (function (_super) {
110
166
  },
111
167
  };
112
168
  };
113
- _this.mergeOptions = function (options1, options2) {
114
- var mergedOptions = options1;
115
- if (Array.isArray(options1)) {
116
- if (Array.isArray(options2)) {
117
- mergedOptions = options1.concat(options2);
118
- }
119
- else if (typeof options2 === 'object') {
120
- mergedOptions = __assign({}, options2);
121
- mergedOptions.__ungrouped = mergedOptions.__ungrouped
122
- ? options1.concat(mergedOptions.__ungrouped)
123
- : options1;
124
- }
125
- }
126
- else if (typeof options1 === 'object') {
127
- mergedOptions = __assign({}, options1);
128
- if (Array.isArray(options2)) {
129
- mergedOptions.__ungrouped = mergedOptions.__ungrouped
130
- ? mergedOptions.__ungrouped.concat(options2)
131
- : options2;
132
- }
133
- else if (typeof options2 === 'object') {
134
- Object.keys(options2).forEach(function (key) {
135
- if (!mergedOptions) {
136
- return;
137
- }
138
- if (key in mergedOptions) {
139
- mergedOptions[key] = mergedOptions[key].concat(options2[key]);
140
- }
141
- else {
142
- mergedOptions[key] = options2[key];
143
- }
144
- });
145
- }
146
- }
147
- else {
148
- mergedOptions = options2;
149
- }
150
- return mergedOptions;
151
- };
152
169
  /*
153
170
  * 1. Add selected values which are not present in Options (to display newly created option)
154
171
  * 2. Add selectAll option in multi-select
155
172
  * */
156
- // todo: remove usage of normalizeOptions
157
- _this.getOptions = memoizeOne(function (locale, createdOptions, options) {
158
- var _a;
159
- var _b = _this.props, valueKey = _b.valueKey, labelKey = _b.labelKey;
160
- var mergedOptions = _this.mergeOptions(options, createdOptions);
161
- var optionArr = _this.getNormalizedOptions(mergedOptions);
173
+ _this.getOptions = memoizeOne(function (locale, createdOptions, options, shouldPrependClearOption) {
174
+ var _a, _b;
175
+ var _c = _this.props, valueKey = _c.valueKey, labelKey = _c.labelKey, clearAsOptionLabel = _c.clearAsOptionLabel, multi = _c.multi;
176
+ var optionArr = _this.getMemoizedNormalizedOptions(valueKey, options, createdOptions);
177
+ if (shouldPrependClearOption) {
178
+ optionArr = __spreadArray([
179
+ (_a = {},
180
+ _a[valueKey] = CLEAR_OPTION_ID,
181
+ _a[labelKey] = clearAsOptionLabel !== null && clearAsOptionLabel !== void 0 ? clearAsOptionLabel : locale.select.clearOptionLabel,
182
+ _a[CLEAR_OPTION_ID] = true,
183
+ _a)
184
+ ], __read(optionArr), false);
185
+ }
162
186
  if (!_this.shouldDisplaySelectAll()) {
163
187
  return optionArr;
164
188
  }
165
189
  return __spreadArray([
166
- (_a = {}, _a[valueKey] = SELECT_ALL_ID, _a[labelKey] = locale.select.selectAllLabel, _a[SELECT_ALL_ID] = true, _a)
190
+ (_b = {}, _b[valueKey] = SELECT_ALL_ID, _b[labelKey] = locale.select.selectAllLabel, _b[SELECT_ALL_ID] = true, _b)
167
191
  ], __read(optionArr), false);
168
192
  });
193
+ _this.defaultCreateOption = function (label) {
194
+ var _a;
195
+ var _b = _this.props, labelKey = _b.labelKey, valueKey = _b.valueKey;
196
+ return [(_a = {}, _a[labelKey] = label.trim(), _a[valueKey] = label.trim(), _a)];
197
+ };
169
198
  _this.getCreatedOptions = function (option) {
170
- var _a = _this.props, labelKey = _a.labelKey, createOption = _a.createOption;
171
- if (createOption && typeof option[labelKey] === 'string') {
199
+ var _a = _this.props, labelKey = _a.labelKey, _b = _a.createOption, createOption = _b === void 0 ? _this.defaultCreateOption : _b;
200
+ if (typeof option[labelKey] === 'string') {
172
201
  return Promise.resolve(createOption(option[labelKey]));
173
202
  }
174
203
  return Promise.resolve([
@@ -185,12 +214,27 @@ var BaseSelect = /** @class */ (function (_super) {
185
214
  return (__assign(__assign({}, acc), (_a = {}, _a[key] = (_b = options[key]) === null || _b === void 0 ? void 0 : _b.map(function (option) { return (__assign(__assign({}, option), { isCreatable: true })); }), _a)));
186
215
  }, {});
187
216
  };
217
+ _this.handleBlur = function (e) {
218
+ var _a;
219
+ if (!_this.props.clearable && !_this.props.multi && !_this.props.value.length && _this.lastSelectedValue.length) {
220
+ _this.props.onChange({
221
+ option: _this.lastSelectedValue[0],
222
+ type: STATE_CHANGE_TYPE.select,
223
+ value: _this.lastSelectedValue,
224
+ });
225
+ }
226
+ _this.setState({ isContainerFocused: false });
227
+ (_a = _this.props) === null || _a === void 0 ? void 0 : _a.onBlur(e);
228
+ };
188
229
  _this.handleChange = function (params) { return __awaiter(_this, void 0, void 0, function () {
189
- var _a, options, _b, onChange, value, creatable, prevSelectAllState, newCreatedOptions, newCreatedValues, mergedValue;
230
+ var _a, options, _b, onChange, value, creatable, valueKey, __selectAllShouldReturnAllOptions, multi, prevSelectAllState, newCreatedOptions, newCreatedValues, mergedValue;
190
231
  return __generator(this, function (_c) {
191
232
  switch (_c.label) {
192
233
  case 0:
193
- _a = this.props, options = _a.options, _b = _a.onChange, onChange = _b === void 0 ? _noop : _b, value = _a.value, creatable = _a.creatable;
234
+ _a = this.props, options = _a.options, _b = _a.onChange, onChange = _b === void 0 ? _noop : _b, value = _a.value, creatable = _a.creatable, valueKey = _a.valueKey, __selectAllShouldReturnAllOptions = _a.__selectAllShouldReturnAllOptions, multi = _a.multi;
235
+ if (params.value.length > 0) {
236
+ this.lastSelectedValue = params.value;
237
+ }
194
238
  //select the user input on option selection
195
239
  if (params.type === STATE_CHANGE_TYPE.select && this.inputRef.current && 'select' in this.inputRef.current) {
196
240
  this.inputRef.current.select();
@@ -205,22 +249,32 @@ var BaseSelect = /** @class */ (function (_super) {
205
249
  ? { type: STATE_CHANGE_TYPE.clear, value: [] }
206
250
  : {
207
251
  type: STATE_CHANGE_TYPE.selectAll,
208
- value: normalizeOptions(this.mergeOptions(options, this.createdOptions)),
252
+ value: __selectAllShouldReturnAllOptions
253
+ ? []
254
+ : mergeOptions(valueKey, options, this.createdOptions).filter(function (opt) { return !opt.disabled; }),
209
255
  });
210
256
  }
211
257
  return [2 /*return*/];
212
258
  }
259
+ if (params.option && params.option[CLEAR_OPTION_ID]) {
260
+ onChange({
261
+ type: STATE_CHANGE_TYPE.clear,
262
+ value: [],
263
+ option: null,
264
+ });
265
+ return [2 /*return*/];
266
+ }
213
267
  if (!(creatable && params.type === STATE_CHANGE_TYPE.select && params.option && params.option.isCreatable)) return [3 /*break*/, 2];
214
268
  return [4 /*yield*/, this.getCreatedOptions(params.option)];
215
269
  case 1:
216
270
  newCreatedOptions = _c.sent();
217
- this.createdOptions = this.mergeOptions(this.createdOptions, newCreatedOptions);
271
+ this.createdOptions = mergeOptions(valueKey, this.createdOptions, newCreatedOptions);
218
272
  newCreatedValues = this.getCreatedValues(newCreatedOptions);
219
- mergedValue = this.mergeOptions(value, newCreatedValues);
273
+ mergedValue = mergeOptions(valueKey, value, newCreatedValues);
220
274
  onChange({
221
- option: __assign(__assign({}, newCreatedOptions[0]), { isCreatable: true }),
275
+ option: __assign(__assign({}, newCreatedOptions === null || newCreatedOptions === void 0 ? void 0 : newCreatedOptions[0]), { isCreatable: true }),
222
276
  type: STATE_CHANGE_TYPE.select,
223
- value: this.getNormalizedOptions(mergedValue),
277
+ value: multi ? mergedValue : [mergedValue[mergedValue.length - 1]],
224
278
  });
225
279
  return [2 /*return*/];
226
280
  case 2:
@@ -230,25 +284,68 @@ var BaseSelect = /** @class */ (function (_super) {
230
284
  });
231
285
  }); };
232
286
  _this.handlePaste = function (e) {
233
- var _a = _this.props, onPaste = _a.onPaste, _b = _a.onChange, onChange = _b === void 0 ? _noop : _b, value = _a.value;
287
+ var _a = _this.props, onPaste = _a.onPaste, _b = _a.onChange, onChange = _b === void 0 ? _noop : _b, value = _a.value, valueKey = _a.valueKey, multi = _a.multi;
234
288
  var pastedOptions = onPaste === null || onPaste === void 0 ? void 0 : onPaste(e);
235
289
  if (!pastedOptions) {
236
290
  return;
237
291
  }
238
- _this.createdOptions = _this.mergeOptions(_this.createdOptions, pastedOptions);
239
- var mergedValue = _this.mergeOptions(value, pastedOptions);
240
- onChange({ type: STATE_CHANGE_TYPE.select, value: _this.getNormalizedOptions(mergedValue) });
292
+ _this.createdOptions = mergeOptions(valueKey, _this.createdOptions, pastedOptions);
293
+ var mergedValue = mergeOptions(valueKey, value, pastedOptions);
294
+ onChange({ type: STATE_CHANGE_TYPE.select, value: multi ? mergedValue : [mergedValue[mergedValue.length - 1]] });
241
295
  };
296
+ _this.handleInputChange = function (e) { return __awaiter(_this, void 0, void 0, function () {
297
+ var _a, _b, onChange, value, valueKey, onInputChange, multi, delimiter, _c, createOption, val, shouldCreateOption, labels, createdOptions, resolvedOptions, err_1, mergedValue;
298
+ var _d, _e;
299
+ return __generator(this, function (_f) {
300
+ switch (_f.label) {
301
+ case 0:
302
+ _a = this.props, _b = _a.onChange, onChange = _b === void 0 ? _noop : _b, value = _a.value, valueKey = _a.valueKey, onInputChange = _a.onInputChange, multi = _a.multi, delimiter = _a.delimiter, _c = _a.createOption, createOption = _c === void 0 ? this.defaultCreateOption : _c;
303
+ onInputChange === null || onInputChange === void 0 ? void 0 : onInputChange(e);
304
+ val = e.target.value;
305
+ shouldCreateOption = typeof delimiter === 'string' && val.includes(delimiter);
306
+ if (!shouldCreateOption) {
307
+ return [2 /*return*/];
308
+ }
309
+ labels = val.split(delimiter).filter(function (label) { return label.trim(); });
310
+ createdOptions = [];
311
+ _f.label = 1;
312
+ case 1:
313
+ _f.trys.push([1, 3, , 4]);
314
+ return [4 /*yield*/, Promise.all(labels.map(function (label) { return createOption(label); }))];
315
+ case 2:
316
+ resolvedOptions = _f.sent();
317
+ createdOptions = resolvedOptions.filter(function (opt) { return !!opt; }).flat();
318
+ return [3 /*break*/, 4];
319
+ case 3:
320
+ err_1 = _f.sent();
321
+ console.error(err_1);
322
+ return [3 /*break*/, 4];
323
+ case 4:
324
+ if (createdOptions.length > 0) {
325
+ this.createdOptions = mergeOptions(valueKey, this.createdOptions, createdOptions);
326
+ mergedValue = mergeOptions(valueKey, value, createdOptions);
327
+ onChange({
328
+ type: STATE_CHANGE_TYPE.inputChange,
329
+ value: multi ? mergedValue : [mergedValue[mergedValue.length - 1]],
330
+ });
331
+ (_d = this.inputRef.current) === null || _d === void 0 ? void 0 : _d.focus();
332
+ (_e = this.inputRef.current) === null || _e === void 0 ? void 0 : _e.setSelectionRange(0, val.length);
333
+ }
334
+ return [2 /*return*/];
335
+ }
336
+ });
337
+ }); };
242
338
  _this.inputRef = React.createRef();
243
- _this.combinedInputRef = memoizeOne(function (refParam) {
244
- return combineRefs(_this.inputRef, refParam);
245
- });
246
339
  return _this;
247
340
  }
248
341
  BaseSelect.prototype.render = function () {
249
342
  var _this = this;
250
- var _a = this.props, options = _a.options, selectOverrides = _a.overrides, type = _a.type, controlRef = _a.controlRef;
251
- return (_jsx(LocaleConsumer, { children: function (locale) { return (_jsx(SpaceStyleConsumer, { children: function (utils) { return (_jsx(StyledSelect, __assign({}, _omit(_this.props, 'size'), { overrides: mergeAndConvertOverrides(_this.getSelectOverrides(), selectOverrides, utils), controlRef: _this.combinedInputRef(controlRef), options: _this.getOptions(locale, _this.createdOptions, options), onChange: _this.handleChange, type: typeAdaptor[type] }), void 0)); } }, void 0)); } }, void 0));
343
+ var _a = this.props, options = _a.options, selectOverrides = _a.overrides, type = _a.type, controlRef = _a.controlRef, inputRef = _a.inputRef, value = _a.value, clearAsOption = _a.clearAsOption, multi = _a.multi;
344
+ var shouldPrependClearOption = clearAsOption && !multi && value && value.length > 0;
345
+ return (_jsx(LocaleConsumer, { children: function (locale) { return (_jsx(SpaceStyleConsumer, { children: function (utils) {
346
+ var _a;
347
+ return (_jsx(StyledSelect, __assign({}, _omit(_this.props, 'size'), { overrides: mergeAndConvertOverrides(_this.getSelectOverrides(), selectOverrides, utils), controlRef: controlRef, inputRef: combineRefs(_this.inputRef, inputRef), options: _this.getOptions(locale, _this.createdOptions, options, shouldPrependClearOption), onChange: _this.handleChange, type: typeAdaptor[type], onInputChange: _this.handleInputChange, placeholder: (_a = _this.props.placeholder) !== null && _a !== void 0 ? _a : locale.select.selectPlaceholder, onBlur: _this.handleBlur }), void 0));
348
+ } }, void 0)); } }, void 0));
252
349
  };
253
350
  BaseSelect.defaultProps = defaultProps;
254
351
  return BaseSelect;
@@ -3,5 +3,8 @@ export declare const STATE_CHANGE_TYPE: {
3
3
  readonly remove: "remove";
4
4
  readonly clear: "clear";
5
5
  readonly selectAll: "selectAll";
6
+ readonly inputChange: "inputChange";
6
7
  };
7
8
  export declare const UNGROUPED_ID = "__ungrouped";
9
+ export declare const LOADING_KEY = "__loading";
10
+ export declare const CLEARABLE_KEY = "clearable";
@@ -1,4 +1,6 @@
1
1
  import { __assign } from "tslib";
2
2
  import { STATE_CHANGE_TYPE as BASE_STATE_CHANGE_TYPE } from 'baseui/select';
3
- export var STATE_CHANGE_TYPE = __assign({ selectAll: 'selectAll' }, BASE_STATE_CHANGE_TYPE);
3
+ export var STATE_CHANGE_TYPE = __assign({ selectAll: 'selectAll', inputChange: 'inputChange' }, BASE_STATE_CHANGE_TYPE);
4
4
  export var UNGROUPED_ID = '__ungrouped';
5
+ export var LOADING_KEY = '__loading';
6
+ export var CLEARABLE_KEY = 'clearable';
@@ -1,4 +1,4 @@
1
- import { OptionsT, Value, Size, Type } from './types';
1
+ import { Options, Value, Type } from './types';
2
2
  declare const defaultProps: {
3
3
  autoFocus: boolean;
4
4
  backspaceRemoves: boolean;
@@ -10,7 +10,10 @@ declare const defaultProps: {
10
10
  error: boolean;
11
11
  positive: boolean;
12
12
  escapeClearsValue: boolean;
13
- filterOptions: any;
13
+ filterOptions: ((options: Value, filterValue: string, excludeOptions: Value | null | undefined, a: {
14
+ valueKey: string;
15
+ labelKey: string;
16
+ }) => Value) | null | undefined;
14
17
  filterOutSelected: boolean;
15
18
  isLoading: boolean;
16
19
  labelKey: string;
@@ -25,14 +28,15 @@ declare const defaultProps: {
25
28
  onSelectResetsInput: boolean;
26
29
  openOnClick: boolean;
27
30
  startOpen: boolean;
28
- options: OptionsT;
31
+ options: Options;
29
32
  overrides: {};
30
33
  required: boolean;
31
34
  searchable: boolean;
32
- size: Size;
33
35
  type: "overlay" | Type | "mobile";
34
36
  value: Value;
35
37
  valueKey: string;
36
- placement: "auto" | "bottom" | "left" | "right" | "top" | "topLeft" | "topRight" | "rightTop" | "rightBottom" | "bottomLeft" | "bottomRight" | "leftTop" | "leftBottom" | undefined;
38
+ placement: "auto" | "bottom" | "left" | "right" | "top" | "topLeft" | "topRight" | "rightTop" | "rightBottom" | "bottomRight" | "bottomLeft" | "leftBottom" | "leftTop" | undefined;
39
+ virtual: boolean;
40
+ popoverMinWidth: string;
37
41
  };
38
42
  export default defaultProps;
@@ -1,5 +1,6 @@
1
1
  import _noop from 'lodash/noop';
2
2
  import { filterOptions } from './utils/default-filter-options';
3
+ import { LIST_MIN_WIDTH } from '../list';
3
4
  var defaultProps = {
4
5
  autoFocus: false,
5
6
  backspaceRemoves: true,
@@ -30,10 +31,12 @@ var defaultProps = {
30
31
  overrides: {},
31
32
  required: false,
32
33
  searchable: true,
33
- size: 'lg',
34
34
  type: 'select',
35
35
  value: [],
36
36
  valueKey: 'id',
37
37
  placement: 'bottom',
38
+ virtual: true,
39
+ // popoverMinWidth should have min-width same as the list minWidth
40
+ popoverMinWidth: "".concat(LIST_MIN_WIDTH, "px"),
38
41
  };
39
42
  export default defaultProps;
@@ -1,8 +1,8 @@
1
- export type { Option, Value, OptionsT, StateReducer, OnChangeParams, SelectProps, AutosizeInputProps, DropdownProps, StatefulSelectProps, StatefulContainerProps, SelectActions, SelectState, AutosizeInputState, StatefulContainerState, } from './types';
2
- export { SELECT_ALL_ID } from './types';
1
+ export type { Option, Value, Options, Optgroups, StateReducer, OnChangeParams, ControlRef, ImperativeMethods, SelectProps, AutosizeInputProps, DropdownProps, StatefulSelectProps, StatefulContainerProps, SelectActions, SelectState, AutosizeInputState, StatefulContainerState, } from './types';
2
+ export { SELECT_ALL_ID, CLEAR_OPTION_ID } from './types';
3
3
  export type { SelectLocale } from './locale';
4
- export { STATE_CHANGE_TYPE } from './constants';
5
- export { StyledRoot, StyledClearIcon, StyledControlContainer, StyledDropdownContainer, StyledIconsContainer, StyledInput, StyledInputContainer, StyledInputSizer, StyledPlaceholder, StyledSearchIcon, StyledSearchIconContainer, StyledSelectArrow, StyledSingleValue, StyledValueContainer, NoResults, StyledOverlayContentContainer, } from './styled-component';
4
+ export { STATE_CHANGE_TYPE, LOADING_KEY, CLEARABLE_KEY } from './constants';
5
+ export { StyledRoot, StyledClearIcon, StyledControlContainer, StyledDropdownContainer, StyledIconsContainer, StyledInput, StyledInputContainer, StyledInputSizer, StyledPlaceholder, StyledSearchIconContainer, StyledSelectArrow, StyledSingleValue, StyledValueContainer, NoResults, StyledOverlayContentContainer, } from './styled-component';
6
6
  export type { StyledSelect } from './styled-component';
7
7
  export { default as Select } from './select';
8
8
  export { default as StatefulSelect } from './stateful-select';
@@ -1,7 +1,7 @@
1
- export { SELECT_ALL_ID } from './types';
2
- export { STATE_CHANGE_TYPE } from './constants';
1
+ export { SELECT_ALL_ID, CLEAR_OPTION_ID } from './types';
2
+ export { STATE_CHANGE_TYPE, LOADING_KEY, CLEARABLE_KEY } from './constants';
3
3
  // styled-components
4
- export { StyledRoot, StyledClearIcon, StyledControlContainer, StyledDropdownContainer, StyledIconsContainer, StyledInput, StyledInputContainer, StyledInputSizer, StyledPlaceholder, StyledSearchIcon, StyledSearchIconContainer, StyledSelectArrow, StyledSingleValue, StyledValueContainer, NoResults, StyledOverlayContentContainer, } from './styled-component';
4
+ export { StyledRoot, StyledClearIcon, StyledControlContainer, StyledDropdownContainer, StyledIconsContainer, StyledInput, StyledInputContainer, StyledInputSizer, StyledPlaceholder, StyledSearchIconContainer, StyledSelectArrow, StyledSingleValue, StyledValueContainer, NoResults, StyledOverlayContentContainer, } from './styled-component';
5
5
  // components
6
6
  export { default as Select } from './select';
7
7
  export { default as StatefulSelect } from './stateful-select';
@@ -1,4 +1,8 @@
1
1
  export declare type SelectLocale = {
2
2
  noResultsMsg: string;
3
3
  selectAllLabel: string;
4
+ hideButtonAriaLabel: string;
5
+ selectPlaceholder: string;
6
+ clearOptionLabel: string;
7
+ selectedValuesPrefix: string;
4
8
  };
@@ -9,12 +9,10 @@ import { usePauseBodyScrollEffect } from './hooks/usePauseBodyScrollEffect';
9
9
  export var MobileSelect = React.memo(function (props) {
10
10
  var overrides = props.overrides, children = props.children, label = props.label;
11
11
  var _a = __read(React.useState(null), 2), scrollContainer = _a[0], setScrollContainer = _a[1];
12
- var mergedOverrides = React.useMemo(function () { return mergeOverrides(overrides !== null && overrides !== void 0 ? overrides : {}, getOverlayOverrides({ overlayContainerRef: setScrollContainer, label: label })); }, [overrides]);
13
- var childSelectOverrides = React.useMemo(function () { return mergeOverrides(overrides !== null && overrides !== void 0 ? overrides : {}, CHILD_SELECT_OVERRIDES); }, [
14
- overrides,
15
- ]);
12
+ var mergedOverrides = React.useMemo(function () { return mergeOverrides(overrides !== null && overrides !== void 0 ? overrides : {}, getOverlayOverrides({ overlayContainerRef: setScrollContainer, label: label })); }, [overrides, label]);
13
+ var childSelectOverrides = React.useMemo(function () { return mergeOverrides(overrides !== null && overrides !== void 0 ? overrides : {}, CHILD_SELECT_OVERRIDES); }, [overrides]);
16
14
  var overlaySelectProps = _omit(props, OVERLAY_SELECT_PROPS_TO_OMIT);
17
15
  var viewSelectProps = _omit(props, CHILD_SELECT_PROPS_TO_OMIT);
18
16
  usePauseBodyScrollEffect({ currentEl: scrollContainer || undefined });
19
- return (_jsx(Select, __assign({ overlayWidth: "100%", maxDropdownHeight: "100%", autoFocus: true }, overlaySelectProps, { overrides: mergedOverrides, type: "overlay" }, { children: React.isValidElement(children) ? (children) : (_jsx(Select, __assign({}, viewSelectProps, { overrides: childSelectOverrides, type: "select" }), void 0)) }), void 0));
17
+ return (_jsx(Select, __assign({ overlayWidth: "100%", maxDropdownHeight: "100%", autoFocus: true }, overlaySelectProps, { overrides: mergedOverrides, type: "overlay", filterOptions: overlaySelectProps.filterOptions }, { children: React.isValidElement(children) ? (children) : (_jsx(Select, __assign({}, viewSelectProps, { filterOptions: viewSelectProps.filterOptions, overrides: childSelectOverrides, type: "select" }), void 0)) }), void 0));
20
18
  });
@@ -17,6 +17,7 @@ import { useKeyboardViewportShiftOffset } from './hooks/useKeyboardViewportShift
17
17
  import { useOverrides } from '../../overrides';
18
18
  import { styled } from '../../style';
19
19
  import { TRANSITION_TYPES } from './AdaptedCSSTransition/constants';
20
+ import { useLocale } from '../../locale';
20
21
  var StyledSheetContainer = styled('div', 'spr-ui-01 fixed bottom-0 w-full z-50 flex flex-col', function (_a) {
21
22
  var px2rem = _a.px2rem;
22
23
  return ({
@@ -42,6 +43,7 @@ export var MobileSheet = function (_a) {
42
43
  var _e = __read(useOverrides(overrides === null || overrides === void 0 ? void 0 : overrides.Label, StyledLabel), 2), Label = _e[0], labelProps = _e[1];
43
44
  var _f = __read(useOverrides(overrides === null || overrides === void 0 ? void 0 : overrides.Layer, DefaultLayer), 2), Layer = _f[0], layerProps = _f[1];
44
45
  var _g = __read(useOverrides(overrides === null || overrides === void 0 ? void 0 : overrides.Backdrop, Backdrop), 2), BackdropComp = _g[0], backdropProps = _g[1];
45
- return (_jsx(LayersManager, __assign({ zIndex: Z_INDEX.OVERLAY }, { children: _jsx(Layer, __assign({}, layerProps, { children: _jsxs(Box, __assign({ id: "".concat(sheetKey, "-container"), "data-testid": "sheetContainer", role: "contentinfo" }, { children: [_jsx(BackdropComp, __assign({ show: visible, onHide: onHide, backdropKey: sheetKey }, backdropProps), void 0), _jsx(AdaptedCSSTransition, __assign({ show: visible, transitionType: TRANSITION_TYPES.SLIDE_FROM_BOTTOM }, { children: _jsxs(SheetContainer, __assign({ "data-testid": "".concat(sheetKey, "-sheetContainer") }, sheetContainerProps, { className: [{ bottom: offsetBottom }, sheetStyles, sheetContainerProps.className], ref: combinedRef }, { children: [label && (_jsxs(Label, __assign({}, labelProps, { children: [_jsx(IconButton, __assign({ onClick: onHide }, { children: _jsx(ChevronDown, { size: 12, className: { transform: 'rotate(90deg)' } }, void 0) }), void 0), _jsx(Typography, __assign({ variant: "h4" }, { children: label }), void 0)] }), void 0)), _jsx(SwipeableTargetArea, { onSwipeStart: onSwipeStart, onSwipe: onSwipe, onSwipeEnd: onSwipeEnd }, void 0), children] }), void 0) }), void 0)] }), void 0) }), void 0) }), void 0));
46
+ var locale = useLocale();
47
+ return (_jsx(LayersManager, __assign({ zIndex: Z_INDEX.OVERLAY }, { children: _jsx(Layer, __assign({}, layerProps, { children: _jsxs(Box, __assign({ id: "".concat(sheetKey, "-container"), "data-testid": "sheetContainer", role: "contentinfo" }, { children: [_jsx(BackdropComp, __assign({ show: visible, onHide: onHide, backdropKey: sheetKey }, backdropProps), void 0), _jsx(AdaptedCSSTransition, __assign({ show: visible, transitionType: TRANSITION_TYPES.SLIDE_FROM_BOTTOM }, { children: _jsxs(SheetContainer, __assign({ "data-testid": "".concat(sheetKey, "-sheetContainer") }, sheetContainerProps, { className: [{ bottom: offsetBottom }, sheetStyles, sheetContainerProps.className], ref: combinedRef }, { children: [label && (_jsxs(Label, __assign({}, labelProps, { children: [_jsx(IconButton, __assign({ onClick: onHide, "aria-label": locale.select.hideButtonAriaLabel }, { children: _jsx(ChevronDown, { size: 12, className: { transform: 'rotate(90deg)' } }, void 0) }), void 0), _jsx(Typography, __assign({ variant: "h4" }, { children: label }), void 0)] }), void 0)), _jsx(SwipeableTargetArea, { onSwipeStart: onSwipeStart, onSwipe: onSwipe, onSwipeEnd: onSwipeEnd }, void 0), children] }), void 0) }), void 0)] }), void 0) }), void 0) }), void 0));
46
48
  };
47
49
  MobileSheet.displayName = 'MobileSheet';
@@ -1,26 +1,36 @@
1
1
  import { __assign, __read, __rest } from "tslib";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { useMemo } from 'react';
4
- import { borderRadius } from '../helpers/longHandHelpers';
5
- import { getComponentSizeTheme } from '../helpers/themeHelpers';
4
+ import { getComponentSizeTheme, getDefaultSize } from '../helpers/themeHelpers';
6
5
  import { mergeOverrides, useOverrides } from '../overrides';
7
6
  import { useStyle } from '../style';
8
7
  import { Tag } from '../tag';
8
+ import { StyledTombstone } from '../helpers/StyledTombstone';
9
+ import { CLEARABLE_KEY, LOADING_KEY } from './constants';
9
10
  export default function MultiValue(props) {
10
- var _a;
11
- var _b = props.overrides, overrides = _b === void 0 ? {} : _b, onActionClick = props.onActionClick, value = props.value, selectSize = props.selectSize, $disabled = props.$disabled, restProps = __rest(props, ["overrides", "onActionClick", "value", "selectSize", "$disabled"]);
12
- var _c = __read(useOverrides(overrides.Tag, Tag), 2), TagComponent = _c[0], tagProps = _c[1];
11
+ var _a, _b;
12
+ var _c = props.overrides, overrides = _c === void 0 ? {} : _c, onActionClick = props.onActionClick, value = props.value, selectSize = props.selectSize, $disabled = props.$disabled, $valueByIdMap = props.$valueByIdMap, $valueKey = props.$valueKey, $size = props.$size, $isContainerFocused = props.$isContainerFocused, restProps = __rest(props, ["overrides", "onActionClick", "value", "selectSize", "$disabled", "$valueByIdMap", "$valueKey", "$size", "$isContainerFocused"]);
13
+ var _d = __read(useOverrides(overrides.Tag, Tag), 2), TagComponent = _d[0], tagProps = _d[1];
13
14
  var theme = useStyle().theme;
14
- var multiSelectTheme = useMemo(function () { return getComponentSizeTheme(theme, 'multiSelect', selectSize, 'lg'); }, [
15
- selectSize,
16
- theme,
17
- ]);
18
- return (_jsx(TagComponent, __assign({ variant: "light", intent: "default", "aria-label": "".concat(typeof restProps.children === 'string' ? "".concat(restProps.children, ", ") : '', "close by backspace"), tabIndex: 0, onActionClick: onActionClick, "$item": value, "$disabled": $disabled }, restProps, tagProps, { closeable: (_a = tagProps.closeable) !== null && _a !== void 0 ? _a : !$disabled, overrides: mergeOverrides({
15
+ var multiSelectTheme = useMemo(function () { return getComponentSizeTheme(theme, 'multiSelect', selectSize, getDefaultSize(theme)); }, [selectSize, theme]);
16
+ var selectedValue = $valueByIdMap === null || $valueByIdMap === void 0 ? void 0 : $valueByIdMap[value[$valueKey]];
17
+ var disabled = $disabled || (selectedValue === null || selectedValue === void 0 ? void 0 : selectedValue[CLEARABLE_KEY]) === false;
18
+ var isLoading = (_a = value === null || value === void 0 ? void 0 : value[LOADING_KEY]) !== null && _a !== void 0 ? _a : selectedValue === null || selectedValue === void 0 ? void 0 : selectedValue[LOADING_KEY];
19
+ var tagMarginX = multiSelectTheme === null || multiSelectTheme === void 0 ? void 0 : multiSelectTheme.tagMarginX;
20
+ var tagMarginY = multiSelectTheme === null || multiSelectTheme === void 0 ? void 0 : multiSelectTheme.tagMarginY;
21
+ var tagSize = selectSize === 'xxxs' ? 'xxxs' : 'sm';
22
+ return (_jsx(TagComponent, __assign({ variant: "light", intent: "default", "aria-label": "".concat(typeof restProps.children === 'string' ? "".concat(restProps.children, ", ") : '', "close by backspace"), tabIndex: $isContainerFocused ? 0 : -1, onActionClick: onActionClick, "$item": value, "$disabled": disabled, size: tagSize }, restProps, tagProps, { closeable: (_b = tagProps.closeable) !== null && _b !== void 0 ? _b : !disabled, overrides: mergeOverrides({
19
23
  Root: {
20
24
  style: [
21
25
  'box-border',
22
- __assign(__assign({}, (theme.multiSelect.tagBorderRadius && borderRadius(theme.multiSelect.tagBorderRadius))), { marginRight: multiSelectTheme.tagMarginX, marginLeft: multiSelectTheme.tagMarginX, marginTop: multiSelectTheme.tagMarginY, marginBottom: multiSelectTheme.tagMarginY, height: multiSelectTheme.tagHeight, maxWidth: "calc(100% - ".concat(2 * parseInt(multiSelectTheme.tagMarginX, 10), "px)") }),
26
+ {
27
+ marginRight: tagMarginX,
28
+ marginBottom: tagMarginY,
29
+ marginTop: tagMarginY,
30
+ maxWidth: "calc(100% - ".concat(2 * parseInt(multiSelectTheme.tagMarginX, 10), "px)"),
31
+ },
23
32
  ],
24
33
  },
25
- }, tagProps.overrides) }, { children: props.children }), void 0));
34
+ Action: { props: { tabIndex: $isContainerFocused ? 0 : -1 } },
35
+ }, tagProps.overrides) }, { children: isLoading ? (_jsx(StyledTombstone, { "data-testid": "multi-value-tombstone", className: "w-20 h-4 rounded-8" }, void 0)) : (props.children) }), void 0));
26
36
  }