@procore/core-react 11.22.1 → 11.23.1

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 (990) hide show
  1. package/babel.config.js +32 -15
  2. package/dist/@types/files.d.js +2 -0
  3. package/dist/@types/files.d.js.map +1 -0
  4. package/dist/@types/global.d.js +2 -0
  5. package/dist/@types/global.d.js.map +1 -0
  6. package/dist/Avatar/Avatar.js +91 -80
  7. package/dist/Avatar/Avatar.js.map +1 -1
  8. package/dist/Avatar/Avatar.styles.js +57 -29
  9. package/dist/Avatar/Avatar.styles.js.map +1 -1
  10. package/dist/Avatar/Avatar.types.js.map +1 -1
  11. package/dist/Avatar/index.js +1 -0
  12. package/dist/Avatar/index.js.map +1 -1
  13. package/dist/AvatarStack/AvatarStack.constants.js.map +1 -1
  14. package/dist/AvatarStack/AvatarStack.js +306 -171
  15. package/dist/AvatarStack/AvatarStack.js.map +1 -1
  16. package/dist/AvatarStack/AvatarStack.styles.js +30 -12
  17. package/dist/AvatarStack/AvatarStack.styles.js.map +1 -1
  18. package/dist/AvatarStack/AvatarStack.types.js.map +1 -1
  19. package/dist/AvatarStack/index.js +1 -0
  20. package/dist/AvatarStack/index.js.map +1 -1
  21. package/dist/Badge/Badge.js +10 -16
  22. package/dist/Badge/Badge.js.map +1 -1
  23. package/dist/Badge/Badge.styles.js +8 -7
  24. package/dist/Badge/Badge.styles.js.map +1 -1
  25. package/dist/Badge/Badge.types.js.map +1 -1
  26. package/dist/Badge/index.js +1 -0
  27. package/dist/Badge/index.js.map +1 -1
  28. package/dist/Banner/Banner.js +211 -110
  29. package/dist/Banner/Banner.js.map +1 -1
  30. package/dist/Banner/Banner.styles.js +85 -56
  31. package/dist/Banner/Banner.styles.js.map +1 -1
  32. package/dist/Banner/Banner.types.js.map +1 -1
  33. package/dist/Banner/index.js +2 -1
  34. package/dist/Banner/index.js.map +1 -1
  35. package/dist/Box/Box.js +85 -55
  36. package/dist/Box/Box.js.map +1 -1
  37. package/dist/Box/Box.styles.js +22 -24
  38. package/dist/Box/Box.styles.js.map +1 -1
  39. package/dist/Box/Box.types.js.map +1 -1
  40. package/dist/Box/index.js +1 -0
  41. package/dist/Box/index.js.map +1 -1
  42. package/dist/Breadcrumbs/Breadcrumbs.js +67 -65
  43. package/dist/Breadcrumbs/Breadcrumbs.js.map +1 -1
  44. package/dist/Breadcrumbs/Breadcrumbs.styles.js +28 -21
  45. package/dist/Breadcrumbs/Breadcrumbs.styles.js.map +1 -1
  46. package/dist/Breadcrumbs/Breadcrumbs.types.js +5 -5
  47. package/dist/Breadcrumbs/Breadcrumbs.types.js.map +1 -1
  48. package/dist/Breadcrumbs/index.js +1 -0
  49. package/dist/Breadcrumbs/index.js.map +1 -1
  50. package/dist/Button/Button.js +105 -63
  51. package/dist/Button/Button.js.map +1 -1
  52. package/dist/Button/Button.styles.js +95 -81
  53. package/dist/Button/Button.styles.js.map +1 -1
  54. package/dist/Button/Button.types.js.map +1 -1
  55. package/dist/Button/index.js.map +1 -1
  56. package/dist/Calendar/Calendar.js +244 -125
  57. package/dist/Calendar/Calendar.js.map +1 -1
  58. package/dist/Calendar/Calendar.styles.js +52 -24
  59. package/dist/Calendar/Calendar.styles.js.map +1 -1
  60. package/dist/Calendar/Calendar.types.js.map +1 -1
  61. package/dist/Calendar/index.js +1 -0
  62. package/dist/Calendar/index.js.map +1 -1
  63. package/dist/Card/Card.js +22 -30
  64. package/dist/Card/Card.js.map +1 -1
  65. package/dist/Card/Card.styles.js +12 -12
  66. package/dist/Card/Card.styles.js.map +1 -1
  67. package/dist/Card/Card.types.js.map +1 -1
  68. package/dist/Card/index.js +1 -0
  69. package/dist/Card/index.js.map +1 -1
  70. package/dist/Changelog.mdx +6 -0
  71. package/dist/Checkbox/Checkbox.js +56 -33
  72. package/dist/Checkbox/Checkbox.js.map +1 -1
  73. package/dist/Checkbox/Checkbox.styles.js +103 -87
  74. package/dist/Checkbox/Checkbox.styles.js.map +1 -1
  75. package/dist/Checkbox/Checkbox.types.js.map +1 -1
  76. package/dist/Checkbox/index.js +1 -0
  77. package/dist/Checkbox/index.js.map +1 -1
  78. package/dist/CheckboxGroup/CheckboxGroup.js +24 -31
  79. package/dist/CheckboxGroup/CheckboxGroup.js.map +1 -1
  80. package/dist/CheckboxGroup/CheckboxGroup.types.js.map +1 -1
  81. package/dist/CheckboxGroup/index.js +1 -0
  82. package/dist/CheckboxGroup/index.js.map +1 -1
  83. package/dist/ClickOutside/ClickOutside.js +38 -38
  84. package/dist/ClickOutside/ClickOutside.js.map +1 -1
  85. package/dist/ClickOutside/index.js.map +1 -1
  86. package/dist/ContactItem/ContactItem.js +56 -45
  87. package/dist/ContactItem/ContactItem.js.map +1 -1
  88. package/dist/ContactItem/ContactItem.styles.js +31 -21
  89. package/dist/ContactItem/ContactItem.styles.js.map +1 -1
  90. package/dist/ContactItem/ContactItem.types.js.map +1 -1
  91. package/dist/ContactItem/index.js +1 -0
  92. package/dist/ContactItem/index.js.map +1 -1
  93. package/dist/Content/Content.js +2 -13
  94. package/dist/Content/Content.js.map +1 -1
  95. package/dist/Content/Content.styles.js +9 -8
  96. package/dist/Content/Content.styles.js.map +1 -1
  97. package/dist/Content/index.js.map +1 -1
  98. package/dist/DateInput/DateInput.js +453 -347
  99. package/dist/DateInput/DateInput.js.map +1 -1
  100. package/dist/DateInput/DateInput.styles.js +42 -27
  101. package/dist/DateInput/DateInput.styles.js.map +1 -1
  102. package/dist/DateInput/DateInput.types.js.map +1 -1
  103. package/dist/DateInput/index.js +1 -1
  104. package/dist/DateInput/index.js.map +1 -1
  105. package/dist/DateSelect/DateSelect.js +148 -107
  106. package/dist/DateSelect/DateSelect.js.map +1 -1
  107. package/dist/DateSelect/DateSelect.types.js.map +1 -1
  108. package/dist/DateSelect/index.js +1 -0
  109. package/dist/DateSelect/index.js.map +1 -1
  110. package/dist/DetailPage/DetailPage.constants.js +42 -42
  111. package/dist/DetailPage/DetailPage.constants.js.map +1 -1
  112. package/dist/DetailPage/DetailPage.js +66 -62
  113. package/dist/DetailPage/DetailPage.js.map +1 -1
  114. package/dist/DetailPage/DetailPage.styles.js +30 -14
  115. package/dist/DetailPage/DetailPage.styles.js.map +1 -1
  116. package/dist/DetailPage/DetailPage.types.js.map +1 -1
  117. package/dist/DetailPage/RankedHeading.js +8 -8
  118. package/dist/DetailPage/RankedHeading.js.map +1 -1
  119. package/dist/DetailPage/index.js +1 -0
  120. package/dist/DetailPage/index.js.map +1 -1
  121. package/dist/Dropdown/Dropdown.js +193 -99
  122. package/dist/Dropdown/Dropdown.js.map +1 -1
  123. package/dist/Dropdown/Dropdown.styles.js +21 -15
  124. package/dist/Dropdown/Dropdown.styles.js.map +1 -1
  125. package/dist/Dropdown/Dropdown.types.js.map +1 -1
  126. package/dist/Dropdown/index.js +1 -0
  127. package/dist/Dropdown/index.js.map +1 -1
  128. package/dist/DropdownFlyout/DropdownFlyout.helpers.js +277 -239
  129. package/dist/DropdownFlyout/DropdownFlyout.helpers.js.map +1 -1
  130. package/dist/DropdownFlyout/DropdownFlyout.js +234 -132
  131. package/dist/DropdownFlyout/DropdownFlyout.js.map +1 -1
  132. package/dist/DropdownFlyout/DropdownFlyout.styles.js +16 -9
  133. package/dist/DropdownFlyout/DropdownFlyout.styles.js.map +1 -1
  134. package/dist/DropdownFlyout/DropdownFlyout.types.js.map +1 -1
  135. package/dist/DropdownFlyout/index.js +1 -1
  136. package/dist/DropdownFlyout/index.js.map +1 -1
  137. package/dist/DropdownFlyout/useDropdownFlyoutOverlay.js +10 -11
  138. package/dist/DropdownFlyout/useDropdownFlyoutOverlay.js.map +1 -1
  139. package/dist/Dropzone/Dropzone.hooks.js +257 -211
  140. package/dist/Dropzone/Dropzone.hooks.js.map +1 -1
  141. package/dist/Dropzone/Dropzone.js +209 -156
  142. package/dist/Dropzone/Dropzone.js.map +1 -1
  143. package/dist/Dropzone/Dropzone.styles.js +54 -31
  144. package/dist/Dropzone/Dropzone.styles.js.map +1 -1
  145. package/dist/Dropzone/Dropzone.types.js +19 -11
  146. package/dist/Dropzone/Dropzone.types.js.map +1 -1
  147. package/dist/Dropzone/index.js +1 -0
  148. package/dist/Dropzone/index.js.map +1 -1
  149. package/dist/EmptyState/EmptyState.js +274 -116
  150. package/dist/EmptyState/EmptyState.js.map +1 -1
  151. package/dist/EmptyState/EmptyState.styles.js +33 -19
  152. package/dist/EmptyState/EmptyState.styles.js.map +1 -1
  153. package/dist/EmptyState/EmptyState.types.js.map +1 -1
  154. package/dist/EmptyState/index.js +1 -0
  155. package/dist/EmptyState/index.js.map +1 -1
  156. package/dist/Field/Field.js +26 -33
  157. package/dist/Field/Field.js.map +1 -1
  158. package/dist/Field/Field.styles.js +12 -8
  159. package/dist/Field/Field.styles.js.map +1 -1
  160. package/dist/Field/index.js.map +1 -1
  161. package/dist/FileList/FileList.js +83 -55
  162. package/dist/FileList/FileList.js.map +1 -1
  163. package/dist/FileList/FileList.styles.js +16 -9
  164. package/dist/FileList/FileList.styles.js.map +1 -1
  165. package/dist/FileList/FileList.types.js.map +1 -1
  166. package/dist/FileList/index.js +1 -0
  167. package/dist/FileList/index.js.map +1 -1
  168. package/dist/FileSelect/FileExplorer/FileExplorer.d.ts +2 -1
  169. package/dist/FileSelect/FileExplorer/FileExplorer.js +69 -65
  170. package/dist/FileSelect/FileExplorer/FileExplorer.js.map +1 -1
  171. package/dist/FileSelect/FileExplorer/FileExplorer.styles.js +37 -16
  172. package/dist/FileSelect/FileExplorer/FileExplorer.styles.js.map +1 -1
  173. package/dist/FileSelect/FileExplorer/FileExplorer.types.js.map +1 -1
  174. package/dist/FileSelect/FileExplorer/FileExplorerModal.d.ts +2 -1
  175. package/dist/FileSelect/FileExplorer/FileExplorerModal.js +25 -31
  176. package/dist/FileSelect/FileExplorer/FileExplorerModal.js.map +1 -1
  177. package/dist/FileSelect/FileExplorer/FileExplorerSidebar.js +92 -63
  178. package/dist/FileSelect/FileExplorer/FileExplorerSidebar.js.map +1 -1
  179. package/dist/FileSelect/FileExplorer/FileExplorerSidebar.styles.js +12 -8
  180. package/dist/FileSelect/FileExplorer/FileExplorerSidebar.styles.js.map +1 -1
  181. package/dist/FileSelect/FileExplorer/useSidebarNavigation.js +40 -51
  182. package/dist/FileSelect/FileExplorer/useSidebarNavigation.js.map +1 -1
  183. package/dist/FileSelect/FileSelect.d.ts +2 -1
  184. package/dist/FileSelect/FileSelect.js +466 -324
  185. package/dist/FileSelect/FileSelect.js.map +1 -1
  186. package/dist/FileSelect/FileSelect.styles.js +8 -7
  187. package/dist/FileSelect/FileSelect.styles.js.map +1 -1
  188. package/dist/FileSelect/FileSelect.types.js.map +1 -1
  189. package/dist/FileSelect/FileSelectDropzone/FileSelectDropzone.js +93 -47
  190. package/dist/FileSelect/FileSelectDropzone/FileSelectDropzone.js.map +1 -1
  191. package/dist/FileSelect/FileSelectDropzone/FileSelectDropzone.styles.js +16 -14
  192. package/dist/FileSelect/FileSelectDropzone/FileSelectDropzone.styles.js.map +1 -1
  193. package/dist/FileSelect/FileSelectDropzone/FileSelectDropzone.types.js.map +1 -1
  194. package/dist/FileSelect/FileSelectDropzone/index.js +1 -0
  195. package/dist/FileSelect/FileSelectDropzone/index.js.map +1 -1
  196. package/dist/FileSelect/FileTokenList/FileToken.types.js.map +1 -1
  197. package/dist/FileSelect/FileTokenList/FileTokenList.js +112 -90
  198. package/dist/FileSelect/FileTokenList/FileTokenList.js.map +1 -1
  199. package/dist/FileSelect/FileTokenList/FileTokenList.styles.js +8 -7
  200. package/dist/FileSelect/FileTokenList/FileTokenList.styles.js.map +1 -1
  201. package/dist/FileSelect/FileTokenList/index.js.map +1 -1
  202. package/dist/FileSelect/GridSource/GridSource.js +269 -222
  203. package/dist/FileSelect/GridSource/GridSource.js.map +1 -1
  204. package/dist/FileSelect/GridSource/GridSource.styles.js +32 -19
  205. package/dist/FileSelect/GridSource/GridSource.styles.js.map +1 -1
  206. package/dist/FileSelect/GridSource/GridSource.types.js.map +1 -1
  207. package/dist/FileSelect/GridSource/index.js +1 -0
  208. package/dist/FileSelect/GridSource/index.js.map +1 -1
  209. package/dist/FileSelect/LocalSource/LocalSource.js +401 -314
  210. package/dist/FileSelect/LocalSource/LocalSource.js.map +1 -1
  211. package/dist/FileSelect/LocalSource/LocalSource.styles.js +18 -11
  212. package/dist/FileSelect/LocalSource/LocalSource.styles.js.map +1 -1
  213. package/dist/FileSelect/LocalSource/LocalSource.types.js.map +1 -1
  214. package/dist/FileSelect/LocalSource/index.js +1 -0
  215. package/dist/FileSelect/LocalSource/index.js.map +1 -1
  216. package/dist/FileSelect/ProgressAnnouncer/ProgressAnnouncer.js +91 -69
  217. package/dist/FileSelect/ProgressAnnouncer/ProgressAnnouncer.js.map +1 -1
  218. package/dist/FileSelect/ProgressAnnouncer/ProgressAnnouncer.types.js.map +1 -1
  219. package/dist/FileSelect/ProgressAnnouncer/index.js.map +1 -1
  220. package/dist/FileSelect/SourceItem/SourceItem.js +66 -54
  221. package/dist/FileSelect/SourceItem/SourceItem.js.map +1 -1
  222. package/dist/FileSelect/SourceItem/SourceItem.styles.js +29 -24
  223. package/dist/FileSelect/SourceItem/SourceItem.styles.js.map +1 -1
  224. package/dist/FileSelect/SourceItem/SourceItem.test.js +53 -0
  225. package/dist/FileSelect/ThumbnailList/ThumbnailList.js +175 -110
  226. package/dist/FileSelect/ThumbnailList/ThumbnailList.js.map +1 -1
  227. package/dist/FileSelect/ThumbnailList/ThumbnailList.styles.js +33 -23
  228. package/dist/FileSelect/ThumbnailList/ThumbnailList.styles.js.map +1 -1
  229. package/dist/FileSelect/ThumbnailList/ThumbnailList.types.js.map +1 -1
  230. package/dist/FileSelect/ThumbnailList/index.js.map +1 -1
  231. package/dist/FileSelect/TreeSource/TreeSource.js +173 -135
  232. package/dist/FileSelect/TreeSource/TreeSource.js.map +1 -1
  233. package/dist/FileSelect/TreeSource/TreeSource.styles.js +4 -6
  234. package/dist/FileSelect/TreeSource/TreeSource.styles.js.map +1 -1
  235. package/dist/FileSelect/TreeSource/TreeSource.types.js.map +1 -1
  236. package/dist/FileSelect/TreeSource/index.js +1 -0
  237. package/dist/FileSelect/TreeSource/index.js.map +1 -1
  238. package/dist/FileSelect/index.js +3 -1
  239. package/dist/FileSelect/index.js.map +1 -1
  240. package/dist/FileSelect/storyHelpers.js +301 -231
  241. package/dist/FileSelect/storyHelpers.js.map +1 -1
  242. package/dist/FileToken/FileToken.js +103 -80
  243. package/dist/FileToken/FileToken.js.map +1 -1
  244. package/dist/FileToken/FileToken.styles.js +29 -21
  245. package/dist/FileToken/FileToken.styles.js.map +1 -1
  246. package/dist/FileToken/FileToken.types.js.map +1 -1
  247. package/dist/FileToken/index.js.map +1 -1
  248. package/dist/FilterToken/FilterToken.js +44 -34
  249. package/dist/FilterToken/FilterToken.js.map +1 -1
  250. package/dist/FilterToken/FilterToken.styles.js +12 -10
  251. package/dist/FilterToken/FilterToken.styles.js.map +1 -1
  252. package/dist/FilterToken/FilterToken.types.js.map +1 -1
  253. package/dist/FilterToken/index.js.map +1 -1
  254. package/dist/Flex/Flex.js +33 -25
  255. package/dist/Flex/Flex.js.map +1 -1
  256. package/dist/Flex/Flex.types.js.map +1 -1
  257. package/dist/Flex/index.js +1 -0
  258. package/dist/Flex/index.js.map +1 -1
  259. package/dist/FlexList/FlexList.js +52 -47
  260. package/dist/FlexList/FlexList.js.map +1 -1
  261. package/dist/FlexList/FlexList.styles.js +9 -11
  262. package/dist/FlexList/FlexList.styles.js.map +1 -1
  263. package/dist/FlexList/FlexList.types.js.map +1 -1
  264. package/dist/FlexList/index.js +1 -0
  265. package/dist/FlexList/index.js.map +1 -1
  266. package/dist/Form/Form.js +1348 -711
  267. package/dist/Form/Form.js.map +1 -1
  268. package/dist/Form/Form.styles.js +92 -43
  269. package/dist/Form/Form.styles.js.map +1 -1
  270. package/dist/Form/Form.types.js.map +1 -1
  271. package/dist/Form/closeWithConfirm.js +38 -31
  272. package/dist/Form/closeWithConfirm.js.map +1 -1
  273. package/dist/Form/index.js +2 -1
  274. package/dist/Form/index.js.map +1 -1
  275. package/dist/Form/stories/util.js +480 -385
  276. package/dist/Form/stories/util.js.map +1 -1
  277. package/dist/Grid/Grid.constants.js +13 -20
  278. package/dist/Grid/Grid.constants.js.map +1 -1
  279. package/dist/Grid/Grid.js +50 -44
  280. package/dist/Grid/Grid.js.map +1 -1
  281. package/dist/Grid/Grid.styles.js +95 -88
  282. package/dist/Grid/Grid.styles.js.map +1 -1
  283. package/dist/Grid/Grid.types.js.map +1 -1
  284. package/dist/Grid/Grid.utils.js +17 -9
  285. package/dist/Grid/Grid.utils.js.map +1 -1
  286. package/dist/Grid/index.js +1 -0
  287. package/dist/Grid/index.js.map +1 -1
  288. package/dist/GroupSelect/GroupSelect.js +210 -146
  289. package/dist/GroupSelect/GroupSelect.js.map +1 -1
  290. package/dist/GroupSelect/GroupSelect.styles.js +6 -8
  291. package/dist/GroupSelect/GroupSelect.styles.js.map +1 -1
  292. package/dist/GroupSelect/GroupSelect.types.js.map +1 -1
  293. package/dist/GroupSelect/index.js +1 -0
  294. package/dist/GroupSelect/index.js.map +1 -1
  295. package/dist/Input/Input.js +10 -25
  296. package/dist/Input/Input.js.map +1 -1
  297. package/dist/Input/Input.styles.js +10 -11
  298. package/dist/Input/Input.styles.js.map +1 -1
  299. package/dist/Input/Input.types.js.map +1 -1
  300. package/dist/Input/index.js +1 -0
  301. package/dist/Input/index.js.map +1 -1
  302. package/dist/Link/Link.js +10 -25
  303. package/dist/Link/Link.js.map +1 -1
  304. package/dist/Link/Link.styles.js +16 -17
  305. package/dist/Link/Link.styles.js.map +1 -1
  306. package/dist/Link/Link.types.js.map +1 -1
  307. package/dist/Link/index.js +1 -0
  308. package/dist/Link/index.js.map +1 -1
  309. package/dist/ListPage/ListPage.js +69 -51
  310. package/dist/ListPage/ListPage.js.map +1 -1
  311. package/dist/ListPage/ListPage.styles.js +44 -25
  312. package/dist/ListPage/ListPage.styles.js.map +1 -1
  313. package/dist/ListPage/ListPage.types.js.map +1 -1
  314. package/dist/ListPage/index.js.map +1 -1
  315. package/dist/Loader/Loader.js +24 -31
  316. package/dist/Loader/Loader.js.map +1 -1
  317. package/dist/Loader/Loader.styles.js +11 -11
  318. package/dist/Loader/Loader.styles.js.map +1 -1
  319. package/dist/Loader/Loader.types.js.map +1 -1
  320. package/dist/Loader/index.js.map +1 -1
  321. package/dist/Menu/Menu.js +332 -237
  322. package/dist/Menu/Menu.js.map +1 -1
  323. package/dist/Menu/Menu.types.js.map +1 -1
  324. package/dist/Menu/index.js +1 -0
  325. package/dist/Menu/index.js.map +1 -1
  326. package/dist/MenuImperative/MenuImperative.js +504 -311
  327. package/dist/MenuImperative/MenuImperative.js.map +1 -1
  328. package/dist/MenuImperative/MenuImperative.styles.js +71 -46
  329. package/dist/MenuImperative/MenuImperative.styles.js.map +1 -1
  330. package/dist/MenuImperative/MenuImperative.types.js.map +1 -1
  331. package/dist/MenuImperative/index.js +1 -1
  332. package/dist/MenuImperative/index.js.map +1 -1
  333. package/dist/MenuImperative/sensors.js +232 -233
  334. package/dist/MenuImperative/sensors.js.map +1 -1
  335. package/dist/Modal/ChildRegistry.context.js +46 -33
  336. package/dist/Modal/ChildRegistry.context.js.map +1 -1
  337. package/dist/Modal/Modal.js +296 -193
  338. package/dist/Modal/Modal.js.map +1 -1
  339. package/dist/Modal/Modal.styles.js +76 -41
  340. package/dist/Modal/Modal.styles.js.map +1 -1
  341. package/dist/Modal/Modal.types.js.map +1 -1
  342. package/dist/Modal/index.js +1 -0
  343. package/dist/Modal/index.js.map +1 -1
  344. package/dist/Modal/storyHelpers.js +221 -149
  345. package/dist/Modal/storyHelpers.js.map +1 -1
  346. package/dist/Modal/useInitializeModalFocus.js +30 -29
  347. package/dist/Modal/useInitializeModalFocus.js.map +1 -1
  348. package/dist/MultiSelect/MultiSelect.js +487 -324
  349. package/dist/MultiSelect/MultiSelect.js.map +1 -1
  350. package/dist/MultiSelect/MultiSelect.styles.js +29 -16
  351. package/dist/MultiSelect/MultiSelect.styles.js.map +1 -1
  352. package/dist/MultiSelect/MultiSelect.test.js +250 -0
  353. package/dist/MultiSelect/MultiSelect.types.js.map +1 -1
  354. package/dist/MultiSelect/index.js.map +1 -1
  355. package/dist/NextMenu/NextMenu.js +121 -55
  356. package/dist/NextMenu/NextMenu.js.map +1 -1
  357. package/dist/NextMenu/NextMenu.styles.js +13 -9
  358. package/dist/NextMenu/NextMenu.styles.js.map +1 -1
  359. package/dist/NextMenu/NextMenu.types.js.map +1 -1
  360. package/dist/NextMenu/NextMenuItem.js +23 -29
  361. package/dist/NextMenu/NextMenuItem.js.map +1 -1
  362. package/dist/NextMenu/sampleData.js +469 -179
  363. package/dist/NextMenu/sampleData.js.map +1 -1
  364. package/dist/NextTile/NextTile.js +174 -101
  365. package/dist/NextTile/NextTile.js.map +1 -1
  366. package/dist/NextTile/NextTile.types.js.map +1 -1
  367. package/dist/Notation/Notation.js +26 -45
  368. package/dist/Notation/Notation.js.map +1 -1
  369. package/dist/Notation/Notation.types.js +4 -4
  370. package/dist/Notation/Notation.types.js.map +1 -1
  371. package/dist/Notation/index.js +1 -0
  372. package/dist/Notation/index.js.map +1 -1
  373. package/dist/NumberInput/NumberInput.constants.js.map +1 -1
  374. package/dist/NumberInput/NumberInput.hooks.js +47 -41
  375. package/dist/NumberInput/NumberInput.hooks.js.map +1 -1
  376. package/dist/NumberInput/NumberInput.js +440 -338
  377. package/dist/NumberInput/NumberInput.js.map +1 -1
  378. package/dist/NumberInput/NumberInput.styles.js +34 -18
  379. package/dist/NumberInput/NumberInput.styles.js.map +1 -1
  380. package/dist/NumberInput/NumberInput.types.js.map +1 -1
  381. package/dist/NumberInput/NumberInput.utils.js +436 -455
  382. package/dist/NumberInput/NumberInput.utils.js.map +1 -1
  383. package/dist/NumberInput/index.js +1 -0
  384. package/dist/NumberInput/index.js.map +1 -1
  385. package/dist/Overlay/Overlay.js +36 -35
  386. package/dist/Overlay/Overlay.js.map +1 -1
  387. package/dist/Overlay/OverlayArrow.js +27 -21
  388. package/dist/Overlay/OverlayArrow.js.map +1 -1
  389. package/dist/Overlay/OverlayArrow.styles.js +4 -6
  390. package/dist/Overlay/OverlayArrow.styles.js.map +1 -1
  391. package/dist/Overlay/index.js +1 -1
  392. package/dist/Overlay/index.js.map +1 -1
  393. package/dist/Overlay/useOverlay.js +29 -21
  394. package/dist/Overlay/useOverlay.js.map +1 -1
  395. package/dist/OverlayTrigger/OverlayTrigger.js +297 -205
  396. package/dist/OverlayTrigger/OverlayTrigger.js.map +1 -1
  397. package/dist/OverlayTrigger/OverlayTrigger.test.js +483 -0
  398. package/dist/OverlayTrigger/OverlayTrigger.types.js.map +1 -1
  399. package/dist/OverlayTrigger/a11yPresets.js +248 -185
  400. package/dist/OverlayTrigger/a11yPresets.js.map +1 -1
  401. package/dist/OverlayTrigger/index.js +2 -1
  402. package/dist/OverlayTrigger/index.js.map +1 -1
  403. package/dist/PageLayout/PageLayout.constants.js.map +1 -1
  404. package/dist/PageLayout/PageLayout.js +324 -269
  405. package/dist/PageLayout/PageLayout.js.map +1 -1
  406. package/dist/PageLayout/PageLayout.styles.js +111 -71
  407. package/dist/PageLayout/PageLayout.styles.js.map +1 -1
  408. package/dist/PageLayout/PageLayout.types.js.map +1 -1
  409. package/dist/PageLayout/PageLayout.utils.js +37 -35
  410. package/dist/PageLayout/PageLayout.utils.js.map +1 -1
  411. package/dist/PageLayout/index.js +1 -0
  412. package/dist/PageLayout/index.js.map +1 -1
  413. package/dist/Pagination/Pagination.js +98 -65
  414. package/dist/Pagination/Pagination.js.map +1 -1
  415. package/dist/Pagination/Pagination.styles.js +20 -10
  416. package/dist/Pagination/Pagination.styles.js.map +1 -1
  417. package/dist/Pagination/Pagination.types.js.map +1 -1
  418. package/dist/Pagination/PaginationSelect.js +126 -96
  419. package/dist/Pagination/PaginationSelect.js.map +1 -1
  420. package/dist/Pagination/index.js +1 -0
  421. package/dist/Pagination/index.js.map +1 -1
  422. package/dist/Panel/Panel.js +207 -127
  423. package/dist/Panel/Panel.js.map +1 -1
  424. package/dist/Panel/Panel.styles.js +61 -33
  425. package/dist/Panel/Panel.styles.js.map +1 -1
  426. package/dist/Panel/Panel.types.js.map +1 -1
  427. package/dist/Panel/index.js +1 -0
  428. package/dist/Panel/index.js.map +1 -1
  429. package/dist/Pill/Pill.colorPalette.js +40 -40
  430. package/dist/Pill/Pill.colorPalette.js.map +1 -1
  431. package/dist/Pill/Pill.js +32 -31
  432. package/dist/Pill/Pill.js.map +1 -1
  433. package/dist/Pill/Pill.styles.js +12 -11
  434. package/dist/Pill/Pill.styles.js.map +1 -1
  435. package/dist/Pill/Pill.types.js.map +1 -1
  436. package/dist/Pill/index.js +1 -0
  437. package/dist/Pill/index.js.map +1 -1
  438. package/dist/PillSelect/PillSelect.js +143 -77
  439. package/dist/PillSelect/PillSelect.js.map +1 -1
  440. package/dist/PillSelect/PillSelect.styles.js +18 -11
  441. package/dist/PillSelect/PillSelect.styles.js.map +1 -1
  442. package/dist/PillSelect/PillSelect.types.js.map +1 -1
  443. package/dist/PillSelect/index.js +1 -0
  444. package/dist/PillSelect/index.js.map +1 -1
  445. package/dist/Popover/Popover.js +57 -32
  446. package/dist/Popover/Popover.js.map +1 -1
  447. package/dist/Popover/Popover.styles.js +12 -11
  448. package/dist/Popover/Popover.styles.js.map +1 -1
  449. package/dist/Popover/Popover.types.js.map +1 -1
  450. package/dist/Popover/index.js +1 -0
  451. package/dist/Popover/index.js.map +1 -1
  452. package/dist/Portal/Portal.js +14 -26
  453. package/dist/Portal/Portal.js.map +1 -1
  454. package/dist/Portal/Portal.styles.js +4 -6
  455. package/dist/Portal/Portal.styles.js.map +1 -1
  456. package/dist/Portal/Portal.types.js.map +1 -1
  457. package/dist/Portal/index.js.map +1 -1
  458. package/dist/ProgressBar/ProgressBar.js +58 -50
  459. package/dist/ProgressBar/ProgressBar.js.map +1 -1
  460. package/dist/ProgressBar/ProgressBar.styles.js +18 -17
  461. package/dist/ProgressBar/ProgressBar.styles.js.map +1 -1
  462. package/dist/ProgressBar/ProgressBar.types.js.map +1 -1
  463. package/dist/ProgressBar/index.js +1 -0
  464. package/dist/ProgressBar/index.js.map +1 -1
  465. package/dist/RadioButton/RadioButton.js +21 -28
  466. package/dist/RadioButton/RadioButton.js.map +1 -1
  467. package/dist/RadioButton/RadioButton.styles.js +18 -14
  468. package/dist/RadioButton/RadioButton.styles.js.map +1 -1
  469. package/dist/RadioButton/RadioButton.types.js.map +1 -1
  470. package/dist/RadioButton/index.js +1 -0
  471. package/dist/RadioButton/index.js.map +1 -1
  472. package/dist/Required/Required.js +21 -32
  473. package/dist/Required/Required.js.map +1 -1
  474. package/dist/Required/Required.styles.js +18 -14
  475. package/dist/Required/Required.styles.js.map +1 -1
  476. package/dist/Required/Required.types.js.map +1 -1
  477. package/dist/Required/index.js +1 -0
  478. package/dist/Required/index.js.map +1 -1
  479. package/dist/Search/Search.hooks.js +59 -40
  480. package/dist/Search/Search.hooks.js.map +1 -1
  481. package/dist/Search/Search.js +60 -48
  482. package/dist/Search/Search.js.map +1 -1
  483. package/dist/Search/Search.styles.js +28 -11
  484. package/dist/Search/Search.styles.js.map +1 -1
  485. package/dist/Search/Search.types.js.map +1 -1
  486. package/dist/Search/index.js +1 -0
  487. package/dist/Search/index.js.map +1 -1
  488. package/dist/Section/Section.js +127 -102
  489. package/dist/Section/Section.js.map +1 -1
  490. package/dist/Section/Section.styles.js +34 -19
  491. package/dist/Section/Section.styles.js.map +1 -1
  492. package/dist/Section/Section.types.js.map +1 -1
  493. package/dist/Section/index.js.map +1 -1
  494. package/dist/SegmentedController/SegmentedController.js +135 -93
  495. package/dist/SegmentedController/SegmentedController.js.map +1 -1
  496. package/dist/SegmentedController/SegmentedController.styles.js +38 -29
  497. package/dist/SegmentedController/SegmentedController.styles.js.map +1 -1
  498. package/dist/SegmentedController/SegmentedController.types.js +3 -3
  499. package/dist/SegmentedController/SegmentedController.types.js.map +1 -1
  500. package/dist/SegmentedController/index.js +1 -0
  501. package/dist/SegmentedController/index.js.map +1 -1
  502. package/dist/Select/Select.js +302 -125
  503. package/dist/Select/Select.js.map +1 -1
  504. package/dist/Select/Select.styles.js +66 -46
  505. package/dist/Select/Select.styles.js.map +1 -1
  506. package/dist/Select/Select.types.js.map +1 -1
  507. package/dist/Select/index.js +1 -1
  508. package/dist/Select/index.js.map +1 -1
  509. package/dist/Semantic/Semantic.js +63 -40
  510. package/dist/Semantic/Semantic.js.map +1 -1
  511. package/dist/Semantic/Semantic.styles.js +49 -34
  512. package/dist/Semantic/Semantic.styles.js.map +1 -1
  513. package/dist/Semantic/Semantic.types.js.map +1 -1
  514. package/dist/Semantic/index.js.map +1 -1
  515. package/dist/Sidebar/Sidebar.js +85 -68
  516. package/dist/Sidebar/Sidebar.js.map +1 -1
  517. package/dist/Sidebar/Sidebar.styles.js +32 -16
  518. package/dist/Sidebar/Sidebar.styles.js.map +1 -1
  519. package/dist/Sidebar/index.js.map +1 -1
  520. package/dist/Slider/Slider.js +120 -73
  521. package/dist/Slider/Slider.js.map +1 -1
  522. package/dist/Slider/Slider.styles.js +48 -22
  523. package/dist/Slider/Slider.styles.js.map +1 -1
  524. package/dist/Slider/Slider.types.js.map +1 -1
  525. package/dist/Slider/index.js +1 -0
  526. package/dist/Slider/index.js.map +1 -1
  527. package/dist/Spinner/Spinner.js +49 -42
  528. package/dist/Spinner/Spinner.js.map +1 -1
  529. package/dist/Spinner/Spinner.styles.js +64 -47
  530. package/dist/Spinner/Spinner.styles.js.map +1 -1
  531. package/dist/Spinner/Spinner.types.js.map +1 -1
  532. package/dist/Spinner/index.js +1 -0
  533. package/dist/Spinner/index.js.map +1 -1
  534. package/dist/SuperSelect/SuperSelect.components.js +288 -210
  535. package/dist/SuperSelect/SuperSelect.components.js.map +1 -1
  536. package/dist/SuperSelect/SuperSelect.constants.js.map +1 -1
  537. package/dist/SuperSelect/SuperSelect.js +82 -56
  538. package/dist/SuperSelect/SuperSelect.js.map +1 -1
  539. package/dist/SuperSelect/SuperSelect.presets.styles.js +4 -6
  540. package/dist/SuperSelect/SuperSelect.presets.styles.js.map +1 -1
  541. package/dist/SuperSelect/SuperSelect.styles.js +228 -117
  542. package/dist/SuperSelect/SuperSelect.styles.js.map +1 -1
  543. package/dist/SuperSelect/SuperSelect.types.js.map +1 -1
  544. package/dist/SuperSelect/SuperSelect.utils.js +136 -129
  545. package/dist/SuperSelect/SuperSelect.utils.js.map +1 -1
  546. package/dist/SuperSelect/SuperSelect.utils.test.js +717 -0
  547. package/dist/SuperSelect/index.js +1 -1
  548. package/dist/SuperSelect/index.js.map +1 -1
  549. package/dist/SuperSelect/presets/contactsPreset.js +16 -31
  550. package/dist/SuperSelect/presets/contactsPreset.js.map +1 -1
  551. package/dist/SuperSelect/presets/filterPreset.js +55 -55
  552. package/dist/SuperSelect/presets/filterPreset.js.map +1 -1
  553. package/dist/SuperSelect/presets/index.js +4 -4
  554. package/dist/SuperSelect/presets/index.js.map +1 -1
  555. package/dist/SuperSelect/presets/pillPreset.js +39 -25
  556. package/dist/SuperSelect/presets/pillPreset.js.map +1 -1
  557. package/dist/SuperSelect/useSuperSelect.js +769 -636
  558. package/dist/SuperSelect/useSuperSelect.js.map +1 -1
  559. package/dist/SuperSelect/useSuperSelect.test.js +1284 -0
  560. package/dist/SuperSelect/useVirtuosoResizeErrorFix.js +15 -18
  561. package/dist/SuperSelect/useVirtuosoResizeErrorFix.js.map +1 -1
  562. package/dist/Switch/Switch.js +22 -32
  563. package/dist/Switch/Switch.js.map +1 -1
  564. package/dist/Switch/Switch.styles.js +26 -17
  565. package/dist/Switch/Switch.styles.js.map +1 -1
  566. package/dist/Switch/Switch.types.js.map +1 -1
  567. package/dist/Switch/index.js +1 -0
  568. package/dist/Switch/index.js.map +1 -1
  569. package/dist/Table/Table.js +372 -197
  570. package/dist/Table/Table.js.map +1 -1
  571. package/dist/Table/Table.styles.js +204 -127
  572. package/dist/Table/Table.styles.js.map +1 -1
  573. package/dist/Table/Table.types.js.map +1 -1
  574. package/dist/Table/index.js +1 -0
  575. package/dist/Table/index.js.map +1 -1
  576. package/dist/TableShelf/TableShelf.js +51 -47
  577. package/dist/TableShelf/TableShelf.js.map +1 -1
  578. package/dist/TableShelf/TableShelf.styles.js +20 -10
  579. package/dist/TableShelf/TableShelf.styles.js.map +1 -1
  580. package/dist/TableShelf/index.js.map +1 -1
  581. package/dist/Tabs/Tabs.js +237 -136
  582. package/dist/Tabs/Tabs.js.map +1 -1
  583. package/dist/Tabs/Tabs.styles.js +59 -40
  584. package/dist/Tabs/Tabs.styles.js.map +1 -1
  585. package/dist/Tabs/Tabs.types.js +6 -6
  586. package/dist/Tabs/Tabs.types.js.map +1 -1
  587. package/dist/Tabs/index.js +1 -0
  588. package/dist/Tabs/index.js.map +1 -1
  589. package/dist/Tearsheet/Tearsheet.constants.js +2 -15
  590. package/dist/Tearsheet/Tearsheet.constants.js.map +1 -1
  591. package/dist/Tearsheet/Tearsheet.js +228 -177
  592. package/dist/Tearsheet/Tearsheet.js.map +1 -1
  593. package/dist/Tearsheet/Tearsheet.styles.js +106 -92
  594. package/dist/Tearsheet/Tearsheet.styles.js.map +1 -1
  595. package/dist/Tearsheet/Tearsheet.types.js.map +1 -1
  596. package/dist/Tearsheet/Tearsheet.util.js +53 -49
  597. package/dist/Tearsheet/Tearsheet.util.js.map +1 -1
  598. package/dist/Tearsheet/index.js +1 -0
  599. package/dist/Tearsheet/index.js.map +1 -1
  600. package/dist/TextArea/TextArea.js +13 -25
  601. package/dist/TextArea/TextArea.js.map +1 -1
  602. package/dist/TextArea/TextArea.styles.js +7 -8
  603. package/dist/TextArea/TextArea.styles.js.map +1 -1
  604. package/dist/TextArea/TextArea.types.js.map +1 -1
  605. package/dist/TextArea/index.js +1 -0
  606. package/dist/TextArea/index.js.map +1 -1
  607. package/dist/TextEditor/TextEditor.js +110 -81
  608. package/dist/TextEditor/TextEditor.js.map +1 -1
  609. package/dist/TextEditor/TextEditor.styles.js +3 -8
  610. package/dist/TextEditor/TextEditor.styles.js.map +1 -1
  611. package/dist/TextEditor/TextEditor.types.js.map +1 -1
  612. package/dist/TextEditor/index.js +1 -0
  613. package/dist/TextEditor/index.js.map +1 -1
  614. package/dist/TextEditorOutput/TextEditorOutput.js +29 -27
  615. package/dist/TextEditorOutput/TextEditorOutput.js.map +1 -1
  616. package/dist/TextEditorOutput/TextEditorOutput.styles.js +4 -6
  617. package/dist/TextEditorOutput/TextEditorOutput.styles.js.map +1 -1
  618. package/dist/TextEditorOutput/TextEditorOutput.types.js.map +1 -1
  619. package/dist/TextEditorOutput/index.js.map +1 -1
  620. package/dist/Thumbnail/Thumbnail.hooks.js +89 -57
  621. package/dist/Thumbnail/Thumbnail.hooks.js.map +1 -1
  622. package/dist/Thumbnail/Thumbnail.js +394 -180
  623. package/dist/Thumbnail/Thumbnail.js.map +1 -1
  624. package/dist/Thumbnail/Thumbnail.styles.js +151 -130
  625. package/dist/Thumbnail/Thumbnail.styles.js.map +1 -1
  626. package/dist/Thumbnail/Thumbnail.types.js.map +1 -1
  627. package/dist/Thumbnail/Thumbnail.utils.js +45 -55
  628. package/dist/Thumbnail/Thumbnail.utils.js.map +1 -1
  629. package/dist/Thumbnail/ThumbnailCaption.js +101 -54
  630. package/dist/Thumbnail/ThumbnailCaption.js.map +1 -1
  631. package/dist/Thumbnail/ThumbnailDocumentIcon.js +479 -156
  632. package/dist/Thumbnail/ThumbnailDocumentIcon.js.map +1 -1
  633. package/dist/Thumbnail/ThumbnailPreview.js +31 -20
  634. package/dist/Thumbnail/ThumbnailPreview.js.map +1 -1
  635. package/dist/Thumbnail/index.js +2 -0
  636. package/dist/Thumbnail/index.js.map +1 -1
  637. package/dist/ThumbnailGrid/ThumbnailGrid.hooks.js +102 -81
  638. package/dist/ThumbnailGrid/ThumbnailGrid.hooks.js.map +1 -1
  639. package/dist/ThumbnailGrid/ThumbnailGrid.js +536 -402
  640. package/dist/ThumbnailGrid/ThumbnailGrid.js.map +1 -1
  641. package/dist/ThumbnailGrid/ThumbnailGrid.styles.js +28 -14
  642. package/dist/ThumbnailGrid/ThumbnailGrid.styles.js.map +1 -1
  643. package/dist/ThumbnailGrid/ThumbnailGrid.types.js.map +1 -1
  644. package/dist/ThumbnailGrid/index.js +1 -0
  645. package/dist/ThumbnailGrid/index.js.map +1 -1
  646. package/dist/TieredDropdown/TieredDropdown.helpers.js +29 -25
  647. package/dist/TieredDropdown/TieredDropdown.helpers.js.map +1 -1
  648. package/dist/TieredDropdown/TieredDropdown.js +241 -145
  649. package/dist/TieredDropdown/TieredDropdown.js.map +1 -1
  650. package/dist/TieredDropdown/TieredDropdown.types.js.map +1 -1
  651. package/dist/TieredDropdown/index.js +1 -0
  652. package/dist/TieredDropdown/index.js.map +1 -1
  653. package/dist/TieredDropdown/useSearch.js +49 -39
  654. package/dist/TieredDropdown/useSearch.js.map +1 -1
  655. package/dist/TieredSelect/LeafSelectionTieredSelect.js +173 -117
  656. package/dist/TieredSelect/LeafSelectionTieredSelect.js.map +1 -1
  657. package/dist/TieredSelect/TierSelectionTieredSelect.js +486 -316
  658. package/dist/TieredSelect/TierSelectionTieredSelect.js.map +1 -1
  659. package/dist/TieredSelect/TieredSelect.js +149 -111
  660. package/dist/TieredSelect/TieredSelect.js.map +1 -1
  661. package/dist/TieredSelect/TieredSelect.styles.js +40 -18
  662. package/dist/TieredSelect/TieredSelect.styles.js.map +1 -1
  663. package/dist/TieredSelect/TieredSelect.types.js.map +1 -1
  664. package/dist/TieredSelect/TieredSelectMenu.js +390 -277
  665. package/dist/TieredSelect/TieredSelectMenu.js.map +1 -1
  666. package/dist/TieredSelect/index.js +1 -0
  667. package/dist/TieredSelect/index.js.map +1 -1
  668. package/dist/Tile/Tile.js +154 -90
  669. package/dist/Tile/Tile.js.map +1 -1
  670. package/dist/Tile/Tile.styles.js +81 -46
  671. package/dist/Tile/Tile.styles.js.map +1 -1
  672. package/dist/Tile/Tile.types.js.map +1 -1
  673. package/dist/Tile/index.js +1 -0
  674. package/dist/Tile/index.js.map +1 -1
  675. package/dist/Title/Title.js +64 -64
  676. package/dist/Title/Title.js.map +1 -1
  677. package/dist/Title/Title.styles.js +30 -14
  678. package/dist/Title/Title.styles.js.map +1 -1
  679. package/dist/Title/Title.types.js.map +1 -1
  680. package/dist/Title/index.js +1 -0
  681. package/dist/Title/index.js.map +1 -1
  682. package/dist/Toast/Toast.js +44 -40
  683. package/dist/Toast/Toast.js.map +1 -1
  684. package/dist/Toast/Toast.styles.js +18 -15
  685. package/dist/Toast/Toast.styles.js.map +1 -1
  686. package/dist/Toast/Toast.types.js.map +1 -1
  687. package/dist/Toast/index.js +1 -0
  688. package/dist/Toast/index.js.map +1 -1
  689. package/dist/ToggleButton/ToggleButton.js +20 -25
  690. package/dist/ToggleButton/ToggleButton.js.map +1 -1
  691. package/dist/ToggleButton/ToggleButton.styles.js +6 -8
  692. package/dist/ToggleButton/ToggleButton.styles.js.map +1 -1
  693. package/dist/ToggleButton/ToggleButton.types.js.map +1 -1
  694. package/dist/ToggleButton/index.js +1 -0
  695. package/dist/ToggleButton/index.js.map +1 -1
  696. package/dist/Token/Token.js +39 -34
  697. package/dist/Token/Token.js.map +1 -1
  698. package/dist/Token/Token.styles.js +25 -16
  699. package/dist/Token/Token.styles.js.map +1 -1
  700. package/dist/Token/Token.types.js.map +1 -1
  701. package/dist/Token/index.js +1 -0
  702. package/dist/Token/index.js.map +1 -1
  703. package/dist/ToolHeader/ActionIcon.js +45 -38
  704. package/dist/ToolHeader/ActionIcon.js.map +1 -1
  705. package/dist/ToolHeader/ActionIcon.types.example.js +58 -18
  706. package/dist/ToolHeader/ActionIcon.types.example.js.map +1 -1
  707. package/dist/ToolHeader/ActionIcon.types.js.map +1 -1
  708. package/dist/ToolHeader/ToolHeader.js +60 -47
  709. package/dist/ToolHeader/ToolHeader.js.map +1 -1
  710. package/dist/ToolHeader/ToolHeader.styles.js +30 -18
  711. package/dist/ToolHeader/ToolHeader.styles.js.map +1 -1
  712. package/dist/ToolHeader/ToolHeader.types.js.map +1 -1
  713. package/dist/ToolHeader/index.js.map +1 -1
  714. package/dist/Tooltip/Tooltip.js +43 -31
  715. package/dist/Tooltip/Tooltip.js.map +1 -1
  716. package/dist/Tooltip/Tooltip.styles.js +8 -7
  717. package/dist/Tooltip/Tooltip.styles.js.map +1 -1
  718. package/dist/Tooltip/Tooltip.types.js.map +1 -1
  719. package/dist/Tooltip/index.js +1 -0
  720. package/dist/Tooltip/index.js.map +1 -1
  721. package/dist/Tree/Tree.hooks.js +195 -190
  722. package/dist/Tree/Tree.hooks.js.map +1 -1
  723. package/dist/Tree/Tree.js +530 -324
  724. package/dist/Tree/Tree.js.map +1 -1
  725. package/dist/Tree/Tree.styles.js +49 -28
  726. package/dist/Tree/Tree.styles.js.map +1 -1
  727. package/dist/Tree/Tree.types.js.map +1 -1
  728. package/dist/Tree/index.js +1 -0
  729. package/dist/Tree/index.js.map +1 -1
  730. package/dist/Typeahead/Typeahead.js +77 -50
  731. package/dist/Typeahead/Typeahead.js.map +1 -1
  732. package/dist/Typeahead/Typeahead.styles.js +16 -8
  733. package/dist/Typeahead/Typeahead.styles.js.map +1 -1
  734. package/dist/Typeahead/Typeahead.types.js.map +1 -1
  735. package/dist/Typeahead/index.js +1 -0
  736. package/dist/Typeahead/index.js.map +1 -1
  737. package/dist/Typography/Typography.colors.story.js +282 -141
  738. package/dist/Typography/Typography.colors.story.js.map +1 -1
  739. package/dist/Typography/Typography.js +13 -25
  740. package/dist/Typography/Typography.js.map +1 -1
  741. package/dist/Typography/Typography.styles.js +42 -41
  742. package/dist/Typography/Typography.styles.js.map +1 -1
  743. package/dist/Typography/Typography.table.story.js +24 -45
  744. package/dist/Typography/Typography.table.story.js.map +1 -1
  745. package/dist/Typography/Typography.types.js.map +1 -1
  746. package/dist/Typography/index.js.map +1 -1
  747. package/dist/_hooks/Analytics.js +27 -18
  748. package/dist/_hooks/Analytics.js.map +1 -1
  749. package/dist/_hooks/Anchor.js +123 -84
  750. package/dist/_hooks/Anchor.js.map +1 -1
  751. package/dist/_hooks/Autofocus.js +53 -52
  752. package/dist/_hooks/Autofocus.js.map +1 -1
  753. package/dist/_hooks/BoundingRect.js +57 -41
  754. package/dist/_hooks/BoundingRect.js.map +1 -1
  755. package/dist/_hooks/Buffer.js +64 -39
  756. package/dist/_hooks/Buffer.js.map +1 -1
  757. package/dist/_hooks/ClickOutside.js +31 -20
  758. package/dist/_hooks/ClickOutside.js.map +1 -1
  759. package/dist/_hooks/DateTime/DateTime.js +235 -188
  760. package/dist/_hooks/DateTime/DateTime.js.map +1 -1
  761. package/dist/_hooks/DateTime/index.js +1 -1
  762. package/dist/_hooks/DateTime/index.js.map +1 -1
  763. package/dist/_hooks/DelayedCallback.js +41 -25
  764. package/dist/_hooks/DelayedCallback.js.map +1 -1
  765. package/dist/_hooks/DelayedToggle.js +98 -59
  766. package/dist/_hooks/DelayedToggle.js.map +1 -1
  767. package/dist/_hooks/Deprecation.js +11 -10
  768. package/dist/_hooks/Deprecation.js.map +1 -1
  769. package/dist/_hooks/Event.js +53 -28
  770. package/dist/_hooks/Event.js.map +1 -1
  771. package/dist/_hooks/EventListener.js +103 -59
  772. package/dist/_hooks/EventListener.js.map +1 -1
  773. package/dist/_hooks/EventRegistry.js +19 -14
  774. package/dist/_hooks/EventRegistry.js.map +1 -1
  775. package/dist/_hooks/Hotkey.js +35 -32
  776. package/dist/_hooks/Hotkey.js.map +1 -1
  777. package/dist/_hooks/I18n.js +54 -52
  778. package/dist/_hooks/I18n.js.map +1 -1
  779. package/dist/_hooks/InjectedScript.js +66 -45
  780. package/dist/_hooks/InjectedScript.js.map +1 -1
  781. package/dist/_hooks/IntersectionObserver/createIntersectionObserver.js +3 -3
  782. package/dist/_hooks/IntersectionObserver/createIntersectionObserver.js.map +1 -1
  783. package/dist/_hooks/IntersectionObserver/index.js.map +1 -1
  784. package/dist/_hooks/IntersectionObserver/useIntersectionObserver.js +23 -14
  785. package/dist/_hooks/IntersectionObserver/useIntersectionObserver.js.map +1 -1
  786. package/dist/_hooks/ListNavigation.js +114 -79
  787. package/dist/_hooks/ListNavigation.js.map +1 -1
  788. package/dist/_hooks/OverflowObserver/OverflowObserver.js +56 -32
  789. package/dist/_hooks/OverflowObserver/OverflowObserver.js.map +1 -1
  790. package/dist/_hooks/OverflowObserver/OverflowObserver.test.js +110 -0
  791. package/dist/_hooks/OverflowObserver/OverflowObserver.types.js.map +1 -1
  792. package/dist/_hooks/OverflowObserver/index.js.map +1 -1
  793. package/dist/_hooks/Resize.js +10 -4
  794. package/dist/_hooks/Resize.js.map +1 -1
  795. package/dist/_hooks/ResizeObserver.js +23 -14
  796. package/dist/_hooks/ResizeObserver.js.map +1 -1
  797. package/dist/_hooks/Scroll.js +16 -4
  798. package/dist/_hooks/Scroll.js.map +1 -1
  799. package/dist/_hooks/ScrollLock.js +15 -15
  800. package/dist/_hooks/ScrollLock.js.map +1 -1
  801. package/dist/_hooks/TextEntry.js +83 -46
  802. package/dist/_hooks/TextEntry.js.map +1 -1
  803. package/dist/_hooks/Timer.js +48 -29
  804. package/dist/_hooks/Timer.js.map +1 -1
  805. package/dist/_hooks/Trigger.js +120 -86
  806. package/dist/_hooks/Trigger.js.map +1 -1
  807. package/dist/_hooks/Visibility.js +82 -49
  808. package/dist/_hooks/Visibility.js.map +1 -1
  809. package/dist/_hooks/ZIndex.js +53 -34
  810. package/dist/_hooks/ZIndex.js.map +1 -1
  811. package/dist/_hooks/__tests__/Anchor.test.js +109 -0
  812. package/dist/_hooks/__tests__/BoundingRect.test.js +85 -0
  813. package/dist/_hooks/__tests__/Buffer.test.js +76 -0
  814. package/dist/_hooks/__tests__/DateTime.test.js +136 -0
  815. package/dist/_hooks/__tests__/DelayedCallback.test.js +119 -0
  816. package/dist/_hooks/__tests__/DelayedToggle.test.js +50 -0
  817. package/dist/_hooks/__tests__/Deprecation.test.js +58 -0
  818. package/dist/_hooks/__tests__/Event.test.js +46 -0
  819. package/dist/_hooks/__tests__/EventListener.test.js +78 -0
  820. package/dist/_hooks/__tests__/Hotkey.test.js +18 -0
  821. package/dist/_hooks/__tests__/InjectedScript.test.js +80 -0
  822. package/dist/_hooks/__tests__/ListNavigation.test.js +101 -0
  823. package/dist/_hooks/__tests__/TextEntry.test.js +92 -0
  824. package/dist/_hooks/__tests__/Timer.test.js +60 -0
  825. package/dist/_hooks/__tests__/Trigger.test.js +52 -0
  826. package/dist/_hooks/__tests__/Visibility.test.js +86 -0
  827. package/dist/_hooks/__tests__/ZIndex.test.js +76 -0
  828. package/dist/_hooks/useFileUploader.js +220 -220
  829. package/dist/_hooks/useFileUploader.js.map +1 -1
  830. package/dist/_hooks/useFocusWithin.js +27 -18
  831. package/dist/_hooks/useFocusWithin.js.map +1 -1
  832. package/dist/_hooks/useSet.js +71 -45
  833. package/dist/_hooks/useSet.js.map +1 -1
  834. package/dist/_hooks/useUpdateEffect.js +14 -13
  835. package/dist/_hooks/useUpdateEffect.js.map +1 -1
  836. package/dist/_locales/de-DE.json +354 -354
  837. package/dist/_locales/en-AU.json +354 -354
  838. package/dist/_locales/en-CA.json +354 -354
  839. package/dist/_locales/en-GB.json +354 -354
  840. package/dist/_locales/en-US.json +30 -30
  841. package/dist/_locales/en.json +353 -353
  842. package/dist/_locales/es-ES.json +354 -354
  843. package/dist/_locales/es.json +354 -354
  844. package/dist/_locales/fr-CA.json +354 -354
  845. package/dist/_locales/fr-FR.json +354 -354
  846. package/dist/_locales/is-IS.json +354 -354
  847. package/dist/_locales/pt-BR.json +354 -354
  848. package/dist/_locales/th-TH.json +354 -354
  849. package/dist/_locales/zh-SG.json +354 -354
  850. package/dist/_styles/arrows.js +4 -9
  851. package/dist/_styles/arrows.js.map +1 -1
  852. package/dist/_styles/borderRadius.js +4 -9
  853. package/dist/_styles/borderRadius.js.map +1 -1
  854. package/dist/_styles/colors.js +19 -18
  855. package/dist/_styles/colors.js.map +1 -1
  856. package/dist/_styles/media.js.map +1 -1
  857. package/dist/_styles/mixins.js +14 -16
  858. package/dist/_styles/mixins.js.map +1 -1
  859. package/dist/_styles/shadows.js +12 -17
  860. package/dist/_styles/shadows.js.map +1 -1
  861. package/dist/_styles/spacing.js +8 -8
  862. package/dist/_styles/spacing.js.map +1 -1
  863. package/dist/_typedoc/Avatar/Avatar.types.json +20 -20
  864. package/dist/_typedoc/AvatarStack/AvatarStack.types.json +23 -23
  865. package/dist/_typedoc/Badge/Badge.types.json +6 -6
  866. package/dist/_typedoc/Banner/Banner.types.json +13 -13
  867. package/dist/_typedoc/Box/Box.types.json +68 -68
  868. package/dist/_typedoc/Breadcrumbs/Breadcrumbs.types.json +10 -10
  869. package/dist/_typedoc/Button/Button.types.json +11 -11
  870. package/dist/_typedoc/Calendar/Calendar.types.json +80 -80
  871. package/dist/_typedoc/Card/Card.types.json +6 -6
  872. package/dist/_typedoc/Checkbox/Checkbox.types.json +7 -7
  873. package/dist/_typedoc/ContactItem/ContactItem.types.json +9 -9
  874. package/dist/_typedoc/DateInput/DateInput.types.json +35 -35
  875. package/dist/_typedoc/DateSelect/DateSelect.types.json +13 -13
  876. package/dist/_typedoc/DetailPage/DetailPage.types.json +4 -4
  877. package/dist/_typedoc/Dropdown/Dropdown.types.json +37 -37
  878. package/dist/_typedoc/DropdownFlyout/DropdownFlyout.types.json +29 -29
  879. package/dist/_typedoc/Dropzone/Dropzone.types.json +41 -41
  880. package/dist/_typedoc/EmptyState/EmptyState.types.json +14 -14
  881. package/dist/_typedoc/FileList/FileList.types.json +9 -9
  882. package/dist/_typedoc/FileSelect/FileSelect.types.json +26 -26
  883. package/dist/_typedoc/FileSelect/GridSource/GridSource.types.json +20 -20
  884. package/dist/_typedoc/FileSelect/LocalSource/LocalSource.types.json +14 -14
  885. package/dist/_typedoc/FileSelect/TreeSource/TreeSource.types.json +9 -9
  886. package/dist/_typedoc/Flex/Flex.types.json +27 -27
  887. package/dist/_typedoc/FlexList/FlexList.types.json +30 -30
  888. package/dist/_typedoc/Form/Form.types.json +698 -698
  889. package/dist/_typedoc/Grid/Grid.types.json +8 -8
  890. package/dist/_typedoc/GroupSelect/GroupSelect.types.json +52 -52
  891. package/dist/_typedoc/Input/Input.types.json +2 -2
  892. package/dist/_typedoc/Link/Link.types.json +4 -4
  893. package/dist/_typedoc/ListPage/ListPage.types.json +13 -13
  894. package/dist/_typedoc/Menu/Menu.types.json +62 -62
  895. package/dist/_typedoc/MenuImperative/MenuImperative.types.json +74 -74
  896. package/dist/_typedoc/Modal/Modal.types.json +41 -41
  897. package/dist/_typedoc/MultiSelect/MultiSelect.types.json +31 -31
  898. package/dist/_typedoc/Notation/Notation.types.json +4 -4
  899. package/dist/_typedoc/NumberInput/NumberInput.types.json +38 -38
  900. package/dist/_typedoc/OverlayTrigger/OverlayTrigger.types.json +30 -30
  901. package/dist/_typedoc/PageLayout/PageLayout.types.json +22 -22
  902. package/dist/_typedoc/Pagination/Pagination.types.json +7 -7
  903. package/dist/_typedoc/Panel/Panel.types.json +27 -27
  904. package/dist/_typedoc/Pill/Pill.types.json +2 -2
  905. package/dist/_typedoc/PillSelect/PillSelect.types.json +46 -46
  906. package/dist/_typedoc/Popover/Popover.types.json +14 -14
  907. package/dist/_typedoc/ProgressBar/ProgressBar.types.json +6 -6
  908. package/dist/_typedoc/RadioButton/RadioButton.types.json +6 -6
  909. package/dist/_typedoc/Required/Required.types.json +5 -5
  910. package/dist/_typedoc/Search/Search.types.json +18 -18
  911. package/dist/_typedoc/Section/Section.types.json +14 -14
  912. package/dist/_typedoc/SegmentedController/SegmentedController.types.json +20 -20
  913. package/dist/_typedoc/Select/Select.types.json +55 -55
  914. package/dist/_typedoc/Slider/Slider.types.json +6 -6
  915. package/dist/_typedoc/Spinner/Spinner.types.json +9 -9
  916. package/dist/_typedoc/Switch/Switch.types.json +3 -3
  917. package/dist/_typedoc/Table/Table.types.json +96 -96
  918. package/dist/_typedoc/Tabs/Tabs.types.json +17 -17
  919. package/dist/_typedoc/Tearsheet/Tearsheet.types.json +16 -16
  920. package/dist/_typedoc/TextArea/TextArea.types.json +3 -3
  921. package/dist/_typedoc/TextEditor/TextEditor.types.json +9 -9
  922. package/dist/_typedoc/TextEditorOutput/TextEditorOutput.types.json +4 -4
  923. package/dist/_typedoc/Thumbnail/Thumbnail.types.json +19 -19
  924. package/dist/_typedoc/TieredDropdown/TieredDropdown.types.json +42 -42
  925. package/dist/_typedoc/TieredSelect/TieredSelect.types.json +28 -28
  926. package/dist/_typedoc/Tile/Tile.types.json +30 -30
  927. package/dist/_typedoc/Toast/Toast.types.json +4 -4
  928. package/dist/_typedoc/ToggleButton/ToggleButton.types.json +3 -3
  929. package/dist/_typedoc/Token/Token.types.json +4 -4
  930. package/dist/_typedoc/ToolHeader/ToolHeader.types.json +10 -10
  931. package/dist/_typedoc/Tooltip/Tooltip.types.json +13 -13
  932. package/dist/_typedoc/Tree/Tree.types.json +86 -86
  933. package/dist/_typedoc/Typeahead/Typeahead.types.json +2 -2
  934. package/dist/_typedoc/Typography/Typography.types.json +8 -8
  935. package/dist/_typedoc/_utils/types.json +3 -3
  936. package/dist/_utils/CalendarHelpers.js +147 -129
  937. package/dist/_utils/CalendarHelpers.js.map +1 -1
  938. package/dist/_utils/TinyMCE.js +60 -109
  939. package/dist/_utils/TinyMCE.js.map +1 -1
  940. package/dist/_utils/__tests__/CalendarHelpers.test.js +64 -0
  941. package/dist/_utils/__tests__/filename.test.js +27 -0
  942. package/dist/_utils/__tests__/getAnchorPosition.test.js +250 -0
  943. package/dist/_utils/__tests__/mergeRefs.test.js +58 -0
  944. package/dist/_utils/__tests__/slotify.test.js +152 -0
  945. package/dist/_utils/addSubcomponents.js +5 -5
  946. package/dist/_utils/addSubcomponents.js.map +1 -1
  947. package/dist/_utils/dateTime.js +103 -85
  948. package/dist/_utils/dateTime.js.map +1 -1
  949. package/dist/_utils/dom.js +21 -25
  950. package/dist/_utils/dom.js.map +1 -1
  951. package/dist/_utils/filename.js +19 -11
  952. package/dist/_utils/filename.js.map +1 -1
  953. package/dist/_utils/genericAnalyticsClient.js +40 -26
  954. package/dist/_utils/genericAnalyticsClient.js.map +1 -1
  955. package/dist/_utils/getAnchorPosition.js +221 -127
  956. package/dist/_utils/getAnchorPosition.js.map +1 -1
  957. package/dist/_utils/i18n.js +19 -19
  958. package/dist/_utils/i18n.js.map +1 -1
  959. package/dist/_utils/isIE11.js +4 -4
  960. package/dist/_utils/isIE11.js.map +1 -1
  961. package/dist/_utils/isReactElement.js +1 -1
  962. package/dist/_utils/isReactElement.js.map +1 -1
  963. package/dist/_utils/mergeRefs.js +13 -13
  964. package/dist/_utils/mergeRefs.js.map +1 -1
  965. package/dist/_utils/partition.js +13 -5
  966. package/dist/_utils/partition.js.map +1 -1
  967. package/dist/_utils/placement.js +13 -13
  968. package/dist/_utils/placement.js.map +1 -1
  969. package/dist/_utils/polymorphic.js +6 -1
  970. package/dist/_utils/polymorphic.js.map +1 -1
  971. package/dist/_utils/props.js +1 -1
  972. package/dist/_utils/props.js.map +1 -1
  973. package/dist/_utils/propsTypedoc.js +14 -0
  974. package/dist/_utils/propsTypedoc.js.map +1 -1
  975. package/dist/_utils/runInQueue.js +39 -57
  976. package/dist/_utils/runInQueue.js.map +1 -1
  977. package/dist/_utils/scrollIntoView.js +17 -15
  978. package/dist/_utils/scrollIntoView.js.map +1 -1
  979. package/dist/_utils/slotify.js +45 -42
  980. package/dist/_utils/slotify.js.map +1 -1
  981. package/dist/_utils/triggerListeners.js +65 -53
  982. package/dist/_utils/triggerListeners.js.map +1 -1
  983. package/dist/_utils/types.js.map +1 -1
  984. package/dist/_utils/usingHookOrDefault.js +3 -5
  985. package/dist/_utils/usingHookOrDefault.js.map +1 -1
  986. package/dist/index.js +9 -1
  987. package/dist/index.js.map +1 -1
  988. package/package.json +8 -6
  989. package/dist/Link/Link.coverage.stories.js +0 -28
  990. package/dist/Link/Link.coverage.stories.js.map +0 -1
@@ -1,40 +1,52 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- var __rest = (this && this.__rest) || function (s, e) {
13
- var t = {};
14
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
- t[p] = s[p];
16
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
- t[p[i]] = s[p[i]];
20
- }
21
- return t;
22
- };
23
- import { formatCurrencyToParts, } from '@procore/globalization-toolkit';
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ var _excluded = ["decimalScale", "defaultValue", "disabled", "error", "fillDecimalScale", "locale", "onChange", "onKeyDown", "onBlur", "prefix", "readOnly", "step", "style", "suffix", "value", "qa"],
3
+ _excluded2 = ["currencyDisplay", "currencyIsoCode", "decimalScale", "fillDecimalScale", "prefix", "suffix"];
4
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
5
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
6
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
7
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
8
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
9
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
10
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
11
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
12
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
13
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
14
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
15
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
16
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
17
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
18
+ import { formatCurrencyToParts } from '@procore/globalization-toolkit';
24
19
  import { findIndex } from 'ramda';
25
20
  import React from 'react';
26
21
  import { useI18nContext } from '../_hooks/I18n';
27
22
  import { spacing } from '../_styles/spacing';
28
23
  import { mergeRefs } from '../_utils/mergeRefs';
29
- import { defaultCurrencyFillDecimalScale, defaultCurrencyInputPrefix, } from './NumberInput.constants';
24
+ import { defaultCurrencyFillDecimalScale, defaultCurrencyInputPrefix } from './NumberInput.constants';
30
25
  import { useNumberFormat, usePrevious } from './NumberInput.hooks';
31
- import { addonRootFontFamily, addonRootFontSize, addonRootPadding, inputDefaultXPadding, StyledIncrementerButton, StyledIncrementerWrapper, StyledInput, StyledPrefix, StyledSuffix, StyledWrapper, } from './NumberInput.styles';
32
- import { backspaceKey, commaKey, controlKey, copyKey, defaultLocale, deleteKey, emptyString, format, getNewCursorPosition, getSeparators, highlightAllKey, identicalLocales, identifyPressedKey, maxDigitLength, metaKeyIdentifier, minus, numericKeypadKey, periodKey, prepareValueToFormatting, toFixed, unformat, } from './NumberInput.utils';
33
- function noop() { }
34
- var PlusIcon = function () { return (React.createElement("svg", { width: "8", height: "8", viewBox: "0 0 8 8", xmlns: "http://www.w3.org/2000/svg" },
35
- React.createElement("path", { d: "M4.5 0H3.5V3.5H0V4.5H3.5V8H4.5V4.5H8V3.5H4.5V0Z" }))); };
36
- var MinusIcon = function () { return (React.createElement("svg", { width: "8", height: "2", viewBox: "0 0 8 2", xmlns: "http://www.w3.org/2000/svg" },
37
- React.createElement("path", { d: "M4.5 0.5H3.5H0V1.5H3.5H4.5H8V0.5H4.5Z" }))); };
26
+ import { addonRootFontFamily, addonRootFontSize, addonRootPadding, inputDefaultXPadding, StyledIncrementerButton, StyledIncrementerWrapper, StyledInput, StyledPrefix, StyledSuffix, StyledWrapper } from './NumberInput.styles';
27
+ import { backspaceKey, commaKey, controlKey, copyKey, defaultLocale, deleteKey, emptyString, format, getNewCursorPosition, getSeparators, highlightAllKey, identicalLocales, identifyPressedKey, maxDigitLength, metaKeyIdentifier, minus, numericKeypadKey, periodKey, prepareValueToFormatting, toFixed, unformat } from './NumberInput.utils';
28
+ function noop() {}
29
+ var PlusIcon = function PlusIcon() {
30
+ return /*#__PURE__*/React.createElement("svg", {
31
+ width: "8",
32
+ height: "8",
33
+ viewBox: "0 0 8 8",
34
+ xmlns: "http://www.w3.org/2000/svg"
35
+ }, /*#__PURE__*/React.createElement("path", {
36
+ d: "M4.5 0H3.5V3.5H0V4.5H3.5V8H4.5V4.5H8V3.5H4.5V0Z"
37
+ }));
38
+ };
39
+ var MinusIcon = function MinusIcon() {
40
+ return /*#__PURE__*/React.createElement("svg", {
41
+ width: "8",
42
+ height: "2",
43
+ viewBox: "0 0 8 2",
44
+ xmlns: "http://www.w3.org/2000/svg"
45
+ }, /*#__PURE__*/React.createElement("path", {
46
+ d: "M4.5 0.5H3.5H0V1.5H3.5H4.5H8V0.5H4.5Z"
47
+ }));
48
+ };
49
+
38
50
  /**
39
51
 
40
52
  The number input allows users to add numbers to a given form or table.
@@ -49,328 +61,418 @@ var MinusIcon = function () { return (React.createElement("svg", { width: "8", h
49
61
  @see [Design Guidelines](https://design.procore.com/number-and-currency-input)
50
62
 
51
63
  */
52
- export var NumberInput = React.forwardRef(function (_a, ref) {
53
- var _b = _a.decimalScale, decimalScale = _b === void 0 ? true : _b, defaultValue = _a.defaultValue, _c = _a.disabled, disabled = _c === void 0 ? false : _c, _d = _a.error, error = _d === void 0 ? false : _d, _e = _a.fillDecimalScale, fillDecimalScale = _e === void 0 ? 'none' : _e, _locale = _a.locale, _onChange = _a.onChange, _f = _a.onKeyDown, _onKeyDown = _f === void 0 ? noop : _f, _g = _a.onBlur, _onBlur = _g === void 0 ? noop : _g, _h = _a.prefix, prefix = _h === void 0 ? emptyString : _h, readOnly = _a.readOnly, _j = _a.step, step = _j === void 0 ? 0 : _j, style = _a.style, _k = _a.suffix, suffix = _k === void 0 ? emptyString : _k, value = _a.value, qa = _a.qa, props = __rest(_a, ["decimalScale", "defaultValue", "disabled", "error", "fillDecimalScale", "locale", "onChange", "onKeyDown", "onBlur", "prefix", "readOnly", "step", "style", "suffix", "value", "qa"]);
54
- var I18n = useI18nContext();
55
- var contextLocale = _locale || I18n.locale || defaultLocale;
56
- var inputRef = React.useRef(null);
57
- var _l = useNumberFormat({
58
- decimalScale: decimalScale,
59
- fillDecimalScale: fillDecimalScale,
60
- locale: contextLocale,
61
- }), verifiedDecimalScale = _l.decimalScale, fillDecimalScaleOnBlur = _l.fillDecimalScaleOnBlur, fixedDecimalScale = _l.fixedDecimalScale, formatValue = _l.formatValue, getValueLengthInfo = _l.getValueLengthInfo, locale = _l.locale;
62
- var isControlled = value !== undefined;
63
- var isControlledWithoutOnChangeHandlerAndReadOnlyAttribute = isControlled && !_onChange && !readOnly;
64
- var hasIncrementer = step > 0 && !readOnly;
65
- var _m = React.useMemo(function () { return getSeparators(locale); }, [locale]), group = _m.group, decimal = _m.decimal;
66
- var decimalSeparatorKey = React.useMemo(function () {
67
- return decimal === periodKey ? periodKey : commaKey;
68
- }, [decimal]);
69
- var inputPadding = React.useMemo(function () {
70
- var fontContext = "".concat(addonRootFontSize, " \"").concat(addonRootFontFamily, "\"");
71
- if (prefix || suffix) {
72
- var element = document.createElement('canvas');
73
- var context = element === null || element === void 0 ? void 0 : element.getContext('2d');
74
- if (context) {
75
- context.font = fontContext;
76
- var extraBasePadding = inputDefaultXPadding + addonRootPadding;
77
- var suffixPadding_1 = extraBasePadding + Math.ceil(context.measureText(suffix).width);
78
- var getRightPadding = function () {
79
- if (hasIncrementer && suffix) {
80
- return suffixPadding_1 + spacing.xl;
81
- }
82
- if (suffix) {
83
- return suffixPadding_1;
84
- }
85
- return null;
86
- };
87
- return {
88
- left: prefix
89
- ? extraBasePadding + Math.ceil(context.measureText(prefix).width)
90
- : inputDefaultXPadding,
91
- right: getRightPadding(),
92
- };
93
- }
94
- }
95
- return {
96
- left: inputDefaultXPadding,
97
- right: null,
64
+ export var NumberInput = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
65
+ var _ref$decimalScale = _ref.decimalScale,
66
+ decimalScale = _ref$decimalScale === void 0 ? true : _ref$decimalScale,
67
+ defaultValue = _ref.defaultValue,
68
+ _ref$disabled = _ref.disabled,
69
+ disabled = _ref$disabled === void 0 ? false : _ref$disabled,
70
+ _ref$error = _ref.error,
71
+ error = _ref$error === void 0 ? false : _ref$error,
72
+ _ref$fillDecimalScale = _ref.fillDecimalScale,
73
+ fillDecimalScale = _ref$fillDecimalScale === void 0 ? 'none' : _ref$fillDecimalScale,
74
+ _locale = _ref.locale,
75
+ _onChange = _ref.onChange,
76
+ _ref$onKeyDown = _ref.onKeyDown,
77
+ _onKeyDown = _ref$onKeyDown === void 0 ? noop : _ref$onKeyDown,
78
+ _ref$onBlur = _ref.onBlur,
79
+ _onBlur = _ref$onBlur === void 0 ? noop : _ref$onBlur,
80
+ _ref$prefix = _ref.prefix,
81
+ prefix = _ref$prefix === void 0 ? emptyString : _ref$prefix,
82
+ readOnly = _ref.readOnly,
83
+ _ref$step = _ref.step,
84
+ step = _ref$step === void 0 ? 0 : _ref$step,
85
+ style = _ref.style,
86
+ _ref$suffix = _ref.suffix,
87
+ suffix = _ref$suffix === void 0 ? emptyString : _ref$suffix,
88
+ value = _ref.value,
89
+ qa = _ref.qa,
90
+ props = _objectWithoutProperties(_ref, _excluded);
91
+ var I18n = useI18nContext();
92
+ var contextLocale = _locale || I18n.locale || defaultLocale;
93
+ var inputRef = React.useRef(null);
94
+ var _useNumberFormat = useNumberFormat({
95
+ decimalScale: decimalScale,
96
+ fillDecimalScale: fillDecimalScale,
97
+ locale: contextLocale
98
+ }),
99
+ verifiedDecimalScale = _useNumberFormat.decimalScale,
100
+ fillDecimalScaleOnBlur = _useNumberFormat.fillDecimalScaleOnBlur,
101
+ fixedDecimalScale = _useNumberFormat.fixedDecimalScale,
102
+ formatValue = _useNumberFormat.formatValue,
103
+ getValueLengthInfo = _useNumberFormat.getValueLengthInfo,
104
+ locale = _useNumberFormat.locale;
105
+ var isControlled = value !== undefined;
106
+ var isControlledWithoutOnChangeHandlerAndReadOnlyAttribute = isControlled && !_onChange && !readOnly;
107
+ var hasIncrementer = step > 0 && !readOnly;
108
+ var _React$useMemo = React.useMemo(function () {
109
+ return getSeparators(locale);
110
+ }, [locale]),
111
+ group = _React$useMemo.group,
112
+ decimal = _React$useMemo.decimal;
113
+ var decimalSeparatorKey = React.useMemo(function () {
114
+ return decimal === periodKey ? periodKey : commaKey;
115
+ }, [decimal]);
116
+ var inputPadding = React.useMemo(function () {
117
+ var fontContext = "".concat(addonRootFontSize, " \"").concat(addonRootFontFamily, "\"");
118
+ if (prefix || suffix) {
119
+ var element = document.createElement('canvas');
120
+ var context = element === null || element === void 0 ? void 0 : element.getContext('2d');
121
+ if (context) {
122
+ context.font = fontContext;
123
+ var extraBasePadding = inputDefaultXPadding + addonRootPadding;
124
+ var suffixPadding = extraBasePadding + Math.ceil(context.measureText(suffix).width);
125
+ var getRightPadding = function getRightPadding() {
126
+ if (hasIncrementer && suffix) {
127
+ return suffixPadding + spacing.xl;
128
+ }
129
+ if (suffix) {
130
+ return suffixPadding;
131
+ }
132
+ return null;
98
133
  };
99
- }, [prefix, suffix, hasIncrementer]);
100
- var getValueChange = React.useCallback(function (value) {
101
- var parsedNumber = unformat(locale, value).parsedNumber;
102
134
  return {
103
- value: value,
104
- parsedNumber: isNaN(parsedNumber) ? null : parsedNumber,
135
+ left: prefix ? extraBasePadding + Math.ceil(context.measureText(prefix).width) : inputDefaultXPadding,
136
+ right: getRightPadding()
105
137
  };
106
- }, [locale]);
107
- var externalOnChange = React.useCallback(function (value) { return _onChange && _onChange(getValueChange(value)); }, [_onChange, getValueChange]);
108
- var _o = React.useState(formatValue(defaultValue)), inputValue = _o[0], setInputValue = _o[1];
109
- var _p = React.useState(isControlled ? formatValue(value) : inputValue), prevValue = _p[0], setPrevValue = _p[1];
110
- var _q = React.useState({
111
- selectionStart: 0,
112
- selectionEnd: 0,
113
- selection: emptyString,
114
- }), prevCursorPosition = _q[0], setPrevCursorPosition = _q[1];
115
- var _r = React.useState(), pressedKey = _r[0], setPressedKey = _r[1];
116
- var prevLocale = usePrevious(locale);
138
+ }
139
+ }
140
+ return {
141
+ left: inputDefaultXPadding,
142
+ right: null
143
+ };
144
+ }, [prefix, suffix, hasIncrementer]);
145
+ var getValueChange = React.useCallback(function (value) {
146
+ var _unformat = unformat(locale, value),
147
+ parsedNumber = _unformat.parsedNumber;
148
+ return {
149
+ value: value,
150
+ parsedNumber: isNaN(parsedNumber) ? null : parsedNumber
151
+ };
152
+ }, [locale]);
153
+ var externalOnChange = React.useCallback(function (value) {
154
+ return _onChange && _onChange(getValueChange(value));
155
+ }, [_onChange, getValueChange]);
156
+ var _React$useState = React.useState(formatValue(defaultValue)),
157
+ _React$useState2 = _slicedToArray(_React$useState, 2),
158
+ inputValue = _React$useState2[0],
159
+ setInputValue = _React$useState2[1];
160
+ var _React$useState3 = React.useState(isControlled ? formatValue(value) : inputValue),
161
+ _React$useState4 = _slicedToArray(_React$useState3, 2),
162
+ prevValue = _React$useState4[0],
163
+ setPrevValue = _React$useState4[1];
164
+ var _React$useState5 = React.useState({
165
+ selectionStart: 0,
166
+ selectionEnd: 0,
167
+ selection: emptyString
168
+ }),
169
+ _React$useState6 = _slicedToArray(_React$useState5, 2),
170
+ prevCursorPosition = _React$useState6[0],
171
+ setPrevCursorPosition = _React$useState6[1];
172
+ var _React$useState7 = React.useState(),
173
+ _React$useState8 = _slicedToArray(_React$useState7, 2),
174
+ pressedKey = _React$useState8[0],
175
+ setPressedKey = _React$useState8[1];
176
+ var prevLocale = usePrevious(locale);
177
+
178
+ // eslint-disable-next-line react-hooks/exhaustive-deps
179
+ React.useLayoutEffect(function () {
180
+ var formattedValue = formatValue(value);
181
+ if (isControlled && inputValue !== formattedValue) {
182
+ setInputValue(formattedValue);
183
+ }
184
+ if (isControlledWithoutOnChangeHandlerAndReadOnlyAttribute) {
185
+ console.error("Warning: Failed prop type: You provided a `value` prop to a form field without an `onChange` handler.\n This will render a read-only field. If the field should be mutable use `defaultValue`.\n Otherwise, set either `onChange` or `readOnly`.");
186
+ }
187
+ }, [value]);
188
+ React.useEffect(function () {
189
+ if (prevLocale && !identicalLocales(prevLocale, locale)) {
190
+ setInputValue(function (prev) {
191
+ var newValue = formatValue(unformat(prevLocale, prev).parsedNumber);
192
+ externalOnChange(newValue);
193
+ return newValue;
194
+ });
195
+ }
117
196
  // eslint-disable-next-line react-hooks/exhaustive-deps
118
- React.useLayoutEffect(function () {
119
- var formattedValue = formatValue(value);
120
- if (isControlled && inputValue !== formattedValue) {
121
- setInputValue(formattedValue);
122
- }
123
- if (isControlledWithoutOnChangeHandlerAndReadOnlyAttribute) {
124
- console.error("Warning: Failed prop type: You provided a `value` prop to a form field without an `onChange` handler.\n This will render a read-only field. If the field should be mutable use `defaultValue`.\n Otherwise, set either `onChange` or `readOnly`.");
125
- }
126
- }, [value]);
127
- React.useEffect(function () {
128
- if (prevLocale && !identicalLocales(prevLocale, locale)) {
129
- setInputValue(function (prev) {
130
- var newValue = formatValue(unformat(prevLocale, prev).parsedNumber);
131
- externalOnChange(newValue);
132
- return newValue;
133
- });
134
- }
135
- // eslint-disable-next-line react-hooks/exhaustive-deps
136
- }, [prevLocale, formatValue]);
137
- React.useLayoutEffect(function () {
138
- var _a;
139
- var displayValue = ((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.value) || '';
140
- if (!_onChange || !displayValue) {
141
- return;
142
- }
143
- var formattedValue = formatValue(value);
144
- if (displayValue !== formattedValue) {
145
- var lastChar = displayValue[displayValue.length - 1];
146
- var lastCharIsPending = [periodKey, commaKey].includes(lastChar);
147
- var decimals = displayValue.split(decimal)[1] || '';
148
- var lastDecimalIsZero = decimals && decimals[decimals.length - 1] === '0';
149
- // a client state and display mismatch is only valid when
150
- if (lastCharIsPending || lastDecimalIsZero) {
151
- return;
152
- }
153
- // otherwise sync display with client state
154
- setInputValue(formattedValue);
155
- }
197
+ }, [prevLocale, formatValue]);
198
+ React.useLayoutEffect(function () {
199
+ var _inputRef$current;
200
+ var displayValue = ((_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.value) || '';
201
+ if (!_onChange || !displayValue) {
202
+ return;
203
+ }
204
+ var formattedValue = formatValue(value);
205
+ if (displayValue !== formattedValue) {
206
+ var lastChar = displayValue[displayValue.length - 1];
207
+ var lastCharIsPending = [periodKey, commaKey].includes(lastChar);
208
+ var decimals = displayValue.split(decimal)[1] || '';
209
+ var lastDecimalIsZero = decimals && decimals[decimals.length - 1] === '0';
210
+
211
+ // a client state and display mismatch is only valid when
212
+ if (lastCharIsPending || lastDecimalIsZero) {
213
+ return;
214
+ }
215
+ // otherwise sync display with client state
216
+ setInputValue(formattedValue);
217
+ }
218
+ });
219
+ var getNewValueAndCursorPosition = function getNewValueAndCursorPosition(value, pressedKey) {
220
+ var preparedValue = prepareValueToFormatting(decimal, decimalSeparatorKey, group, pressedKey, prevCursorPosition, prevValue, verifiedDecimalScale, value);
221
+ var newValue = formatValue(preparedValue);
222
+ return {
223
+ newValue: newValue,
224
+ newCursorPosition: getNewCursorPosition(decimal, decimalSeparatorKey, group, newValue, pressedKey, prevCursorPosition, prevValue, value, verifiedDecimalScale, locale, fillDecimalScale)
225
+ };
226
+ };
227
+ var adjustCursor = function adjustCursor(newPosition) {
228
+ var _inputRef$current2;
229
+ (_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : _inputRef$current2.setSelectionRange(newPosition, newPosition);
230
+ // Mobile Chrome adjustment
231
+ setTimeout(function () {
232
+ var _inputRef$current3;
233
+ return (_inputRef$current3 = inputRef.current) === null || _inputRef$current3 === void 0 ? void 0 : _inputRef$current3.setSelectionRange(newPosition, newPosition);
234
+ }, 0);
235
+ };
236
+ var makeStep = function makeStep() {
237
+ var down = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
238
+ var getSignificantPrecision = function getSignificantPrecision(fraction) {
239
+ var reversedFraction = fraction.split(emptyString).reverse();
240
+ var indexOfLastSignificantFractionDigit = findIndex(function (i) {
241
+ return i !== '0';
242
+ }, reversedFraction);
243
+ return indexOfLastSignificantFractionDigit > -1 ? reversedFraction.slice(indexOfLastSignificantFractionDigit).length : 0;
244
+ };
245
+ var _unformat2 = unformat(locale, inputValue),
246
+ parsedNumber = _unformat2.parsedNumber,
247
+ fraction = _unformat2.fraction;
248
+ var _unformat3 = unformat(locale, step),
249
+ stepFraction = _unformat3.fraction;
250
+ var prevValuePrecision = fraction.length || 0;
251
+ var prevValueSignificantPrecision = getSignificantPrecision(fraction);
252
+ var rawStepPrecision = stepFraction.length || 0;
253
+ var rawStepPrecisionExceedsDecimalScale = rawStepPrecision > verifiedDecimalScale;
254
+ var stepPrecision = rawStepPrecisionExceedsDecimalScale ? verifiedDecimalScale : rawStepPrecision;
255
+ if (rawStepPrecisionExceedsDecimalScale) {
256
+ console.warn("WARNING: Step's value was rounded since its scale (".concat(rawStepPrecision, ") exceeds the decimal scale (").concat(verifiedDecimalScale, ")."));
257
+ }
258
+ var diff = toFixed(step, stepPrecision) * (down ? -1 : 1);
259
+ var precision = Math.max(stepPrecision, fixedDecimalScale ? verifiedDecimalScale : prevValuePrecision);
260
+ var significantPrecision = Math.max(prevValueSignificantPrecision, stepPrecision);
261
+ var calculated = inputValue ? ((parsedNumber || 0) + diff).toFixed(significantPrecision) : diff;
262
+ var _getValueLengthInfo = getValueLengthInfo(calculated, true),
263
+ isSafeLength = _getValueLengthInfo.isSafeLength,
264
+ isSafeIntegerLength = _getValueLengthInfo.isSafeIntegerLength;
265
+ var rejectStepByLengthLimit = !isSafeLength || !isSafeIntegerLength;
266
+ if (rejectStepByLengthLimit) {
267
+ console.warn("WARNING: Incrementer's step was not fulfilled since result oversteps input ".concat(maxDigitLength, "-digit limit and can't be presented without a loss of precision."));
268
+ return;
269
+ }
270
+ var formatted = format(locale, precision, 'always', calculated, true);
271
+ setInputValue(formatted);
272
+ externalOnChange(formatted);
273
+ };
274
+ var internalOnKeyDown = function internalOnKeyDown(e) {
275
+ var ctrlKey = e.ctrlKey,
276
+ metaKey = e.metaKey,
277
+ key = e.key,
278
+ _e$target = e.target,
279
+ value = _e$target.value,
280
+ selectionStart = _e$target.selectionStart,
281
+ selectionEnd = _e$target.selectionEnd;
282
+ var selection = value.slice(selectionStart, selectionEnd);
283
+ setPressedKey(key);
284
+ setPrevCursorPosition({
285
+ selectionStart: selectionStart,
286
+ selectionEnd: selectionEnd,
287
+ selection: selection
156
288
  });
157
- var getNewValueAndCursorPosition = function (value, pressedKey) {
158
- var preparedValue = prepareValueToFormatting(decimal, decimalSeparatorKey, group, pressedKey, prevCursorPosition, prevValue, verifiedDecimalScale, value);
159
- var newValue = formatValue(preparedValue);
160
- return {
161
- newValue: newValue,
162
- newCursorPosition: getNewCursorPosition(decimal, decimalSeparatorKey, group, newValue, pressedKey, prevCursorPosition, prevValue, value, verifiedDecimalScale, locale, fillDecimalScale),
163
- };
289
+ setPrevValue(value);
290
+ var preserveDecimalSeparator = function preserveDecimalSeparator() {
291
+ var decimalBackspaced = !selection && [backspaceKey].includes(key) && value[selectionEnd - 1] === decimal;
292
+ var decimalDeleted = !selection && [deleteKey, numericKeypadKey].includes(key) && value[selectionEnd] === decimal;
293
+ var nonReplacingKeys = [metaKeyIdentifier, controlKey, highlightAllKey, copyKey].includes(key) && (ctrlKey || metaKey);
294
+ var decimalReplacedAsSelection = selection && selection.includes(decimal) && selection.length < value.length && !nonReplacingKeys;
295
+ var preserveDecimal = decimalBackspaced || decimalDeleted || decimalReplacedAsSelection;
296
+ if (preserveDecimal) {
297
+ var base = decimalReplacedAsSelection ? selectionStart : selectionEnd;
298
+ var shift = decimalBackspaced && -1 || decimalDeleted && 1 || 0;
299
+ var cursorPosition = base + shift;
300
+ e.preventDefault();
301
+ adjustCursor(cursorPosition);
302
+ }
164
303
  };
165
- var adjustCursor = function (newPosition) {
166
- var _a;
167
- (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.setSelectionRange(newPosition, newPosition);
168
- // Mobile Chrome adjustment
169
- setTimeout(function () { var _a; return (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.setSelectionRange(newPosition, newPosition); }, 0);
304
+ var isDecimalSeparatorPreserved = function isDecimalSeparatorPreserved() {
305
+ var _getValueLengthInfo2 = getValueLengthInfo(value),
306
+ safeIntegerLength = _getValueLengthInfo2.safeIntegerLength,
307
+ integerLength = _getValueLengthInfo2.integerLength,
308
+ fractionLength = _getValueLengthInfo2.fractionLength;
309
+ var decimalSeparatorCanNotBeRemoved = safeIntegerLength - integerLength < fractionLength;
310
+ return fillDecimalScaleOnBlur && decimalSeparatorCanNotBeRemoved || fixedDecimalScale;
170
311
  };
171
- var makeStep = function (down) {
172
- if (down === void 0) { down = false; }
173
- var getSignificantPrecision = function (fraction) {
174
- var reversedFraction = fraction.split(emptyString).reverse();
175
- var indexOfLastSignificantFractionDigit = findIndex(function (i) { return i !== '0'; }, reversedFraction);
176
- return indexOfLastSignificantFractionDigit > -1
177
- ? reversedFraction.slice(indexOfLastSignificantFractionDigit).length
178
- : 0;
179
- };
180
- var _a = unformat(locale, inputValue), parsedNumber = _a.parsedNumber, fraction = _a.fraction;
181
- var stepFraction = unformat(locale, step).fraction;
182
- var prevValuePrecision = fraction.length || 0;
183
- var prevValueSignificantPrecision = getSignificantPrecision(fraction);
184
- var rawStepPrecision = stepFraction.length || 0;
185
- var rawStepPrecisionExceedsDecimalScale = rawStepPrecision > verifiedDecimalScale;
186
- var stepPrecision = rawStepPrecisionExceedsDecimalScale
187
- ? verifiedDecimalScale
188
- : rawStepPrecision;
189
- if (rawStepPrecisionExceedsDecimalScale) {
190
- console.warn("WARNING: Step's value was rounded since its scale (".concat(rawStepPrecision, ") exceeds the decimal scale (").concat(verifiedDecimalScale, ")."));
191
- }
192
- var diff = toFixed(step, stepPrecision) * (down ? -1 : 1);
193
- var precision = Math.max(stepPrecision, fixedDecimalScale ? verifiedDecimalScale : prevValuePrecision);
194
- var significantPrecision = Math.max(prevValueSignificantPrecision, stepPrecision);
195
- var calculated = inputValue
196
- ? ((parsedNumber || 0) + diff).toFixed(significantPrecision)
197
- : diff;
198
- var _b = getValueLengthInfo(calculated, true), isSafeLength = _b.isSafeLength, isSafeIntegerLength = _b.isSafeIntegerLength;
199
- var rejectStepByLengthLimit = !isSafeLength || !isSafeIntegerLength;
200
- if (rejectStepByLengthLimit) {
201
- console.warn("WARNING: Incrementer's step was not fulfilled since result oversteps input ".concat(maxDigitLength, "-digit limit and can't be presented without a loss of precision."));
202
- return;
203
- }
204
- var formatted = format(locale, precision, 'always', calculated, true);
205
- setInputValue(formatted);
206
- externalOnChange(formatted);
312
+ if (isDecimalSeparatorPreserved()) {
313
+ preserveDecimalSeparator();
314
+ }
315
+ var handleIncrementer = function handleIncrementer() {
316
+ switch (key) {
317
+ case 'ArrowUp':
318
+ case 'Up':
319
+ e.preventDefault();
320
+ makeStep();
321
+ break;
322
+ case 'ArrowDown':
323
+ case 'Down':
324
+ e.preventDefault();
325
+ makeStep(true);
326
+ break;
327
+ }
207
328
  };
208
- var internalOnKeyDown = function (e) {
209
- var ctrlKey = e.ctrlKey, metaKey = e.metaKey, key = e.key, _a = e.target, value = _a.value, selectionStart = _a.selectionStart, selectionEnd = _a.selectionEnd;
210
- var selection = value.slice(selectionStart, selectionEnd);
211
- setPressedKey(key);
212
- setPrevCursorPosition({
213
- selectionStart: selectionStart,
214
- selectionEnd: selectionEnd,
215
- selection: selection,
216
- });
217
- setPrevValue(value);
218
- var preserveDecimalSeparator = function () {
219
- var decimalBackspaced = !selection &&
220
- [backspaceKey].includes(key) &&
221
- value[selectionEnd - 1] === decimal;
222
- var decimalDeleted = !selection &&
223
- [deleteKey, numericKeypadKey].includes(key) &&
224
- value[selectionEnd] === decimal;
225
- var nonReplacingKeys = [metaKeyIdentifier, controlKey, highlightAllKey, copyKey].includes(key) &&
226
- (ctrlKey || metaKey);
227
- var decimalReplacedAsSelection = selection &&
228
- selection.includes(decimal) &&
229
- selection.length < value.length &&
230
- !nonReplacingKeys;
231
- var preserveDecimal = decimalBackspaced || decimalDeleted || decimalReplacedAsSelection;
232
- if (preserveDecimal) {
233
- var base = decimalReplacedAsSelection
234
- ? selectionStart
235
- : selectionEnd;
236
- var shift = (decimalBackspaced && -1) || (decimalDeleted && 1) || 0;
237
- var cursorPosition = base + shift;
238
- e.preventDefault();
239
- adjustCursor(cursorPosition);
240
- }
241
- };
242
- var isDecimalSeparatorPreserved = function () {
243
- var _a = getValueLengthInfo(value), safeIntegerLength = _a.safeIntegerLength, integerLength = _a.integerLength, fractionLength = _a.fractionLength;
244
- var decimalSeparatorCanNotBeRemoved = safeIntegerLength - integerLength < fractionLength;
245
- return ((fillDecimalScaleOnBlur && decimalSeparatorCanNotBeRemoved) ||
246
- fixedDecimalScale);
247
- };
248
- if (isDecimalSeparatorPreserved()) {
249
- preserveDecimalSeparator();
329
+ if (hasIncrementer) {
330
+ handleIncrementer();
331
+ }
332
+ _onKeyDown(e);
333
+ };
334
+ var internalOnChange = function internalOnChange(e) {
335
+ if (isControlledWithoutOnChangeHandlerAndReadOnlyAttribute) return;
336
+ var value = e.target.value,
337
+ inputType = e.nativeEvent.inputType;
338
+ var _getNewValueAndCursor = getNewValueAndCursorPosition(value, identifyPressedKey(decimalSeparatorKey, inputType, pressedKey, prevValue, value)),
339
+ newValue = _getNewValueAndCursor.newValue,
340
+ newCursorPosition = _getNewValueAndCursor.newCursorPosition;
341
+ // Prevent cursor flickering
342
+ e.target.value = newValue;
343
+ setInputValue(newValue);
344
+ adjustCursor(newCursorPosition);
345
+ if (newValue !== prevValue) {
346
+ externalOnChange(newValue);
347
+ }
348
+ };
349
+ var internalOnBlur = function internalOnBlur(e) {
350
+ var _unformat4 = unformat(locale, inputValue),
351
+ integer = _unformat4.integer,
352
+ fraction = _unformat4.fraction;
353
+ var shouldValueBeCleared = inputValue === minus || inputValue === decimal || inputValue === "".concat(minus).concat(decimal);
354
+ var shouldIntegerPartBeFilled = fraction.length > 0 && (integer === emptyString || integer === minus);
355
+ var isDecimalSeparatorRedundant = verifiedDecimalScale > 0 && inputValue[inputValue.length - 1] === decimal && !fillDecimalScaleOnBlur;
356
+ var isDecimalScaleNotFilled = verifiedDecimalScale - fraction.length > 0;
357
+ var shouldDecimalScaleBeFilled = fillDecimalScaleOnBlur && isDecimalScaleNotFilled;
358
+ if (shouldValueBeCleared || shouldIntegerPartBeFilled || isDecimalSeparatorRedundant || shouldDecimalScaleBeFilled) {
359
+ var getNewValue = function getNewValue() {
360
+ if (shouldValueBeCleared) {
361
+ return emptyString;
250
362
  }
251
- var handleIncrementer = function () {
252
- switch (key) {
253
- case 'ArrowUp':
254
- case 'Up':
255
- e.preventDefault();
256
- makeStep();
257
- break;
258
- case 'ArrowDown':
259
- case 'Down':
260
- e.preventDefault();
261
- makeStep(true);
262
- break;
263
- }
264
- };
265
- if (hasIncrementer) {
266
- handleIncrementer();
363
+ if (shouldIntegerPartBeFilled) {
364
+ var numberOfZerosToPad = verifiedDecimalScale - fraction.length;
365
+ return "".concat(integer, "0").concat(decimal).concat(shouldDecimalScaleBeFilled ? fraction.concat(Array.from({
366
+ length: numberOfZerosToPad
367
+ }, function (_) {
368
+ return '0';
369
+ }).join(emptyString)) : fraction);
267
370
  }
268
- _onKeyDown(e);
269
- };
270
- var internalOnChange = function (e) {
271
- if (isControlledWithoutOnChangeHandlerAndReadOnlyAttribute)
272
- return;
273
- var value = e.target.value, inputType = e.nativeEvent.inputType;
274
- var _a = getNewValueAndCursorPosition(value, identifyPressedKey(decimalSeparatorKey, inputType, pressedKey, prevValue, value)), newValue = _a.newValue, newCursorPosition = _a.newCursorPosition;
275
- // Prevent cursor flickering
276
- e.target.value = newValue;
277
- setInputValue(newValue);
278
- adjustCursor(newCursorPosition);
279
- if (newValue !== prevValue) {
280
- externalOnChange(newValue);
371
+ if (isDecimalSeparatorRedundant) {
372
+ return inputValue.replace(new RegExp("[".concat(decimal, "]"), 'g'), emptyString);
281
373
  }
282
- };
283
- var internalOnBlur = function (e) {
284
- var _a = unformat(locale, inputValue), integer = _a.integer, fraction = _a.fraction;
285
- var shouldValueBeCleared = inputValue === minus ||
286
- inputValue === decimal ||
287
- inputValue === "".concat(minus).concat(decimal);
288
- var shouldIntegerPartBeFilled = fraction.length > 0 && (integer === emptyString || integer === minus);
289
- var isDecimalSeparatorRedundant = verifiedDecimalScale > 0 &&
290
- inputValue[inputValue.length - 1] === decimal &&
291
- !fillDecimalScaleOnBlur;
292
- var isDecimalScaleNotFilled = verifiedDecimalScale - fraction.length > 0;
293
- var shouldDecimalScaleBeFilled = fillDecimalScaleOnBlur && isDecimalScaleNotFilled;
294
- if (shouldValueBeCleared ||
295
- shouldIntegerPartBeFilled ||
296
- isDecimalSeparatorRedundant ||
297
- shouldDecimalScaleBeFilled) {
298
- var getNewValue = function () {
299
- if (shouldValueBeCleared) {
300
- return emptyString;
301
- }
302
- if (shouldIntegerPartBeFilled) {
303
- var numberOfZerosToPad = verifiedDecimalScale - fraction.length;
304
- return "".concat(integer, "0").concat(decimal).concat(shouldDecimalScaleBeFilled
305
- ? fraction.concat(Array.from({ length: numberOfZerosToPad }, function (_) { return '0'; }).join(emptyString))
306
- : fraction);
307
- }
308
- if (isDecimalSeparatorRedundant) {
309
- return inputValue.replace(new RegExp("[".concat(decimal, "]"), 'g'), emptyString);
310
- }
311
- if (shouldDecimalScaleBeFilled) {
312
- return format(locale, verifiedDecimalScale, 'always', inputValue);
313
- }
314
- return inputValue;
315
- };
316
- var newValue = getNewValue();
317
- setInputValue(newValue);
318
- externalOnChange(newValue);
374
+ if (shouldDecimalScaleBeFilled) {
375
+ return format(locale, verifiedDecimalScale, 'always', inputValue);
319
376
  }
320
- _onBlur(e);
321
- };
322
- return (React.createElement(StyledWrapper, { hasIncrementer: hasIncrementer, "data-qa": qa === null || qa === void 0 ? void 0 : qa.wrapper },
323
- React.createElement(StyledInput, __assign({ value: inputValue, disabled: disabled, error: error, onKeyDown: internalOnKeyDown, onChange: internalOnChange, onBlur: internalOnBlur, inputMode: "numeric", readOnly: readOnly, style: __assign(__assign({}, style), {
324
- paddingLeft: "".concat(inputPadding.left, "px"),
325
- paddingRight: "".concat(inputPadding.right, "px"),
326
- }) }, props, { ref: mergeRefs(ref, inputRef) })),
327
- prefix && React.createElement(StyledPrefix, { disabled: disabled }, prefix),
328
- suffix && (React.createElement(StyledSuffix, { withIncrementer: hasIncrementer, disabled: disabled }, suffix)),
329
- hasIncrementer && (React.createElement(StyledIncrementerWrapper, null,
330
- React.createElement(StyledIncrementerButton, { "aria-hidden": "true", type: "button", disabled: disabled, tabIndex: -1, "data-qa": qa === null || qa === void 0 ? void 0 : qa.increment, onClick: function () { return makeStep(); } },
331
- React.createElement(PlusIcon, null)),
332
- React.createElement(StyledIncrementerButton, { "aria-hidden": "true", type: "button", disabled: disabled, tabIndex: -1, "data-qa": qa === null || qa === void 0 ? void 0 : qa.decrement, onClick: function () { return makeStep(true); } },
333
- React.createElement(MinusIcon, null))))));
377
+ return inputValue;
378
+ };
379
+ var newValue = getNewValue();
380
+ setInputValue(newValue);
381
+ externalOnChange(newValue);
382
+ }
383
+ _onBlur(e);
384
+ };
385
+ return /*#__PURE__*/React.createElement(StyledWrapper, {
386
+ hasIncrementer: hasIncrementer,
387
+ "data-qa": qa === null || qa === void 0 ? void 0 : qa.wrapper
388
+ }, /*#__PURE__*/React.createElement(StyledInput, _extends({
389
+ value: inputValue,
390
+ disabled: disabled,
391
+ error: error,
392
+ onKeyDown: internalOnKeyDown,
393
+ onChange: internalOnChange,
394
+ onBlur: internalOnBlur,
395
+ inputMode: "numeric",
396
+ readOnly: readOnly,
397
+ style: _objectSpread(_objectSpread({}, style), {
398
+ paddingLeft: "".concat(inputPadding.left, "px"),
399
+ paddingRight: "".concat(inputPadding.right, "px")
400
+ })
401
+ }, props, {
402
+ ref: mergeRefs(ref, inputRef)
403
+ })), prefix && /*#__PURE__*/React.createElement(StyledPrefix, {
404
+ disabled: disabled
405
+ }, prefix), suffix && /*#__PURE__*/React.createElement(StyledSuffix, {
406
+ withIncrementer: hasIncrementer,
407
+ disabled: disabled
408
+ }, suffix), hasIncrementer && /*#__PURE__*/React.createElement(StyledIncrementerWrapper, null, /*#__PURE__*/React.createElement(StyledIncrementerButton, {
409
+ "aria-hidden": "true",
410
+ type: "button",
411
+ disabled: disabled,
412
+ tabIndex: -1,
413
+ "data-qa": qa === null || qa === void 0 ? void 0 : qa.increment,
414
+ onClick: function onClick() {
415
+ return makeStep();
416
+ }
417
+ }, /*#__PURE__*/React.createElement(PlusIcon, null)), /*#__PURE__*/React.createElement(StyledIncrementerButton, {
418
+ "aria-hidden": "true",
419
+ type: "button",
420
+ disabled: disabled,
421
+ tabIndex: -1,
422
+ "data-qa": qa === null || qa === void 0 ? void 0 : qa.decrement,
423
+ onClick: function onClick() {
424
+ return makeStep(true);
425
+ }
426
+ }, /*#__PURE__*/React.createElement(MinusIcon, null))));
334
427
  });
335
428
  NumberInput.displayName = 'NumberInput';
336
- export var getCurrencyProps = function (locale, _decimalScale, symbol, currencyIsoCode, currencyDisplay) {
337
- var _a, _b;
338
- var currencyOptions = {
339
- locale: locale,
340
- currencyIsoCode: currencyIsoCode || 'USD',
341
- currencyDisplay: currencyDisplay || 'narrowSymbol',
342
- };
343
- var parts = formatCurrencyToParts(1, currencyOptions);
344
- var formatterDecimalScale = ((_a = parts.find(function (part) { return part.type === 'fraction'; })) === null || _a === void 0 ? void 0 : _a.value.length) || 0;
345
- var decimalScale = _decimalScale || formatterDecimalScale;
346
- var placement = parts.findIndex(function (object) {
347
- return object.type === 'currency';
348
- }) <
349
- parts.findIndex(function (part) {
350
- return part.type === 'integer';
351
- })
352
- ? 'prefix'
353
- : 'suffix';
354
- var currencyIsoSymbol = currencyIsoCode
355
- ? (_b = parts.find(function (part) { return part.type === 'currency'; })) === null || _b === void 0 ? void 0 : _b.value.toString()
356
- : undefined;
357
- var currencyProps = placement === 'prefix'
358
- ? {
359
- decimalScale: decimalScale,
360
- prefix: currencyIsoSymbol || symbol || '',
361
- }
362
- : {
363
- decimalScale: decimalScale,
364
- suffix: currencyIsoSymbol || symbol || '',
365
- };
366
- return currencyProps;
429
+ export var getCurrencyProps = function getCurrencyProps(locale, _decimalScale, symbol, currencyIsoCode, currencyDisplay) {
430
+ var _parts$find, _parts$find2;
431
+ var currencyOptions = {
432
+ locale: locale,
433
+ currencyIsoCode: currencyIsoCode || 'USD',
434
+ currencyDisplay: currencyDisplay || 'narrowSymbol'
435
+ };
436
+ var parts = formatCurrencyToParts(1, currencyOptions);
437
+ var formatterDecimalScale = ((_parts$find = parts.find(function (part) {
438
+ return part.type === 'fraction';
439
+ })) === null || _parts$find === void 0 ? void 0 : _parts$find.value.length) || 0;
440
+ var decimalScale = _decimalScale || formatterDecimalScale;
441
+ var placement = parts.findIndex(function (object) {
442
+ return object.type === 'currency';
443
+ }) < parts.findIndex(function (part) {
444
+ return part.type === 'integer';
445
+ }) ? 'prefix' : 'suffix';
446
+ var currencyIsoSymbol = currencyIsoCode ? (_parts$find2 = parts.find(function (part) {
447
+ return part.type === 'currency';
448
+ })) === null || _parts$find2 === void 0 ? void 0 : _parts$find2.value.toString() : undefined;
449
+ var currencyProps = placement === 'prefix' ? {
450
+ decimalScale: decimalScale,
451
+ prefix: currencyIsoSymbol || symbol || ''
452
+ } : {
453
+ decimalScale: decimalScale,
454
+ suffix: currencyIsoSymbol || symbol || ''
455
+ };
456
+ return currencyProps;
367
457
  };
368
- export var CurrencyInput = React.forwardRef(function (_a, ref) {
369
- var currencyDisplay = _a.currencyDisplay, currencyIsoCode = _a.currencyIsoCode, _decimalScale = _a.decimalScale, _b = _a.fillDecimalScale, fillDecimalScale = _b === void 0 ? defaultCurrencyFillDecimalScale : _b, _c = _a.prefix, prefix = _c === void 0 ? defaultCurrencyInputPrefix : _c, suffix = _a.suffix, props = __rest(_a, ["currencyDisplay", "currencyIsoCode", "decimalScale", "fillDecimalScale", "prefix", "suffix"]);
370
- var I18n = useI18nContext();
371
- var contextLocale = props.locale || I18n.locale || defaultLocale;
372
- var currencyProps = getCurrencyProps(contextLocale, _decimalScale, prefix || suffix, currencyIsoCode, currencyDisplay);
373
- return (React.createElement(NumberInput, __assign({ fillDecimalScale: fillDecimalScale }, props, currencyProps, { ref: ref })));
458
+ export var CurrencyInput = /*#__PURE__*/React.forwardRef(function (_ref2, ref) {
459
+ var currencyDisplay = _ref2.currencyDisplay,
460
+ currencyIsoCode = _ref2.currencyIsoCode,
461
+ _decimalScale = _ref2.decimalScale,
462
+ _ref2$fillDecimalScal = _ref2.fillDecimalScale,
463
+ fillDecimalScale = _ref2$fillDecimalScal === void 0 ? defaultCurrencyFillDecimalScale : _ref2$fillDecimalScal,
464
+ _ref2$prefix = _ref2.prefix,
465
+ prefix = _ref2$prefix === void 0 ? defaultCurrencyInputPrefix : _ref2$prefix,
466
+ suffix = _ref2.suffix,
467
+ props = _objectWithoutProperties(_ref2, _excluded2);
468
+ var I18n = useI18nContext();
469
+ var contextLocale = props.locale || I18n.locale || defaultLocale;
470
+ var currencyProps = getCurrencyProps(contextLocale, _decimalScale, prefix || suffix, currencyIsoCode, currencyDisplay);
471
+ return /*#__PURE__*/React.createElement(NumberInput, _extends({
472
+ fillDecimalScale: fillDecimalScale
473
+ }, props, currencyProps, {
474
+ ref: ref
475
+ }));
374
476
  });
375
477
  CurrencyInput.displayName = 'CurrencyInput';
376
478
  //# sourceMappingURL=NumberInput.js.map