@procore/core-react 12.18.1 → 12.19.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 (185) 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.styles.js +10 -10
  6. package/dist/Box/Box.styles.js +1 -1
  7. package/dist/Breadcrumbs/Breadcrumbs.styles.js +4 -4
  8. package/dist/Button/Button.styles.js +5 -5
  9. package/dist/Calendar/Calendar.styles.js +8 -8
  10. package/dist/Card/Card.styles.js +1 -1
  11. package/dist/Checkbox/Checkbox.styles.js +6 -6
  12. package/dist/Checkbox/CheckboxTooltip.js +1 -1
  13. package/dist/ContactItem/ContactItem.styles.js +5 -5
  14. package/dist/Content/Content.styles.js +2 -2
  15. package/dist/DateInput/DateInput.styles.js +6 -6
  16. package/dist/DetailPage/DetailPage.styles.js +7 -7
  17. package/dist/Dropdown/Dropdown.styles.js +3 -3
  18. package/dist/DropdownFlyout/DropdownFlyout.styles.js +4 -4
  19. package/dist/Dropzone/Dropzone.hooks.js +2 -1
  20. package/dist/Dropzone/Dropzone.hooks.js.map +1 -1
  21. package/dist/Dropzone/Dropzone.js +26 -7
  22. package/dist/Dropzone/Dropzone.js.map +1 -1
  23. package/dist/Dropzone/Dropzone.styles.d.ts +3 -3
  24. package/dist/Dropzone/Dropzone.styles.js +14 -14
  25. package/dist/Dropzone/Dropzone.styles.js.map +1 -1
  26. package/dist/Dropzone/Dropzone.types.d.ts +18 -1
  27. package/dist/Dropzone/Dropzone.types.js.map +1 -1
  28. package/dist/EmptyState/EmptyState.styles.js +6 -6
  29. package/dist/Field/Field.styles.js +3 -3
  30. package/dist/FileList/FileList.styles.js +4 -4
  31. package/dist/FileSelect/FileExplorer/FileExplorer.styles.js +9 -9
  32. package/dist/FileSelect/FileExplorer/FileExplorerSidebar.styles.js +3 -3
  33. package/dist/FileSelect/FileSelect.styles.js +2 -2
  34. package/dist/FileSelect/FileSelectDropzone/FileSelectDropzone.styles.js +3 -3
  35. package/dist/FileSelect/FileTokenList/FileTokenList.styles.js +2 -2
  36. package/dist/FileSelect/GridSource/GridSource.styles.js +6 -6
  37. package/dist/FileSelect/LocalSource/LocalSource.styles.js +4 -4
  38. package/dist/FileSelect/SourceItem/SourceItem.styles.js +3 -3
  39. package/dist/FileSelect/ThumbnailList/ThumbnailList.styles.js +6 -6
  40. package/dist/FileSelect/TreeSource/TreeSource.styles.js +1 -1
  41. package/dist/FileToken/FileToken.styles.js +4 -4
  42. package/dist/FilterToken/FilterToken.styles.js +5 -5
  43. package/dist/FlexList/FlexList.styles.js +1 -1
  44. package/dist/Form/Form.styles.js +14 -14
  45. package/dist/Form/StyledFormikForm.styles.js +2 -2
  46. package/dist/GhostPlaceholder/GhostPlaceholder.styles.js +2 -2
  47. package/dist/Grid/Grid.styles.js +2 -2
  48. package/dist/GroupSelect/GroupSelect.styles.js +1 -1
  49. package/dist/Input/Input.styles.js +1 -1
  50. package/dist/Link/Link.styles.js +1 -1
  51. package/dist/ListPage/ListPage.styles.js +8 -8
  52. package/dist/Loader/Loader.styles.js +2 -2
  53. package/dist/MenuImperative/MenuImperative.styles.js +10 -10
  54. package/dist/Modal/Modal.styles.js +13 -13
  55. package/dist/MultiSelect/MultiSelect.styles.js +6 -6
  56. package/dist/NextMenu/NextMenu.styles.js +3 -3
  57. package/dist/Notation/Notation.js +1 -1
  58. package/dist/NumberInput/NumberInput.styles.js +7 -7
  59. package/dist/Overlay/OverlayArrow.styles.js +1 -1
  60. package/dist/PageFooterTemplate/PageFooterTemplate.styles.js +1 -1
  61. package/dist/PageHeaderTemplate/PageHeaderTemplate.styles.js +3 -3
  62. package/dist/PageLayout/PageLayout.styles.js +16 -16
  63. package/dist/PagePaneTemplate/PagePaneTemplate.styles.js +2 -2
  64. package/dist/PageTemplate/PageTemplate.styles.js +3 -3
  65. package/dist/Pagination/Pagination.styles.js +5 -5
  66. package/dist/Panel/Panel.styles.js +11 -11
  67. package/dist/Pill/Pill.styles.js +2 -2
  68. package/dist/PillSelect/PillSelect.styles.js +4 -4
  69. package/dist/Popover/Popover.styles.js +2 -2
  70. package/dist/Portal/Portal.styles.js +1 -1
  71. package/dist/ProgressBar/ProgressBar.styles.js +2 -2
  72. package/dist/RadioButton/RadioButton.styles.js +3 -3
  73. package/dist/Required/Required.styles.js +3 -3
  74. package/dist/Search/Search.styles.js +5 -5
  75. package/dist/Section/Section.styles.js +7 -7
  76. package/dist/SegmentedController/SegmentedController.styles.js +4 -4
  77. package/dist/Select/Select.styles.js +7 -7
  78. package/dist/Semantic/Semantic.styles.js +9 -9
  79. package/dist/Slider/Slider.styles.js +5 -5
  80. package/dist/Spinner/Spinner.styles.js +7 -7
  81. package/dist/SplitViewCard/SplitViewCard.styles.js +8 -8
  82. package/dist/SuperSelect/SuperSelect.presets.styles.js +1 -1
  83. package/dist/SuperSelect/SuperSelect.styles.js +37 -37
  84. package/dist/Switch/Switch.styles.js +4 -4
  85. package/dist/Table/Table.styles.js +28 -28
  86. package/dist/TableShelf/TableShelf.styles.js +5 -5
  87. package/dist/Tabs/Tabs.styles.js +15 -15
  88. package/dist/Tearsheet/Tearsheet.styles.js +5 -5
  89. package/dist/TextArea/TextArea.styles.js +1 -1
  90. package/dist/TextEditorOutput/TextEditorOutput.styles.js +1 -1
  91. package/dist/Thumbnail/Thumbnail.styles.js +17 -17
  92. package/dist/ThumbnailGrid/ThumbnailGrid.styles.js +7 -7
  93. package/dist/TieredSelect/TieredSelect.styles.js +9 -9
  94. package/dist/Tile/Tile.styles.js +8 -8
  95. package/dist/Title/Title.styles.js +7 -7
  96. package/dist/Toast/Toast.styles.js +3 -3
  97. package/dist/ToggleButton/ToggleButton.styles.js +1 -1
  98. package/dist/Token/Token.styles.js +3 -3
  99. package/dist/ToolHeader/ToolHeader.styles.js +6 -6
  100. package/dist/ToolLandingPage/ToolLandingPage.styles.js +3 -3
  101. package/dist/Tooltip/Tooltip.styles.js +2 -2
  102. package/dist/Tree/Tree.styles.js +9 -9
  103. package/dist/Typeahead/Typeahead.styles.js +3 -3
  104. package/dist/Typography/Typography.styles.js +1 -1
  105. package/dist/Typography/Typography.table.story.js +2 -2
  106. package/dist/_typedoc/Avatar/Avatar.types.json +20 -20
  107. package/dist/_typedoc/AvatarStack/AvatarStack.types.json +24 -24
  108. package/dist/_typedoc/Badge/Badge.types.json +6 -6
  109. package/dist/_typedoc/Banner/Banner.types.json +13 -13
  110. package/dist/_typedoc/Box/Box.types.json +68 -68
  111. package/dist/_typedoc/Breadcrumbs/Breadcrumbs.types.json +10 -10
  112. package/dist/_typedoc/Button/Button.types.json +12 -12
  113. package/dist/_typedoc/Calendar/Calendar.types.json +80 -80
  114. package/dist/_typedoc/Card/Card.types.json +6 -6
  115. package/dist/_typedoc/Checkbox/Checkbox.types.json +9 -9
  116. package/dist/_typedoc/ContactItem/ContactItem.types.json +9 -9
  117. package/dist/_typedoc/DateInput/DateInput.types.json +35 -35
  118. package/dist/_typedoc/DateSelect/DateSelect.types.json +13 -13
  119. package/dist/_typedoc/DetailPage/DetailPage.types.json +5 -5
  120. package/dist/_typedoc/Dropdown/Dropdown.types.json +37 -37
  121. package/dist/_typedoc/DropdownFlyout/DropdownFlyout.types.json +29 -29
  122. package/dist/_typedoc/Dropzone/Dropzone.types.json +74 -42
  123. package/dist/_typedoc/EmptyState/EmptyState.types.json +16 -16
  124. package/dist/_typedoc/FileList/FileList.types.json +9 -9
  125. package/dist/_typedoc/FileSelect/FileSelect.types.json +26 -26
  126. package/dist/_typedoc/FileSelect/GridSource/GridSource.types.json +20 -20
  127. package/dist/_typedoc/FileSelect/LocalSource/LocalSource.types.json +14 -14
  128. package/dist/_typedoc/FileSelect/TreeSource/TreeSource.types.json +9 -9
  129. package/dist/_typedoc/Flex/Flex.types.json +27 -27
  130. package/dist/_typedoc/FlexList/FlexList.types.json +30 -30
  131. package/dist/_typedoc/Form/Form.types.json +741 -741
  132. package/dist/_typedoc/GhostPlaceholder/GhostPlaceholder.types.json +12 -12
  133. package/dist/_typedoc/Grid/Grid.types.json +8 -8
  134. package/dist/_typedoc/GroupSelect/GroupSelect.types.json +52 -52
  135. package/dist/_typedoc/Input/Input.types.json +2 -2
  136. package/dist/_typedoc/Link/Link.types.json +4 -4
  137. package/dist/_typedoc/ListPage/ListPage.types.json +13 -13
  138. package/dist/_typedoc/Menu/Menu.types.json +62 -62
  139. package/dist/_typedoc/MenuImperative/MenuImperative.types.json +74 -74
  140. package/dist/_typedoc/Modal/Modal.types.json +46 -46
  141. package/dist/_typedoc/MultiSelect/MultiSelect.types.json +31 -31
  142. package/dist/_typedoc/Notation/Notation.types.json +4 -4
  143. package/dist/_typedoc/NumberInput/NumberInput.types.json +37 -37
  144. package/dist/_typedoc/OverlayTrigger/OverlayTrigger.types.json +31 -31
  145. package/dist/_typedoc/PageLayout/PageLayout.types.json +29 -29
  146. package/dist/_typedoc/Pagination/Pagination.types.json +7 -7
  147. package/dist/_typedoc/Panel/Panel.types.json +28 -28
  148. package/dist/_typedoc/Pill/Pill.types.json +2 -2
  149. package/dist/_typedoc/PillSelect/PillSelect.types.json +49 -49
  150. package/dist/_typedoc/Popover/Popover.types.json +15 -15
  151. package/dist/_typedoc/ProgressBar/ProgressBar.types.json +6 -6
  152. package/dist/_typedoc/RadioButton/RadioButton.types.json +6 -6
  153. package/dist/_typedoc/Required/Required.types.json +5 -5
  154. package/dist/_typedoc/Search/Search.types.json +19 -19
  155. package/dist/_typedoc/Section/Section.types.json +15 -15
  156. package/dist/_typedoc/SegmentedController/SegmentedController.types.json +21 -21
  157. package/dist/_typedoc/Select/Select.types.json +60 -60
  158. package/dist/_typedoc/SettingsPage/SettingsPage.types.json +10 -10
  159. package/dist/_typedoc/Slider/Slider.types.json +6 -6
  160. package/dist/_typedoc/Spinner/Spinner.types.json +9 -9
  161. package/dist/_typedoc/SplitViewCard/SplitViewCard.types.json +12 -12
  162. package/dist/_typedoc/Switch/Switch.types.json +3 -3
  163. package/dist/_typedoc/Table/Table.types.json +101 -101
  164. package/dist/_typedoc/Tabs/Tabs.types.json +20 -20
  165. package/dist/_typedoc/Tearsheet/Tearsheet.types.json +17 -17
  166. package/dist/_typedoc/TextArea/TextArea.types.json +3 -3
  167. package/dist/_typedoc/TextEditor/TextEditor.types.json +9 -9
  168. package/dist/_typedoc/TextEditorOutput/TextEditorOutput.types.json +4 -4
  169. package/dist/_typedoc/Thumbnail/Thumbnail.types.json +19 -19
  170. package/dist/_typedoc/TieredDropdown/TieredDropdown.types.json +42 -42
  171. package/dist/_typedoc/TieredSelect/TieredSelect.types.json +28 -28
  172. package/dist/_typedoc/Tile/Tile.types.json +30 -30
  173. package/dist/_typedoc/Title/Title.types.json +1 -1
  174. package/dist/_typedoc/Toast/Toast.types.json +4 -4
  175. package/dist/_typedoc/ToggleButton/ToggleButton.types.json +4 -4
  176. package/dist/_typedoc/Token/Token.types.json +4 -4
  177. package/dist/_typedoc/ToolHeader/ToolHeader.types.json +10 -10
  178. package/dist/_typedoc/ToolLandingPage/ToolLandingPage.types.json +7 -7
  179. package/dist/_typedoc/Tooltip/Tooltip.types.json +13 -13
  180. package/dist/_typedoc/Tree/Tree.types.json +86 -86
  181. package/dist/_typedoc/Typeahead/Typeahead.types.json +2 -2
  182. package/dist/_typedoc/Typography/Typography.types.json +9 -9
  183. package/dist/_typedoc/_utils/types.json +3 -3
  184. package/dist/_typedoc/deprecations.json +1 -1
  185. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"Dropzone.hooks.js","names":["React","useDropzone","useDropzoneBase","useI18nContext","partition","MultipleErrors","StyledErrorBannerDetails","dropErrors","fileRejectionReason","getFileDetail","isZeroSize","oneDropAtATimeRejectionReason","dropErrorsByReason","_defineProperty","maxFiles","fileAmount","maxFileSize","minFileSize","fileType","getSizeInMB","maxSize","_ref","arguments","length","undefined","_ref$value","value","_ref$disabled","disabled","_ref$multiple","multiple","_ref$noClick","noClick","_ref$noKeyboard","noKeyboard","onDragEnter","onDragOver","onDragLeave","onDropRejected","minSize","_ref$maxFileNumber","maxFileNumber","Infinity","_onDrop","onDrop","onDropAccepted","props","_objectWithoutProperties","_excluded","I18n","_React$useState","useState","_React$useState2","_slicedToArray","acceptedFiles","setAcceptedFiles","_React$useState3","_React$useState4","fileRejections","setFileRejections","maxFilesRemaining","defaultDropError","type","reset","title","message","dropErrorReducer","state","action","rejectedFiles","createElement","map","_ref2","file","key","name","t","oneFileAtATime","body","sizeInMegabytes","multipleErrors","_objectSpread","withOneDropAtATimeError","errors","code","_React$useReducer","useReducer","_React$useReducer2","dropError","dispatchDropError","useCallback","event","droppedFiles","concat","_toConsumableArray","rej","allFilesWithRejections","_ref3","i","_partition","_ref4","_partition2","actualAcceptedFiles_","actualRejectedFiles","actualAcceptedFiles","_ref5","errorCodes","flatMap","rejection","error","hasMultipleErrors","Set","size","_useDropzoneBase","getRootProps","getInputProps","isDragActive","isFileDialogActive","isDragReject","isFocused","isDragAccept","draggedFiles","open","rootRef","inputRef","dragError","useMemo","getFileTypeError","count","getFileAmountError","fileLimit","amountError"],"sources":["../../src/Dropzone/Dropzone.hooks.tsx"],"sourcesContent":["import React from 'react'\nimport type { DropEvent, DropzoneOptions } from 'react-dropzone'\nimport { useDropzone as useDropzoneBase } from 'react-dropzone'\nimport { useI18nContext } from '../_hooks/I18n'\nimport { partition } from '../_utils/partition'\nimport { MultipleErrors } from './Dropzone'\nimport { StyledErrorBannerDetails } from './Dropzone.styles'\nimport type {\n DropError,\n DropErrorType,\n DropzoneHookProps,\n DropzoneHookState,\n FileRejection,\n FileRejectionReason,\n} from './Dropzone.types'\nimport { dropErrors, fileRejectionReason } from './Dropzone.types'\nimport { getFileDetail, isZeroSize } from './Dropzone.utils'\n\nconst oneDropAtATimeRejectionReason = 'one-drop-at-a-time'\n\nconst dropErrorsByReason: Record<FileRejectionReason, DropErrorType> = {\n [fileRejectionReason.maxFiles]: dropErrors.fileAmount,\n [fileRejectionReason.maxFileSize]: dropErrors.maxFileSize,\n [fileRejectionReason.minFileSize]: dropErrors.minFileSize,\n [fileRejectionReason.fileType]: dropErrors.fileType,\n}\n\nconst getSizeInMB = (maxSize: number): number => maxSize / 10e5\n\n/**\n * WARNING:\n * Use ACCEPT prop carefully, because mime type determination is not reliable across platforms.\n * Details: https://github.com/react-dropzone/react-dropzone/tree/master/examples/accept#browser-limitations\n */\nexport const useDropzone = ({\n value = [],\n disabled = false,\n multiple = false,\n noClick = true,\n noKeyboard = true,\n onDragEnter,\n onDragOver,\n onDragLeave,\n onDropRejected,\n maxFileSize: maxSize,\n minFileSize: minSize,\n maxFileNumber = Infinity,\n onDrop: _onDrop,\n onDropAccepted,\n ...props\n}: DropzoneHookProps = {}): DropzoneHookState => {\n const I18n = useI18nContext()\n const [acceptedFiles, setAcceptedFiles] = React.useState<File[]>([])\n const [fileRejections, setFileRejections] = React.useState<FileRejection[]>(\n []\n )\n\n const maxFilesRemaining = maxFileNumber - value.length\n\n const defaultDropError = {\n type: dropErrors.reset,\n title: '',\n message: '',\n }\n\n const dropErrorReducer = (\n state: DropError,\n action: DropErrorType\n ): DropError => {\n const rejectedFiles = (\n <StyledErrorBannerDetails>\n {fileRejections.map(({ file }) => {\n return <li key={file.name}>{getFileDetail(file)}</li>\n })}\n </StyledErrorBannerDetails>\n )\n const title = I18n.t('core.dropzone.errorTitle')\n\n switch (action) {\n case dropErrors.oneFileAtATime:\n return {\n type: dropErrors.oneFileAtATime,\n title: '',\n message: I18n.t('core.dropzone.oneFileAtATimeError'),\n }\n case dropErrors.fileAmount:\n return {\n type: dropErrors.fileAmount,\n title,\n message: I18n.t('core.dropzone.standaloneMaxFileNumberError', {\n maxFiles: maxFileNumber,\n }),\n body: rejectedFiles,\n }\n case dropErrors.fileType:\n return {\n type: dropErrors.fileType,\n title,\n message: I18n.t('core.dropzone.standaloneUnsupportedFileTypeError'),\n body: rejectedFiles,\n }\n case dropErrors.maxFileSize:\n return {\n type: dropErrors.maxFileSize,\n title,\n message: I18n.t('core.dropzone.standaloneMaxFileSizeError', {\n sizeInMegabytes: getSizeInMB(maxSize as number),\n }),\n body: rejectedFiles,\n }\n case dropErrors.minFileSize:\n const message = isZeroSize(minSize)\n ? I18n.t('core.dropzone.standaloneZeroFileSizeError')\n : I18n.t('core.dropzone.standaloneMinFileSizeError', {\n sizeInMegabytes: getSizeInMB(minSize as number),\n })\n\n return {\n type: dropErrors.minFileSize,\n title,\n message,\n body: rejectedFiles,\n }\n case dropErrors.multipleErrors:\n return {\n type: dropErrors.multipleErrors,\n title,\n message: I18n.t('core.dropzone.multipleErrorsMessage'),\n body: (\n <MultipleErrors\n fileRejections={fileRejections}\n maxFiles={maxFileNumber}\n maxSize={maxSize}\n minSize={minSize}\n />\n ),\n }\n case dropErrors.reset:\n return { ...defaultDropError }\n default:\n return state\n }\n }\n\n const withOneDropAtATimeError = (file: File) => ({\n file,\n errors: [\n {\n message: I18n.t('core.dropzone.oneDropAtATimeError'),\n code: oneDropAtATimeRejectionReason as FileRejectionReason,\n },\n ],\n })\n\n const [dropError, dispatchDropError] = React.useReducer<\n React.Reducer<DropError, DropErrorType>\n >(dropErrorReducer, { ...defaultDropError })\n\n const onDrop: DropzoneOptions['onDrop'] = React.useCallback(\n (\n acceptedFiles: File[],\n rejectedFiles: FileRejection[],\n event: DropEvent\n ) => {\n dispatchDropError(dropErrors.reset)\n\n const droppedFiles = [\n ...acceptedFiles,\n ...rejectedFiles.map((rej) => rej.file),\n ]\n if (!multiple && droppedFiles.length > 1) {\n dispatchDropError(dropErrors.oneFileAtATime)\n onDropRejected?.(droppedFiles.map(withOneDropAtATimeError), event)\n return\n }\n\n const allFilesWithRejections = [\n ...acceptedFiles.map((file) => ({ file, errors: [] })),\n ...rejectedFiles,\n ].map(({ file, errors }, i) => ({\n file,\n errors:\n i < maxFilesRemaining\n ? errors\n : [...errors, { message: '', code: fileRejectionReason.maxFiles }],\n }))\n\n const [actualAcceptedFiles_, actualRejectedFiles] =\n partition<FileRejection>(\n ({ errors }) => errors.length === 0,\n allFilesWithRejections\n )\n\n const actualAcceptedFiles = actualAcceptedFiles_.map(({ file }) => file)\n\n _onDrop?.(actualAcceptedFiles, actualRejectedFiles, event)\n\n setAcceptedFiles(actualAcceptedFiles)\n setFileRejections(actualRejectedFiles)\n\n if (actualAcceptedFiles.length) {\n onDropAccepted?.(actualAcceptedFiles, event)\n }\n\n if (actualRejectedFiles.length) {\n onDropRejected?.(actualRejectedFiles, event)\n }\n\n const errorCodes = actualRejectedFiles\n .flatMap((rejection) => rejection.errors)\n .map((error) => error.code)\n const hasMultipleErrors = new Set([...errorCodes]).size > 1\n\n if (hasMultipleErrors) {\n dispatchDropError(dropErrors.multipleErrors)\n } else {\n dispatchDropError(dropErrorsByReason[errorCodes[0]])\n }\n },\n [_onDrop, maxFilesRemaining, onDropRejected, onDropAccepted, multiple]\n )\n\n const {\n getRootProps,\n getInputProps,\n isDragActive,\n isFileDialogActive,\n isDragReject,\n isFocused,\n isDragAccept,\n draggedFiles,\n open,\n rootRef,\n inputRef,\n } = useDropzoneBase({\n ...props,\n disabled,\n minSize,\n maxSize,\n multiple,\n onDragEnter,\n onDragLeave,\n onDragOver,\n onDrop,\n noClick,\n noKeyboard,\n })\n\n const dragError = React.useMemo(() => {\n const getFileTypeError = () => {\n return isDragReject\n ? I18n.t('core.dropzone.incorrectFileTypeMessage', {\n count: draggedFiles.length,\n })\n : ''\n }\n\n const getFileAmountError = () => {\n const fileLimit = multiple ? maxFilesRemaining : 1\n\n const amountError = multiple\n ? I18n.t('core.dropzone.invalidAmountAttachments', {\n count: maxFileNumber,\n })\n : I18n.t('core.dropzone.incorrectFileNumber')\n\n return draggedFiles.length > fileLimit ? amountError : ''\n }\n\n return getFileAmountError() || getFileTypeError()\n }, [\n I18n,\n draggedFiles.length,\n maxFilesRemaining,\n isDragReject,\n maxFileNumber,\n multiple,\n ])\n\n return {\n getRootProps,\n getInputProps,\n\n isDragActive,\n isFileDialogActive,\n isDragReject,\n isFocused,\n isDragAccept,\n draggedFiles,\n acceptedFiles,\n fileRejections,\n\n open,\n rootRef,\n inputRef,\n\n multiple,\n dragError,\n dropError,\n dispatchDropError,\n disabled,\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,WAAW,IAAIC,eAAe,QAAQ,gBAAgB;AAC/D,SAASC,cAAc,QAAQ,gBAAgB;AAC/C,SAASC,SAAS,QAAQ,qBAAqB;AAC/C,SAASC,cAAc,QAAQ,YAAY;AAC3C,SAASC,wBAAwB,QAAQ,mBAAmB;AAS5D,SAASC,UAAU,EAAEC,mBAAmB,QAAQ,kBAAkB;AAClE,SAASC,aAAa,EAAEC,UAAU,QAAQ,kBAAkB;AAE5D,IAAMC,6BAA6B,GAAG,oBAAoB;AAE1D,IAAMC,kBAA8D,GAAAC,eAAA,CAAAA,eAAA,CAAAA,eAAA,CAAAA,eAAA,KACjEL,mBAAmB,CAACM,QAAQ,EAAGP,UAAU,CAACQ,UAAU,GACpDP,mBAAmB,CAACQ,WAAW,EAAGT,UAAU,CAACS,WAAW,GACxDR,mBAAmB,CAACS,WAAW,EAAGV,UAAU,CAACU,WAAW,GACxDT,mBAAmB,CAACU,QAAQ,EAAGX,UAAU,CAACW,QAAQ,CACpD;AAED,IAAMC,WAAW,GAAG,SAAdA,WAAWA,CAAIC,OAAe;EAAA,OAAaA,OAAO,GAAG,IAAI;AAAA;;AAE/D;AACA;AACA;AACA;AACA;AACA,OAAO,IAAMnB,WAAW,GAAG,SAAdA,WAAWA,CAAA,EAgByB;EAAA,IAAAoB,IAAA,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAA1B,CAAC,CAAC;EAAA,IAAAG,UAAA,GAAAJ,IAAA,CAfvBK,KAAK;IAALA,KAAK,GAAAD,UAAA,cAAG,E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JA,IAAI;IACJC,OAAO,EAAPA,OAAO;IACPC,QAAQ,EAARA,QAAQ;IAER9F,QAAQ,EAARA,QAAQ;IACR+F,SAAS,EAATA,SAAS;IACTrC,SAAS,EAATA,SAAS;IACTC,iBAAiB,EAAjBA,iBAAiB;IACjB7D,QAAQ,EAARA;EACF,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"Dropzone.hooks.js","names":["React","useDropzone","useDropzoneBase","useI18nContext","partition","MultipleErrors","StyledErrorBannerDetails","dropErrors","fileRejectionReason","getFileDetail","isZeroSize","oneDropAtATimeRejectionReason","dropErrorsByReason","_defineProperty","maxFiles","fileAmount","maxFileSize","minFileSize","fileType","getSizeInMB","maxSize","_ref","arguments","length","undefined","_ref$value","value","_ref$disabled","disabled","_ref$multiple","multiple","_ref$noClick","noClick","_ref$noKeyboard","noKeyboard","onDragEnter","onDragOver","onDragLeave","onDropRejected","minSize","_ref$maxFileNumber","maxFileNumber","Infinity","_onDrop","onDrop","onDropAccepted","props","_objectWithoutProperties","_excluded","I18n","_React$useState","useState","_React$useState2","_slicedToArray","acceptedFiles","setAcceptedFiles","_React$useState3","_React$useState4","fileRejections","setFileRejections","maxFilesRemaining","defaultDropError","type","reset","title","message","dropErrorReducer","state","action","rejectedFiles","createElement","map","_ref2","file","key","name","t","oneFileAtATime","body","sizeInMegabytes","multipleErrors","_objectSpread","withOneDropAtATimeError","errors","code","_React$useReducer","useReducer","_React$useReducer2","dropError","dispatchDropError","useCallback","event","droppedFiles","concat","_toConsumableArray","rej","allFilesWithRejections","_ref3","i","_partition","_ref4","_partition2","actualAcceptedFiles_","actualRejectedFiles","actualAcceptedFiles","_ref5","errorCodes","flatMap","rejection","error","hasMultipleErrors","Set","size","_useDropzoneBase","getRootProps","getInputProps","isDragActive","isFileDialogActive","isDragReject","isFocused","isDragAccept","draggedFiles","open","rootRef","inputRef","dragError","useMemo","getFileTypeError","count","getFileAmountError","fileLimit","amountError"],"sources":["../../src/Dropzone/Dropzone.hooks.tsx"],"sourcesContent":["import React from 'react'\nimport type { DropEvent, DropzoneOptions } from 'react-dropzone'\nimport { useDropzone as useDropzoneBase } from 'react-dropzone'\nimport { useI18nContext } from '../_hooks/I18n'\nimport { partition } from '../_utils/partition'\nimport { MultipleErrors } from './Dropzone'\nimport { StyledErrorBannerDetails } from './Dropzone.styles'\nimport type {\n DropError,\n DropErrorType,\n DropzoneHookProps,\n DropzoneHookState,\n FileRejection,\n FileRejectionReason,\n} from './Dropzone.types'\nimport { dropErrors, fileRejectionReason } from './Dropzone.types'\nimport { getFileDetail, isZeroSize } from './Dropzone.utils'\n\nconst oneDropAtATimeRejectionReason = 'one-drop-at-a-time'\n\nconst dropErrorsByReason: Record<FileRejectionReason, DropErrorType> = {\n [fileRejectionReason.maxFiles]: dropErrors.fileAmount,\n [fileRejectionReason.maxFileSize]: dropErrors.maxFileSize,\n [fileRejectionReason.minFileSize]: dropErrors.minFileSize,\n [fileRejectionReason.fileType]: dropErrors.fileType,\n}\n\nconst getSizeInMB = (maxSize: number): number => maxSize / 10e5\n\n/**\n * WARNING:\n * Use ACCEPT prop carefully, because mime type determination is not reliable across platforms.\n * Details: https://github.com/react-dropzone/react-dropzone/tree/master/examples/accept#browser-limitations\n */\nexport const useDropzone = ({\n value = [],\n disabled = false,\n multiple = false,\n noClick = true,\n noKeyboard = true,\n onDragEnter,\n onDragOver,\n onDragLeave,\n onDropRejected,\n maxFileSize: maxSize,\n minFileSize: minSize,\n maxFileNumber = Infinity,\n onDrop: _onDrop,\n onDropAccepted,\n ...props\n}: DropzoneHookProps = {}): DropzoneHookState => {\n const I18n = useI18nContext()\n const [acceptedFiles, setAcceptedFiles] = React.useState<File[]>([])\n const [fileRejections, setFileRejections] = React.useState<FileRejection[]>(\n []\n )\n\n const maxFilesRemaining = maxFileNumber - value.length\n\n const defaultDropError = {\n type: dropErrors.reset,\n title: '',\n message: '',\n }\n\n const dropErrorReducer = (\n state: DropError,\n action: DropErrorType\n ): DropError => {\n const rejectedFiles = (\n <StyledErrorBannerDetails>\n {fileRejections.map(({ file }) => {\n return <li key={file.name}>{getFileDetail(file)}</li>\n })}\n </StyledErrorBannerDetails>\n )\n const title = I18n.t('core.dropzone.errorTitle')\n\n switch (action) {\n case dropErrors.oneFileAtATime:\n return {\n type: dropErrors.oneFileAtATime,\n title: '',\n message: I18n.t('core.dropzone.oneFileAtATimeError'),\n }\n case dropErrors.fileAmount:\n return {\n type: dropErrors.fileAmount,\n title,\n message: I18n.t('core.dropzone.standaloneMaxFileNumberError', {\n maxFiles: maxFileNumber,\n }),\n body: rejectedFiles,\n }\n case dropErrors.fileType:\n return {\n type: dropErrors.fileType,\n title,\n message: I18n.t('core.dropzone.standaloneUnsupportedFileTypeError'),\n body: rejectedFiles,\n }\n case dropErrors.maxFileSize:\n return {\n type: dropErrors.maxFileSize,\n title,\n message: I18n.t('core.dropzone.standaloneMaxFileSizeError', {\n sizeInMegabytes: getSizeInMB(maxSize as number),\n }),\n body: rejectedFiles,\n }\n case dropErrors.minFileSize:\n const message = isZeroSize(minSize)\n ? I18n.t('core.dropzone.standaloneZeroFileSizeError')\n : I18n.t('core.dropzone.standaloneMinFileSizeError', {\n sizeInMegabytes: getSizeInMB(minSize as number),\n })\n\n return {\n type: dropErrors.minFileSize,\n title,\n message,\n body: rejectedFiles,\n }\n case dropErrors.multipleErrors:\n return {\n type: dropErrors.multipleErrors,\n title,\n message: I18n.t('core.dropzone.multipleErrorsMessage'),\n body: (\n <MultipleErrors\n fileRejections={fileRejections}\n maxFiles={maxFileNumber}\n maxSize={maxSize}\n minSize={minSize}\n />\n ),\n }\n case dropErrors.reset:\n return { ...defaultDropError }\n default:\n return state\n }\n }\n\n const withOneDropAtATimeError = (file: File) => ({\n file,\n errors: [\n {\n message: I18n.t('core.dropzone.oneDropAtATimeError'),\n code: oneDropAtATimeRejectionReason as FileRejectionReason,\n },\n ],\n })\n\n const [dropError, dispatchDropError] = React.useReducer<\n React.Reducer<DropError, DropErrorType>\n >(dropErrorReducer, { ...defaultDropError })\n\n const onDrop: DropzoneOptions['onDrop'] = React.useCallback(\n (\n acceptedFiles: File[],\n rejectedFiles: FileRejection[],\n event: DropEvent\n ) => {\n dispatchDropError(dropErrors.reset)\n\n const droppedFiles = [\n ...acceptedFiles,\n ...rejectedFiles.map((rej) => rej.file),\n ]\n if (!multiple && droppedFiles.length > 1) {\n dispatchDropError(dropErrors.oneFileAtATime)\n onDropRejected?.(droppedFiles.map(withOneDropAtATimeError), event)\n return\n }\n\n const allFilesWithRejections = [\n ...acceptedFiles.map((file) => ({ file, errors: [] })),\n ...rejectedFiles,\n ].map(({ file, errors }, i) => ({\n file,\n errors:\n i < maxFilesRemaining\n ? errors\n : [...errors, { message: '', code: fileRejectionReason.maxFiles }],\n }))\n\n const [actualAcceptedFiles_, actualRejectedFiles] =\n partition<FileRejection>(\n ({ errors }) => errors.length === 0,\n allFilesWithRejections\n )\n\n const actualAcceptedFiles = actualAcceptedFiles_.map(({ file }) => file)\n\n _onDrop?.(actualAcceptedFiles, actualRejectedFiles, event)\n\n setAcceptedFiles(actualAcceptedFiles)\n setFileRejections(actualRejectedFiles)\n\n if (actualAcceptedFiles.length) {\n onDropAccepted?.(actualAcceptedFiles, event)\n }\n\n if (actualRejectedFiles.length) {\n onDropRejected?.(actualRejectedFiles, event)\n }\n\n const errorCodes = actualRejectedFiles\n .flatMap((rejection) => rejection.errors)\n .map((error) => error.code)\n const hasMultipleErrors = new Set([...errorCodes]).size > 1\n\n if (hasMultipleErrors) {\n dispatchDropError(dropErrors.multipleErrors)\n } else {\n dispatchDropError(dropErrorsByReason[errorCodes[0]])\n }\n },\n [_onDrop, maxFilesRemaining, onDropRejected, onDropAccepted, multiple]\n )\n\n const {\n getRootProps,\n getInputProps,\n isDragActive,\n isFileDialogActive,\n isDragReject,\n isFocused,\n isDragAccept,\n draggedFiles,\n open,\n rootRef,\n inputRef,\n } = useDropzoneBase({\n ...props,\n disabled,\n minSize,\n maxSize,\n multiple,\n onDragEnter,\n onDragLeave,\n onDragOver,\n onDrop,\n noClick,\n noKeyboard,\n })\n\n const dragError = React.useMemo(() => {\n const getFileTypeError = () => {\n return isDragReject\n ? I18n.t('core.dropzone.incorrectFileTypeMessage', {\n count: draggedFiles.length,\n })\n : ''\n }\n\n const getFileAmountError = () => {\n const fileLimit = multiple ? maxFilesRemaining : 1\n\n const amountError = multiple\n ? I18n.t('core.dropzone.invalidAmountAttachments', {\n count: maxFileNumber,\n })\n : I18n.t('core.dropzone.incorrectFileNumber')\n\n return draggedFiles.length > fileLimit ? amountError : ''\n }\n\n return getFileAmountError() || getFileTypeError()\n }, [\n I18n,\n draggedFiles.length,\n maxFilesRemaining,\n isDragReject,\n maxFileNumber,\n multiple,\n ])\n\n return {\n getRootProps,\n getInputProps,\n\n isDragActive,\n isFileDialogActive,\n isDragReject,\n isFocused,\n isDragAccept,\n draggedFiles,\n acceptedFiles,\n fileRejections,\n\n open,\n rootRef,\n inputRef,\n\n multiple,\n dragError,\n dropError,\n dispatchDropError,\n disabled,\n\n value,\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,WAAW,IAAIC,eAAe,QAAQ,gBAAgB;AAC/D,SAASC,cAAc,QAAQ,gBAAgB;AAC/C,SAASC,SAAS,QAAQ,qBAAqB;AAC/C,SAASC,cAAc,QAAQ,YAAY;AAC3C,SAASC,wBAAwB,QAAQ,mBAAmB;AAS5D,SAASC,UAAU,EAAEC,mBAAmB,QAAQ,kBAAkB;AAClE,SAASC,aAAa,EAAEC,UAAU,QAAQ,kBAAkB;AAE5D,IAAMC,6BAA6B,GAAG,oBAAoB;AAE1D,IAAMC,kBAA8D,GAAAC,eAAA,CAAAA,eAAA,CAAAA,eAAA,CAAAA,eAAA,KACjEL,mBAAmB,CAACM,QAAQ,EAAGP,UAAU,CAACQ,UAAU,GACpDP,mBAAmB,CAACQ,WAAW,EAAGT,UAAU,CAACS,WAAW,GACxDR,mBAAmB,CAACS,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,CAAC,IAAIF,gBAAgB,CAAC,CAAC;EACnD,CAAC,EAAE,CACD9E,IAAI,EACJwE,YAAY,CAAClG,MAAM,EACnBqC,iBAAiB,EACjB0D,YAAY,EACZ7E,aAAa,EACbX,QAAQ,CACT,CAAC;EAEF,OAAO;IACLoF,YAAY,EAAZA,YAAY;IACZC,aAAa,EAAbA,aAAa;IAEbC,YAAY,EAAZA,YAAY;IACZC,kBAAkB,EAAlBA,kBAAkB;IAClBC,YAAY,EAAZA,YAAY;IACZC,SAAS,EAATA,SAAS;IACTC,YAAY,EAAZA,YAAY;IACZC,YAAY,EAAZA,YAAY;IACZnE,aAAa,EAAbA,aAAa;IACbI,cAAc,EAAdA,cAAc;IAEdgE,IAAI,EAAJA,IAAI;IACJC,OAAO,EAAPA,OAAO;IACPC,QAAQ,EAARA,QAAQ;IAER9F,QAAQ,EAARA,QAAQ;IACR+F,SAAS,EAATA,SAAS;IACTrC,SAAS,EAATA,SAAS;IACTC,iBAAiB,EAAjBA,iBAAiB;IACjB7D,QAAQ,EAARA,QAAQ;IAERF,KAAK,EAALA;EACF,CAAC;AACH,CAAC"}
@@ -16,10 +16,12 @@ import { Ban, Image } from '@procore/core-icons/dist';
16
16
  import { equals, omit } from 'ramda';
17
17
  import React from 'react';
18
18
  import styled from 'styled-components';
19
- import { Banner } from '../Banner/Banner';
20
- import { Button } from '../Button/Button';
21
- import { Tooltip } from '../Tooltip/Tooltip';
22
- import { Typography } from '../Typography/Typography';
19
+ import { Banner } from '../Banner';
20
+ import { Box } from '../Box';
21
+ import { Button } from '../Button';
22
+ import { Token } from '../Token';
23
+ import { Tooltip } from '../Tooltip';
24
+ import { Typography } from '../Typography';
23
25
  import { useI18nContext } from '../_hooks/I18n';
24
26
  import { useResizeObserver } from '../_hooks/ResizeObserver';
25
27
  import { useFocusWithin } from '../_hooks/useFocusWithin';
@@ -93,7 +95,7 @@ export function MultipleErrors(props) {
93
95
  // make error banner accessible as a styled-components selector
94
96
  export var DropzoneErrorBanner = /*#__PURE__*/styled(DropzoneErrorBannerBase).withConfig({
95
97
  displayName: "DropzoneErrorBanner",
96
- componentId: "core-12_18_1__sc-l4fojb-0"
98
+ componentId: "core-12_19_0__sc-l4fojb-0"
97
99
  })([""]);
98
100
  function DropzoneContainer(_ref2) {
99
101
  var active = _ref2.active,
@@ -155,7 +157,9 @@ var Dropzone_ = /*#__PURE__*/React.forwardRef(function Dropzone(_ref5, ref) {
155
157
  _ref5$inputProps = _ref5.inputProps,
156
158
  inputProps = _ref5$inputProps === void 0 ? {} : _ref5$inputProps,
157
159
  className = _ref5.className,
158
- qa = _ref5.qa;
160
+ qa = _ref5.qa,
161
+ tokens = _ref5.tokens,
162
+ onClear = _ref5.onClear;
159
163
  var _React$useState3 = React.useState(false),
160
164
  _React$useState4 = _slicedToArray(_React$useState3, 2),
161
165
  isIconVisible = _React$useState4[0],
@@ -201,6 +205,7 @@ var Dropzone_ = /*#__PURE__*/React.forwardRef(function Dropzone(_ref5, ref) {
201
205
  return /*#__PURE__*/React.createElement(StyledDropzoneWrapper, {
202
206
  direction: "column",
203
207
  alignItems: "stretch",
208
+ gap: "xs",
204
209
  className: className
205
210
  }, /*#__PURE__*/React.createElement(Tooltip, {
206
211
  trigger: Boolean(tooltip) ? 'hover' : 'none',
@@ -223,7 +228,21 @@ var Dropzone_ = /*#__PURE__*/React.forwardRef(function Dropzone(_ref5, ref) {
223
228
  onDismiss: function onDismiss() {
224
229
  return dispatchDropError(dropErrors.reset);
225
230
  }
226
- }));
231
+ }), tokens && tokens.length > 0 && /*#__PURE__*/React.createElement(Box, {
232
+ as: "ul",
233
+ display: "flex",
234
+ flexWrap: "wrap",
235
+ gap: "sm",
236
+ paddingTop: "lg"
237
+ }, tokens.map(function (token) {
238
+ return /*#__PURE__*/React.createElement("li", {
239
+ key: token.name
240
+ }, /*#__PURE__*/React.createElement(Token, null, /*#__PURE__*/React.createElement(Token.Label, null, getFileDetail(token)), onClear && /*#__PURE__*/React.createElement(Token.Remove, {
241
+ onClick: function onClick() {
242
+ return onClear(token);
243
+ }
244
+ })));
245
+ })));
227
246
  });
228
247
  DropzoneContainer.displayName = 'DropzoneContainer';
229
248
  DropzoneContent.displayName = 'DropzoneContent';
@@ -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","getFileDetail","isZeroSize","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","filesByErrorType","reduce","acc","rejection","errors","forEach","dropErrorType","dropErrorsByReason","code","push","file","_defineProperty","fileAmount","minFileSize","maxFileSize","fileType","oneFileAtATime","multipleErrors","messages","count","maxFiles","minSize","sizeInMegabytes","getSizeInMB","maxSize","map","errorType","files","length","key","weight","name","DropzoneErrorBanner","withConfig","displayName","componentId","DropzoneContainer","_ref2","active","disabled","getRootProps","rootProps","children","DropzoneContent","_ref3","isIconVisible","contentMessage","DropzoneDefaultMessage","_ref4","open","multiple","errorMessage","Fragment","variant","Infinity","Dropzone_","Dropzone","_ref5","forceIconVisibility","contentRenderer","tooltip","rootRef","inputRef","dragError","dropError","dispatchDropError","getInputProps","isDragActive","_ref5$rootProps","_ref5$inputProps","inputProps","className","_React$useState3","_React$useState4","setIsIconVisible","_useFocusWithin","isFocusWithin","containerProps","toggleIconVisibility","useCallback","entries","_ref6","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'\nimport { getFileDetail, isZeroSize } from './Dropzone.utils'\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]: isZeroSize(props.minSize)\n ? I18n.t('core.dropzone.zeroFileSizeErrorGroup')\n : 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((file) => (\n <li key={file.name}>{getFileDetail(file)}</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,EAC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2BAA2B,EAAKgI,cAAc,eAC7C3I,KAAA,CAAA+C,aAAA,CAACmD,iBAAiB;IAChBK,SAAS,EAAEkD,cAAe;IAC1BrD,MAAM,EAAE6B,YAAY,IAAIS,aAAc;IACtCrC,QAAQ,EAAEiD,kBAAmB;IAC7BhD,YAAY,EAAEA;EAAa,gBAE3BtG,KAAA,CAAA+C,aAAA,UAAAC,QAAA;IAAOH,IAAI,EAAC;EAAM,GAAKmF,aAAa,CAAC0B,eAAe,CAAC,CAAG,CAAC,eACzD1J,KAAA,CAAA+C,aAAA,CAAC0D,eAAe;IACdJ,QAAQ,EAAEiD,kBAAmB;IAC7B3C,aAAa,EACX,OAAOa,mBAAmB,KAAK,WAAW,GACtCb,aAAa,GACba,mBACL;IACDZ,cAAc,EAAEA;EAAe,CAChC,CACgB,CACQ,CACtB,CAAC,eACV5G,KAAA,CAAA+C,aAAA,CAAC+C,mBAAmB;IAClBjE,EAAE,EAAEA,EAAG;IACPF,KAAK,EAAEmG,SAAU;IACjBhG,cAAc,EAAEA,cAAe;IAC/BF,SAAS,EAAE,SAAXA,SAASA,CAAA;MAAA,OAAQmG,iBAAiB,CAAC7G,UAAU,CAAC4B,KAAK,CAAC;IAAA;EAAC,CACtD,CACoB,CAAC;AAE5B,CACF,CAAC;AAEDoD,iBAAiB,CAACF,WAAW,GAAG,mBAAmB;AAEnDS,eAAe,CAACT,WAAW,GAAG,iBAAiB;AAE/CqB,SAAS,CAACrB,WAAW,GAAG,UAAU;;AAElC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAMsB,QAAQ,gBAAGtH,KAAK,CAAC+J,IAAI,CAAC1C,SAAS,EAAEvH,MAAM,CAAC"}
1
+ {"version":3,"file":"Dropzone.js","names":["Ban","Image","equals","omit","React","styled","Banner","Box","Button","Token","Tooltip","Typography","useI18nContext","useResizeObserver","useFocusWithin","StyledDropzoneCaption","StyledDropzoneContainer","StyledDropzoneFocusDetector","StyledDropzoneIcon","StyledDropzoneMessage","StyledDropzoneWrapper","StyledErrorBanner","StyledErrorBannerDetails","StyledUploadButton","dropErrors","fileRejectionReason","getFileDetail","isZeroSize","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","filesByErrorType","reduce","acc","rejection","errors","forEach","dropErrorType","dropErrorsByReason","code","push","file","_defineProperty","fileAmount","minFileSize","maxFileSize","fileType","oneFileAtATime","multipleErrors","messages","count","maxFiles","minSize","sizeInMegabytes","getSizeInMB","maxSize","map","errorType","files","length","key","weight","name","DropzoneErrorBanner","withConfig","displayName","componentId","DropzoneContainer","_ref2","active","disabled","getRootProps","rootProps","children","DropzoneContent","_ref3","isIconVisible","contentMessage","DropzoneDefaultMessage","_ref4","open","multiple","errorMessage","Fragment","variant","Infinity","Dropzone_","Dropzone","_ref5","forceIconVisibility","contentRenderer","tooltip","rootRef","inputRef","dragError","dropError","dispatchDropError","getInputProps","isDragActive","_ref5$rootProps","_ref5$inputProps","inputProps","className","tokens","onClear","_React$useState3","_React$useState4","setIsIconVisible","_useFocusWithin","isFocusWithin","containerProps","toggleIconVisibility","useCallback","entries","_ref6","target","height","offsetHeight","setResizeObserverTarget","current","useImperativeHandle","isDropzoneDisabled","Boolean","useMemo","validRootProps","validInputProps","direction","alignItems","gap","trigger","overlay","as","display","flexWrap","paddingTop","token","Label","Remove","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'\nimport { Box } from '../Box'\nimport { Button } from '../Button'\nimport { Token } from '../Token'\nimport { Tooltip } from '../Tooltip'\nimport { Typography } from '../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'\nimport { getFileDetail, isZeroSize } from './Dropzone.utils'\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]: isZeroSize(props.minSize)\n ? I18n.t('core.dropzone.zeroFileSizeErrorGroup')\n : 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((file) => (\n <li key={file.name}>{getFileDetail(file)}</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 tokens,\n onClear,\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 gap=\"xs\"\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 {tokens && tokens.length > 0 && (\n <Box as=\"ul\" display=\"flex\" flexWrap=\"wrap\" gap=\"sm\" paddingTop=\"lg\">\n {tokens.map((token) => (\n <li key={token.name}>\n <Token>\n <Token.Label>{getFileDetail(token)}</Token.Label>\n {onClear && <Token.Remove onClick={() => onClear(token)} />}\n </Token>\n </li>\n ))}\n </Box>\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,WAAW;AAClC,SAASC,GAAG,QAAQ,QAAQ;AAC5B,SAASC,MAAM,QAAQ,WAAW;AAClC,SAASC,KAAK,QAAQ,UAAU;AAChC,SAASC,OAAO,QAAQ,YAAY;AACpC,SAASC,UAAU,QAAQ,eAAe;AAC1C,SAASC,cAAc,QAAQ,gBAAgB;AAC/C,SAASC,iBAAiB,QAAQ,0BAA0B;AAC5D,SAASC,cAAc,QAAQ,0BAA0B;AAEzD,SACEC,qBAAqB,EACrBC,uBAAuB,EACvBC,2BAA2B,EAC3BC,kBAAkB,E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A,CAAAiD,aAAA;MAAI4C,GAAG,EAAE2E,KAAK,CAACzE;IAAK,gBAClB/F,KAAA,CAAAiD,aAAA,CAAC5C,KAAK,qBACJL,KAAA,CAAAiD,aAAA,CAAC5C,KAAK,CAACoK,KAAK,QAAEnJ,aAAa,CAACkJ,KAAK,CAAe,CAAC,EAChD/B,OAAO,iBAAIzI,KAAA,CAAAiD,aAAA,CAAC5C,KAAK,CAACqK,MAAM;MAAClH,OAAO,EAAE,SAATA,OAAOA,CAAA;QAAA,OAAQiF,OAAO,CAAC+B,KAAK,CAAC;MAAA;IAAC,CAAE,CACrD,CACL,CAAC;EAAA,CACN,CACE,CAEc,CAAC;AAE5B,CACF,CAAC;AAEDpE,iBAAiB,CAACF,WAAW,GAAG,mBAAmB;AAEnDS,eAAe,CAACT,WAAW,GAAG,iBAAiB;AAE/CqB,SAAS,CAACrB,WAAW,GAAG,UAAU;;AAElC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAMsB,QAAQ,gBAAGxH,KAAK,CAAC2K,IAAI,CAACpD,SAAS,EAAEzH,MAAM,CAAC"}
@@ -9,9 +9,9 @@ export declare const StyledDropzoneContainer: import("styled-components").Styled
9
9
  disabled: boolean;
10
10
  }, never>;
11
11
  export declare const StyledDropzoneMessage: import("styled-components").StyledComponent<"div", any, {}, never>;
12
- export declare const StyledUploadButton: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("..").ButtonProps & import("react").RefAttributes<HTMLButtonElement>>, any, {}, never>;
12
+ export declare const StyledUploadButton: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../Button").ButtonProps & import("react").RefAttributes<HTMLButtonElement>>, any, {}, never>;
13
13
  export declare const StyledDropzoneCaption: import("styled-components").StyledComponent<"span", any, {
14
14
  error: boolean;
15
15
  }, never>;
16
- export declare const StyledDropzoneWrapper: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("..").DivAttributes & import("..").FlexProps & import("react").RefAttributes<HTMLDivElement>>, any, {}, never>;
17
- export declare const StyledDropzoneFocusDetector: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("..").DivAttributes & import("..").BoxProps & import("react").RefAttributes<HTMLDivElement>>, any, {}, never>;
16
+ export declare const StyledDropzoneWrapper: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("..").DivAttributes & import("../Flex").FlexProps & import("react").RefAttributes<HTMLDivElement>>, any, {}, never>;
17
+ export declare const StyledDropzoneFocusDetector: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("..").DivAttributes & import("../Box").BoxProps & import("react").RefAttributes<HTMLDivElement>>, any, {}, never>;
@@ -1,23 +1,23 @@
1
1
  import styled, { css } from 'styled-components';
2
2
  import { ErrorBanner as ErrorBannerBase } from '../Banner/Banner';
3
- import { Box } from '../Box/Box';
4
- import { Button } from '../Button/Button';
5
- import { Flex } from '../Flex/Flex';
6
- import { getTypographyIntent } from '../Typography/Typography.styles';
3
+ import { Box } from '../Box';
4
+ import { Button } from '../Button';
5
+ import { Flex } from '../Flex';
6
+ import { getTypographyIntent } from '../Typography';
7
7
  import { borderRadius } from '../_styles/borderRadius';
8
8
  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_18_1__sc-by95hy-0"
12
+ componentId: "core-12_19_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_18_1__sc-by95hy-1"
16
+ componentId: "core-12_19_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_18_1__sc-by95hy-2"
20
+ componentId: "core-12_19_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_18_1__sc-by95hy-3"
29
+ componentId: "core-12_19_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);
@@ -35,7 +35,7 @@ export var StyledDropzoneContainer = /*#__PURE__*/styled.div.withConfig({
35
35
  return disabled && disabledDropzone;
36
36
  }, function (_ref4) {
37
37
  var disabled = _ref4.disabled;
38
- return disabled && css(["&:hover,&:focused{", "}"], disabledDropzone);
38
+ return disabled && css(["&:hover,&:focus{", "}"], disabledDropzone);
39
39
  }, function (_ref5) {
40
40
  var active = _ref5.active,
41
41
  disabled = _ref5.disabled;
@@ -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_18_1__sc-by95hy-4"
46
+ componentId: "core-12_19_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_18_1__sc-by95hy-5"
50
+ componentId: "core-12_19_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_18_1__sc-by95hy-6"
54
+ componentId: "core-12_19_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_18_1__sc-by95hy-7"
61
+ componentId: "core-12_19_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_18_1__sc-by95hy-8"
65
+ componentId: "core-12_19_0__sc-by95hy-8"
66
66
  })(["height:100%;"]);
67
67
  //# sourceMappingURL=Dropzone.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Dropzone.styles.js","names":["styled","css","ErrorBanner","ErrorBannerBase","Box","Button","Flex","getTypographyIntent","borderRadius","colors","spacing","StyledErrorBanner","withConfig","displayName","componentId","lg","StyledErrorBannerDetails","ul","xs","StyledDropzoneIcon","div","gray45","_ref","disabled","sm","activeDropzone","blue50","blue96","disabledDropzone","gray70","gray85","gray98","StyledDropzoneContainer","gray40","gray96","md","_ref2","_ref3","_ref4","_ref5","active","StyledDropzoneMessage","StyledUploadButton","StyledDropzoneCaption","span","_ref6","error","gray15","StyledDropzoneWrapper","StyledDropzoneFocusDetector"],"sources":["../../src/Dropzone/Dropzone.styles.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport { ErrorBanner as ErrorBannerBase } from '../Banner/Banner'\nimport { Box } from '../Box/Box'\nimport { Button } from '../Button/Button'\nimport { Flex } from '../Flex/Flex'\nimport { getTypographyIntent } from '../Typography/Typography.styles'\nimport { borderRadius } from '../_styles/borderRadius'\nimport { colors } from '../_styles/colors'\nimport { spacing } from '../_styles/spacing'\n\nexport const StyledErrorBanner = styled(ErrorBannerBase)`\n margin-top: ${spacing.lg}px;\n flex-shrink: 0;\n`\nexport const StyledErrorBannerDetails = styled.ul`\n margin: ${spacing.xs}px;\n padding: 0;\n list-style-position: inside;\n list-style-type: disc;\n`\nexport const StyledDropzoneIcon = styled.div<{ disabled: boolean }>`\n display: flex;\n justify-content: center;\n align-items: center;\n height: 64px;\n color: ${colors.gray45};\n margin-bottom: ${spacing.lg}px;\n transition: all 250ms ease-out;\n\n ${({ disabled }) =>\n disabled &&\n css`\n height: 72px;\n margin-bottom: ${spacing.sm}px;\n `}\n\n svg {\n width: auto;\n height: 100%;\n }\n`\n\nconst activeDropzone = css`\n outline: none;\n border: 2px dashed ${colors.blue50};\n background-color: ${colors.blue96};\n\n & ${StyledDropzoneIcon} {\n color: ${colors.blue50};\n transform: scale(0.95);\n }\n`\n\nconst disabledDropzone = css`\n color: ${colors.gray70};\n border: 2px dashed ${colors.gray85};\n background-color: ${colors.gray98};\n cursor: not-allowed;\n\n & ${StyledDropzoneIcon} {\n color: ${colors.gray85};\n transform: none;\n }\n`\n\nexport const StyledDropzoneContainer = styled.div<{\n active: boolean\n disabled: boolean\n}>`\n ${getTypographyIntent('body')}\n\n display: inline-flex;\n justify-content: center;\n align-items: center;\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n min-height: 92px;\n padding: ${spacing.lg}px;\n color: ${colors.gray40};\n border: 2px dashed ${colors.gray70};\n background-color: ${colors.gray96};\n border-radius: ${borderRadius.md}px;\n text-align: center;\n letter-spacing: 0.25px;\n transition: all 250ms ease-out;\n cursor: grab;\n\n ${({ disabled }) =>\n !disabled &&\n css`\n &:hover {\n ${activeDropzone}\n }\n `}\n\n ${({ disabled }) => disabled && disabledDropzone}\n\n ${({ disabled }) =>\n disabled &&\n css`\n &:hover,\n &:focused {\n ${disabledDropzone}\n }\n `}\n\n ${({ active, disabled }) => active && !disabled && activeDropzone}\n`\n\nexport const StyledDropzoneMessage = styled.div`\n user-select: none;\n`\n\nexport const StyledUploadButton = styled(Button)`\n display: block;\n margin-left: auto;\n margin-right: auto;\n margin-bottom: ${spacing.sm}px;\n`\n\nexport const StyledDropzoneCaption = styled.span<{ error: boolean }>`\n color: ${({ error }) => error && colors.gray15};\n`\n\nexport const StyledDropzoneWrapper = styled(Flex)`\n height: 100%;\n`\n\nexport const StyledDropzoneFocusDetector = styled(Box)`\n height: 100%;\n`\n"],"mappings":"AAAA,OAAOA,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAC/C,SAASC,WAAW,IAAIC,eAAe,QAAQ,kBAAkB;AACjE,SAASC,GAAG,QAAQ,YAAY;AAChC,SAASC,MAAM,QAAQ,kBAAkB;AACzC,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,mBAAmB,QAAQ,iCAAiC;AACrE,SAASC,YAAY,QAAQ,yBAAyB;AACtD,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,OAAO,QAAQ,oBAAoB;AAE5C,OAAO,IAAMC,iBAAiB,gBAAGX,MAAM,CAACG,eAAe,CAAC,CAAAS,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,yCACxCJ,OAAO,CAACK,EAAE,CAEzB;AACD,OAAO,IAAMC,wBAAwB,gBAAGhB,MAAM,CAACiB,EAA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,QAAQ,GAAAe,KAAA,CAARf,QAAQ;EAAA,OACXA,QAAQ,IACRtB,GAAG,8BAGG2B,gBAAgB,CAErB;AAAA,GAED,UAAAW,KAAA;EAAA,IAAGC,MAAM,GAAAD,KAAA,CAANC,MAAM;IAAEjB,QAAQ,GAAAgB,KAAA,CAARhB,QAAQ;EAAA,OAAOiB,MAAM,IAAI,CAACjB,QAAQ,IAAIE,cAAc;AAAA,EAClE;AAED,OAAO,IAAMgB,qBAAqB,gBAAGzC,MAAM,CAACoB,GAAG,CAAAR,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,yBAE9C;AAED,OAAO,IAAM4B,kBAAkB,gBAAG1C,MAAM,CAACK,MAAM,CAAC,CAAAO,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,+EAI7BJ,OAAO,CAACc,EAAE,CAC5B;AAED,OAAO,IAAMmB,qBAAqB,gBAAG3C,MAAM,CAAC4C,IAAI,CAAAhC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,oBACrC,UAAA+B,KAAA;EAAA,IAAGC,KAAK,GAAAD,KAAA,CAALC,KAAK;EAAA,OAAOA,KAAK,IAAIrC,MAAM,CAACsC,MAAM;AAAA,EAC/C;AAED,OAAO,IAAMC,qBAAqB,gBAAGhD,MAAM,CAACM,IAAI,CAAC,CAAAM,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,oBAEhD;AAED,OAAO,IAAMmC,2BAA2B,gBAAGjD,MAAM,CAACI,GAAG,CAAC,CAAAQ,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,oBAErD"}
1
+ {"version":3,"file":"Dropzone.styles.js","names":["styled","css","ErrorBanner","ErrorBannerBase","Box","Button","Flex","getTypographyIntent","borderRadius","colors","spacing","StyledErrorBanner","withConfig","displayName","componentId","lg","StyledErrorBannerDetails","ul","xs","StyledDropzoneIcon","div","gray45","_ref","disabled","sm","activeDropzone","blue50","blue96","disabledDropzone","gray70","gray85","gray98","StyledDropzoneContainer","gray40","gray96","md","_ref2","_ref3","_ref4","_ref5","active","StyledDropzoneMessage","StyledUploadButton","StyledDropzoneCaption","span","_ref6","error","gray15","StyledDropzoneWrapper","StyledDropzoneFocusDetector"],"sources":["../../src/Dropzone/Dropzone.styles.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport { ErrorBanner as ErrorBannerBase } from '../Banner/Banner'\nimport { Box } from '../Box'\nimport { Button } from '../Button'\nimport { Flex } from '../Flex'\nimport { getTypographyIntent } from '../Typography'\nimport { borderRadius } from '../_styles/borderRadius'\nimport { colors } from '../_styles/colors'\nimport { spacing } from '../_styles/spacing'\n\nexport const StyledErrorBanner = styled(ErrorBannerBase)`\n margin-top: ${spacing.lg}px;\n flex-shrink: 0;\n`\nexport const StyledErrorBannerDetails = styled.ul`\n margin: ${spacing.xs}px;\n padding: 0;\n list-style-position: inside;\n list-style-type: disc;\n`\nexport const StyledDropzoneIcon = styled.div<{ disabled: boolean }>`\n display: flex;\n justify-content: center;\n align-items: center;\n height: 64px;\n color: ${colors.gray45};\n margin-bottom: ${spacing.lg}px;\n transition: all 250ms ease-out;\n\n ${({ disabled }) =>\n disabled &&\n css`\n height: 72px;\n margin-bottom: ${spacing.sm}px;\n `}\n\n svg {\n width: auto;\n height: 100%;\n }\n`\n\nconst activeDropzone = css`\n outline: none;\n border: 2px dashed ${colors.blue50};\n background-color: ${colors.blue96};\n\n & ${StyledDropzoneIcon} {\n color: ${colors.blue50};\n transform: scale(0.95);\n }\n`\n\nconst disabledDropzone = css`\n color: ${colors.gray70};\n border: 2px dashed ${colors.gray85};\n background-color: ${colors.gray98};\n cursor: not-allowed;\n\n & ${StyledDropzoneIcon} {\n color: ${colors.gray85};\n transform: none;\n }\n`\n\nexport const StyledDropzoneContainer = styled.div<{\n active: boolean\n disabled: boolean\n}>`\n ${getTypographyIntent('body')}\n\n display: inline-flex;\n justify-content: center;\n align-items: center;\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n min-height: 92px;\n padding: ${spacing.lg}px;\n color: ${colors.gray40};\n border: 2px dashed ${colors.gray70};\n background-color: ${colors.gray96};\n border-radius: ${borderRadius.md}px;\n text-align: center;\n letter-spacing: 0.25px;\n transition: all 250ms ease-out;\n cursor: grab;\n\n ${({ disabled }) =>\n !disabled &&\n css`\n &:hover {\n ${activeDropzone}\n }\n `}\n\n ${({ disabled }) => disabled && disabledDropzone}\n\n ${({ disabled }) =>\n disabled &&\n css`\n &:hover,\n &:focus {\n ${disabledDropzone}\n }\n `}\n\n ${({ active, disabled }) => active && !disabled && activeDropzone}\n`\n\nexport const StyledDropzoneMessage = styled.div`\n user-select: none;\n`\n\nexport const StyledUploadButton = styled(Button)`\n display: block;\n margin-left: auto;\n margin-right: auto;\n margin-bottom: ${spacing.sm}px;\n`\n\nexport const StyledDropzoneCaption = styled.span<{ error: boolean }>`\n color: ${({ error }) => error && colors.gray15};\n`\n\nexport const StyledDropzoneWrapper = styled(Flex)`\n height: 100%;\n`\n\nexport const StyledDropzoneFocusDetector = styled(Box)`\n height: 100%;\n`\n"],"mappings":"AAAA,OAAOA,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAC/C,SAASC,WAAW,IAAIC,eAAe,QAAQ,kBAAkB;AACjE,SAASC,GAAG,QAAQ,QAAQ;AAC5B,SAASC,MAAM,QAAQ,WAAW;AAClC,SAASC,IAAI,QAAQ,SAAS;AAC9B,SAASC,mBAAmB,QAAQ,eAAe;AACnD,SAASC,YAAY,QAAQ,yBAAyB;AACtD,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,OAAO,QAAQ,oBAAoB;AAE5C,OAAO,IAAMC,iBAAiB,gBAAGX,MAAM,CAACG,eAAe,CAAC,CAAAS,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,yCACxCJ,OAAO,CAACK,EAAE,CAEzB;AACD,OAAO,IAAMC,wBAAwB,gBAAGhB,MAAM,CAACiB,EAAE,CAAAL,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,iFACr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,IACRtB,GAAG,4BAGG2B,gBAAgB,CAErB;AAAA,GAED,UAAAW,KAAA;EAAA,IAAGC,MAAM,GAAAD,KAAA,CAANC,MAAM;IAAEjB,QAAQ,GAAAgB,KAAA,CAARhB,QAAQ;EAAA,OAAOiB,MAAM,IAAI,CAACjB,QAAQ,IAAIE,cAAc;AAAA,EAClE;AAED,OAAO,IAAMgB,qBAAqB,gBAAGzC,MAAM,CAACoB,GAAG,CAAAR,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,yBAE9C;AAED,OAAO,IAAM4B,kBAAkB,gBAAG1C,MAAM,CAACK,MAAM,CAAC,CAAAO,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,+EAI7BJ,OAAO,CAACc,EAAE,CAC5B;AAED,OAAO,IAAMmB,qBAAqB,gBAAG3C,MAAM,CAAC4C,IAAI,CAAAhC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,oBACrC,UAAA+B,KAAA;EAAA,IAAGC,KAAK,GAAAD,KAAA,CAALC,KAAK;EAAA,OAAOA,KAAK,IAAIrC,MAAM,CAACsC,MAAM;AAAA,EAC/C;AAED,OAAO,IAAMC,qBAAqB,gBAAGhD,MAAM,CAACM,IAAI,CAAC,CAAAM,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,oBAEhD;AAED,OAAO,IAAMmC,2BAA2B,gBAAGjD,MAAM,CAACI,GAAG,CAAC,CAAAQ,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,oBAErD"}
@@ -1,6 +1,6 @@
1
1
  import type React from 'react';
2
2
  import type { DropzoneInputProps as DropzoneInputPropsBase, DropzoneOptions, DropzoneRootProps as DropzoneRootPropsBase, DropzoneState } from 'react-dropzone';
3
- import { type FileError as FileRejectionError, type FileRejection } from 'react-dropzone';
3
+ import { type FileError as FileRejectionError, type FileRejection, type FileWithPath } from 'react-dropzone';
4
4
  export declare type DropzoneFile = any;
5
5
  export declare type FileRejectionReason = FileRejectionError['code'];
6
6
  export declare const fileRejectionReason: Record<string, FileRejectionReason>;
@@ -198,6 +198,11 @@ export declare type DropzoneHookState = DropzoneState & {
198
198
  * @since 10.19.0
199
199
  */
200
200
  dispatchDropError: (error: DropErrorType) => void;
201
+ /**
202
+ * Array of already selected files
203
+ * @since 12.19.0
204
+ */
205
+ value?: FileWithPath[];
201
206
  };
202
207
  /**
203
208
  * WARNING
@@ -248,8 +253,20 @@ export interface DropzoneProps extends DropzoneHookState {
248
253
  /**
249
254
  * Dropzone tooltip content
250
255
  * @since 10.19.0
256
+ * @deprecatedSince 12.19.0
257
+ * @deprecated `tooltip` has been deprecated and will be removed in the future version. Please use `contentRenderer` instead
251
258
  */
252
259
  tooltip?: React.ReactNode | string;
260
+ /**
261
+ * Array of already selected files
262
+ * @since 12.19.0
263
+ */
264
+ tokens?: FileWithPath[];
265
+ /**
266
+ * Handler function to clear already selected files
267
+ * @since 12.19.0
268
+ */
269
+ onClear?: (token: FileWithPath) => void;
253
270
  /**
254
271
  * Additional props for dropzone element
255
272
  * @since 10.19.0
@@ -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 * ```\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"}
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 type FileWithPath,\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 * Array of already selected files\n * @since 12.19.0\n */\n value?: FileWithPath[]\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 * @deprecatedSince 12.19.0\n * @deprecated `tooltip` has been deprecated and will be removed in the future version. Please use `contentRenderer` instead\n */\n tooltip?: React.ReactNode | string\n\n /**\n * Array of already selected files\n * @since 12.19.0\n */\n tokens?: FileWithPath[]\n\n /**\n * Handler function to clear already selected files\n * @since 12.19.0\n */\n onClear?: (token: FileWithPath) => void\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":"AAiBA,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;;AAwEV;AACA;AACA;AACA;AACA"}
@@ -5,27 +5,27 @@ import { spacing } from '../_styles/spacing';
5
5
  var emptyStateWidth = 312;
6
6
  export var StyledSvg = /*#__PURE__*/styled.svg.withConfig({
7
7
  displayName: "StyledSvg",
8
- componentId: "core-12_18_1__sc-1xaoo8n-0"
8
+ componentId: "core-12_19_0__sc-1xaoo8n-0"
9
9
  })(["width:200px;height:200px;"]);
10
10
  export var StyledImage = /*#__PURE__*/styled.div.withConfig({
11
11
  displayName: "StyledImage",
12
- componentId: "core-12_18_1__sc-1xaoo8n-1"
12
+ componentId: "core-12_19_0__sc-1xaoo8n-1"
13
13
  })([""]);
14
14
  export var StyledTitle = /*#__PURE__*/styled.div.withConfig({
15
15
  displayName: "StyledTitle",
16
- componentId: "core-12_18_1__sc-1xaoo8n-2"
16
+ componentId: "core-12_19_0__sc-1xaoo8n-2"
17
17
  })(["color:", ";max-width:", "px;width:100%;", ""], colors.gray15, emptyStateWidth, getTypographyIntent('h2'));
18
18
  export var StyledDescription = /*#__PURE__*/styled.div.withConfig({
19
19
  displayName: "StyledDescription",
20
- componentId: "core-12_18_1__sc-1xaoo8n-3"
20
+ componentId: "core-12_19_0__sc-1xaoo8n-3"
21
21
  })(["margin-top:", "px;color:", ";max-width:", "px;width:100%;", ""], spacing.lg, colors.gray45, emptyStateWidth, getTypographyIntent('body'));
22
22
  export var StyledActions = /*#__PURE__*/styled.div.withConfig({
23
23
  displayName: "StyledActions",
24
- componentId: "core-12_18_1__sc-1xaoo8n-4"
24
+ componentId: "core-12_19_0__sc-1xaoo8n-4"
25
25
  })(["margin-top:", "px;"], spacing.xl);
26
26
  export var StyledEmptyState = /*#__PURE__*/styled.div.withConfig({
27
27
  displayName: "StyledEmptyState",
28
- componentId: "core-12_18_1__sc-1xaoo8n-5"
28
+ componentId: "core-12_19_0__sc-1xaoo8n-5"
29
29
  })(["display:flex;justify-content:center;align-items:", ";gap:", "px;flex-direction:", ";margin-top:", "px;margin-bottom:", "px;", "{> img{max-width:200px;}}", " ", "}"], function (_ref) {
30
30
  var $isHorizontal = _ref.$isHorizontal;
31
31
  return $isHorizontal ? 'flex-start' : 'center';
@@ -2,14 +2,14 @@ import styled from 'styled-components';
2
2
  import { getSmallIconBodyTextRules, StyledP } from '../Semantic/Semantic.styles';
3
3
  export var StyledField = /*#__PURE__*/styled.div.withConfig({
4
4
  displayName: "StyledField",
5
- componentId: "core-12_18_1__sc-1q3pe6s-0"
5
+ componentId: "core-12_19_0__sc-1q3pe6s-0"
6
6
  })(["> ", "{", "}"], StyledP, getSmallIconBodyTextRules);
7
7
  export var StyledFieldHeader = /*#__PURE__*/styled.div.withConfig({
8
8
  displayName: "StyledFieldHeader",
9
- componentId: "core-12_18_1__sc-1q3pe6s-1"
9
+ componentId: "core-12_19_0__sc-1q3pe6s-1"
10
10
  })(["", " > ", "{", "}"], getSmallIconBodyTextRules, StyledP, getSmallIconBodyTextRules);
11
11
  export var StyledFieldFooter = /*#__PURE__*/styled.div.withConfig({
12
12
  displayName: "StyledFieldFooter",
13
- componentId: "core-12_18_1__sc-1q3pe6s-2"
13
+ componentId: "core-12_19_0__sc-1q3pe6s-2"
14
14
  })(["> ", "{", "}"], StyledP, getSmallIconBodyTextRules);
15
15
  //# sourceMappingURL=Field.styles.js.map
@@ -3,18 +3,18 @@ import { LinkButton } from '../Button/Button';
3
3
  import { spacing } from '../_styles/spacing';
4
4
  export var StyledFileListDownloadAll = /*#__PURE__*/styled(LinkButton).withConfig({
5
5
  displayName: "StyledFileListDownloadAll",
6
- componentId: "core-12_18_1__sc-7gltjc-0"
6
+ componentId: "core-12_19_0__sc-7gltjc-0"
7
7
  })(["margin-bottom:", "px;"], spacing.xs);
8
8
  export var StyledFileListItem = /*#__PURE__*/styled.li.withConfig({
9
9
  displayName: "StyledFileListItem",
10
- componentId: "core-12_18_1__sc-7gltjc-1"
10
+ componentId: "core-12_19_0__sc-7gltjc-1"
11
11
  })(["display:flex;align-items:center;margin-bottom:", "px;word-break:break-word;&:last-child{margin-bottom:0;}"], spacing.xs);
12
12
  export var StyledFileListItemTextInactive = /*#__PURE__*/styled.span.withConfig({
13
13
  displayName: "StyledFileListItemTextInactive",
14
- componentId: "core-12_18_1__sc-7gltjc-2"
14
+ componentId: "core-12_19_0__sc-7gltjc-2"
15
15
  })(["cursor:pointer;"]);
16
16
  export var StyledFileListItemDownloadIcon = /*#__PURE__*/styled(LinkButton).withConfig({
17
17
  displayName: "StyledFileListItemDownloadIcon",
18
- componentId: "core-12_18_1__sc-7gltjc-3"
18
+ componentId: "core-12_19_0__sc-7gltjc-3"
19
19
  })(["margin-left:", "px;align-self:flex-start;"], spacing.sm);
20
20
  //# sourceMappingURL=FileList.styles.js.map