box-ui-elements 15.0.0-beta.7 → 15.0.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 (508) hide show
  1. package/CONTRIBUTING.md +3 -1
  2. package/dist/explorer.css +1 -1
  3. package/dist/explorer.js +58 -26
  4. package/dist/openwith.css +1 -1
  5. package/dist/openwith.js +10 -17
  6. package/dist/picker.css +1 -1
  7. package/dist/picker.js +12 -19
  8. package/dist/preview.css +1 -1
  9. package/dist/preview.js +56 -24
  10. package/dist/sharing.css +1 -1
  11. package/dist/sharing.js +54 -22
  12. package/dist/sidebar.css +1 -1
  13. package/dist/sidebar.js +56 -24
  14. package/dist/uploader.css +1 -1
  15. package/dist/uploader.js +12 -19
  16. package/es/api/uploads/UploadsReachability.js.flow +2 -2
  17. package/es/api/uploads/UploadsReachability.js.map +1 -1
  18. package/es/common/messages.js +4 -0
  19. package/es/common/messages.js.flow +5 -0
  20. package/es/common/messages.js.map +1 -1
  21. package/es/common/types/core.js.flow +2 -0
  22. package/es/common/types/core.js.map +1 -1
  23. package/es/components/avatar/UnknownUserAvatar.js +6 -9
  24. package/es/components/avatar/UnknownUserAvatar.js.map +1 -1
  25. package/es/components/close-button/CloseButton.js +24 -0
  26. package/es/components/close-button/CloseButton.js.flow +26 -0
  27. package/es/components/close-button/CloseButton.js.map +1 -0
  28. package/es/components/close-button/CloseButton.scss +10 -0
  29. package/es/components/close-button/CloseButton.stories.js +14 -0
  30. package/es/components/close-button/CloseButton.stories.js.map +1 -0
  31. package/es/components/close-button/index.js +2 -0
  32. package/es/components/close-button/index.js.flow +2 -0
  33. package/es/components/close-button/index.js.map +1 -0
  34. package/es/components/date-picker/AccessiblePikaday.js +113 -0
  35. package/es/components/date-picker/AccessiblePikaday.js.map +1 -0
  36. package/es/components/date-picker/DatePicker.js +426 -106
  37. package/es/components/date-picker/DatePicker.js.map +1 -1
  38. package/es/components/date-picker/DatePicker.scss +32 -22
  39. package/es/components/date-picker/DatePicker.stories.js +10 -0
  40. package/es/components/date-picker/DatePicker.stories.js.map +1 -1
  41. package/es/components/date-picker/_pikaday.scss +8 -2
  42. package/es/components/flyout/Flyout.js +13 -3
  43. package/es/components/flyout/Flyout.js.flow +14 -3
  44. package/es/components/flyout/Flyout.js.map +1 -1
  45. package/es/components/flyout/Flyout.scss +40 -0
  46. package/es/components/flyout/FlyoutContext.js +6 -0
  47. package/es/components/flyout/FlyoutContext.js.flow +9 -0
  48. package/es/components/flyout/FlyoutContext.js.map +1 -0
  49. package/es/components/flyout/OverlayHeader.js +33 -0
  50. package/es/components/flyout/OverlayHeader.js.map +1 -0
  51. package/es/components/flyout/OverlayHeader.scss +9 -0
  52. package/es/components/flyout/_variables.scss +1 -0
  53. package/es/components/flyout/index.js +2 -0
  54. package/es/components/flyout/index.js.flow +2 -0
  55. package/es/components/flyout/index.js.map +1 -1
  56. package/es/components/image-tooltip/ImageTooltip.js +1 -2
  57. package/es/components/image-tooltip/ImageTooltip.js.map +1 -1
  58. package/es/components/media-query/constants.js +26 -0
  59. package/es/components/media-query/constants.js.flow +32 -0
  60. package/es/components/media-query/constants.js.map +1 -0
  61. package/es/components/media-query/index.js +3 -0
  62. package/es/components/media-query/index.js.flow +4 -0
  63. package/es/components/media-query/index.js.map +1 -0
  64. package/es/components/media-query/stories/MediaQuery.stories.js +37 -0
  65. package/es/components/media-query/stories/MediaQuery.stories.js.flow +80 -0
  66. package/es/components/media-query/stories/MediaQuery.stories.js.map +1 -0
  67. package/es/components/media-query/types.js +2 -0
  68. package/es/components/media-query/types.js.flow +29 -0
  69. package/es/components/media-query/types.js.map +1 -0
  70. package/es/components/media-query/useMediaQuery.js +91 -0
  71. package/es/components/media-query/useMediaQuery.js.flow +97 -0
  72. package/es/components/media-query/useMediaQuery.js.map +1 -0
  73. package/es/components/media-query/withMediaQuery.js +21 -0
  74. package/es/components/media-query/withMediaQuery.js.flow +23 -0
  75. package/es/components/media-query/withMediaQuery.js.map +1 -0
  76. package/es/components/modal/Modal.scss +27 -0
  77. package/es/components/preview/previewIcons.js +4 -0
  78. package/es/components/preview/previewIcons.js.map +1 -1
  79. package/es/components/search-form/SearchForm.scss +0 -5
  80. package/es/components/selector-dropdown/SelectorDropdown.js +5 -3
  81. package/es/components/selector-dropdown/SelectorDropdown.js.flow +3 -3
  82. package/es/components/selector-dropdown/SelectorDropdown.js.map +1 -1
  83. package/es/components/tab-view/Tabs.scss +0 -4
  84. package/es/components/tooltip/Tooltip.js +21 -4
  85. package/es/components/tooltip/Tooltip.js.map +1 -1
  86. package/es/constants.js +1 -0
  87. package/es/constants.js.flow +1 -0
  88. package/es/constants.js.map +1 -1
  89. package/es/elements/content-open-with/IconFileMap.js +0 -2
  90. package/es/elements/content-open-with/IconFileMap.js.flow +0 -2
  91. package/es/elements/content-open-with/IconFileMap.js.map +1 -1
  92. package/es/elements/content-sidebar/Sidebar.js +2 -1
  93. package/es/elements/content-sidebar/Sidebar.js.flow +1 -1
  94. package/es/elements/content-sidebar/Sidebar.js.map +1 -1
  95. package/es/elements/content-sidebar/activity-feed/common/delete-confirmation/DeleteConfirmation.scss +3 -3
  96. package/es/elements/content-sidebar/activity-feed/task-form/TaskForm.js +14 -4
  97. package/es/elements/content-sidebar/activity-feed/task-form/TaskForm.js.flow +18 -5
  98. package/es/elements/content-sidebar/activity-feed/task-form/TaskForm.js.map +1 -1
  99. package/es/elements/content-sidebar/versions/StaticVersionSidebar.js +78 -0
  100. package/es/elements/content-sidebar/versions/StaticVersionSidebar.js.flow +97 -0
  101. package/es/elements/content-sidebar/versions/StaticVersionSidebar.js.map +1 -0
  102. package/es/elements/content-sidebar/versions/StaticVersionsSidebar.scss +67 -0
  103. package/es/elements/content-sidebar/versions/VersionsSidebar.js +12 -4
  104. package/es/elements/content-sidebar/versions/VersionsSidebar.js.flow +16 -3
  105. package/es/elements/content-sidebar/versions/VersionsSidebar.js.map +1 -1
  106. package/es/elements/content-sidebar/versions/VersionsSidebar.scss +5 -0
  107. package/es/elements/content-sidebar/versions/VersionsSidebarContainer.js +42 -10
  108. package/es/elements/content-sidebar/versions/VersionsSidebarContainer.js.flow +42 -7
  109. package/es/elements/content-sidebar/versions/VersionsSidebarContainer.js.map +1 -1
  110. package/es/elements/content-sidebar/versions/flowTypes.js.flow +1 -0
  111. package/es/elements/content-sidebar/versions/messages.js +20 -0
  112. package/es/elements/content-sidebar/versions/messages.js.flow +28 -0
  113. package/es/elements/content-sidebar/versions/messages.js.map +1 -1
  114. package/es/features/classification/constants.js +2 -1
  115. package/es/features/classification/constants.js.flow +2 -0
  116. package/es/features/classification/constants.js.map +1 -1
  117. package/es/features/classification/flowTypes.js +1 -0
  118. package/es/features/classification/flowTypes.js.flow +7 -1
  119. package/es/features/classification/flowTypes.js.map +1 -1
  120. package/es/features/classification/security-controls/SecurityControls.js +3 -4
  121. package/es/features/classification/security-controls/SecurityControls.js.flow +3 -4
  122. package/es/features/classification/security-controls/SecurityControls.js.map +1 -1
  123. package/es/features/classification/security-controls/SecurityControlsItem.js +1 -1
  124. package/es/features/classification/security-controls/SecurityControlsItem.js.flow +20 -17
  125. package/es/features/classification/security-controls/SecurityControlsItem.js.map +1 -1
  126. package/es/features/classification/security-controls/SecurityControlsItem.scss +4 -0
  127. package/es/features/classification/security-controls/SecurityControlsModal.js +2 -2
  128. package/es/features/classification/security-controls/SecurityControlsModal.js.flow +2 -2
  129. package/es/features/classification/security-controls/SecurityControlsModal.js.map +1 -1
  130. package/es/features/classification/security-controls/messages.js +4 -0
  131. package/es/features/classification/security-controls/messages.js.flow +5 -0
  132. package/es/features/classification/security-controls/messages.js.map +1 -1
  133. package/es/features/classification/security-controls/utils.js +56 -35
  134. package/es/features/classification/security-controls/utils.js.flow +51 -27
  135. package/es/features/classification/security-controls/utils.js.map +1 -1
  136. package/es/features/collapsible-sidebar/CollapsibleSidebar.js +9 -3
  137. package/es/features/collapsible-sidebar/CollapsibleSidebar.js.flow +13 -5
  138. package/es/features/collapsible-sidebar/CollapsibleSidebar.js.map +1 -1
  139. package/es/features/collapsible-sidebar/CollapsibleSidebar.scss +35 -3
  140. package/es/features/content-explorer/content-explorer/ContentExplorer.scss +1 -1
  141. package/es/features/content-explorer/item-list/ItemList.js +1 -0
  142. package/es/features/content-explorer/item-list/ItemList.js.flow +1 -0
  143. package/es/features/content-explorer/item-list/ItemList.js.map +1 -1
  144. package/es/features/content-explorer/item-list/ItemListName.js +13 -2
  145. package/es/features/content-explorer/item-list/ItemListName.js.flow +3 -2
  146. package/es/features/content-explorer/item-list/ItemListName.js.map +1 -1
  147. package/es/features/header-flyout/HeaderFlyout.js +8 -10
  148. package/es/features/header-flyout/HeaderFlyout.js.flow +4 -8
  149. package/es/features/header-flyout/HeaderFlyout.js.map +1 -1
  150. package/es/features/header-flyout/styles/HeaderFlyout.scss +54 -15
  151. package/es/features/header-flyout/styles/_variables.scss +4 -0
  152. package/es/features/message-center/components/message-center-modal/MessageCenterModal.js +1 -0
  153. package/es/features/message-center/components/message-center-modal/MessageCenterModal.js.flow +1 -0
  154. package/es/features/message-center/components/message-center-modal/MessageCenterModal.js.map +1 -1
  155. package/es/features/presence/PresenceCollaborator.js +90 -0
  156. package/es/features/presence/PresenceCollaborator.js.flow +81 -0
  157. package/es/features/presence/PresenceCollaborator.js.map +1 -0
  158. package/es/features/presence/PresenceCollaborator.scss +28 -0
  159. package/es/features/presence/PresenceCollaboratorsList.js +9 -57
  160. package/es/features/presence/PresenceCollaboratorsList.js.flow +7 -58
  161. package/es/features/presence/PresenceCollaboratorsList.js.map +1 -1
  162. package/es/features/presence/PresenceCollaboratorsList.scss +8 -35
  163. package/es/features/quick-search/QuickSearch.js +4 -2
  164. package/es/features/quick-search/QuickSearch.js.flow +13 -1
  165. package/es/features/quick-search/QuickSearch.js.map +1 -1
  166. package/es/features/unified-share-modal/SharedLinkSection.js +9 -20
  167. package/es/features/unified-share-modal/SharedLinkSection.js.flow +6 -27
  168. package/es/features/unified-share-modal/SharedLinkSection.js.map +1 -1
  169. package/es/features/unified-share-modal/UnifiedShareForm.js +95 -53
  170. package/es/features/unified-share-modal/UnifiedShareForm.js.flow +70 -14
  171. package/es/features/unified-share-modal/UnifiedShareForm.js.map +1 -1
  172. package/es/features/unified-share-modal/UnifiedShareModal.scss +3 -0
  173. package/es/features/unified-share-modal/flowTypes.js.flow +6 -0
  174. package/es/features/unified-share-modal/flowTypes.js.map +1 -1
  175. package/es/features/unified-share-modal/messages.js +8 -0
  176. package/es/features/unified-share-modal/messages.js.flow +10 -0
  177. package/es/features/unified-share-modal/messages.js.map +1 -1
  178. package/es/features/unified-share-modal/utils/mergeContacts.js +13 -10
  179. package/es/features/unified-share-modal/utils/mergeContacts.js.flow +4 -2
  180. package/es/features/unified-share-modal/utils/mergeContacts.js.map +1 -1
  181. package/es/icon/content/FileXbd32.js +39 -0
  182. package/es/icon/content/FileXbd32.js.flow +38 -0
  183. package/es/icon/content/FileXbd32.js.map +1 -0
  184. package/es/icon/content/FileXbd32.stories.js +13 -0
  185. package/es/icon/content/FileXbd32.stories.js.map +1 -0
  186. package/es/icon/content/FileXdw32.js +39 -0
  187. package/es/icon/content/FileXdw32.js.flow +38 -0
  188. package/es/icon/content/FileXdw32.js.map +1 -0
  189. package/es/icon/content/FileXdw32.stories.js +13 -0
  190. package/es/icon/content/FileXdw32.stories.js.map +1 -0
  191. package/es/icon/content/RetentionPolicyModifiable32.js +36 -0
  192. package/es/icon/content/RetentionPolicyModifiable32.js.flow +31 -0
  193. package/es/icon/content/RetentionPolicyModifiable32.js.map +1 -0
  194. package/es/icon/content/RetentionPolicyModifiable32.stories.js +13 -0
  195. package/es/icon/content/RetentionPolicyModifiable32.stories.js.map +1 -0
  196. package/es/icon/content/RetentionPolicyNonModifiable32.js +36 -0
  197. package/es/icon/content/RetentionPolicyNonModifiable32.js.flow +31 -0
  198. package/es/icon/content/RetentionPolicyNonModifiable32.js.map +1 -0
  199. package/es/icon/content/RetentionPolicyNonModifiable32.stories.js +13 -0
  200. package/es/icon/content/RetentionPolicyNonModifiable32.stories.js.map +1 -0
  201. package/es/icons/avatars/UnknownUserAvatar.js +10 -34
  202. package/es/icons/avatars/UnknownUserAvatar.js.map +1 -1
  203. package/es/icons/file-icon/FileIcon.js +8 -2
  204. package/es/icons/file-icon/FileIcon.js.flow +2 -2
  205. package/es/icons/file-icon/FileIcon.js.map +1 -1
  206. package/es/icons/general/IconSearch.js +1 -1
  207. package/es/icons/general/IconSearch.js.flow +1 -1
  208. package/es/icons/general/IconSearch.js.map +1 -1
  209. package/es/icons/general/IconSearchJuicy.js +30 -0
  210. package/es/icons/general/IconSearchJuicy.js.flow +26 -0
  211. package/es/icons/general/IconSearchJuicy.js.map +1 -0
  212. package/es/icons/google-docs/IconGoogle.js +89 -0
  213. package/es/icons/google-docs/IconGoogle.js.flow +57 -0
  214. package/es/icons/google-docs/IconGoogle.js.map +1 -0
  215. package/es/icons/item-icon/ItemIcon.js +4 -0
  216. package/es/icons/item-icon/ItemIcon.js.map +1 -1
  217. package/es/icons/microsoft-office/IconOffice.js +80 -0
  218. package/es/icons/microsoft-office/IconOffice.js.flow +45 -0
  219. package/es/icons/microsoft-office/IconOffice.js.map +1 -0
  220. package/es/illustration/EmailVerification140.js +111 -0
  221. package/es/illustration/EmailVerification140.js.flow +102 -0
  222. package/es/illustration/EmailVerification140.js.map +1 -0
  223. package/es/illustration/EmailVerification140.stories.js +13 -0
  224. package/es/illustration/EmailVerification140.stories.js.map +1 -0
  225. package/es/src/components/close-button/CloseButton.d.ts +9 -0
  226. package/es/src/components/close-button/CloseButton.stories.d.ts +9 -0
  227. package/es/src/components/close-button/__tests__/CloseButton.stories.test.d.ts +0 -0
  228. package/es/src/components/close-button/__tests__/CloseButton.test.d.ts +1 -0
  229. package/es/src/components/close-button/index.d.ts +1 -0
  230. package/es/src/components/date-picker/AccessiblePikaday.d.ts +16 -0
  231. package/es/src/components/date-picker/DatePicker.d.ts +33 -6
  232. package/es/src/components/date-picker/DatePicker.stories.d.ts +2 -1
  233. package/es/src/components/flyout/OverlayHeader.d.ts +10 -0
  234. package/es/src/components/tooltip/Tooltip.d.ts +4 -3
  235. package/es/src/icon/content/FileXbd32.d.ts +13 -0
  236. package/es/src/icon/content/FileXbd32.stories.d.ts +9 -0
  237. package/es/src/icon/content/FileXdw32.d.ts +13 -0
  238. package/es/src/icon/content/FileXdw32.stories.d.ts +9 -0
  239. package/es/src/icon/content/RetentionPolicyModifiable32.d.ts +13 -0
  240. package/es/src/icon/content/RetentionPolicyModifiable32.stories.d.ts +9 -0
  241. package/es/src/icon/content/RetentionPolicyNonModifiable32.d.ts +13 -0
  242. package/es/src/icon/content/RetentionPolicyNonModifiable32.stories.d.ts +9 -0
  243. package/es/src/icons/avatars/UnknownUserAvatar.d.ts +0 -1
  244. package/es/src/icons/general/IconSearchJuicy.d.ts +3 -0
  245. package/es/src/icons/general/__tests__/IconSearchJuicy.test.d.ts +1 -0
  246. package/es/src/icons/google-docs/IconGoogle.d.ts +12 -0
  247. package/es/src/icons/google-docs/__tests__/IconGoogle.test.d.ts +1 -0
  248. package/es/src/icons/item-icon/ItemIcon.d.ts +2 -0
  249. package/es/src/icons/microsoft-office/IconOffice.d.ts +12 -0
  250. package/es/src/icons/microsoft-office/__tests__/IconOffice.test.d.ts +1 -0
  251. package/es/src/illustration/EmailVerification140.d.ts +13 -0
  252. package/es/src/illustration/EmailVerification140.stories.d.ts +9 -0
  253. package/es/src/styles/variables.d.ts +9 -0
  254. package/es/styles/_variables.scss +1 -0
  255. package/es/styles/common/_forms.scss +6 -0
  256. package/es/styles/constants/_layout.scss +3 -0
  257. package/es/styles/constants/_media-queries.scss +15 -0
  258. package/es/styles/variables.js +18 -0
  259. package/es/styles/variables.js.flow +10 -1
  260. package/es/styles/variables.js.map +1 -1
  261. package/es/utils/Browser.js +12 -0
  262. package/es/utils/Browser.js.flow +10 -0
  263. package/es/utils/Browser.js.map +1 -1
  264. package/es/utils/validators.js +26 -4
  265. package/es/utils/validators.js.flow +25 -3
  266. package/es/utils/validators.js.map +1 -1
  267. package/i18n/bn-IN.js +12 -0
  268. package/i18n/bn-IN.properties +24 -0
  269. package/i18n/da-DK.js +12 -0
  270. package/i18n/da-DK.properties +24 -0
  271. package/i18n/de-DE.js +12 -0
  272. package/i18n/de-DE.properties +24 -0
  273. package/i18n/en-AU.js +12 -0
  274. package/i18n/en-AU.properties +24 -0
  275. package/i18n/en-CA.js +12 -0
  276. package/i18n/en-CA.properties +24 -0
  277. package/i18n/en-GB.js +12 -0
  278. package/i18n/en-GB.properties +24 -0
  279. package/i18n/en-US.js +12 -0
  280. package/i18n/en-US.properties +24 -0
  281. package/i18n/en-x-pseudo.js +12 -0
  282. package/i18n/es-419.js +12 -0
  283. package/i18n/es-419.properties +24 -0
  284. package/i18n/es-ES.js +12 -0
  285. package/i18n/es-ES.properties +24 -0
  286. package/i18n/fi-FI.js +12 -0
  287. package/i18n/fi-FI.properties +24 -0
  288. package/i18n/fr-CA.js +12 -0
  289. package/i18n/fr-CA.properties +24 -0
  290. package/i18n/fr-FR.js +12 -0
  291. package/i18n/fr-FR.properties +24 -0
  292. package/i18n/hi-IN.js +12 -0
  293. package/i18n/hi-IN.properties +24 -0
  294. package/i18n/it-IT.js +12 -0
  295. package/i18n/it-IT.properties +24 -0
  296. package/i18n/ja-JP.js +25 -13
  297. package/i18n/ja-JP.properties +37 -13
  298. package/i18n/ko-KR.js +12 -0
  299. package/i18n/ko-KR.properties +24 -0
  300. package/i18n/nb-NO.js +12 -0
  301. package/i18n/nb-NO.properties +24 -0
  302. package/i18n/nl-NL.js +12 -0
  303. package/i18n/nl-NL.properties +24 -0
  304. package/i18n/pl-PL.js +12 -0
  305. package/i18n/pl-PL.properties +24 -0
  306. package/i18n/pt-BR.js +12 -0
  307. package/i18n/pt-BR.properties +24 -0
  308. package/i18n/ru-RU.js +12 -0
  309. package/i18n/ru-RU.properties +24 -0
  310. package/i18n/sv-SE.js +12 -0
  311. package/i18n/sv-SE.properties +24 -0
  312. package/i18n/tr-TR.js +12 -0
  313. package/i18n/tr-TR.properties +24 -0
  314. package/i18n/zh-CN.js +12 -0
  315. package/i18n/zh-CN.properties +24 -0
  316. package/i18n/zh-TW.js +12 -0
  317. package/i18n/zh-TW.properties +24 -0
  318. package/package.json +8 -5
  319. package/src/__mocks__/pikaday.js +1 -0
  320. package/src/api/__tests__/MockOpenWithData.json +2 -25
  321. package/src/api/uploads/UploadsReachability.js +2 -2
  322. package/src/common/messages.js +5 -0
  323. package/src/common/types/core.js +2 -0
  324. package/src/components/avatar/UnknownUserAvatar.tsx +5 -4
  325. package/src/components/close-button/CloseButton.js.flow +26 -0
  326. package/src/components/close-button/CloseButton.scss +10 -0
  327. package/src/components/close-button/CloseButton.stories.md +1 -0
  328. package/src/components/close-button/CloseButton.stories.tsx +14 -0
  329. package/src/components/close-button/CloseButton.tsx +30 -0
  330. package/src/components/close-button/__tests__/CloseButton.stories.test.tsx +6 -0
  331. package/src/components/close-button/__tests__/CloseButton.test.tsx +40 -0
  332. package/src/components/close-button/__tests__/__image_snapshots__/close-button-stories-test-tsx-components-close-button-close-button-looks-visually-correct-when-using-story-components-buttons-closebutton-regular-1-snap.png +0 -0
  333. package/src/components/close-button/index.js.flow +2 -0
  334. package/src/components/close-button/index.ts +1 -0
  335. package/src/components/date-picker/AccessiblePikaday.ts +79 -0
  336. package/src/components/date-picker/DatePicker.scss +32 -22
  337. package/src/components/date-picker/DatePicker.stories.tsx +6 -0
  338. package/src/components/date-picker/DatePicker.tsx +350 -64
  339. package/src/components/date-picker/__tests__/DatePicker.test.tsx +44 -2
  340. package/src/components/date-picker/__tests__/__image_snapshots__/date-picker-stories-test-tsx-components-date-picker-date-picker-allows-editing-in-story-components-datepicker-manually-editable-1-snap.png +0 -0
  341. package/src/components/date-picker/__tests__/__image_snapshots__/date-picker-stories-test-tsx-components-date-picker-date-picker-allows-keyboard-selection-in-components-datepicker-always-visible-with-custom-input-field-1-snap.png +0 -0
  342. package/src/components/date-picker/__tests__/__image_snapshots__/date-picker-stories-test-tsx-components-date-picker-date-picker-closes-calendar-and-clears-date-for-components-datepicker-basic-1-snap.png +0 -0
  343. package/src/components/date-picker/__tests__/__image_snapshots__/date-picker-stories-test-tsx-components-date-picker-date-picker-looks-visually-correct-when-using-story-components-datepicker-always-visible-with-custom-input-field-1-snap.png +0 -0
  344. package/src/components/date-picker/__tests__/__image_snapshots__/date-picker-stories-test-tsx-components-date-picker-date-picker-looks-visually-correct-when-using-story-components-datepicker-basic-1-snap.png +0 -0
  345. package/src/components/date-picker/__tests__/__image_snapshots__/date-picker-stories-test-tsx-components-date-picker-date-picker-looks-visually-correct-when-using-story-components-datepicker-custom-error-tooltip-position-1-snap.png +0 -0
  346. package/src/components/date-picker/__tests__/__image_snapshots__/date-picker-stories-test-tsx-components-date-picker-date-picker-looks-visually-correct-when-using-story-components-datepicker-disabled-with-error-message-1-snap.png +0 -0
  347. package/src/components/date-picker/__tests__/__image_snapshots__/date-picker-stories-test-tsx-components-date-picker-date-picker-looks-visually-correct-when-using-story-components-datepicker-manually-editable-1-snap.png +0 -0
  348. package/src/components/date-picker/__tests__/__image_snapshots__/date-picker-stories-test-tsx-components-date-picker-date-picker-looks-visually-correct-when-using-story-components-datepicker-with-description-1-snap.png +0 -0
  349. package/src/components/date-picker/__tests__/__image_snapshots__/date-picker-stories-test-tsx-components-date-picker-date-picker-looks-visually-correct-when-using-story-components-datepicker-with-limited-date-range-1-snap.png +0 -0
  350. package/src/components/date-picker/__tests__/__image_snapshots__/date-picker-stories-test-tsx-components-date-picker-date-picker-looks-visually-correct-when-using-story-components-datepicker-with-range-1-snap.png +0 -0
  351. package/src/components/date-picker/__tests__/__image_snapshots__/date-picker-stories-test-tsx-components-date-picker-date-picker-reflects-changes-in-components-datepicker-always-visible-with-custom-input-field-1-snap.png +0 -0
  352. package/src/components/date-picker/__tests__/__image_snapshots__/date-picker-stories-test-tsx-components-date-picker-date-picker-shows-calendar-and-date-for-components-datepicker-basic-1-snap.png +0 -0
  353. package/src/components/date-picker/__tests__/__image_snapshots__/date-picker-stories-test-tsx-components-date-picker-date-picker-shows-limited-range-in-components-datepicker-with-limited-date-range-1-snap.png +0 -0
  354. package/src/components/date-picker/_pikaday.scss +8 -2
  355. package/src/components/flyout/Flyout.js +14 -3
  356. package/src/components/flyout/Flyout.scss +40 -0
  357. package/src/components/flyout/FlyoutContext.js +9 -0
  358. package/src/components/flyout/OverlayHeader.scss +9 -0
  359. package/src/components/flyout/OverlayHeader.tsx +38 -0
  360. package/src/components/flyout/__tests__/Flyout.test.js +15 -0
  361. package/src/components/flyout/__tests__/OverlayHeader.test.js +56 -0
  362. package/src/components/flyout/_variables.scss +1 -0
  363. package/src/components/flyout/index.js +2 -0
  364. package/src/components/image-tooltip/ImageTooltip.tsx +1 -2
  365. package/src/components/media-query/__tests__/useMediaQuery.test.js +48 -0
  366. package/src/components/media-query/__tests__/withMediaQuery.test.js +29 -0
  367. package/src/components/media-query/constants.js +32 -0
  368. package/src/components/media-query/index.js +4 -0
  369. package/src/components/media-query/stories/MediaQuery.stories.js +80 -0
  370. package/src/components/media-query/stories/MediaQuery.stories.md +29 -0
  371. package/src/components/media-query/types.js +29 -0
  372. package/src/components/media-query/useMediaQuery.js +97 -0
  373. package/src/components/media-query/withMediaQuery.js +23 -0
  374. package/src/components/modal/Modal.scss +27 -0
  375. package/src/components/modal/__tests__/Modal.stories.test.js +10 -0
  376. package/src/components/modal/__tests__/__image_snapshots__/modal-stories-test-js-components-modal-modal-looks-visually-correct-for-small-screens-when-button-is-clicked-in-story-components-modal-basic-1-snap.png +0 -0
  377. package/src/components/modal/__tests__/__image_snapshots__/modal-stories-test-js-components-modal-modal-looks-visually-correct-for-small-screens-when-button-is-clicked-in-story-components-modal-with-custom-backdrop-click-handler-1-snap.png +0 -0
  378. package/src/components/preview/previewIcons.ts +4 -0
  379. package/src/components/search-form/SearchForm.scss +0 -5
  380. package/src/components/selector-dropdown/SelectorDropdown.js +3 -3
  381. package/src/components/selector-dropdown/__tests__/SelectorDropdown.test.js +5 -1
  382. package/src/components/sidebar-toggle-button/__tests__/__snapshots__/SidebarToggleButton.test.js.snap +0 -8
  383. package/src/components/tab-view/Tabs.scss +0 -4
  384. package/src/components/tooltip/Tooltip.tsx +20 -5
  385. package/src/components/tooltip/__tests__/Tooltip.test.tsx +17 -4
  386. package/src/components/tooltip/__tests__/__snapshots__/Tooltip.test.tsx.snap +0 -2
  387. package/src/constants.js +1 -0
  388. package/src/elements/content-open-with/IconFileMap.js +0 -2
  389. package/src/elements/content-open-with/__tests__/ContentOpenWith.test.js +13 -13
  390. package/src/elements/content-open-with/__tests__/OpenWithButton.test.js +1 -1
  391. package/src/elements/content-open-with/__tests__/OpenWithDropdownMenu.test.js +1 -5
  392. package/src/elements/content-open-with/__tests__/OpenWithDropdownMenuItem.test.js +2 -2
  393. package/src/elements/content-open-with/__tests__/__snapshots__/ContentOpenWith.test.js.snap +5 -5
  394. package/src/elements/content-open-with/__tests__/__snapshots__/OpenWithButton.test.js.snap +1 -1
  395. package/src/elements/content-open-with/__tests__/__snapshots__/OpenWithDropdownMenu.test.js.snap +1 -11
  396. package/src/elements/content-open-with/__tests__/__snapshots__/OpenWithDropdownMenuItem.test.js.snap +4 -3
  397. package/src/elements/content-sidebar/Sidebar.js +1 -1
  398. package/src/elements/content-sidebar/__tests__/AddTaskButton.test.js +15 -0
  399. package/src/elements/content-sidebar/activity-feed/common/delete-confirmation/DeleteConfirmation.scss +3 -3
  400. package/src/elements/content-sidebar/activity-feed/task-form/TaskForm.js +18 -5
  401. package/src/elements/content-sidebar/versions/StaticVersionSidebar.js +97 -0
  402. package/src/elements/content-sidebar/versions/StaticVersionsSidebar.scss +67 -0
  403. package/src/elements/content-sidebar/versions/VersionsSidebar.js +16 -3
  404. package/src/elements/content-sidebar/versions/VersionsSidebar.scss +5 -0
  405. package/src/elements/content-sidebar/versions/VersionsSidebarContainer.js +42 -7
  406. package/src/elements/content-sidebar/versions/__tests__/VersionsSidebar.test.js +18 -1
  407. package/src/elements/content-sidebar/versions/__tests__/VersionsSidebarContainer.test.js +51 -2
  408. package/src/elements/content-sidebar/versions/__tests__/__snapshots__/VersionsSidebarContainer.test.js.snap +75 -0
  409. package/src/elements/content-sidebar/versions/flowTypes.js +1 -0
  410. package/src/elements/content-sidebar/versions/messages.js +28 -0
  411. package/src/features/classification/constants.js +2 -0
  412. package/src/features/classification/flowTypes.js +7 -1
  413. package/src/features/classification/security-controls/SecurityControls.js +3 -4
  414. package/src/features/classification/security-controls/SecurityControlsItem.js +20 -17
  415. package/src/features/classification/security-controls/SecurityControlsItem.scss +4 -0
  416. package/src/features/classification/security-controls/SecurityControlsModal.js +2 -2
  417. package/src/features/classification/security-controls/__tests__/SecurityControlsItem.test.js +10 -0
  418. package/src/features/classification/security-controls/__tests__/__snapshots__/SecurityControls.test.js.snap +6 -6
  419. package/src/features/classification/security-controls/__tests__/__snapshots__/SecurityControlsItem.test.js.snap +35 -0
  420. package/src/features/classification/security-controls/__tests__/__snapshots__/SecurityControlsModal.test.js.snap +2 -2
  421. package/src/features/classification/security-controls/__tests__/__snapshots__/utils.test.js.snap +20 -0
  422. package/src/features/classification/security-controls/__tests__/utils.test.js +38 -18
  423. package/src/features/classification/security-controls/messages.js +5 -0
  424. package/src/features/classification/security-controls/utils.js +51 -27
  425. package/src/features/collapsible-sidebar/CollapsibleSidebar.js +13 -5
  426. package/src/features/collapsible-sidebar/CollapsibleSidebar.scss +35 -3
  427. package/src/features/collapsible-sidebar/__tests__/CollapsibleSidebar.test.js +35 -0
  428. package/src/features/collapsible-sidebar/__tests__/__snapshots__/CollapsibleSidebar.test.js.snap +1 -0
  429. package/src/features/content-explorer/content-explorer/ContentExplorer.scss +1 -1
  430. package/src/features/content-explorer/item-list/ItemList.js +1 -0
  431. package/src/features/content-explorer/item-list/ItemListName.js +3 -2
  432. package/src/features/content-explorer/item-list/__tests__/ItemListName.test.js +16 -2
  433. package/src/features/header-flyout/HeaderFlyout.js +4 -8
  434. package/src/features/header-flyout/__tests__/__snapshots__/HeaderFlyout.test.js.snap +14 -11
  435. package/src/features/header-flyout/styles/HeaderFlyout.scss +54 -15
  436. package/src/features/header-flyout/styles/_variables.scss +4 -0
  437. package/src/features/message-center/components/message-center-modal/MessageCenterModal.js +1 -0
  438. package/src/features/metadata-instance-editor/__tests__/__snapshots__/TemplateDropdown.test.js.snap +7 -0
  439. package/src/features/pagination/__tests__/__snapshots__/MarkerBasedPagination.test.js.snap +0 -8
  440. package/src/features/pagination/__tests__/__snapshots__/OffsetBasedPagination.test.js.snap +0 -16
  441. package/src/features/presence/PresenceCollaborator.js +81 -0
  442. package/src/features/presence/PresenceCollaborator.scss +28 -0
  443. package/src/features/presence/PresenceCollaboratorsList.js +7 -58
  444. package/src/features/presence/PresenceCollaboratorsList.scss +8 -35
  445. package/src/features/presence/__tests__/PresenceCollaborator.test.js +36 -0
  446. package/src/features/presence/__tests__/PresenceCollaboratorsList.test.js +13 -57
  447. package/src/features/presence/__tests__/__snapshots__/Presence.test.js.snap +5 -0
  448. package/src/features/presence/__tests__/__snapshots__/PresenceLink.test.js.snap +3 -0
  449. package/src/features/query-bar/__tests__/__snapshots__/ColumnButton.test.js.snap +3 -0
  450. package/src/features/quick-search/QuickSearch.js +13 -1
  451. package/src/features/quick-search/__tests__/QuickSearch.test.js +17 -0
  452. package/src/features/unified-share-modal/SharedLinkSection.js +6 -27
  453. package/src/features/unified-share-modal/UnifiedShareForm.js +70 -14
  454. package/src/features/unified-share-modal/UnifiedShareModal.scss +3 -0
  455. package/src/features/unified-share-modal/__tests__/EmailForm.test.js +9 -0
  456. package/src/features/unified-share-modal/__tests__/SharedLinkSection.test.js +14 -4
  457. package/src/features/unified-share-modal/__tests__/UnifiedShareForm.test.js +53 -4
  458. package/src/features/unified-share-modal/__tests__/__snapshots__/SharedLinkSection.test.js.snap +9 -0
  459. package/src/features/unified-share-modal/__tests__/__snapshots__/UnifiedShareForm.test.js.snap +0 -159
  460. package/src/features/unified-share-modal/flowTypes.js +6 -0
  461. package/src/features/unified-share-modal/messages.js +10 -0
  462. package/src/features/unified-share-modal/utils/__tests__/mergeContacts.test.js +23 -0
  463. package/src/features/unified-share-modal/utils/mergeContacts.js +4 -2
  464. package/src/icon/content/FileXbd32.js.flow +38 -0
  465. package/src/icon/content/FileXbd32.stories.tsx +13 -0
  466. package/src/icon/content/FileXbd32.tsx +37 -0
  467. package/src/icon/content/FileXdw32.js.flow +38 -0
  468. package/src/icon/content/FileXdw32.stories.tsx +13 -0
  469. package/src/icon/content/FileXdw32.tsx +37 -0
  470. package/src/icon/content/RetentionPolicyModifiable32.js.flow +31 -0
  471. package/src/icon/content/RetentionPolicyModifiable32.stories.tsx +14 -0
  472. package/src/icon/content/RetentionPolicyModifiable32.tsx +29 -0
  473. package/src/icon/content/RetentionPolicyNonModifiable32.js.flow +31 -0
  474. package/src/icon/content/RetentionPolicyNonModifiable32.stories.tsx +14 -0
  475. package/src/icon/content/RetentionPolicyNonModifiable32.tsx +29 -0
  476. package/src/icons/adobe-sign/README.md +1 -1
  477. package/src/icons/avatars/UnknownUserAvatar.tsx +7 -15
  478. package/src/icons/file-icon/FileIcon.js.flow +2 -2
  479. package/src/icons/file-icon/FileIcon.tsx +8 -2
  480. package/src/icons/file-icon/__tests__/FileIcon.test.tsx +28 -69
  481. package/src/icons/file-icon/__tests__/__snapshots__/FileIcon.test.tsx.snap +48 -34
  482. package/src/icons/general/IconSearch.js.flow +1 -1
  483. package/src/icons/general/IconSearch.tsx +1 -1
  484. package/src/icons/general/IconSearchJuicy.js.flow +26 -0
  485. package/src/icons/general/IconSearchJuicy.tsx +25 -0
  486. package/src/icons/general/README.md +5 -0
  487. package/src/icons/general/__tests__/IconSearchJuicy.test.tsx +38 -0
  488. package/src/icons/google-docs/IconGoogle.js.flow +57 -0
  489. package/src/icons/google-docs/IconGoogle.tsx +50 -0
  490. package/src/icons/google-docs/__tests__/IconGoogle.test.tsx +44 -0
  491. package/src/icons/item-icon/ItemIcon.tsx +4 -0
  492. package/src/icons/item-icon/__tests__/ItemIcon.test.tsx +47 -115
  493. package/src/icons/item-icon/__tests__/__snapshots__/ItemIcon.test.tsx.snap +229 -229
  494. package/src/icons/microsoft-office/IconOffice.js.flow +45 -0
  495. package/src/icons/microsoft-office/IconOffice.tsx +38 -0
  496. package/src/icons/microsoft-office/__tests__/IconOffice.test.tsx +44 -0
  497. package/src/illustration/EmailVerification140.js.flow +102 -0
  498. package/src/illustration/EmailVerification140.stories.tsx +13 -0
  499. package/src/illustration/EmailVerification140.tsx +100 -0
  500. package/src/styles/_variables.scss +1 -0
  501. package/src/styles/common/_forms.scss +6 -0
  502. package/src/styles/constants/_layout.scss +3 -0
  503. package/src/styles/constants/_media-queries.scss +15 -0
  504. package/src/styles/variables.js +10 -1
  505. package/src/styles/variables.json +10 -1
  506. package/src/styles/variables.ts +9 -0
  507. package/src/utils/Browser.js +10 -0
  508. package/src/utils/validators.js +25 -3
@@ -1,11 +1,11 @@
1
1
  function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
2
2
 
3
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
-
5
3
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
6
4
 
7
5
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
8
6
 
7
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
8
+
9
9
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
10
10
 
11
11
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
@@ -27,15 +27,15 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
27
27
  import * as React from 'react';
28
28
  import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
29
29
  import classNames from 'classnames';
30
- import Pikaday from 'pikaday';
31
30
  import noop from 'lodash/noop';
32
31
  import range from 'lodash/range';
33
32
  import uniqueId from 'lodash/uniqueId'; // @ts-ignore flow import
34
33
 
35
34
  import { RESIN_TAG_TARGET } from '../../common/variables';
36
- import IconAlert from '../../icons/general/IconAlert';
37
- import IconCalendar from '../../icons/general/IconCalendar';
38
- import IconClear from '../../icons/general/IconClear';
35
+ import Alert16 from '../../icon/fill/Alert16';
36
+ import Calendar16 from '../../icon/fill/Calendar16';
37
+ import ClearBadge16 from '../../icon/fill/ClearBadge16';
38
+ import AccessiblePikaday from './AccessiblePikaday';
39
39
  import { ButtonType } from '../button';
40
40
  import Label from '../label';
41
41
  import PlainButton from '../plain-button';
@@ -63,12 +63,25 @@ var messages = defineMessages({
63
63
  chooseDate: {
64
64
  "id": "boxui.datePicker.chooseDate",
65
65
  "defaultMessage": "Choose Date"
66
+ },
67
+ dateInputRangeError: {
68
+ "id": "boxui.datePicker.dateInputRangeError",
69
+ "defaultMessage": "Please enter a date between {minLocaleDate} and {maxLocaleDate}"
70
+ },
71
+ dateInputMaxError: {
72
+ "id": "boxui.datePicker.dateInputMaxError",
73
+ "defaultMessage": "Please enter a date before {maxLocaleDate}"
74
+ },
75
+ dateInputMinError: {
76
+ "id": "boxui.datePicker.dateInputMinError",
77
+ "defaultMessage": "Please enter a date after {minLocaleDate}"
66
78
  }
67
79
  });
68
80
  var TOGGLE_DELAY_MS = 300;
69
81
  var ENTER_KEY = 'Enter';
70
82
  var ESCAPE_KEY = 'Escape';
71
83
  var TAB_KEY = 'Tab';
84
+ var ISO_DATE_FORMAT_PATTERN = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/;
72
85
  export var DateFormat;
73
86
  /**
74
87
  * Converts date from being relative to GMT, to being relative to browser
@@ -80,6 +93,7 @@ export var DateFormat;
80
93
 
81
94
  (function (DateFormat) {
82
95
  DateFormat["ISO_STRING_DATE_FORMAT"] = "isoString";
96
+ DateFormat["LOCALE_DATE_STRING_DATE_FORMAT"] = "localeDateString";
83
97
  DateFormat["UTC_TIME_DATE_FORMAT"] = "utcTime";
84
98
  DateFormat["UNIX_TIME_DATE_FORMAT"] = "unixTime";
85
99
  DateFormat["UTC_ISO_STRING_DATE_FORMAT"] = "utcISOString";
@@ -103,6 +117,9 @@ function getFormattedDate(date, format) {
103
117
  case DateFormat.ISO_STRING_DATE_FORMAT:
104
118
  return date.toISOString();
105
119
 
120
+ case DateFormat.LOCALE_DATE_STRING_DATE_FORMAT:
121
+ return date.toLocaleDateString();
122
+
106
123
  case DateFormat.UTC_TIME_DATE_FORMAT:
107
124
  return convertDateToUnixMidnightTime(date);
108
125
 
@@ -135,47 +152,116 @@ function (_React$Component) {
135
152
 
136
153
  _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(DatePicker)).call.apply(_getPrototypeOf2, [this].concat(args)));
137
154
 
155
+ _defineProperty(_assertThisInitialized(_this), "state", {
156
+ isDateInputInvalid: false,
157
+ showDateInputError: false
158
+ });
159
+
138
160
  _defineProperty(_assertThisInitialized(_this), "errorMessageID", uniqueId('errorMessage'));
139
161
 
140
162
  _defineProperty(_assertThisInitialized(_this), "descriptionID", uniqueId('description'));
141
163
 
142
164
  _defineProperty(_assertThisInitialized(_this), "onSelectHandler", function () {
143
165
  var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
144
- var onChange = _this.props.onChange;
166
+ var _this$props = _this.props,
167
+ onChange = _this$props.onChange,
168
+ isAccessible = _this$props.isAccessible;
169
+ var isDateInputInvalid = _this.state.isDateInputInvalid;
145
170
 
146
171
  if (onChange) {
147
172
  var formattedDate = _this.formatValue(date);
148
173
 
149
174
  onChange(date, formattedDate);
150
175
  }
176
+
177
+ if (isAccessible) {
178
+ if (_this.dateInputEl && _this.datePicker) {
179
+ // Required because Pikaday instance is unbound
180
+ // See https://github.com/Pikaday/Pikaday#usage
181
+ _this.dateInputEl.value = _this.datePicker.toString();
182
+ }
183
+
184
+ if (_this.datePicker && _this.datePicker.isVisible()) {
185
+ _this.datePicker.hide();
186
+
187
+ _this.focusDatePicker();
188
+ }
189
+ }
190
+
191
+ if (isDateInputInvalid) {
192
+ _this.setState({
193
+ isDateInputInvalid: false,
194
+ showDateInputError: false
195
+ });
196
+ }
151
197
  });
152
198
 
153
199
  _defineProperty(_assertThisInitialized(_this), "datePicker", null);
154
200
 
201
+ _defineProperty(_assertThisInitialized(_this), "canUseDateInputType", true);
202
+
155
203
  _defineProperty(_assertThisInitialized(_this), "shouldStayClosed", false);
156
204
 
157
205
  _defineProperty(_assertThisInitialized(_this), "focusDatePicker", function () {
158
- // By default, this will open the datepicker too
206
+ // This also opens the date picker when isAccessible is disabled
159
207
  if (_this.dateInputEl) {
160
208
  _this.dateInputEl.focus();
161
209
  }
162
210
  });
163
211
 
212
+ _defineProperty(_assertThisInitialized(_this), "getDateInputError", function () {
213
+ var _this$props2 = _this.props,
214
+ intl = _this$props2.intl,
215
+ _this$props2$maxDate = _this$props2.maxDate,
216
+ maxDate = _this$props2$maxDate === void 0 ? null : _this$props2$maxDate,
217
+ _this$props2$minDate = _this$props2.minDate,
218
+ minDate = _this$props2$minDate === void 0 ? null : _this$props2$minDate;
219
+ var showDateInputError = _this.state.showDateInputError;
220
+ var formatMessage = intl.formatMessage;
221
+ if (!showDateInputError) return '';
222
+ var dateInputError = '';
223
+ var maxLocaleDate = getFormattedDate(maxDate, DateFormat.LOCALE_DATE_STRING_DATE_FORMAT);
224
+ var minLocaleDate = getFormattedDate(minDate, DateFormat.LOCALE_DATE_STRING_DATE_FORMAT);
225
+
226
+ if (maxLocaleDate && minLocaleDate) {
227
+ dateInputError = formatMessage(messages.dateInputRangeError, {
228
+ maxLocaleDate: maxLocaleDate,
229
+ minLocaleDate: minLocaleDate
230
+ });
231
+ } else if (maxLocaleDate) {
232
+ dateInputError = formatMessage(messages.dateInputMaxError, {
233
+ maxLocaleDate: maxLocaleDate
234
+ });
235
+ } else if (minLocaleDate) {
236
+ dateInputError = formatMessage(messages.dateInputMinError, {
237
+ minLocaleDate: minLocaleDate
238
+ });
239
+ }
240
+
241
+ return dateInputError;
242
+ });
243
+
164
244
  _defineProperty(_assertThisInitialized(_this), "handleInputKeyDown", function (event) {
165
- var _this$props = _this.props,
166
- isKeyboardInputAllowed = _this$props.isKeyboardInputAllowed,
167
- isTextInputAllowed = _this$props.isTextInputAllowed;
245
+ var _this$props3 = _this.props,
246
+ isKeyboardInputAllowed = _this$props3.isKeyboardInputAllowed,
247
+ isTextInputAllowed = _this$props3.isTextInputAllowed,
248
+ isAccessible = _this$props3.isAccessible;
168
249
 
169
250
  if (!isKeyboardInputAllowed && _this.datePicker && _this.datePicker.isVisible()) {
170
251
  event.stopPropagation();
171
252
  } // Stops up/down arrow & spacebar from moving page scroll position since pikaday does not preventDefault correctly
172
253
 
173
254
 
174
- if (!isTextInputAllowed && event.key !== TAB_KEY) {
255
+ if (!(isTextInputAllowed || isAccessible) && event.key !== TAB_KEY) {
175
256
  event.preventDefault();
176
257
  }
177
258
 
178
- if (isTextInputAllowed && event.key === ENTER_KEY) {
259
+ if ((isTextInputAllowed || isAccessible && !_this.canUseDateInputType) && event.key === ENTER_KEY) {
260
+ event.preventDefault();
261
+ } // Stops enter & spacebar from opening up the browser's default date picker
262
+
263
+
264
+ if (isAccessible && (event.key === ENTER_KEY || event.key === ' ')) {
179
265
  event.preventDefault();
180
266
  }
181
267
 
@@ -187,10 +273,73 @@ function (_React$Component) {
187
273
  }
188
274
  });
189
275
 
276
+ _defineProperty(_assertThisInitialized(_this), "handleOnChange", function (event) {
277
+ var _this$props4 = _this.props,
278
+ isAccessible = _this$props4.isAccessible,
279
+ maxDate = _this$props4.maxDate,
280
+ minDate = _this$props4.minDate,
281
+ onChange = _this$props4.onChange;
282
+ var isDateInputInvalid = _this.state.isDateInputInvalid;
283
+
284
+ if (!isAccessible || !_this.canUseDateInputType) {
285
+ return;
286
+ }
287
+
288
+ if (_this.datePicker && _this.datePicker.isVisible()) {
289
+ event.stopPropagation();
290
+ }
291
+
292
+ var value = event.target.value;
293
+
294
+ if (_this.datePicker && value) {
295
+ var parsedDate = _this.parseDisplayDateType(value);
296
+
297
+ if (parsedDate) {
298
+ if (minDate && parsedDate < minDate || maxDate && parsedDate > maxDate) {
299
+ _this.datePicker.setDate(null);
300
+
301
+ _this.setState({
302
+ isDateInputInvalid: true
303
+ });
304
+
305
+ return;
306
+ } // Reset the error styling on valid date input
307
+
308
+
309
+ if (isDateInputInvalid) {
310
+ _this.setState({
311
+ isDateInputInvalid: false,
312
+ showDateInputError: false
313
+ });
314
+ }
315
+ } else {
316
+ _this.setState({
317
+ isDateInputInvalid: true
318
+ });
319
+ } // Set date so Pikaday date picker value stays in sync with input
320
+
321
+
322
+ _this.datePicker.setDate(parsedDate, true);
323
+
324
+ if (onChange) {
325
+ var formattedDate = _this.formatValue(parsedDate);
326
+
327
+ onChange(parsedDate, formattedDate);
328
+ }
329
+ } else if (isDateInputInvalid) {
330
+ _this.setState({
331
+ isDateInputInvalid: false,
332
+ showDateInputError: false
333
+ });
334
+ }
335
+ });
336
+
190
337
  _defineProperty(_assertThisInitialized(_this), "handleInputBlur", function (event) {
191
- var _this$props2 = _this.props,
192
- onBlur = _this$props2.onBlur,
193
- isTextInputAllowed = _this$props2.isTextInputAllowed;
338
+ var _this$props5 = _this.props,
339
+ isAccessible = _this$props5.isAccessible,
340
+ isTextInputAllowed = _this$props5.isTextInputAllowed,
341
+ onBlur = _this$props5.onBlur;
342
+ var isDateInputInvalid = _this.state.isDateInputInvalid;
194
343
  var nextActiveElement = event.relatedTarget || document.activeElement; // This is mostly here to cancel out the pikaday hide() on blur
195
344
 
196
345
  if (_this.datePicker && _this.datePicker.isVisible() && nextActiveElement && nextActiveElement === _this.datePickerButtonEl) {
@@ -202,50 +351,155 @@ function (_React$Component) {
202
351
 
203
352
  if (onBlur) {
204
353
  onBlur(event);
205
- } // Since we Fire parent onChange event if isTextInputAllowed
354
+ } // Since we fire parent onChange event if isTextInputAllowed,
206
355
  // fire it on blur if the user typed a correct date format
207
356
 
208
357
 
209
358
  var inputDate = null;
210
359
 
211
360
  if (_this.dateInputEl) {
212
- inputDate = new Date(_this.dateInputEl.value);
361
+ var dateInputElVal = null;
362
+
363
+ if (isAccessible && !_this.canUseDateInputType) {
364
+ dateInputElVal = _this.parseDisplayDateType(_this.dateInputEl.value);
365
+ }
366
+
367
+ inputDate = new Date(dateInputElVal || _this.dateInputEl.value);
213
368
  }
214
369
 
215
- if (isTextInputAllowed && inputDate && inputDate.getDate()) {
370
+ if ((isTextInputAllowed || isAccessible && !_this.canUseDateInputType) && inputDate && inputDate.getDate()) {
216
371
  _this.onSelectHandler(inputDate);
217
372
  }
373
+
374
+ if (isAccessible && isDateInputInvalid) _this.setState({
375
+ showDateInputError: true
376
+ });
218
377
  });
219
378
 
220
379
  _defineProperty(_assertThisInitialized(_this), "handleButtonClick", function (event) {
221
380
  event.preventDefault();
222
381
  event.stopPropagation();
382
+ var _this$props6 = _this.props,
383
+ isAccessible = _this$props6.isAccessible,
384
+ isDisabled = _this$props6.isDisabled;
385
+
386
+ if (isAccessible) {
387
+ if (isDisabled || !_this.datePicker) {
388
+ return;
389
+ }
390
+
391
+ if (_this.datePicker.isVisible()) {
392
+ _this.datePicker.hide();
393
+
394
+ _this.focusDatePicker();
395
+ } else {
396
+ _this.datePicker.show();
397
+ }
398
+
399
+ return;
400
+ }
223
401
 
224
402
  if (!_this.shouldStayClosed) {
225
403
  _this.focusDatePicker();
226
404
  }
227
405
  });
228
406
 
407
+ _defineProperty(_assertThisInitialized(_this), "handleOnClick", function (event) {
408
+ var isAccessible = _this.props.isAccessible;
409
+
410
+ if (isAccessible) {
411
+ // Suppress Firefox default behavior: clicking on input type "date"
412
+ // opens the browser date picker.
413
+ event.preventDefault();
414
+ event.stopPropagation();
415
+ }
416
+ });
417
+
229
418
  _defineProperty(_assertThisInitialized(_this), "formatDisplay", function (date) {
230
- var _this$props3 = _this.props,
231
- displayFormat = _this$props3.displayFormat,
232
- intl = _this$props3.intl;
419
+ var _this$props7 = _this.props,
420
+ displayFormat = _this$props7.displayFormat,
421
+ intl = _this$props7.intl;
233
422
  return date ? intl.formatDate(date, displayFormat) : '';
234
423
  });
235
424
 
425
+ _defineProperty(_assertThisInitialized(_this), "formatDisplayDateType", function (date) {
426
+ // Input type "date" only accepts the format YYYY-MM-DD
427
+ return date ? getFormattedDate(date, DateFormat.UTC_ISO_STRING_DATE_FORMAT).slice(0, 10) : '';
428
+ });
429
+
430
+ _defineProperty(_assertThisInitialized(_this), "parseDisplayDateType", function (dateString) {
431
+ if (dateString && ISO_DATE_FORMAT_PATTERN.test(dateString)) {
432
+ // Calling new Date('YYYY-MM-DD') without 'T00:00:00' yields undesired results:
433
+ // E.g. new Date('2017-06-01') => May 31 2017
434
+ // E.g. new Date('2017-06-01T00:00:00') => June 01 2017
435
+ // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date#parameters
436
+ return new Date("".concat(dateString, "T00:00:00"));
437
+ }
438
+
439
+ return null;
440
+ });
441
+
236
442
  _defineProperty(_assertThisInitialized(_this), "formatValue", function (date) {
237
443
  var dateFormat = _this.props.dateFormat;
238
444
  return dateFormat ? getFormattedDate(date, dateFormat) : '';
239
445
  });
240
446
 
241
447
  _defineProperty(_assertThisInitialized(_this), "clearDate", function (event) {
242
- event.preventDefault(); // so datepicker doesn't open after clearing
448
+ // Prevents the date picker from opening after clearing
449
+ event.preventDefault();
450
+ var isAccessible = _this.props.isAccessible;
243
451
 
244
452
  if (_this.datePicker) {
245
453
  _this.datePicker.setDate(null);
246
454
  }
247
455
 
248
456
  _this.onSelectHandler(null);
457
+
458
+ if (isAccessible) {
459
+ _this.focusDatePicker();
460
+ }
461
+ });
462
+
463
+ _defineProperty(_assertThisInitialized(_this), "shouldUseAccessibleFallback", function () {
464
+ var test = document.createElement('input');
465
+
466
+ try {
467
+ test.type = 'date';
468
+ } catch (e) {} // no-op
469
+ // If date input falls back to text input, show the fallback
470
+
471
+
472
+ return test.type === 'text';
473
+ });
474
+
475
+ _defineProperty(_assertThisInitialized(_this), "renderCalendarButton", function () {
476
+ var _this$props8 = _this.props,
477
+ intl = _this$props8.intl,
478
+ isAccessible = _this$props8.isAccessible,
479
+ isAlwaysVisible = _this$props8.isAlwaysVisible,
480
+ isDisabled = _this$props8.isDisabled;
481
+ var formatMessage = intl.formatMessage;
482
+
483
+ if (isAlwaysVisible) {
484
+ return null;
485
+ } // De-emphasizing the Pikaday date picker because it does not meet accessibility standards
486
+ // Screenreaders & navigating via keyboard will no longer pick up on this element
487
+
488
+
489
+ var accessibleAttrs = isAccessible ? {
490
+ 'aria-hidden': true,
491
+ tabIndex: -1
492
+ } : {};
493
+ return React.createElement(PlainButton, _extends({
494
+ "aria-label": formatMessage(messages.chooseDate),
495
+ className: "date-picker-open-btn",
496
+ getDOMRef: function getDOMRef(ref) {
497
+ _this.datePickerButtonEl = ref;
498
+ },
499
+ isDisabled: isDisabled,
500
+ onClick: _this.handleButtonClick,
501
+ type: ButtonType.BUTTON
502
+ }, accessibleAttrs), React.createElement(Calendar16, null));
249
503
  });
250
504
 
251
505
  return _this;
@@ -254,52 +508,72 @@ function (_React$Component) {
254
508
  _createClass(DatePicker, [{
255
509
  key: "componentDidMount",
256
510
  value: function componentDidMount() {
257
- var _this$props4 = this.props,
258
- customInput = _this$props4.customInput,
259
- dateFormat = _this$props4.dateFormat,
260
- intl = _this$props4.intl,
261
- isAlwaysVisible = _this$props4.isAlwaysVisible,
262
- isTextInputAllowed = _this$props4.isTextInputAllowed,
263
- maxDate = _this$props4.maxDate,
264
- minDate = _this$props4.minDate,
265
- value = _this$props4.value,
266
- yearRange = _this$props4.yearRange;
511
+ var _this$props9 = this.props,
512
+ customInput = _this$props9.customInput,
513
+ dateFormat = _this$props9.dateFormat,
514
+ displayFormat = _this$props9.displayFormat,
515
+ intl = _this$props9.intl,
516
+ isAccessible = _this$props9.isAccessible,
517
+ isAlwaysVisible = _this$props9.isAlwaysVisible,
518
+ isTextInputAllowed = _this$props9.isTextInputAllowed,
519
+ maxDate = _this$props9.maxDate,
520
+ minDate = _this$props9.minDate,
521
+ onChange = _this$props9.onChange,
522
+ value = _this$props9.value,
523
+ yearRange = _this$props9.yearRange;
267
524
  var formatDate = intl.formatDate,
268
525
  formatMessage = intl.formatMessage;
269
526
  var nextMonth = messages.nextMonth,
270
527
  previousMonth = messages.previousMonth;
271
- var defaultValue = value; // When date format is utcTime, initial date needs to be converted from being relative to GMT to being
528
+ var defaultValue = value;
529
+
530
+ if (isAccessible && this.shouldUseAccessibleFallback()) {
531
+ this.canUseDateInputType = false;
532
+ } // When date format is utcTime, initial date needs to be converted from being relative to GMT to being
272
533
  // relative to browser timezone
273
534
 
535
+
274
536
  if (dateFormat === DateFormat.UTC_TIME_DATE_FORMAT && value) {
275
537
  defaultValue = convertUTCToLocal(value);
538
+
539
+ if (onChange) {
540
+ var formattedDate = this.formatValue(defaultValue);
541
+ onChange(defaultValue, formattedDate);
542
+ }
276
543
  } // Make sure the DST detection algorithm in browsers is up-to-date
277
544
 
278
545
 
279
546
  var year = new Date().getFullYear();
547
+
548
+ var _ref = displayFormat || {},
549
+ timeZone = _ref.timeZone;
550
+
280
551
  var i18n = {
281
552
  previousMonth: formatMessage(previousMonth),
282
553
  nextMonth: formatMessage(nextMonth),
283
554
  months: range(12).map(function (month) {
284
555
  return formatDate(new Date(year, month, 15), {
285
- month: 'long'
556
+ month: 'long',
557
+ timeZone: timeZone
286
558
  });
287
559
  }),
288
560
  // weekdays must start with Sunday, so array of dates below is May 1st-8th, 2016
289
561
  weekdays: range(1, 8).map(function (date) {
290
562
  return formatDate(new Date(2016, 4, date), {
291
- weekday: 'long'
563
+ weekday: 'long',
564
+ timeZone: timeZone
292
565
  });
293
566
  }),
294
567
  weekdaysShort: range(1, 8).map(function (date) {
295
568
  return formatDate(new Date(2016, 4, date), {
296
- weekday: 'narrow'
569
+ weekday: 'narrow',
570
+ timeZone: timeZone
297
571
  });
298
572
  })
299
573
  }; // If "bound" is true (default), the DatePicker will be appended at the end of the document, with absolute positioning
300
574
  // If "bound" is false, the DatePicker will be appended to the DOM right after the input, with relative positioning
301
575
 
302
- this.datePicker = new Pikaday({
576
+ var datePickerConfig = {
303
577
  bound: !customInput,
304
578
  blurFieldOnSelect: false,
305
579
  // Available in pikaday > 1.5.1
@@ -315,7 +589,22 @@ function (_React$Component) {
315
589
  onSelect: this.onSelectHandler,
316
590
  yearRange: yearRange,
317
591
  toString: this.formatDisplay
318
- });
592
+ };
593
+
594
+ if (isAccessible) {
595
+ if (this.canUseDateInputType) {
596
+ delete datePickerConfig.field;
597
+ datePickerConfig.trigger = this.dateInputEl;
598
+ datePickerConfig.accessibleFieldEl = this.dateInputEl;
599
+ datePickerConfig.datePickerButtonEl = this.datePickerButtonEl;
600
+ }
601
+
602
+ datePickerConfig.parse = this.parseDisplayDateType;
603
+ datePickerConfig.toString = this.formatDisplayDateType;
604
+ datePickerConfig.keyboardInput = false;
605
+ }
606
+
607
+ this.datePicker = new AccessiblePikaday(datePickerConfig);
319
608
 
320
609
  if (isTextInputAllowed) {
321
610
  this.updateDateInputValue(this.formatDisplay(defaultValue));
@@ -337,11 +626,11 @@ function (_React$Component) {
337
626
  nextMinDate = _nextProps$minDate === void 0 ? null : _nextProps$minDate,
338
627
  _nextProps$maxDate = nextProps.maxDate,
339
628
  nextMaxDate = _nextProps$maxDate === void 0 ? null : _nextProps$maxDate;
340
- var _this$props5 = this.props,
341
- value = _this$props5.value,
342
- minDate = _this$props5.minDate,
343
- maxDate = _this$props5.maxDate,
344
- isTextInputAllowed = _this$props5.isTextInputAllowed;
629
+ var _this$props10 = this.props,
630
+ value = _this$props10.value,
631
+ minDate = _this$props10.minDate,
632
+ maxDate = _this$props10.maxDate,
633
+ isTextInputAllowed = _this$props10.isTextInputAllowed;
345
634
  var selectedDate = this.datePicker && this.datePicker.getDate(); // only set date when props change
346
635
 
347
636
  if (nextValue && !value || !nextValue && value || nextValue && value && nextValue.getTime() !== value.getTime()) {
@@ -389,33 +678,38 @@ function (_React$Component) {
389
678
  value: function render() {
390
679
  var _this2 = this;
391
680
 
392
- var _this$props6 = this.props,
393
- className = _this$props6.className,
394
- customInput = _this$props6.customInput,
395
- description = _this$props6.description,
396
- error = _this$props6.error,
397
- errorTooltipPosition = _this$props6.errorTooltipPosition,
398
- hideLabel = _this$props6.hideLabel,
399
- hideOptionalLabel = _this$props6.hideOptionalLabel,
400
- inputProps = _this$props6.inputProps,
401
- intl = _this$props6.intl,
402
- isAlwaysVisible = _this$props6.isAlwaysVisible,
403
- isClearable = _this$props6.isClearable,
404
- isDisabled = _this$props6.isDisabled,
405
- isRequired = _this$props6.isRequired,
406
- isTextInputAllowed = _this$props6.isTextInputAllowed,
407
- label = _this$props6.label,
408
- name = _this$props6.name,
409
- onFocus = _this$props6.onFocus,
410
- placeholder = _this$props6.placeholder,
411
- resinTarget = _this$props6.resinTarget,
412
- value = _this$props6.value;
681
+ var _this$props11 = this.props,
682
+ className = _this$props11.className,
683
+ customInput = _this$props11.customInput,
684
+ description = _this$props11.description,
685
+ error = _this$props11.error,
686
+ errorTooltipPosition = _this$props11.errorTooltipPosition,
687
+ hideLabel = _this$props11.hideLabel,
688
+ hideOptionalLabel = _this$props11.hideOptionalLabel,
689
+ inputProps = _this$props11.inputProps,
690
+ intl = _this$props11.intl,
691
+ isAccessible = _this$props11.isAccessible,
692
+ isClearable = _this$props11.isClearable,
693
+ isDisabled = _this$props11.isDisabled,
694
+ isRequired = _this$props11.isRequired,
695
+ isTextInputAllowed = _this$props11.isTextInputAllowed,
696
+ label = _this$props11.label,
697
+ maxDate = _this$props11.maxDate,
698
+ minDate = _this$props11.minDate,
699
+ name = _this$props11.name,
700
+ onFocus = _this$props11.onFocus,
701
+ placeholder = _this$props11.placeholder,
702
+ resinTarget = _this$props11.resinTarget,
703
+ value = _this$props11.value;
704
+ var isDateInputInvalid = this.state.isDateInputInvalid;
413
705
  var formatMessage = intl.formatMessage;
706
+ var errorMessage = error || this.getDateInputError();
707
+ var hasError = !!errorMessage || isDateInputInvalid;
708
+ var hasValue = !!value || isDateInputInvalid;
414
709
  var classes = classNames(className, 'date-picker-wrapper', {
415
- 'show-clear-btn': !!value,
416
- 'show-error': !!error
710
+ 'show-clear-btn': isClearable && hasValue && !isDisabled,
711
+ 'show-error': hasError
417
712
  });
418
- var hasError = !!error;
419
713
  var ariaAttrs = {
420
714
  'aria-invalid': hasError,
421
715
  'aria-required': isRequired,
@@ -423,15 +717,57 @@ function (_React$Component) {
423
717
  'aria-describedby': description ? this.descriptionID : undefined
424
718
  };
425
719
  var resinTargetAttr = resinTarget ? _defineProperty({}, RESIN_TAG_TARGET, resinTarget) : {};
426
- var valueAttr = isTextInputAllowed ? {
427
- defaultValue: this.formatDisplay(value)
428
- } : {
429
- value: this.formatDisplay(value)
430
- };
431
- var onChangeAttr = isTextInputAllowed ? {} : {
432
- onChange: noop
433
- };
434
- /* fixes proptype error about readonly field (not adding readonly so constraint validation works) */
720
+ var valueAttr;
721
+
722
+ if (isAccessible) {
723
+ valueAttr = {
724
+ defaultValue: this.formatDisplayDateType(value)
725
+ };
726
+ } else if (isTextInputAllowed) {
727
+ valueAttr = {
728
+ defaultValue: this.formatDisplay(value)
729
+ };
730
+ } else {
731
+ valueAttr = {
732
+ value: this.formatDisplay(value)
733
+ };
734
+ }
735
+
736
+ var onChangeAttr;
737
+
738
+ if (isAccessible && this.canUseDateInputType) {
739
+ onChangeAttr = {
740
+ onChange: this.handleOnChange
741
+ };
742
+ } else if (isTextInputAllowed || isAccessible && !this.canUseDateInputType) {
743
+ onChangeAttr = {};
744
+ } else {
745
+ // Fixes prop type error about read-only field
746
+ // Not adding readOnly so constraint validation works
747
+ onChangeAttr = {
748
+ onChange: noop
749
+ };
750
+ }
751
+
752
+ var additionalAttrs;
753
+
754
+ if (isAccessible && this.canUseDateInputType) {
755
+ additionalAttrs = {
756
+ max: this.formatDisplayDateType(maxDate) || '9999-12-31',
757
+ min: this.formatDisplayDateType(minDate) || '0001-01-01'
758
+ };
759
+ } else if (isAccessible && !this.canUseDateInputType) {
760
+ // "name" prop is required for pattern validation to be surfaced on form submit. See components/form-elements/form/Form.js
761
+ // "title" prop is shown during constraint validation as a description of the pattern
762
+ // See https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern#usability
763
+ additionalAttrs = {
764
+ name: name,
765
+ pattern: ISO_DATE_FORMAT_PATTERN.source,
766
+ title: 'YYYY-MM-DD'
767
+ };
768
+ } else {
769
+ additionalAttrs = {};
770
+ }
435
771
 
436
772
  return React.createElement("div", {
437
773
  className: classes
@@ -446,59 +782,43 @@ function (_React$Component) {
446
782
  className: "date-picker-description"
447
783
  }, description), React.createElement(Tooltip, {
448
784
  className: "date-picker-error-tooltip",
449
- isShown: !!error,
785
+ isShown: !!errorMessage,
450
786
  position: errorTooltipPosition,
451
- text: error || '',
787
+ text: errorMessage || '',
452
788
  theme: TooltipTheme.ERROR
453
789
  }, customInput ? React.cloneElement(customInput, _objectSpread({
454
790
  disabled: isDisabled,
455
- ref: function ref(_ref2) {
456
- _this2.dateInputEl = _ref2;
791
+ ref: function ref(_ref3) {
792
+ _this2.dateInputEl = _ref3;
457
793
  },
458
794
  required: isRequired
459
795
  }, resinTargetAttr, {}, ariaAttrs)) : React.createElement("input", _extends({
460
- ref: function ref(_ref3) {
461
- _this2.dateInputEl = _ref3;
796
+ ref: function ref(_ref4) {
797
+ _this2.dateInputEl = _ref4;
462
798
  },
463
799
  className: "date-picker-input",
464
800
  disabled: isDisabled,
465
801
  onBlur: this.handleInputBlur,
802
+ onClick: this.handleOnClick,
466
803
  placeholder: placeholder || formatMessage(messages.chooseDate),
467
804
  required: isRequired,
468
- type: "text"
805
+ type: isAccessible && this.canUseDateInputType ? 'date' : 'text'
469
806
  }, onChangeAttr, {
470
807
  onFocus: onFocus,
471
808
  onKeyDown: this.handleInputKeyDown
472
- }, resinTargetAttr, ariaAttrs, inputProps, valueAttr))), React.createElement("span", {
809
+ }, resinTargetAttr, ariaAttrs, inputProps, valueAttr, additionalAttrs))), React.createElement("span", {
473
810
  id: this.errorMessageID,
474
811
  className: "accessibility-hidden",
475
812
  role: "alert"
476
- }, error))), isClearable && !!value && !isDisabled ? React.createElement(PlainButton, {
813
+ }, errorMessage))), isClearable && hasValue && !isDisabled ? React.createElement(PlainButton, {
477
814
  "aria-label": formatMessage(messages.dateClearButton),
478
815
  className: "date-picker-clear-btn",
479
816
  onClick: this.clearDate,
480
817
  type: ButtonType.BUTTON
481
- }, React.createElement(IconClear, {
482
- height: 12,
483
- width: 12
484
- })) : null, error ? React.createElement(IconAlert, {
818
+ }, React.createElement(ClearBadge16, null)) : null, hasError ? React.createElement(Alert16, {
485
819
  className: "date-picker-icon-alert",
486
- height: 13,
487
- title: React.createElement(FormattedMessage, messages.iconAlertText),
488
- width: 13
489
- }) : null, !isAlwaysVisible && React.createElement(PlainButton, {
490
- "aria-label": formatMessage(messages.chooseDate),
491
- className: "date-picker-open-btn",
492
- getDOMRef: function getDOMRef(ref) {
493
- _this2.datePickerButtonEl = ref;
494
- },
495
- isDisabled: isDisabled,
496
- onClick: this.handleButtonClick,
497
- type: ButtonType.BUTTON
498
- }, React.createElement(IconCalendar, {
499
- height: 17,
500
- width: 16
501
- })), React.createElement("input", {
820
+ title: React.createElement(FormattedMessage, messages.iconAlertText)
821
+ }) : null, this.renderCalendarButton(), React.createElement("input", {
502
822
  className: "date-picker-unix-time-input",
503
823
  name: name,
504
824
  readOnly: true,