grommet 2.47.0 → 2.49.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 (460) hide show
  1. package/all/stories/AllComponents.stories.js +1 -2
  2. package/components/Accordion/Accordion.js +1 -2
  3. package/components/Accordion/stories/CustomHeader.stories.js +1 -2
  4. package/components/AccordionPanel/AccordionPanel.js +4 -8
  5. package/components/Anchor/Anchor.js +5 -6
  6. package/components/Anchor/StyledAnchor.js +2 -3
  7. package/components/Avatar/Avatar.js +1 -2
  8. package/components/Box/Box.js +6 -3
  9. package/components/Box/ResponsiveContainerProvider.js +1 -2
  10. package/components/Box/StyledBox.js +5 -4
  11. package/components/Box/stories/ResponsiveContainer.stories.js +1 -2
  12. package/components/Button/Badge.js +1 -2
  13. package/components/Button/BusyAnimation.js +6 -3
  14. package/components/Button/Button.js +4 -3
  15. package/components/Button/StyledButton.js +4 -3
  16. package/components/Button/StyledButtonKind.js +4 -3
  17. package/components/Button/index.d.ts +1 -1
  18. package/components/Button/propTypes.js +1 -1
  19. package/components/Button/stories/Busy.stories.js +1 -2
  20. package/components/Calendar/Calendar.js +159 -140
  21. package/components/Calendar/StyledCalendar.js +34 -37
  22. package/components/Calendar/stories/ActiveDate.stories.js +1 -2
  23. package/components/Calendar/stories/CustomDay.stories.js +1 -2
  24. package/components/Calendar/stories/CustomHeader.stories.js +1 -2
  25. package/components/Calendar/stories/CustomThemed/CustomSizeHeading.stories.js +1 -2
  26. package/components/Calendar/stories/Dual.stories.js +1 -4
  27. package/components/Calendar/stories/HeaderLevel.stories.js +1 -2
  28. package/components/Calendar/stories/Multiple.stories.js +1 -2
  29. package/components/Calendar/stories/ShowAdjacentDays.stories.js +2 -3
  30. package/components/Calendar/stories/Simple.stories.js +1 -2
  31. package/components/Card/Card.js +1 -2
  32. package/components/Cards/Cards.js +4 -6
  33. package/components/Carousel/Carousel.js +1 -2
  34. package/components/Carousel/CarouselChild.js +1 -2
  35. package/components/Carousel/StyledCarousel.js +1 -2
  36. package/components/Chart/Chart.js +15 -14
  37. package/components/Chart/StyledChart.js +1 -2
  38. package/components/Chart/calcs.js +21 -13
  39. package/components/Chart/stories/Rich.stories.js +1 -2
  40. package/components/Chart/stories/Scan.stories.js +1 -2
  41. package/components/Chart/stories/Window.stories.js +1 -2
  42. package/components/Chart/stories/Zoom.stories.js +1 -2
  43. package/components/CheckBox/CheckBox.js +2 -3
  44. package/components/CheckBox/StyledCheckBox.js +1 -2
  45. package/components/CheckBox/stories/CustomThemed/Custom.stories.js +1 -2
  46. package/components/CheckBox/stories/CustomThemed/CustomToggle.stories.js +1 -2
  47. package/components/CheckBox/stories/Indeterminate.stories.js +1 -2
  48. package/components/CheckBox/stories/NoLabel.stories.js +1 -2
  49. package/components/CheckBox/stories/Simple.stories.js +1 -2
  50. package/components/CheckBox/stories/WithStickyDiv.stories.js +1 -2
  51. package/components/CheckBoxGroup/CheckBoxGroup.js +15 -5
  52. package/components/CheckBoxGroup/stories/Children.stories.js +1 -2
  53. package/components/CheckBoxGroup/stories/InitialValues.stories.js +1 -2
  54. package/components/Clock/Analog.js +1 -2
  55. package/components/Clock/Clock.js +1 -2
  56. package/components/Clock/Digital.js +1 -2
  57. package/components/Clock/StyledClock.js +1 -2
  58. package/components/Collapsible/Collapsible.js +1 -2
  59. package/components/Data/Data.js +6 -3
  60. package/components/Data/DataForm.js +7 -6
  61. package/components/Data/index.d.ts +3 -0
  62. package/components/Data/propTypes.js +4 -1
  63. package/components/Data/stories/Infinite.stories.js +11 -17
  64. package/components/Data/stories/Inline.stories.js +1 -2
  65. package/components/Data/stories/OnSelect.stories.js +11 -17
  66. package/components/Data/stories/SpaceX.stories.js +11 -17
  67. package/components/Data/stories/StarWars.stories.js +16 -44
  68. package/components/DataChart/DataChart.js +18 -17
  69. package/components/DataChart/Detail.js +3 -4
  70. package/components/DataChart/Legend.js +9 -11
  71. package/components/DataChart/XAxis.js +1 -2
  72. package/components/DataChart/XGuide.js +1 -2
  73. package/components/DataChart/YAxis.js +1 -2
  74. package/components/DataChart/YGuide.js +1 -2
  75. package/components/DataChart/stories/Prediction.stories.js +1 -2
  76. package/components/DataChart/utils.js +15 -8
  77. package/components/DataClearFilters/DataClearFilters.js +1 -2
  78. package/components/DataClearFilters/stories/Simple.stories.js +1 -2
  79. package/components/DataFilter/DataFilter.js +15 -12
  80. package/components/DataFilters/DataFilters.js +10 -12
  81. package/components/DataSearch/DataSearch.js +6 -6
  82. package/components/DataSort/DataSort.js +7 -6
  83. package/components/DataSummary/DataSummary.js +7 -8
  84. package/components/DataTable/Body.js +106 -35
  85. package/components/DataTable/Cell.js +1 -2
  86. package/components/DataTable/DataTable.js +49 -16
  87. package/components/DataTable/ExpanderCell.js +55 -7
  88. package/components/DataTable/Footer.js +7 -5
  89. package/components/DataTable/GroupedBody.js +12 -5
  90. package/components/DataTable/Header.js +87 -34
  91. package/components/DataTable/PlaceholderBody.js +1 -2
  92. package/components/DataTable/Resizer.js +167 -47
  93. package/components/DataTable/Searcher.js +40 -13
  94. package/components/DataTable/StyledDataTable.js +2 -3
  95. package/components/DataTable/index.d.ts +19 -0
  96. package/components/DataTable/propTypes.js +19 -0
  97. package/components/DataTable/stories/ControlledGrouped.stories.js +5 -2
  98. package/components/DataTable/stories/Grouped.stories.js +7 -1
  99. package/components/DataTable/stories/GroupedOnSelect.stories.js +7 -1
  100. package/components/DataTable/stories/OnUpdate.stories.js +4 -2
  101. package/components/DataTable/stories/SpaceX.stories.js +23 -18
  102. package/components/DataTable/stories/SpaceXUngrouped.stories.js +8 -9
  103. package/components/DataTable/stories/Styled.stories.js +5 -1
  104. package/components/DataTable/stories/rowDetails.stories.js +22 -48
  105. package/components/DataTableColumns/DataTableColumns.js +39 -24
  106. package/components/DataTableGroupBy/DataTableGroupBy.js +1 -2
  107. package/components/DataView/DataView.js +1 -2
  108. package/components/DateInput/DateInput.js +20 -19
  109. package/components/DateInput/stories/FormatInline.stories.js +1 -2
  110. package/components/Diagram/Diagram.js +1 -2
  111. package/components/Diagram/StyledDiagram.js +1 -2
  112. package/components/Diagram/stories/Animated.stories.js +1 -2
  113. package/components/Diagram/stories/Progressing.stories.js +1 -2
  114. package/components/Distribution/Distribution.js +8 -5
  115. package/components/Drop/Drop.js +1 -2
  116. package/components/Drop/DropContainer.js +1 -2
  117. package/components/Drop/StyledDrop.js +1 -2
  118. package/components/Drop/stories/CustomThemed/Lazy.stories.js +1 -2
  119. package/components/Drop/stories/CustomThemed/Themed.stories.js +1 -2
  120. package/components/Drop/stories/Inline.stories.js +1 -2
  121. package/components/Drop/stories/Meter.stories.js +1 -2
  122. package/components/Drop/stories/Multiple.stories.js +1 -2
  123. package/components/Drop/stories/Overflow.stories.js +1 -2
  124. package/components/Drop/stories/Plain.stories.js +1 -2
  125. package/components/Drop/stories/Progressive.stories.js +1 -2
  126. package/components/Drop/stories/Simple.stories.js +1 -2
  127. package/components/Drop/stories/Styled.stories.js +1 -2
  128. package/components/DropButton/DropButton.js +1 -2
  129. package/components/FileInput/FileInput.js +78 -41
  130. package/components/FileInput/index.d.ts +10 -1
  131. package/components/FileInput/propTypes.js +11 -0
  132. package/components/FocusedContainer.js +1 -2
  133. package/components/Footer/Footer.js +5 -1
  134. package/components/Form/Form.js +11 -12
  135. package/components/Form/FormContext.js +1 -2
  136. package/components/Form/stories/ArrayOfFormFields.stories.js +1 -2
  137. package/components/Form/stories/Controlled.stories.js +2 -2
  138. package/components/Form/stories/ControlledInput.stories.js +2 -2
  139. package/components/Form/stories/ControlledInputLazy.stories.js +2 -2
  140. package/components/Form/stories/ControlledLazy.stories.js +2 -2
  141. package/components/Form/stories/CustomThemed/Custom.stories.js +1 -0
  142. package/components/Form/stories/CustomThemed/FieldBorderPosition.stories.js +1 -2
  143. package/components/Form/stories/CustomThemed/FieldCustomStates.stories.js +1 -2
  144. package/components/Form/stories/DynamicFields.stories.js +1 -2
  145. package/components/Form/stories/FieldStates.stories.js +1 -2
  146. package/components/Form/stories/FieldWithChildren.stories.js +2 -0
  147. package/components/Form/stories/SolicitedFeedback.stories.js +1 -2
  148. package/components/Form/stories/Uncontrolled.stories.js +1 -0
  149. package/components/Form/stories/UnsolicitedFeedback.stories.js +1 -2
  150. package/components/Form/stories/ValidateOnBlur.stories.js +1 -1
  151. package/components/Form/stories/ValidateOnChange.stories.js +1 -2
  152. package/components/Form/stories/ValidateOnMount.stories.js +1 -2
  153. package/components/Form/stories/typescript/TypedForm.stories.tsx +7 -1
  154. package/components/FormField/FormField.js +23 -3
  155. package/components/FormField/stories/Simple.stories.js +1 -2
  156. package/components/Grid/Grid.js +1 -2
  157. package/components/Grid/StyledGrid.js +1 -2
  158. package/components/Grid/stories/ResponsiveCards.stories.js +1 -2
  159. package/components/Grommet/Grommet.js +1 -2
  160. package/components/Grommet/StyledGrommet.js +1 -2
  161. package/components/Grommet/index.d.ts +30 -0
  162. package/components/Grommet/propTypes.js +31 -1
  163. package/components/Header/Header.js +3 -4
  164. package/components/Header/stories/Sticky.stories.js +1 -2
  165. package/components/Heading/Heading.js +1 -2
  166. package/components/Heading/HeadingSkeleton.js +1 -2
  167. package/components/Heading/StyledHeading.js +1 -2
  168. package/components/Image/Image.js +1 -2
  169. package/components/Image/StyledImage.js +1 -2
  170. package/components/InfiniteScroll/InfiniteScroll.js +1 -2
  171. package/components/Layer/Layer.js +47 -18
  172. package/components/Layer/LayerContainer.js +19 -17
  173. package/components/Layer/StyledLayer.js +3 -4
  174. package/components/Layer/stories/Form.stories.js +1 -1
  175. package/components/List/List.js +140 -150
  176. package/components/List/index.d.ts +3 -0
  177. package/components/List/propTypes.js +3 -0
  178. package/components/List/stories/Order.stories.js +1 -2
  179. package/components/List/stories/Pinned.stories.js +1 -2
  180. package/components/Markdown/Markdown.js +1 -2
  181. package/components/MaskedInput/MaskedInput.js +7 -3
  182. package/components/Menu/Menu.js +14 -3
  183. package/components/Meter/Bar.js +39 -19
  184. package/components/Meter/Circle.js +32 -48
  185. package/components/Meter/Meter.js +1 -2
  186. package/components/Meter/StyledMeter.js +1 -2
  187. package/components/Meter/stories/Circle.stories.js +7 -10
  188. package/components/Meter/stories/VerticalBarMultiple.stories.js +1 -2
  189. package/components/Meter/utils.js +15 -1
  190. package/components/NameValueList/NameValueList.js +1 -2
  191. package/components/NameValuePair/NameValuePair.js +1 -2
  192. package/components/Nav/Nav.js +5 -1
  193. package/components/Nav/stories/CustomThemed/JustifySidebar.stories.js +1 -2
  194. package/components/Nav/stories/Sidebar.stories.js +1 -2
  195. package/components/Notification/Notification.js +26 -13
  196. package/components/Notification/index.d.ts +3 -0
  197. package/components/Notification/propTypes.js +3 -0
  198. package/components/Notification/stories/Global.stories.js +1 -2
  199. package/components/Notification/stories/Title.stories.js +1 -2
  200. package/components/Notification/stories/TitleAndMessage.stories.js +1 -2
  201. package/components/Page/Page.js +1 -2
  202. package/components/Page/stories/PageNotificaton.stories.js +1 -2
  203. package/components/PageContent/PageContent.js +1 -2
  204. package/components/PageHeader/PageHeader.js +1 -2
  205. package/components/PageHeader/stories/MultipleActions.stories.js +1 -2
  206. package/components/Pagination/Pagination.js +6 -12
  207. package/components/Pagination/PaginationStep.js +3 -3
  208. package/components/Pagination/PaginationSummary.js +1 -2
  209. package/components/Pagination/stories/Grid.stories.js +1 -2
  210. package/components/Paragraph/Paragraph.js +1 -2
  211. package/components/Paragraph/ParagraphSkeleton.js +3 -3
  212. package/components/Paragraph/StyledParagraph.js +1 -2
  213. package/components/RadioButton/RadioButton.js +2 -3
  214. package/components/RadioButton/StyledRadioButton.js +3 -4
  215. package/components/RadioButtonGroup/RadioButtonGroup.js +18 -8
  216. package/components/RadioButtonGroup/stories/Children.stories.js +1 -2
  217. package/components/RadioButtonGroup/stories/CustomThemed/CustomTheme.stories.js +1 -2
  218. package/components/RadioButtonGroup/stories/Disabled.stories.js +1 -2
  219. package/components/RangeInput/RangeInput.js +2 -3
  220. package/components/RangeInput/StyledRangeInput.js +1 -2
  221. package/components/RangeInput/stories/CustomThemed/Bounds.stories.js +1 -2
  222. package/components/RangeSelector/EdgeControl.js +56 -13
  223. package/components/RangeSelector/RangeSelector.js +14 -31
  224. package/components/RangeSelector/stories/Basic.stories.js +1 -2
  225. package/components/RangeSelector/stories/CustomThemed/Custom.stories.js +1 -2
  226. package/components/RangeSelector/stories/CustomThemed/CustomEdgeControl.stories.js +1 -2
  227. package/components/RangeSelector/stories/Label.stories.js +1 -2
  228. package/components/RangeSelector/stories/Simple.stories.js +1 -2
  229. package/components/RangeSelector/stories/Step.stories.js +1 -2
  230. package/components/RangeSelector/stories/Thin.stories.js +1 -2
  231. package/components/RangeSelector/stories/Vertical.stories.js +1 -2
  232. package/components/RoutedAnchor/RoutedAnchor.js +1 -2
  233. package/components/RoutedButton/RoutedButton.js +1 -2
  234. package/components/Select/DefaultSelectTextInput.js +1 -2
  235. package/components/Select/Select.js +17 -4
  236. package/components/Select/SelectContainer.js +35 -11
  237. package/components/Select/stories/ChildrenRender.stories.js +1 -2
  238. package/components/Select/stories/Clear.stories.js +1 -2
  239. package/components/Select/stories/Controlled.stories.js +1 -2
  240. package/components/Select/stories/CustomThemed/CustomSearch.stories.js +1 -2
  241. package/components/Select/stories/Disabled.stories.js +1 -2
  242. package/components/Select/stories/InsideFormField.stories.js +1 -2
  243. package/components/Select/stories/Multiple.stories.js +1 -2
  244. package/components/Select/stories/ObjectOptions.stories.js +1 -2
  245. package/components/Select/stories/Search.stories.js +1 -2
  246. package/components/Select/stories/Simple.stories.js +1 -2
  247. package/components/Select/stories/ValueLabel.stories.js +1 -2
  248. package/components/Select/stories/components/SearchBorderBox.js +1 -2
  249. package/components/Select/stories/components/SearchInput.js +1 -2
  250. package/components/Select/utils.js +13 -4
  251. package/components/SelectMultiple/SelectMultiple.js +32 -19
  252. package/components/SelectMultiple/SelectMultipleContainer.js +34 -21
  253. package/components/SelectMultiple/SelectMultipleValue.js +6 -9
  254. package/components/SelectMultiple/SelectionSummary.js +8 -10
  255. package/components/SelectMultiple/stories/CustomMessages.stories.js +1 -2
  256. package/components/SelectMultiple/stories/Default.stories.js +1 -2
  257. package/components/SelectMultiple/stories/Disabled.stories.js +1 -2
  258. package/components/SelectMultiple/stories/FormField.stories.js +1 -2
  259. package/components/SelectMultiple/stories/Help.stories.js +1 -2
  260. package/components/SelectMultiple/stories/Limited.stories.js +1 -2
  261. package/components/SelectMultiple/stories/ObjectOptions.stories.js +1 -2
  262. package/components/SelectMultiple/stories/ShowSelectedInline.stories.js +1 -2
  263. package/components/Sidebar/Sidebar.js +6 -3
  264. package/components/Skeleton/Skeleton.js +6 -3
  265. package/components/Skeleton/SkeletonContext.js +1 -2
  266. package/components/Skeleton/stories/CustomThemed/Custom.stories.js +1 -4
  267. package/components/Skeleton/stories/GridContainer.stories.js +1 -2
  268. package/components/Skeleton/stories/Simple.stories.js +0 -1
  269. package/components/SkipLink/SkipLink.js +1 -2
  270. package/components/SkipLinks/SkipLinks.js +1 -2
  271. package/components/Spinner/Spinner.js +8 -6
  272. package/components/Spinner/stories/Animation.stories.js +1 -2
  273. package/components/Spinner/stories/Announced.stories.js +1 -2
  274. package/components/Stack/Stack.js +1 -2
  275. package/components/Stack/StyledStack.js +1 -2
  276. package/components/StarRating/StarRating.js +9 -7
  277. package/components/Tab/StyledTab.js +1 -2
  278. package/components/Tab/Tab.js +3 -3
  279. package/components/Table/StyledTable.js +3 -4
  280. package/components/Table/Table.js +1 -2
  281. package/components/Table/stories/InfiniteScrollInTable.stories.js +1 -2
  282. package/components/TableBody/TableBody.js +1 -2
  283. package/components/TableCell/TableCell.js +21 -5
  284. package/components/TableFooter/TableFooter.js +1 -2
  285. package/components/TableHeader/TableHeader.js +1 -2
  286. package/components/TableRow/TableRow.js +1 -2
  287. package/components/Tabs/StyledTabs.js +1 -2
  288. package/components/Tabs/Tabs.js +9 -14
  289. package/components/Tabs/stories/CustomThemed/States.stories.js +1 -2
  290. package/components/Tabs/stories/Responsive.stories.js +1 -2
  291. package/components/Tag/StyledTag.js +9 -1
  292. package/components/Tag/Tag.js +1 -2
  293. package/components/Text/StyledText.js +1 -2
  294. package/components/Text/Text.js +1 -2
  295. package/components/Text/TextSkeleton.js +1 -2
  296. package/components/TextArea/StyledTextArea.js +1 -2
  297. package/components/TextArea/TextArea.js +1 -2
  298. package/components/TextArea/stories/CustomThemed/Themed.stories.js +1 -2
  299. package/components/TextArea/stories/InsideFormField.stories.js +1 -2
  300. package/components/TextArea/stories/NonResizable.stories.js +1 -2
  301. package/components/TextArea/stories/Simple.stories.js +1 -2
  302. package/components/TextInput/CopyButton.js +6 -3
  303. package/components/TextInput/StyledTextInput.js +1 -2
  304. package/components/TextInput/TextInput.js +10 -3
  305. package/components/TextInput/stories/InsideFormField.stories.js +1 -2
  306. package/components/ThumbsRating/ThumbsRating.js +15 -10
  307. package/components/Tip/Tip.js +1 -2
  308. package/components/Tip/stories/HeaderActions.stories.js +1 -2
  309. package/components/ToggleGroup/ToggleGroup.js +1 -2
  310. package/components/ToggleGroup/stories/Controlled.stories.js +1 -2
  311. package/components/Toolbar/Toolbar.js +16 -13
  312. package/components/Video/StyledVideo.js +1 -2
  313. package/components/Video/Video.js +16 -19
  314. package/components/WorldMap/WorldMap.js +1 -2
  315. package/contexts/AnalyticsContext/AnalyticsContext.js +1 -2
  316. package/contexts/AnnounceContext/AnnounceContext.js +28 -5
  317. package/contexts/AnnounceContext/stories/Polite.stories.js +1 -2
  318. package/contexts/RootsContext.js +1 -2
  319. package/contexts/ThemeContext/stories/ThemeContextExtend.stories.js +1 -2
  320. package/es6/components/AccordionPanel/AccordionPanel.js +3 -6
  321. package/es6/components/Anchor/Anchor.js +4 -4
  322. package/es6/components/Anchor/StyledAnchor.js +2 -2
  323. package/es6/components/Box/Box.js +5 -1
  324. package/es6/components/Box/StyledBox.js +5 -3
  325. package/es6/components/Button/BusyAnimation.js +5 -1
  326. package/es6/components/Button/Button.js +3 -1
  327. package/es6/components/Button/StyledButton.js +3 -1
  328. package/es6/components/Button/StyledButtonKind.js +3 -1
  329. package/es6/components/Button/index.d.ts +1 -1
  330. package/es6/components/Button/propTypes.js +1 -1
  331. package/es6/components/Calendar/Calendar.js +158 -138
  332. package/es6/components/Calendar/StyledCalendar.js +34 -36
  333. package/es6/components/Calendar/stories/Dual.stories.js +0 -2
  334. package/es6/components/Calendar/stories/ShowAdjacentDays.stories.js +1 -1
  335. package/es6/components/Cards/Cards.js +3 -4
  336. package/es6/components/Chart/Chart.js +14 -12
  337. package/es6/components/Chart/calcs.js +21 -13
  338. package/es6/components/CheckBox/CheckBox.js +1 -1
  339. package/es6/components/CheckBoxGroup/CheckBoxGroup.js +14 -3
  340. package/es6/components/Data/Data.js +5 -1
  341. package/es6/components/Data/DataForm.js +6 -4
  342. package/es6/components/Data/index.d.ts +3 -0
  343. package/es6/components/Data/propTypes.js +4 -1
  344. package/es6/components/Data/stories/Infinite.stories.js +10 -15
  345. package/es6/components/Data/stories/OnSelect.stories.js +10 -15
  346. package/es6/components/Data/stories/SpaceX.stories.js +10 -15
  347. package/es6/components/Data/stories/StarWars.stories.js +16 -43
  348. package/es6/components/DataChart/DataChart.js +17 -15
  349. package/es6/components/DataChart/Detail.js +2 -2
  350. package/es6/components/DataChart/Legend.js +8 -9
  351. package/es6/components/DataChart/utils.js +15 -8
  352. package/es6/components/DataFilter/DataFilter.js +14 -10
  353. package/es6/components/DataFilters/DataFilters.js +9 -10
  354. package/es6/components/DataSearch/DataSearch.js +5 -4
  355. package/es6/components/DataSort/DataSort.js +6 -4
  356. package/es6/components/DataSummary/DataSummary.js +6 -6
  357. package/es6/components/DataTable/Body.js +106 -33
  358. package/es6/components/DataTable/DataTable.js +48 -14
  359. package/es6/components/DataTable/ExpanderCell.js +54 -6
  360. package/es6/components/DataTable/Footer.js +4 -1
  361. package/es6/components/DataTable/GroupedBody.js +11 -3
  362. package/es6/components/DataTable/Header.js +86 -32
  363. package/es6/components/DataTable/Resizer.js +168 -46
  364. package/es6/components/DataTable/Searcher.js +40 -12
  365. package/es6/components/DataTable/StyledDataTable.js +1 -1
  366. package/es6/components/DataTable/index.d.ts +19 -0
  367. package/es6/components/DataTable/propTypes.js +19 -0
  368. package/es6/components/DataTable/stories/ControlledGrouped.stories.js +4 -0
  369. package/es6/components/DataTable/stories/Grouped.stories.js +7 -1
  370. package/es6/components/DataTable/stories/GroupedOnSelect.stories.js +7 -1
  371. package/es6/components/DataTable/stories/OnUpdate.stories.js +3 -0
  372. package/es6/components/DataTable/stories/SpaceX.stories.js +22 -16
  373. package/es6/components/DataTable/stories/SpaceXUngrouped.stories.js +7 -7
  374. package/es6/components/DataTable/stories/Styled.stories.js +5 -1
  375. package/es6/components/DataTable/stories/rowDetails.stories.js +22 -47
  376. package/es6/components/DataTableColumns/DataTableColumns.js +37 -21
  377. package/es6/components/DateInput/DateInput.js +19 -17
  378. package/es6/components/Distribution/Distribution.js +8 -5
  379. package/es6/components/FileInput/FileInput.js +78 -40
  380. package/es6/components/FileInput/index.d.ts +10 -1
  381. package/es6/components/FileInput/propTypes.js +11 -0
  382. package/es6/components/Footer/Footer.js +5 -1
  383. package/es6/components/Form/Form.js +10 -10
  384. package/es6/components/Form/stories/Controlled.stories.js +1 -0
  385. package/es6/components/Form/stories/ControlledInput.stories.js +1 -0
  386. package/es6/components/Form/stories/ControlledInputLazy.stories.js +1 -0
  387. package/es6/components/Form/stories/ControlledLazy.stories.js +1 -0
  388. package/es6/components/Form/stories/CustomThemed/Custom.stories.js +1 -0
  389. package/es6/components/Form/stories/FieldWithChildren.stories.js +2 -0
  390. package/es6/components/Form/stories/Uncontrolled.stories.js +1 -0
  391. package/es6/components/Form/stories/ValidateOnBlur.stories.js +1 -1
  392. package/es6/components/Form/stories/typescript/TypedForm.stories.tsx +7 -1
  393. package/es6/components/FormField/FormField.js +22 -1
  394. package/es6/components/Grommet/index.d.ts +30 -0
  395. package/es6/components/Grommet/propTypes.js +31 -1
  396. package/es6/components/Header/Header.js +2 -2
  397. package/es6/components/Layer/Layer.js +47 -17
  398. package/es6/components/Layer/LayerContainer.js +20 -16
  399. package/es6/components/Layer/StyledLayer.js +3 -3
  400. package/es6/components/Layer/stories/Form.stories.js +1 -1
  401. package/es6/components/List/List.js +141 -150
  402. package/es6/components/List/index.d.ts +3 -0
  403. package/es6/components/List/propTypes.js +3 -0
  404. package/es6/components/MaskedInput/MaskedInput.js +6 -1
  405. package/es6/components/Menu/Menu.js +13 -1
  406. package/es6/components/Meter/Bar.js +39 -18
  407. package/es6/components/Meter/Circle.js +33 -48
  408. package/es6/components/Meter/stories/Circle.stories.js +7 -9
  409. package/es6/components/Meter/utils.js +14 -0
  410. package/es6/components/Nav/Nav.js +5 -1
  411. package/es6/components/Notification/Notification.js +27 -12
  412. package/es6/components/Notification/index.d.ts +3 -0
  413. package/es6/components/Notification/propTypes.js +3 -0
  414. package/es6/components/Pagination/Pagination.js +5 -10
  415. package/es6/components/Pagination/PaginationStep.js +2 -1
  416. package/es6/components/Paragraph/ParagraphSkeleton.js +2 -1
  417. package/es6/components/RadioButton/RadioButton.js +1 -1
  418. package/es6/components/RadioButton/StyledRadioButton.js +2 -2
  419. package/es6/components/RadioButtonGroup/RadioButtonGroup.js +17 -6
  420. package/es6/components/RangeInput/RangeInput.js +1 -1
  421. package/es6/components/RangeSelector/EdgeControl.js +57 -12
  422. package/es6/components/RangeSelector/RangeSelector.js +13 -29
  423. package/es6/components/Select/Select.js +17 -3
  424. package/es6/components/Select/SelectContainer.js +34 -9
  425. package/es6/components/Select/utils.js +11 -1
  426. package/es6/components/SelectMultiple/SelectMultiple.js +32 -18
  427. package/es6/components/SelectMultiple/SelectMultipleContainer.js +33 -19
  428. package/es6/components/SelectMultiple/SelectMultipleValue.js +5 -7
  429. package/es6/components/SelectMultiple/SelectionSummary.js +7 -8
  430. package/es6/components/Sidebar/Sidebar.js +6 -3
  431. package/es6/components/Skeleton/Skeleton.js +5 -1
  432. package/es6/components/Skeleton/stories/CustomThemed/Custom.stories.js +0 -2
  433. package/es6/components/Skeleton/stories/Simple.stories.js +0 -1
  434. package/es6/components/Spinner/Spinner.js +6 -3
  435. package/es6/components/StarRating/StarRating.js +8 -5
  436. package/es6/components/Tab/Tab.js +2 -1
  437. package/es6/components/Table/StyledTable.js +2 -2
  438. package/es6/components/TableCell/TableCell.js +20 -3
  439. package/es6/components/Tabs/Tabs.js +8 -12
  440. package/es6/components/Tag/StyledTag.js +10 -2
  441. package/es6/components/TextInput/CopyButton.js +6 -3
  442. package/es6/components/TextInput/TextInput.js +9 -1
  443. package/es6/components/ThumbsRating/ThumbsRating.js +15 -10
  444. package/es6/components/Toolbar/Toolbar.js +15 -11
  445. package/es6/components/Video/Video.js +15 -17
  446. package/es6/contexts/AnnounceContext/AnnounceContext.js +28 -5
  447. package/es6/languages/default.json +33 -3
  448. package/es6/themes/base.d.ts +301 -4
  449. package/es6/themes/base.js +387 -28
  450. package/es6/utils/graphics.js +123 -0
  451. package/es6/utils/styles.js +53 -45
  452. package/grommet.min.js +1 -1
  453. package/grommet.min.js.map +1 -1
  454. package/languages/default.json +33 -3
  455. package/package.json +55 -55
  456. package/themes/base.d.ts +301 -4
  457. package/themes/base.js +387 -28
  458. package/utils/graphics.js +124 -1
  459. package/utils/styles.js +53 -45
  460. package/utils/useId.js +1 -2
@@ -1,7 +1,6 @@
1
1
  import styled, { css, keyframes } from 'styled-components';
2
2
  import { Button } from '../Button';
3
- import { backgroundStyle, focusStyle, genericStyles, kindPartStyles, normalizeColor, parseMetricToNum, roundStyle, styledComponentsConfig } from '../../utils';
4
- import { activeStyle } from '../../utils/background';
3
+ import { backgroundStyle, disabledStyle, focusStyle, genericStyles, kindPartStyles, normalizeColor, parseMetricToNum, roundStyle, styledComponentsConfig } from '../../utils';
5
4
  import { breakpointStyle } from '../../utils/mixins';
6
5
  var responsiveSizeStyle = function responsiveSizeStyle(props) {
7
6
  var breakpoint = props.theme.global.size[props.sizeProp];
@@ -78,7 +77,7 @@ var rangeRoundStyle = function rangeRoundStyle(props) {
78
77
  themeObj = rangeStart;
79
78
  } else if (props.rangePosition === 'end' && rangeEnd) themeObj = rangeEnd;
80
79
  } else themeObj = ((_props$theme$calendar5 = props.theme.calendar) == null || (_props$theme$calendar5 = _props$theme$calendar5[props.sizeProp]) == null || (_props$theme$calendar5 = _props$theme$calendar5.range) == null ? void 0 : _props$theme$calendar5.round) || ((_props$theme$calendar6 = props.theme.calendar) == null || (_props$theme$calendar6 = _props$theme$calendar6.medium) == null || (_props$theme$calendar6 = _props$theme$calendar6.range) == null ? void 0 : _props$theme$calendar6.round);
81
- return themeObj && [roundStyle(themeObj, props.responsive, props.theme), 'overflow: hidden;'];
80
+ return themeObj && [roundStyle(themeObj, props.responsive, props.theme)];
82
81
  };
83
82
  var StyledWeeks = styled.div.withConfig(styledComponentsConfig).withConfig({
84
83
  displayName: "StyledCalendar__StyledWeeks",
@@ -125,12 +124,13 @@ var responsiveDayButtonStyle = function responsiveDayButtonStyle(props) {
125
124
 
126
125
  // when caller opts in to day hover styling, apply all state styles
127
126
  // on CalendarDay instead of active state on CalendarDayButton
127
+ // position relative and z-index are added to prevent the focus
128
+ // indicator from getting cut off
128
129
  var StyledDayButton = styled(Button).withConfig({
129
130
  displayName: "StyledCalendar__StyledDayButton",
130
131
  componentId: "sc-1y4xhmp-5"
131
- })(["", " ", ""], function (props) {
132
- var _props$theme$calendar8;
133
- return ((_props$theme$calendar8 = props.theme.calendar) == null || (_props$theme$calendar8 = _props$theme$calendar8.day) == null || (_props$theme$calendar8 = _props$theme$calendar8.hover) == null ? void 0 : _props$theme$calendar8.background) && 'background: inherit;';
132
+ })(["&:focus{position:relative;z-index:1;}", " ", ""], function (props) {
133
+ return props.disabledProp && disabledStyle(props.theme.button.disabled.opacity);
134
134
  }, function (props) {
135
135
  return props.responsive && responsiveDayButtonStyle(props);
136
136
  });
@@ -149,23 +149,23 @@ var dayStyle = function dayStyle(props) {
149
149
  var backgroundObj;
150
150
  var colorObj;
151
151
  if (props.isSelected) {
152
- var _props$theme$calendar9, _props$theme$calendar10;
153
- backgroundObj = ((_props$theme$calendar9 = props.theme.calendar.day) == null || (_props$theme$calendar9 = _props$theme$calendar9.selected) == null ? void 0 : _props$theme$calendar9.background) || 'control';
154
- colorObj = (_props$theme$calendar10 = props.theme.calendar.day) == null || (_props$theme$calendar10 = _props$theme$calendar10.selected) == null ? void 0 : _props$theme$calendar10.color;
152
+ var _props$theme$calendar8, _props$theme$calendar9;
153
+ backgroundObj = ((_props$theme$calendar8 = props.theme.calendar.day) == null || (_props$theme$calendar8 = _props$theme$calendar8.selected) == null ? void 0 : _props$theme$calendar8.background) || 'control';
154
+ colorObj = (_props$theme$calendar9 = props.theme.calendar.day) == null || (_props$theme$calendar9 = _props$theme$calendar9.selected) == null ? void 0 : _props$theme$calendar9.color;
155
155
  } else if (props.inRange) {
156
- var _props$theme$calendar11, _props$theme$calendar12, _props$theme$calendar13, _props$theme$calendar14;
156
+ var _props$theme$calendar0, _props$theme$calendar1, _props$theme$calendar10, _props$theme$calendar11;
157
157
  // for backwards compatability, only apply this if caller hasn't specified
158
158
  // range specific rounding
159
159
  // if they have, background will be applied to StyledDayContainer
160
- backgroundObj = !((_props$theme$calendar11 = props.theme.calendar) != null && (_props$theme$calendar11 = _props$theme$calendar11[props.sizeProp]) != null && (_props$theme$calendar11 = _props$theme$calendar11.range) != null && _props$theme$calendar11.round) && !((_props$theme$calendar12 = props.theme.calendar) != null && (_props$theme$calendar12 = _props$theme$calendar12.medium.range) != null && _props$theme$calendar12.round) && (((_props$theme$calendar13 = props.theme.calendar.day) == null || (_props$theme$calendar13 = _props$theme$calendar13.inRange) == null ? void 0 : _props$theme$calendar13.background) || {
160
+ backgroundObj = !((_props$theme$calendar0 = props.theme.calendar) != null && (_props$theme$calendar0 = _props$theme$calendar0[props.sizeProp]) != null && (_props$theme$calendar0 = _props$theme$calendar0.range) != null && _props$theme$calendar0.round) && !((_props$theme$calendar1 = props.theme.calendar) != null && (_props$theme$calendar1 = _props$theme$calendar1.medium.range) != null && _props$theme$calendar1.round) && (((_props$theme$calendar10 = props.theme.calendar.day) == null || (_props$theme$calendar10 = _props$theme$calendar10.inRange) == null ? void 0 : _props$theme$calendar10.background) || {
161
161
  color: 'control',
162
162
  opacity: 'weak'
163
163
  });
164
- colorObj = (_props$theme$calendar14 = props.theme.calendar.day) == null || (_props$theme$calendar14 = _props$theme$calendar14.inRange) == null ? void 0 : _props$theme$calendar14.color;
164
+ colorObj = (_props$theme$calendar11 = props.theme.calendar.day) == null || (_props$theme$calendar11 = _props$theme$calendar11.inRange) == null ? void 0 : _props$theme$calendar11.color;
165
165
  } else {
166
- var _props$theme$calendar15, _props$theme$calendar16;
167
- backgroundObj = (_props$theme$calendar15 = props.theme.calendar.day) == null ? void 0 : _props$theme$calendar15.background;
168
- colorObj = (_props$theme$calendar16 = props.theme.calendar.day) == null ? void 0 : _props$theme$calendar16.color;
166
+ var _props$theme$calendar12, _props$theme$calendar13;
167
+ backgroundObj = (_props$theme$calendar12 = props.theme.calendar.day) == null ? void 0 : _props$theme$calendar12.background;
168
+ colorObj = (_props$theme$calendar13 = props.theme.calendar.day) == null ? void 0 : _props$theme$calendar13.color;
169
169
  }
170
170
  if (colorObj && !backgroundObj) return "color: " + normalizeColor(colorObj, props.theme) + ";";
171
171
  return backgroundStyle(backgroundObj, props.theme, colorObj);
@@ -174,17 +174,17 @@ var dayHoverStyle = function dayHoverStyle(props) {
174
174
  var backgroundObj;
175
175
  var colorObj;
176
176
  if (props.isSelected) {
177
- var _props$theme$calendar17, _props$theme$calendar18;
178
- backgroundObj = (_props$theme$calendar17 = props.theme.calendar.day) == null || (_props$theme$calendar17 = _props$theme$calendar17.selected) == null || (_props$theme$calendar17 = _props$theme$calendar17.hover) == null ? void 0 : _props$theme$calendar17.background;
179
- colorObj = (_props$theme$calendar18 = props.theme.calendar.day) == null || (_props$theme$calendar18 = _props$theme$calendar18.selected) == null || (_props$theme$calendar18 = _props$theme$calendar18.hover) == null ? void 0 : _props$theme$calendar18.color;
177
+ var _props$theme$calendar14, _props$theme$calendar15;
178
+ backgroundObj = (_props$theme$calendar14 = props.theme.calendar.day) == null || (_props$theme$calendar14 = _props$theme$calendar14.selected) == null || (_props$theme$calendar14 = _props$theme$calendar14.hover) == null ? void 0 : _props$theme$calendar14.background;
179
+ colorObj = (_props$theme$calendar15 = props.theme.calendar.day) == null || (_props$theme$calendar15 = _props$theme$calendar15.selected) == null || (_props$theme$calendar15 = _props$theme$calendar15.hover) == null ? void 0 : _props$theme$calendar15.color;
180
180
  } else if (props.inRange) {
181
- var _props$theme$calendar19, _props$theme$calendar20;
182
- backgroundObj = (_props$theme$calendar19 = props.theme.calendar.day) == null || (_props$theme$calendar19 = _props$theme$calendar19.inRange) == null || (_props$theme$calendar19 = _props$theme$calendar19.hover) == null ? void 0 : _props$theme$calendar19.background;
183
- colorObj = (_props$theme$calendar20 = props.theme.calendar.day) == null || (_props$theme$calendar20 = _props$theme$calendar20.inRange) == null || (_props$theme$calendar20 = _props$theme$calendar20.hover) == null ? void 0 : _props$theme$calendar20.color;
181
+ var _props$theme$calendar16, _props$theme$calendar17;
182
+ backgroundObj = (_props$theme$calendar16 = props.theme.calendar.day) == null || (_props$theme$calendar16 = _props$theme$calendar16.inRange) == null || (_props$theme$calendar16 = _props$theme$calendar16.hover) == null ? void 0 : _props$theme$calendar16.background;
183
+ colorObj = (_props$theme$calendar17 = props.theme.calendar.day) == null || (_props$theme$calendar17 = _props$theme$calendar17.inRange) == null || (_props$theme$calendar17 = _props$theme$calendar17.hover) == null ? void 0 : _props$theme$calendar17.color;
184
184
  } else {
185
- var _props$theme$calendar21, _props$theme$calendar22;
186
- backgroundObj = (_props$theme$calendar21 = props.theme.calendar.day) == null || (_props$theme$calendar21 = _props$theme$calendar21.hover) == null ? void 0 : _props$theme$calendar21.background;
187
- colorObj = (_props$theme$calendar22 = props.theme.calendar.day) == null || (_props$theme$calendar22 = _props$theme$calendar22.hover) == null ? void 0 : _props$theme$calendar22.color;
185
+ var _props$theme$calendar18, _props$theme$calendar19;
186
+ backgroundObj = (_props$theme$calendar18 = props.theme.calendar.day) == null || (_props$theme$calendar18 = _props$theme$calendar18.hover) == null ? void 0 : _props$theme$calendar18.background;
187
+ colorObj = (_props$theme$calendar19 = props.theme.calendar.day) == null || (_props$theme$calendar19 = _props$theme$calendar19.hover) == null ? void 0 : _props$theme$calendar19.color;
188
188
  }
189
189
  if (colorObj && !backgroundObj) return "color: " + normalizeColor(colorObj, props.theme) + ";";
190
190
  return backgroundStyle(backgroundObj, props.theme, colorObj);
@@ -192,20 +192,20 @@ var dayHoverStyle = function dayHoverStyle(props) {
192
192
  var dayFontStyle = function dayFontStyle(props) {
193
193
  var fontWeight;
194
194
  if (props.isSelected) {
195
- var _props$theme$calendar23;
196
- fontWeight = (_props$theme$calendar23 = props.theme.calendar.day) == null || (_props$theme$calendar23 = _props$theme$calendar23.selected) == null || (_props$theme$calendar23 = _props$theme$calendar23.font) == null ? void 0 : _props$theme$calendar23.weight;
195
+ var _props$theme$calendar20;
196
+ fontWeight = (_props$theme$calendar20 = props.theme.calendar.day) == null || (_props$theme$calendar20 = _props$theme$calendar20.selected) == null || (_props$theme$calendar20 = _props$theme$calendar20.font) == null ? void 0 : _props$theme$calendar20.weight;
197
197
  } else if (props.inRange) {
198
- var _props$theme$calendar24;
199
- fontWeight = (_props$theme$calendar24 = props.theme.calendar.day) == null || (_props$theme$calendar24 = _props$theme$calendar24.inRange) == null || (_props$theme$calendar24 = _props$theme$calendar24.font) == null ? void 0 : _props$theme$calendar24.weight;
198
+ var _props$theme$calendar21;
199
+ fontWeight = (_props$theme$calendar21 = props.theme.calendar.day) == null || (_props$theme$calendar21 = _props$theme$calendar21.inRange) == null || (_props$theme$calendar21 = _props$theme$calendar21.font) == null ? void 0 : _props$theme$calendar21.weight;
200
200
  }
201
201
  return fontWeight && "font-weight: " + fontWeight + ";";
202
202
  };
203
203
  var StyledDay = styled.div.withConfig(styledComponentsConfig).withConfig({
204
204
  displayName: "StyledCalendar__StyledDay",
205
205
  componentId: "sc-1y4xhmp-6"
206
- })(["display:flex;justify-content:center;align-items:center;color:", ";", " ", " ", " ", " ", " ", " ", " ", " ", ""], function (props) {
207
- var _props$theme$calendar25;
208
- return normalizeColor(props.otherMonth ? ((_props$theme$calendar25 = props.theme.calendar) == null || (_props$theme$calendar25 = _props$theme$calendar25.day) == null || (_props$theme$calendar25 = _props$theme$calendar25.adjacent) == null ? void 0 : _props$theme$calendar25.color) || 'text-xweak' : 'text-strong', props.theme);
206
+ })(["display:flex;justify-content:center;align-items:center;color:", ";", " ", " ", " ", " ", " ", " ", " ", ""], function (props) {
207
+ var _props$theme$calendar22;
208
+ return normalizeColor(props.otherMonth ? ((_props$theme$calendar22 = props.theme.calendar) == null || (_props$theme$calendar22 = _props$theme$calendar22.day) == null || (_props$theme$calendar22 = _props$theme$calendar22.adjacent) == null ? void 0 : _props$theme$calendar22.color) || 'text-xweak' : 'text-strong', props.theme);
209
209
  }, function (props) {
210
210
  return daySizeStyle(props);
211
211
  }, function (props) {
@@ -215,14 +215,12 @@ var StyledDay = styled.div.withConfig(styledComponentsConfig).withConfig({
215
215
  }, function (props) {
216
216
  return dayFontStyle(props);
217
217
  }, function (props) {
218
- var _props$theme$calendar26, _props$theme$calendar27;
218
+ var _props$theme$calendar23, _props$theme$calendar24;
219
219
  // fallback to medium if no size-specific styles
220
- var round = ((_props$theme$calendar26 = props.theme.calendar) == null || (_props$theme$calendar26 = _props$theme$calendar26[props.sizeProp]) == null || (_props$theme$calendar26 = _props$theme$calendar26.day) == null ? void 0 : _props$theme$calendar26.round) || ((_props$theme$calendar27 = props.theme.calendar) == null || (_props$theme$calendar27 = _props$theme$calendar27.medium) == null || (_props$theme$calendar27 = _props$theme$calendar27.day) == null ? void 0 : _props$theme$calendar27.round);
220
+ var round = ((_props$theme$calendar23 = props.theme.calendar) == null || (_props$theme$calendar23 = _props$theme$calendar23[props.sizeProp]) == null || (_props$theme$calendar23 = _props$theme$calendar23.day) == null ? void 0 : _props$theme$calendar23.round) || ((_props$theme$calendar24 = props.theme.calendar) == null || (_props$theme$calendar24 = _props$theme$calendar24.medium) == null || (_props$theme$calendar24 = _props$theme$calendar24.day) == null ? void 0 : _props$theme$calendar24.round);
221
221
  return round && roundStyle(round, props.responsive, props.theme);
222
222
  }, function (props) {
223
- return props.active && activeStyle;
224
- }, function (props) {
225
- return props.hover && dayHoverStyle(props);
223
+ return props.hover && !props.disabledProp && dayHoverStyle(props);
226
224
  }, function (props) {
227
225
  return (
228
226
  // when theme uses kind Buttons, since we use children for Button,
@@ -46,7 +46,6 @@ export var Dual = function Dual() {
46
46
  var refDate = new Date(reference);
47
47
  var nextDate = new Date(refDate);
48
48
  nextDate.setMonth(refDate.getMonth() + 1, 1);
49
- setReference1(refDate.toISOString());
50
49
  setReference2(nextDate.toISOString());
51
50
  },
52
51
  header: function header(_ref) {
@@ -83,7 +82,6 @@ export var Dual = function Dual() {
83
82
  var priorDate = new Date(refDate);
84
83
  priorDate.setMonth(refDate.getMonth() - 1, 1);
85
84
  setReference1(priorDate.toISOString());
86
- setReference2(refDate.toISOString());
87
85
  },
88
86
  header: function header(_ref2) {
89
87
  var currentDate = _ref2.date,
@@ -14,7 +14,7 @@ var Container = function Container(_ref) {
14
14
  }, rest));
15
15
  };
16
16
  export var ShowAdjacent = function ShowAdjacent() {
17
- var _useState = useState(new Date(2020, 6, 15).toDateString()),
17
+ var _useState = useState(new Date(2020, 6, 15).toISOString()),
18
18
  date = _useState[0],
19
19
  setDate = _useState[1];
20
20
  var onSelect = function onSelect(nextDate) {
@@ -23,8 +23,7 @@ var Cards = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
23
23
  pad = _ref.pad,
24
24
  paginate = _ref.paginate,
25
25
  showProp = _ref.show,
26
- _ref$size = _ref.size,
27
- size = _ref$size === void 0 ? 'small' : _ref$size,
26
+ size = _ref.size,
28
27
  _ref$step = _ref.step,
29
28
  step = _ref$step === void 0 ? paginate ? 50 : undefined : _ref$step,
30
29
  rest = _objectWithoutPropertiesLoose(_ref, _excluded);
@@ -48,8 +47,8 @@ var Cards = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
48
47
  return /*#__PURE__*/React.createElement(Container, containerProps, /*#__PURE__*/React.createElement(Grid, _extends({
49
48
  ref: ref,
50
49
  as: as,
51
- columns: size,
52
- gap: "medium",
50
+ gap: theme.cards.grid.gap,
51
+ columns: size || theme.cards.grid.columns,
53
52
  margin: !paginate && margin || 'none',
54
53
  pad: !paginate && pad || 'none'
55
54
  }, rest), /*#__PURE__*/React.createElement(InfiniteScroll, {
@@ -13,12 +13,9 @@ import { useThemeValue } from '../../utils/useThemeValue';
13
13
  var gradientMaskColor = '#ffffff';
14
14
 
15
15
  // use constants so re-renders don't re-trigger effects
16
- var defaultSize = {
17
- height: 'small',
18
- width: 'medium'
19
- };
20
16
  var defaultValues = [];
21
17
  var Chart = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
18
+ var _theme$chart, _theme$chart4, _theme$chart5;
22
19
  var a11yTitle = _ref.a11yTitle,
23
20
  boundsProp = _ref.bounds,
24
21
  color = _ref.color,
@@ -37,8 +34,7 @@ var Chart = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
37
34
  point = _ref.point,
38
35
  round = _ref.round,
39
36
  sizeProp = _ref.size,
40
- _ref$thickness = _ref.thickness,
41
- thickness = _ref$thickness === void 0 ? 'medium' : _ref$thickness,
37
+ thickness = _ref.thickness,
42
38
  _ref$type = _ref.type,
43
39
  type = _ref$type === void 0 ? 'bar' : _ref$type,
44
40
  _ref$values = _ref.values,
@@ -48,6 +44,7 @@ var Chart = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
48
44
  var _useThemeValue = useThemeValue(),
49
45
  theme = _useThemeValue.theme,
50
46
  passThemeFlag = _useThemeValue.passThemeFlag;
47
+ var thicknessValue = thickness || ((_theme$chart = theme.chart) == null ? void 0 : _theme$chart.thickness);
51
48
  var values = useMemo(function () {
52
49
  return normalizeValues(valuesProp);
53
50
  }, [valuesProp]);
@@ -60,8 +57,8 @@ var Chart = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
60
57
  return normalizeBounds(boundsProp, values, direction);
61
58
  }, [direction, boundsProp, values]);
62
59
  var strokeWidth = useMemo(function () {
63
- return parseMetricToNum(theme.global.edgeSize[thickness] || thickness);
64
- }, [theme.global.edgeSize, thickness]);
60
+ return parseMetricToNum(theme.global.edgeSize[thicknessValue] || thicknessValue);
61
+ }, [theme.global.edgeSize, thicknessValue]);
65
62
 
66
63
  // inset is { top, left, bottom, right }
67
64
  var inset = useMemo(function () {
@@ -117,6 +114,11 @@ var Chart = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
117
114
 
118
115
  // size is { width, height }
119
116
  var size = useMemo(function () {
117
+ var _theme$chart2, _theme$chart3;
118
+ var defaultSize = {
119
+ height: (_theme$chart2 = theme.chart) == null ? void 0 : _theme$chart2.height,
120
+ width: (_theme$chart3 = theme.chart) == null ? void 0 : _theme$chart3.width
121
+ };
120
122
  var gapWidth = gap ? parseMetricToNum(theme.global.edgeSize[gap] || gap) : strokeWidth;
121
123
 
122
124
  // autoSize is how wide or tall we'd pefer based on the number of values
@@ -143,7 +145,7 @@ var Chart = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
143
145
  width: width,
144
146
  height: height
145
147
  };
146
- }, [containerSize, gap, horizontal, sizeProp, strokeWidth, theme.global.edgeSize, theme.global.size, values]);
148
+ }, [containerSize, gap, horizontal, sizeProp, strokeWidth, theme.global.edgeSize, theme.global.size, (_theme$chart4 = theme.chart) == null ? void 0 : _theme$chart4.height, (_theme$chart5 = theme.chart) == null ? void 0 : _theme$chart5.width, values]);
147
149
 
148
150
  // scale is { x, y }
149
151
  var scale = useMemo(function () {
@@ -484,9 +486,9 @@ var Chart = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
484
486
  y2: horizontal ? 0 : 1
485
487
  }, color.slice(0).sort(function (c1, c2) {
486
488
  return horizontal ? c1.value - c2.value : c2.value - c1.value;
487
- }).map(function (_ref10) {
488
- var value = _ref10.value,
489
- gradientColor = _ref10.color;
489
+ }).map(function (_ref0) {
490
+ var value = _ref0.value,
491
+ gradientColor = _ref0.color;
490
492
  return /*#__PURE__*/React.createElement("stop", {
491
493
  key: value,
492
494
  offset: horizontal ? (value - bounds.x.min) * scale.x / size.width : (size.height - (value - bounds.y.min) * scale.y) / size.height,
@@ -1,11 +1,4 @@
1
1
  import { calcMinMax, normalizeValues } from './utils';
2
- var thicknessPad = {
3
- xlarge: 'large',
4
- large: 'medium',
5
- medium: 'small',
6
- small: 'xsmall',
7
- xsmall: 'xxsmall'
8
- };
9
2
  export var round = function round(value, decimals) {
10
3
  return Number(Math.round(value + "e" + decimals) + "e-" + decimals);
11
4
  };
@@ -156,12 +149,14 @@ export var calcBounds = function calcBounds(valuesArg, options) {
156
149
  // object structure. If options.direction is not present, the results are
157
150
  // delivered in [x, y] array structure, for backwards compatibility
158
151
  export var calcs = function calcs(values, options) {
152
+ var _theme$dataChart, _theme$dataChart2, _theme$dataChart3, _theme$dataChart4, _theme$dataChart5;
159
153
  if (values === void 0) {
160
154
  values = [];
161
155
  }
162
156
  if (options === void 0) {
163
157
  options = {};
164
158
  }
159
+ var theme = options.theme || {};
165
160
  var horizontal = options.direction === 'horizontal';
166
161
 
167
162
  // the number of steps is one less than the number of labels
@@ -223,6 +218,13 @@ export var calcs = function calcs(values, options) {
223
218
  xAxis.push(round(x, 2));
224
219
  x += xStepInterval;
225
220
  }
221
+ var thicknessPad = {
222
+ xlarge: ((_theme$dataChart = theme.dataChart) == null || (_theme$dataChart = _theme$dataChart.thicknessPad) == null ? void 0 : _theme$dataChart.xlarge) || 'large',
223
+ large: ((_theme$dataChart2 = theme.dataChart) == null || (_theme$dataChart2 = _theme$dataChart2.thicknessPad) == null ? void 0 : _theme$dataChart2.large) || 'medium',
224
+ medium: ((_theme$dataChart3 = theme.dataChart) == null || (_theme$dataChart3 = _theme$dataChart3.thicknessPad) == null ? void 0 : _theme$dataChart3.medium) || 'small',
225
+ small: ((_theme$dataChart4 = theme.dataChart) == null || (_theme$dataChart4 = _theme$dataChart4.thicknessPad) == null ? void 0 : _theme$dataChart4.small) || 'xsmall',
226
+ xsmall: ((_theme$dataChart5 = theme.dataChart) == null || (_theme$dataChart5 = _theme$dataChart5.thicknessPad) == null ? void 0 : _theme$dataChart5.xsmall) || 'xxsmall'
227
+ };
226
228
  var _options = options,
227
229
  thickness = _options.thickness;
228
230
  if (!thickness) {
@@ -231,17 +233,23 @@ export var calcs = function calcs(values, options) {
231
233
  // These values were emirically determined, trying to balance visibility
232
234
  // and overlap across resolutions.
233
235
  if (values.length < 5) {
234
- thickness = 'xlarge';
236
+ var _theme$dataChart6;
237
+ thickness = ((_theme$dataChart6 = theme.dataChart) == null || (_theme$dataChart6 = _theme$dataChart6.thickness) == null ? void 0 : _theme$dataChart6.sparse) || 'xlarge';
235
238
  } else if (values.length < 11) {
236
- thickness = 'large';
239
+ var _theme$dataChart7;
240
+ thickness = ((_theme$dataChart7 = theme.dataChart) == null || (_theme$dataChart7 = _theme$dataChart7.thickness) == null ? void 0 : _theme$dataChart7.light) || 'large';
237
241
  } else if (values.length < 21) {
238
- thickness = 'medium';
242
+ var _theme$dataChart8;
243
+ thickness = ((_theme$dataChart8 = theme.dataChart) == null || (_theme$dataChart8 = _theme$dataChart8.thickness) == null ? void 0 : _theme$dataChart8.moderate) || 'medium';
239
244
  } else if (values.length < 61) {
240
- thickness = 'small';
245
+ var _theme$dataChart9;
246
+ thickness = ((_theme$dataChart9 = theme.dataChart) == null || (_theme$dataChart9 = _theme$dataChart9.thickness) == null ? void 0 : _theme$dataChart9.heavy) || 'small';
241
247
  } else if (values.length < 121) {
242
- thickness = 'xsmall';
248
+ var _theme$dataChart0;
249
+ thickness = ((_theme$dataChart0 = theme.dataChart) == null || (_theme$dataChart0 = _theme$dataChart0.thickness) == null ? void 0 : _theme$dataChart0.dense) || 'xsmall';
243
250
  } else {
244
- thickness = 'hair';
251
+ var _theme$dataChart1;
252
+ thickness = ((_theme$dataChart1 = theme.dataChart) == null || (_theme$dataChart1 = _theme$dataChart1.thickness) == null ? void 0 : _theme$dataChart1.veryDense) || 'hair';
245
253
  }
246
254
  }
247
255
  var pad = thicknessPad[thickness];
@@ -134,7 +134,7 @@ var CheckBox = /*#__PURE__*/forwardRef(function (_ref, ref) {
134
134
  var checkBoxNode = /*#__PURE__*/React.createElement(StyledCheckBox, _extends({
135
135
  align: "center",
136
136
  justify: "center",
137
- margin: label && (_ref2 = {}, _ref2[side] = theme.checkBox.gap || 'small', _ref2)
137
+ margin: label && (_ref2 = {}, _ref2[side] = theme.checkBox.gap, _ref2)
138
138
  }, themeableProps), /*#__PURE__*/React.createElement(StyledCheckBoxInput, _extends({
139
139
  "aria-label": ariaLabel || a11yTitle
140
140
  }, passThemeFlag, rest, {
@@ -1,4 +1,4 @@
1
- var _excluded = ["children", "defaultValue", "value", "disabled", "focusIndicator", "gap", "labelKey", "valueKey", "onChange", "options", "name"],
1
+ var _excluded = ["aria-label", "aria-labelledby", "children", "defaultValue", "value", "disabled", "focusIndicator", "gap", "id", "labelKey", "valueKey", "onChange", "options", "name"],
2
2
  _excluded2 = ["value"];
3
3
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
4
4
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
@@ -9,13 +9,17 @@ import { StyledCheckBoxGroup } from './StyledCheckBoxGroup';
9
9
  import { CheckBoxGroupPropTypes } from './propTypes';
10
10
  import { useThemeValue } from '../../utils/useThemeValue';
11
11
  var CheckBoxGroup = /*#__PURE__*/forwardRef(function (_ref, ref) {
12
- var children = _ref.children,
12
+ var _formContext$useFormF, _theme$checkBoxGroup;
13
+ var ariaLabelProp = _ref['aria-label'],
14
+ ariaLabelledByProp = _ref['aria-labelledby'],
15
+ children = _ref.children,
13
16
  defaultValue = _ref.defaultValue,
14
17
  valueProp = _ref.value,
15
18
  disabledProp = _ref.disabled,
16
19
  _ref$focusIndicator = _ref.focusIndicator,
17
20
  focusIndicator = _ref$focusIndicator === void 0 ? true : _ref$focusIndicator,
18
21
  gap = _ref.gap,
22
+ id = _ref.id,
19
23
  labelKey = _ref.labelKey,
20
24
  valueKey = _ref.valueKey,
21
25
  onChange = _ref.onChange,
@@ -63,11 +67,18 @@ var CheckBoxGroup = /*#__PURE__*/forwardRef(function (_ref, ref) {
63
67
  onChange(adjustedEvent);
64
68
  }
65
69
  };
70
+ var ariaLabelledBy;
71
+ if (formContext != null && (_formContext$useFormF = formContext.useFormField({})) != null && _formContext$useFormF.inForm && id && !ariaLabelProp) {
72
+ ariaLabelledBy = "grommet-" + id + "__label";
73
+ }
66
74
  return /*#__PURE__*/React.createElement(StyledCheckBoxGroup, _extends({
67
75
  ref: ref,
76
+ "aria-label": ariaLabelProp,
77
+ "aria-labelledby": ariaLabelledByProp || ariaLabelledBy,
68
78
  role: "group"
69
79
  }, theme.checkBoxGroup.container, {
70
- gap: gap || (theme.checkBoxGroup.container && theme.checkBoxGroup.container.gap ? theme.checkBoxGroup.container.gap : 'small') // consistent with RadioButtonGroup default
80
+ gap: gap || ((_theme$checkBoxGroup = theme.checkBoxGroup) == null || (_theme$checkBoxGroup = _theme$checkBoxGroup.container) == null ? void 0 : _theme$checkBoxGroup.gap),
81
+ id: id
71
82
  }, passThemeFlag, rest), options.map(function (option, index) {
72
83
  var optionValue = option.value;
73
84
  var label = labelKey ? option[labelKey] : option.label;
@@ -13,6 +13,7 @@ import { DataContext } from '../../contexts/DataContext';
13
13
  import { DataPropTypes } from './propTypes';
14
14
  import { MessageContext } from '../../contexts/MessageContext';
15
15
  import { filter } from './filter';
16
+ import { useThemeValue } from '../../utils/useThemeValue';
16
17
  var defaultDefaultView = {
17
18
  search: ''
18
19
  };
@@ -69,6 +70,8 @@ export var Data = function Data(_ref) {
69
70
  var announce = useContext(AnnounceContext);
70
71
  var _useContext = useContext(MessageContext),
71
72
  format = _useContext.format;
73
+ var _useThemeValue = useThemeValue(),
74
+ theme = _useThemeValue.theme;
72
75
  // Announce to screen readers when search or filters are
73
76
  // applied and affect the underlying result set
74
77
  useEffect(function () {
@@ -139,9 +142,10 @@ export var Data = function Data(_ref) {
139
142
  }, [id, messages, filtersCleared, onView, properties, result, selected, toolbarKeys, view, views]);
140
143
  var toolbarContent;
141
144
  if (toolbar) {
145
+ var _theme$data;
142
146
  toolbarContent = [/*#__PURE__*/React.createElement(Toolbar, {
143
147
  key: "toolbar",
144
- gap: "medium"
148
+ gap: (_theme$data = theme.data) == null || (_theme$data = _theme$data.toolbar) == null ? void 0 : _theme$data.gap
145
149
  }, /*#__PURE__*/React.createElement(Toolbar, null, (toolbar === true || toolbar === 'search') && /*#__PURE__*/React.createElement(DataSearch, null), (toolbar === true || toolbar === 'filters') && /*#__PURE__*/React.createElement(DataFilters, {
146
150
  layer: true
147
151
  })), (toolbar === true || toolbar === 'view') && /*#__PURE__*/React.createElement(DataView, null)), /*#__PURE__*/React.createElement(DataSummary, {
@@ -11,6 +11,7 @@ import { DataContext } from '../../contexts/DataContext';
11
11
  import { DataFormContext } from '../../contexts/DataFormContext';
12
12
  import { MessageContext } from '../../contexts/MessageContext';
13
13
  import { useDebounce } from '../../utils/use-debounce';
14
+ import { useThemeValue } from '../../utils/useThemeValue';
14
15
  var MaxForm = styled(Form).withConfig({
15
16
  displayName: "DataForm__MaxForm",
16
17
  componentId: "sc-v64e1r-0"
@@ -235,6 +236,8 @@ export var DataForm = function DataForm(_ref) {
235
236
  };
236
237
  }, []);
237
238
  var debounce = useDebounce(DEBOUNCE_TIMEOUT);
239
+ var _useThemeValue = useThemeValue(),
240
+ theme = _useThemeValue.theme;
238
241
  var onSubmit = useCallback(function (_ref2) {
239
242
  var value = _ref2.value;
240
243
  var nextValue = normalizeValue(value, formValue, views, pendingReset);
@@ -266,6 +269,7 @@ export var DataForm = function DataForm(_ref) {
266
269
  }, [view]);
267
270
  var content = children;
268
271
  if (footer !== false && updateOn === 'submit' || pad) {
272
+ var _theme$dataFilters, _theme$dataFilters2;
269
273
  content = /*#__PURE__*/React.createElement(Box, {
270
274
  fill: "vertical"
271
275
  }, /*#__PURE__*/React.createElement(Box, {
@@ -279,14 +283,12 @@ export var DataForm = function DataForm(_ref) {
279
283
  flex: false
280
284
  }, content)), footer !== false && updateOn === 'submit' && /*#__PURE__*/React.createElement(Footer, {
281
285
  flex: false,
282
- margin: {
283
- top: 'medium'
284
- },
285
286
  pad: {
286
287
  horizontal: pad,
287
288
  bottom: pad
288
289
  },
289
- gap: "small"
290
+ margin: (_theme$dataFilters = theme.dataFilters) == null || (_theme$dataFilters = _theme$dataFilters.footer) == null || (_theme$dataFilters = _theme$dataFilters.actions) == null ? void 0 : _theme$dataFilters.margin,
291
+ gap: (_theme$dataFilters2 = theme.dataFilters) == null || (_theme$dataFilters2 = _theme$dataFilters2.footer) == null || (_theme$dataFilters2 = _theme$dataFilters2.actions) == null ? void 0 : _theme$dataFilters2.gap
290
292
  }, /*#__PURE__*/React.createElement(Button, {
291
293
  label: format({
292
294
  id: 'dataForm.submit',
@@ -102,8 +102,11 @@ export interface DataProps {
102
102
  dataTableColumns?: {
103
103
  open?: string;
104
104
  order?: string;
105
+ pinned?: string;
105
106
  select?: string;
106
107
  tip?: string;
108
+ orderAria?: string;
109
+ selectAria?: string;
107
110
  };
108
111
  dataTableGroupBy?: {
109
112
  clear?: string;
@@ -51,8 +51,11 @@ if (process.env.NODE_ENV !== 'production') {
51
51
  dataTableColumns: PropTypes.shape({
52
52
  open: PropTypes.string,
53
53
  order: PropTypes.string,
54
+ pinned: PropTypes.string,
54
55
  select: PropTypes.string,
55
- tip: PropTypes.string
56
+ tip: PropTypes.string,
57
+ selectAria: PropTypes.string,
58
+ orderAria: PropTypes.string
56
59
  }),
57
60
  dataTableGroupBy: PropTypes.shape({
58
61
  clear: PropTypes.string,
@@ -1,4 +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 e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(typeof e + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
1
+ function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
2
+ function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
2
3
  function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
3
4
  function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
4
5
  import React, { useEffect, useState } from 'react';
@@ -30,11 +31,11 @@ var buildQuery = function buildQuery(view) {
30
31
  return query;
31
32
  };
32
33
  var fetchLaunches = /*#__PURE__*/function () {
33
- var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(view) {
34
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(view) {
34
35
  var _view$sort, _view$sort2, _sort;
35
36
  var query, sort, body;
36
- return _regeneratorRuntime().wrap(function _callee$(_context) {
37
- while (1) switch (_context.prev = _context.next) {
37
+ return _regenerator().w(function (_context) {
38
+ while (1) switch (_context.n) {
38
39
  case 0:
39
40
  query = buildQuery(view);
40
41
  sort = (_sort = {}, _sort[(view == null || (_view$sort = view.sort) == null ? void 0 : _view$sort.property) || 'name'] = (view == null || (_view$sort2 = view.sort) == null ? void 0 : _view$sort2.direction) || 'asc', _sort);
@@ -52,7 +53,7 @@ var fetchLaunches = /*#__PURE__*/function () {
52
53
  },
53
54
  query: query
54
55
  };
55
- return _context.abrupt("return", fetch('https://api.spacexdata.com/v4/launches/query', {
56
+ return _context.a(2, fetch('https://api.spacexdata.com/v4/launches/query', {
56
57
  method: 'POST',
57
58
  headers: {
58
59
  'Content-Type': 'application/json'
@@ -61,9 +62,6 @@ var fetchLaunches = /*#__PURE__*/function () {
61
62
  }).then(function (response) {
62
63
  return response.json();
63
64
  }));
64
- case 4:
65
- case "end":
66
- return _context.stop();
67
65
  }
68
66
  }, _callee);
69
67
  }));
@@ -72,10 +70,10 @@ var fetchLaunches = /*#__PURE__*/function () {
72
70
  };
73
71
  }();
74
72
  var fetchRockets = /*#__PURE__*/function () {
75
- var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
73
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
76
74
  var body;
77
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
78
- while (1) switch (_context2.prev = _context2.next) {
75
+ return _regenerator().w(function (_context2) {
76
+ while (1) switch (_context2.n) {
79
77
  case 0:
80
78
  body = {
81
79
  options: {
@@ -85,7 +83,7 @@ var fetchRockets = /*#__PURE__*/function () {
85
83
  select: ['name', 'id']
86
84
  }
87
85
  };
88
- return _context2.abrupt("return", fetch('https://api.spacexdata.com/v4/rockets/query', {
86
+ return _context2.a(2, fetch('https://api.spacexdata.com/v4/rockets/query', {
89
87
  method: 'POST',
90
88
  headers: {
91
89
  'Content-Type': 'application/json'
@@ -94,9 +92,6 @@ var fetchRockets = /*#__PURE__*/function () {
94
92
  }).then(function (response) {
95
93
  return response.json();
96
94
  }));
97
- case 2:
98
- case "end":
99
- return _context2.stop();
100
95
  }
101
96
  }, _callee2);
102
97
  }));