@procore/core-react 12.14.0 → 12.16.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 (314) hide show
  1. package/dist/AnchorNavigation/AnchorNavigation.styles.js +3 -3
  2. package/dist/Avatar/Avatar.styles.js +5 -5
  3. package/dist/AvatarStack/AvatarStack.styles.js +7 -7
  4. package/dist/Badge/Badge.styles.js +2 -2
  5. package/dist/Banner/Banner.js +3 -3
  6. package/dist/Banner/Banner.js.map +1 -1
  7. package/dist/Banner/Banner.styles.d.ts +3 -3
  8. package/dist/Banner/Banner.styles.js +16 -16
  9. package/dist/Banner/Banner.styles.js.map +1 -1
  10. package/dist/Box/Box.styles.js +1 -1
  11. package/dist/Breadcrumbs/Breadcrumbs.js +5 -2
  12. package/dist/Breadcrumbs/Breadcrumbs.js.map +1 -1
  13. package/dist/Breadcrumbs/Breadcrumbs.styles.js +4 -4
  14. package/dist/Button/Button.styles.js +5 -5
  15. package/dist/Calendar/Calendar.styles.js +8 -8
  16. package/dist/Card/Card.styles.js +1 -1
  17. package/dist/Checkbox/Checkbox.styles.js +6 -6
  18. package/dist/Checkbox/CheckboxTooltip.js +1 -1
  19. package/dist/ContactItem/ContactItem.styles.js +5 -5
  20. package/dist/Content/Content.styles.js +2 -2
  21. package/dist/DateInput/DateInput.js +1 -1
  22. package/dist/DateInput/DateInput.js.map +1 -1
  23. package/dist/DateInput/DateInput.styles.d.ts +1 -1
  24. package/dist/DateInput/DateInput.styles.js +6 -6
  25. package/dist/DateInput/DateInput.styles.js.map +1 -1
  26. package/dist/DetailPage/DetailPage.styles.js +7 -7
  27. package/dist/DetailPageTemplate/DetailPageTemplate.d.ts +11 -0
  28. package/dist/DetailPageTemplate/DetailPageTemplate.js +38 -0
  29. package/dist/DetailPageTemplate/DetailPageTemplate.js.map +1 -0
  30. package/dist/DetailPageTemplate/DetailPageTemplate.types.d.ts +13 -0
  31. package/dist/DetailPageTemplate/DetailPageTemplate.types.js +2 -0
  32. package/dist/DetailPageTemplate/DetailPageTemplate.types.js.map +1 -0
  33. package/dist/Dropdown/Dropdown.styles.js +3 -3
  34. package/dist/Dropdown/Dropdown.types.d.ts +5 -11
  35. package/dist/Dropdown/Dropdown.types.js.map +1 -1
  36. package/dist/DropdownFlyout/DropdownFlyout.js +6 -2
  37. package/dist/DropdownFlyout/DropdownFlyout.js.map +1 -1
  38. package/dist/DropdownFlyout/DropdownFlyout.styles.js +4 -4
  39. package/dist/DropdownFlyout/DropdownFlyout.types.d.ts +12 -14
  40. package/dist/DropdownFlyout/DropdownFlyout.types.js.map +1 -1
  41. package/dist/Dropzone/Dropzone.js +3 -2
  42. package/dist/Dropzone/Dropzone.js.map +1 -1
  43. package/dist/Dropzone/Dropzone.styles.js +9 -9
  44. package/dist/Dropzone/Dropzone.types.d.ts +22 -20
  45. package/dist/Dropzone/Dropzone.types.js.map +1 -1
  46. package/dist/EmptyState/EmptyState.styles.js +6 -6
  47. package/dist/Field/Field.styles.js +3 -3
  48. package/dist/FileList/FileList.styles.js +4 -4
  49. package/dist/FileSelect/FileExplorer/FileExplorer.styles.js +9 -9
  50. package/dist/FileSelect/FileExplorer/FileExplorerSidebar.styles.js +3 -3
  51. package/dist/FileSelect/FileSelect.styles.js +2 -2
  52. package/dist/FileSelect/FileSelectDropzone/FileSelectDropzone.styles.js +3 -3
  53. package/dist/FileSelect/FileTokenList/FileTokenList.styles.js +2 -2
  54. package/dist/FileSelect/GridSource/GridSource.js +3 -3
  55. package/dist/FileSelect/GridSource/GridSource.js.map +1 -1
  56. package/dist/FileSelect/GridSource/GridSource.styles.d.ts +3 -3
  57. package/dist/FileSelect/GridSource/GridSource.styles.js +12 -12
  58. package/dist/FileSelect/GridSource/GridSource.styles.js.map +1 -1
  59. package/dist/FileSelect/GridSource/GridSource.types.d.ts +14 -23
  60. package/dist/FileSelect/GridSource/GridSource.types.js.map +1 -1
  61. package/dist/FileSelect/LocalSource/LocalSource.styles.js +4 -4
  62. package/dist/FileSelect/LocalSource/LocalSource.types.d.ts +43 -47
  63. package/dist/FileSelect/LocalSource/LocalSource.types.js.map +1 -1
  64. package/dist/FileSelect/SourceItem/SourceItem.styles.js +3 -3
  65. package/dist/FileSelect/ThumbnailList/ThumbnailList.styles.js +6 -6
  66. package/dist/FileSelect/TreeSource/TreeSource.styles.js +1 -1
  67. package/dist/FileSelect/TreeSource/TreeSource.types.d.ts +3 -1
  68. package/dist/FileSelect/TreeSource/TreeSource.types.js.map +1 -1
  69. package/dist/FileToken/FileToken.styles.js +4 -4
  70. package/dist/FilterToken/FilterToken.styles.js +2 -2
  71. package/dist/FlexList/FlexList.styles.js +1 -1
  72. package/dist/Form/Form.js +12 -7
  73. package/dist/Form/Form.js.map +1 -1
  74. package/dist/Form/Form.styles.js +14 -14
  75. package/dist/Form/Form.types.d.ts +55 -67
  76. package/dist/Form/Form.types.js.map +1 -1
  77. package/dist/Form/StyledFormikForm.styles.js +2 -2
  78. package/dist/GhostPlaceholder/GhostPlaceholder.styles.js +2 -2
  79. package/dist/Grid/Grid.styles.js +2 -2
  80. package/dist/GroupSelect/GroupSelect.styles.js +1 -1
  81. package/dist/Input/Input.styles.js +1 -1
  82. package/dist/Link/Link.styles.js +1 -1
  83. package/dist/ListPage/ListPage.styles.js +8 -8
  84. package/dist/Loader/Loader.styles.js +4 -4
  85. package/dist/Loader/Loader.styles.js.map +1 -1
  86. package/dist/MenuImperative/MenuImperative.js +8 -5
  87. package/dist/MenuImperative/MenuImperative.js.map +1 -1
  88. package/dist/MenuImperative/MenuImperative.styles.js +10 -10
  89. package/dist/Modal/Modal.js +2 -2
  90. package/dist/Modal/Modal.js.map +1 -1
  91. package/dist/Modal/Modal.styles.d.ts +2 -2
  92. package/dist/Modal/Modal.styles.js +18 -18
  93. package/dist/Modal/Modal.styles.js.map +1 -1
  94. package/dist/MultiSelect/MultiSelect.styles.js +6 -6
  95. package/dist/MultiSelect/MultiSelect.types.d.ts +22 -15
  96. package/dist/MultiSelect/MultiSelect.types.js.map +1 -1
  97. package/dist/NextMenu/NextMenu.styles.js +3 -3
  98. package/dist/Notation/Notation.js +1 -1
  99. package/dist/NumberInput/NumberInput.js +2 -2
  100. package/dist/NumberInput/NumberInput.js.map +1 -1
  101. package/dist/NumberInput/NumberInput.styles.d.ts +2 -2
  102. package/dist/NumberInput/NumberInput.styles.js +11 -11
  103. package/dist/NumberInput/NumberInput.styles.js.map +1 -1
  104. package/dist/Overlay/OverlayArrow.styles.js +1 -1
  105. package/dist/PageFooterTemplate/PageFooterTemplate.styles.js +2 -2
  106. package/dist/PageFooterTemplate/PageFooterTemplate.styles.js.map +1 -1
  107. package/dist/PageHeaderTemplate/PageHeaderTemplate.js +70 -23
  108. package/dist/PageHeaderTemplate/PageHeaderTemplate.js.map +1 -1
  109. package/dist/PageHeaderTemplate/PageHeaderTemplate.styles.d.ts +2 -0
  110. package/dist/PageHeaderTemplate/PageHeaderTemplate.styles.js +11 -1
  111. package/dist/PageHeaderTemplate/PageHeaderTemplate.styles.js.map +1 -1
  112. package/dist/PageHeaderTemplate/PageHeaderTemplate.utils.d.ts +11 -0
  113. package/dist/PageHeaderTemplate/PageHeaderTemplate.utils.js +88 -0
  114. package/dist/PageHeaderTemplate/PageHeaderTemplate.utils.js.map +1 -0
  115. package/dist/PageLayout/PageLayout.styles.js +16 -16
  116. package/dist/PageLayout/PageLayout.utils.d.ts +2 -0
  117. package/dist/PageLayout/PageLayout.utils.js +6 -0
  118. package/dist/PageLayout/PageLayout.utils.js.map +1 -1
  119. package/dist/PageTemplate/PageTemplate.js +6 -2
  120. package/dist/PageTemplate/PageTemplate.js.map +1 -1
  121. package/dist/PageTemplate/PageTemplate.styles.d.ts +5 -0
  122. package/dist/PageTemplate/PageTemplate.styles.js +24 -0
  123. package/dist/PageTemplate/PageTemplate.styles.js.map +1 -0
  124. package/dist/PageTemplate/PageTemplate.types.d.ts +1 -0
  125. package/dist/PageTemplate/PageTemplate.types.js.map +1 -1
  126. package/dist/Pagination/Pagination.styles.js +5 -5
  127. package/dist/Panel/Panel.styles.js +11 -11
  128. package/dist/Pill/Pill.styles.js +2 -2
  129. package/dist/Pill/Pill.types.d.ts +3 -1
  130. package/dist/Pill/Pill.types.js.map +1 -1
  131. package/dist/PillSelect/PillSelect.styles.js +4 -4
  132. package/dist/Popover/Popover.styles.js +2 -2
  133. package/dist/Portal/Portal.styles.js +1 -1
  134. package/dist/ProgressBar/ProgressBar.styles.js +2 -2
  135. package/dist/RadioButton/RadioButton.styles.js +3 -3
  136. package/dist/Required/Required.styles.js +3 -3
  137. package/dist/Search/Search.styles.js +5 -5
  138. package/dist/Search/Search.types.d.ts +4 -2
  139. package/dist/Search/Search.types.js.map +1 -1
  140. package/dist/Section/Section.styles.js +7 -7
  141. package/dist/SegmentedController/SegmentedController.styles.js +4 -4
  142. package/dist/Select/Select.js +6 -3
  143. package/dist/Select/Select.js.map +1 -1
  144. package/dist/Select/Select.styles.js +9 -8
  145. package/dist/Select/Select.styles.js.map +1 -1
  146. package/dist/Select/Select.types.d.ts +9 -1
  147. package/dist/Select/Select.types.js.map +1 -1
  148. package/dist/Semantic/Semantic.d.ts +3 -7
  149. package/dist/Semantic/Semantic.js +14 -2
  150. package/dist/Semantic/Semantic.js.map +1 -1
  151. package/dist/Semantic/Semantic.styles.d.ts +3 -3
  152. package/dist/Semantic/Semantic.styles.js +11 -11
  153. package/dist/Semantic/Semantic.styles.js.map +1 -1
  154. package/dist/Semantic/Semantic.types.d.ts +5 -0
  155. package/dist/Semantic/Semantic.types.js.map +1 -1
  156. package/dist/SettingsPageTemplate/SettingsPageTemplate.d.ts +7 -0
  157. package/dist/SettingsPageTemplate/SettingsPageTemplate.js +34 -0
  158. package/dist/SettingsPageTemplate/SettingsPageTemplate.js.map +1 -0
  159. package/dist/SettingsPageTemplate/SettingsPageTemplate.types.d.ts +9 -0
  160. package/dist/SettingsPageTemplate/SettingsPageTemplate.types.js +2 -0
  161. package/dist/SettingsPageTemplate/SettingsPageTemplate.types.js.map +1 -0
  162. package/dist/Slider/Slider.js +2 -2
  163. package/dist/Slider/Slider.js.map +1 -1
  164. package/dist/Slider/Slider.styles.d.ts +2 -2
  165. package/dist/Slider/Slider.styles.js +9 -9
  166. package/dist/Slider/Slider.styles.js.map +1 -1
  167. package/dist/Spinner/Spinner.styles.js +7 -7
  168. package/dist/Spinner/Spinner.types.d.ts +2 -5
  169. package/dist/Spinner/Spinner.types.js.map +1 -1
  170. package/dist/SplitViewCard/SplitViewCard.styles.js +8 -8
  171. package/dist/SuperSelect/SuperSelect.presets.styles.js +1 -1
  172. package/dist/SuperSelect/SuperSelect.styles.js +37 -37
  173. package/dist/Switch/Switch.styles.js +4 -4
  174. package/dist/Table/Table.styles.js +28 -28
  175. package/dist/TableShelf/TableShelf.styles.js +5 -5
  176. package/dist/Tabs/Tabs.styles.js +15 -15
  177. package/dist/Tearsheet/Tearsheet.styles.js +7 -7
  178. package/dist/Tearsheet/Tearsheet.styles.js.map +1 -1
  179. package/dist/TextArea/TextArea.styles.js +1 -1
  180. package/dist/TextEditor/TextEditor.types.d.ts +12 -9
  181. package/dist/TextEditor/TextEditor.types.js.map +1 -1
  182. package/dist/TextEditorOutput/TextEditorOutput.styles.js +1 -1
  183. package/dist/Thumbnail/Thumbnail.js +25 -10
  184. package/dist/Thumbnail/Thumbnail.js.map +1 -1
  185. package/dist/Thumbnail/Thumbnail.styles.js +17 -17
  186. package/dist/Thumbnail/Thumbnail.types.d.ts +2 -3
  187. package/dist/Thumbnail/Thumbnail.types.js.map +1 -1
  188. package/dist/Thumbnail/ThumbnailCaption.js +2 -2
  189. package/dist/Thumbnail/ThumbnailCaption.js.map +1 -1
  190. package/dist/ThumbnailGrid/ThumbnailGrid.styles.js +7 -7
  191. package/dist/TieredSelect/TieredSelect.styles.js +9 -9
  192. package/dist/TieredSelect/TieredSelect.types.d.ts +64 -40
  193. package/dist/TieredSelect/TieredSelect.types.js.map +1 -1
  194. package/dist/Tile/Tile.styles.js +8 -8
  195. package/dist/Tile/Tile.types.d.ts +1 -1
  196. package/dist/Tile/Tile.types.js.map +1 -1
  197. package/dist/Title/Title.styles.js +7 -7
  198. package/dist/Toast/Toast.styles.js +3 -3
  199. package/dist/ToggleButton/ToggleButton.styles.js +1 -1
  200. package/dist/ToggleButton/ToggleButton.types.d.ts +1 -1
  201. package/dist/ToggleButton/ToggleButton.types.js.map +1 -1
  202. package/dist/Token/Token.styles.js +3 -3
  203. package/dist/ToolHeader/ToolHeader.styles.js +6 -6
  204. package/dist/ToolLandingPage/ToolLandingPage.styles.js +3 -3
  205. package/dist/ToolLandingPageTemplate/ToolLandingPageTemplate.d.ts +5 -0
  206. package/dist/ToolLandingPageTemplate/ToolLandingPageTemplate.js +44 -0
  207. package/dist/ToolLandingPageTemplate/ToolLandingPageTemplate.js.map +1 -0
  208. package/dist/ToolLandingPageTemplate/ToolLandingPageTemplate.types.d.ts +7 -0
  209. package/dist/ToolLandingPageTemplate/ToolLandingPageTemplate.types.js +2 -0
  210. package/dist/ToolLandingPageTemplate/ToolLandingPageTemplate.types.js.map +1 -0
  211. package/dist/Tooltip/Tooltip.styles.js +2 -2
  212. package/dist/Tree/Tree.js +3 -3
  213. package/dist/Tree/Tree.js.map +1 -1
  214. package/dist/Tree/Tree.styles.d.ts +9 -3
  215. package/dist/Tree/Tree.styles.js +23 -15
  216. package/dist/Tree/Tree.styles.js.map +1 -1
  217. package/dist/Tree/Tree.types.d.ts +40 -19
  218. package/dist/Tree/Tree.types.js.map +1 -1
  219. package/dist/Typeahead/Typeahead.styles.js +3 -3
  220. package/dist/Typography/Typography.js +1 -1
  221. package/dist/Typography/Typography.js.map +1 -1
  222. package/dist/Typography/Typography.styles.d.ts +2 -1
  223. package/dist/Typography/Typography.styles.js +3 -3
  224. package/dist/Typography/Typography.styles.js.map +1 -1
  225. package/dist/Typography/Typography.table.story.js +2 -2
  226. package/dist/_hooks/useCurrentMedia.d.ts +36 -0
  227. package/dist/_hooks/useCurrentMedia.js +73 -0
  228. package/dist/_hooks/useCurrentMedia.js.map +1 -0
  229. package/dist/_locales/en-AU.json +56 -56
  230. package/dist/_locales/en-CA.json +56 -56
  231. package/dist/_locales/en-GB.json +55 -55
  232. package/dist/_locales/es.json +2 -2
  233. package/dist/_locales/ja-JP.json +5 -5
  234. package/dist/_locales/pt-BR.json +1 -1
  235. package/dist/_locales/th-TH.json +1 -1
  236. package/dist/_typedoc/Avatar/Avatar.types.json +20 -20
  237. package/dist/_typedoc/AvatarStack/AvatarStack.types.json +24 -24
  238. package/dist/_typedoc/Badge/Badge.types.json +6 -6
  239. package/dist/_typedoc/Banner/Banner.types.json +13 -13
  240. package/dist/_typedoc/Box/Box.types.json +68 -68
  241. package/dist/_typedoc/Breadcrumbs/Breadcrumbs.types.json +10 -10
  242. package/dist/_typedoc/Button/Button.types.json +12 -12
  243. package/dist/_typedoc/Calendar/Calendar.types.json +80 -80
  244. package/dist/_typedoc/Card/Card.types.json +6 -6
  245. package/dist/_typedoc/Checkbox/Checkbox.types.json +9 -9
  246. package/dist/_typedoc/ContactItem/ContactItem.types.json +9 -9
  247. package/dist/_typedoc/DateInput/DateInput.types.json +35 -35
  248. package/dist/_typedoc/DateSelect/DateSelect.types.json +13 -13
  249. package/dist/_typedoc/DetailPage/DetailPage.types.json +5 -5
  250. package/dist/_typedoc/Dropdown/Dropdown.types.json +39 -39
  251. package/dist/_typedoc/DropdownFlyout/DropdownFlyout.types.json +35 -35
  252. package/dist/_typedoc/Dropzone/Dropzone.types.json +53 -53
  253. package/dist/_typedoc/EmptyState/EmptyState.types.json +14 -14
  254. package/dist/_typedoc/FileList/FileList.types.json +9 -9
  255. package/dist/_typedoc/FileSelect/FileSelect.types.json +26 -26
  256. package/dist/_typedoc/FileSelect/GridSource/GridSource.types.json +42 -42
  257. package/dist/_typedoc/FileSelect/LocalSource/LocalSource.types.json +30 -30
  258. package/dist/_typedoc/FileSelect/TreeSource/TreeSource.types.json +27 -27
  259. package/dist/_typedoc/Flex/Flex.types.json +27 -27
  260. package/dist/_typedoc/FlexList/FlexList.types.json +30 -30
  261. package/dist/_typedoc/Form/Form.types.json +1015 -975
  262. package/dist/_typedoc/GhostPlaceholder/GhostPlaceholder.types.json +12 -12
  263. package/dist/_typedoc/Grid/Grid.types.json +8 -8
  264. package/dist/_typedoc/GroupSelect/GroupSelect.types.json +54 -54
  265. package/dist/_typedoc/Input/Input.types.json +2 -2
  266. package/dist/_typedoc/Link/Link.types.json +4 -4
  267. package/dist/_typedoc/ListPage/ListPage.types.json +13 -13
  268. package/dist/_typedoc/Menu/Menu.types.json +62 -62
  269. package/dist/_typedoc/MenuImperative/MenuImperative.types.json +74 -74
  270. package/dist/_typedoc/Modal/Modal.types.json +46 -46
  271. package/dist/_typedoc/MultiSelect/MultiSelect.types.json +35 -35
  272. package/dist/_typedoc/Notation/Notation.types.json +4 -4
  273. package/dist/_typedoc/NumberInput/NumberInput.types.json +37 -37
  274. package/dist/_typedoc/OverlayTrigger/OverlayTrigger.types.json +31 -31
  275. package/dist/_typedoc/PageLayout/PageLayout.types.json +28 -28
  276. package/dist/_typedoc/Pagination/Pagination.types.json +7 -7
  277. package/dist/_typedoc/Panel/Panel.types.json +28 -28
  278. package/dist/_typedoc/Pill/Pill.types.json +4 -4
  279. package/dist/_typedoc/PillSelect/PillSelect.types.json +58 -48
  280. package/dist/_typedoc/Popover/Popover.types.json +14 -14
  281. package/dist/_typedoc/ProgressBar/ProgressBar.types.json +6 -6
  282. package/dist/_typedoc/RadioButton/RadioButton.types.json +6 -6
  283. package/dist/_typedoc/Required/Required.types.json +5 -5
  284. package/dist/_typedoc/Search/Search.types.json +22 -22
  285. package/dist/_typedoc/Section/Section.types.json +15 -15
  286. package/dist/_typedoc/SegmentedController/SegmentedController.types.json +20 -20
  287. package/dist/_typedoc/Select/Select.types.json +78 -58
  288. package/dist/_typedoc/SettingsPage/SettingsPage.types.json +10 -10
  289. package/dist/_typedoc/Slider/Slider.types.json +6 -6
  290. package/dist/_typedoc/Spinner/Spinner.types.json +11 -11
  291. package/dist/_typedoc/SplitViewCard/SplitViewCard.types.json +12 -12
  292. package/dist/_typedoc/Switch/Switch.types.json +3 -3
  293. package/dist/_typedoc/Table/Table.types.json +112 -102
  294. package/dist/_typedoc/Tabs/Tabs.types.json +19 -19
  295. package/dist/_typedoc/Tearsheet/Tearsheet.types.json +16 -16
  296. package/dist/_typedoc/TextArea/TextArea.types.json +3 -3
  297. package/dist/_typedoc/TextEditor/TextEditor.types.json +13 -13
  298. package/dist/_typedoc/TextEditorOutput/TextEditorOutput.types.json +4 -4
  299. package/dist/_typedoc/Thumbnail/Thumbnail.types.json +23 -23
  300. package/dist/_typedoc/TieredDropdown/TieredDropdown.types.json +56 -56
  301. package/dist/_typedoc/TieredSelect/TieredSelect.types.json +44 -44
  302. package/dist/_typedoc/Tile/Tile.types.json +32 -32
  303. package/dist/_typedoc/Title/Title.types.json +1 -1
  304. package/dist/_typedoc/Toast/Toast.types.json +4 -4
  305. package/dist/_typedoc/ToggleButton/ToggleButton.types.json +6 -6
  306. package/dist/_typedoc/Token/Token.types.json +4 -4
  307. package/dist/_typedoc/ToolHeader/ToolHeader.types.json +10 -10
  308. package/dist/_typedoc/ToolLandingPage/ToolLandingPage.types.json +7 -7
  309. package/dist/_typedoc/Tooltip/Tooltip.types.json +13 -13
  310. package/dist/_typedoc/Tree/Tree.types.json +110 -110
  311. package/dist/_typedoc/Typeahead/Typeahead.types.json +2 -2
  312. package/dist/_typedoc/Typography/Typography.types.json +9 -9
  313. package/dist/_typedoc/_utils/types.json +3 -3
  314. package/package.json +2 -2
@@ -11,7 +11,7 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
11
11
  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; }
12
12
  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; }
13
13
  import { EllipsisVertical } from '@procore/core-icons/dist';
14
- import React from 'react';
14
+ import React, { useCallback } from 'react';
15
15
  import { Card } from '../Card/Card';
16
16
  import { DropdownButton } from '../Dropdown/Dropdown';
17
17
  import { Portal } from '../Portal';
@@ -234,6 +234,10 @@ export var DropdownFlyout = /*#__PURE__*/React.forwardRef(function DropdownFlyou
234
234
  _React$useState4 = _slicedToArray(_React$useState3, 2),
235
235
  referenceEl = _React$useState4[0],
236
236
  setReferenceEl = _React$useState4[1];
237
+
238
+ // mergeRefs function is from shared utils.
239
+ // eslint-disable-next-line react-hooks/exhaustive-deps
240
+ var memoRef = useCallback(trigger.ref ? mergeRefs(trigger.ref, targetRef, setReferenceEl) : mergeRefs(targetRef, setReferenceEl), [targetRef, setReferenceEl, trigger.ref]);
237
241
  return /*#__PURE__*/React.createElement("div", _extends({}, props, {
238
242
  "aria-label": undefined,
239
243
  ref: containerRef,
@@ -244,7 +248,7 @@ export var DropdownFlyout = /*#__PURE__*/React.forwardRef(function DropdownFlyou
244
248
  onMouseDown: onMouseDown,
245
249
  onBlur: onBlur
246
250
  }), /*#__PURE__*/React.cloneElement(trigger, {
247
- ref: trigger.ref ? mergeRefs(trigger.ref, targetRef, setReferenceEl) : mergeRefs(targetRef, setReferenceEl),
251
+ ref: memoRef,
248
252
  onClick: function onClick(e) {
249
253
  var _trigger$props$onClic, _trigger$props;
250
254
  (_trigger$props$onClic = (_trigger$props = trigger.props).onClick) === null || _trigger$props$onClic === void 0 ? void 0 : _trigger$props$onClic.call(_trigger$props, e);
@@ -1 +1 @@
1
- {"version":3,"file":"DropdownFlyout.js","names":["EllipsisVertical","React","Card","DropdownButton","Portal","useClickOutside","useI18nContext","mergeRefs","defaultOptionRenderer","DropdownFlyoutContext","noop","transformOption","useDropdownFlyout","useDropdownFlyoutContext","StyledDropdownFlyout","StyledDropdownFlyoutItem","rootId","useDropdownFlyoutOverlay","FlyoutCaption","forwardRef","_ref","ref","option","highlighted","optionRenderer","props","_objectWithoutProperties","_excluded","createElement","_extends","displayName","FlyoutItem","_ref2","overlayElRef","useRef","_useDropdownFlyoutCon","isHighlighted","isExpanded","_onClick","onClick","expand","collapse","onMouseEnter","useCallback","onMouseLeave","e","relatedTarget","Node","current","contains","_React$useState","useState","_React$useState2","_slicedToArray","referenceEl","setReferenceEl","Fragment","role","origin","Array","isArray","children","FlyoutList","options","overlayRef","placement","_ref3","_ref3$offset","offset","_useDropdownFlyoutOve","mainAxis","overlayStyle","referenceRef","useEffect","shadowStrength","style","map","key","id","DefaultButton","_ref4","icon","_excluded2","loading","undefined","arrow","Boolean","Children","count","DropdownFlyout","_ref5","disabled","label","_options","_ref5$onClick","_ref5$optionRenderer","_ref5$placement","_onKeyDown","onKeyDown","onFocus_","onFocus","onBlur_","onBlur","onMouseDown_","onMouseDown","onMouseEnter_","onMouseLeave_","size","_ref5$variant","variant","_excluded3","innerRef","containerRef","targetRef","flyoutOptions","useMemo","_useDropdownFlyout","closeSelectedDropdown","openDropdown","isOpen","setMouseOver","setFocused","onClickOutside","refs","element","I18n","ariaLabel","t","concat","trigger","isValidElement","_containerRef$current","target","dataset","flyout","preventDefault","_targetRef$current","focus","_React$useState3","_React$useState4","cloneElement","_trigger$props$onClic","_trigger$props","call","tabIndex","Provider","value"],"sources":["../../src/DropdownFlyout/DropdownFlyout.tsx"],"sourcesContent":["import { EllipsisVertical } from '@procore/core-icons/dist'\nimport type { MouseEvent } from 'react'\nimport React from 'react'\nimport type { ButtonProps } from '../Button/Button.types'\nimport { Card } from '../Card/Card'\nimport { DropdownButton } from '../Dropdown/Dropdown'\nimport { Portal } from '../Portal'\nimport { useClickOutside } from '../_hooks/ClickOutside'\nimport { useI18nContext } from '../_hooks/I18n'\nimport { mergeRefs } from '../_utils/mergeRefs'\nimport type { ReactElementWithRef } from '../_utils/types'\nimport {\n defaultOptionRenderer,\n DropdownFlyoutContext,\n noop,\n transformOption,\n useDropdownFlyout,\n useDropdownFlyoutContext,\n} from './DropdownFlyout.helpers'\nimport {\n StyledDropdownFlyout,\n StyledDropdownFlyoutItem,\n} from './DropdownFlyout.styles'\nimport type {\n DropdownFlyoutProps,\n FlyoutCaptionProps,\n FlyoutItemProps,\n FlyoutListProps,\n} from './DropdownFlyout.types'\nimport { rootId } from './DropdownFlyout.types'\nimport { useDropdownFlyoutOverlay } from './useDropdownFlyoutOverlay'\n\nexport const FlyoutCaption = React.forwardRef<\n HTMLDivElement,\n FlyoutCaptionProps\n>(function FlyoutCaption(\n { option, highlighted, optionRenderer, ...props },\n ref\n) {\n return (\n <StyledDropdownFlyoutItem\n {...props}\n ref={ref}\n data-highlighted={highlighted}\n data-flyout\n >\n {optionRenderer(option)}\n </StyledDropdownFlyoutItem>\n )\n})\n\nFlyoutCaption.displayName = 'FlyoutCaption'\n\nexport function FlyoutItem({ option }: FlyoutItemProps) {\n const overlayElRef = React.useRef<HTMLDivElement>(null)\n const {\n isHighlighted,\n isExpanded,\n onClick: _onClick,\n expand,\n collapse,\n optionRenderer,\n } = useDropdownFlyoutContext()\n\n const onMouseEnter = React.useCallback(() => expand(option), [option, expand])\n const onMouseLeave = React.useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n if (\n e.relatedTarget instanceof Node &&\n overlayElRef.current &&\n !overlayElRef.current.contains(e.relatedTarget as Node)\n ) {\n collapse(option)\n }\n },\n [collapse, option]\n )\n\n const onClick = React.useCallback(() => _onClick(option), [_onClick, option])\n\n const [referenceEl, setReferenceEl] = React.useState<HTMLElement | null>(null)\n\n return (\n <>\n <FlyoutCaption\n ref={setReferenceEl}\n role=\"listitem\"\n option={option.origin}\n onClick={onClick}\n optionRenderer={optionRenderer}\n highlighted={isHighlighted(option)}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n />\n {Array.isArray(option.children) && isExpanded(option) ? (\n <Portal>\n <FlyoutList\n referenceEl={referenceEl}\n options={option.children}\n overlayRef={overlayElRef}\n placement=\"right-top\"\n />\n </Portal>\n ) : null}\n </>\n )\n}\n\nexport function FlyoutList({\n options,\n placement,\n referenceEl,\n overlayRef: overlayElRef,\n offset = 0,\n}: FlyoutListProps) {\n const { overlayStyle, referenceRef, overlayRef } = useDropdownFlyoutOverlay({\n placement,\n offset: { mainAxis: offset },\n })\n\n React.useEffect(() => {\n referenceRef(referenceEl)\n }, [referenceEl, referenceRef])\n\n return (\n <Card\n ref={mergeRefs(overlayRef, overlayElRef)}\n shadowStrength={2}\n style={overlayStyle}\n >\n <StyledDropdownFlyout role=\"list\">\n {options.map((option) => (\n <FlyoutItem key={option.id} option={option} />\n ))}\n </StyledDropdownFlyout>\n </Card>\n )\n}\n\nconst DefaultButton = React.forwardRef<HTMLButtonElement, ButtonProps>(\n function DefaultButton({ children, icon, ...props }, ref) {\n return (\n <DropdownButton\n {...props}\n icon={\n props.loading ? undefined : !icon && !children ? (\n <EllipsisVertical />\n ) : (\n icon\n )\n }\n arrow={Boolean(React.Children.count(children))}\n ref={ref}\n >\n {children}\n </DropdownButton>\n )\n }\n)\n\n/**\n\n The dropdown flyout allows for additional menu items to be nested within\n parent items, which allows more menu options for users.\n @a11y WARN: DropdownFlyotus hold no value and take an action. Focus is expected\n to be moved from a Dropdown to something else, to continue the user flow.\n If the action is inert and does not move focus, this is left to be added\n by the consumer.\n @since 10.19.0\n\n @see [Storybook](https://stories.core.procore.com/?path=/story/core-react_demos-dropdownflyout--demo)\n\n @see [Design Guidelines](https://design.procore.com/dropdown-flyout)\n\n */\nexport const DropdownFlyout = React.forwardRef<\n HTMLDivElement,\n DropdownFlyoutProps\n>(function DropdownFlyout(\n {\n disabled,\n icon,\n label,\n loading,\n options: _options,\n onClick: _onClick = noop,\n optionRenderer = defaultOptionRenderer,\n children,\n placement = 'right-bottom',\n onKeyDown: _onKeyDown,\n onFocus: onFocus_,\n onBlur: onBlur_,\n onMouseDown: onMouseDown_,\n onMouseEnter: onMouseEnter_,\n onMouseLeave: onMouseLeave_,\n size,\n variant = 'secondary',\n ...props\n },\n ref\n) {\n const innerRef = React.useRef<HTMLDivElement>(null)\n const containerRef = (ref as React.RefObject<HTMLInputElement>) || innerRef\n const overlayElRef = React.useRef<HTMLDivElement>(null)\n const targetRef = React.useRef<HTMLElement>(null)\n\n const flyoutOptions = React.useMemo(\n () => transformOption(_options, rootId),\n [_options]\n )\n\n const {\n options,\n collapse,\n expand,\n closeSelectedDropdown,\n openDropdown,\n isOpen,\n onClick,\n onKeyDown,\n setMouseOver,\n setFocused,\n isExpanded,\n isHighlighted,\n } = useDropdownFlyout({\n flyoutOptions,\n onClick: _onClick,\n onKeyDown: _onKeyDown,\n })\n\n useClickOutside({\n onClickOutside: isOpen ? closeSelectedDropdown : noop,\n refs: [containerRef],\n })\n\n const element =\n typeof children === 'function' ? children({ isOpen }) : children\n\n const I18n = useI18nContext()\n\n const ariaLabel =\n props['aria-label'] ||\n label ||\n I18n.t(`core.dropdown.${loading ? 'loading' : 'moreOptions'}`)\n\n const trigger: ReactElementWithRef = React.isValidElement(element) ? (\n element\n ) : (\n <DefaultButton\n aria-label={ariaLabel}\n children={label}\n disabled={disabled}\n loading={loading}\n icon={icon}\n size={size}\n variant={variant}\n />\n )\n\n function onBlur(e: React.FocusEvent<HTMLDivElement>) {\n setFocused(false)\n closeSelectedDropdown(e)\n onBlur_?.(e)\n }\n\n function onFocus(e: React.FocusEvent<HTMLDivElement>) {\n setFocused(true)\n onFocus_?.(e)\n }\n\n function onMouseDown(e: React.MouseEvent<HTMLDivElement>) {\n // Discard firing of blur event\n // when click was inside the dropdown\n if ((e.target as HTMLElement).dataset.flyout) {\n e.preventDefault()\n return\n }\n if (e.target instanceof Node && containerRef.current?.contains(e.target)) {\n e.preventDefault()\n targetRef.current?.focus()\n }\n onMouseDown_?.(e)\n }\n\n function onMouseLeave(e: React.MouseEvent<HTMLDivElement>) {\n setMouseOver(false)\n onMouseLeave_?.(e)\n }\n\n function onMouseEnter(e: React.MouseEvent<HTMLDivElement>) {\n setMouseOver(true)\n onMouseEnter_?.(e)\n }\n\n const [referenceEl, setReferenceEl] = React.useState<HTMLElement | null>(null)\n\n return (\n <div\n {...props}\n aria-label={undefined}\n ref={containerRef}\n onKeyDown={onKeyDown}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n onFocus={onFocus}\n onMouseDown={onMouseDown}\n onBlur={onBlur}\n >\n {React.cloneElement(trigger, {\n ref: trigger.ref\n ? mergeRefs(trigger.ref, targetRef, setReferenceEl)\n : mergeRefs(targetRef, setReferenceEl),\n onClick: (e: MouseEvent<HTMLElement, 'click'>) => {\n trigger.props.onClick?.(e)\n openDropdown()\n },\n tabIndex: 0,\n })}\n <DropdownFlyoutContext.Provider\n value={{\n expand,\n collapse,\n onClick,\n isExpanded,\n isHighlighted,\n optionRenderer,\n }}\n >\n {isOpen && (\n <Portal>\n <FlyoutList\n options={options}\n overlayRef={overlayElRef}\n placement={placement}\n referenceEl={referenceEl}\n offset={4}\n />\n </Portal>\n )}\n </DropdownFlyoutContext.Provider>\n </div>\n )\n})\n"],"mappings":";;;;;;;;;;;;AAAA,SAASA,gBAAgB,QAAQ,0BAA0B;AAE3D,OAAOC,KAAK,MAAM,OAAO;AAEzB,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,cAAc,QAAQ,sBAAsB;AACrD,SAASC,MAAM,QAAQ,WAAW;AAClC,SAASC,eAAe,QAAQ,wBAAwB;AACxD,SAASC,cAAc,QAAQ,gBAAgB;AAC/C,SAASC,SAAS,QAAQ,qBAAqB;AAE/C,SACEC,qBAAqB,EACrBC,qBAAqB,EACrBC,IAAI,EACJC,eAAe,EACfC,iBAAiB,EACjBC,wBAAwB,QACnB,0BAA0B;AACjC,SACEC,oBA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AA,CAACkC,UAAU;IACTC,OAAO,EAAEA,OAAQ;IACjBC,UAAU,EAAE/B,YAAa;IACzBgC,SAAS,EAAEA,SAAU;IACrBX,WAAW,EAAEA,WAAY;IACzBc,MAAM,EAAE;EAAE,CACX,CACK,CAEoB,CAC7B,CAAC;AAEV,CAAC,CAAC"}
1
+ {"version":3,"file":"DropdownFlyout.js","names":["EllipsisVertical","React","useCallback","Card","DropdownButton","Portal","useClickOutside","useI18nContext","mergeRefs","defaultOptionRenderer","DropdownFlyoutContext","noop","transformOption","useDropdownFlyout","useDropdownFlyoutContext","StyledDropdownFlyout","StyledDropdownFlyoutItem","rootId","useDropdownFlyoutOverlay","FlyoutCaption","forwardRef","_ref","ref","option","highlighted","optionRenderer","props","_objectWithoutProperties","_excluded","createElement","_extends","displayName","FlyoutItem","_ref2","overlayElRef","useRef","_useDropdownFlyoutCon","isHighlighted","isExpanded","_onClick","onClick","expand","collapse","onMouseEnter","onMouseLeave","e","relatedTarget","Node","current","contains","_React$useState","useState","_React$useState2","_slicedToArray","referenceEl","setReferenceEl","Fragment","role","origin","Array","isArray","children","FlyoutList","options","overlayRef","placement","_ref3","_ref3$offset","offset","_useDropdownFlyoutOve","mainAxis","overlayStyle","referenceRef","useEffect","shadowStrength","style","map","key","id","DefaultButton","_ref4","icon","_excluded2","loading","undefined","arrow","Boolean","Children","count","DropdownFlyout","_ref5","disabled","label","_options","_ref5$onClick","_ref5$optionRenderer","_ref5$placement","_onKeyDown","onKeyDown","onFocus_","onFocus","onBlur_","onBlur","onMouseDown_","onMouseDown","onMouseEnter_","onMouseLeave_","size","_ref5$variant","variant","_excluded3","innerRef","containerRef","targetRef","flyoutOptions","useMemo","_useDropdownFlyout","closeSelectedDropdown","openDropdown","isOpen","setMouseOver","setFocused","onClickOutside","refs","element","I18n","ariaLabel","t","concat","trigger","isValidElement","_containerRef$current","target","dataset","flyout","preventDefault","_targetRef$current","focus","_React$useState3","_React$useState4","memoRef","cloneElement","_trigger$props$onClic","_trigger$props","call","tabIndex","Provider","value"],"sources":["../../src/DropdownFlyout/DropdownFlyout.tsx"],"sourcesContent":["import { EllipsisVertical } from '@procore/core-icons/dist'\nimport type { MouseEvent } from 'react'\nimport React, { useCallback } from 'react'\nimport type { ButtonProps } from '../Button/Button.types'\nimport { Card } from '../Card/Card'\nimport { DropdownButton } from '../Dropdown/Dropdown'\nimport { Portal } from '../Portal'\nimport { useClickOutside } from '../_hooks/ClickOutside'\nimport { useI18nContext } from '../_hooks/I18n'\nimport { mergeRefs } from '../_utils/mergeRefs'\nimport type { ReactElementWithRef } from '../_utils/types'\nimport {\n defaultOptionRenderer,\n DropdownFlyoutContext,\n noop,\n transformOption,\n useDropdownFlyout,\n useDropdownFlyoutContext,\n} from './DropdownFlyout.helpers'\nimport {\n StyledDropdownFlyout,\n StyledDropdownFlyoutItem,\n} from './DropdownFlyout.styles'\nimport type {\n DropdownFlyoutProps,\n FlyoutCaptionProps,\n FlyoutItemProps,\n FlyoutListProps,\n} from './DropdownFlyout.types'\nimport { rootId } from './DropdownFlyout.types'\nimport { useDropdownFlyoutOverlay } from './useDropdownFlyoutOverlay'\n\nexport const FlyoutCaption = React.forwardRef<\n HTMLDivElement,\n FlyoutCaptionProps\n>(function FlyoutCaption(\n { option, highlighted, optionRenderer, ...props },\n ref\n) {\n return (\n <StyledDropdownFlyoutItem\n {...props}\n ref={ref}\n data-highlighted={highlighted}\n data-flyout\n >\n {optionRenderer(option)}\n </StyledDropdownFlyoutItem>\n )\n})\n\nFlyoutCaption.displayName = 'FlyoutCaption'\n\nexport function FlyoutItem({ option }: FlyoutItemProps) {\n const overlayElRef = React.useRef<HTMLDivElement>(null)\n const {\n isHighlighted,\n isExpanded,\n onClick: _onClick,\n expand,\n collapse,\n optionRenderer,\n } = useDropdownFlyoutContext()\n\n const onMouseEnter = React.useCallback(() => expand(option), [option, expand])\n const onMouseLeave = React.useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n if (\n e.relatedTarget instanceof Node &&\n overlayElRef.current &&\n !overlayElRef.current.contains(e.relatedTarget as Node)\n ) {\n collapse(option)\n }\n },\n [collapse, option]\n )\n\n const onClick = React.useCallback(() => _onClick(option), [_onClick, option])\n\n const [referenceEl, setReferenceEl] = React.useState<HTMLElement | null>(null)\n\n return (\n <>\n <FlyoutCaption\n ref={setReferenceEl}\n role=\"listitem\"\n option={option.origin}\n onClick={onClick}\n optionRenderer={optionRenderer}\n highlighted={isHighlighted(option)}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n />\n {Array.isArray(option.children) && isExpanded(option) ? (\n <Portal>\n <FlyoutList\n referenceEl={referenceEl}\n options={option.children}\n overlayRef={overlayElRef}\n placement=\"right-top\"\n />\n </Portal>\n ) : null}\n </>\n )\n}\n\nexport function FlyoutList({\n options,\n placement,\n referenceEl,\n overlayRef: overlayElRef,\n offset = 0,\n}: FlyoutListProps) {\n const { overlayStyle, referenceRef, overlayRef } = useDropdownFlyoutOverlay({\n placement,\n offset: { mainAxis: offset },\n })\n\n React.useEffect(() => {\n referenceRef(referenceEl)\n }, [referenceEl, referenceRef])\n\n return (\n <Card\n ref={mergeRefs(overlayRef, overlayElRef)}\n shadowStrength={2}\n style={overlayStyle}\n >\n <StyledDropdownFlyout role=\"list\">\n {options.map((option) => (\n <FlyoutItem key={option.id} option={option} />\n ))}\n </StyledDropdownFlyout>\n </Card>\n )\n}\n\nconst DefaultButton = React.forwardRef<HTMLButtonElement, ButtonProps>(\n function DefaultButton({ children, icon, ...props }, ref) {\n return (\n <DropdownButton\n {...props}\n icon={\n props.loading ? undefined : !icon && !children ? (\n <EllipsisVertical />\n ) : (\n icon\n )\n }\n arrow={Boolean(React.Children.count(children))}\n ref={ref}\n >\n {children}\n </DropdownButton>\n )\n }\n)\n\n/**\n\n The dropdown flyout allows for additional menu items to be nested within\n parent items, which allows more menu options for users.\n @a11y WARN: DropdownFlyotus hold no value and take an action. Focus is expected\n to be moved from a Dropdown to something else, to continue the user flow.\n If the action is inert and does not move focus, this is left to be added\n by the consumer.\n @since 10.19.0\n\n @see [Storybook](https://stories.core.procore.com/?path=/story/core-react_demos-dropdownflyout--demo)\n\n @see [Design Guidelines](https://design.procore.com/dropdown-flyout)\n\n */\nexport const DropdownFlyout = React.forwardRef<\n HTMLDivElement,\n DropdownFlyoutProps\n>(function DropdownFlyout(\n {\n disabled,\n icon,\n label,\n loading,\n options: _options,\n onClick: _onClick = noop,\n optionRenderer = defaultOptionRenderer,\n children,\n placement = 'right-bottom',\n onKeyDown: _onKeyDown,\n onFocus: onFocus_,\n onBlur: onBlur_,\n onMouseDown: onMouseDown_,\n onMouseEnter: onMouseEnter_,\n onMouseLeave: onMouseLeave_,\n size,\n variant = 'secondary',\n ...props\n },\n ref\n) {\n const innerRef = React.useRef<HTMLDivElement>(null)\n const containerRef = (ref as React.RefObject<HTMLInputElement>) || innerRef\n const overlayElRef = React.useRef<HTMLDivElement>(null)\n const targetRef = React.useRef<HTMLElement>(null)\n\n const flyoutOptions = React.useMemo(\n () => transformOption(_options, rootId),\n [_options]\n )\n\n const {\n options,\n collapse,\n expand,\n closeSelectedDropdown,\n openDropdown,\n isOpen,\n onClick,\n onKeyDown,\n setMouseOver,\n setFocused,\n isExpanded,\n isHighlighted,\n } = useDropdownFlyout({\n flyoutOptions,\n onClick: _onClick,\n onKeyDown: _onKeyDown,\n })\n\n useClickOutside({\n onClickOutside: isOpen ? closeSelectedDropdown : noop,\n refs: [containerRef],\n })\n\n const element =\n typeof children === 'function' ? children({ isOpen }) : children\n\n const I18n = useI18nContext()\n\n const ariaLabel =\n props['aria-label'] ||\n label ||\n I18n.t(`core.dropdown.${loading ? 'loading' : 'moreOptions'}`)\n\n const trigger: ReactElementWithRef = React.isValidElement(element) ? (\n element\n ) : (\n <DefaultButton\n aria-label={ariaLabel}\n children={label}\n disabled={disabled}\n loading={loading}\n icon={icon}\n size={size}\n variant={variant}\n />\n )\n\n function onBlur(e: React.FocusEvent<HTMLDivElement>) {\n setFocused(false)\n closeSelectedDropdown(e)\n onBlur_?.(e)\n }\n\n function onFocus(e: React.FocusEvent<HTMLDivElement>) {\n setFocused(true)\n onFocus_?.(e)\n }\n\n function onMouseDown(e: React.MouseEvent<HTMLDivElement>) {\n // Discard firing of blur event\n // when click was inside the dropdown\n if ((e.target as HTMLElement).dataset.flyout) {\n e.preventDefault()\n return\n }\n if (e.target instanceof Node && containerRef.current?.contains(e.target)) {\n e.preventDefault()\n targetRef.current?.focus()\n }\n onMouseDown_?.(e)\n }\n\n function onMouseLeave(e: React.MouseEvent<HTMLDivElement>) {\n setMouseOver(false)\n onMouseLeave_?.(e)\n }\n\n function onMouseEnter(e: React.MouseEvent<HTMLDivElement>) {\n setMouseOver(true)\n onMouseEnter_?.(e)\n }\n\n const [referenceEl, setReferenceEl] = React.useState<HTMLElement | null>(null)\n\n // mergeRefs function is from shared utils.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const memoRef = useCallback(\n trigger.ref\n ? mergeRefs(trigger.ref, targetRef, setReferenceEl)\n : mergeRefs(targetRef, setReferenceEl),\n [targetRef, setReferenceEl, trigger.ref]\n )\n return (\n <div\n {...props}\n aria-label={undefined}\n ref={containerRef}\n onKeyDown={onKeyDown}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n onFocus={onFocus}\n onMouseDown={onMouseDown}\n onBlur={onBlur}\n >\n {React.cloneElement(trigger, {\n ref: memoRef,\n onClick: (e: MouseEvent<HTMLElement, 'click'>) => {\n trigger.props.onClick?.(e)\n openDropdown()\n },\n tabIndex: 0,\n })}\n <DropdownFlyoutContext.Provider\n value={{\n expand,\n collapse,\n onClick,\n isExpanded,\n isHighlighted,\n optionRenderer,\n }}\n >\n {isOpen && (\n <Portal>\n <FlyoutList\n options={options}\n overlayRef={overlayElRef}\n placement={placement}\n referenceEl={referenceEl}\n offset={4}\n />\n </Portal>\n )}\n </DropdownFlyoutContext.Provider>\n </div>\n )\n})\n"],"mappings":";;;;;;;;;;;;AAAA,SAASA,gBAAg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AA,GAAAd,OAAO,CAACvG,KAAK,EAACc,OAAO,cAAAsG,qBAAA,uBAArBA,qBAAA,CAAAE,IAAA,CAAAD,cAAA,EAAwBlG,CAAC,CAAC;MAC1ByE,YAAY,CAAC,CAAC;IAChB,CAAC;IACD2B,QAAQ,EAAE;EACZ,CAAC,CAAC,eACFhJ,KAAA,CAAA4B,aAAA,CAACnB,qBAAqB,CAACwI,QAAQ;IAC7BC,KAAK,EAAE;MACL1G,MAAM,EAANA,MAAM;MACNC,QAAQ,EAARA,QAAQ;MACRF,OAAO,EAAPA,OAAO;MACPF,UAAU,EAAVA,UAAU;MACVD,aAAa,EAAbA,aAAa;MACbZ,cAAc,EAAdA;IACF;EAAE,GAED8F,MAAM,iBACLtH,KAAA,CAAA4B,aAAA,CAACxB,MAAM,qBACLJ,KAAA,CAAA4B,aAAA,CAACiC,UAAU;IACTC,OAAO,EAAEA,OAAQ;IACjBC,UAAU,EAAE9B,YAAa;IACzB+B,SAAS,EAAEA,SAAU;IACrBX,WAAW,EAAEA,WAAY;IACzBc,MAAM,EAAE;EAAE,CACX,CACK,CAEoB,CAC7B,CAAC;AAEV,CAAC,CAAC"}
@@ -6,18 +6,18 @@ import { getEllipsis } from '../_styles/mixins';
6
6
  import { spacing } from '../_styles/spacing';
7
7
  export var StyledDropdownFlyout = /*#__PURE__*/styled.div.withConfig({
8
8
  displayName: "StyledDropdownFlyout",
9
- componentId: "core-12_14_0__sc-1i79jsg-0"
9
+ componentId: "core-12_16_0__sc-1i79jsg-0"
10
10
  })(["display:flex;flex-wrap:wrap;flex-direction:column;width:100%;max-height:855px;padding:", "px 0;"], spacing.sm);
11
11
  export var StyledDropdownFlyoutItem = /*#__PURE__*/styled.div.withConfig({
12
12
  displayName: "StyledDropdownFlyoutItem",
13
- componentId: "core-12_14_0__sc-1i79jsg-1"
13
+ componentId: "core-12_16_0__sc-1i79jsg-1"
14
14
  })(["display:flex;justify-content:space-between;cursor:pointer;width:100%;padding:", "px ", "px;color:", ";", " &[data-highlighted='true'],&:hover{background-color:", ";}"], spacing.xs, spacing.lg, colors.gray20, getTypographyIntent('body'), colors.gray96);
15
15
  export var StyledDropdownFlyoutLabel = /*#__PURE__*/styled.span.withConfig({
16
16
  displayName: "StyledDropdownFlyoutLabel",
17
- componentId: "core-12_14_0__sc-1i79jsg-2"
17
+ componentId: "core-12_16_0__sc-1i79jsg-2"
18
18
  })(["", ""], getEllipsis());
19
19
  export var StyledDropdownFlyoutExpandIcon = /*#__PURE__*/styled.span.withConfig({
20
20
  displayName: "StyledDropdownFlyoutExpandIcon",
21
- componentId: "core-12_14_0__sc-1i79jsg-3"
21
+ componentId: "core-12_16_0__sc-1i79jsg-3"
22
22
  })(["position:relative;display:inline-flex;align-self:center;flex-shrink:0;margin-left:", "px;white-space:nowrap;", ""], spacing.lg, arrowRight(4, 'black'));
23
23
  //# sourceMappingURL=DropdownFlyout.styles.js.map
@@ -92,28 +92,26 @@ export interface DropdownFlyoutProps extends Omit<DivAttributes, 'onClick'> {
92
92
  */
93
93
  icon?: DropdownProps['icon'];
94
94
  /**
95
- * <div>
96
- * Data of the dropdown options - <Code>Option[]</Code>
97
- * <CodeBlock>
98
- * {`type Option = { label: string; children?: Option[] }`}
99
- * </CodeBlock>
100
- * </div>
95
+ * Data of the dropdown options - `Option[]`
96
+ * ```
97
+ * type Option = { label: string; children?: Option[] }
98
+ * ```
101
99
  * @since 10.19.0
102
100
  */
103
101
  options: DropdownOption[];
104
102
  /**
105
- * <div>
106
- * Callback for click on dropdown option
107
- * <CodeBlock>{'(option: Option) => void'}</CodeBlock>
108
- * </div>
103
+ * Callback for click on dropdown option
104
+ * ```
105
+ * (option: Option) => void
106
+ * ```
109
107
  * @since 10.19.0
110
108
  */
111
109
  onClick?: (option: DropdownOption) => void;
112
110
  /**
113
- * <div>
114
- * Render prop to specify custom dropdown option content
115
- * <CodeBlock>{'(option: Option) => ReactNode'}</CodeBlock>
116
- * </div>
111
+ * Render prop to specify custom dropdown option content
112
+ * ```
113
+ * (option: Option) => ReactNode
114
+ * ```
117
115
  * @since 10.19.0
118
116
  */
119
117
  optionRenderer?: (option: DropdownOption) => React.ReactNode;
@@ -1 +1 @@
1
- {"version":3,"file":"DropdownFlyout.types.js","names":["rootId"],"sources":["../../src/DropdownFlyout/DropdownFlyout.types.ts"],"sourcesContent":["import type { Ref } from 'react'\nimport type { DropdownProps } from '../Dropdown/Dropdown.types'\nimport type { OverlayProps } from '../Overlay/Overlay'\nimport type { DivAttributes, Placement, Props } from '../_utils/types'\n\nexport const rootId = 'ROOT_ID'\n\nexport type Action =\n | { type: 'highlight'; option: FlyoutOption }\n | { type: 'expand'; option: FlyoutOption }\n | { type: 'collapse'; option: FlyoutOption }\n | { type: 'close' }\n | { type: 'open' }\n | { type: 'setMouseOver'; isMouseOver: boolean }\n | { type: 'setFocused'; isFocused: boolean }\n | { type: 'updateOptions'; options: FlyoutOption[] }\n\ntype ExpandedItem = FlyoutOptionId\n\nexport type State = {\n highlighted: FlyoutOption\n expanded: ExpandedItem[]\n options: FlyoutOption[]\n isMouseOver: boolean\n isFocused: boolean\n isOpen: boolean\n}\n\nexport interface DropdownOption {\n value: any\n label: string\n children?: DropdownOption[]\n}\n\ntype OptionId = string\nexport interface FlyoutOption {\n /**\n * @since 10.19.0\n */\n id: OptionId\n /**\n * @since 10.19.0\n */\n parentId: OptionId | typeof rootId\n /**\n * @since 10.19.0\n */\n origin: DropdownOption\n /**\n * @since 10.19.0\n */\n children?: FlyoutOption[]\n}\n\nexport type FlyoutOptionId = FlyoutOption['id'] | typeof rootId\n\nexport interface FlyoutCaptionProps extends DivAttributes {\n option: DropdownOption\n highlighted: boolean\n optionRenderer: (option: DropdownOption) => React.ReactNode\n}\n\nexport interface FlyoutListProps extends DivAttributes {\n options: FlyoutOption[]\n overlayRef: Ref<HTMLDivElement>\n placement: Placement\n referenceEl: HTMLElement | null\n offset?: number\n}\n\nexport interface DropdownFlyoutProps extends Omit<DivAttributes, 'onClick'> {\n /**\n * @since 10.19.0\n */\n disabled?: DropdownProps['disabled']\n\n /**\n * The text of the button.\n * @since 10.19.0\n */\n label?: DropdownProps['label']\n /**\n * @since 10.19.0\n */\n loading?: DropdownProps['loading']\n\n /**\n * The icon of the button.\n * @since 10.19.0\n */\n icon?: DropdownProps['icon']\n\n /**\n * <div>\n * Data of the dropdown options - <Code>Option[]</Code>\n * <CodeBlock>\n * {`type Option = { label: string; children?: Option[] }`}\n * </CodeBlock>\n * </div>\n * @since 10.19.0\n */\n options: DropdownOption[]\n\n /**\n * <div>\n * Callback for click on dropdown option\n * <CodeBlock>{'(option: Option) => void'}</CodeBlock>\n * </div>\n * @since 10.19.0\n */\n onClick?: (option: DropdownOption) => void\n\n /**\n * <div>\n * Render prop to specify custom dropdown option content\n * <CodeBlock>{'(option: Option) => ReactNode'}</CodeBlock>\n * </div>\n * @since 10.19.0\n */\n optionRenderer?: (option: DropdownOption) => React.ReactNode\n\n /**\n * @default 'right-bottom'\n * @since 10.19.0\n */\n placement?: OverlayProps['placement']\n\n /**\n * The button size\n * @default 'md'\n * @since 10.19.0\n */\n size?: DropdownProps['size']\n\n /**\n * @default 'secondary'\n * @since 10.19.0\n */\n variant?: DropdownProps['variant']\n}\n\nexport interface FlyoutItemProps extends Props {\n option: FlyoutOption\n}\n"],"mappings":"AAKA,OAAO,IAAMA,MAAM,GAAG,SAAS"}
1
+ {"version":3,"file":"DropdownFlyout.types.js","names":["rootId"],"sources":["../../src/DropdownFlyout/DropdownFlyout.types.ts"],"sourcesContent":["import type { Ref } from 'react'\nimport type { DropdownProps } from '../Dropdown/Dropdown.types'\nimport type { OverlayProps } from '../Overlay/Overlay'\nimport type { DivAttributes, Placement, Props } from '../_utils/types'\n\nexport const rootId = 'ROOT_ID'\n\nexport type Action =\n | { type: 'highlight'; option: FlyoutOption }\n | { type: 'expand'; option: FlyoutOption }\n | { type: 'collapse'; option: FlyoutOption }\n | { type: 'close' }\n | { type: 'open' }\n | { type: 'setMouseOver'; isMouseOver: boolean }\n | { type: 'setFocused'; isFocused: boolean }\n | { type: 'updateOptions'; options: FlyoutOption[] }\n\ntype ExpandedItem = FlyoutOptionId\n\nexport type State = {\n highlighted: FlyoutOption\n expanded: ExpandedItem[]\n options: FlyoutOption[]\n isMouseOver: boolean\n isFocused: boolean\n isOpen: boolean\n}\n\nexport interface DropdownOption {\n value: any\n label: string\n children?: DropdownOption[]\n}\n\ntype OptionId = string\nexport interface FlyoutOption {\n /**\n * @since 10.19.0\n */\n id: OptionId\n /**\n * @since 10.19.0\n */\n parentId: OptionId | typeof rootId\n /**\n * @since 10.19.0\n */\n origin: DropdownOption\n /**\n * @since 10.19.0\n */\n children?: FlyoutOption[]\n}\n\nexport type FlyoutOptionId = FlyoutOption['id'] | typeof rootId\n\nexport interface FlyoutCaptionProps extends DivAttributes {\n option: DropdownOption\n highlighted: boolean\n optionRenderer: (option: DropdownOption) => React.ReactNode\n}\n\nexport interface FlyoutListProps extends DivAttributes {\n options: FlyoutOption[]\n overlayRef: Ref<HTMLDivElement>\n placement: Placement\n referenceEl: HTMLElement | null\n offset?: number\n}\n\nexport interface DropdownFlyoutProps extends Omit<DivAttributes, 'onClick'> {\n /**\n * @since 10.19.0\n */\n disabled?: DropdownProps['disabled']\n\n /**\n * The text of the button.\n * @since 10.19.0\n */\n label?: DropdownProps['label']\n /**\n * @since 10.19.0\n */\n loading?: DropdownProps['loading']\n\n /**\n * The icon of the button.\n * @since 10.19.0\n */\n icon?: DropdownProps['icon']\n\n /**\n * Data of the dropdown options - `Option[]`\n * ```\n * type Option = { label: string; children?: Option[] }\n * ```\n * @since 10.19.0\n */\n options: DropdownOption[]\n\n /**\n * Callback for click on dropdown option\n * ```\n * (option: Option) => void\n * ```\n * @since 10.19.0\n */\n onClick?: (option: DropdownOption) => void\n\n /**\n * Render prop to specify custom dropdown option content\n * ```\n * (option: Option) => ReactNode\n * ```\n * @since 10.19.0\n */\n optionRenderer?: (option: DropdownOption) => React.ReactNode\n\n /**\n * @default 'right-bottom'\n * @since 10.19.0\n */\n placement?: OverlayProps['placement']\n\n /**\n * The button size\n * @default 'md'\n * @since 10.19.0\n */\n size?: DropdownProps['size']\n\n /**\n * @default 'secondary'\n * @since 10.19.0\n */\n variant?: DropdownProps['variant']\n}\n\nexport interface FlyoutItemProps extends Props {\n option: FlyoutOption\n}\n"],"mappings":"AAKA,OAAO,IAAMA,MAAM,GAAG,SAAS"}
@@ -1,6 +1,6 @@
1
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
2
  var _dropErrorsByReason;
3
- var _excluded = ["error", "onDismiss", "qa"];
3
+ var _excluded = ["error", "onDismiss", "qa", "fileRejections"];
4
4
  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; }
5
5
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
6
  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); }
@@ -31,6 +31,7 @@ var DropzoneErrorBannerBase = /*#__PURE__*/React.forwardRef(function (_ref, ref)
31
31
  var error = _ref.error,
32
32
  onDismiss = _ref.onDismiss,
33
33
  qa = _ref.qa,
34
+ fileRejections = _ref.fileRejections,
34
35
  props = _objectWithoutProperties(_ref, _excluded);
35
36
  var I18n = useI18nContext();
36
37
  var _React$useState = React.useState(false),
@@ -94,7 +95,7 @@ export function MultipleErrors(props) {
94
95
  // make error banner accessible as a styled-components selector
95
96
  export var DropzoneErrorBanner = /*#__PURE__*/styled(DropzoneErrorBannerBase).withConfig({
96
97
  displayName: "DropzoneErrorBanner",
97
- componentId: "core-12_14_0__sc-l4fojb-0"
98
+ componentId: "core-12_16_0__sc-l4fojb-0"
98
99
  })([""]);
99
100
  function DropzoneContainer(_ref3) {
100
101
  var active = _ref3.active,
@@ -1 +1 @@
1
- {"version":3,"file":"Dropzone.js","names":["Ban","Image","equals","omit","React","styled","Banner","Button","Tooltip","Typography","useI18nContext","useResizeObserver","useFocusWithin","StyledDropzoneCaption","StyledDropzoneContainer","StyledDropzoneFocusDetector","StyledDropzoneIcon","StyledDropzoneMessage","StyledDropzoneWrapper","StyledErrorBanner","StyledErrorBannerDetails","StyledUploadButton","dropErrors","fileRejectionReason","extendedViewHeightBreakpoint","DropzoneErrorBannerBase","forwardRef","_ref","ref","error","onDismiss","qa","props","_objectWithoutProperties","_excluded","I18n","_React$useState","useState","_React$useState2","_slicedToArray","isExpanded","setExpanded","useEffect","title","body","message","type","reset","createElement","_extends","Content","Title","Body","Action","showErrorDetails","onClick","prev","t","Dismiss","hideError","ExpandableContent","expanded","MultipleErrors","_props$fileRejections","_messages","filesByErrorType","fileRejections","reduce","acc","rejection","errors","forEach","dropErrorType","dropErrorsByReason","code","push","file","_defineProperty","fileAmount","minFileSize","maxFileSize","fileType","oneFileAtATime","multipleErrors","messages","count","maxFiles","sizeInMegabytes","getSizeInMB","minSize","maxSize","map","errorType","files","length","key","weight","_ref2","name","DropzoneErrorBanner","withConfig","displayName","componentId","DropzoneContainer","_ref3","active","disabled","getRootProps","rootProps","children","DropzoneContent","_ref4","isIconVisible","contentMessage","DropzoneDefaultMessage","_ref5","open","multiple","errorMessage","Fragment","variant","Infinity","_dropErrorsByReason","Dropzone_","Dropzone","_ref6","forceIconVisibility","contentRenderer","tooltip","rootRef","inputRef","dragError","dropError","dispatchDropError","getInputProps","isDragActive","_ref6$rootProps","_ref6$inputProps","inputProps","className","_React$useState3","_React$useState4","setIsIconVisible","_useFocusWithin","isFocusWithin","containerProps","toggleIconVisibility","useCallback","entries","_ref7","target","height","offsetHeight","setResizeObserverTarget","current","useImperativeHandle","isDropzoneDisabled","Boolean","useMemo","validRootProps","validInputProps","direction","alignItems","trigger","overlay","memo"],"sources":["../../src/Dropzone/Dropzone.tsx"],"sourcesContent":["import { Ban, Image } from '@procore/core-icons/dist'\nimport { equals, omit } from 'ramda'\nimport React from 'react'\nimport styled from 'styled-components'\nimport { Banner } from '../Banner/Banner'\nimport { Button } from '../Button/Button'\nimport { Tooltip } from '../Tooltip/Tooltip'\nimport { Typography } from '../Typography/Typography'\nimport { useI18nContext } from '../_hooks/I18n'\nimport { useResizeObserver } from '../_hooks/ResizeObserver'\nimport { useFocusWithin } from '../_hooks/useFocusWithin'\nimport type { DivAttributes, Props } from '../_utils/types'\nimport {\n StyledDropzoneCaption,\n StyledDropzoneContainer,\n StyledDropzoneFocusDetector,\n StyledDropzoneIcon,\n StyledDropzoneMessage,\n StyledDropzoneWrapper,\n StyledErrorBanner,\n StyledErrorBannerDetails,\n StyledUploadButton,\n} from './Dropzone.styles'\nimport type {\n ContainerProps,\n ContentProps,\n DropErrorType,\n DropzoneContentProps,\n DropzoneErrorBannerProps,\n DropzoneInputProps,\n DropzoneProps,\n DropzoneRef,\n DropzoneRootProps,\n FileRejectionReason,\n MultipleErrorsProps,\n} from './Dropzone.types'\nimport { dropErrors, fileRejectionReason } from './Dropzone.types'\n\nconst extendedViewHeightBreakpoint = 172\n\nconst DropzoneErrorBannerBase = React.forwardRef<\n HTMLDivElement,\n DropzoneErrorBannerProps & DivAttributes\n>(({ error, onDismiss, qa, ...props }, ref) => {\n const I18n = useI18nContext()\n const [isExpanded, setExpanded] = React.useState(false)\n\n React.useEffect(() => {\n setExpanded(false)\n }, [error.title, error.body, error.message])\n\n if (error.type === dropErrors.reset) {\n return null\n }\n\n return (\n <StyledErrorBanner {...props} ref={ref}>\n <Banner.Content>\n <Banner.Title>{error.title}</Banner.Title>\n <Banner.Body>{error.message}</Banner.Body>\n </Banner.Content>\n {error.body ? (\n <Banner.Action>\n <Button\n data-qa={qa?.showErrorDetails}\n onClick={() => setExpanded((prev) => !prev)}\n >\n {isExpanded\n ? I18n.t('core.dropzone.hideDetails')\n : I18n.t('core.dropzone.showDetails')}\n </Button>\n </Banner.Action>\n ) : null}\n <Banner.Dismiss onClick={onDismiss} data-qa={qa?.hideError} />\n {error.body ? (\n <Banner.ExpandableContent expanded={isExpanded}>\n {error.body}\n </Banner.ExpandableContent>\n ) : null}\n </StyledErrorBanner>\n )\n})\n\nexport function MultipleErrors(props: MultipleErrorsProps) {\n const I18n = useI18nContext()\n\n const filesByErrorType = props.fileRejections.reduce(\n (acc, rejection) => {\n rejection.errors.forEach((error) => {\n const dropErrorType = dropErrorsByReason[error.code]\n acc[dropErrorType].push(rejection.file)\n })\n\n return acc\n },\n {\n [dropErrors.fileAmount]: [],\n [dropErrors.minFileSize]: [],\n [dropErrors.maxFileSize]: [],\n [dropErrors.fileType]: [],\n [dropErrors.oneFileAtATime]: [],\n [dropErrors.reset]: [],\n [dropErrors.multipleErrors]: [],\n } as Record<DropErrorType, File[]>\n )\n\n const messages: Record<DropErrorType, string> = {\n [dropErrors.fileAmount]: I18n.t('core.dropzone.maxFileNumberErrorGroup', {\n count: props.maxFiles,\n }),\n [dropErrors.minFileSize]: I18n.t('core.dropzone.minFileSizeErrorGroup', {\n sizeInMegabytes: getSizeInMB(props.minSize as number),\n }),\n [dropErrors.maxFileSize]: I18n.t('core.dropzone.maxFileSizeErrorGroup', {\n sizeInMegabytes: getSizeInMB(props.maxSize as number),\n }),\n [dropErrors.fileType]: I18n.t('core.dropzone.wrongFileTypeErrorGroup'),\n [dropErrors.reset]: '',\n [dropErrors.multipleErrors]: '',\n [dropErrors.oneFileAtATime]: '',\n }\n\n return (\n <div>\n {[\n dropErrors.fileAmount,\n dropErrors.fileType,\n dropErrors.maxFileSize,\n dropErrors.minFileSize,\n ].map((errorType) => {\n const files = filesByErrorType[errorType]\n return files.length ? (\n <div key={errorType}>\n <Typography weight=\"bold\">{messages[errorType]}</Typography>\n <StyledErrorBannerDetails>\n {filesByErrorType[errorType].map(({ name }) => (\n <li key={name}>{name}</li>\n ))}\n </StyledErrorBannerDetails>\n </div>\n ) : null\n })}\n </div>\n )\n}\n\n// make error banner accessible as a styled-components selector\nexport const DropzoneErrorBanner = styled(DropzoneErrorBannerBase)``\n\nfunction DropzoneContainer({\n active,\n disabled,\n getRootProps,\n rootProps,\n children,\n}: ContainerProps & Props) {\n return (\n <StyledDropzoneContainer\n {...getRootProps(rootProps)}\n active={active}\n disabled={disabled}\n >\n {children}\n </StyledDropzoneContainer>\n )\n}\n\nfunction DropzoneContent({\n disabled,\n isIconVisible,\n contentMessage,\n}: ContentProps) {\n return (\n <StyledDropzoneMessage>\n {isIconVisible && (\n <StyledDropzoneIcon disabled={disabled}>\n {disabled ? <Ban /> : <Image />}\n </StyledDropzoneIcon>\n )}\n {contentMessage}\n </StyledDropzoneMessage>\n )\n}\n\nexport function DropzoneDefaultMessage({\n open,\n disabled,\n multiple,\n errorMessage,\n}: DropzoneContentProps & { multiple: boolean }) {\n const I18n = useI18nContext()\n\n return (\n <>\n <StyledUploadButton\n variant=\"secondary\"\n onClick={open}\n disabled={disabled}\n >\n {I18n.t('core.dropzone.uploadFiles', {\n count: multiple ? Infinity : 1,\n })}\n </StyledUploadButton>\n <StyledDropzoneCaption error={!!errorMessage}>\n {errorMessage || I18n.t('core.dropzone.dragAndDrop')}\n </StyledDropzoneCaption>\n </>\n )\n}\n\nconst dropErrorsByReason = {\n [fileRejectionReason.maxFiles]: dropErrors.fileAmount,\n [fileRejectionReason.maxFileSize]: dropErrors.maxFileSize,\n [fileRejectionReason.minFileSize]: dropErrors.minFileSize,\n [fileRejectionReason.fileType]: dropErrors.fileType,\n} as Record<FileRejectionReason, DropErrorType>\n\nconst getSizeInMB = (maxSize: number): number => maxSize / 10e5\n\nconst Dropzone_ = React.forwardRef<DropzoneRef, DropzoneProps>(\n function Dropzone(\n {\n isIconVisible: forceIconVisibility,\n contentRenderer,\n disabled,\n tooltip,\n rootRef,\n inputRef,\n dragError,\n dropError,\n dispatchDropError,\n getRootProps,\n getInputProps,\n isDragActive,\n multiple,\n fileRejections,\n open,\n rootProps = {} as DropzoneRootProps,\n inputProps = {} as DropzoneInputProps,\n className,\n qa,\n },\n ref\n ) {\n const [isIconVisible, setIsIconVisible] = React.useState(false)\n const { isFocusWithin, containerProps } = useFocusWithin()\n\n const toggleIconVisibility = React.useCallback(\n (entries: ResizeObserverEntry[]) => {\n const { offsetHeight: height } = entries[0].target as HTMLElement\n setIsIconVisible(height >= extendedViewHeightBreakpoint)\n },\n [setIsIconVisible]\n )\n\n const setResizeObserverTarget = useResizeObserver(toggleIconVisibility)\n\n React.useEffect(() => {\n setResizeObserverTarget(rootRef.current)\n }, [rootRef, setResizeObserverTarget])\n\n React.useImperativeHandle(ref, () => ({\n rootRef: rootRef as React.RefObject<HTMLElement>,\n inputRef: inputRef as React.RefObject<HTMLInputElement>,\n open,\n }))\n\n const isDropzoneDisabled = disabled || Boolean(dragError)\n\n const contentMessage = React.useMemo(\n () =>\n contentRenderer ? (\n contentRenderer({\n open,\n disabled: isDropzoneDisabled,\n errorMessage: dragError,\n })\n ) : (\n <DropzoneDefaultMessage\n open={open}\n disabled={isDropzoneDisabled}\n errorMessage={dragError}\n multiple={multiple}\n />\n ),\n [contentRenderer, open, isDropzoneDisabled, dragError, multiple]\n )\n\n const validRootProps = React.useMemo(\n () => omit(['disabled'], rootProps),\n [rootProps]\n )\n\n const validInputProps = React.useMemo(\n () => omit(['accept', 'multiple', 'type'], inputProps),\n [inputProps]\n )\n\n return (\n <StyledDropzoneWrapper\n direction=\"column\"\n alignItems=\"stretch\"\n className={className}\n >\n <Tooltip\n trigger={Boolean(tooltip) ? 'hover' : 'none'}\n overlay={tooltip || ''}\n >\n <StyledDropzoneFocusDetector {...containerProps}>\n <DropzoneContainer\n rootProps={validRootProps}\n active={isDragActive || isFocusWithin}\n disabled={isDropzoneDisabled}\n getRootProps={getRootProps}\n >\n <input type=\"file\" {...getInputProps(validInputProps)} />\n <DropzoneContent\n disabled={isDropzoneDisabled}\n isIconVisible={\n typeof forceIconVisibility === 'undefined'\n ? isIconVisible\n : forceIconVisibility\n }\n contentMessage={contentMessage}\n />\n </DropzoneContainer>\n </StyledDropzoneFocusDetector>\n </Tooltip>\n <DropzoneErrorBanner\n qa={qa}\n error={dropError}\n fileRejections={fileRejections}\n onDismiss={() => dispatchDropError(dropErrors.reset)}\n />\n </StyledDropzoneWrapper>\n )\n }\n)\n\nDropzoneContainer.displayName = 'DropzoneContainer'\n\nDropzoneContent.displayName = 'DropzoneContent'\n\nDropzone_.displayName = 'Dropzone'\n\n/**\n\n Dropzones allow users to quickly upload files from their computers, as well\n as optionally launch the file select component.\n\n @since 10.19.0\n\n @see [Storybook](https://stories.core.procore.com/?path=/story/core-react_demos-dropzone--demo)\n\n @see [Design Guidelines](https://design.procore.com/dropzone)\n\n*/\nexport const Dropzone = React.memo(Dropzone_, equals)\n"],"mappings":";;;;;;;;;;;;;;;AAAA,SAASA,GAAG,EAAEC,KAAK,QAAQ,0BAA0B;AACrD,SAASC,MAAM,EAAEC,IAAI,QAAQ,OAAO;AACpC,OAAOC,KAAK,MAAM,OAAO;AACzB,OAAOC,MAAM,MAAM,mBAAmB;AACtC,SAASC,MAAM,QAAQ,kBAAkB;AACzC,SAASC,MAAM,QAAQ,kBAAkB;AACzC,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,UAAU,QAAQ,0BAA0B;AACrD,SAASC,cAAc,QAAQ,gBAAgB;AAC/C,SAASC,iBAAiB,QAAQ,0BAA0B;AAC5D,SAASC,cAAc,QAAQ,0BAA0B;AAEzD,SACEC,qBAAqB,EACrBC,uBAAuB,EACvBC,2BAA2B,EAC3BC,kBAAkB,EAClBC,qBAAqB,EACrBC,qBAAqB,EACrBC,iBAAiB,EACjBC,wBAAwB,EACxBC,kBAAkB,QACb,mBA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CAAC"}
1
+ {"version":3,"file":"Dropzone.js","names":["Ban","Image","equals","omit","React","styled","Banner","Button","Tooltip","Typography","useI18nContext","useResizeObserver","useFocusWithin","StyledDropzoneCaption","StyledDropzoneContainer","StyledDropzoneFocusDetector","StyledDropzoneIcon","StyledDropzoneMessage","StyledDropzoneWrapper","StyledErrorBanner","StyledErrorBannerDetails","StyledUploadButton","dropErrors","fileRejectionReason","extendedViewHeightBreakpoint","DropzoneErrorBannerBase","forwardRef","_ref","ref","error","onDismiss","qa","fileRejections","props","_objectWithoutProperties","_excluded","I18n","_React$useState","useState","_React$useState2","_slicedToArray","isExpanded","setExpanded","useEffect","title","body","message","type","reset","createElement","_extends","Content","Title","Body","Action","showErrorDetails","onClick","prev","t","Dismiss","hideError","ExpandableContent","expanded","MultipleErrors","_props$fileRejections","_messages","filesByErrorType","reduce","acc","rejection","errors","forEach","dropErrorType","dropErrorsByReason","code","push","file","_defineProperty","fileAmount","minFileSize","maxFileSize","fileType","oneFileAtATime","multipleErrors","messages","count","maxFiles","sizeInMegabytes","getSizeInMB","minSize","maxSize","map","errorType","files","length","key","weight","_ref2","name","DropzoneErrorBanner","withConfig","displayName","componentId","DropzoneContainer","_ref3","active","disabled","getRootProps","rootProps","children","DropzoneContent","_ref4","isIconVisible","contentMessage","DropzoneDefaultMessage","_ref5","open","multiple","errorMessage","Fragment","variant","Infinity","_dropErrorsByReason","Dropzone_","Dropzone","_ref6","forceIconVisibility","contentRenderer","tooltip","rootRef","inputRef","dragError","dropError","dispatchDropError","getInputProps","isDragActive","_ref6$rootProps","_ref6$inputProps","inputProps","className","_React$useState3","_React$useState4","setIsIconVisible","_useFocusWithin","isFocusWithin","containerProps","toggleIconVisibility","useCallback","entries","_ref7","target","height","offsetHeight","setResizeObserverTarget","current","useImperativeHandle","isDropzoneDisabled","Boolean","useMemo","validRootProps","validInputProps","direction","alignItems","trigger","overlay","memo"],"sources":["../../src/Dropzone/Dropzone.tsx"],"sourcesContent":["import { Ban, Image } from '@procore/core-icons/dist'\nimport { equals, omit } from 'ramda'\nimport React from 'react'\nimport styled from 'styled-components'\nimport { Banner } from '../Banner/Banner'\nimport { Button } from '../Button/Button'\nimport { Tooltip } from '../Tooltip/Tooltip'\nimport { Typography } from '../Typography/Typography'\nimport { useI18nContext } from '../_hooks/I18n'\nimport { useResizeObserver } from '../_hooks/ResizeObserver'\nimport { useFocusWithin } from '../_hooks/useFocusWithin'\nimport type { DivAttributes, Props } from '../_utils/types'\nimport {\n StyledDropzoneCaption,\n StyledDropzoneContainer,\n StyledDropzoneFocusDetector,\n StyledDropzoneIcon,\n StyledDropzoneMessage,\n StyledDropzoneWrapper,\n StyledErrorBanner,\n StyledErrorBannerDetails,\n StyledUploadButton,\n} from './Dropzone.styles'\nimport type {\n ContainerProps,\n ContentProps,\n DropErrorType,\n DropzoneContentProps,\n DropzoneErrorBannerProps,\n DropzoneInputProps,\n DropzoneProps,\n DropzoneRef,\n DropzoneRootProps,\n FileRejectionReason,\n MultipleErrorsProps,\n} from './Dropzone.types'\nimport { dropErrors, fileRejectionReason } from './Dropzone.types'\n\nconst extendedViewHeightBreakpoint = 172\n\nconst DropzoneErrorBannerBase = React.forwardRef<\n HTMLDivElement,\n DropzoneErrorBannerProps & DivAttributes\n>(({ error, onDismiss, qa, fileRejections, ...props }, ref) => {\n const I18n = useI18nContext()\n const [isExpanded, setExpanded] = React.useState(false)\n\n React.useEffect(() => {\n setExpanded(false)\n }, [error.title, error.body, error.message])\n\n if (error.type === dropErrors.reset) {\n return null\n }\n\n return (\n <StyledErrorBanner {...props} ref={ref}>\n <Banner.Content>\n <Banner.Title>{error.title}</Banner.Title>\n <Banner.Body>{error.message}</Banner.Body>\n </Banner.Content>\n {error.body ? (\n <Banner.Action>\n <Button\n data-qa={qa?.showErrorDetails}\n onClick={() => setExpanded((prev) => !prev)}\n >\n {isExpanded\n ? I18n.t('core.dropzone.hideDetails')\n : I18n.t('core.dropzone.showDetails')}\n </Button>\n </Banner.Action>\n ) : null}\n <Banner.Dismiss onClick={onDismiss} data-qa={qa?.hideError} />\n {error.body ? (\n <Banner.ExpandableContent expanded={isExpanded}>\n {error.body}\n </Banner.ExpandableContent>\n ) : null}\n </StyledErrorBanner>\n )\n})\n\nexport function MultipleErrors(props: MultipleErrorsProps) {\n const I18n = useI18nContext()\n\n const filesByErrorType = props.fileRejections.reduce(\n (acc, rejection) => {\n rejection.errors.forEach((error) => {\n const dropErrorType = dropErrorsByReason[error.code]\n acc[dropErrorType].push(rejection.file)\n })\n\n return acc\n },\n {\n [dropErrors.fileAmount]: [],\n [dropErrors.minFileSize]: [],\n [dropErrors.maxFileSize]: [],\n [dropErrors.fileType]: [],\n [dropErrors.oneFileAtATime]: [],\n [dropErrors.reset]: [],\n [dropErrors.multipleErrors]: [],\n } as Record<DropErrorType, File[]>\n )\n\n const messages: Record<DropErrorType, string> = {\n [dropErrors.fileAmount]: I18n.t('core.dropzone.maxFileNumberErrorGroup', {\n count: props.maxFiles,\n }),\n [dropErrors.minFileSize]: I18n.t('core.dropzone.minFileSizeErrorGroup', {\n sizeInMegabytes: getSizeInMB(props.minSize as number),\n }),\n [dropErrors.maxFileSize]: I18n.t('core.dropzone.maxFileSizeErrorGroup', {\n sizeInMegabytes: getSizeInMB(props.maxSize as number),\n }),\n [dropErrors.fileType]: I18n.t('core.dropzone.wrongFileTypeErrorGroup'),\n [dropErrors.reset]: '',\n [dropErrors.multipleErrors]: '',\n [dropErrors.oneFileAtATime]: '',\n }\n\n return (\n <div>\n {[\n dropErrors.fileAmount,\n dropErrors.fileType,\n dropErrors.maxFileSize,\n dropErrors.minFileSize,\n ].map((errorType) => {\n const files = filesByErrorType[errorType]\n return files.length ? (\n <div key={errorType}>\n <Typography weight=\"bold\">{messages[errorType]}</Typography>\n <StyledErrorBannerDetails>\n {filesByErrorType[errorType].map(({ name }) => (\n <li key={name}>{name}</li>\n ))}\n </StyledErrorBannerDetails>\n </div>\n ) : null\n })}\n </div>\n )\n}\n\n// make error banner accessible as a styled-components selector\nexport const DropzoneErrorBanner = styled(DropzoneErrorBannerBase)``\n\nfunction DropzoneContainer({\n active,\n disabled,\n getRootProps,\n rootProps,\n children,\n}: ContainerProps & Props) {\n return (\n <StyledDropzoneContainer\n {...getRootProps(rootProps)}\n active={active}\n disabled={disabled}\n >\n {children}\n </StyledDropzoneContainer>\n )\n}\n\nfunction DropzoneContent({\n disabled,\n isIconVisible,\n contentMessage,\n}: ContentProps) {\n return (\n <StyledDropzoneMessage>\n {isIconVisible && (\n <StyledDropzoneIcon disabled={disabled}>\n {disabled ? <Ban /> : <Image />}\n </StyledDropzoneIcon>\n )}\n {contentMessage}\n </StyledDropzoneMessage>\n )\n}\n\nexport function DropzoneDefaultMessage({\n open,\n disabled,\n multiple,\n errorMessage,\n}: DropzoneContentProps & { multiple: boolean }) {\n const I18n = useI18nContext()\n\n return (\n <>\n <StyledUploadButton\n variant=\"secondary\"\n onClick={open}\n disabled={disabled}\n >\n {I18n.t('core.dropzone.uploadFiles', {\n count: multiple ? Infinity : 1,\n })}\n </StyledUploadButton>\n <StyledDropzoneCaption error={!!errorMessage}>\n {errorMessage || I18n.t('core.dropzone.dragAndDrop')}\n </StyledDropzoneCaption>\n </>\n )\n}\n\nconst dropErrorsByReason = {\n [fileRejectionReason.maxFiles]: dropErrors.fileAmount,\n [fileRejectionReason.maxFileSize]: dropErrors.maxFileSize,\n [fileRejectionReason.minFileSize]: dropErrors.minFileSize,\n [fileRejectionReason.fileType]: dropErrors.fileType,\n} as Record<FileRejectionReason, DropErrorType>\n\nconst getSizeInMB = (maxSize: number): number => maxSize / 10e5\n\nconst Dropzone_ = React.forwardRef<DropzoneRef, DropzoneProps>(\n function Dropzone(\n {\n isIconVisible: forceIconVisibility,\n contentRenderer,\n disabled,\n tooltip,\n rootRef,\n inputRef,\n dragError,\n dropError,\n dispatchDropError,\n getRootProps,\n getInputProps,\n isDragActive,\n multiple,\n fileRejections,\n open,\n rootProps = {} as DropzoneRootProps,\n inputProps = {} as DropzoneInputProps,\n className,\n qa,\n },\n ref\n ) {\n const [isIconVisible, setIsIconVisible] = React.useState(false)\n const { isFocusWithin, containerProps } = useFocusWithin()\n\n const toggleIconVisibility = React.useCallback(\n (entries: ResizeObserverEntry[]) => {\n const { offsetHeight: height } = entries[0].target as HTMLElement\n setIsIconVisible(height >= extendedViewHeightBreakpoint)\n },\n [setIsIconVisible]\n )\n\n const setResizeObserverTarget = useResizeObserver(toggleIconVisibility)\n\n React.useEffect(() => {\n setResizeObserverTarget(rootRef.current)\n }, [rootRef, setResizeObserverTarget])\n\n React.useImperativeHandle(ref, () => ({\n rootRef: rootRef as React.RefObject<HTMLElement>,\n inputRef: inputRef as React.RefObject<HTMLInputElement>,\n open,\n }))\n\n const isDropzoneDisabled = disabled || Boolean(dragError)\n\n const contentMessage = React.useMemo(\n () =>\n contentRenderer ? (\n contentRenderer({\n open,\n disabled: isDropzoneDisabled,\n errorMessage: dragError,\n })\n ) : (\n <DropzoneDefaultMessage\n open={open}\n disabled={isDropzoneDisabled}\n errorMessage={dragError}\n multiple={multiple}\n />\n ),\n [contentRenderer, open, isDropzoneDisabled, dragError, multiple]\n )\n\n const validRootProps = React.useMemo(\n () => omit(['disabled'], rootProps),\n [rootProps]\n )\n\n const validInputProps = React.useMemo(\n () => omit(['accept', 'multiple', 'type'], inputProps),\n [inputProps]\n )\n\n return (\n <StyledDropzoneWrapper\n direction=\"column\"\n alignItems=\"stretch\"\n className={className}\n >\n <Tooltip\n trigger={Boolean(tooltip) ? 'hover' : 'none'}\n overlay={tooltip || ''}\n >\n <StyledDropzoneFocusDetector {...containerProps}>\n <DropzoneContainer\n rootProps={validRootProps}\n active={isDragActive || isFocusWithin}\n disabled={isDropzoneDisabled}\n getRootProps={getRootProps}\n >\n <input type=\"file\" {...getInputProps(validInputProps)} />\n <DropzoneContent\n disabled={isDropzoneDisabled}\n isIconVisible={\n typeof forceIconVisibility === 'undefined'\n ? isIconVisible\n : forceIconVisibility\n }\n contentMessage={contentMessage}\n />\n </DropzoneContainer>\n </StyledDropzoneFocusDetector>\n </Tooltip>\n <DropzoneErrorBanner\n qa={qa}\n error={dropError}\n fileRejections={fileRejections}\n onDismiss={() => dispatchDropError(dropErrors.reset)}\n />\n </StyledDropzoneWrapper>\n )\n }\n)\n\nDropzoneContainer.displayName = 'DropzoneContainer'\n\nDropzoneContent.displayName = 'DropzoneContent'\n\nDropzone_.displayName = 'Dropzone'\n\n/**\n\n Dropzones allow users to quickly upload files from their computers, as well\n as optionally launch the file select component.\n\n @since 10.19.0\n\n @see [Storybook](https://stories.core.procore.com/?path=/story/core-react_demos-dropzone--demo)\n\n @see [Design Guidelines](https://design.procore.com/dropzone)\n\n*/\nexport const Dropzone = React.memo(Dropzone_, equals)\n"],"mappings":";;;;;;;;;;;;;;;AAAA,SAASA,GAAG,EAAEC,KAAK,QAAQ,0BAA0B;AACrD,SAASC,MAAM,EAAEC,IAAI,QAAQ,OAAO;AACpC,OAAOC,KAAK,MAAM,OAAO;AACzB,OAAOC,MAAM,MAAM,mBAAmB;AACtC,SAASC,MAAM,QAAQ,kBAAkB;AACzC,SAASC,MAAM,QAAQ,kBAAkB;AACzC,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,UAAU,QAAQ,0BAA0B;AACrD,SAASC,cAAc,QAAQ,gBAAgB;AAC/C,SAASC,iBAAiB,QAAQ,0BAA0B;AAC5D,SAASC,cAAc,QAAQ,0BAA0B;AAEzD,SACEC,qBAAqB,EACrBC,uBAAuB,EACvBC,2BAA2B,EAC3BC,kBAAkB,EAClBC,qBAAqB,EACrBC,qBAAqB,EACrBC,iBAAiB,EACjBC,wBAAwB,EACxBC,kBAAkB,QACb,mBAAmB;AAc1B,SAASC,UAAU,EAAEC,mBAAmB,QAAQ,kBAAkB;AAElE,IAAMC,4BAA4B,GAAG,GAAG;AAExC,IAAMC,uBAAuB,gBAAGrB,KAAK,CAACsB,UAAU,CAG9C,UAAAC,IAAA,EAAqDC,GAAG,EAAK;EAAA,IAA1DC,KAA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EvB5H,KAAA,CAAA6C,aAAA,CAAClC,2BAA2B,EAAKkI,cAAc,eAC7C7I,KAAA,CAAA6C,aAAA,CAACsD,iBAAiB;IAChBK,SAAS,EAAEmD,cAAe;IAC1BtD,MAAM,EAAE8B,YAAY,IAAIS,aAAc;IACtCtC,QAAQ,EAAEkD,kBAAmB;IAC7BjD,YAAY,EAAEA;EAAa,gBAE3BvG,KAAA,CAAA6C,aAAA,UAAAC,QAAA;IAAOH,IAAI,EAAC;EAAM,GAAKuF,aAAa,CAAC0B,eAAe,CAAC,CAAG,CAAC,eACzD5J,KAAA,CAAA6C,aAAA,CAAC6D,eAAe;IACdJ,QAAQ,EAAEkD,kBAAmB;IAC7B5C,aAAa,EACX,OAAOc,mBAAmB,KAAK,WAAW,GACtCd,aAAa,GACbc,mBACL;IACDb,cAAc,EAAEA;EAAe,CAChC,CACgB,CACQ,CACtB,CAAC,eACV7G,KAAA,CAAA6C,aAAA,CAACkD,mBAAmB;IAClBpE,EAAE,EAAEA,EAAG;IACPF,KAAK,EAAEuG,SAAU;IACjBpG,cAAc,EAAEA,cAAe;IAC/BF,SAAS,EAAE,SAAAA,UAAA;MAAA,OAAMuG,iBAAiB,CAAC/G,UAAU,CAAC0B,KAAK,CAAC;IAAA;EAAC,CACtD,CACoB,CAAC;AAE5B,CACF,CAAC;AAEDuD,iBAAiB,CAACF,WAAW,GAAG,mBAAmB;AAEnDS,eAAe,CAACT,WAAW,GAAG,iBAAiB;AAE/CsB,SAAS,CAACtB,WAAW,GAAG,UAAU;;AAElC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAMuB,QAAQ,gBAAGxH,KAAK,CAACiK,IAAI,CAAC1C,SAAS,EAAEzH,MAAM,CAAC"}
@@ -9,15 +9,15 @@ import { colors } from '../_styles/colors';
9
9
  import { spacing } from '../_styles/spacing';
10
10
  export var StyledErrorBanner = /*#__PURE__*/styled(ErrorBannerBase).withConfig({
11
11
  displayName: "StyledErrorBanner",
12
- componentId: "core-12_14_0__sc-by95hy-0"
12
+ componentId: "core-12_16_0__sc-by95hy-0"
13
13
  })(["margin-top:", "px;flex-shrink:0;"], spacing.lg);
14
14
  export var StyledErrorBannerDetails = /*#__PURE__*/styled.ul.withConfig({
15
15
  displayName: "StyledErrorBannerDetails",
16
- componentId: "core-12_14_0__sc-by95hy-1"
16
+ componentId: "core-12_16_0__sc-by95hy-1"
17
17
  })(["margin:", "px;padding:0;list-style-position:inside;list-style-type:disc;"], spacing.xs);
18
18
  export var StyledDropzoneIcon = /*#__PURE__*/styled.div.withConfig({
19
19
  displayName: "StyledDropzoneIcon",
20
- componentId: "core-12_14_0__sc-by95hy-2"
20
+ componentId: "core-12_16_0__sc-by95hy-2"
21
21
  })(["display:flex;justify-content:center;align-items:center;height:64px;color:", ";margin-bottom:", "px;transition:all 250ms ease-out;", " svg{width:auto;height:100%;}"], colors.gray45, spacing.lg, function (_ref) {
22
22
  var disabled = _ref.disabled;
23
23
  return disabled && css(["height:72px;margin-bottom:", "px;"], spacing.sm);
@@ -26,7 +26,7 @@ var activeDropzone = /*#__PURE__*/css(["outline:none;border:2px dashed ", ";back
26
26
  var disabledDropzone = /*#__PURE__*/css(["color:", ";border:2px dashed ", ";background-color:", ";cursor:not-allowed;& ", "{color:", ";transform:none;}"], colors.gray70, colors.gray85, colors.gray98, StyledDropzoneIcon, colors.gray85);
27
27
  export var StyledDropzoneContainer = /*#__PURE__*/styled.div.withConfig({
28
28
  displayName: "StyledDropzoneContainer",
29
- componentId: "core-12_14_0__sc-by95hy-3"
29
+ componentId: "core-12_16_0__sc-by95hy-3"
30
30
  })(["", " display:inline-flex;justify-content:center;align-items:center;box-sizing:border-box;width:100%;height:100%;min-height:92px;padding:", "px;color:", ";border:2px dashed ", ";background-color:", ";border-radius:", "px;text-align:center;letter-spacing:0.25px;transition:all 250ms ease-out;cursor:grab;", " ", " ", " ", ""], getTypographyIntent('body'), spacing.lg, colors.gray40, colors.gray70, colors.gray96, borderRadius.md, function (_ref2) {
31
31
  var disabled = _ref2.disabled;
32
32
  return !disabled && css(["&:hover{", "}"], activeDropzone);
@@ -43,25 +43,25 @@ export var StyledDropzoneContainer = /*#__PURE__*/styled.div.withConfig({
43
43
  });
44
44
  export var StyledDropzoneMessage = /*#__PURE__*/styled.div.withConfig({
45
45
  displayName: "StyledDropzoneMessage",
46
- componentId: "core-12_14_0__sc-by95hy-4"
46
+ componentId: "core-12_16_0__sc-by95hy-4"
47
47
  })(["user-select:none;"]);
48
48
  export var StyledUploadButton = /*#__PURE__*/styled(Button).withConfig({
49
49
  displayName: "StyledUploadButton",
50
- componentId: "core-12_14_0__sc-by95hy-5"
50
+ componentId: "core-12_16_0__sc-by95hy-5"
51
51
  })(["display:block;margin-left:auto;margin-right:auto;margin-bottom:", "px;"], spacing.sm);
52
52
  export var StyledDropzoneCaption = /*#__PURE__*/styled.span.withConfig({
53
53
  displayName: "StyledDropzoneCaption",
54
- componentId: "core-12_14_0__sc-by95hy-6"
54
+ componentId: "core-12_16_0__sc-by95hy-6"
55
55
  })(["color:", ";"], function (_ref6) {
56
56
  var error = _ref6.error;
57
57
  return error && colors.gray15;
58
58
  });
59
59
  export var StyledDropzoneWrapper = /*#__PURE__*/styled(Flex).withConfig({
60
60
  displayName: "StyledDropzoneWrapper",
61
- componentId: "core-12_14_0__sc-by95hy-7"
61
+ componentId: "core-12_16_0__sc-by95hy-7"
62
62
  })(["height:100%;"]);
63
63
  export var StyledDropzoneFocusDetector = /*#__PURE__*/styled(Box).withConfig({
64
64
  displayName: "StyledDropzoneFocusDetector",
65
- componentId: "core-12_14_0__sc-by95hy-8"
65
+ componentId: "core-12_16_0__sc-by95hy-8"
66
66
  })(["height:100%;"]);
67
67
  //# sourceMappingURL=Dropzone.styles.js.map
@@ -12,12 +12,12 @@ export interface DropzoneErrorBannerProps {
12
12
  error: DropzoneHookState['dropError'];
13
13
  /**
14
14
  * Rejected files and why they were rejected
15
- * <CodeBlock>
16
- * {`{
15
+ * ```
16
+ * {
17
17
  * file: File,
18
18
  * errors: FileError[]
19
- * }[]`}
20
- * </CodeBlock>
19
+ * }[]
20
+ * ```
21
21
  * @since 10.19.0
22
22
  */
23
23
  fileRejections: DropzoneHookState['fileRejections'];
@@ -79,7 +79,7 @@ export interface ContainerProps {
79
79
  export interface ContentProps {
80
80
  /**
81
81
  * Force icon visibility
82
- * <Code>NOTICE:</Code> passing <Code>true</Code> or <Code>false</Code>
82
+ * `NOTICE:` passing `true` or `false`
83
83
  * value explicitly will make component ignore resizing.
84
84
  * @since 10.19.0
85
85
  */
@@ -170,17 +170,17 @@ export declare type DropzoneHookState = DropzoneState & {
170
170
  multiple: boolean;
171
171
  /**
172
172
  * Error message if dragged files is rejected
173
- * <CodeBlock>
174
- * {`{ type: DropErrorType, title: string, message: string }`}
175
- * </CodeBlock>
173
+ * ```
174
+ * { type: DropErrorType, title: string, message: string }
175
+ * ```
176
176
  * @since 10.19.0
177
177
  */
178
178
  dragError: string;
179
179
  /**
180
180
  * Error message if dropped files is rejected
181
- * <CodeBlock>
182
- * {`{ type: DropErrorType, title: string, message: string }`}
183
- * </CodeBlock>
181
+ * ```
182
+ * { type: DropErrorType, title: string, message: string }
183
+ * ```
184
184
  * @since 10.19.0
185
185
  */
186
186
  dropError: DropError;
@@ -191,8 +191,10 @@ export declare type DropzoneHookState = DropzoneState & {
191
191
  */
192
192
  disabled: boolean;
193
193
  /**
194
- * Sets <Code>dropError</Code>.
195
- * <CodeBlock>{'(error: DropErrorType) => void'}</CodeBlock>
194
+ * Sets `dropError`.
195
+ * ```
196
+ * (error: DropErrorType) => void
197
+ * ```
196
198
  * @since 10.19.0
197
199
  */
198
200
  dispatchDropError: (error: DropErrorType) => void;
@@ -233,13 +235,13 @@ export interface DropzoneProps extends DropzoneHookState {
233
235
  */
234
236
  contentRenderer?: (props: DropzoneContentProps) => React.ReactNode;
235
237
  /**
236
- * <Code>NOTICE:</Code>
237
- * <br/>
238
- * <Code>true</Code> - will make Icon always visible, despite the component height
239
- * <br/>
240
- * <Code>false</Code> - will make Icon always hide, despite the component height
241
- * <br/>
242
- * <Code>undefined</Code> - will look on the component height to decide show or hide Icon
238
+ * `NOTICE:`
239
+ *
240
+ * `true` - will make Icon always visible, despite the component height
241
+ *
242
+ * `false` - will make Icon always hide, despite the component height
243
+ *
244
+ * `undefined` - will look on the component height to decide show or hide Icon
243
245
  * @since 10.19.0
244
246
  */
245
247
  isIconVisible?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"Dropzone.types.js","names":["fileRejectionReason","maxFiles","maxFileSize","minFileSize","fileType","dropErrors","fileAmount","oneFileAtATime","multipleErrors","reset"],"sources":["../../src/Dropzone/Dropzone.types.ts"],"sourcesContent":["import type React from 'react'\nimport type {\n DropzoneInputProps as DropzoneInputPropsBase,\n DropzoneOptions,\n DropzoneRootProps as DropzoneRootPropsBase,\n DropzoneState,\n} from 'react-dropzone'\nimport {\n type FileError as FileRejectionError,\n type FileRejection,\n} from 'react-dropzone'\n\nexport type DropzoneFile = any\n\nexport type FileRejectionReason = FileRejectionError['code']\n\nexport const fileRejectionReason: Record<string, FileRejectionReason> = {\n maxFiles: 'too-many-files',\n maxFileSize: 'file-too-large',\n minFileSize: 'file-too-small',\n fileType: 'file-invalid-type',\n}\n\nexport type { FileRejection, FileRejectionError }\n\nexport interface DropzoneErrorBannerProps {\n /**\n * @since 10.19.0\n */\n error: DropzoneHookState['dropError']\n\n /**\n * Rejected files and why they were rejected\n * <CodeBlock>\n * {`{\n * file: File,\n * errors: FileError[]\n * }[]`}\n * </CodeBlock>\n * @since 10.19.0\n */\n fileRejections: DropzoneHookState['fileRejections']\n /**\n * @since 10.19.0\n */\n onDismiss: () => void\n /**\n * @since 10.19.0\n */\n className?: string\n /**\n * @since 10.19.0\n */\n qa?: {\n showErrorDetails?: string\n hideError?: string\n }\n}\n\nexport interface MultipleErrorsProps {\n /**\n * @since 10.19.0\n */\n fileRejections: FileRejection[]\n /**\n * @since 10.19.0\n */\n maxFiles?: number\n /**\n * @since 10.19.0\n */\n maxSize?: number\n /**\n * @since 10.19.0\n */\n minSize?: number\n}\n\nexport interface ContainerProps {\n /**\n * Additional props for dropzone container element\n * @since 10.19.0\n */\n rootProps: DropzoneRootProps\n\n /**\n * Returns the props you should apply to the root drop container you render\n * @since 10.19.0\n */\n getRootProps: DropzoneState['getRootProps']\n /**\n * @since 10.19.0\n */\n active: boolean\n\n /**\n * Enable/disable the dropzone container\n * @since 10.19.0\n */\n disabled: boolean\n}\nexport interface ContentProps {\n /**\n * Force icon visibility\n * <Code>NOTICE:</Code> passing <Code>true</Code> or <Code>false</Code>\n * value explicitly will make component ignore resizing.\n * @since 10.19.0\n */\n isIconVisible: boolean\n\n /**\n * Enable/disable the dropzone content\n * @since 10.19.0\n */\n disabled: boolean\n /**\n * @since 10.19.0\n */\n contentMessage: React.ReactNode\n}\n\nexport interface DropzoneContentProps {\n /**\n * Open the native file selection dialog\n * @since 10.19.0\n */\n open: () => void\n\n /**\n * Enable/disable the dropzone content\n * @since 10.19.0\n */\n disabled: boolean\n /**\n * @since 10.19.0\n */\n errorMessage?: string\n}\n\nexport interface DropzoneHookProps\n extends Partial<Omit<DropzoneOptions, 'minSize' | 'maxSize'>> {\n /**\n * Array of already selected items\n * @since 10.19.0\n */\n value?: DropzoneFile[]\n\n /**\n * Maximum number files to the dropzone is allowed. All files above the limit\n * will be rejected.\n * @since 10.19.0\n */\n maxFileNumber?: number\n\n /**\n * Minimum file size (in bytes)\n * @since 10.19.0\n */\n minFileSize?: DropzoneOptions['minSize']\n\n /**\n * Maximum file size (in bytes)\n * @since 10.19.0\n */\n maxFileSize?: DropzoneOptions['maxSize']\n}\n\nexport const dropErrors = {\n fileType: 'FILE_TYPE_ERROR',\n fileAmount: 'FILE_AMOUNT_ERROR',\n maxFileSize: 'MAX_FILE_SIZE',\n minFileSize: 'MIN_FILE_SIZE',\n oneFileAtATime: 'ONE_FILE_AT_A_TIME',\n multipleErrors: 'MULTIPLE_ERRORS',\n reset: 'RESET',\n} as const\n\nexport type DropErrorType = (typeof dropErrors)[keyof typeof dropErrors]\n\nexport type DropError = {\n /**\n * @since 10.19.0\n */\n type: DropErrorType\n /**\n * @since 10.19.0\n */\n title: string\n /**\n * @since 10.19.0\n */\n message: string\n /**\n * @since 10.19.0\n */\n body?: React.ReactNode\n}\n\nexport type DropzoneHookState = DropzoneState & {\n /**\n * Allow drag 'n' drop (or selection from the file dialog) of multiple files\n * @default false\n * @since 10.19.0\n * */\n multiple: boolean\n\n /**\n * Error message if dragged files is rejected\n * <CodeBlock>\n * {`{ type: DropErrorType, title: string, message: string }`}\n * </CodeBlock>\n * @since 10.19.0\n */\n dragError: string\n\n /**\n * Error message if dropped files is rejected\n * <CodeBlock>\n * {`{ type: DropErrorType, title: string, message: string }`}\n * </CodeBlock>\n * @since 10.19.0\n */\n dropError: DropError\n\n /**\n * Enable/disable the dropzone\n * @default false\n * @since 10.19.0\n */\n disabled: boolean\n\n /**\n * Sets <Code>dropError</Code>.\n * <CodeBlock>{'(error: DropErrorType) => void'}</CodeBlock>\n * @since 10.19.0\n */\n dispatchDropError: (error: DropErrorType) => void\n}\n\n/**\n * WARNING\n * To keep component work as expected according to props passed to `useDropzone` hook\n * Some properties are omitted\n */\ntype FrozenDropzoneRootKeys = 'disabled'\n\ntype FrozenDropzoneRootProps = {\n [key in FrozenDropzoneRootKeys]?: never\n}\n\ntype FrozenDropzoneInputKeys = 'accept' | 'multiple' | 'type'\n\ntype FrozenDropzoneInputProps = {\n [key in FrozenDropzoneInputKeys]: never\n}\n\nexport type DropzoneRootProps = DropzoneRootPropsBase & FrozenDropzoneRootProps\n\nexport type DropzoneInputProps = DropzoneInputPropsBase &\n FrozenDropzoneInputProps\n\nexport interface QaTags {\n /**\n * @since 10.19.0\n */\n dropzone?: string\n /**\n * @since 10.19.0\n */\n showErrorDetails?: string\n /**\n * @since 10.19.0\n */\n hideError?: string\n}\n\nexport interface DropzoneProps extends DropzoneHookState {\n /**\n * Render prop to specify a custom dropzone body message\n * @since 10.19.0\n */\n contentRenderer?: (props: DropzoneContentProps) => React.ReactNode\n /**\n * <Code>NOTICE:</Code>\n * <br/>\n * <Code>true</Code> - will make Icon always visible, despite the component height\n * <br/>\n * <Code>false</Code> - will make Icon always hide, despite the component height\n * <br/>\n * <Code>undefined</Code> - will look on the component height to decide show or hide Icon\n * @since 10.19.0\n */\n isIconVisible?: boolean\n\n /**\n * Dropzone tooltip content\n * @since 10.19.0\n */\n tooltip?: React.ReactNode | string\n\n /**\n * Additional props for dropzone element\n * @since 10.19.0\n */\n rootProps?: DropzoneRootProps\n\n /**\n * Additional props for input element\n * @since 10.19.0\n */\n inputProps?: DropzoneInputProps\n /**\n * @since 10.19.0\n */\n className?: string\n /**\n * @since 10.19.0\n */\n qa?: QaTags\n}\n\nexport interface DropzoneRef {\n /**\n * @since 10.19.0\n */\n rootRef: React.RefObject<HTMLElement>\n /**\n * @since 10.19.0\n */\n inputRef: React.RefObject<HTMLInputElement>\n\n /**\n * Open the native file selection dialog\n * @since 10.19.0\n */\n open: () => void\n}\n"],"mappings":"AAgBA,OAAO,IAAMA,mBAAwD,GAAG;EACtEC,QAAQ,EAAE,gBAAgB;EAC1BC,WAAW,EAAE,gBAAgB;EAC7BC,WAAW,EAAE,gBAAgB;EAC7BC,QAAQ,EAAE;AACZ,CAAC;AAkJD,OAAO,IAAMC,UAAU,GAAG;EACxBD,QAAQ,EAAE,iBAAiB;EAC3BE,UAAU,EAAE,mBAAmB;EAC/BJ,WAAW,EAAE,eAAe;EAC5BC,WAAW,EAAE,eAAe;EAC5BI,cAAc,EAAE,oBAAoB;EACpCC,cAAc,EAAE,iBAAiB;EACjCC,KAAK,EAAE;AACT,CAAU;;AAgEV;AACA;AACA;AACA;AACA"}
1
+ {"version":3,"file":"Dropzone.types.js","names":["fileRejectionReason","maxFiles","maxFileSize","minFileSize","fileType","dropErrors","fileAmount","oneFileAtATime","multipleErrors","reset"],"sources":["../../src/Dropzone/Dropzone.types.ts"],"sourcesContent":["import type React from 'react'\nimport type {\n DropzoneInputProps as DropzoneInputPropsBase,\n DropzoneOptions,\n DropzoneRootProps as DropzoneRootPropsBase,\n DropzoneState,\n} from 'react-dropzone'\nimport {\n type FileError as FileRejectionError,\n type FileRejection,\n} from 'react-dropzone'\n\nexport type DropzoneFile = any\n\nexport type FileRejectionReason = FileRejectionError['code']\n\nexport const fileRejectionReason: Record<string, FileRejectionReason> = {\n maxFiles: 'too-many-files',\n maxFileSize: 'file-too-large',\n minFileSize: 'file-too-small',\n fileType: 'file-invalid-type',\n}\n\nexport type { FileRejection, FileRejectionError }\n\nexport interface DropzoneErrorBannerProps {\n /**\n * @since 10.19.0\n */\n error: DropzoneHookState['dropError']\n\n /**\n * Rejected files and why they were rejected\n * ```\n * {\n * file: File,\n * errors: FileError[]\n * }[]\n * ```\n * @since 10.19.0\n */\n fileRejections: DropzoneHookState['fileRejections']\n /**\n * @since 10.19.0\n */\n onDismiss: () => void\n /**\n * @since 10.19.0\n */\n className?: string\n /**\n * @since 10.19.0\n */\n qa?: {\n showErrorDetails?: string\n hideError?: string\n }\n}\n\nexport interface MultipleErrorsProps {\n /**\n * @since 10.19.0\n */\n fileRejections: FileRejection[]\n /**\n * @since 10.19.0\n */\n maxFiles?: number\n /**\n * @since 10.19.0\n */\n maxSize?: number\n /**\n * @since 10.19.0\n */\n minSize?: number\n}\n\nexport interface ContainerProps {\n /**\n * Additional props for dropzone container element\n * @since 10.19.0\n */\n rootProps: DropzoneRootProps\n\n /**\n * Returns the props you should apply to the root drop container you render\n * @since 10.19.0\n */\n getRootProps: DropzoneState['getRootProps']\n /**\n * @since 10.19.0\n */\n active: boolean\n\n /**\n * Enable/disable the dropzone container\n * @since 10.19.0\n */\n disabled: boolean\n}\nexport interface ContentProps {\n /**\n * Force icon visibility\n * `NOTICE:` passing `true` or `false`\n * value explicitly will make component ignore resizing.\n * @since 10.19.0\n */\n isIconVisible: boolean\n\n /**\n * Enable/disable the dropzone content\n * @since 10.19.0\n */\n disabled: boolean\n /**\n * @since 10.19.0\n */\n contentMessage: React.ReactNode\n}\n\nexport interface DropzoneContentProps {\n /**\n * Open the native file selection dialog\n * @since 10.19.0\n */\n open: () => void\n\n /**\n * Enable/disable the dropzone content\n * @since 10.19.0\n */\n disabled: boolean\n /**\n * @since 10.19.0\n */\n errorMessage?: string\n}\n\nexport interface DropzoneHookProps\n extends Partial<Omit<DropzoneOptions, 'minSize' | 'maxSize'>> {\n /**\n * Array of already selected items\n * @since 10.19.0\n */\n value?: DropzoneFile[]\n\n /**\n * Maximum number files to the dropzone is allowed. All files above the limit\n * will be rejected.\n * @since 10.19.0\n */\n maxFileNumber?: number\n\n /**\n * Minimum file size (in bytes)\n * @since 10.19.0\n */\n minFileSize?: DropzoneOptions['minSize']\n\n /**\n * Maximum file size (in bytes)\n * @since 10.19.0\n */\n maxFileSize?: DropzoneOptions['maxSize']\n}\n\nexport const dropErrors = {\n fileType: 'FILE_TYPE_ERROR',\n fileAmount: 'FILE_AMOUNT_ERROR',\n maxFileSize: 'MAX_FILE_SIZE',\n minFileSize: 'MIN_FILE_SIZE',\n oneFileAtATime: 'ONE_FILE_AT_A_TIME',\n multipleErrors: 'MULTIPLE_ERRORS',\n reset: 'RESET',\n} as const\n\nexport type DropErrorType = (typeof dropErrors)[keyof typeof dropErrors]\n\nexport type DropError = {\n /**\n * @since 10.19.0\n */\n type: DropErrorType\n /**\n * @since 10.19.0\n */\n title: string\n /**\n * @since 10.19.0\n */\n message: string\n /**\n * @since 10.19.0\n */\n body?: React.ReactNode\n}\n\nexport type DropzoneHookState = DropzoneState & {\n /**\n * Allow drag 'n' drop (or selection from the file dialog) of multiple files\n * @default false\n * @since 10.19.0\n * */\n multiple: boolean\n\n /**\n * Error message if dragged files is rejected\n * ```\n * { type: DropErrorType, title: string, message: string }\n * ```\n * @since 10.19.0\n */\n dragError: string\n\n /**\n * Error message if dropped files is rejected\n * ```\n * { type: DropErrorType, title: string, message: string }\n * ```\n * @since 10.19.0\n */\n dropError: DropError\n\n /**\n * Enable/disable the dropzone\n * @default false\n * @since 10.19.0\n */\n disabled: boolean\n\n /**\n * Sets `dropError`.\n * ```\n * (error: DropErrorType) => void\n * ```\n * @since 10.19.0\n */\n dispatchDropError: (error: DropErrorType) => void\n}\n\n/**\n * WARNING\n * To keep component work as expected according to props passed to `useDropzone` hook\n * Some properties are omitted\n */\ntype FrozenDropzoneRootKeys = 'disabled'\n\ntype FrozenDropzoneRootProps = {\n [key in FrozenDropzoneRootKeys]?: never\n}\n\ntype FrozenDropzoneInputKeys = 'accept' | 'multiple' | 'type'\n\ntype FrozenDropzoneInputProps = {\n [key in FrozenDropzoneInputKeys]: never\n}\n\nexport type DropzoneRootProps = DropzoneRootPropsBase & FrozenDropzoneRootProps\n\nexport type DropzoneInputProps = DropzoneInputPropsBase &\n FrozenDropzoneInputProps\n\nexport interface QaTags {\n /**\n * @since 10.19.0\n */\n dropzone?: string\n /**\n * @since 10.19.0\n */\n showErrorDetails?: string\n /**\n * @since 10.19.0\n */\n hideError?: string\n}\n\nexport interface DropzoneProps extends DropzoneHookState {\n /**\n * Render prop to specify a custom dropzone body message\n * @since 10.19.0\n */\n contentRenderer?: (props: DropzoneContentProps) => React.ReactNode\n /**\n * `NOTICE:`\n *\n * `true` - will make Icon always visible, despite the component height\n *\n * `false` - will make Icon always hide, despite the component height\n *\n * `undefined` - will look on the component height to decide show or hide Icon\n * @since 10.19.0\n */\n isIconVisible?: boolean\n\n /**\n * Dropzone tooltip content\n * @since 10.19.0\n */\n tooltip?: React.ReactNode | string\n\n /**\n * Additional props for dropzone element\n * @since 10.19.0\n */\n rootProps?: DropzoneRootProps\n\n /**\n * Additional props for input element\n * @since 10.19.0\n */\n inputProps?: DropzoneInputProps\n /**\n * @since 10.19.0\n */\n className?: string\n /**\n * @since 10.19.0\n */\n qa?: QaTags\n}\n\nexport interface DropzoneRef {\n /**\n * @since 10.19.0\n */\n rootRef: React.RefObject<HTMLElement>\n /**\n * @since 10.19.0\n */\n inputRef: React.RefObject<HTMLInputElement>\n\n /**\n * Open the native file selection dialog\n * @since 10.19.0\n */\n open: () => void\n}\n"],"mappings":"AAgBA,OAAO,IAAMA,mBAAwD,GAAG;EACtEC,QAAQ,EAAE,gBAAgB;EAC1BC,WAAW,EAAE,gBAAgB;EAC7BC,WAAW,EAAE,gBAAgB;EAC7BC,QAAQ,EAAE;AACZ,CAAC;AAkJD,OAAO,IAAMC,UAAU,GAAG;EACxBD,QAAQ,EAAE,iBAAiB;EAC3BE,UAAU,EAAE,mBAAmB;EAC/BJ,WAAW,EAAE,eAAe;EAC5BC,WAAW,EAAE,eAAe;EAC5BI,cAAc,EAAE,oBAAoB;EACpCC,cAAc,EAAE,iBAAiB;EACjCC,KAAK,EAAE;AACT,CAAU;;AAkEV;AACA;AACA;AACA;AACA"}
@@ -6,27 +6,27 @@ var emptyStateWidth = 440;
6
6
  var emptyStateWidthCompact = 352;
7
7
  export var StyledSvg = /*#__PURE__*/styled.svg.withConfig({
8
8
  displayName: "StyledSvg",
9
- componentId: "core-12_14_0__sc-1xaoo8n-0"
9
+ componentId: "core-12_16_0__sc-1xaoo8n-0"
10
10
  })(["width:200px;height:200px;"]);
11
11
  export var StyledImage = /*#__PURE__*/styled.div.withConfig({
12
12
  displayName: "StyledImage",
13
- componentId: "core-12_14_0__sc-1xaoo8n-1"
13
+ componentId: "core-12_16_0__sc-1xaoo8n-1"
14
14
  })([""]);
15
15
  export var StyledTitle = /*#__PURE__*/styled.div.withConfig({
16
16
  displayName: "StyledTitle",
17
- componentId: "core-12_14_0__sc-1xaoo8n-2"
17
+ componentId: "core-12_16_0__sc-1xaoo8n-2"
18
18
  })(["margin-top:", "px;text-align:center;color:", ";width:", "px;", ""], spacing.xl, colors.gray15, emptyStateWidth, getTypographyIntent('h2'));
19
19
  export var StyledDescription = /*#__PURE__*/styled.div.withConfig({
20
20
  displayName: "StyledDescription",
21
- componentId: "core-12_14_0__sc-1xaoo8n-3"
21
+ componentId: "core-12_16_0__sc-1xaoo8n-3"
22
22
  })(["margin-top:", "px;text-align:center;color:", ";width:", "px;", ""], spacing.lg, colors.gray45, emptyStateWidth, getTypographyIntent('body'));
23
23
  export var StyledActions = /*#__PURE__*/styled.div.withConfig({
24
24
  displayName: "StyledActions",
25
- componentId: "core-12_14_0__sc-1xaoo8n-4"
25
+ componentId: "core-12_16_0__sc-1xaoo8n-4"
26
26
  })(["margin-top:", "px;"], spacing.xl);
27
27
  export var StyledEmptyState = /*#__PURE__*/styled.div.withConfig({
28
28
  displayName: "StyledEmptyState",
29
- componentId: "core-12_14_0__sc-1xaoo8n-5"
29
+ componentId: "core-12_16_0__sc-1xaoo8n-5"
30
30
  })(["display:flex;justify-content:center;align-items:center;flex-direction:column;margin-top:", "px;margin-bottom:", "px;", "{> img{max-width:200px;}}", "}"], function (_ref) {
31
31
  var $compact = _ref.$compact;
32
32
  return $compact ? 0 : 96;