box-ui-elements 19.0.0 → 20.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (190) hide show
  1. package/dist/explorer.js +1 -1
  2. package/dist/openwith.js +1 -1
  3. package/dist/picker.js +1 -1
  4. package/dist/preview.js +1 -1
  5. package/dist/sharing.js +1 -1
  6. package/dist/sidebar.js +1 -1
  7. package/dist/uploader.js +1 -1
  8. package/es/components/breadcrumb/Breadcrumb.js.flow +3 -2
  9. package/es/components/breadcrumb/Breadcrumb.js.map +1 -1
  10. package/es/components/date-picker/DatePicker.js.flow +3 -2
  11. package/es/components/grid-view/GridViewSlider.js.flow +3 -2
  12. package/es/components/grid-view/GridViewSlider.js.map +1 -1
  13. package/es/components/i18n/FormattedCompMessage.js +1 -0
  14. package/es/components/i18n/FormattedCompMessage.js.flow +1 -0
  15. package/es/components/i18n/FormattedCompMessage.js.map +1 -1
  16. package/es/components/i18n/Plural.js +1 -1
  17. package/es/components/i18n/Plural.js.flow +1 -1
  18. package/es/components/i18n/Plural.js.map +1 -1
  19. package/es/components/i18n/index.js +1 -1
  20. package/es/components/i18n/index.js.flow +1 -1
  21. package/es/components/i18n/index.js.map +1 -1
  22. package/es/components/sidebar-toggle-button/SidebarToggleButton.js.flow +3 -2
  23. package/es/components/sidebar-toggle-button/SidebarToggleButton.js.map +1 -1
  24. package/es/components/time/ReadableTime.js +7 -8
  25. package/es/components/time/ReadableTime.js.flow +4 -8
  26. package/es/components/time/ReadableTime.js.map +1 -1
  27. package/es/elements/common/breadcrumbs/Breadcrumbs.js.flow +3 -2
  28. package/es/elements/common/breadcrumbs/Breadcrumbs.js.map +1 -1
  29. package/es/elements/common/create-folder-dialog/CreateFolderDialog.js.flow +3 -2
  30. package/es/elements/common/create-folder-dialog/CreateFolderDialog.js.map +1 -1
  31. package/es/elements/common/date/DateField.js.flow +3 -2
  32. package/es/elements/common/date/DateField.js.map +1 -1
  33. package/es/elements/common/share-access-select/ShareAccessSelect.js.flow +3 -2
  34. package/es/elements/common/share-access-select/ShareAccessSelect.js.map +1 -1
  35. package/es/elements/common/sub-header/SubHeaderLeft.js.flow +3 -2
  36. package/es/elements/common/sub-header/SubHeaderLeft.js.map +1 -1
  37. package/es/elements/common/sub-header/ViewModeChangeButton.js.flow +3 -2
  38. package/es/elements/common/sub-header/ViewModeChangeButton.js.map +1 -1
  39. package/es/elements/common/upload-dialog/UploadDialog.js.flow +3 -2
  40. package/es/elements/common/upload-dialog/UploadDialog.js.map +1 -1
  41. package/es/elements/content-explorer/DeleteConfirmationDialog.js.flow +3 -2
  42. package/es/elements/content-explorer/DeleteConfirmationDialog.js.map +1 -1
  43. package/es/elements/content-explorer/ItemList.js.flow +3 -2
  44. package/es/elements/content-explorer/ItemList.js.map +1 -1
  45. package/es/elements/content-explorer/PreviewDialog.js.flow +3 -2
  46. package/es/elements/content-explorer/PreviewDialog.js.map +1 -1
  47. package/es/elements/content-explorer/RenameDialog.js.flow +3 -2
  48. package/es/elements/content-explorer/RenameDialog.js.map +1 -1
  49. package/es/elements/content-explorer/ShareDialog.js.flow +3 -2
  50. package/es/elements/content-explorer/ShareDialog.js.map +1 -1
  51. package/es/elements/content-preview/PreviewNavigation.js.flow +3 -2
  52. package/es/elements/content-preview/PreviewNavigation.js.map +1 -1
  53. package/es/elements/content-preview/preview-header/PreviewHeader.js.flow +3 -2
  54. package/es/elements/content-preview/preview-header/PreviewHeader.js.map +1 -1
  55. package/es/elements/content-sidebar/SidebarAccessStats.js.flow +3 -2
  56. package/es/elements/content-sidebar/SidebarAccessStats.js.map +1 -1
  57. package/es/elements/content-sidebar/SidebarFileProperties.js.flow +3 -2
  58. package/es/elements/content-sidebar/SidebarFileProperties.js.map +1 -1
  59. package/es/elements/content-sidebar/SidebarNav.js.flow +3 -2
  60. package/es/elements/content-sidebar/SidebarNav.js.map +1 -1
  61. package/es/elements/content-sidebar/activity-feed/activity-feed/ActivityThreadReplyForm.js.flow +3 -2
  62. package/es/elements/content-sidebar/activity-feed/activity-feed/ActivityThreadReplyForm.js.map +1 -1
  63. package/es/elements/content-sidebar/activity-feed/comment-form/CommentForm.js.flow +3 -2
  64. package/es/elements/content-sidebar/activity-feed/comment-form/CommentForm.js.map +1 -1
  65. package/es/elements/content-sidebar/activity-feed/task-form/TaskForm.js.flow +2 -2
  66. package/es/elements/content-sidebar/activity-feed/task-form/TaskForm.js.map +1 -1
  67. package/es/elements/content-sidebar/activity-feed/version/CollapsedVersion.js.flow +3 -2
  68. package/es/elements/content-sidebar/activity-feed/version/CollapsedVersion.js.map +1 -1
  69. package/es/elements/content-sidebar/activity-feed/version/Version.js.flow +3 -2
  70. package/es/elements/content-sidebar/activity-feed/version/Version.js.map +1 -1
  71. package/es/elements/content-uploader/ItemAction.js.flow +3 -2
  72. package/es/elements/content-uploader/ItemAction.js.map +1 -1
  73. package/es/elements/content-uploader/ItemRemove.js.flow +3 -2
  74. package/es/elements/content-uploader/ItemRemove.js.map +1 -1
  75. package/es/features/classification/security-controls/messages.js +1 -1
  76. package/es/features/classification/security-controls/messages.js.flow +1 -1
  77. package/es/features/classification/security-controls/messages.js.map +1 -1
  78. package/es/features/collaborator-avatars/CollaboratorAvatarItem.js.flow +3 -2
  79. package/es/features/collaborator-avatars/CollaboratorAvatarItem.js.map +1 -1
  80. package/es/features/collapsible-sidebar/CollapsibleSidebarLogo.js.flow +4 -2
  81. package/es/features/collapsible-sidebar/CollapsibleSidebarLogo.js.map +1 -1
  82. package/es/features/content-explorer/content-explorer-modal/ContentExplorerModal.js +5 -3
  83. package/es/features/content-explorer/content-explorer-modal/ContentExplorerModal.js.flow +3 -0
  84. package/es/features/content-explorer/content-explorer-modal/ContentExplorerModal.js.map +1 -1
  85. package/es/features/content-explorer/content-explorer-modal-container/ContentExplorerModalContainer.js +10 -4
  86. package/es/features/content-explorer/content-explorer-modal-container/ContentExplorerModalContainer.js.flow +5 -0
  87. package/es/features/content-explorer/content-explorer-modal-container/ContentExplorerModalContainer.js.map +1 -1
  88. package/es/features/content-explorer/new-folder-modal/NewFolderModal.js +9 -3
  89. package/es/features/content-explorer/new-folder-modal/NewFolderModal.js.flow +5 -0
  90. package/es/features/content-explorer/new-folder-modal/NewFolderModal.js.map +1 -1
  91. package/es/features/message-center/components/message-center-modal/MessageCenterModal.js.flow +4 -2
  92. package/es/features/message-center/components/message-center-modal/MessageCenterModal.js.map +1 -1
  93. package/es/features/presence/PresenceAvatarTooltipContent.js +8 -10
  94. package/es/features/presence/PresenceAvatarTooltipContent.js.map +1 -1
  95. package/es/features/presence/PresenceCollaborator.js +6 -1
  96. package/es/features/presence/PresenceCollaborator.js.flow +3 -3
  97. package/es/features/presence/PresenceCollaborator.js.map +1 -1
  98. package/es/features/shared-link-modal/SharedLink.js.flow +3 -2
  99. package/es/features/shared-link-modal/SharedLink.js.map +1 -1
  100. package/es/features/unified-share-modal/ContactRestrictionNotice.js.flow +3 -2
  101. package/es/features/unified-share-modal/ContactRestrictionNotice.js.map +1 -1
  102. package/es/features/virtualized-table/VirtualizedTable.js.flow +2 -2
  103. package/es/features/virtualized-table/VirtualizedTable.js.map +1 -1
  104. package/es/features/virtualized-table-renderers/lastModifiedByCellRenderer.js +6 -11
  105. package/es/features/virtualized-table-renderers/lastModifiedByCellRenderer.js.flow +3 -8
  106. package/es/features/virtualized-table-renderers/lastModifiedByCellRenderer.js.map +1 -1
  107. package/es/src/components/avatar/Avatar.d.ts +1 -3
  108. package/es/src/components/avatar/Avatar.stories.d.ts +1 -3
  109. package/es/src/components/close-button/CloseButton.d.ts +1 -3
  110. package/es/src/components/close-button/CloseButton.stories.d.ts +1 -3
  111. package/es/src/components/date-picker/DatePicker.d.ts +1 -3
  112. package/es/src/components/date-picker/DatePicker.stories.d.ts +1 -3
  113. package/es/src/components/media/Media.d.ts +1 -3
  114. package/es/src/components/media/MediaMenu.d.ts +1 -3
  115. package/es/src/components/media/stories/Media.stories.d.ts +1 -3
  116. package/es/src/components/media/stories/MediaMenu.stories.d.ts +1 -3
  117. package/es/src/components/search-form/SearchActions.d.ts +2 -2
  118. package/es/src/components/time-input/TimeInput.d.ts +1 -3
  119. package/es/src/components/time-input/TimeInput.stories.d.ts +1 -3
  120. package/es/src/components/tooltip/CloseButton.d.ts +1 -3
  121. package/es/src/elements/content-sidebar/SidebarNavSignButton.d.ts +2 -4
  122. package/es/src/elements/content-sidebar/activity-feed/annotations/AnnotationActivityLink.d.ts +1 -3
  123. package/es/src/features/content-answers/ContentAnswersModalFooter.d.ts +1 -3
  124. package/es/src/features/content-answers/ContentAnswersOpenButton.d.ts +1 -3
  125. package/es/src/features/content-insights/CompactCount.d.ts +1 -3
  126. package/es/src/features/content-insights/GraphCardPreviewsSummary.d.ts +1 -3
  127. package/es/src/features/content-insights/MetricSummary.d.ts +1 -3
  128. package/es/src/features/content-insights/TrendPill.d.ts +1 -3
  129. package/es/src/features/presence/PresenceAvatarTooltipContent.d.ts +2 -4
  130. package/es/utils/relativeTime.js +54 -0
  131. package/es/utils/relativeTime.js.flow +31 -0
  132. package/es/utils/relativeTime.js.map +1 -0
  133. package/i18n/en-US.js +1 -1
  134. package/i18n/en-US.properties +1 -1
  135. package/package.json +4 -4
  136. package/src/components/breadcrumb/Breadcrumb.js +3 -2
  137. package/src/components/date-picker/DatePicker.js.flow +3 -2
  138. package/src/components/grid-view/GridViewSlider.js +3 -2
  139. package/src/components/i18n/FormattedCompMessage.js +1 -0
  140. package/src/components/i18n/Plural.js +1 -1
  141. package/src/components/i18n/README.md +4 -0
  142. package/src/components/i18n/index.js +1 -1
  143. package/src/components/sidebar-toggle-button/SidebarToggleButton.js +3 -2
  144. package/src/components/time/ReadableTime.js +4 -8
  145. package/src/components/time/__tests__/__snapshots__/ReadableTime.test.js.snap +7 -7
  146. package/src/elements/common/breadcrumbs/Breadcrumbs.js +3 -2
  147. package/src/elements/common/create-folder-dialog/CreateFolderDialog.js +3 -2
  148. package/src/elements/common/date/DateField.js +3 -2
  149. package/src/elements/common/share-access-select/ShareAccessSelect.js +3 -2
  150. package/src/elements/common/sub-header/SubHeaderLeft.js +3 -2
  151. package/src/elements/common/sub-header/ViewModeChangeButton.js +3 -2
  152. package/src/elements/common/upload-dialog/UploadDialog.js +3 -2
  153. package/src/elements/content-explorer/DeleteConfirmationDialog.js +3 -2
  154. package/src/elements/content-explorer/ItemList.js +3 -2
  155. package/src/elements/content-explorer/PreviewDialog.js +3 -2
  156. package/src/elements/content-explorer/RenameDialog.js +3 -2
  157. package/src/elements/content-explorer/ShareDialog.js +3 -2
  158. package/src/elements/content-preview/PreviewNavigation.js +3 -2
  159. package/src/elements/content-preview/preview-header/PreviewHeader.js +3 -2
  160. package/src/elements/content-sidebar/SidebarAccessStats.js +3 -2
  161. package/src/elements/content-sidebar/SidebarFileProperties.js +3 -2
  162. package/src/elements/content-sidebar/SidebarNav.js +3 -2
  163. package/src/elements/content-sidebar/activity-feed/activity-feed/ActivityThreadReplyForm.js +3 -2
  164. package/src/elements/content-sidebar/activity-feed/comment-form/CommentForm.js +3 -2
  165. package/src/elements/content-sidebar/activity-feed/task-form/TaskForm.js +2 -2
  166. package/src/elements/content-sidebar/activity-feed/version/CollapsedVersion.js +3 -2
  167. package/src/elements/content-sidebar/activity-feed/version/Version.js +3 -2
  168. package/src/elements/content-uploader/ItemAction.js +3 -2
  169. package/src/elements/content-uploader/ItemRemove.js +3 -2
  170. package/src/features/classification/security-controls/__tests__/__snapshots__/SecurityControlsModal.test.js.snap +1 -1
  171. package/src/features/classification/security-controls/messages.js +1 -1
  172. package/src/features/collaborator-avatars/CollaboratorAvatarItem.js +3 -2
  173. package/src/features/collapsible-sidebar/CollapsibleSidebarLogo.js +4 -2
  174. package/src/features/content-explorer/content-explorer-modal/ContentExplorerModal.js +3 -0
  175. package/src/features/content-explorer/content-explorer-modal/__tests__/__snapshots__/ContentExplorerModal.test.js.snap +1 -0
  176. package/src/features/content-explorer/content-explorer-modal-container/ContentExplorerModalContainer.js +5 -0
  177. package/src/features/content-explorer/content-explorer-modal-container/__tests__/ContentExplorerModalContainer.test.js +16 -2
  178. package/src/features/content-explorer/new-folder-modal/NewFolderModal.js +5 -0
  179. package/src/features/message-center/components/message-center-modal/MessageCenterModal.js +4 -2
  180. package/src/features/presence/PresenceAvatarTooltipContent.tsx +4 -8
  181. package/src/features/presence/PresenceCollaborator.js +3 -3
  182. package/src/features/presence/__tests__/PresenceAvatarTooltipContent.test.tsx +2 -2
  183. package/src/features/shared-link-modal/SharedLink.js +3 -2
  184. package/src/features/unified-share-modal/ContactRestrictionNotice.js +3 -2
  185. package/src/features/virtualized-table/VirtualizedTable.js +2 -2
  186. package/src/features/virtualized-table-renderers/__tests__/__snapshots__/lastModifiedByCellRenderer.test.js.snap +1 -1
  187. package/src/features/virtualized-table-renderers/__tests__/lastModifiedByCellRenderer.test.js +14 -9
  188. package/src/features/virtualized-table-renderers/lastModifiedByCellRenderer.js +3 -8
  189. package/src/utils/__tests__/relativeTime.test.js +45 -0
  190. package/src/utils/relativeTime.js +31 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "box-ui-elements",
3
- "version": "19.0.0",
3
+ "version": "20.0.0-beta.1",
4
4
  "description": "Box UI Elements",
5
5
  "author": "Box (https://www.box.com/)",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -282,7 +282,6 @@
282
282
  "lodash": "^4.17.15",
283
283
  "message-accumulator": "^2.1.1",
284
284
  "mini-css-extract-plugin": "^0.9.0",
285
- "mocha": "^6.2.2",
286
285
  "mousetrap": "^1.6.3",
287
286
  "mutationobserver-shim": "^0.3.3",
288
287
  "npm-run-all": "^4.1.3",
@@ -307,7 +306,7 @@
307
306
  "react-dom": "^17.0.1",
308
307
  "react-draggable": "^3.3.0",
309
308
  "react-immutable-proptypes": "^2.1.0",
310
- "react-intl": "^3.11.0",
309
+ "react-intl": "6.4.2",
311
310
  "react-measure": "^2.3.0",
312
311
  "react-modal": "^3.8.1",
313
312
  "react-popper": "^1.3.4",
@@ -404,7 +403,8 @@
404
403
  },
405
404
  "resolutions": {
406
405
  "ip": "1.1.8",
407
- "terser-webpack-plugin": "^4.2.3"
406
+ "terser-webpack-plugin": "^4.2.3",
407
+ "**/react-intl/**/@types/react": "^16.9.18"
408
408
  },
409
409
  "overrides": {
410
410
  "draft-js": {
@@ -1,7 +1,7 @@
1
1
  // @flow
2
2
  import * as React from 'react';
3
3
  import { injectIntl } from 'react-intl';
4
- import type { InjectIntlProvidedProps } from 'react-intl';
4
+ import type { IntlShape } from 'react-intl';
5
5
  import classNames from 'classnames';
6
6
 
7
7
  import { MenuLinkItem } from '../menu';
@@ -18,6 +18,7 @@ export type BreadcrumbProps = {
18
18
  className?: string,
19
19
  /** Reverse default overflow breadcrumb ordering to highest to lowest depth */
20
20
  hasReverseOverflowOrder?: boolean,
21
+ intl: IntlShape,
21
22
  /** Show number of breadcrumb items before overflow. Default is 1 */
22
23
  numItemsBeforeOverflow?: number,
23
24
  /** Element to override default overflow menu button */
@@ -26,7 +27,7 @@ export type BreadcrumbProps = {
26
27
  threshold?: number,
27
28
  };
28
29
 
29
- type Props = BreadcrumbProps & InjectIntlProvidedProps;
30
+ type Props = BreadcrumbProps;
30
31
 
31
32
  const Breadcrumb = ({
32
33
  children,
@@ -1,7 +1,7 @@
1
1
  // @flow
2
2
  import * as React from 'react';
3
3
  import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
4
- import type { InjectIntlProvidedProps } from 'react-intl';
4
+ import type { IntlShape } from 'react-intl';
5
5
  import classNames from 'classnames';
6
6
  import Pikaday from 'pikaday';
7
7
  import range from 'lodash/range';
@@ -122,6 +122,7 @@ type Props = {
122
122
  hideOptionalLabel?: boolean,
123
123
  /** Props that will be applied on the input element */
124
124
  inputProps?: Object,
125
+ intl: IntlShape,
125
126
  /** Is input clearable */
126
127
  isClearable?: boolean,
127
128
  /** Is input disabled */
@@ -151,7 +152,7 @@ type Props = {
151
152
  /** Date to set the input */
152
153
  value?: Date,
153
154
  yearRange?: number | Array<number>,
154
- } & InjectIntlProvidedProps;
155
+ };
155
156
 
156
157
  class DatePicker extends React.Component<Props> {
157
158
  static defaultProps = {
@@ -1,7 +1,7 @@
1
1
  // @flow
2
2
  import * as React from 'react';
3
3
  import { injectIntl } from 'react-intl';
4
- import type { InjectIntlProvidedProps } from 'react-intl';
4
+ import type { IntlShape } from 'react-intl';
5
5
  import IconPlusThin from '../../icons/general/IconPlusThin';
6
6
  import IconMinusThin from '../../icons/general/IconMinusThin';
7
7
  import PlainButton from '../plain-button/PlainButton';
@@ -13,9 +13,10 @@ type Props = {
13
13
  columnCount: number,
14
14
  gridMaxColumns: number,
15
15
  gridMinColumns: number,
16
+ intl: IntlShape,
16
17
  maxColumnCount: number,
17
18
  onChange: (newSliderValue: number) => void,
18
- } & InjectIntlProvidedProps;
19
+ };
19
20
 
20
21
  const GridViewSlider = ({ columnCount, gridMaxColumns, gridMinColumns, intl, maxColumnCount, onChange }: Props) => {
21
22
  const { formatMessage } = intl;
@@ -1,4 +1,5 @@
1
1
  // @flow
2
+ // @deprecated, use FormattedMessage from react-intl v6 instead.
2
3
  import * as React from 'react';
3
4
  import { injectIntl } from 'react-intl';
4
5
  import isNaN from 'lodash/isNaN';
@@ -1,5 +1,5 @@
1
1
  // @flow
2
- // @deprecated, use FormattedPlural from react-intl v3 instead
2
+ // @deprecated, use FormattedPlural from react-intl v6 instead.
3
3
  import * as React from 'react';
4
4
 
5
5
  type Props = {
@@ -1,5 +1,9 @@
1
1
  ### Examples
2
2
 
3
+ <!-- @deprecated, use [FormattedPlural](https://formatjs.io/docs/react-intl/components#formattedplural) or [FormattedMessage](https://formatjs.io/docs/react-intl/components#rich-text-formatting) with rich-text formatting from react-intl v6 instead.
4
+ @TODO: remove redundant components/code after react-intl upgrade (confirm unusability).
5
+ -->
6
+
3
7
  ** Basic **
4
8
 
5
9
  This can be a drop-in replacement for react-intl's FormattedHTMLMessage component:
@@ -1,5 +1,5 @@
1
1
  // @flow
2
- // @deprecated, use FormattedPlural or FormattedMessage from react-intl v3 instead
2
+ // @deprecated, use FormattedPlural or FormattedMessage from react-intl v6 instead.
3
3
  export { default as Param } from './Param';
4
4
  export { default as Plural } from './Plural';
5
5
  export { default } from './FormattedCompMessage';
@@ -2,7 +2,7 @@
2
2
  import * as React from 'react';
3
3
  import classNames from 'classnames';
4
4
  import { injectIntl } from 'react-intl';
5
- import type { InjectIntlProvidedProps } from 'react-intl';
5
+ import type { IntlShape } from 'react-intl';
6
6
 
7
7
  import IconHide from '../../icons/general/IconHide';
8
8
  import IconShow from '../../icons/general/IconShow';
@@ -19,9 +19,10 @@ const DIRECTION_RIGHT = 'right';
19
19
  type Props = {
20
20
  className?: string,
21
21
  direction?: string,
22
+ intl: IntlShape,
22
23
  isOpen: boolean,
23
24
  onClick?: Function,
24
- } & InjectIntlProvidedProps;
25
+ };
25
26
 
26
27
  const SidebarToggleButton = ({
27
28
  className = '',
@@ -3,7 +3,8 @@
3
3
  import { injectIntl } from 'react-intl';
4
4
 
5
5
  import { ONE_HOUR_MS } from '../../constants';
6
- import { isToday, isYesterday, isCurrentYear } from '../../utils/datetime';
6
+ import { isCurrentYear, isToday, isYesterday } from '../../utils/datetime';
7
+ import timeFromNow from '../../utils/relativeTime';
7
8
 
8
9
  import messages from './messages';
9
10
 
@@ -78,13 +79,8 @@ const ReadableTime = ({
78
79
  // print the default time format
79
80
  const timeDiff = timestamp - Date.now();
80
81
  if (Math.abs(timeDiff) <= relativeThreshold) {
81
- if (intl.formatRelativeTime) {
82
- // react-intl v3
83
- output = intl.formatRelativeTime(timeDiff);
84
- } else {
85
- // react-intl v2
86
- output = intl.formatRelative(timestamp);
87
- }
82
+ const { value, unit } = timeFromNow(timestamp);
83
+ output = intl.formatRelativeTime(value, unit);
88
84
  }
89
85
 
90
86
  return shouldUppercase ? output.toLocaleUpperCase(intl.locale) : output;
@@ -1,10 +1,10 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`components/time/ReadableTime should use default relative threshold if not provided 1`] = `"in 1,800,000 seconds"`;
3
+ exports[`components/time/ReadableTime should use default relative threshold if not provided 1`] = `"in 30 minutes"`;
4
4
 
5
- exports[`components/time/ReadableTime timestamp: ms1HourInFuture | allowFutureTimestamps: false | alwaysShowTime: false | showWeekday: false | Today at hh:mm 1`] = `"3,600,000 seconds ago"`;
5
+ exports[`components/time/ReadableTime timestamp: ms1HourInFuture | allowFutureTimestamps: false | alwaysShowTime: false | showWeekday: false | Today at hh:mm 1`] = `"1 hour ago"`;
6
6
 
7
- exports[`components/time/ReadableTime timestamp: ms1HourInFuture | allowFutureTimestamps: false | alwaysShowTime: false | showWeekday: false | Today at hh:mm: uppercase 1`] = `"3,600,000 SECONDS AGO"`;
7
+ exports[`components/time/ReadableTime timestamp: ms1HourInFuture | allowFutureTimestamps: false | alwaysShowTime: false | showWeekday: false | Today at hh:mm: uppercase 1`] = `"1 HOUR AGO"`;
8
8
 
9
9
  exports[`components/time/ReadableTime timestamp: msBeginningOfCenturyTime | allowFutureTimestamps: true | alwaysShowTime: false | showWeekday: false | mm dd yy at hh:mm 1`] = `"Dec 31, 1999"`;
10
10
 
@@ -26,13 +26,13 @@ exports[`components/time/ReadableTime timestamp: relativeThreshold * 2 + now | a
26
26
 
27
27
  exports[`components/time/ReadableTime timestamp: relativeThreshold * 2 + now | allowFutureTimestamps: true | alwaysShowTime: false | showWeekday: false | Today at hh:mm: uppercase 1`] = `"TODAY AT 5:30 PM"`;
28
28
 
29
- exports[`components/time/ReadableTime timestamp: withinRelativeThresholdAhead | allowFutureTimestamps: true | alwaysShowTime: false | showWeekday: false | in 30 minutes 1`] = `"in 1,800,000 seconds"`;
29
+ exports[`components/time/ReadableTime timestamp: withinRelativeThresholdAhead | allowFutureTimestamps: true | alwaysShowTime: false | showWeekday: false | in 30 minutes 1`] = `"in 30 minutes"`;
30
30
 
31
- exports[`components/time/ReadableTime timestamp: withinRelativeThresholdAhead | allowFutureTimestamps: true | alwaysShowTime: false | showWeekday: false | in 30 minutes: uppercase 1`] = `"IN 1,800,000 SECONDS"`;
31
+ exports[`components/time/ReadableTime timestamp: withinRelativeThresholdAhead | allowFutureTimestamps: true | alwaysShowTime: false | showWeekday: false | in 30 minutes: uppercase 1`] = `"IN 30 MINUTES"`;
32
32
 
33
- exports[`components/time/ReadableTime timestamp: withinRelativeThresholdBehind | allowFutureTimestamps: true | alwaysShowTime: false | showWeekday: false | 30 minutes ago 1`] = `"1,800,000 seconds ago"`;
33
+ exports[`components/time/ReadableTime timestamp: withinRelativeThresholdBehind | allowFutureTimestamps: true | alwaysShowTime: false | showWeekday: false | 30 minutes ago 1`] = `"30 minutes ago"`;
34
34
 
35
- exports[`components/time/ReadableTime timestamp: withinRelativeThresholdBehind | allowFutureTimestamps: true | alwaysShowTime: false | showWeekday: false | 30 minutes ago: uppercase 1`] = `"1,800,000 SECONDS AGO"`;
35
+ exports[`components/time/ReadableTime timestamp: withinRelativeThresholdBehind | allowFutureTimestamps: true | alwaysShowTime: false | showWeekday: false | 30 minutes ago: uppercase 1`] = `"30 MINUTES AGO"`;
36
36
 
37
37
  exports[`components/time/ReadableTime timestamp: yesterday | allowFutureTimestamps: true | alwaysShowTime: false | showWeekday: false | Yesterday at hh:mm 1`] = `"Yesterday at 3:30 PM"`;
38
38
 
@@ -6,7 +6,7 @@
6
6
 
7
7
  import React from 'react';
8
8
  import { injectIntl } from 'react-intl';
9
- import type { InjectIntlProvidedProps } from 'react-intl';
9
+ import type { IntlShape } from 'react-intl';
10
10
  import Breadcrumb from './Breadcrumb';
11
11
  import BreadcrumbDropdown from './BreadcrumbDropdown';
12
12
  import BreadcrumbDelimiter from './BreadcrumbDelimiter';
@@ -18,10 +18,11 @@ import './Breadcrumbs.scss';
18
18
  type Props = {
19
19
  crumbs: Crumb[],
20
20
  delimiter: Delimiter,
21
+ intl: IntlShape,
21
22
  isSmall?: boolean,
22
23
  onCrumbClick: Function,
23
24
  rootId: string,
24
- } & InjectIntlProvidedProps;
25
+ };
25
26
 
26
27
  /**
27
28
  * Filters out ancestors to root from the crumbs.
@@ -7,7 +7,7 @@
7
7
  import React from 'react';
8
8
  import Modal from 'react-modal';
9
9
  import { injectIntl, FormattedMessage } from 'react-intl';
10
- import type { InjectIntlProvidedProps } from 'react-intl';
10
+ import type { IntlShape } from 'react-intl';
11
11
  import PrimaryButton from '../../../components/primary-button/PrimaryButton';
12
12
  import Button from '../../../components/button/Button';
13
13
  import messages from '../messages';
@@ -22,12 +22,13 @@ import {
22
22
  type Props = {
23
23
  appElement: HTMLElement,
24
24
  errorCode: string,
25
+ intl: IntlShape,
25
26
  isLoading: boolean,
26
27
  isOpen: boolean,
27
28
  onCancel: Function,
28
29
  onCreate: Function,
29
30
  parentElement: HTMLElement,
30
- } & InjectIntlProvidedProps;
31
+ };
31
32
 
32
33
  /* eslint-disable jsx-a11y/label-has-for */
33
34
  const CreateFolderDialog = ({
@@ -6,7 +6,7 @@
6
6
 
7
7
  import React from 'react';
8
8
  import { injectIntl, FormattedMessage } from 'react-intl';
9
- import type { InjectIntlProvidedProps } from 'react-intl';
9
+ import type { IntlShape } from 'react-intl';
10
10
  import { isToday, isYesterday } from '../../../utils/datetime';
11
11
  import messages from '../messages';
12
12
  import './DateField.scss';
@@ -15,9 +15,10 @@ type Props = {
15
15
  capitalize?: boolean,
16
16
  date: string,
17
17
  dateFormat?: Object,
18
+ intl: IntlShape,
18
19
  omitCommas?: boolean,
19
20
  relative?: boolean,
20
- } & InjectIntlProvidedProps;
21
+ };
21
22
 
22
23
  const DEFAULT_DATE_FORMAT = {
23
24
  weekday: 'short',
@@ -6,7 +6,7 @@
6
6
 
7
7
  import React from 'react';
8
8
  import { injectIntl } from 'react-intl';
9
- import type { InjectIntlProvidedProps } from 'react-intl';
9
+ import type { IntlShape } from 'react-intl';
10
10
  import messages from '../messages';
11
11
  import { ACCESS_NONE, ACCESS_OPEN, ACCESS_COLLAB, ACCESS_COMPANY } from '../../../constants';
12
12
  import type { BoxItem } from '../../../common/types/core';
@@ -15,9 +15,10 @@ import './ShareAccessSelect.scss';
15
15
  type Props = {
16
16
  canSetShareAccess: boolean,
17
17
  className: string,
18
+ intl: IntlShape,
18
19
  item: BoxItem,
19
20
  onChange: Function,
20
- } & InjectIntlProvidedProps;
21
+ };
21
22
 
22
23
  const ShareAccessSelect = ({ className, canSetShareAccess, onChange, item, intl }: Props) => {
23
24
  const { allowed_shared_link_access_levels: allowedSharedAccessLevels, permissions, shared_link: sharedLink } = item;
@@ -6,7 +6,7 @@
6
6
 
7
7
  import React from 'react';
8
8
  import { injectIntl } from 'react-intl';
9
- import type { InjectIntlProvidedProps } from 'react-intl';
9
+ import type { IntlShape } from 'react-intl';
10
10
  import messages from '../messages';
11
11
  import { Breadcrumbs } from '../breadcrumbs';
12
12
  import { VIEW_SEARCH, VIEW_FOLDER, VIEW_RECENTS, DELIMITER_CARET } from '../../../constants';
@@ -14,12 +14,13 @@ import type { View, Collection } from '../../../common/types/core';
14
14
 
15
15
  type Props = {
16
16
  currentCollection: Collection,
17
+ intl: IntlShape,
17
18
  isSmall: boolean,
18
19
  onItemClick: Function,
19
20
  rootId: string,
20
21
  rootName?: string,
21
22
  view: View,
22
- } & InjectIntlProvidedProps;
23
+ };
23
24
 
24
25
  const SubHeaderLeft = ({ view, isSmall, rootId, rootName, currentCollection, onItemClick, intl }: Props) => {
25
26
  let crumbs;
@@ -2,7 +2,7 @@
2
2
 
3
3
  import React from 'react';
4
4
  import { injectIntl } from 'react-intl';
5
- import type { InjectIntlProvidedProps } from 'react-intl';
5
+ import type { IntlShape } from 'react-intl';
6
6
  import classNames from 'classnames';
7
7
  import noop from 'lodash/noop';
8
8
 
@@ -18,9 +18,10 @@ import './ViewModeChangeButton.scss';
18
18
 
19
19
  type Props = {
20
20
  className?: string,
21
+ intl: IntlShape,
21
22
  onViewModeChange?: (viewMode: ViewMode) => void,
22
23
  viewMode: ViewMode,
23
- } & InjectIntlProvidedProps;
24
+ };
24
25
 
25
26
  const ViewModeChangeButton = ({ className = '', onViewModeChange = noop, intl, viewMode, ...rest }: Props) => {
26
27
  const isGridView = viewMode === VIEW_MODE_GRID;
@@ -7,7 +7,7 @@
7
7
  import React from 'react';
8
8
  import Modal from 'react-modal';
9
9
  import { injectIntl } from 'react-intl';
10
- import type { InjectIntlProvidedProps } from 'react-intl';
10
+ import type { IntlShape } from 'react-intl';
11
11
  import ContentUploader from '../../content-uploader';
12
12
  import messages from '../messages';
13
13
  import { CLASS_MODAL_CONTENT_FULL_BLEED, CLASS_MODAL_OVERLAY, CLASS_MODAL } from '../../../constants';
@@ -18,6 +18,7 @@ type Props = {
18
18
  appElement: HTMLElement,
19
19
  contentUploaderProps: ContentUploaderProps,
20
20
  currentFolderId: ?string,
21
+ intl: IntlShape,
21
22
  isOpen: boolean,
22
23
  onClose: Function,
23
24
  onUpload?: Function,
@@ -28,7 +29,7 @@ type Props = {
28
29
  sharedLinkPassword?: string,
29
30
  token: Token,
30
31
  uploadHost: string,
31
- } & InjectIntlProvidedProps;
32
+ };
32
33
 
33
34
  const UploadDialog = ({
34
35
  isOpen,
@@ -7,7 +7,7 @@
7
7
  import React from 'react';
8
8
  import Modal from 'react-modal';
9
9
  import { injectIntl, FormattedMessage } from 'react-intl';
10
- import type { InjectIntlProvidedProps } from 'react-intl';
10
+ import type { IntlShape } from 'react-intl';
11
11
  import PrimaryButton from '../../components/primary-button/PrimaryButton';
12
12
  import Button from '../../components/button/Button';
13
13
  import messages from '../common/messages';
@@ -18,13 +18,14 @@ import './DeleteConfirmationDialog.scss';
18
18
 
19
19
  type Props = {
20
20
  appElement: HTMLElement,
21
+ intl: IntlShape,
21
22
  isLoading: boolean,
22
23
  isOpen: boolean,
23
24
  item: BoxItem,
24
25
  onCancel: Function,
25
26
  onDelete: Function,
26
27
  parentElement: HTMLElement,
27
- } & InjectIntlProvidedProps;
28
+ };
28
29
 
29
30
  const DeleteConfirmationDialog = ({
30
31
  isOpen,
@@ -7,7 +7,7 @@
7
7
  import React from 'react';
8
8
  import classNames from 'classnames';
9
9
  import { injectIntl } from 'react-intl';
10
- import type { InjectIntlProvidedProps } from 'react-intl';
10
+ import type { IntlShape } from 'react-intl';
11
11
  import { Table, Column } from '@box/react-virtualized/dist/es/Table';
12
12
  import AutoSizer from '@box/react-virtualized/dist/es/AutoSizer';
13
13
  import KeyBinder from '../common/KeyBinder';
@@ -32,6 +32,7 @@ type Props = {
32
32
  canShare: boolean,
33
33
  currentCollection: Collection,
34
34
  focusedRow: number,
35
+ intl: IntlShape,
35
36
  isMedium: boolean,
36
37
  isSmall: boolean,
37
38
  isTouch: boolean,
@@ -47,7 +48,7 @@ type Props = {
47
48
  rootId: string,
48
49
  tableRef: Function,
49
50
  view: View,
50
- } & InjectIntlProvidedProps;
51
+ };
51
52
 
52
53
  const ItemList = ({
53
54
  view,
@@ -7,7 +7,7 @@
7
7
  import React from 'react';
8
8
  import Modal from 'react-modal';
9
9
  import { injectIntl } from 'react-intl';
10
- import type { InjectIntlProvidedProps } from 'react-intl';
10
+ import type { IntlShape } from 'react-intl';
11
11
  import cloneDeep from 'lodash/cloneDeep';
12
12
  import messages from '../common/messages';
13
13
  import ContentPreview from '../content-preview';
@@ -23,6 +23,7 @@ type Props = {
23
23
  canDownload: boolean,
24
24
  contentPreviewProps: ContentPreviewProps,
25
25
  currentCollection: Collection,
26
+ intl: IntlShape,
26
27
  isOpen: boolean,
27
28
  isTouch: boolean,
28
29
  item: BoxItem,
@@ -38,7 +39,7 @@ type Props = {
38
39
  staticHost: string,
39
40
  staticPath: string,
40
41
  token: Token,
41
- } & InjectIntlProvidedProps;
42
+ };
42
43
 
43
44
  const PreviewDialog = ({
44
45
  item,
@@ -7,7 +7,7 @@
7
7
  import React from 'react';
8
8
  import Modal from 'react-modal';
9
9
  import { injectIntl, FormattedMessage } from 'react-intl';
10
- import type { InjectIntlProvidedProps } from 'react-intl';
10
+ import type { IntlShape } from 'react-intl';
11
11
  import PrimaryButton from '../../components/primary-button/PrimaryButton';
12
12
  import Button from '../../components/button/Button';
13
13
  import messages from '../common/messages';
@@ -23,13 +23,14 @@ import type { BoxItem } from '../../common/types/core';
23
23
  type Props = {
24
24
  appElement: HTMLElement,
25
25
  errorCode: string,
26
+ intl: IntlShape,
26
27
  isLoading: boolean,
27
28
  isOpen: boolean,
28
29
  item: BoxItem,
29
30
  onCancel: Function,
30
31
  onRename: Function,
31
32
  parentElement: HTMLElement,
32
- } & InjectIntlProvidedProps;
33
+ };
33
34
 
34
35
  /* eslint-disable jsx-a11y/label-has-for */
35
36
  const RenameDialog = ({
@@ -8,7 +8,7 @@ import React from 'react';
8
8
  import Modal from 'react-modal';
9
9
  import noop from 'lodash/noop';
10
10
  import { injectIntl, FormattedMessage } from 'react-intl';
11
- import type { InjectIntlProvidedProps } from 'react-intl';
11
+ import type { IntlShape } from 'react-intl';
12
12
  import PrimaryButton from '../../components/primary-button/PrimaryButton';
13
13
  import Button from '../../components/button/Button';
14
14
  import messages from '../common/messages';
@@ -21,13 +21,14 @@ import './ShareDialog.scss';
21
21
  type Props = {
22
22
  appElement: HTMLElement,
23
23
  canSetShareAccess: boolean,
24
+ intl: IntlShape,
24
25
  isLoading: boolean,
25
26
  isOpen: boolean,
26
27
  item: BoxItem,
27
28
  onCancel: Function,
28
29
  onShareAccessChange: Function,
29
30
  parentElement: HTMLElement,
30
- } & InjectIntlProvidedProps;
31
+ };
31
32
 
32
33
  const ShareDialog = ({
33
34
  isOpen,
@@ -6,8 +6,8 @@
6
6
 
7
7
  import * as React from 'react';
8
8
  import { injectIntl } from 'react-intl';
9
+ import type { IntlShape } from 'react-intl';
9
10
  import { Route } from 'react-router-dom';
10
- import type { InjectIntlProvidedProps } from 'react-intl';
11
11
  import IconNavigateLeft from '../../icons/general/IconNavigateLeft';
12
12
  import IconNavigateRight from '../../icons/general/IconNavigateRight';
13
13
  import PlainButton from '../../components/plain-button/PlainButton';
@@ -17,9 +17,10 @@ import type { BoxItem } from '../../common/types/core';
17
17
  type Props = {
18
18
  collection: Array<string | BoxItem>,
19
19
  currentIndex: number,
20
+ intl: IntlShape,
20
21
  onNavigateLeft: Function,
21
22
  onNavigateRight: Function,
22
- } & InjectIntlProvidedProps;
23
+ };
23
24
 
24
25
  const PreviewNavigation = ({ collection = [], currentIndex, intl, onNavigateLeft, onNavigateRight }: Props) => {
25
26
  const hasLeftNavigation = collection.length > 1 && currentIndex > 0 && currentIndex < collection.length;
@@ -6,7 +6,7 @@
6
6
 
7
7
  import React from 'react';
8
8
  import { injectIntl } from 'react-intl';
9
- import type { InjectIntlProvidedProps } from 'react-intl';
9
+ import type { IntlShape } from 'react-intl';
10
10
  import classNames from 'classnames';
11
11
  import getProp from 'lodash/get';
12
12
  import AsyncLoad from '../../common/async-load';
@@ -33,13 +33,14 @@ type Props = {
33
33
  contentAnswersProps?: ContentAnswersProps,
34
34
  contentOpenWithProps?: ContentOpenWithProps,
35
35
  file?: BoxItem,
36
+ intl: IntlShape,
36
37
  logoUrl?: string,
37
38
  onClose?: Function,
38
39
  onDownload: Function,
39
40
  onPrint: Function,
40
41
  selectedVersion: ?BoxItemVersion,
41
42
  token: ?string,
42
- } & InjectIntlProvidedProps;
43
+ };
43
44
 
44
45
  const LoadableContentOpenWith = AsyncLoad({
45
46
  loader: () => import(/* webpackMode: "lazy", webpackChunkName: "content-open-with" */ '../../content-open-with'),
@@ -7,7 +7,7 @@
7
7
  import React from 'react';
8
8
  import isFinite from 'lodash/isFinite';
9
9
  import { injectIntl, FormattedMessage } from 'react-intl';
10
- import type { MessageDescriptor, InjectIntlProvidedProps } from 'react-intl';
10
+ import type { MessageDescriptor, IntlShape } from 'react-intl';
11
11
  import AccessStats from '../../features/access-stats/AccessStats';
12
12
  import messages from '../common/messages';
13
13
  import { INTERACTION_TARGET, SECTION_TARGETS, DETAILS_TARGETS } from '../common/interactionTargets';
@@ -21,8 +21,9 @@ type Props = {
21
21
  accessStats?: FileAccessStats,
22
22
  error?: MessageDescriptor,
23
23
  file: BoxItem,
24
+ intl: IntlShape,
24
25
  onAccessStatsClick?: Function,
25
- } & InjectIntlProvidedProps;
26
+ };
26
27
 
27
28
  const SidebarAccessStats = ({
28
29
  onAccessStatsClick,
@@ -7,7 +7,7 @@
7
7
  import React from 'react';
8
8
  import getProp from 'lodash/get';
9
9
  import { injectIntl } from 'react-intl';
10
- import type { InjectIntlProvidedProps } from 'react-intl';
10
+ import type { IntlShape } from 'react-intl';
11
11
  import ItemProperties from '../../features/item-details/ItemProperties';
12
12
  import LoadingIndicatorWrapper from '../../components/loading-indicator/LoadingIndicatorWrapper';
13
13
  import getFileSize from '../../utils/getFileSize';
@@ -22,11 +22,12 @@ type Props = {
22
22
  file: BoxItem,
23
23
  hasClassification: boolean,
24
24
  hasRetentionPolicy: boolean,
25
+ intl: IntlShape,
25
26
  isLoading: boolean,
26
27
  onDescriptionChange: Function,
27
28
  onRetentionPolicyExtendClick?: Function,
28
29
  retentionPolicy?: Object,
29
- } & InjectIntlProvidedProps;
30
+ };
30
31
 
31
32
  const SidebarFileProperties = ({
32
33
  file,
@@ -6,7 +6,7 @@
6
6
 
7
7
  import * as React from 'react';
8
8
  import { injectIntl } from 'react-intl';
9
- import type { InjectIntlProvidedProps } from 'react-intl';
9
+ import type { IntlShape } from 'react-intl';
10
10
  import AdditionalTabs from './additional-tabs';
11
11
  import IconChatRound from '../../icons/general/IconChatRound';
12
12
  import IconDocInfo from '../../icons/general/IconDocInfo';
@@ -37,9 +37,10 @@ type Props = {
37
37
  hasDetails: boolean,
38
38
  hasMetadata: boolean,
39
39
  hasSkills: boolean,
40
+ intl: IntlShape,
40
41
  isOpen?: boolean,
41
42
  onNavigate?: (SyntheticEvent<>, NavigateOptions) => void,
42
- } & InjectIntlProvidedProps;
43
+ };
43
44
 
44
45
  const SidebarNav = ({
45
46
  additionalTabs,