@procore/core-react 12.21.2 → 12.23.0

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 (407) hide show
  1. package/CHANGELOG.md +20 -8
  2. package/dist/@types/global.d.js.map +1 -1
  3. package/dist/AnchorNavigation/AnchorNavigation.styles.d.ts +6 -5
  4. package/dist/AnchorNavigation/AnchorNavigation.styles.js +3 -3
  5. package/dist/Avatar/Avatar.styles.d.ts +7 -6
  6. package/dist/Avatar/Avatar.styles.js +5 -5
  7. package/dist/AvatarStack/AvatarStack.styles.d.ts +1677 -13
  8. package/dist/AvatarStack/AvatarStack.styles.js +7 -7
  9. package/dist/Badge/Badge.styles.d.ts +3 -2
  10. package/dist/Badge/Badge.styles.js +2 -2
  11. package/dist/BadgePill/BadgePill.d.ts +3 -0
  12. package/dist/BadgePill/BadgePill.js +25 -0
  13. package/dist/BadgePill/BadgePill.js.map +1 -0
  14. package/dist/BadgePill/BadgePill.styles.d.ts +12 -0
  15. package/dist/BadgePill/BadgePill.styles.js +33 -0
  16. package/dist/BadgePill/BadgePill.styles.js.map +1 -0
  17. package/dist/BadgePill/BadgePill.types.d.ts +50 -0
  18. package/dist/BadgePill/BadgePill.types.js +2 -0
  19. package/dist/BadgePill/BadgePill.types.js.map +1 -0
  20. package/dist/BadgePill/index.d.ts +2 -0
  21. package/dist/BadgePill/index.js +2 -0
  22. package/dist/BadgePill/index.js.map +1 -0
  23. package/dist/Banner/Banner.js +1 -1
  24. package/dist/Banner/Banner.js.map +1 -1
  25. package/dist/Banner/Banner.styles.d.ts +22 -13
  26. package/dist/Banner/Banner.styles.js +12 -12
  27. package/dist/Banner/Banner.styles.js.map +1 -1
  28. package/dist/Box/Box.js +1 -1
  29. package/dist/Box/Box.js.map +1 -1
  30. package/dist/Box/Box.styles.d.ts +2 -1
  31. package/dist/Box/Box.styles.js +3 -3
  32. package/dist/Box/Box.styles.js.map +1 -1
  33. package/dist/Box/Box.types.d.ts +1 -1
  34. package/dist/Box/Box.types.js.map +1 -1
  35. package/dist/Breadcrumbs/Breadcrumbs.styles.d.ts +5 -4
  36. package/dist/Breadcrumbs/Breadcrumbs.styles.js +4 -4
  37. package/dist/Button/Button.styles.d.ts +8 -6
  38. package/dist/Button/Button.styles.js +5 -5
  39. package/dist/Calendar/Calendar.styles.d.ts +15 -9
  40. package/dist/Calendar/Calendar.styles.js +8 -8
  41. package/dist/Card/Card.styles.d.ts +3 -2
  42. package/dist/Card/Card.styles.js +1 -1
  43. package/dist/Checkbox/Checkbox.styles.d.ts +11 -10
  44. package/dist/Checkbox/Checkbox.styles.js +6 -6
  45. package/dist/Checkbox/CheckboxTooltip.js +1 -1
  46. package/dist/ContactItem/ContactItem.js +2 -0
  47. package/dist/ContactItem/ContactItem.js.map +1 -1
  48. package/dist/ContactItem/ContactItem.styles.d.ts +18 -7
  49. package/dist/ContactItem/ContactItem.styles.js +5 -5
  50. package/dist/Content/Content.styles.d.ts +6 -2
  51. package/dist/Content/Content.styles.js +2 -2
  52. package/dist/DateInput/DateInput.js +6 -6
  53. package/dist/DateInput/DateInput.js.map +1 -1
  54. package/dist/DateInput/DateInput.styles.d.ts +20 -13
  55. package/dist/DateInput/DateInput.styles.js +21 -23
  56. package/dist/DateInput/DateInput.styles.js.map +1 -1
  57. package/dist/DateSelect/DateSelect.js +2 -2
  58. package/dist/DateSelect/DateSelect.js.map +1 -1
  59. package/dist/DetailPage/DetailPage.styles.d.ts +13 -7
  60. package/dist/DetailPage/DetailPage.styles.js +7 -7
  61. package/dist/Dropdown/Dropdown.styles.d.ts +10 -4
  62. package/dist/Dropdown/Dropdown.styles.js +3 -3
  63. package/dist/DropdownFlyout/DropdownFlyout.js +1 -1
  64. package/dist/DropdownFlyout/DropdownFlyout.js.map +1 -1
  65. package/dist/DropdownFlyout/DropdownFlyout.styles.d.ts +5 -4
  66. package/dist/DropdownFlyout/DropdownFlyout.styles.js +4 -4
  67. package/dist/DropdownFlyout/DropdownFlyout.types.d.ts +4 -1
  68. package/dist/DropdownFlyout/DropdownFlyout.types.js.map +1 -1
  69. package/dist/Dropzone/Dropzone.d.ts +3 -1
  70. package/dist/Dropzone/Dropzone.js +5 -5
  71. package/dist/Dropzone/Dropzone.js.map +1 -1
  72. package/dist/Dropzone/Dropzone.styles.d.ts +24 -16
  73. package/dist/Dropzone/Dropzone.styles.js +22 -22
  74. package/dist/Dropzone/Dropzone.styles.js.map +1 -1
  75. package/dist/EmptyState/EmptyState.js +1 -1
  76. package/dist/EmptyState/EmptyState.js.map +1 -1
  77. package/dist/EmptyState/EmptyState.styles.d.ts +8 -7
  78. package/dist/EmptyState/EmptyState.styles.js +6 -6
  79. package/dist/Field/Field.styles.d.ts +4 -3
  80. package/dist/Field/Field.styles.js +3 -3
  81. package/dist/FileList/FileList.styles.d.ts +8 -4
  82. package/dist/FileList/FileList.styles.js +4 -4
  83. package/dist/FileSelect/FileExplorer/FileExplorer.styles.d.ts +18 -10
  84. package/dist/FileSelect/FileExplorer/FileExplorer.styles.js +9 -9
  85. package/dist/FileSelect/FileExplorer/FileExplorerSidebar.styles.d.ts +5 -3
  86. package/dist/FileSelect/FileExplorer/FileExplorerSidebar.styles.js +3 -3
  87. package/dist/FileSelect/FileSelect.d.ts +3 -3
  88. package/dist/FileSelect/FileSelect.js +4 -4
  89. package/dist/FileSelect/FileSelect.js.map +1 -1
  90. package/dist/FileSelect/FileSelect.styles.d.ts +4 -2
  91. package/dist/FileSelect/FileSelect.styles.js +2 -2
  92. package/dist/FileSelect/FileSelectDropzone/FileSelectDropzone.styles.d.ts +7 -5
  93. package/dist/FileSelect/FileSelectDropzone/FileSelectDropzone.styles.js +3 -3
  94. package/dist/FileSelect/FileTokenList/FileTokenList.styles.d.ts +4 -2
  95. package/dist/FileSelect/FileTokenList/FileTokenList.styles.js +2 -2
  96. package/dist/FileSelect/GridSource/GridSource.styles.d.ts +11 -9
  97. package/dist/FileSelect/GridSource/GridSource.styles.js +6 -6
  98. package/dist/FileSelect/LocalSource/LocalSource.styles.d.ts +10 -4
  99. package/dist/FileSelect/LocalSource/LocalSource.styles.js +4 -4
  100. package/dist/FileSelect/SourceItem/SourceItem.styles.d.ts +5 -4
  101. package/dist/FileSelect/SourceItem/SourceItem.styles.js +3 -3
  102. package/dist/FileSelect/ThumbnailList/ThumbnailList.js +1 -1
  103. package/dist/FileSelect/ThumbnailList/ThumbnailList.js.map +1 -1
  104. package/dist/FileSelect/ThumbnailList/ThumbnailList.styles.d.ts +18 -8
  105. package/dist/FileSelect/ThumbnailList/ThumbnailList.styles.js +6 -6
  106. package/dist/FileSelect/TreeSource/TreeSource.styles.d.ts +2 -1
  107. package/dist/FileSelect/TreeSource/TreeSource.styles.js +1 -1
  108. package/dist/FileToken/FileToken.styles.d.ts +6 -5
  109. package/dist/FileToken/FileToken.styles.js +4 -4
  110. package/dist/FilterToken/FilterToken.styles.d.ts +8 -7
  111. package/dist/FilterToken/FilterToken.styles.js +5 -5
  112. package/dist/FlexList/FlexList.styles.d.ts +4 -2
  113. package/dist/FlexList/FlexList.styles.js +1 -1
  114. package/dist/Form/Form.d.ts +2 -1
  115. package/dist/Form/Form.js.map +1 -1
  116. package/dist/Form/Form.styles.d.ts +48 -25
  117. package/dist/Form/Form.styles.js +18 -18
  118. package/dist/Form/Form.styles.js.map +1 -1
  119. package/dist/Form/Form.types.d.ts +1 -1
  120. package/dist/Form/Form.types.js.map +1 -1
  121. package/dist/Form/StyledFormikForm.styles.d.ts +7 -3
  122. package/dist/Form/StyledFormikForm.styles.js +2 -2
  123. package/dist/GhostPlaceholder/GhostPlaceholder.styles.d.ts +5 -2
  124. package/dist/GhostPlaceholder/GhostPlaceholder.styles.js +2 -2
  125. package/dist/Grid/Grid.styles.d.ts +5 -4
  126. package/dist/Grid/Grid.styles.js +2 -2
  127. package/dist/GroupSelect/GroupSelect.js +1 -1
  128. package/dist/GroupSelect/GroupSelect.js.map +1 -1
  129. package/dist/GroupSelect/GroupSelect.styles.d.ts +4 -2
  130. package/dist/GroupSelect/GroupSelect.styles.js +1 -1
  131. package/dist/Input/Input.js +5 -1
  132. package/dist/Input/Input.js.map +1 -1
  133. package/dist/Input/Input.styles.d.ts +8 -8
  134. package/dist/Input/Input.styles.js +5 -5
  135. package/dist/Input/Input.styles.js.map +1 -1
  136. package/dist/Link/Link.js +3 -1
  137. package/dist/Link/Link.js.map +1 -1
  138. package/dist/Link/Link.styles.d.ts +4 -1
  139. package/dist/Link/Link.styles.js +4 -4
  140. package/dist/Link/Link.styles.js.map +1 -1
  141. package/dist/Link/Link.types.d.ts +1 -2
  142. package/dist/Link/Link.types.js.map +1 -1
  143. package/dist/ListPage/ListPage.styles.d.ts +9 -8
  144. package/dist/ListPage/ListPage.styles.js +8 -8
  145. package/dist/Loader/Loader.styles.d.ts +4 -3
  146. package/dist/Loader/Loader.styles.js +2 -2
  147. package/dist/Menu/Menu.js +6 -5
  148. package/dist/Menu/Menu.js.map +1 -1
  149. package/dist/MenuImperative/MenuImperative.d.ts +2 -3
  150. package/dist/MenuImperative/MenuImperative.js +8 -26
  151. package/dist/MenuImperative/MenuImperative.js.map +1 -1
  152. package/dist/MenuImperative/MenuImperative.styles.d.ts +15 -13
  153. package/dist/MenuImperative/MenuImperative.styles.js +13 -13
  154. package/dist/MenuImperative/MenuImperative.styles.js.map +1 -1
  155. package/dist/Modal/Modal.d.ts +6 -6
  156. package/dist/Modal/Modal.js +2 -2
  157. package/dist/Modal/Modal.js.map +1 -1
  158. package/dist/Modal/Modal.styles.d.ts +27 -19
  159. package/dist/Modal/Modal.styles.js +13 -13
  160. package/dist/MultiSelect/MultiSelect.js +5 -5
  161. package/dist/MultiSelect/MultiSelect.js.map +1 -1
  162. package/dist/MultiSelect/MultiSelect.styles.d.ts +19 -13
  163. package/dist/MultiSelect/MultiSelect.styles.js +6 -6
  164. package/dist/NextMenu/NextMenu.styles.d.ts +4 -3
  165. package/dist/NextMenu/NextMenu.styles.js +3 -3
  166. package/dist/Notation/Notation.js +5 -5
  167. package/dist/Notation/Notation.js.map +1 -1
  168. package/dist/NumberInput/NumberInput.hooks.d.ts +1 -1
  169. package/dist/NumberInput/NumberInput.styles.d.ts +16 -10
  170. package/dist/NumberInput/NumberInput.styles.js +7 -7
  171. package/dist/Overlay/OverlayArrow.styles.d.ts +2 -1
  172. package/dist/Overlay/OverlayArrow.styles.js +1 -1
  173. package/dist/OverlayTrigger/a11yPresets.d.ts +20 -20
  174. package/dist/PageLayout/PageLayout.styles.d.ts +33 -24
  175. package/dist/PageLayout/PageLayout.styles.js +16 -16
  176. package/dist/PageTemplate/PageFooterTemplate/PageFooterTemplate.styles.d.ts +2 -1
  177. package/dist/PageTemplate/PageFooterTemplate/PageFooterTemplate.styles.js +1 -1
  178. package/dist/PageTemplate/PageHeaderTemplate/PageHeaderTemplate.d.ts +3 -1
  179. package/dist/PageTemplate/PageHeaderTemplate/PageHeaderTemplate.js.map +1 -1
  180. package/dist/PageTemplate/PageHeaderTemplate/PageHeaderTemplate.styles.d.ts +10 -4
  181. package/dist/PageTemplate/PageHeaderTemplate/PageHeaderTemplate.styles.js +3 -3
  182. package/dist/PageTemplate/PagePaneTemplate/PagePaneTemplate.styles.d.ts +12 -8
  183. package/dist/PageTemplate/PagePaneTemplate/PagePaneTemplate.styles.js +2 -2
  184. package/dist/PageTemplate/PageTemplate/PageTemplate.styles.d.ts +5 -3
  185. package/dist/PageTemplate/PageTemplate/PageTemplate.styles.js +3 -3
  186. package/dist/Pagination/Pagination.styles.d.ts +13 -5
  187. package/dist/Pagination/Pagination.styles.js +5 -5
  188. package/dist/Panel/Panel.js +1 -1
  189. package/dist/Panel/Panel.js.map +1 -1
  190. package/dist/Panel/Panel.styles.d.ts +19 -15
  191. package/dist/Panel/Panel.styles.js +19 -19
  192. package/dist/Panel/Panel.styles.js.map +1 -1
  193. package/dist/Pill/Pill.styles.d.ts +9 -5
  194. package/dist/Pill/Pill.styles.js +2 -2
  195. package/dist/PillSelect/PillSelect.styles.d.ts +7 -5
  196. package/dist/PillSelect/PillSelect.styles.js +4 -4
  197. package/dist/Popover/Popover.styles.d.ts +3 -2
  198. package/dist/Popover/Popover.styles.js +2 -2
  199. package/dist/Portal/Portal.styles.d.ts +2 -1
  200. package/dist/Portal/Portal.styles.js +1 -1
  201. package/dist/ProgressBar/ProgressBar.styles.d.ts +3 -3
  202. package/dist/ProgressBar/ProgressBar.styles.js +2 -2
  203. package/dist/RadioButton/RadioButton.styles.d.ts +5 -4
  204. package/dist/RadioButton/RadioButton.styles.js +3 -3
  205. package/dist/Required/Required.styles.d.ts +5 -4
  206. package/dist/Required/Required.styles.js +3 -3
  207. package/dist/Search/Search.js +6 -2
  208. package/dist/Search/Search.js.map +1 -1
  209. package/dist/Search/Search.styles.d.ts +11 -12
  210. package/dist/Search/Search.styles.js +13 -7
  211. package/dist/Search/Search.styles.js.map +1 -1
  212. package/dist/Section/Section.styles.d.ts +11 -9
  213. package/dist/Section/Section.styles.js +7 -7
  214. package/dist/SegmentedController/SegmentedController.js +1 -1
  215. package/dist/SegmentedController/SegmentedController.js.map +1 -1
  216. package/dist/SegmentedController/SegmentedController.styles.d.ts +8 -7
  217. package/dist/SegmentedController/SegmentedController.styles.js +9 -9
  218. package/dist/SegmentedController/SegmentedController.styles.js.map +1 -1
  219. package/dist/Select/Select.js +4 -4
  220. package/dist/Select/Select.js.map +1 -1
  221. package/dist/Select/Select.styles.d.ts +13 -9
  222. package/dist/Select/Select.styles.js +7 -7
  223. package/dist/Semantic/Semantic.styles.d.ts +359 -20
  224. package/dist/Semantic/Semantic.styles.js +11 -12
  225. package/dist/Semantic/Semantic.styles.js.map +1 -1
  226. package/dist/Slider/Slider.styles.d.ts +9 -7
  227. package/dist/Slider/Slider.styles.js +5 -5
  228. package/dist/Spinner/Spinner.styles.d.ts +9 -8
  229. package/dist/Spinner/Spinner.styles.js +7 -7
  230. package/dist/SplitViewCard/SplitViewCard.styles.d.ts +13 -11
  231. package/dist/SplitViewCard/SplitViewCard.styles.js +8 -8
  232. package/dist/SuperSelect/SuperSelect.components.d.ts +1 -1
  233. package/dist/SuperSelect/SuperSelect.components.js.map +1 -1
  234. package/dist/SuperSelect/SuperSelect.presets.styles.d.ts +3 -1
  235. package/dist/SuperSelect/SuperSelect.presets.styles.js +1 -1
  236. package/dist/SuperSelect/SuperSelect.styles.d.ts +67 -54
  237. package/dist/SuperSelect/SuperSelect.styles.js +37 -37
  238. package/dist/SuperSelect/SuperSelect.styles.js.map +1 -1
  239. package/dist/SuperSelect/SuperSelect.types.d.ts +9 -8
  240. package/dist/SuperSelect/SuperSelect.types.js.map +1 -1
  241. package/dist/SuperSelect/presets/filterPreset.js.map +1 -1
  242. package/dist/SuperSelect/useSuperSelect.js.map +1 -1
  243. package/dist/Switch/Switch.styles.d.ts +6 -5
  244. package/dist/Switch/Switch.styles.js +4 -4
  245. package/dist/Table/Table.d.ts +7 -3
  246. package/dist/Table/Table.js.map +1 -1
  247. package/dist/Table/Table.styles.d.ts +69 -45
  248. package/dist/Table/Table.styles.js +28 -28
  249. package/dist/TableShelf/TableShelf.styles.d.ts +6 -5
  250. package/dist/TableShelf/TableShelf.styles.js +5 -5
  251. package/dist/Tabs/Tabs.styles.d.ts +31 -9
  252. package/dist/Tabs/Tabs.styles.js +15 -15
  253. package/dist/Tearsheet/Tearsheet.styles.d.ts +12 -10
  254. package/dist/Tearsheet/Tearsheet.styles.js +6 -6
  255. package/dist/Tearsheet/Tearsheet.styles.js.map +1 -1
  256. package/dist/TextArea/TextArea.js +6 -2
  257. package/dist/TextArea/TextArea.js.map +1 -1
  258. package/dist/TextArea/TextArea.styles.d.ts +7 -1
  259. package/dist/TextArea/TextArea.styles.js +2 -2
  260. package/dist/TextArea/TextArea.styles.js.map +1 -1
  261. package/dist/TextEditor/TextEditor.styles.d.ts +3 -2
  262. package/dist/TextEditorOutput/TextEditorOutput.styles.d.ts +2 -1
  263. package/dist/TextEditorOutput/TextEditorOutput.styles.js +1 -1
  264. package/dist/Thumbnail/Thumbnail.hooks.d.ts +131 -141
  265. package/dist/Thumbnail/Thumbnail.js +69 -56
  266. package/dist/Thumbnail/Thumbnail.js.map +1 -1
  267. package/dist/Thumbnail/Thumbnail.styles.d.ts +34 -32
  268. package/dist/Thumbnail/Thumbnail.styles.js +78 -79
  269. package/dist/Thumbnail/Thumbnail.styles.js.map +1 -1
  270. package/dist/Thumbnail/Thumbnail.types.d.ts +1 -1
  271. package/dist/Thumbnail/Thumbnail.types.js.map +1 -1
  272. package/dist/Thumbnail/ThumbnailCaption.js +10 -10
  273. package/dist/Thumbnail/ThumbnailCaption.js.map +1 -1
  274. package/dist/ThumbnailGrid/ThumbnailGrid.js +2 -2
  275. package/dist/ThumbnailGrid/ThumbnailGrid.js.map +1 -1
  276. package/dist/ThumbnailGrid/ThumbnailGrid.styles.d.ts +20 -8
  277. package/dist/ThumbnailGrid/ThumbnailGrid.styles.js +7 -7
  278. package/dist/TieredSelect/TierSelectionTieredSelect.js +9 -9
  279. package/dist/TieredSelect/TierSelectionTieredSelect.js.map +1 -1
  280. package/dist/TieredSelect/TieredSelect.styles.d.ts +29 -13
  281. package/dist/TieredSelect/TieredSelect.styles.js +9 -9
  282. package/dist/TieredSelect/TieredSelect.types.d.ts +1 -1
  283. package/dist/TieredSelect/TieredSelect.types.js.map +1 -1
  284. package/dist/TieredSelect/TieredSelectMenu.js +10 -10
  285. package/dist/TieredSelect/TieredSelectMenu.js.map +1 -1
  286. package/dist/Tile/Tile.js +1 -1
  287. package/dist/Tile/Tile.js.map +1 -1
  288. package/dist/Tile/Tile.styles.d.ts +13 -11
  289. package/dist/Tile/Tile.styles.js +8 -8
  290. package/dist/Title/Title.styles.d.ts +12 -8
  291. package/dist/Title/Title.styles.js +7 -7
  292. package/dist/Toast/Toast.styles.d.ts +7 -5
  293. package/dist/Toast/Toast.styles.js +3 -3
  294. package/dist/ToggleButton/ToggleButton.styles.d.ts +4 -2
  295. package/dist/ToggleButton/ToggleButton.styles.js +1 -1
  296. package/dist/Token/Token.styles.d.ts +9 -5
  297. package/dist/Token/Token.styles.js +3 -3
  298. package/dist/ToolHeader/ToolHeader.d.ts +8 -4
  299. package/dist/ToolHeader/ToolHeader.styles.d.ts +9 -7
  300. package/dist/ToolHeader/ToolHeader.styles.js +8 -8
  301. package/dist/ToolHeader/ToolHeader.styles.js.map +1 -1
  302. package/dist/ToolLandingPage/ToolLandingPage.styles.d.ts +5 -3
  303. package/dist/ToolLandingPage/ToolLandingPage.styles.js +3 -3
  304. package/dist/Tooltip/Tooltip.js +3 -4
  305. package/dist/Tooltip/Tooltip.js.map +1 -1
  306. package/dist/Tooltip/Tooltip.styles.d.ts +3 -2
  307. package/dist/Tooltip/Tooltip.styles.js +3 -3
  308. package/dist/Tooltip/Tooltip.styles.js.map +1 -1
  309. package/dist/Tree/Tree.styles.d.ts +24 -12
  310. package/dist/Tree/Tree.styles.js +9 -9
  311. package/dist/Typeahead/Typeahead.js +1 -1
  312. package/dist/Typeahead/Typeahead.js.map +1 -1
  313. package/dist/Typeahead/Typeahead.styles.d.ts +5 -7
  314. package/dist/Typeahead/Typeahead.styles.js +3 -3
  315. package/dist/Typography/Typography.styles.d.ts +5 -4
  316. package/dist/Typography/Typography.styles.js +1 -1
  317. package/dist/Typography/Typography.styles.js.map +1 -1
  318. package/dist/Typography/Typography.table.story.js +2 -2
  319. package/dist/_hooks/ClickOutside.js +19 -5
  320. package/dist/_hooks/ClickOutside.js.map +1 -1
  321. package/dist/_hooks/I18n.d.ts +44 -9
  322. package/dist/_hooks/I18n.js +63 -28
  323. package/dist/_hooks/I18n.js.map +1 -1
  324. package/dist/_styles/arrows.d.ts +4 -4
  325. package/dist/_styles/borderRadius.d.ts +1 -1
  326. package/dist/_styles/mixins.d.ts +7 -7
  327. package/dist/_styles/shadows.d.ts +1 -1
  328. package/dist/_typedoc/AnchorNavigation/AnchorNavigation.types.json +3 -3
  329. package/dist/_typedoc/Avatar/Avatar.types.json +20 -20
  330. package/dist/_typedoc/AvatarStack/AvatarStack.types.json +24 -24
  331. package/dist/_typedoc/Badge/Badge.types.json +6 -6
  332. package/dist/_typedoc/Banner/Banner.types.json +13 -13
  333. package/dist/_typedoc/Box/Box.types.json +77 -77
  334. package/dist/_typedoc/Breadcrumbs/Breadcrumbs.types.json +10 -10
  335. package/dist/_typedoc/Button/Button.types.json +13 -13
  336. package/dist/_typedoc/Calendar/Calendar.types.json +80 -80
  337. package/dist/_typedoc/Card/Card.types.json +6 -6
  338. package/dist/_typedoc/Checkbox/Checkbox.types.json +9 -9
  339. package/dist/_typedoc/ContactItem/ContactItem.types.json +9 -9
  340. package/dist/_typedoc/DateInput/DateInput.types.json +35 -35
  341. package/dist/_typedoc/DateSelect/DateSelect.types.json +13 -13
  342. package/dist/_typedoc/DetailPage/DetailPage.types.json +5 -5
  343. package/dist/_typedoc/Dropdown/Dropdown.types.json +37 -37
  344. package/dist/_typedoc/DropdownFlyout/DropdownFlyout.types.json +39 -29
  345. package/dist/_typedoc/Dropzone/Dropzone.types.json +44 -44
  346. package/dist/_typedoc/EmptyState/EmptyState.types.json +16 -16
  347. package/dist/_typedoc/FileList/FileList.types.json +9 -9
  348. package/dist/_typedoc/FileSelect/FileSelect.types.json +27 -27
  349. package/dist/_typedoc/FileSelect/GridSource/GridSource.types.json +20 -20
  350. package/dist/_typedoc/FileSelect/LocalSource/LocalSource.types.json +14 -14
  351. package/dist/_typedoc/FileSelect/TreeSource/TreeSource.types.json +9 -9
  352. package/dist/_typedoc/Flex/Flex.types.json +27 -27
  353. package/dist/_typedoc/FlexList/FlexList.types.json +30 -30
  354. package/dist/_typedoc/Form/Form.types.json +747 -747
  355. package/dist/_typedoc/GhostPlaceholder/GhostPlaceholder.types.json +12 -12
  356. package/dist/_typedoc/Grid/Grid.types.json +8 -8
  357. package/dist/_typedoc/GroupSelect/GroupSelect.types.json +52 -52
  358. package/dist/_typedoc/Input/Input.types.json +2 -2
  359. package/dist/_typedoc/Link/Link.types.json +11 -6
  360. package/dist/_typedoc/ListPage/ListPage.types.json +13 -13
  361. package/dist/_typedoc/Menu/Menu.types.json +62 -62
  362. package/dist/_typedoc/MenuImperative/MenuImperative.types.json +74 -74
  363. package/dist/_typedoc/Modal/Modal.types.json +46 -46
  364. package/dist/_typedoc/MultiSelect/MultiSelect.types.json +31 -31
  365. package/dist/_typedoc/Notation/Notation.types.json +4 -4
  366. package/dist/_typedoc/NumberInput/NumberInput.types.json +37 -37
  367. package/dist/_typedoc/OverlayTrigger/OverlayTrigger.types.json +31 -31
  368. package/dist/_typedoc/PageLayout/PageLayout.types.json +29 -29
  369. package/dist/_typedoc/Pagination/Pagination.types.json +7 -7
  370. package/dist/_typedoc/Panel/Panel.types.json +28 -28
  371. package/dist/_typedoc/Pill/Pill.types.json +2 -2
  372. package/dist/_typedoc/PillSelect/PillSelect.types.json +49 -49
  373. package/dist/_typedoc/Popover/Popover.types.json +15 -15
  374. package/dist/_typedoc/ProgressBar/ProgressBar.types.json +6 -6
  375. package/dist/_typedoc/RadioButton/RadioButton.types.json +6 -6
  376. package/dist/_typedoc/Required/Required.types.json +5 -5
  377. package/dist/_typedoc/Search/Search.types.json +18 -18
  378. package/dist/_typedoc/Section/Section.types.json +15 -15
  379. package/dist/_typedoc/SegmentedController/SegmentedController.types.json +21 -21
  380. package/dist/_typedoc/Select/Select.types.json +60 -60
  381. package/dist/_typedoc/SettingsPage/SettingsPage.types.json +10 -10
  382. package/dist/_typedoc/Slider/Slider.types.json +6 -6
  383. package/dist/_typedoc/Spinner/Spinner.types.json +9 -9
  384. package/dist/_typedoc/SplitViewCard/SplitViewCard.types.json +12 -12
  385. package/dist/_typedoc/Switch/Switch.types.json +3 -3
  386. package/dist/_typedoc/Table/Table.types.json +101 -101
  387. package/dist/_typedoc/Tabs/Tabs.types.json +20 -20
  388. package/dist/_typedoc/Tearsheet/Tearsheet.types.json +17 -17
  389. package/dist/_typedoc/TextArea/TextArea.types.json +3 -3
  390. package/dist/_typedoc/TextEditor/TextEditor.types.json +9 -9
  391. package/dist/_typedoc/TextEditorOutput/TextEditorOutput.types.json +4 -4
  392. package/dist/_typedoc/Thumbnail/Thumbnail.types.json +19 -19
  393. package/dist/_typedoc/TieredDropdown/TieredDropdown.types.json +44 -44
  394. package/dist/_typedoc/TieredSelect/TieredSelect.types.json +30 -30
  395. package/dist/_typedoc/Tile/Tile.types.json +30 -30
  396. package/dist/_typedoc/Title/Title.types.json +3 -3
  397. package/dist/_typedoc/Toast/Toast.types.json +4 -4
  398. package/dist/_typedoc/ToggleButton/ToggleButton.types.json +4 -4
  399. package/dist/_typedoc/Token/Token.types.json +6 -6
  400. package/dist/_typedoc/ToolHeader/ToolHeader.types.json +10 -10
  401. package/dist/_typedoc/ToolLandingPage/ToolLandingPage.types.json +7 -7
  402. package/dist/_typedoc/Tooltip/Tooltip.types.json +13 -13
  403. package/dist/_typedoc/Tree/Tree.types.json +86 -86
  404. package/dist/_typedoc/Typeahead/Typeahead.types.json +2 -2
  405. package/dist/_typedoc/Typography/Typography.types.json +9 -9
  406. package/dist/_typedoc/_utils/types.json +3 -3
  407. package/package.json +90 -91
@@ -1 +1 @@
1
- {"version":3,"file":"Typeahead.js","names":["Clear","Search","React","Button","useLayoutEventListener","mergeRefs","StyledIcon","StyledInput","StyledTypeahead","Typeahead","forwardRef","_ref","ref","className","disabled","onChange_","onChange","style","value","_ref$type","type","onKeyDown_","onKeyDown","props","_objectWithoutProperties","_excluded","useCallback","e","target","innerRef","useRef","dependencies","event","handler","key","stopPropagation","_objectSpread","scope","onClickClear","createElement","_extends","size","variant","icon","onClick","tabIndex"],"sources":["../../src/Typeahead/Typeahead.tsx"],"sourcesContent":["import { Clear, Search } from '@procore/core-icons/dist'\nimport React from 'react'\nimport { Button } from '../Button/Button'\nimport { useLayoutEventListener } from '../_hooks/EventListener'\nimport { mergeRefs } from '../_utils/mergeRefs'\nimport { StyledIcon, StyledInput, StyledTypeahead } from './Typeahead.styles'\nimport type { TypeaheadInputProps, TypeaheadProps } from './Typeahead.types'\n\n/**\n @since 10.19.0\n\n @see [Storybook](https://stories.core.procore.com/?path=/story/core-react_demos-typeahead--demo)\n\n */\nexport const Typeahead = React.forwardRef<\n HTMLInputElement,\n TypeaheadInputProps & TypeaheadProps\n>(function (\n {\n className,\n disabled,\n onChange: onChange_,\n style,\n value,\n type = 'search',\n onKeyDown: onKeyDown_,\n ...props\n },\n ref\n) {\n const onChange = React.useCallback(\n function onChange(e: React.ChangeEvent<HTMLInputElement>) {\n onChange_?.(e.target.value, e)\n },\n [onChange_]\n )\n\n const innerRef = React.useRef(null)\n\n useLayoutEventListener({\n dependencies: [onChange_, onKeyDown_],\n event: 'keydown',\n handler: function onKeyDown(e: React.KeyboardEvent<HTMLInputElement>) {\n if (e.key === 'Escape' || e.key === 'Esc') {\n // stop propagation once to clear input\n if ((e.target as HTMLInputElement).value) {\n e.stopPropagation()\n }\n onChange_?.('', { ...e, target: { ...e.target, value: '' } })\n }\n\n onKeyDown_?.(e)\n },\n scope: innerRef,\n })\n\n const onClickClear = React.useCallback(\n function onClickClear(e: React.MouseEvent<HTMLButtonElement>) {\n if (!disabled) {\n onChange_?.('', { ...e, target: { ...e.target, value: '' } })\n }\n },\n [disabled, onChange_]\n )\n\n return (\n <StyledTypeahead\n className={className}\n style={style}\n data-qa={props['data-qa']}\n >\n <StyledInput\n {...props}\n type={type}\n data-qa=\"core-typeahead-input\"\n ref={mergeRefs(innerRef, ref)}\n onChange={onChange}\n disabled={disabled}\n value={value}\n />\n <StyledIcon disabled={disabled}>\n {value ? (\n <Button\n aria-label=\"Clear the input\"\n data-qa=\"core-typeahead-clear-icon\"\n size=\"sm\"\n variant=\"tertiary\"\n icon={<Clear />}\n disabled={disabled}\n onClick={onClickClear}\n tabIndex={-1} // TODO revisit this accessibility\n />\n ) : (\n <Search data-qa=\"core-typeahead-search-icon\" size=\"sm\" />\n )}\n </StyledIcon>\n </StyledTypeahead>\n )\n})\n"],"mappings":";;;;;;;;;;AAAA,SAASA,KAAK,EAAEC,MAAM,QAAQ,0BAA0B;AACxD,OAAOC,KAAK,MAAM,OAAO;AAC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AAS,GAC5BI,KAAK,gBACJhB,KAAA,CAAAqC,aAAA,CAACpC,MAAM;IACL,cAAW,iBAAiB;IAC5B,WAAQ,2BAA2B;IACnCsC,IAAI,EAAC,IAAI;IACTC,OAAO,EAAC,UAAU;IAClBC,IAAI,eAAEzC,KAAA,CAAAqC,aAAA,CAACvC,KAAK,MAAE,CAAE;IAChBc,QAAQ,EAAEA,QAAS;IACnB8B,OAAO,EAAEN,YAAa;IACtBO,QAAQ,EAAE,CAAC,CAAE,CAAC;EAAA,CACf,CAAC,gBAEF3C,KAAA,CAAAqC,aAAA,CAACtC,MAAM;IAAC,WAAQ,4BAA4B;IAACwC,IAAI,EAAC;EAAI,CAAE,CAEhD,CACG,CAAC;AAEtB,CAAC,CAAC"}
1
+ {"version":3,"file":"Typeahead.js","names":["Clear","Search","React","Button","useLayoutEventListener","mergeRefs","StyledIcon","StyledInput","StyledTypeahead","Typeahead","forwardRef","_ref","ref","className","disabled","onChange_","onChange","style","value","_ref$type","type","onKeyDown_","onKeyDown","props","_objectWithoutProperties","_excluded","useCallback","e","target","innerRef","useRef","dependencies","event","handler","key","stopPropagation","_objectSpread","scope","onClickClear","createElement","_extends","size","variant","icon","onClick","tabIndex"],"sources":["../../src/Typeahead/Typeahead.tsx"],"sourcesContent":["import { Clear, Search } from '@procore/core-icons/dist'\nimport React from 'react'\nimport { Button } from '../Button'\nimport { useLayoutEventListener } from '../_hooks/EventListener'\nimport { mergeRefs } from '../_utils/mergeRefs'\nimport { StyledIcon, StyledInput, StyledTypeahead } from './Typeahead.styles'\nimport type { TypeaheadInputProps, TypeaheadProps } from './Typeahead.types'\n\n/**\n @since 10.19.0\n\n @see [Storybook](https://stories.core.procore.com/?path=/story/core-react_demos-typeahead--demo)\n\n */\nexport const Typeahead = React.forwardRef<\n HTMLInputElement,\n TypeaheadInputProps & TypeaheadProps\n>(function (\n {\n className,\n disabled,\n onChange: onChange_,\n style,\n value,\n type = 'search',\n onKeyDown: onKeyDown_,\n ...props\n },\n ref\n) {\n const onChange = React.useCallback(\n function onChange(e: React.ChangeEvent<HTMLInputElement>) {\n onChange_?.(e.target.value, e)\n },\n [onChange_]\n )\n\n const innerRef = React.useRef(null)\n\n useLayoutEventListener({\n dependencies: [onChange_, onKeyDown_],\n event: 'keydown',\n handler: function onKeyDown(e: React.KeyboardEvent<HTMLInputElement>) {\n if (e.key === 'Escape' || e.key === 'Esc') {\n // stop propagation once to clear input\n if ((e.target as HTMLInputElement).value) {\n e.stopPropagation()\n }\n onChange_?.('', { ...e, target: { ...e.target, value: '' } })\n }\n\n onKeyDown_?.(e)\n },\n scope: innerRef,\n })\n\n const onClickClear = React.useCallback(\n function onClickClear(e: React.MouseEvent<HTMLButtonElement>) {\n if (!disabled) {\n onChange_?.('', { ...e, target: { ...e.target, value: '' } })\n }\n },\n [disabled, onChange_]\n )\n\n return (\n <StyledTypeahead\n className={className}\n style={style}\n data-qa={props['data-qa']}\n >\n <StyledInput\n {...props}\n type={type}\n data-qa=\"core-typeahead-input\"\n ref={mergeRefs(innerRef, ref)}\n onChange={onChange}\n disabled={disabled}\n value={value}\n />\n <StyledIcon disabled={disabled}>\n {value ? (\n <Button\n aria-label=\"Clear the input\"\n data-qa=\"core-typeahead-clear-icon\"\n size=\"sm\"\n variant=\"tertiary\"\n icon={<Clear />}\n disabled={disabled}\n onClick={onClickClear}\n tabIndex={-1} // TODO revisit this accessibility\n />\n ) : (\n <Search data-qa=\"core-typeahead-search-icon\" size=\"sm\" />\n )}\n </StyledIcon>\n </StyledTypeahead>\n )\n})\n"],"mappings":";;;;;;;;;;AAAA,SAASA,KAAK,EAAEC,MAAM,QAAQ,0BAA0B;AACxD,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,MAAM,QAAQ,WAAW;AAClC,SAASC,sBAAsB,QAAQ,yBAAyB;AAChE,SAASC,SAAS,QAAQ,qBAAqB;AAC/C,SAASC,UAAU,EAAEC,WAAW,EAAEC,eAAe,QAAQ,oBAAoB;AAG7E;AACA;AACA;A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,CAAAqC,aAAA,CAACvC,KAAK,MAAE,CAAE;IAChBc,QAAQ,EAAEA,QAAS;IACnB8B,OAAO,EAAEN,YAAa;IACtBO,QAAQ,EAAE,CAAC,CAAE,CAAC;EAAA,CACf,CAAC,gBAEF3C,KAAA,CAAAqC,aAAA,CAACtC,MAAM;IAAC,WAAQ,4BAA4B;IAACwC,IAAI,EAAC;EAAI,CAAE,CAEhD,CACG,CAAC;AAEtB,CAAC,CAAC"}
@@ -1,8 +1,6 @@
1
- export declare const StyledInput: import("styled-components").StyledComponent<"input", any, {
2
- error?: boolean | undefined;
3
- variant?: "" | "error" | undefined;
4
- }, never>;
5
- export declare const StyledIcon: import("styled-components").StyledComponent<"div", any, {
1
+ /// <reference types="react" />
2
+ export declare const StyledInput: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, never>> & string;
3
+ export declare const StyledIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
6
4
  disabled?: boolean | undefined;
7
- }, never>;
8
- export declare const StyledTypeahead: import("styled-components").StyledComponent<"div", any, {}, never>;
5
+ }>> & string;
6
+ export declare const StyledTypeahead: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
@@ -5,11 +5,11 @@ import { spacing } from '../_styles/spacing';
5
5
  var inputHeight = 36;
6
6
  export var StyledInput = /*#__PURE__*/styled.input.withConfig({
7
7
  displayName: "StyledInput",
8
- componentId: "core-12_21_2__sc-gpc39h-0"
8
+ componentId: "core-12_23_0__sc-gpc39h-0"
9
9
  })(["", " padding-right:", "px;"], getSearchInputStyles(), spacing.xxl);
10
10
  export var StyledIcon = /*#__PURE__*/styled.div.withConfig({
11
11
  displayName: "StyledIcon",
12
- componentId: "core-12_21_2__sc-gpc39h-1"
12
+ componentId: "core-12_23_0__sc-gpc39h-1"
13
13
  })(["align-items:center;color:", ";display:flex;height:", "px;justify-content:center;pointer-events:", ";position:absolute;right:0;top:0;width:", "px;"], function (p) {
14
14
  return p.disabled ? colors.gray70 : colors.gray45;
15
15
  }, inputHeight, function (p) {
@@ -17,6 +17,6 @@ export var StyledIcon = /*#__PURE__*/styled.div.withConfig({
17
17
  }, inputHeight);
18
18
  export var StyledTypeahead = /*#__PURE__*/styled.div.withConfig({
19
19
  displayName: "StyledTypeahead",
20
- componentId: "core-12_21_2__sc-gpc39h-2"
20
+ componentId: "core-12_23_0__sc-gpc39h-2"
21
21
  })(["position:relative;width:100%;"]);
22
22
  //# sourceMappingURL=Typeahead.styles.js.map
@@ -1,4 +1,5 @@
1
- import type { FlattenSimpleInterpolation } from 'styled-components';
1
+ /// <reference types="react" />
2
+ import type { RuleSet } from 'styled-components';
2
3
  import type { Intent, TypographyProps, Weight } from './Typography.types';
3
4
  export interface StyledTypographyProps {
4
5
  $breakWord?: TypographyProps['intent'];
@@ -11,6 +12,6 @@ export declare const typographyWeights: {
11
12
  [key in Weight]: number;
12
13
  };
13
14
  export declare const typographyLineHeight: Record<Intent, number>;
14
- export declare function getTypographyIntent(intent: Intent): FlattenSimpleInterpolation;
15
- export declare const semiboldRules: () => FlattenSimpleInterpolation;
16
- export declare const StyledTypography: import("styled-components").StyledComponent<"span", any, StyledTypographyProps, never>;
15
+ export declare function getTypographyIntent(intent: Intent): RuleSet<object>;
16
+ export declare const semiboldRules: () => RuleSet<object>;
17
+ export declare const StyledTypography: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, StyledTypographyProps>> & string;
@@ -35,7 +35,7 @@ export var semiboldRules = function semiboldRules() {
35
35
  };
36
36
  export var StyledTypography = /*#__PURE__*/styled.span.withConfig({
37
37
  displayName: "StyledTypography",
38
- componentId: "core-12_21_2__sc-1c4583t-0"
38
+ componentId: "core-12_23_0__sc-1c4583t-0"
39
39
  })(["", " color:", ";font-style:", ";font-weight:", ";", " ", " em,i{font-style:italic;}"], function (_ref) {
40
40
  var _ref$$intent = _ref.$intent,
41
41
  $intent = _ref$$intent === void 0 ? 'body' : _ref$$intent;
@@ -1 +1 @@
1
- {"version":3,"file":"Typography.styles.js","names":["styled","css","colors","typographyWeights","regular","semibold","bold","typographyLineHeight","small","body","h1","h2","h3","label","typographyIntents","getTypographyIntent","intent","semiboldRules","StyledTypography","span","withConfig","displayName","componentId","_ref","_ref$$intent","$intent","_ref2","_ref2$$color","$color","_ref3","_ref3$$italic","$italic","_ref4","$weight","_ref5","$breakWord"],"sources":["../../src/Typography/Typography.styles.ts"],"sourcesContent":["import type { FlattenSimpleInterpolation } from 'styled-components'\nimport styled, { css } from 'styled-components'\nimport { colors } from '../_styles/colors'\nimport type { Intent, TypographyProps, Weight } from './Typography.types'\n\nexport interface StyledTypographyProps {\n $breakWord?: TypographyProps['intent']\n $color?: TypographyProps['color']\n $intent?: TypographyProps['intent']\n $italic?: TypographyProps['italic']\n $weight?: TypographyProps['weight']\n}\n\nexport const typographyWeights: {\n [key in Weight]: number\n} = {\n regular: 400,\n semibold: 600,\n bold: 700,\n}\n\nexport const typographyLineHeight: Record<Intent, number> = {\n small: 16,\n body: 20,\n h1: 32,\n h2: 28,\n h3: 24,\n label: 20,\n}\n\nconst body = css`\n font-family: inherit;\n font-size: 14px;\n font-weight: ${typographyWeights.regular};\n letter-spacing: 0.15px;\n line-height: ${typographyLineHeight.body}px;\n`\n\nconst h1 = css`\n font-family: inherit;\n font-size: 24px;\n font-weight: ${typographyWeights.bold};\n letter-spacing: 0.15px;\n line-height: ${typographyLineHeight.h1}px;\n`\n\nconst h2 = css`\n font-family: inherit;\n font-size: 20px;\n font-weight: ${typographyWeights.semibold};\n letter-spacing: 0.15px;\n line-height: ${typographyLineHeight.h2}px;\n`\n\nconst h3 = css`\n font-family: inherit;\n font-size: 16px;\n font-weight: ${typographyWeights.semibold};\n letter-spacing: 0.15px;\n line-height: ${typographyLineHeight.h3}px;\n`\n\nconst small = css`\n font-family: inherit;\n font-size: 12px;\n font-weight: ${typographyWeights.regular};\n letter-spacing: 0.25px;\n line-height: ${typographyLineHeight.small}px;\n`\n\nconst label = css`\n font-family: inherit;\n font-size: 14px;\n font-weight: ${typographyWeights.semibold};\n letter-spacing: 0.15px;\n line-height: ${typographyLineHeight.label}px;\n`\n\nconst typographyIntents: {\n [key in Intent]: FlattenSimpleInterpolation\n} = {\n body,\n h1,\n h2,\n h3,\n small,\n label,\n}\n\nexport function getTypographyIntent(intent: Intent) {\n return typographyIntents[intent]\n}\n\nexport const semiboldRules = () => {\n return css`\n & > strong,\n > b {\n font-weight: 600;\n }\n `\n}\n\nexport const StyledTypography = styled.span<StyledTypographyProps>`\n ${({ $intent = 'body' }) => typographyIntents[$intent]}\n color: ${({ $color = 'gray15' }) => colors[$color]};\n font-style: ${({ $italic = false }) => ($italic ? 'italic' : 'inherit')};\n font-weight: ${({ $weight }) => $weight && typographyWeights[$weight]};\n ${semiboldRules}\n ${({ $breakWord }) =>\n $breakWord &&\n `\n word-wrap: break-word;\n word-break: break-word;\n`}\n em,\n i {\n font-style: italic;\n }\n`\n"],"mappings":"AACA,OAAOA,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAC/C,SAASC,MAAM,QAAQ,mBAAmB;AAW1C,OAAO,IAAMC,iBAEZ,GAAG;EACFC,OAAO,EAAE,GAAG;EACZC,QAAQ,EAAE,GAAG;EACbC,IAAI,EAAE;AACR,CAAC;AAED,OAAO,IAAMC,oBAA4C,GAAG;EAC1DC,KAAK,EAAE,EAAE;EACTC,IAAI,EAAE,EAAE;EACRC,EAAE,EAAE,EAAE;EACNC,EAAE,EAAE,EAAE;EACNC,EAAE,EAAE,EAAE;EACNC,KAAK,EAAE;AACT,CAAC;AAED,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EAAA,IAAAC,YAAA,GAAAD,KAAA,CAAGE,MAAM;IAANA,MAAM,GAAAD,YAAA,cAAG,QAAQ,GAAAA,YAAA;EAAA,OAAOzB,MAAM,CAAC0B,MAAM,CAAC;AAAA,GACpC,UAAAC,KAAA;EAAA,IAAAC,aAAA,GAAAD,KAAA,CAAGE,OAAO;IAAPA,OAAO,GAAAD,aAAA,cAAG,KAAK,GAAAA,aAAA;EAAA,OAAQC,OAAO,GAAG,QAAQ,GAAG,SAAS;AAAA,CAAC,EACxD,UAAAC,KAAA;EAAA,IAAGC,OAAO,GAAAD,KAAA,CAAPC,OAAO;EAAA,OAAOA,OAAO,IAAI9B,iBAAiB,CAAC8B,OAAO,CAAC;AAAA,GACnEhB,aAAa,EACb,UAAAiB,KAAA;EAAA,IAAGC,UAAU,GAAAD,KAAA,CAAVC,UAAU;EAAA,OACbA,UAAU,6DAIb;AAAA,EAKA"}
1
+ {"version":3,"file":"Typography.styles.js","names":["styled","css","colors","typographyWeights","regular","semibold","bold","typographyLineHeight","small","body","h1","h2","h3","label","typographyIntents","getTypographyIntent","intent","semiboldRules","StyledTypography","span","withConfig","displayName","componentId","_ref","_ref$$intent","$intent","_ref2","_ref2$$color","$color","_ref3","_ref3$$italic","$italic","_ref4","$weight","_ref5","$breakWord"],"sources":["../../src/Typography/Typography.styles.ts"],"sourcesContent":["import type { RuleSet } from 'styled-components'\nimport styled, { css } from 'styled-components'\nimport { colors } from '../_styles/colors'\nimport type { Intent, TypographyProps, Weight } from './Typography.types'\n\nexport interface StyledTypographyProps {\n $breakWord?: TypographyProps['intent']\n $color?: TypographyProps['color']\n $intent?: TypographyProps['intent']\n $italic?: TypographyProps['italic']\n $weight?: TypographyProps['weight']\n}\n\nexport const typographyWeights: {\n [key in Weight]: number\n} = {\n regular: 400,\n semibold: 600,\n bold: 700,\n}\n\nexport const typographyLineHeight: Record<Intent, number> = {\n small: 16,\n body: 20,\n h1: 32,\n h2: 28,\n h3: 24,\n label: 20,\n}\n\nconst body = css`\n font-family: inherit;\n font-size: 14px;\n font-weight: ${typographyWeights.regular};\n letter-spacing: 0.15px;\n line-height: ${typographyLineHeight.body}px;\n`\n\nconst h1 = css`\n font-family: inherit;\n font-size: 24px;\n font-weight: ${typographyWeights.bold};\n letter-spacing: 0.15px;\n line-height: ${typographyLineHeight.h1}px;\n`\n\nconst h2 = css`\n font-family: inherit;\n font-size: 20px;\n font-weight: ${typographyWeights.semibold};\n letter-spacing: 0.15px;\n line-height: ${typographyLineHeight.h2}px;\n`\n\nconst h3 = css`\n font-family: inherit;\n font-size: 16px;\n font-weight: ${typographyWeights.semibold};\n letter-spacing: 0.15px;\n line-height: ${typographyLineHeight.h3}px;\n`\n\nconst small = css`\n font-family: inherit;\n font-size: 12px;\n font-weight: ${typographyWeights.regular};\n letter-spacing: 0.25px;\n line-height: ${typographyLineHeight.small}px;\n`\n\nconst label = css`\n font-family: inherit;\n font-size: 14px;\n font-weight: ${typographyWeights.semibold};\n letter-spacing: 0.15px;\n line-height: ${typographyLineHeight.label}px;\n`\n\nconst typographyIntents: Record<Intent, RuleSet<object>> = {\n body,\n h1,\n h2,\n h3,\n small,\n label,\n}\n\nexport function getTypographyIntent(intent: Intent) {\n return typographyIntents[intent]\n}\n\nexport const semiboldRules = () => {\n return css`\n & > strong,\n > b {\n font-weight: 600;\n }\n `\n}\n\nexport const StyledTypography = styled.span<StyledTypographyProps>`\n ${({ $intent = 'body' }) => typographyIntents[$intent]}\n color: ${({ $color = 'gray15' }) => colors[$color]};\n font-style: ${({ $italic = false }) => ($italic ? 'italic' : 'inherit')};\n font-weight: ${({ $weight }) => $weight && typographyWeights[$weight]};\n ${semiboldRules}\n ${({ $breakWord }) =>\n $breakWord &&\n `\n word-wrap: break-word;\n word-break: break-word;\n`}\n em,\n i {\n font-style: italic;\n }\n`\n"],"mappings":"AACA,OAAOA,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAC/C,SAASC,MAAM,QAAQ,mBAAmB;AAW1C,OAAO,IAAM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AAED,OAAO,IAAMiB,gBAAgB,gBAAGlB,MAAM,CAACmB,IAAI,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,4FACvC,UAAAC,IAAA;EAAA,IAAAC,YAAA,GAAAD,IAAA,CAAGE,OAAO;IAAPA,OAAO,GAAAD,YAAA,cAAG,MAAM,GAAAA,YAAA;EAAA,OAAOV,iBAAiB,CAACW,OAAO,CAAC;AAAA,GAC7C,UAAAC,KAAA;EAAA,IAAAC,YAAA,GAAAD,KAAA,CAAGE,MAAM;IAANA,MAAM,GAAAD,YAAA,cAAG,QAAQ,GAAAA,YAAA;EAAA,OAAOzB,MAAM,CAAC0B,MAAM,CAAC;AAAA,GACpC,UAAAC,KAAA;EAAA,IAAAC,aAAA,GAAAD,KAAA,CAAGE,OAAO;IAAPA,OAAO,GAAAD,aAAA,cAAG,KAAK,GAAAA,aAAA;EAAA,OAAQC,OAAO,GAAG,QAAQ,GAAG,SAAS;AAAA,CAAC,EACxD,UAAAC,KAAA;EAAA,IAAGC,OAAO,GAAAD,KAAA,CAAPC,OAAO;EAAA,OAAOA,OAAO,IAAI9B,iBAAiB,CAAC8B,OAAO,CAAC;AAAA,GACnEhB,aAAa,EACb,UAAAiB,KAAA;EAAA,IAAGC,UAAU,GAAAD,KAAA,CAAVC,UAAU;EAAA,OACbA,UAAU,6DAIb;AAAA,EAKA"}
@@ -5,11 +5,11 @@ import { colors } from '../_styles/colors';
5
5
  import { getTypographyIntent } from './Typography.styles';
6
6
  var StyledBodyCell = /*#__PURE__*/styled(Table.BodyCell).withConfig({
7
7
  displayName: "StyledBodyCell",
8
- componentId: "core-12_21_2__sc-p4v7d-0"
8
+ componentId: "core-12_23_0__sc-p4v7d-0"
9
9
  })([""]);
10
10
  var StyledTextCell = /*#__PURE__*/styled(Table.TextCell).withConfig({
11
11
  displayName: "StyledTextCell",
12
- componentId: "core-12_21_2__sc-p4v7d-1"
12
+ componentId: "core-12_23_0__sc-p4v7d-1"
13
13
  })(["", " color:", ";"], getTypographyIntent('body'), colors.blue50);
14
14
  function BodyCell() {
15
15
  return /*#__PURE__*/React.createElement(StyledBodyCell, {
@@ -1,3 +1,4 @@
1
+ import { useRef } from 'react';
1
2
  import { useEventListener } from './EventListener';
2
3
  /**
3
4
  * @deprecatedSince 9
@@ -21,12 +22,19 @@ export function useClickOutside(_ref) {
21
22
  refs = _ref$refs === void 0 ? [] : _ref$refs,
22
23
  onClickOutside = _ref.onClickOutside,
23
24
  container = _ref.container;
24
- var handler = function handler(event) {
25
- if (onClickOutside && !refs.find(function (ref) {
25
+ var mousedownTarget = useRef(null);
26
+ var handleMouseDown = function handleMouseDown(event) {
27
+ mousedownTarget.current = event.target;
28
+ };
29
+ var handleMouseUp = function handleMouseUp(event) {
30
+ // Only trigger if the mouseup target is the same as the mousedown target
31
+ // and it's outside of our refs
32
+ if (mousedownTarget.current === event.target && onClickOutside && !refs.find(function (ref) {
26
33
  return isEventSource(ref, event);
27
34
  })) {
28
35
  onClickOutside(event);
29
36
  }
37
+ mousedownTarget.current = null;
30
38
  };
31
39
  var options = {
32
40
  capture: true
@@ -34,14 +42,20 @@ export function useClickOutside(_ref) {
34
42
  var containerDocument = container === null || container === void 0 ? void 0 : container.ownerDocument;
35
43
  var scope = (containerDocument === null || containerDocument === void 0 ? void 0 : containerDocument.defaultView) || undefined;
36
44
  useEventListener({
37
- event: 'click',
38
- handler: handler,
45
+ event: 'mousedown',
46
+ handler: handleMouseDown,
47
+ options: options,
48
+ scope: scope
49
+ });
50
+ useEventListener({
51
+ event: 'mouseup',
52
+ handler: handleMouseUp,
39
53
  options: options,
40
54
  scope: scope
41
55
  });
42
56
  useEventListener({
43
57
  event: 'touchend',
44
- handler: handler,
58
+ handler: handleMouseUp,
45
59
  options: options,
46
60
  scope: scope
47
61
  });
@@ -1 +1 @@
1
- {"version":3,"file":"ClickOutside.js","names":["useEventListener","isEventSource","ref","event","current","target","HTMLElement","SVGElement","contains","useClickOutside","_ref","_ref$refs","refs","onClickOutside","container","handler","find","options","capture","containerDocument","ownerDocument","scope","defaultView","undefined"],"sources":["../../src/_hooks/ClickOutside.ts"],"sourcesContent":["import type React from 'react'\nimport type { PortalProps } from '../Portal/Portal.types'\nimport { useEventListener } from './EventListener'\n\nexport interface ClickOutsideConfig extends Pick<PortalProps, 'container'> {\n /**\n * @since 10.19.0\n */\n onClickOutside: (event: MouseEvent) => void\n /**\n * @since 10.19.0\n */\n refs: Array<React.RefObject<HTMLElement>>\n}\n\nexport interface ClickOutsideProps extends ClickOutsideConfig {\n /**\n * @since 10.19.0\n */\n children: React.ReactElement\n}\n\n/**\n * @deprecatedSince 9\n * @deprecated Never officially documented/supported\n */\n// To support MenuRef had to change to any. Could manually do <HTMLElement & MenuRef> but seems brittle\nexport function isEventSource(ref: React.RefObject<any>, event: Event) {\n if (\n ref?.current &&\n event &&\n (event.target instanceof HTMLElement || event.target instanceof SVGElement)\n ) {\n return ref.current.contains(event.target)\n } else {\n return false\n }\n}\n\n/**\n * @deprecatedSince 9\n * @deprecated Never officially documented/supported\n */\nexport function useClickOutside({\n refs = [],\n onClickOutside,\n container,\n}: ClickOutsideConfig) {\n const handler = (event: MouseEvent) => {\n if (onClickOutside && !refs.find((ref) => isEventSource(ref, event))) {\n onClickOutside(event)\n }\n }\n\n const options = { capture: true }\n\n const containerDocument = container?.ownerDocument\n const scope = containerDocument?.defaultView || undefined\n\n useEventListener({ event: 'click', handler, options, scope: scope })\n\n useEventListener({ event: 'touchend', handler, options, scope: scope })\n}\n"],"mappings":"AAEA,SAASA,gBAAgB,QAAQ,iBAAiB;AAoBlD;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,aAAaA,CAACC,GAAyB,EAAEC,KAAY,EAAE;EACrE,IACED,GAAG,aAAHA,GAAG,eAAHA,GAAG,CAAEE,OAAO,IACZD,KAAK,KACJA,KAAK,CAACE,MAAM,YAAYC,WAAW,IAAIH,KAAK,CAACE,MAAM,YAAYE,UAAU,CAAC,EAC3E;IACA,OAAOL,GAAG,CAACE,OAAO,CAACI,QAAQ,CAACL,KAAK,CAACE,MAAM,CAAC;EAC3C,CAAC,MAAM;IACL,OAAO,KAAK;EACd;AACF;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASI,eAAeA,CAAAC,IAAA,EAIR;EAAA,IAAAC,SAAA,GAAAD,IAAA,CAHrBE,IAAI;IAAJA,IAAI,GAAAD,SAAA,cAAG,EAAE,GAAAA,SAAA;IACTE,cAAc,GAAAH,IAAA,CAAdG,cAAc;IACdC,SAAS,GAAAJ,IAAA,CAATI,SAAS;EAET,IAAMC,OAAO,GAAG,SAAVA,OAAOA,CAAIZ,KAAiB,EAAK;IACrC,IAAIU,cAAc,IAAI,CAACD,IAAI,CAACI,IAAI,CAAC,UAACd,GAAG;MAAA,OAAKD,aAAa,CAACC,GAAG,EAAEC,KAAK,CAAC;IAAA,EAAC,EAAE;MACpEU,cAAc,CAACV,KAAK,CAAC;IACvB;EACF,CAAC;EAED,IAAMc,OAAO,GAAG;IAAEC,OAAO,EAAE;EAAK,CAAC;EAEjC,IAAMC,iBAAiB,GAAGL,SAAS,aAATA,SAAS,uBAATA,SAAS,CAAEM,aAAa;EAClD,IAAMC,KAAK,GAAG,CAAAF,iBAAiB,aAAjBA,iBAAiB,uBAAjBA,iBAAiB,CAAEG,WAAW,KAAIC,SAAS;EAEzDvB,gBAAgB,CAAC;IAAEG,KAAK,EAAE,OAAO;IAAEY,OAAO,EAAPA,OAAO;IAAEE,OAAO,EAAPA,OAAO;IAAEI,KAAK,EAAEA;EAAM,CAAC,CAAC;EAEpErB,gBAAgB,CAAC;IAAEG,KAAK,EAAE,UAAU;IAAEY,OAAO,EAAPA,OAAO;IAAEE,OAAO,EAAPA,OAAO;IAAEI,KAAK,EAAEA;EAAM,CAAC,CAAC;AACzE"}
1
+ {"version":3,"file":"ClickOutside.js","names":["useRef","useEventListener","isEventSource","ref","event","current","target","HTMLElement","SVGElement","contains","useClickOutside","_ref","_ref$refs","refs","onClickOutside","container","mousedownTarget","handleMouseDown","handleMouseUp","find","options","capture","containerDocument","ownerDocument","scope","defaultView","undefined","handler"],"sources":["../../src/_hooks/ClickOutside.ts"],"sourcesContent":["import type React from 'react'\nimport { useRef } from 'react'\nimport type { PortalProps } from '../Portal/Portal.types'\nimport { useEventListener } from './EventListener'\n\nexport interface ClickOutsideConfig extends Pick<PortalProps, 'container'> {\n /**\n * @since 10.19.0\n */\n onClickOutside: (event: MouseEvent) => void\n /**\n * @since 10.19.0\n */\n refs: Array<React.RefObject<HTMLElement>>\n}\n\nexport interface ClickOutsideProps extends ClickOutsideConfig {\n /**\n * @since 10.19.0\n */\n children: React.ReactElement\n}\n\n/**\n * @deprecatedSince 9\n * @deprecated Never officially documented/supported\n */\n// To support MenuRef had to change to any. Could manually do <HTMLElement & MenuRef> but seems brittle\nexport function isEventSource(ref: React.RefObject<any>, event: Event) {\n if (\n ref?.current &&\n event &&\n (event.target instanceof HTMLElement || event.target instanceof SVGElement)\n ) {\n return ref.current.contains(event.target)\n } else {\n return false\n }\n}\n\n/**\n * @deprecatedSince 9\n * @deprecated Never officially documented/supported\n */\nexport function useClickOutside({\n refs = [],\n onClickOutside,\n container,\n}: ClickOutsideConfig) {\n const mousedownTarget = useRef<EventTarget | null>(null)\n\n const handleMouseDown = (event: MouseEvent) => {\n mousedownTarget.current = event.target\n }\n\n const handleMouseUp = (event: MouseEvent) => {\n // Only trigger if the mouseup target is the same as the mousedown target\n // and it's outside of our refs\n if (\n mousedownTarget.current === event.target &&\n onClickOutside &&\n !refs.find((ref) => isEventSource(ref, event))\n ) {\n onClickOutside(event)\n }\n mousedownTarget.current = null\n }\n\n const options = { capture: true }\n const containerDocument = container?.ownerDocument\n const scope = containerDocument?.defaultView || undefined\n\n useEventListener({\n event: 'mousedown',\n handler: handleMouseDown,\n options,\n scope: scope,\n })\n\n useEventListener({\n event: 'mouseup',\n handler: handleMouseUp,\n options,\n scope: scope,\n })\n\n useEventListener({\n event: 'touchend',\n handler: handleMouseUp,\n options,\n sc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GAAG;IAAEC,OAAO,EAAE;EAAK,CAAC;EACjC,IAAMC,iBAAiB,GAAGP,SAAS,aAATA,SAAS,uBAATA,SAAS,CAAEQ,aAAa;EAClD,IAAMC,KAAK,GAAG,CAAAF,iBAAiB,aAAjBA,iBAAiB,uBAAjBA,iBAAiB,CAAEG,WAAW,KAAIC,SAAS;EAEzDzB,gBAAgB,CAAC;IACfG,KAAK,EAAE,WAAW;IAClBuB,OAAO,EAAEV,eAAe;IACxBG,OAAO,EAAPA,OAAO;IACPI,KAAK,EAAEA;EACT,CAAC,CAAC;EAEFvB,gBAAgB,CAAC;IACfG,KAAK,EAAE,SAAS;IAChBuB,OAAO,EAAET,aAAa;IACtBE,OAAO,EAAPA,OAAO;IACPI,KAAK,EAAEA;EACT,CAAC,CAAC;EAEFvB,gBAAgB,CAAC;IACfG,KAAK,EAAE,UAAU;IACjBuB,OAAO,EAAET,aAAa;IACtBE,OAAO,EAAPA,OAAO;IACPI,KAAK,EAAEA;EACT,CAAC,CAAC;AACJ"}
@@ -1,6 +1,9 @@
1
1
  import type { I18njs, I18njsConfig } from '@procore/core-i18n-js';
2
- import React from 'react';
2
+ import React, { type PropsWithChildren } from 'react';
3
3
  declare type I18nConfig = Omit<I18njsConfig, 'I18n'>;
4
+ declare type I18nWithCDNFlag = I18njs & {
5
+ enableCDN?: boolean;
6
+ };
4
7
  /**
5
8
  * @deprecated this type will no longer be supported from core-i18n-js,
6
9
  * to have a type safe Locale use TmsSupportedLocale or AllLocales from [Globalization toolkit](https://github.com/procore/globalization-toolkit)
@@ -2272,6 +2275,11 @@ export declare const coreTranslations: {
2272
2275
  emailSendErrorTitle: string;
2273
2276
  emailBodyRequiredError: string;
2274
2277
  emailContentValidationError: string;
2278
+ /**
2279
+ * @deprecated this type will no longer be supported from core-i18n-js,
2280
+ * to have a type safe Locale use TmsSupportedLocale or AllLocales from [Globalization toolkit](https://github.com/procore/globalization-toolkit)
2281
+ * @deprecatedSince 12.10.0
2282
+ */
2275
2283
  emailContentDisclaimer: string;
2276
2284
  recipientSelectPlaceholder: string;
2277
2285
  emailRecipientRequiredError: string;
@@ -4950,6 +4958,15 @@ export declare const coreTranslations: {
4950
4958
  toast: {
4951
4959
  itemAdded: string;
4952
4960
  itemAdditionFailed: string;
4961
+ /**
4962
+ * Provider to wrap the application with the I18n context.
4963
+ * @param {PropsWithChildren<UseI18n>} props - The I18n configuration.
4964
+ * @param {React.ReactNode} props.children - The children to render.
4965
+ * @param {UseI18n} props.locale - The locale to use.
4966
+ * @param {Record<string, string>} props.translations - The translations to use.
4967
+ * @param {boolean} props.enableCDN - Whether to pull core-react translations from the CDN or not, by default it follows the value passed down through the parent I18nProvider.
4968
+ * @returns {React.ReactNode} The I18n context instance.
4969
+ */
4953
4970
  itemRemoved: string;
4954
4971
  requestError: string;
4955
4972
  };
@@ -5961,11 +5978,29 @@ export declare const coreTranslations: {
5961
5978
  };
5962
5979
  };
5963
5980
  };
5964
- export declare function useI18n({ locale: _locale, translations: _translations, }: I18njsConfig): I18njs;
5965
- export declare const I18nContext: React.Context<I18njs>;
5966
- export declare function I18nProvider({ children, ...props }: I18nConfig & {
5967
- children: React.ReactNode;
5968
- }): React.JSX.Element;
5981
+ declare type UseI18n = I18nConfig & {
5982
+ enableCDN?: boolean;
5983
+ };
5984
+ /**
5985
+ * Hook to create I18n object.
5986
+ * @param {UseI18n} props - The I18n configuration.
5987
+ * @param {string} props.locale - The locale to use.
5988
+ * @param {Record<string, string>} props.translations - The translations to use.
5989
+ * @param {boolean} props.enableCDN - Whether to pull core-react translations from the CDN or not, by default it follows the value passed down through the parent I18nProvider.
5990
+ * @returns {I18nWithCDNFlag} The I18n object.
5991
+ */
5992
+ export declare function useI18n({ locale, translations: _translations, enableCDN, }: UseI18n): I18nWithCDNFlag;
5993
+ export declare const I18nContext: React.Context<I18nWithCDNFlag>;
5994
+ /**
5995
+ * Provider to wrap the application with the I18n context.
5996
+ * @param {PropsWithChildren<UseI18n>} props - The I18n configuration.
5997
+ * @param {React.ReactNode} props.children - The children to render.
5998
+ * @param {UseI18n} props.locale - The locale to use.
5999
+ * @param {Record<string, string>} props.translations - The translations to use.
6000
+ * @param {boolean} props.enableCDN - Whether to pull core-react translations from the CDN or not, by default it follows the value passed down through the parent I18nProvider.
6001
+ * @returns {React.ReactNode} The I18n context instance.
6002
+ */
6003
+ export declare function I18nProvider({ children, ...props }: PropsWithChildren<UseI18n>): React.JSX.Element;
5969
6004
  declare type DeepStringRecord = {
5970
6005
  [key: string]: string | DeepStringRecord;
5971
6006
  };
@@ -6008,10 +6043,10 @@ declare type PluralizationParams<T extends PluralizationForm> = {
6008
6043
  };
6009
6044
  declare type InterpolationOrPluralizationParams<T> = T extends PluralizationForm ? [PluralizationParams<T>] : T extends string ? InterpolationParams<T> extends never ? [ExplicitTranslateOptions?] : [InterpolationParams<T>] : [ExplicitTranslateOptions?];
6010
6045
  declare type TypedTranslate<Translations> = <P extends DotNestedKeys<Translations>>(path: P, ...args: InterpolationOrPluralizationParams<StringLiteralPathValue<Translations, P>>) => StringLiteralPathValue<Translations, P>;
6011
- declare type I18njsWithTypedTranslate<Translations> = Omit<I18njs, 't' | 'translate'> & {
6046
+ declare type I18njsWithTypedTranslate<Translations> = Omit<I18nWithCDNFlag, 't' | 'translate'> & {
6012
6047
  t: TypedTranslate<Translations>;
6013
6048
  translate: TypedTranslate<Translations>;
6014
6049
  };
6015
- export declare function useI18nContext<Translations extends DeepStringRecord | undefined = undefined>(): Translations extends undefined ? I18njs : I18njsWithTypedTranslate<NonNullable<Translations>>;
6016
- export declare function useI18nContext(): I18njs;
6050
+ export declare function useI18nContext<Translations extends DeepStringRecord | undefined = undefined>(): Translations extends undefined ? I18nWithCDNFlag : I18njsWithTypedTranslate<NonNullable<Translations>>;
6051
+ export declare function useI18nContext(): I18nWithCDNFlag;
6017
6052
  export {};
@@ -13,6 +13,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
13
13
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
14
14
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
15
15
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
16
+ import { getFallbackList, isCDNFeatureFlagEnabled, useRequestTranslations } from '@procore/cdn-translations';
16
17
  import { createI18njs } from '@procore/core-i18n-js';
17
18
  import * as R from 'ramda';
18
19
  import React from 'react';
@@ -40,7 +41,7 @@ import { OVERWRITE_LOCALE_MAP } from './getI18nProviderLocale';
40
41
  * @deprecatedSince 12.10.0
41
42
  */
42
43
 
43
- /* Set up i18n-js */
44
+ /* Set up core translations */
44
45
  export var coreTranslations = {
45
46
  'de-DE': deDE,
46
47
  en: en,
@@ -59,11 +60,6 @@ export var coreTranslations = {
59
60
  'zh-SG': zhSG,
60
61
  'pl-PL': plPL
61
62
  };
62
- function getValidLocale(_ref) {
63
- var locale = _ref.locale,
64
- translations = _ref.translations;
65
- return locale;
66
- }
67
63
  var FALLBACK_LOCALE_MAP = _objectSpread({
68
64
  'es-ES': 'es',
69
65
  'fr-FR': 'fr-CA'
@@ -74,38 +70,77 @@ function getTranslationFallbacks(locale) {
74
70
  }
75
71
  return ['en'];
76
72
  }
77
- function setTranslationFallbacks(I18n) {
78
- I18n.locales[I18n.locale] = function () {
79
- var fallbacks = getTranslationFallbacks(I18n.locale).filter(function (locale) {
80
- return locale !== I18n.locale;
81
- });
82
- return [I18n.locale].concat(_toConsumableArray(fallbacks));
83
- };
73
+ function setTranslationFallbacks(I18n, isCDNEnabled) {
74
+ if (isCDNEnabled === true) {
75
+ I18n.locales[I18n.locale] = function () {
76
+ return getFallbackList(I18n.locale);
77
+ };
78
+ } else {
79
+ I18n.locales[I18n.locale] = function () {
80
+ var fallbacks = getTranslationFallbacks(I18n.locale).filter(function (locale) {
81
+ return locale !== I18n.locale;
82
+ });
83
+ return [I18n.locale].concat(_toConsumableArray(fallbacks));
84
+ };
85
+ }
84
86
  return I18n;
85
87
  }
86
- export function useI18n(_ref2) {
87
- var _locale = _ref2.locale,
88
- _ref2$translations = _ref2.translations,
89
- _translations = _ref2$translations === void 0 ? {} : _ref2$translations;
90
- var translations = R.mergeDeepLeft(_translations, coreTranslations);
91
- var locale = getValidLocale({
92
- locale: _locale,
93
- translations: translations
88
+ /**
89
+ * Hook to create I18n object.
90
+ * @param {UseI18n} props - The I18n configuration.
91
+ * @param {string} props.locale - The locale to use.
92
+ * @param {Record<string, string>} props.translations - The translations to use.
93
+ * @param {boolean} props.enableCDN - Whether to pull core-react translations from the CDN or not, by default it follows the value passed down through the parent I18nProvider.
94
+ * @returns {I18nWithCDNFlag} The I18n object.
95
+ */
96
+ export function useI18n(_ref) {
97
+ var locale = _ref.locale,
98
+ _ref$translations = _ref.translations,
99
+ _translations = _ref$translations === void 0 ? {} : _ref$translations,
100
+ enableCDN = _ref.enableCDN;
101
+ var i18nContext = React.useContext(I18nContext);
102
+ var isCDNEnabled = isCDNFeatureFlagEnabled(i18nContext, enableCDN);
103
+ var coreCDNTranslations = useRequestTranslations({
104
+ locale: locale !== null && locale !== void 0 ? locale : 'en',
105
+ type: 'file',
106
+ absolute_file_path: function absolute_file_path(locale) {
107
+ return "core/packages/core-react/src/_locales/".concat(locale, ".json");
108
+ }
109
+ }, {
110
+ en: en,
111
+ pseudo: pseudo
112
+ }, {
113
+ oldTranslations: coreTranslations,
114
+ enableCDN: isCDNEnabled
94
115
  });
116
+ var translations = R.mergeDeepLeft(_translations, coreCDNTranslations.translations);
95
117
  var I18n = createI18njs({
96
118
  locale: locale,
97
119
  translations: translations
98
120
  });
99
- return setTranslationFallbacks(I18n);
121
+ var I18nWithFallbacks = setTranslationFallbacks(I18n, isCDNEnabled);
122
+ I18nWithFallbacks.enableCDN = isCDNEnabled;
123
+ return I18nWithFallbacks;
100
124
  }
101
125
  export var I18nContext = /*#__PURE__*/React.createContext(createI18njs({
102
126
  locale: 'en',
103
- translations: coreTranslations // inject our translations
127
+ translations: {
128
+ en: coreTranslations.en
129
+ }
104
130
  }));
105
131
 
106
- export function I18nProvider(_ref3) {
107
- var children = _ref3.children,
108
- props = _objectWithoutProperties(_ref3, _excluded);
132
+ /**
133
+ * Provider to wrap the application with the I18n context.
134
+ * @param {PropsWithChildren<UseI18n>} props - The I18n configuration.
135
+ * @param {React.ReactNode} props.children - The children to render.
136
+ * @param {UseI18n} props.locale - The locale to use.
137
+ * @param {Record<string, string>} props.translations - The translations to use.
138
+ * @param {boolean} props.enableCDN - Whether to pull core-react translations from the CDN or not, by default it follows the value passed down through the parent I18nProvider.
139
+ * @returns {React.ReactNode} The I18n context instance.
140
+ */
141
+ export function I18nProvider(_ref2) {
142
+ var children = _ref2.children,
143
+ props = _objectWithoutProperties(_ref2, _excluded);
109
144
  return /*#__PURE__*/React.createElement(I18nContext.Provider, {
110
145
  value: useI18n(props)
111
146
  }, children);
@@ -131,9 +166,9 @@ export function I18nProvider(_ref3) {
131
166
  * @template Translations - An optional generic to provide type safety for translations.
132
167
  * If specified, it enables typed access to the `t` and `translate` methods of the I18n instance.
133
168
  * These methods will have type safe access to both the tranlsation scope as well as the interpolation variables.
134
- * If not specified, the default I18njs instance is returned.
169
+ * If not specified, the default I18nWithCDN instance is returned.
135
170
  *
136
- * @returns {I18njs | I18njsWithTypedTranslate<Translations>} The I18n context instance,
171
+ * @returns {I18nWithCDNFlag | I18njsWithTypedTranslate<Translations>} The I18n context instance,
137
172
  * either with or without typed translations based on the provided generic.
138
173
  */
139
174
  export function useI18nContext() {
@@ -1 +1 @@
1
- {"version":3,"file":"I18n.js","names":["createI18njs","R","React","deDE","enAU","enCA","enGB","en","esES","es","frCA","frFR","isIS","jaJP","plPL","pseudo","ptBR","thTH","zhSG","OVERWRITE_LOCALE_MAP","coreTranslations","getValidLocale","_ref","locale","translations","FALLBACK_LOCALE_MAP","_objectSpread","getTranslationFallbacks","setTranslationFallbacks","I18n","locales","fallbacks","filter","concat","_toConsumableArray","useI18n","_ref2","_locale","_ref2$translations","_translations","mergeDeepLeft","I18nContext","createContext","I18nProvider","_ref3","children","props","_objectWithoutProperties","_excluded","createElement","Provider","value","useI18nContext","ctx","useContext"],"sources":["../../src/_hooks/I18n.tsx"],"sourcesContent":["import type { I18njs, I18njsConfig } from '@procore/core-i18n-js'\nimport { createI18njs } from '@procore/core-i18n-js'\nimport * as R from 'ramda'\nimport React from 'react'\nimport deDE from '../_locales/de-DE.json'\nimport enAU from '../_locales/en-AU.json'\nimport enCA from '../_locales/en-CA.json'\nimport enGB from '../_locales/en-GB.json'\nimport en from '../_locales/en.json'\nimport esES from '../_locales/es-ES.json'\nimport es from '../_locales/es.json'\nimport frCA from '../_locales/fr-CA.json'\nimport frFR from '../_locales/fr-FR.json'\nimport isIS from '../_locales/is-IS.json'\nimport jaJP from '../_locales/ja-JP.json'\nimport plPL from '../_locales/pl-PL.json'\nimport pseudo from '../_locales/pseudo.json'\nimport ptBR from '../_locales/pt-BR.json'\nimport thTH from '../_locales/th-TH.json'\nimport zhSG from '../_locales/zh-SG.json'\nimport { OVERWRITE_LOCALE_MAP } from './getI18nProviderLocale'\n\ntype I18nConfig = Omit<I18njsConfig, 'I18n'>\n\n/**\n * @deprecated this type will no longer be supported from core-i18n-js,\n * to have a type safe Locale use TmsSupportedLocale or AllLocales from [Globalization toolkit](https://github.com/procore/globalization-toolkit)\n * @deprecatedSince 12.10.0\n */\nexport type Locale =\n | 'de-DE'\n | 'en-AE'\n | 'en-AU'\n | 'en-CA'\n | 'en-GB'\n | 'en-SG'\n | 'en'\n | 'es-ES'\n | 'es'\n | 'fr-CA'\n | 'fr-FR'\n | 'is-IS'\n | 'ja-JP'\n | 'pt-BR'\n | 'th-TH'\n | 'zh-SG'\n | 'pseudo'\n | 'pl-PL'\n\n/* Set up i18n-js */\nexport const coreTranslations = {\n 'de-DE': deDE,\n en,\n 'en-AU': enAU,\n 'en-CA': enCA,\n 'en-GB': enGB,\n es,\n 'es-ES': esES,\n 'fr-CA': frCA,\n 'fr-FR': frFR,\n 'is-IS': isIS,\n 'ja-JP': jaJP,\n pseudo,\n 'pt-BR': ptBR,\n 'th-TH': thTH,\n 'zh-SG': zhSG,\n 'pl-PL': plPL,\n} as const\n\nfunction getValidLocale({ locale, translations }: I18njsConfig) {\n return locale\n}\n\nconst FALLBACK_LOCALE_MAP: Record<string, Locale> = {\n 'es-ES': 'es',\n 'fr-FR': 'fr-CA',\n ...OVERWRITE_LOCALE_MAP,\n}\n\nfunction getTranslationFallbacks(locale: string): Locale[] {\n if (FALLBACK_LOCALE_MAP[locale]) {\n return [FALLBACK_LOCALE_MAP[locale], 'en']\n }\n\n return ['en']\n}\n\nfunction setTranslationFallbacks(I18n: I18njs) {\n I18n.locales[I18n.locale] = function () {\n const fallbacks = getTranslationFallbacks(I18n.locale).filter(\n (locale) => locale !== I18n.locale\n )\n return [I18n.locale, ...fallbacks]\n }\n\n return I18n\n}\n\nexport function useI18n({\n locale: _locale,\n translations: _translations = {},\n}: I18njsConfig): I18njs {\n const translations = R.mergeDeepLeft(_translations, coreTranslations)\n const locale = getValidLocale({ locale: _locale, translations })\n const I18n = createI18njs({\n locale,\n translations,\n })\n return setTranslationFallbacks(I18n)\n}\n\nexport const I18nContext: React.Context<I18njs> = React.createContext(\n createI18njs({\n locale: 'en',\n translations: coreTranslations, // inject our translations\n })\n)\n\nexport function I18nProvider({\n children,\n ...props\n}: I18nConfig & { children: React.ReactNode }) {\n return (\n <I18nContext.Provider value={useI18n(props)}>\n {children}\n </I18nContext.Provider>\n )\n}\n\n// Base type of user provider translations type\ntype DeepStringRecord = {\n [key: string]: string | DeepStringRecord\n}\n\ntype PluralizationForm = {\n zero?: string\n one: string\n other: string\n}\n\n// Type to get nested key paths with dot notation\ntype DotPrefix<T extends string> = T extends '' ? '' : `.${T}`\ntype DotNestedKeys<T> = (\n T extends string\n ? ''\n : T extends DeepStringRecord\n ? {\n [K in keyof T]: K extends string\n ? T[K] extends PluralizationForm\n ? `${K}`\n : T[K] extends DeepStringRecord\n ? `${K}${DotPrefix<DotNestedKeys<T[K]>>}`\n : `${K}`\n : never\n }[keyof T]\n : ''\n) extends infer D\n ? Extract<D, string>\n : never\n\n// Type to get the literal string type from a path\ntype StringLiteralPathValue<\n T,\n P extends string\n> = P extends `${infer K}.${infer Rest}`\n ? K extends keyof T\n ? T[K] extends PluralizationForm\n ? T[K]\n : T[K] extends DeepStringRecord\n ? StringLiteralPathValue<T[K], Rest>\n : never\n : never\n : P extends keyof T\n ? T[P] extends PluralizationForm\n ? T[P]\n : T[P] extends string\n ? T[P]\n : never\n : never\n\n// Check if a string has any interpolation variables\ntype HasInterpolation<T extends string> =\n T extends `${string}%{${string}}${string}` ? true : false\n\n// Extract interpolation variables from a string\ntype ExtractInterpolationVars<T extends string> =\n T extends `${infer _Before}%{${infer Param}}${infer After}`\n ? Param | ExtractInterpolationVars<After>\n : never\n\n// always allowed values in the interpolation object (remove [key: string]: any in favor of our strong types)\ntype ExplicitTranslateOptions = {\n [K in keyof I18n.TranslateOptions as string extends K\n ? never\n : K]: I18n.TranslateOptions[K]\n}\n\ntype InterpolationParams<T extends string> = HasInterpolation<T> extends true\n ? {\n [K in ExtractInterpolationVars<T>]: string\n } & {\n [K in keyof ExplicitTranslateOptions]?: ExplicitTranslateOptions[K]\n }\n : never\n\ntype PluralizationParams<T extends PluralizationForm> = {\n count: number\n} & (\n | (T['zero'] extends string\n ? { count: 0 } & { [K in ExtractInterpolationVars<T['zero']>]: string }\n : {})\n | (T['one'] extends string\n ? { count: 1 } & { [K in ExtractInterpolationVars<T['one']>]: string }\n : {})\n | (T['other'] extends string\n ? { count: number } & {\n [K in ExtractInterpolationVars<T['other']>]: string\n }\n : {})\n) & {\n [K in keyof ExplicitTranslateOptions]?: ExplicitTranslateOptions[K]\n }\n\ntype InterpolationOrPluralizationParams<T> = T extends PluralizationForm\n ? [PluralizationParams<T>]\n : T extends string\n ? InterpolationParams<T> extends never\n ? [ExplicitTranslateOptions?]\n : [InterpolationParams<T>]\n : [ExplicitTranslateOptions?]\n\ntype TypedTranslate<Translations> = <P extends DotNestedKeys<Translations>>(\n path: P,\n ...args: InterpolationOrPluralizationParams<\n StringLiteralPathValue<Translations, P>\n >\n) => StringLiteralPathValue<Translations, P>\n\ntype I18njsWithTypedTranslate<Translations> = Omit<\n I18njs,\n 't' | 'translate'\n> & {\n t: TypedTranslate<Translations>\n translate: TypedTranslate<Translations>\n}\n\nexport function useI18nContext<\n Translations extends DeepStringRecord | undefined = undefined\n>(): Translations extends undefined\n ? I18njs\n : I18njsWithTypedTranslate<NonNullable<Translations>>\n// overload for when no generic is provided\nexport function useI18nContext(): I18njs\n\n/**\n * Hook to access the I18n context.\n *\n * @template Translations - An optional generic to provide type safety for translations.\n * If specified, it enables typed access to the `t` and `translate` methods of the I18n instance.\n * These methods will have type safe access to both the tranlsation scope as well as the interpolation variables.\n * If not specified, the default I18njs instance is returned.\n *\n * @returns {I18njs | I18njsWithTypedTranslate<Translations>} The I18n context instance,\n * either with or without typed translations based on the provided generic.\n */\nexport function useI18nContext<\n Translations extends DeepStringRecord | undefined = undefined\n>() {\n const ctx = React.useContext(I18nContext)\n\n if (!ctx) {\n // TODO investigate a way to do warnings that won't annoy people\n // we probably need to introduce a build system to have nice dev warnings\n // console.warn()\n }\n\n // Cast to typing if user has provided a type\n return ctx as Translations extends undefined\n ? I18njs\n : I18njsWithTypedTranslate<NonNullable<Translations>>\n}\n"],"mappings":";;;;;;;;;;;;;;;AACA,SAASA,YAAY,QAAQ,uBAAuB;AACpD,OAAO,KAAKC,CAAC,MAAM,OAAO;AAC1B,OAAOC,KAAK,MAAM,OAAO;AACzB,OAAOC,IAAI,MAAM,wBAAwB;AACzC,OAAOC,IAAI,MAAM,wBAAwB;AACz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ACH,CAAC;;AAED,OAAO,SAASuB,YAAYA,CAAAC,KAAA,EAGmB;EAAA,IAF7CC,QAAQ,GAAAD,KAAA,CAARC,QAAQ;IACLC,KAAK,GAAAC,wBAAA,CAAAH,KAAA,EAAAI,SAAA;EAER,oBACE9C,KAAA,CAAA+C,aAAA,CAACR,WAAW,CAACS,QAAQ;IAACC,KAAK,EAAEhB,OAAO,CAACW,KAAK;EAAE,GACzCD,QACmB,CAAC;AAE3B;;AAEA;;AAWA;;AAoBA;;AAoBA;;AAIA;;AAMA;;AA6DA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASO,cAAcA,CAAA,EAE1B;EACF,IAAMC,GAAG,GAAGnD,KAAK,CAACoD,UAAU,CAACb,WAAW,CAAC;EAEzC,IAAI,CAACY,GAAG,EAAE;IACR;IACA;IACA;EAAA;;EAGF;EACA,OAAOA,GAAG;AAGZ"}
1
+ {"version":3,"file":"I18n.js","names":["getFallbackList","isCDNFeatureFlagEnabled","useRequestTranslations","createI18njs","R","React","deDE","enAU","enCA","enGB","en","esES","es","frCA","frFR","isIS","jaJP","plPL","pseudo","ptBR","thTH","zhSG","OVERWRITE_LOCALE_MAP","coreTranslations","FALLBACK_LOCALE_MAP","_objectSpread","getTranslationFallbacks","locale","setTranslationFallbacks","I18n","isCDNEnabled","locales","fallbacks","filter","concat","_toConsumableArray","useI18n","_ref","_ref$translations","translations","_translations","enableCDN","i18nContext","useContext","I18nContext","coreCDNTranslations","type","absolute_file_path","oldTranslations","mergeDeepLeft","I18nWithFallbacks","createContext","I18nProvider","_ref2","children","props","_objectWithoutProperties","_excluded","createElement","Provider","value","useI18nContext","ctx"],"sources":["../../src/_hooks/I18n.tsx"],"sourcesContent":["import {\n getFallbackList,\n isCDNFeatureFlagEnabled,\n useRequestTranslations,\n} from '@procore/cdn-translations'\nimport type { I18njs, I18njsConfig } from '@procore/core-i18n-js'\nimport { createI18njs } from '@procore/core-i18n-js'\nimport * as R from 'ramda'\nimport React, { type PropsWithChildren } from 'react'\nimport deDE from '../_locales/de-DE.json'\nimport enAU from '../_locales/en-AU.json'\nimport enCA from '../_locales/en-CA.json'\nimport enGB from '../_locales/en-GB.json'\nimport en from '../_locales/en.json'\nimport esES from '../_locales/es-ES.json'\nimport es from '../_locales/es.json'\nimport frCA from '../_locales/fr-CA.json'\nimport frFR from '../_locales/fr-FR.json'\nimport isIS from '../_locales/is-IS.json'\nimport jaJP from '../_locales/ja-JP.json'\nimport plPL from '../_locales/pl-PL.json'\nimport pseudo from '../_locales/pseudo.json'\nimport ptBR from '../_locales/pt-BR.json'\nimport thTH from '../_locales/th-TH.json'\nimport zhSG from '../_locales/zh-SG.json'\nimport { OVERWRITE_LOCALE_MAP } from './getI18nProviderLocale'\n\ntype I18nConfig = Omit<I18njsConfig, 'I18n'>\n\ntype I18nWithCDNFlag = I18njs & {\n enableCDN?: boolean\n}\n\n/**\n * @deprecated this type will no longer be supported from core-i18n-js,\n * to have a type safe Locale use TmsSupportedLocale or AllLocales from [Globalization toolkit](https://github.com/procore/globalization-toolkit)\n * @deprecatedSince 12.10.0\n */\nexport type Locale =\n | 'de-DE'\n | 'en-AE'\n | 'en-AU'\n | 'en-CA'\n | 'en-GB'\n | 'en-SG'\n | 'en'\n | 'es-ES'\n | 'es'\n | 'fr-CA'\n | 'fr-FR'\n | 'is-IS'\n | 'ja-JP'\n | 'pt-BR'\n | 'th-TH'\n | 'zh-SG'\n | 'pseudo'\n | 'pl-PL'\n\n/* Set up core translations */\nexport const coreTranslations = {\n 'de-DE': deDE,\n en,\n 'en-AU': enAU,\n 'en-CA': enCA,\n 'en-GB': enGB,\n es,\n 'es-ES': esES,\n 'fr-CA': frCA,\n 'fr-FR': frFR,\n 'is-IS': isIS,\n 'ja-JP': jaJP,\n pseudo,\n 'pt-BR': ptBR,\n 'th-TH': thTH,\n 'zh-SG': zhSG,\n 'pl-PL': plPL,\n} as const\n\nconst FALLBACK_LOCALE_MAP: Record<string, Locale> = {\n 'es-ES': 'es',\n 'fr-FR': 'fr-CA',\n ...OVERWRITE_LOCALE_MAP,\n}\n\nfunction getTranslationFallbacks(locale: string): Locale[] {\n if (FALLBACK_LOCALE_MAP[locale]) {\n return [FALLBACK_LOCALE_MAP[locale], 'en']\n }\n\n return ['en']\n}\n\nfunction setTranslationFallbacks(\n I18n: I18nWithCDNFlag,\n isCDNEnabled: boolean | undefined\n) {\n if (isCDNEnabled === true) {\n I18n.locales[I18n.locale] = function () {\n return getFallbackList(I18n.locale)\n }\n } else {\n I18n.locales[I18n.locale] = function () {\n const fallbacks = getTranslationFallbacks(I18n.locale).filter(\n (locale) => locale !== I18n.locale\n )\n return [I18n.locale, ...fallbacks]\n }\n }\n\n return I18n\n}\n\ntype UseI18n = I18nConfig & {\n enableCDN?: boolean\n}\n\n/**\n * Hook to create I18n object.\n * @param {UseI18n} props - The I18n configuration.\n * @param {string} props.locale - The locale to use.\n * @param {Record<string, string>} props.translations - The translations to use.\n * @param {boolean} props.enableCDN - Whether to pull core-react translations from the CDN or not, by default it follows the value passed down through the parent I18nProvider.\n * @returns {I18nWithCDNFlag} The I18n object.\n */\nexport function useI18n({\n locale,\n translations: _translations = {},\n enableCDN,\n}: UseI18n): I18nWithCDNFlag {\n const i18nContext: I18nWithCDNFlag | undefined = React.useContext(I18nContext)\n\n const isCDNEnabled = isCDNFeatureFlagEnabled(i18nContext, enableCDN)\n\n const coreCDNTranslations = useRequestTranslations(\n {\n locale: locale ?? 'en',\n type: 'file',\n absolute_file_path: (locale) =>\n `core/packages/core-react/src/_locales/${locale}.json`,\n },\n { en, pseudo },\n {\n oldTranslations: coreTranslations,\n enableCDN: isCDNEnabled,\n }\n )\n\n const translations = R.mergeDeepLeft(\n _translations,\n coreCDNTranslations.translations\n )\n\n const I18n = createI18njs({\n locale,\n translations,\n })\n\n const I18nWithFallbacks = setTranslationFallbacks(I18n, isCDNEnabled)\n\n I18nWithFallbacks.enableCDN = isCDNEnabled\n\n return I18nWithFallbacks\n}\n\nexport const I18nContext: React.Context<I18nWithCDNFlag> = React.createContext(\n createI18njs({\n locale: 'en',\n translations: { en: coreTranslations.en },\n })\n)\n\n/**\n * Provider to wrap the application with the I18n context.\n * @param {PropsWithChildren<UseI18n>} props - The I18n configuration.\n * @param {React.ReactNode} props.children - The children to render.\n * @param {UseI18n} props.locale - The locale to use.\n * @param {Record<string, string>} props.translations - The translations to use.\n * @param {boolean} props.enableCDN - Whether to pull core-react translations from the CDN or not, by default it follows the value passed down through the parent I18nProvider.\n * @returns {React.ReactNode} The I18n context instance.\n */\nexport function I18nProvider({\n children,\n ...props\n}: PropsWithChildren<UseI18n>) {\n return (\n <I18nContext.Provider value={useI18n(props)}>\n {children}\n </I18nContext.Provider>\n )\n}\n\n// Base type of user provider translations type\ntype DeepStringRecord = {\n [key: string]: string | DeepStringRecord\n}\n\ntype PluralizationForm = {\n zero?: string\n one: string\n other: string\n}\n\n// Type to get nested key paths with dot notation\ntype DotPrefix<T extends string> = T extends '' ? '' : `.${T}`\ntype DotNestedKeys<T> = (\n T extends string\n ? ''\n : T extends DeepStringRecord\n ? {\n [K in keyof T]: K extends string\n ? T[K] extends PluralizationForm\n ? `${K}`\n : T[K] extends DeepStringRecord\n ? `${K}${DotPrefix<DotNestedKeys<T[K]>>}`\n : `${K}`\n : never\n }[keyof T]\n : ''\n) extends infer D\n ? Extract<D, string>\n : never\n\n// Type to get the literal string type from a path\ntype StringLiteralPathValue<\n T,\n P extends string\n> = P extends `${infer K}.${infer Rest}`\n ? K extends keyof T\n ? T[K] extends PluralizationForm\n ? T[K]\n : T[K] extends DeepStringRecord\n ? StringLiteralPathValue<T[K], Rest>\n : never\n : never\n : P extends keyof T\n ? T[P] extends PluralizationForm\n ? T[P]\n : T[P] extends string\n ? T[P]\n : never\n : never\n\n// Check if a string has any interpolation variables\ntype HasInterpolation<T extends string> =\n T extends `${string}%{${string}}${string}` ? true : false\n\n// Extract interpolation variables from a string\ntype ExtractInterpolationVars<T extends string> =\n T extends `${infer _Before}%{${infer Param}}${infer After}`\n ? Param | ExtractInterpolationVars<After>\n : never\n\n// always allowed values in the interpolation object (remove [key: string]: any in favor of our strong types)\ntype ExplicitTranslateOptions = {\n [K in keyof I18n.TranslateOptions as string extends K\n ? never\n : K]: I18n.TranslateOptions[K]\n}\n\ntype InterpolationParams<T extends string> = HasInterpolation<T> extends true\n ? {\n [K in ExtractInterpolationVars<T>]: string\n } & {\n [K in keyof ExplicitTranslateOptions]?: ExplicitTranslateOptions[K]\n }\n : never\n\ntype PluralizationParams<T extends PluralizationForm> = {\n count: number\n} & (\n | (T['zero'] extends string\n ? { count: 0 } & { [K in ExtractInterpolationVars<T['zero']>]: string }\n : {})\n | (T['one'] extends string\n ? { count: 1 } & { [K in ExtractInterpolationVars<T['one']>]: string }\n : {})\n | (T['other'] extends string\n ? { count: number } & {\n [K in ExtractInterpolationVars<T['other']>]: string\n }\n : {})\n) & {\n [K in keyof ExplicitTranslateOptions]?: ExplicitTranslateOptions[K]\n }\n\ntype InterpolationOrPluralizationParams<T> = T extends PluralizationForm\n ? [PluralizationParams<T>]\n : T extends string\n ? InterpolationParams<T> extends never\n ? [ExplicitTranslateOptions?]\n : [InterpolationParams<T>]\n : [ExplicitTranslateOptions?]\n\ntype TypedTranslate<Translations> = <P extends DotNestedKeys<Translations>>(\n path: P,\n ...args: InterpolationOrPluralizationParams<\n StringLiteralPathValue<Translations, P>\n >\n) => StringLiteralPathValue<Translations, P>\n\ntype I18njsWithTypedTranslate<Translations> = Omit<\n I18nWithCDNFlag,\n 't' | 'translate'\n> & {\n t: TypedTranslate<Translations>\n translate: TypedTranslate<Translations>\n}\n\nexport function useI18nContext<\n Translations extends DeepStringRecord | undefined = undefined\n>(): Translations extends undefined\n ? I18nWithCDNFlag\n : I18njsWithTypedTranslate<NonNullable<Translations>>\n// overload for when no generic is provided\nexport function useI18nContext(): I18nWithCDNFlag\n\n/**\n * Hook to access the I18n context.\n *\n * @template Translations - An optional generic to provide type safety for translations.\n * If specified, it enables typed access to the `t` and `translate` methods of the I18n instance.\n * These methods will have type safe access to both the tranlsation scope as well as the interpolation variables.\n * If not specified, the default I18nWithCDN instance is returned.\n *\n * @returns {I18nWithCDNFlag | I18njsWithTypedTranslate<Translations>} The I18n context instance,\n * either with or without typed translations based on the provided generic.\n */\nexport function useI18nContext<\n Translations extends DeepStringRecord | undefined = undefined\n>() {\n const ctx = React.useContext(I18nContext)\n\n if (!ctx) {\n // TODO investigate a way to do warnings that won't annoy people\n // we probably need to introduce a build system to have nice dev warnings\n // console.warn()\n }\n\n // Cast to typing if user has provided a type\n return ctx as Translations extends undefined\n ? I18nWithCDNFlag\n : I18njsWithTypedTranslate<NonNullable<Translations>>\n}\n"],"mappings":";;;;;;;;;;;;;;;AAAA,SACEA,eAAe,EACfC,uBAAuB,EACvBC,sBAAsB,QACjB,2BAA2B;AAElC,SAASC,YAAY,QAAQ,uBAAuB;AACpD,OAAO,KAAKC,CAAC,MAAM,OAAO;AAC1B,OAAOC,KAAK,MAAkC,OAAO;AACrD,OAAOC,IAAI,MAAM,wBAAwB;AACzC,OAAOC,IAAI,MAAM,wBAAwB;AACzC,OAAOC,IAAI,MAAM,wBAAwB;AACzC,OAAOC,IAAI,MAAM,wBAAwB;AACzC,OAAOC,EAAE,MAAM,qBAAqB;AACpC,OAAOC,IAAI,MAAM,wBAAwB;AACzC,OAAOC,EAAE,MAAM,qBAAqB;AACpC,OAAOC,IAAI,MAAM,wBAAwB;AACzC,OAAOC,IAAI,MAAM,wBAAwB;AACzC,OAAOC,IAAI,MAAM,wBAAwB;AACzC,OAAOC,IAAI,MAAM,wBAAwB;AACzC,OAAOC,IAAI,MAAM,wBAAwB;AACzC,OAAOC,MAAM,MAAM,yBAAyB;AAC5C,OAAOC,IAAI,MAAM,wBAAwB;AACzC,OAAOC,IAAI,MAAM,wBAAwB;AACzC,OAAOC,IAAI,MAAM,wBAAwB;AACzC,SAASC,oBAAoB,QAAQ,yBAAyB;;AAQ9D;AACA;AAC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BAAGvC,KAAK,CAAC8C,aAAa,CAC5EhD,YAAY,CAAC;EACXwB,MAAM,EAAE,IAAI;EACZY,YAAY,EAAE;IAAE7B,EAAE,EAAEa,gBAAgB,CAACb;EAAG;AAC1C,CAAC,CACH,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAAS0C,YAAYA,CAAAC,KAAA,EAGG;EAAA,IAF7BC,QAAQ,GAAAD,KAAA,CAARC,QAAQ;IACLC,KAAK,GAAAC,wBAAA,CAAAH,KAAA,EAAAI,SAAA;EAER,oBACEpD,KAAA,CAAAqD,aAAA,CAACd,WAAW,CAACe,QAAQ;IAACC,KAAK,EAAExB,OAAO,CAACmB,KAAK;EAAE,GACzCD,QACmB,CAAC;AAE3B;;AAEA;;AAWA;;AAoBA;;AAoBA;;AAIA;;AAMA;;AA6DA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASO,cAAcA,CAAA,EAE1B;EACF,IAAMC,GAAG,GAAGzD,KAAK,CAACsC,UAAU,CAACC,WAAW,CAAC;EAEzC,IAAI,CAACkB,GAAG,EAAE;IACR;IACA;IACA;EAAA;;EAGF;EACA,OAAOA,GAAG;AAGZ"}
@@ -1,5 +1,5 @@
1
1
  import type { Color } from './colors';
2
- export declare function arrowUp(size: number, color: Color): import("styled-components").FlattenSimpleInterpolation;
3
- export declare function arrowDown(size: number, color: Color): import("styled-components").FlattenSimpleInterpolation;
4
- export declare function arrowRight(size: number, color: Color): import("styled-components").FlattenSimpleInterpolation;
5
- export declare function arrowLeft(size: number, color: Color): import("styled-components").FlattenSimpleInterpolation;
2
+ export declare function arrowUp(size: number, color: Color): import("styled-components").RuleSet<object>;
3
+ export declare function arrowDown(size: number, color: Color): import("styled-components").RuleSet<object>;
4
+ export declare function arrowRight(size: number, color: Color): import("styled-components").RuleSet<object>;
5
+ export declare function arrowLeft(size: number, color: Color): import("styled-components").RuleSet<object>;
@@ -4,5 +4,5 @@ export declare const borderRadius: {
4
4
  md: number;
5
5
  lg: number;
6
6
  };
7
- export declare function getBorderRadius(size: BorderRadiusSize): import("styled-components").FlattenSimpleInterpolation;
7
+ export declare function getBorderRadius(size: BorderRadiusSize): import("styled-components").RuleSet<object>;
8
8
  export {};
@@ -3,15 +3,15 @@ export declare const focusBlue: string;
3
3
  /**
4
4
  * Using box-shadow only, will not change size with a border.
5
5
  */
6
- export declare const focusable: import("styled-components").FlattenSimpleInterpolation;
7
- export declare function getGapOutlineFocus(): import("styled-components").FlattenSimpleInterpolation;
8
- export declare const defaultTransition: import("styled-components").FlattenSimpleInterpolation;
9
- export declare function getEllipsis(): import("styled-components").FlattenSimpleInterpolation;
6
+ export declare const focusable: import("styled-components").RuleSet<object>;
7
+ export declare function getGapOutlineFocus(): import("styled-components").RuleSet<object>;
8
+ export declare const defaultTransition: import("styled-components").RuleSet<object>;
9
+ export declare function getEllipsis(): import("styled-components").RuleSet<object>;
10
10
  /**
11
11
  * `border` is used instead of `outline` intentionally - as `outline` can't handle `border-radius`
12
12
  * (rounded elements will still have square outline)
13
13
  */
14
- export declare function getFocus(): import("styled-components").FlattenSimpleInterpolation;
15
- export declare function getLineClamp(lines?: number): import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<{
14
+ export declare function getFocus(): import("styled-components").RuleSet<object>;
15
+ export declare function getLineClamp(lines?: number): import("styled-components").RuleSet<{
16
16
  intent?: Intent | undefined;
17
- }, any>>;
17
+ }>;
@@ -1,2 +1,2 @@
1
1
  import type { Placement } from '../_utils/placement';
2
- export declare function getShadow(strength?: number, placement?: Placement): import("styled-components").FlattenSimpleInterpolation;
2
+ export declare function getShadow(strength?: number, placement?: Placement): import("styled-components").RuleSet<object>;
@@ -10,7 +10,7 @@
10
10
  "description": "An array of sections used in the anchor navigation.",
11
11
  "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>An array of sections used in the anchor navigation.</p>\n</div><dl class=\"tsd-comment-tags\"><dt>since</dt><dd><p>12.18.0</p>\n</dd></dl></div>",
12
12
  "sourceFile": "packages/core-react/src/AnchorNavigation/AnchorNavigation.types.tsx",
13
- "sourceUrl": "https://github.com/procore/core/blob/17b58ed/packages/core-react/src/AnchorNavigation/AnchorNavigation.types.tsx#L15"
13
+ "sourceUrl": "https://github.com/procore/core/blob/80fa986/packages/core-react/src/AnchorNavigation/AnchorNavigation.types.tsx#L15"
14
14
  },
15
15
  {
16
16
  "name": "selected",
@@ -20,7 +20,7 @@
20
20
  "description": "The ID of the currently selected section.",
21
21
  "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>The ID of the currently selected section.</p>\n</div><dl class=\"tsd-comment-tags\"><dt>since</dt><dd><p>12.18.0</p>\n</dd></dl></div>",
22
22
  "sourceFile": "packages/core-react/src/AnchorNavigation/AnchorNavigation.types.tsx",
23
- "sourceUrl": "https://github.com/procore/core/blob/17b58ed/packages/core-react/src/AnchorNavigation/AnchorNavigation.types.tsx#L20"
23
+ "sourceUrl": "https://github.com/procore/core/blob/80fa986/packages/core-react/src/AnchorNavigation/AnchorNavigation.types.tsx#L20"
24
24
  },
25
25
  {
26
26
  "name": "onSelect",
@@ -30,7 +30,7 @@
30
30
  "description": "Callback function to update the selected section ID.",
31
31
  "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Callback function to update the selected section ID.</p>\n</div><dl class=\"tsd-comment-tags\"><dt>since</dt><dd><p>12.18.0</p>\n</dd></dl></div>",
32
32
  "sourceFile": "packages/core-react/src/AnchorNavigation/AnchorNavigation.types.tsx",
33
- "sourceUrl": "https://github.com/procore/core/blob/17b58ed/packages/core-react/src/AnchorNavigation/AnchorNavigation.types.tsx#L25"
33
+ "sourceUrl": "https://github.com/procore/core/blob/80fa986/packages/core-react/src/AnchorNavigation/AnchorNavigation.types.tsx#L25"
34
34
  }
35
35
  ],
36
36
  "description": ""