grommet 2.23.0 → 2.25.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 (489) hide show
  1. package/all/stories/AllComponents.js +2 -7
  2. package/components/Accordion/Accordion.js +1 -1
  3. package/components/Accordion/propTypes.js +1 -1
  4. package/components/Accordion/stories/CustomThemed/Custom.js +3 -2
  5. package/components/AccordionPanel/AccordionPanel.js +2 -1
  6. package/components/Anchor/Anchor.js +3 -4
  7. package/components/Anchor/propTypes.js +1 -1
  8. package/components/Avatar/Avatar.js +1 -1
  9. package/components/Box/Box.js +1 -1
  10. package/components/Box/StyledBox.js +1 -1
  11. package/components/Box/propTypes.js +1 -1
  12. package/components/Button/Button.js +1 -1
  13. package/components/Button/propTypes.js +2 -2
  14. package/components/Button/stories/Basic.js +1 -1
  15. package/components/Button/stories/Fill.js +1 -1
  16. package/components/Button/stories/Kind.js +1 -1
  17. package/components/Calendar/Calendar.js +233 -293
  18. package/components/Calendar/index.d.ts +2 -2
  19. package/components/Calendar/propTypes.js +1 -1
  20. package/components/Calendar/stories/ShowAdjacentDays.js +1 -1
  21. package/components/Calendar/utils.js +16 -129
  22. package/components/Card/Card.js +1 -1
  23. package/components/Card/stories/CustomThemed/Clickable.js +1 -1
  24. package/components/Card/stories/CustomThemed/RichFooter.js +1 -1
  25. package/components/Card/stories/CustomThemed/Themed.js +1 -1
  26. package/components/CardBody/CardBody.js +1 -1
  27. package/components/CardFooter/CardFooter.js +1 -1
  28. package/components/CardHeader/CardHeader.js +1 -1
  29. package/components/Carousel/Carousel.js +1 -1
  30. package/components/Carousel/propTypes.js +1 -1
  31. package/components/Carousel/stories/CustomThemed/Custom.js +1 -1
  32. package/components/Chart/Chart.js +1 -1
  33. package/components/Chart/calcs.js +44 -27
  34. package/components/Chart/index.d.ts +28 -2
  35. package/components/Chart/propTypes.js +1 -1
  36. package/components/Chart/stories/Rich.js +1 -1
  37. package/components/Chart/stories/Scan.js +11 -9
  38. package/components/Chart/stories/Window.js +1 -1
  39. package/components/Chart/stories/data.js +16 -17
  40. package/components/CheckBox/CheckBox.js +4 -3
  41. package/components/CheckBox/stories/CustomThemed/Custom.js +1 -1
  42. package/components/CheckBox/stories/CustomThemed/CustomToggle.js +1 -1
  43. package/components/CheckBox/stories/NoLabel.js +1 -1
  44. package/components/CheckBox/stories/Simple.js +1 -1
  45. package/components/CheckBoxGroup/CheckBoxGroup.js +1 -1
  46. package/components/CheckBoxGroup/index.d.ts +1 -3
  47. package/components/Clock/Analog.js +1 -1
  48. package/components/Clock/Clock.js +1 -1
  49. package/components/Clock/Digital.js +1 -1
  50. package/components/Clock/propTypes.js +1 -1
  51. package/components/Collapsible/stories/Nested.js +1 -1
  52. package/components/Collapsible/stories/Simple.js +1 -1
  53. package/components/DataChart/DataChart.js +11 -42
  54. package/components/DataChart/Detail.js +18 -11
  55. package/components/DataChart/Legend.js +1 -1
  56. package/components/DataChart/Swatch.js +64 -23
  57. package/components/DataChart/XAxis.js +1 -1
  58. package/components/DataChart/YGuide.js +1 -1
  59. package/components/DataChart/propTypes.js +1 -1
  60. package/components/DataChart/stories/Legend.js +6 -2
  61. package/components/DataChart/stories/Pad.js +54 -0
  62. package/components/DataChart/utils.js +11 -1
  63. package/components/DataTable/Body.js +11 -5
  64. package/components/DataTable/Cell.js +1 -1
  65. package/components/DataTable/DataTable.js +1 -1
  66. package/components/DataTable/ExpanderCell.js +1 -1
  67. package/components/DataTable/Footer.js +1 -1
  68. package/components/DataTable/GroupedBody.js +1 -1
  69. package/components/DataTable/Header.js +1 -1
  70. package/components/DataTable/Resizer.js +1 -1
  71. package/components/DataTable/Sorter.js +1 -1
  72. package/components/DataTable/propTypes.js +1 -1
  73. package/components/DataTable/stories/Controlled.js +1 -1
  74. package/components/DataTable/stories/ControlledGrouped.js +1 -1
  75. package/components/DataTable/stories/CustomThemed/Fill.js +1 -1
  76. package/components/DataTable/stories/GroupedOnSelect.js +1 -1
  77. package/components/DataTable/stories/OnUpdate.js +1 -1
  78. package/components/DataTable/stories/Served.js +1 -1
  79. package/components/DataTable/stories/Sort.js +1 -1
  80. package/components/DataTable/stories/SpaceX.js +6 -4
  81. package/components/DataTable/stories/SpaceXUngrouped.js +4 -2
  82. package/components/DataTable/stories/Tunable.js +1 -1
  83. package/components/DataTable/stories/data.js +1 -1
  84. package/components/DataTable/stories/rowDetails.js +1 -1
  85. package/components/DateInput/DateInput.js +89 -92
  86. package/components/DateInput/index.d.ts +1 -0
  87. package/components/DateInput/propTypes.js +1 -0
  88. package/components/DateInput/stories/Format.js +14 -1
  89. package/components/DateInput/utils.js +31 -6
  90. package/components/Diagram/Diagram.js +1 -1
  91. package/components/Diagram/stories/Animated.js +1 -1
  92. package/components/Diagram/stories/Progressing.js +1 -1
  93. package/components/Distribution/Distribution.js +1 -1
  94. package/components/Distribution/propTypes.js +1 -1
  95. package/components/Drop/Drop.js +1 -1
  96. package/components/Drop/DropContainer.js +7 -3
  97. package/components/DropButton/DropButton.js +1 -1
  98. package/components/DropButton/propTypes.js +1 -1
  99. package/components/FileInput/FileInput.js +28 -9
  100. package/components/FileInput/StyledFileInput.js +1 -1
  101. package/components/FileInput/index.d.ts +6 -1
  102. package/components/FileInput/stories/Multiple.js +1 -0
  103. package/components/FocusedContainer.js +1 -1
  104. package/components/Footer/Footer.js +1 -1
  105. package/components/Footer/stories/DoubleFooter.js +1 -1
  106. package/components/Footer/stories/Sitemap.js +1 -1
  107. package/components/Form/Form.js +7 -2
  108. package/components/Form/stories/ArrayOfFormFields.js +1 -1
  109. package/components/Form/stories/CustomThemed/FieldSpacingOptions.js +1 -1
  110. package/components/Form/stories/HelpAndError.js +1 -1
  111. package/components/FormField/FormField.js +26 -29
  112. package/components/Grid/Grid.js +5 -3
  113. package/components/Grid/README.md +0 -2
  114. package/components/Grid/index.d.ts +9 -3
  115. package/components/Grid/propTypes.js +1 -1
  116. package/components/Grid/stories/CustomThemed/Responsive.js +1 -1
  117. package/components/Grid/stories/typescript/App.tsx +42 -48
  118. package/components/Grommet/Grommet.js +1 -1
  119. package/components/Header/Header.js +1 -1
  120. package/components/Heading/Heading.js +1 -1
  121. package/components/Heading/propTypes.js +1 -1
  122. package/components/Image/Image.js +5 -3
  123. package/components/Image/propTypes.js +1 -1
  124. package/components/InfiniteScroll/stories/Basics.js +1 -1
  125. package/components/InfiniteScroll/stories/ClassChildren.js +1 -1
  126. package/components/InfiniteScroll/stories/Marker.js +1 -1
  127. package/components/InfiniteScroll/stories/Show.js +1 -1
  128. package/components/InfiniteScroll/stories/ShowAfter.js +1 -1
  129. package/components/InfiniteScroll/stories/ShowBefore.js +1 -1
  130. package/components/Layer/Layer.js +2 -2
  131. package/components/Layer/LayerContainer.js +7 -3
  132. package/components/List/List.js +104 -41
  133. package/components/List/index.d.ts +3 -1
  134. package/components/List/propTypes.js +4 -2
  135. package/components/List/stories/Disabled.js +33 -0
  136. package/components/Main/Main.js +1 -1
  137. package/components/Markdown/Markdown.js +1 -1
  138. package/components/MaskedInput/MaskedInput.js +37 -28
  139. package/components/Menu/Menu.js +105 -61
  140. package/components/Menu/index.d.ts +2 -2
  141. package/components/Menu/propTypes.js +2 -2
  142. package/components/Menu/stories/Grouped.js +52 -0
  143. package/components/Meter/Bar.js +1 -1
  144. package/components/Meter/Circle.js +5 -3
  145. package/components/Meter/Meter.js +1 -1
  146. package/components/Meter/propTypes.js +1 -1
  147. package/components/NameValueList/NameValueList.js +1 -1
  148. package/components/NameValuePair/NameValuePair.js +1 -1
  149. package/components/Nav/Nav.js +1 -1
  150. package/components/Nav/stories/CustomThemed/JustifySidebar.js +1 -1
  151. package/components/Nav/stories/Sidebar.js +1 -1
  152. package/components/Notification/Notification.js +18 -9
  153. package/components/Notification/index.d.ts +2 -1
  154. package/components/Notification/propTypes.js +2 -1
  155. package/components/Page/Page.js +1 -1
  156. package/components/PageContent/PageContent.js +1 -1
  157. package/components/PageHeader/PageHeader.js +80 -0
  158. package/components/PageHeader/index.d.ts +26 -0
  159. package/components/PageHeader/index.js +8 -0
  160. package/components/PageHeader/propTypes.js +30 -0
  161. package/components/PageHeader/stories/Custom.js +47 -0
  162. package/components/PageHeader/stories/MultipleActions.js +79 -0
  163. package/components/PageHeader/stories/Responsive.js +37 -0
  164. package/components/PageHeader/stories/Simple.js +36 -0
  165. package/components/Pagination/PageControl.js +1 -1
  166. package/components/Pagination/Pagination.js +1 -1
  167. package/components/Pagination/propTypes.js +1 -1
  168. package/components/Paragraph/Paragraph.js +1 -1
  169. package/components/Paragraph/StyledParagraph.js +7 -1
  170. package/components/Paragraph/index.d.ts +1 -0
  171. package/components/Paragraph/propTypes.js +2 -1
  172. package/components/Paragraph/stories/MaxLines.js +37 -0
  173. package/components/RadioButton/RadioButton.js +1 -1
  174. package/components/RadioButtonGroup/RadioButtonGroup.js +1 -1
  175. package/components/RadioButtonGroup/index.d.ts +2 -1
  176. package/components/RadioButtonGroup/stories/CustomThemed/CustomTheme.js +1 -1
  177. package/components/RadioButtonGroup/stories/Disabled.js +1 -1
  178. package/components/RangeInput/RangeInput.js +1 -1
  179. package/components/RangeSelector/EdgeControl.js +1 -1
  180. package/components/RangeSelector/RangeSelector.js +1 -1
  181. package/components/RangeSelector/stories/CustomThemed/Custom.js +1 -1
  182. package/components/RangeSelector/stories/CustomThemed/CustomEdgeControl.js +1 -1
  183. package/components/RangeSelector/stories/Step.js +1 -1
  184. package/components/RangeSelector/stories/Vertical.js +1 -1
  185. package/components/RoutedAnchor/RoutedAnchor.js +2 -2
  186. package/components/RoutedButton/RoutedButton.js +2 -2
  187. package/components/Select/Select.js +11 -32
  188. package/components/Select/SelectContainer.js +34 -37
  189. package/components/Select/propTypes.js +1 -1
  190. package/components/Select/stories/components/SearchBorderBox.js +1 -1
  191. package/components/Select/stories/components/SearchInput.js +1 -1
  192. package/components/Sidebar/Sidebar.js +1 -1
  193. package/components/Sidebar/stories/Labels.js +1 -1
  194. package/components/SkipLink/SkipLink.js +1 -1
  195. package/components/SkipLinkTarget/SkipLinkTarget.js +1 -1
  196. package/components/Spinner/Spinner.js +1 -1
  197. package/components/Stack/Stack.js +1 -1
  198. package/components/Stack/propTypes.js +1 -1
  199. package/components/Tab/StyledTab.js +2 -2
  200. package/components/Tab/Tab.js +35 -17
  201. package/components/Table/StyledTable.js +1 -1
  202. package/components/Table/propTypes.js +1 -1
  203. package/components/TableBody/TableBody.js +1 -1
  204. package/components/TableCell/TableCell.js +1 -1
  205. package/components/TableFooter/TableFooter.js +1 -1
  206. package/components/TableHeader/TableHeader.js +1 -1
  207. package/components/TableRow/TableRow.js +1 -1
  208. package/components/Tabs/Tabs.js +233 -11
  209. package/components/Tabs/propTypes.js +1 -1
  210. package/components/Tabs/stories/Responsive.js +18 -0
  211. package/components/Tag/Tag.js +1 -1
  212. package/components/Tag/propTypes.js +1 -1
  213. package/components/Text/Text.js +1 -1
  214. package/components/Text/propTypes.js +1 -1
  215. package/components/TextArea/TextArea.js +1 -1
  216. package/components/TextArea/stories/NonResizable.js +1 -1
  217. package/components/TextArea/stories/Simple.js +1 -1
  218. package/components/TextInput/TextInput.js +33 -4
  219. package/components/TextInput/stories/DefaultSuggestion.js +1 -0
  220. package/components/TextInput/stories/InsideFormField.js +1 -1
  221. package/components/TextInput/stories/Suggestions.js +1 -0
  222. package/components/TextInput/stories/WithTags.js +1 -1
  223. package/components/Tip/Tip.js +22 -29
  224. package/components/Video/StyledVideo.js +2 -2
  225. package/components/Video/Video.js +101 -47
  226. package/components/Video/index.d.ts +1 -0
  227. package/components/Video/propTypes.js +2 -2
  228. package/components/Video/stories/typescript/ControlsBelow.tsx +6 -2
  229. package/components/WorldMap/WorldMap.js +1 -1
  230. package/components/WorldMap/propTypes.js +1 -1
  231. package/components/WorldMap/stories/Places.js +1 -1
  232. package/components/index.d.ts +1 -0
  233. package/components/index.js +8 -0
  234. package/contexts/AnnounceContext/stories/Assertive.js +1 -1
  235. package/contexts/ResponsiveContext/stories/ResponsiveGrid.js +1 -1
  236. package/es6/all/stories/AllComponents.js +2 -7
  237. package/es6/components/Accordion/Accordion.js +1 -1
  238. package/es6/components/Accordion/propTypes.js +1 -1
  239. package/es6/components/Accordion/stories/CustomThemed/Custom.js +3 -2
  240. package/es6/components/AccordionPanel/AccordionPanel.js +2 -1
  241. package/es6/components/Anchor/Anchor.js +3 -4
  242. package/es6/components/Anchor/propTypes.js +1 -1
  243. package/es6/components/Avatar/Avatar.js +1 -1
  244. package/es6/components/Box/Box.js +1 -1
  245. package/es6/components/Box/StyledBox.js +1 -1
  246. package/es6/components/Box/propTypes.js +1 -1
  247. package/es6/components/Button/Button.js +1 -1
  248. package/es6/components/Button/propTypes.js +2 -2
  249. package/es6/components/Button/stories/Basic.js +1 -1
  250. package/es6/components/Button/stories/Fill.js +1 -1
  251. package/es6/components/Button/stories/Kind.js +1 -1
  252. package/es6/components/Calendar/Calendar.js +231 -293
  253. package/es6/components/Calendar/index.d.ts +2 -2
  254. package/es6/components/Calendar/propTypes.js +1 -1
  255. package/es6/components/Calendar/stories/ShowAdjacentDays.js +1 -1
  256. package/es6/components/Calendar/utils.js +13 -114
  257. package/es6/components/Card/Card.js +1 -1
  258. package/es6/components/Card/stories/CustomThemed/Clickable.js +1 -1
  259. package/es6/components/Card/stories/CustomThemed/RichFooter.js +1 -1
  260. package/es6/components/Card/stories/CustomThemed/Themed.js +1 -1
  261. package/es6/components/CardBody/CardBody.js +1 -1
  262. package/es6/components/CardFooter/CardFooter.js +1 -1
  263. package/es6/components/CardHeader/CardHeader.js +1 -1
  264. package/es6/components/Carousel/Carousel.js +1 -1
  265. package/es6/components/Carousel/propTypes.js +1 -1
  266. package/es6/components/Carousel/stories/CustomThemed/Custom.js +1 -1
  267. package/es6/components/Chart/Chart.js +1 -1
  268. package/es6/components/Chart/calcs.js +44 -27
  269. package/es6/components/Chart/index.d.ts +28 -2
  270. package/es6/components/Chart/propTypes.js +1 -1
  271. package/es6/components/Chart/stories/Rich.js +1 -1
  272. package/es6/components/Chart/stories/Scan.js +10 -9
  273. package/es6/components/Chart/stories/Window.js +1 -1
  274. package/es6/components/Chart/stories/data.js +16 -17
  275. package/es6/components/CheckBox/CheckBox.js +4 -3
  276. package/es6/components/CheckBox/stories/CustomThemed/Custom.js +1 -1
  277. package/es6/components/CheckBox/stories/CustomThemed/CustomToggle.js +1 -1
  278. package/es6/components/CheckBox/stories/NoLabel.js +1 -1
  279. package/es6/components/CheckBox/stories/Simple.js +1 -1
  280. package/es6/components/CheckBoxGroup/CheckBoxGroup.js +1 -1
  281. package/es6/components/CheckBoxGroup/index.d.ts +1 -3
  282. package/es6/components/Clock/Analog.js +1 -1
  283. package/es6/components/Clock/Clock.js +1 -1
  284. package/es6/components/Clock/Digital.js +1 -1
  285. package/es6/components/Clock/propTypes.js +1 -1
  286. package/es6/components/Collapsible/stories/Nested.js +1 -1
  287. package/es6/components/Collapsible/stories/Simple.js +1 -1
  288. package/es6/components/DataChart/DataChart.js +13 -44
  289. package/es6/components/DataChart/Detail.js +20 -10
  290. package/es6/components/DataChart/Legend.js +1 -1
  291. package/es6/components/DataChart/Swatch.js +64 -23
  292. package/es6/components/DataChart/XAxis.js +1 -1
  293. package/es6/components/DataChart/YGuide.js +1 -1
  294. package/es6/components/DataChart/propTypes.js +1 -1
  295. package/es6/components/DataChart/stories/Legend.js +6 -2
  296. package/es6/components/DataChart/stories/Pad.js +42 -0
  297. package/es6/components/DataChart/utils.js +7 -0
  298. package/es6/components/DataTable/Body.js +10 -5
  299. package/es6/components/DataTable/Cell.js +1 -1
  300. package/es6/components/DataTable/DataTable.js +1 -1
  301. package/es6/components/DataTable/ExpanderCell.js +1 -1
  302. package/es6/components/DataTable/Footer.js +1 -1
  303. package/es6/components/DataTable/GroupedBody.js +1 -1
  304. package/es6/components/DataTable/Header.js +1 -1
  305. package/es6/components/DataTable/Resizer.js +1 -1
  306. package/es6/components/DataTable/Sorter.js +1 -1
  307. package/es6/components/DataTable/propTypes.js +1 -1
  308. package/es6/components/DataTable/stories/Controlled.js +1 -1
  309. package/es6/components/DataTable/stories/ControlledGrouped.js +1 -1
  310. package/es6/components/DataTable/stories/CustomThemed/Fill.js +1 -1
  311. package/es6/components/DataTable/stories/GroupedOnSelect.js +1 -1
  312. package/es6/components/DataTable/stories/OnUpdate.js +1 -1
  313. package/es6/components/DataTable/stories/Served.js +1 -1
  314. package/es6/components/DataTable/stories/Sort.js +1 -1
  315. package/es6/components/DataTable/stories/SpaceX.js +6 -4
  316. package/es6/components/DataTable/stories/SpaceXUngrouped.js +4 -2
  317. package/es6/components/DataTable/stories/Tunable.js +1 -1
  318. package/es6/components/DataTable/stories/data.js +1 -1
  319. package/es6/components/DataTable/stories/rowDetails.js +1 -1
  320. package/es6/components/DateInput/DateInput.js +85 -88
  321. package/es6/components/DateInput/index.d.ts +1 -0
  322. package/es6/components/DateInput/propTypes.js +1 -0
  323. package/es6/components/DateInput/stories/Format.js +14 -1
  324. package/es6/components/DateInput/utils.js +30 -8
  325. package/es6/components/Diagram/Diagram.js +1 -1
  326. package/es6/components/Diagram/stories/Animated.js +1 -1
  327. package/es6/components/Diagram/stories/Progressing.js +1 -1
  328. package/es6/components/Distribution/Distribution.js +1 -1
  329. package/es6/components/Distribution/propTypes.js +1 -1
  330. package/es6/components/Drop/Drop.js +1 -1
  331. package/es6/components/Drop/DropContainer.js +5 -3
  332. package/es6/components/DropButton/DropButton.js +1 -1
  333. package/es6/components/DropButton/propTypes.js +1 -1
  334. package/es6/components/FileInput/FileInput.js +28 -9
  335. package/es6/components/FileInput/StyledFileInput.js +1 -1
  336. package/es6/components/FileInput/index.d.ts +6 -1
  337. package/es6/components/FileInput/stories/Multiple.js +1 -0
  338. package/es6/components/FocusedContainer.js +1 -1
  339. package/es6/components/Footer/Footer.js +1 -1
  340. package/es6/components/Footer/stories/DoubleFooter.js +1 -1
  341. package/es6/components/Footer/stories/Sitemap.js +1 -1
  342. package/es6/components/Form/Form.js +7 -2
  343. package/es6/components/Form/stories/ArrayOfFormFields.js +1 -1
  344. package/es6/components/Form/stories/CustomThemed/FieldSpacingOptions.js +1 -1
  345. package/es6/components/Form/stories/HelpAndError.js +1 -1
  346. package/es6/components/FormField/FormField.js +26 -30
  347. package/es6/components/Grid/Grid.js +5 -3
  348. package/es6/components/Grid/README.md +0 -2
  349. package/es6/components/Grid/index.d.ts +9 -3
  350. package/es6/components/Grid/propTypes.js +1 -1
  351. package/es6/components/Grid/stories/CustomThemed/Responsive.js +1 -1
  352. package/es6/components/Grid/stories/typescript/App.tsx +42 -48
  353. package/es6/components/Grommet/Grommet.js +1 -1
  354. package/es6/components/Header/Header.js +1 -1
  355. package/es6/components/Heading/Heading.js +1 -1
  356. package/es6/components/Heading/propTypes.js +1 -1
  357. package/es6/components/Image/Image.js +5 -3
  358. package/es6/components/Image/propTypes.js +1 -1
  359. package/es6/components/InfiniteScroll/stories/Basics.js +1 -1
  360. package/es6/components/InfiniteScroll/stories/ClassChildren.js +1 -1
  361. package/es6/components/InfiniteScroll/stories/Marker.js +1 -1
  362. package/es6/components/InfiniteScroll/stories/Show.js +1 -1
  363. package/es6/components/InfiniteScroll/stories/ShowAfter.js +1 -1
  364. package/es6/components/InfiniteScroll/stories/ShowBefore.js +1 -1
  365. package/es6/components/Layer/Layer.js +2 -2
  366. package/es6/components/Layer/LayerContainer.js +5 -3
  367. package/es6/components/List/List.js +105 -42
  368. package/es6/components/List/index.d.ts +3 -1
  369. package/es6/components/List/propTypes.js +4 -2
  370. package/es6/components/List/stories/Disabled.js +20 -0
  371. package/es6/components/Main/Main.js +1 -1
  372. package/es6/components/Markdown/Markdown.js +1 -1
  373. package/es6/components/MaskedInput/MaskedInput.js +38 -29
  374. package/es6/components/Menu/Menu.js +106 -61
  375. package/es6/components/Menu/index.d.ts +2 -2
  376. package/es6/components/Menu/propTypes.js +2 -2
  377. package/es6/components/Menu/stories/Grouped.js +40 -0
  378. package/es6/components/Meter/Bar.js +1 -1
  379. package/es6/components/Meter/Circle.js +5 -3
  380. package/es6/components/Meter/Meter.js +1 -1
  381. package/es6/components/Meter/propTypes.js +1 -1
  382. package/es6/components/NameValueList/NameValueList.js +1 -1
  383. package/es6/components/NameValuePair/NameValuePair.js +1 -1
  384. package/es6/components/Nav/Nav.js +1 -1
  385. package/es6/components/Nav/stories/CustomThemed/JustifySidebar.js +1 -1
  386. package/es6/components/Nav/stories/Sidebar.js +1 -1
  387. package/es6/components/Notification/Notification.js +18 -9
  388. package/es6/components/Notification/index.d.ts +2 -1
  389. package/es6/components/Notification/propTypes.js +2 -1
  390. package/es6/components/Page/Page.js +1 -1
  391. package/es6/components/PageContent/PageContent.js +1 -1
  392. package/es6/components/PageHeader/PageHeader.js +63 -0
  393. package/es6/components/PageHeader/index.d.ts +26 -0
  394. package/es6/components/PageHeader/index.js +1 -0
  395. package/es6/components/PageHeader/propTypes.js +19 -0
  396. package/es6/components/PageHeader/stories/Custom.js +32 -0
  397. package/es6/components/PageHeader/stories/MultipleActions.js +63 -0
  398. package/es6/components/PageHeader/stories/Responsive.js +25 -0
  399. package/es6/components/PageHeader/stories/Simple.js +24 -0
  400. package/es6/components/Pagination/PageControl.js +1 -1
  401. package/es6/components/Pagination/Pagination.js +1 -1
  402. package/es6/components/Pagination/propTypes.js +1 -1
  403. package/es6/components/Paragraph/Paragraph.js +1 -1
  404. package/es6/components/Paragraph/StyledParagraph.js +8 -1
  405. package/es6/components/Paragraph/index.d.ts +1 -0
  406. package/es6/components/Paragraph/propTypes.js +2 -1
  407. package/es6/components/Paragraph/stories/MaxLines.js +24 -0
  408. package/es6/components/RadioButton/RadioButton.js +1 -1
  409. package/es6/components/RadioButtonGroup/RadioButtonGroup.js +1 -1
  410. package/es6/components/RadioButtonGroup/index.d.ts +2 -1
  411. package/es6/components/RadioButtonGroup/stories/CustomThemed/CustomTheme.js +1 -1
  412. package/es6/components/RadioButtonGroup/stories/Disabled.js +1 -1
  413. package/es6/components/RangeInput/RangeInput.js +1 -1
  414. package/es6/components/RangeSelector/EdgeControl.js +1 -1
  415. package/es6/components/RangeSelector/RangeSelector.js +1 -1
  416. package/es6/components/RangeSelector/stories/CustomThemed/Custom.js +1 -1
  417. package/es6/components/RangeSelector/stories/CustomThemed/CustomEdgeControl.js +1 -1
  418. package/es6/components/RangeSelector/stories/Step.js +1 -1
  419. package/es6/components/RangeSelector/stories/Vertical.js +1 -1
  420. package/es6/components/RoutedAnchor/RoutedAnchor.js +2 -2
  421. package/es6/components/RoutedButton/RoutedButton.js +2 -2
  422. package/es6/components/Select/Select.js +12 -33
  423. package/es6/components/Select/SelectContainer.js +35 -38
  424. package/es6/components/Select/propTypes.js +1 -1
  425. package/es6/components/Select/stories/components/SearchBorderBox.js +1 -1
  426. package/es6/components/Select/stories/components/SearchInput.js +1 -1
  427. package/es6/components/Sidebar/Sidebar.js +1 -1
  428. package/es6/components/Sidebar/stories/Labels.js +1 -1
  429. package/es6/components/SkipLink/SkipLink.js +1 -1
  430. package/es6/components/SkipLinkTarget/SkipLinkTarget.js +1 -1
  431. package/es6/components/Spinner/Spinner.js +1 -1
  432. package/es6/components/Stack/Stack.js +1 -1
  433. package/es6/components/Stack/propTypes.js +1 -1
  434. package/es6/components/Tab/StyledTab.js +2 -2
  435. package/es6/components/Tab/Tab.js +35 -18
  436. package/es6/components/Table/StyledTable.js +1 -1
  437. package/es6/components/Table/propTypes.js +1 -1
  438. package/es6/components/TableBody/TableBody.js +1 -1
  439. package/es6/components/TableCell/TableCell.js +1 -1
  440. package/es6/components/TableFooter/TableFooter.js +1 -1
  441. package/es6/components/TableHeader/TableHeader.js +1 -1
  442. package/es6/components/TableRow/TableRow.js +1 -1
  443. package/es6/components/Tabs/Tabs.js +229 -12
  444. package/es6/components/Tabs/propTypes.js +1 -1
  445. package/es6/components/Tabs/stories/Responsive.js +18 -0
  446. package/es6/components/Tag/Tag.js +1 -1
  447. package/es6/components/Tag/propTypes.js +1 -1
  448. package/es6/components/Text/Text.js +1 -1
  449. package/es6/components/Text/propTypes.js +1 -1
  450. package/es6/components/TextArea/TextArea.js +1 -1
  451. package/es6/components/TextArea/stories/NonResizable.js +1 -1
  452. package/es6/components/TextArea/stories/Simple.js +1 -1
  453. package/es6/components/TextInput/TextInput.js +33 -4
  454. package/es6/components/TextInput/stories/DefaultSuggestion.js +1 -0
  455. package/es6/components/TextInput/stories/InsideFormField.js +1 -1
  456. package/es6/components/TextInput/stories/Suggestions.js +1 -0
  457. package/es6/components/TextInput/stories/WithTags.js +1 -1
  458. package/es6/components/Tip/Tip.js +22 -29
  459. package/es6/components/Video/StyledVideo.js +2 -2
  460. package/es6/components/Video/Video.js +100 -47
  461. package/es6/components/Video/index.d.ts +1 -0
  462. package/es6/components/Video/propTypes.js +2 -2
  463. package/es6/components/Video/stories/typescript/ControlsBelow.tsx +6 -2
  464. package/es6/components/WorldMap/WorldMap.js +1 -1
  465. package/es6/components/WorldMap/propTypes.js +1 -1
  466. package/es6/components/WorldMap/stories/Places.js +1 -1
  467. package/es6/components/index.d.ts +1 -0
  468. package/es6/components/index.js +1 -0
  469. package/es6/contexts/AnnounceContext/stories/Assertive.js +1 -1
  470. package/es6/contexts/ResponsiveContext/stories/ResponsiveGrid.js +1 -1
  471. package/es6/index.d.ts +1 -0
  472. package/es6/languages/default.json +4 -1
  473. package/es6/themes/base.d.ts +74 -34
  474. package/es6/themes/base.js +99 -3
  475. package/es6/utils/index.js +2 -1
  476. package/es6/utils/object.js +1 -1
  477. package/es6/utils/pagination.js +1 -1
  478. package/es6/utils/use-keyboard.js +25 -0
  479. package/grommet.min.js +1 -1
  480. package/grommet.min.js.map +1 -1
  481. package/index.d.ts +1 -0
  482. package/languages/default.json +4 -1
  483. package/package.json +65 -59
  484. package/themes/base.d.ts +74 -34
  485. package/themes/base.js +100 -3
  486. package/utils/index.js +8 -0
  487. package/utils/object.js +1 -1
  488. package/utils/pagination.js +1 -1
  489. package/utils/use-keyboard.js +34 -0
@@ -1,4 +1,4 @@
1
- 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); }
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
2
2
 
3
3
  import React, { useContext } from 'react';
4
4
  import styled, { ThemeContext } from 'styled-components';
@@ -1,4 +1,4 @@
1
- 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); }
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
2
2
 
3
3
  import PropTypes from 'prop-types';
4
4
  import { genericProps } from '../../utils/general-prop-types';
@@ -1,4 +1,4 @@
1
- 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); }
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
2
2
 
3
3
  import React from 'react';
4
4
  import { Box, DataTable, CheckBox } from 'grommet'; // Source code for the data can be found here
@@ -1,4 +1,4 @@
1
- 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); }
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
2
2
 
3
3
  import React, { useState } from 'react';
4
4
  import { DataTable } from 'grommet'; // Source code for the data can be found here
@@ -1,4 +1,4 @@
1
- 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); }
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
2
2
 
3
3
  import React from 'react';
4
4
  import { Grommet, Box, DataTable } from 'grommet';
@@ -1,4 +1,4 @@
1
- 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); }
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
2
2
 
3
3
  import React from 'react';
4
4
  import { Box, DataTable } from 'grommet'; // Source code for the data can be found here
@@ -1,4 +1,4 @@
1
- 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); }
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
2
2
 
3
3
  /* eslint-disable no-param-reassign */
4
4
  import React, { useCallback, useMemo, useState } from 'react';
@@ -1,4 +1,4 @@
1
- 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); }
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
2
2
 
3
3
  import React from 'react';
4
4
  import { Box, DataTable } from 'grommet'; // Source code for the data can be found here
@@ -1,4 +1,4 @@
1
- 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); }
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
2
2
 
3
3
  import React from 'react';
4
4
  import { Box, DataTable } from 'grommet';
@@ -1,3 +1,5 @@
1
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
2
+
1
3
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
2
4
 
3
5
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
@@ -127,9 +129,9 @@ export var SpaceX = function SpaceX() {
127
129
  }, [groups]);
128
130
  useEffect(function () {
129
131
  var fetchData = /*#__PURE__*/function () {
130
- var _ref5 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
132
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
131
133
  var query;
132
- return regeneratorRuntime.wrap(function _callee$(_context) {
134
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
133
135
  while (1) {
134
136
  switch (_context.prev = _context.next) {
135
137
  case 0:
@@ -169,11 +171,11 @@ export var SpaceX = function SpaceX() {
169
171
  }, []);
170
172
  useEffect(function () {
171
173
  var fetchData = /*#__PURE__*/function () {
172
- var _ref6 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
174
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
173
175
  var _sort;
174
176
 
175
177
  var query;
176
- return regeneratorRuntime.wrap(function _callee2$(_context2) {
178
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
177
179
  while (1) {
178
180
  switch (_context2.prev = _context2.next) {
179
181
  case 0:
@@ -1,3 +1,5 @@
1
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
2
+
1
3
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
2
4
 
3
5
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
@@ -66,11 +68,11 @@ export var SpaceXUngrouped = function SpaceXUngrouped() {
66
68
 
67
69
  useEffect(function () {
68
70
  var fetchData = /*#__PURE__*/function () {
69
- var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
71
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
70
72
  var _sort;
71
73
 
72
74
  var query;
73
- return regeneratorRuntime.wrap(function _callee$(_context) {
75
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
74
76
  while (1) {
75
77
  switch (_context.prev = _context.next) {
76
78
  case 0:
@@ -1,4 +1,4 @@
1
- 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); }
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
2
2
 
3
3
  import React from 'react';
4
4
  import { Box, DataTable } from 'grommet'; // Source code for the data can be found here
@@ -1,4 +1,4 @@
1
- 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); }
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
2
2
 
3
3
  import React from 'react';
4
4
  import { Box, Meter, Text, Tip } from 'grommet';
@@ -1,4 +1,4 @@
1
- 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); }
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
2
2
 
3
3
  import React from 'react';
4
4
  import { Box, DataTable, CheckBox } from 'grommet'; // Source code for the data can be found here
@@ -1,7 +1,7 @@
1
- var _excluded = ["buttonProps", "calendarProps", "defaultValue", "disabled", "dropProps", "format", "id", "icon", "inline", "inputProps", "name", "onChange", "onFocus", "plain", "value", "messages"],
1
+ var _excluded = ["buttonProps", "calendarProps", "defaultValue", "disabled", "dropProps", "format", "id", "icon", "inline", "inputProps", "name", "onChange", "onFocus", "plain", "reverse", "value", "messages"],
2
2
  _excluded2 = ["icon"];
3
3
 
4
- 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
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
5
5
 
6
6
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
7
7
 
@@ -20,9 +20,34 @@ import { FormContext } from '../Form';
20
20
  import { Keyboard } from '../Keyboard';
21
21
  import { MaskedInput } from '../MaskedInput';
22
22
  import { useForwardedRef } from '../../utils';
23
- import { getTimestamp, normalizeForTimezone } from '../Calendar/utils';
24
23
  import { formatToSchema, schemaToMask, valuesAreEqual, valueToText, textToValue } from './utils';
25
24
  import { DateInputPropTypes } from './propTypes';
25
+ import { getOutputFormat } from '../Calendar/Calendar';
26
+
27
+ var getReference = function getReference(value) {
28
+ var adjustedDate;
29
+ var res;
30
+ if (typeof value === 'string') res = value;else if (Array.isArray(value) && Array.isArray(value[0])) res = value[0].find(function (date) {
31
+ return date;
32
+ });else if (Array.isArray(value) && value.length) {
33
+ res = value[0];
34
+ }
35
+
36
+ if (res) {
37
+ var _res;
38
+
39
+ adjustedDate = new Date(res); // if time is not specified in ISOstring, normalize to midnight
40
+
41
+ if (((_res = res) == null ? void 0 : _res.indexOf('T')) === -1) {
42
+ var offset = adjustedDate.getTimezoneOffset();
43
+ var hour = adjustedDate.getHours();
44
+ adjustedDate.setHours(hour, offset);
45
+ }
46
+ }
47
+
48
+ return adjustedDate;
49
+ };
50
+
26
51
  var DateInput = /*#__PURE__*/forwardRef(function (_ref, refArg) {
27
52
  var buttonProps = _ref.buttonProps,
28
53
  calendarProps = _ref.calendarProps,
@@ -39,6 +64,8 @@ var DateInput = /*#__PURE__*/forwardRef(function (_ref, refArg) {
39
64
  _onChange = _ref.onChange,
40
65
  _onFocus = _ref.onFocus,
41
66
  plain = _ref.plain,
67
+ _ref$reverse = _ref.reverse,
68
+ reverseProp = _ref$reverse === void 0 ? false : _ref$reverse,
42
69
  valueArg = _ref.value,
43
70
  messages = _ref.messages,
44
71
  rest = _objectWithoutPropertiesLoose(_ref, _excluded);
@@ -65,25 +92,24 @@ var DateInput = /*#__PURE__*/forwardRef(function (_ref, refArg) {
65
92
  value = _useFormInput[0],
66
93
  setValue = _useFormInput[1];
67
94
 
68
- var timestamp = useMemo(function () {
69
- if (Array.isArray(defaultValue) && defaultValue.length) return getTimestamp(defaultValue[0]);
70
- if (typeof defaultValue === 'string') return getTimestamp(defaultValue);
71
- if (Array.isArray(value) && value.length) return getTimestamp(value[0]); // check to see if value is not an empty string
72
- // empty string should behave like undefined
95
+ var _useState = useState(getOutputFormat(value)),
96
+ outputFormat = _useState[0],
97
+ setOutputFormat = _useState[1];
73
98
 
74
- if (typeof value === 'string' && value.length) return getTimestamp(value);
75
- return undefined;
76
- }, [defaultValue, value]); // whether or not we should normalize the date based on the timestamp.
77
- // will be set to false if the initial timestamp is undefined (meaning
78
- // a user did not provide a defaultValue or value). in this case, we
79
- // will just rely on the UTC timestamp and don't need to normalize.
99
+ useEffect(function () {
100
+ setOutputFormat(function (previousFormat) {
101
+ var nextFormat = getOutputFormat(value); // when user types, date could become something like 07//2020
102
+ // and value becomes undefined. don't lose the format from the
103
+ // previous valid date
80
104
 
81
- var _useState = useState(true),
82
- normalize = _useState[0],
83
- setNormalize = _useState[1]; // normalize value based on timestamp vs user's local timezone
105
+ return previousFormat !== nextFormat ? previousFormat : nextFormat;
106
+ });
107
+ }, [value]); // keep track of timestamp from original date(s)
84
108
 
109
+ var _useState2 = useState(getReference(value)),
110
+ reference = _useState2[0],
111
+ setReference = _useState2[1]; // do we expect multiple dates?
85
112
 
86
- var normalizedDate = normalizeForTimezone(value, timestamp, normalize); // do we expect multiple dates?
87
113
 
88
114
  var range = Array.isArray(value) || format && format.includes('-'); // parse format and build a formal schema we can use elsewhere
89
115
 
@@ -95,9 +121,9 @@ var DateInput = /*#__PURE__*/forwardRef(function (_ref, refArg) {
95
121
  return schemaToMask(schema);
96
122
  }, [schema]); // textValue is only used when a format is provided
97
123
 
98
- var _useState2 = useState(schema ? valueToText(normalizedDate, schema) : undefined),
99
- textValue = _useState2[0],
100
- setTextValue = _useState2[1]; // Setting the icon through `inputProps` is deprecated.
124
+ var _useState3 = useState(schema ? valueToText(value, schema) : undefined),
125
+ textValue = _useState3[0],
126
+ setTextValue = _useState3[1]; // Setting the icon through `inputProps` is deprecated.
101
127
  // The `icon` prop should be used instead.
102
128
 
103
129
 
@@ -107,27 +133,32 @@ var DateInput = /*#__PURE__*/forwardRef(function (_ref, refArg) {
107
133
 
108
134
  if (MaskedInputIcon) {
109
135
  console.warn("Customizing the DateInput icon through inputProps is deprecated. \nUse the icon prop instead.");
110
- } // We need to distinguish between the caller changing a Form value
136
+ }
137
+
138
+ var reverse = reverseProp || restOfInputProps.reverse;
139
+ var calendarDropdownAlign = {
140
+ top: 'bottom',
141
+ left: 'left'
142
+ }; // We need to distinguish between the caller changing a Form value
111
143
  // and the user typing a date that he isn't finished with yet.
112
144
  // To handle this, we see if we have a value and the text value
113
145
  // associated with it doesn't align to it, then we update the text value.
114
146
  // We compare using textToValue to avoid "06/01/2021" not
115
147
  // matching "06/1/2021".
116
148
 
117
-
118
149
  useEffect(function () {
119
150
  if (schema && value !== undefined) {
120
- var nextTextValue = valueToText(normalizedDate, schema);
151
+ var nextTextValue = valueToText(value, schema);
121
152
 
122
- if (!valuesAreEqual(textToValue(textValue, schema, range, timestamp), textToValue(nextTextValue, schema, range, timestamp)) || textValue === '' && nextTextValue !== '') {
153
+ if (!valuesAreEqual(textToValue(textValue, schema, range, reference), textToValue(nextTextValue, schema, range, reference)) || textValue === '' && nextTextValue !== '') {
123
154
  setTextValue(nextTextValue);
124
155
  }
125
156
  }
126
- }, [range, schema, textValue, value, normalizedDate, timestamp]); // when format and not inline, whether to show the Calendar in a Drop
157
+ }, [range, schema, textValue, reference, value]); // when format and not inline, whether to show the Calendar in a Drop
127
158
 
128
- var _useState3 = useState(),
129
- open = _useState3[0],
130
- setOpen = _useState3[1];
159
+ var _useState4 = useState(),
160
+ open = _useState4[0],
161
+ setOpen = _useState4[1];
131
162
 
132
163
  var openCalendar = useCallback(function () {
133
164
  setOpen(true);
@@ -147,33 +178,23 @@ var DateInput = /*#__PURE__*/forwardRef(function (_ref, refArg) {
147
178
  ref: inline ? ref : undefined,
148
179
  id: inline && !format ? id : undefined,
149
180
  range: range,
150
- date: range ? undefined : normalizedDate // when caller initializes with empty array, dates should be undefined
181
+ date: range ? undefined : value // when caller initializes with empty array, dates should be undefined
151
182
  // allowing the user to select both begin and end of the range
152
183
  ,
153
- dates: range && value.length ? [normalizedDate] : undefined // places focus on days grid when Calendar opens
184
+ dates: range && value.length ? [value] : undefined // places focus on days grid when Calendar opens
154
185
  ,
155
186
  initialFocus: open ? 'days' : undefined,
156
- normalize: normalize,
157
187
  onSelect: disabled ? undefined : function (nextValue) {
158
188
  var normalizedValue;
159
189
 
160
190
  if (range && Array.isArray(nextValue)) {
161
191
  normalizedValue = nextValue[0];
162
192
  } // clicking an edge date removes it
163
- else if (range) normalizedValue = [nextValue, nextValue];else normalizedValue = nextValue; // timestamp will be undefined if no defaultValue or value have
164
- // been passed in, indicating that we should stay local if the
165
- // user first picks a date via the Calendar.
166
-
167
-
168
- var nextNormalize = normalize;
169
-
170
- if (timestamp === undefined) {
171
- nextNormalize = false;
172
- setNormalize(nextNormalize);
173
- }
193
+ else if (range) normalizedValue = [nextValue, nextValue];else normalizedValue = nextValue;
174
194
 
175
- if (schema) setTextValue(valueToText(normalizeForTimezone(normalizedValue, undefined, nextNormalize), schema));
195
+ if (schema) setTextValue(valueToText(normalizedValue, schema));
176
196
  setValue(normalizedValue);
197
+ setReference(getReference(nextValue));
177
198
  if (_onChange) _onChange({
178
199
  value: normalizedValue
179
200
  });
@@ -185,9 +206,7 @@ var DateInput = /*#__PURE__*/forwardRef(function (_ref, refArg) {
185
206
  }, 1);
186
207
  }
187
208
  }
188
- }, _extends({}, calendarProps, {
189
- timestamp: timestamp
190
- })));
209
+ }, calendarProps));
191
210
  var formContextValue = useMemo(function () {
192
211
  return {
193
212
  useFormInput: function useFormInput(_ref3) {
@@ -204,10 +223,7 @@ var DateInput = /*#__PURE__*/forwardRef(function (_ref, refArg) {
204
223
  ref: ref,
205
224
  id: id,
206
225
  dropProps: _extends({
207
- align: {
208
- top: 'bottom',
209
- left: 'left'
210
- }
226
+ align: calendarDropdownAlign
211
227
  }, dropProps),
212
228
  dropContent: calendar,
213
229
  icon: icon || MaskedInputIcon || /*#__PURE__*/React.createElement(CalendarIcon, {
@@ -216,6 +232,18 @@ var DateInput = /*#__PURE__*/forwardRef(function (_ref, refArg) {
216
232
  }, buttonProps));
217
233
  }
218
234
 
235
+ var calendarButton = /*#__PURE__*/React.createElement(Button, {
236
+ onClick: open ? closeCalendar : openCalendar,
237
+ plain: true,
238
+ icon: icon || MaskedInputIcon || /*#__PURE__*/React.createElement(CalendarIcon, {
239
+ size: iconSize
240
+ }),
241
+ margin: reverse ? {
242
+ left: 'small'
243
+ } : {
244
+ right: 'small'
245
+ }
246
+ });
219
247
  var input = /*#__PURE__*/React.createElement(FormContext.Provider, {
220
248
  key: "input" // don't let MaskedInput drive the Form
221
249
  ,
@@ -234,7 +262,7 @@ var DateInput = /*#__PURE__*/forwardRef(function (_ref, refArg) {
234
262
  round: "xxsmall",
235
263
  direction: "row",
236
264
  fill: true
237
- }, /*#__PURE__*/React.createElement(MaskedInput, _extends({
265
+ }, reverse && calendarButton, /*#__PURE__*/React.createElement(MaskedInput, _extends({
238
266
  ref: ref,
239
267
  id: id,
240
268
  name: name,
@@ -247,27 +275,8 @@ var DateInput = /*#__PURE__*/forwardRef(function (_ref, refArg) {
247
275
  onChange: function onChange(event) {
248
276
  var nextTextValue = event.target.value;
249
277
  setTextValue(nextTextValue);
250
- var localTimestamp; // get the UTC timestamp relative to the user's timezone
251
- // once a date is complete
252
-
253
- if (timestamp === undefined && Date.parse(nextTextValue)) {
254
- var _Date$toISOString$spl = new Date(nextTextValue).toISOString().split('T');
255
-
256
- localTimestamp = _Date$toISOString$spl[1];
257
- } // timestamp will be undefined if no defaultValue or value have
258
- // been passed in, indicating that we should stay local
259
-
260
-
261
- var nextNormalize = normalize;
262
-
263
- if (timestamp === undefined) {
264
- nextNormalize = false;
265
- setNormalize(nextNormalize);
266
- }
267
-
268
- var nextValue = textToValue(nextTextValue, schema, range, timestamp || localTimestamp, nextNormalize); // reset to original state
269
-
270
- if (nextValue === undefined) setNormalize(true); // update value even when undefined
278
+ var nextValue = textToValue(nextTextValue, schema, range, reference, outputFormat);
279
+ if (nextValue !== undefined) setReference(getReference(nextValue)); // update value even when undefined
271
280
 
272
281
  setValue(nextValue);
273
282
 
@@ -287,16 +296,7 @@ var DateInput = /*#__PURE__*/forwardRef(function (_ref, refArg) {
287
296
  }));
288
297
  if (_onFocus) _onFocus(event);
289
298
  }
290
- })), /*#__PURE__*/React.createElement(Button, {
291
- onClick: open ? closeCalendar : openCalendar,
292
- plain: true,
293
- icon: icon || MaskedInputIcon || /*#__PURE__*/React.createElement(CalendarIcon, {
294
- size: iconSize
295
- }),
296
- margin: {
297
- right: 'small'
298
- }
299
- }))));
299
+ })), !reverse && calendarButton)));
300
300
 
301
301
  if (inline) {
302
302
  return /*#__PURE__*/React.createElement(Box, null, input, calendar);
@@ -311,11 +311,8 @@ var DateInput = /*#__PURE__*/forwardRef(function (_ref, refArg) {
311
311
  }, /*#__PURE__*/React.createElement(Drop, _extends({
312
312
  overflow: "visible",
313
313
  id: id ? id + "__drop" : undefined,
314
- target: ref.current,
315
- align: _extends({
316
- top: 'bottom',
317
- left: 'left'
318
- }, dropProps),
314
+ target: containerRef.current,
315
+ align: _extends({}, calendarDropdownAlign, dropProps),
319
316
  onEsc: closeCalendar,
320
317
  onClickOutside: function onClickOutside(_ref4) {
321
318
  var target = _ref4.target;
@@ -14,6 +14,7 @@ export interface DateInputProps {
14
14
  icon?: JSX.Element;
15
15
  id?: string;
16
16
  inline?: boolean;
17
+ reverse?: boolean;
17
18
  inputProps?: MaskedInputType;
18
19
  messages?: {
19
20
  enterCalendar?: string;
@@ -11,6 +11,7 @@ if (process.env.NODE_ENV !== 'production') {
11
11
  icon: PropTypes.element,
12
12
  id: PropTypes.string,
13
13
  inline: PropTypes.bool,
14
+ reverse: PropTypes.bool,
14
15
  inputProps: PropTypes.shape({}),
15
16
  name: PropTypes.string,
16
17
  onChange: PropTypes.func,
@@ -16,11 +16,24 @@ export var Format = function Format() {
16
16
  align: "center",
17
17
  pad: "large"
18
18
  }, /*#__PURE__*/React.createElement(Box, {
19
- width: "medium"
19
+ width: "medium",
20
+ margin: {
21
+ vertical: 'small'
22
+ }
20
23
  }, /*#__PURE__*/React.createElement(DateInput, {
21
24
  format: "m/d/yy",
22
25
  value: value,
23
26
  onChange: onChange
27
+ })), /*#__PURE__*/React.createElement(Box, {
28
+ width: "medium",
29
+ margin: {
30
+ vertical: 'small'
31
+ }
32
+ }, /*#__PURE__*/React.createElement(DateInput, {
33
+ format: "m/d/yy",
34
+ value: value,
35
+ reverse: true,
36
+ onChange: onChange
24
37
  })));
25
38
  };
26
39
  export default {
@@ -1,9 +1,15 @@
1
- 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); }
1
+ function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct.bind(); } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
2
2
 
3
- // Converting between Date and String types is handled via a "schema".
3
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
4
+
5
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
6
+
7
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : 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
+ import { handleOffset } from '../Calendar/utils'; // Converting between Date and String types is handled via a "schema".
4
10
  // The schema is an array of strings, split into strings with identical
5
11
  // characters. So, 'mm/dd/yyyy' will be ['mm', '/', 'dd', '/', 'yyyyy'].
6
- import { formatToLocalYYYYMMDD } from '../Calendar/utils';
12
+
7
13
  export var formatToSchema = function formatToSchema(format) {
8
14
  if (!format) return undefined;
9
15
  var result = [];
@@ -70,7 +76,16 @@ export var valueToText = function valueToText(value, schema) {
70
76
 
71
77
  if (!value || Array.isArray(value) && !value.length) return text;
72
78
  var dates = (Array.isArray(value) ? value : [value]).map(function (v) {
73
- return new Date(v);
79
+ // TO DO should we extract this to a reusable function?
80
+ var adjustedDate = new Date(v); // if time is not specified in ISOstring, normalize to midnight
81
+
82
+ if (v.indexOf('T') === -1) {
83
+ var offset = adjustedDate.getTimezoneOffset();
84
+ var hour = adjustedDate.getHours();
85
+ adjustedDate.setHours(hour, offset);
86
+ }
87
+
88
+ return adjustedDate;
74
89
  });
75
90
  var dateIndex = 0;
76
91
  var parts = {};
@@ -126,7 +141,7 @@ var pullDigits = function pullDigits(text, index) {
126
141
  return text.slice(index, end);
127
142
  };
128
143
 
129
- export var textToValue = function textToValue(text, schema, range, timestamp, normalize) {
144
+ export var textToValue = function textToValue(text, schema, range, reference, outputFormat) {
130
145
  if (!text) return range ? [] : undefined;
131
146
  var result;
132
147
 
@@ -134,10 +149,17 @@ export var textToValue = function textToValue(text, schema, range, timestamp, no
134
149
  var leapYear = parts.y % 4 === 0 && parts.y % 100 !== 0 || parts.y % 400 === 0; // Do a little sanity checking on the parts first.
135
150
  // If not valid, leave as is.
136
151
 
137
- if (!parts.m || !parts.d || !parts.y || parts.y.length < 4 || parts.m.length > 2 || parts.d.length > 2 || parts.m > 12 || parts.d > 31 || (parts.m === "02" || parts.m === "2") && parts.d > (leapYear ? 29 : 28)) return parts;
138
- var date = new Date(parts.y, parts.m - 1, parts.d).toISOString(); // match time and timezone of any supplied valueProp
152
+ if (!parts.m || !parts.d || !parts.y || parts.y.length < 4 || parts.m.length > 2 || parts.d.length > 2 || parts.m > 12 || parts.d > 31 || (parts.m === "02" || parts.m === "2") && parts.d > (leapYear ? 29 : 28)) return parts; // use time info from reference date
153
+
154
+ var time = reference ? [reference.getHours(), reference.getMinutes(), reference.getSeconds(), reference.getMilliseconds()] : null;
155
+
156
+ var date = _construct(Date, [parts.y, parts.m - 1, parts.d].concat(time)).toISOString();
139
157
 
140
- if (timestamp) date = formatToLocalYYYYMMDD(date, normalize).split('T')[0] + "T" + timestamp;else date = "" + formatToLocalYYYYMMDD(date, normalize).split('T')[0];
158
+ if (date && outputFormat === 'no timezone') {
159
+ var _handleOffset$toISOSt = handleOffset(date).toISOString().split('T');
160
+
161
+ date = _handleOffset$toISOSt[0];
162
+ }
141
163
 
142
164
  if (!range) {
143
165
  if (!result) result = date;
@@ -1,7 +1,7 @@
1
1
  var _excluded = ["connections"],
2
2
  _excluded2 = ["anchor", "animation", "color", "offset", "round", "thickness", "type"];
3
3
 
4
- 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
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
5
5
 
6
6
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
7
7