grommet 2.24.0 → 2.25.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 (429) 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 +1 -1
  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 +1 -1
  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/Card/Card.js +1 -1
  22. package/components/Card/stories/CustomThemed/Clickable.js +1 -1
  23. package/components/Card/stories/CustomThemed/RichFooter.js +1 -1
  24. package/components/Card/stories/CustomThemed/Themed.js +1 -1
  25. package/components/CardBody/CardBody.js +1 -1
  26. package/components/CardFooter/CardFooter.js +1 -1
  27. package/components/CardHeader/CardHeader.js +1 -1
  28. package/components/Carousel/Carousel.js +1 -1
  29. package/components/Carousel/propTypes.js +1 -1
  30. package/components/Carousel/stories/CustomThemed/Custom.js +1 -1
  31. package/components/Chart/Chart.js +1 -1
  32. package/components/Chart/index.d.ts +28 -2
  33. package/components/Chart/propTypes.js +1 -1
  34. package/components/Chart/stories/Rich.js +1 -1
  35. package/components/Chart/stories/Window.js +1 -1
  36. package/components/CheckBox/CheckBox.js +1 -1
  37. package/components/CheckBox/stories/CustomThemed/Custom.js +1 -1
  38. package/components/CheckBox/stories/CustomThemed/CustomToggle.js +1 -1
  39. package/components/CheckBox/stories/NoLabel.js +1 -1
  40. package/components/CheckBox/stories/Simple.js +1 -1
  41. package/components/CheckBoxGroup/CheckBoxGroup.js +1 -1
  42. package/components/Clock/Analog.js +1 -1
  43. package/components/Clock/Clock.js +1 -1
  44. package/components/Clock/Digital.js +1 -1
  45. package/components/Clock/propTypes.js +1 -1
  46. package/components/Collapsible/stories/Nested.js +1 -1
  47. package/components/Collapsible/stories/Simple.js +1 -1
  48. package/components/DataChart/DataChart.js +9 -28
  49. package/components/DataChart/Legend.js +1 -1
  50. package/components/DataChart/Swatch.js +64 -23
  51. package/components/DataChart/XAxis.js +1 -1
  52. package/components/DataChart/YGuide.js +1 -1
  53. package/components/DataChart/propTypes.js +1 -1
  54. package/components/DataChart/stories/Legend.js +6 -2
  55. package/components/DataChart/utils.js +11 -1
  56. package/components/DataTable/Body.js +11 -5
  57. package/components/DataTable/Cell.js +1 -1
  58. package/components/DataTable/DataTable.js +1 -1
  59. package/components/DataTable/ExpanderCell.js +1 -1
  60. package/components/DataTable/Footer.js +1 -1
  61. package/components/DataTable/GroupedBody.js +1 -1
  62. package/components/DataTable/Header.js +1 -1
  63. package/components/DataTable/Resizer.js +1 -1
  64. package/components/DataTable/Sorter.js +1 -1
  65. package/components/DataTable/propTypes.js +1 -1
  66. package/components/DataTable/stories/Controlled.js +1 -1
  67. package/components/DataTable/stories/ControlledGrouped.js +1 -1
  68. package/components/DataTable/stories/CustomThemed/Fill.js +1 -1
  69. package/components/DataTable/stories/GroupedOnSelect.js +1 -1
  70. package/components/DataTable/stories/OnUpdate.js +1 -1
  71. package/components/DataTable/stories/Served.js +1 -1
  72. package/components/DataTable/stories/Sort.js +1 -1
  73. package/components/DataTable/stories/Tunable.js +1 -1
  74. package/components/DataTable/stories/data.js +1 -1
  75. package/components/DataTable/stories/rowDetails.js +1 -1
  76. package/components/DateInput/DateInput.js +29 -24
  77. package/components/DateInput/index.d.ts +1 -0
  78. package/components/DateInput/propTypes.js +1 -0
  79. package/components/DateInput/stories/Format.js +14 -1
  80. package/components/DateInput/utils.js +1 -1
  81. package/components/Diagram/Diagram.js +1 -1
  82. package/components/Diagram/stories/Animated.js +1 -1
  83. package/components/Diagram/stories/Progressing.js +1 -1
  84. package/components/Distribution/Distribution.js +1 -1
  85. package/components/Distribution/propTypes.js +1 -1
  86. package/components/Drop/Drop.js +1 -1
  87. package/components/Drop/DropContainer.js +1 -1
  88. package/components/DropButton/DropButton.js +1 -1
  89. package/components/DropButton/propTypes.js +1 -1
  90. package/components/FileInput/FileInput.js +26 -8
  91. package/components/FileInput/stories/Multiple.js +1 -0
  92. package/components/FocusedContainer.js +1 -1
  93. package/components/Footer/Footer.js +1 -1
  94. package/components/Footer/stories/DoubleFooter.js +1 -1
  95. package/components/Footer/stories/Sitemap.js +1 -1
  96. package/components/Form/Form.js +1 -1
  97. package/components/Form/stories/ArrayOfFormFields.js +1 -1
  98. package/components/Form/stories/CustomThemed/FieldSpacingOptions.js +1 -1
  99. package/components/FormField/FormField.js +1 -1
  100. package/components/Grid/Grid.js +5 -3
  101. package/components/Grid/README.md +0 -2
  102. package/components/Grid/index.d.ts +4 -2
  103. package/components/Grid/propTypes.js +1 -1
  104. package/components/Grid/stories/CustomThemed/Responsive.js +1 -1
  105. package/components/Grid/stories/typescript/App.tsx +42 -48
  106. package/components/Grommet/Grommet.js +1 -1
  107. package/components/Header/Header.js +1 -1
  108. package/components/Heading/Heading.js +1 -1
  109. package/components/Heading/propTypes.js +1 -1
  110. package/components/Image/Image.js +1 -1
  111. package/components/Image/propTypes.js +1 -1
  112. package/components/InfiniteScroll/stories/Basics.js +1 -1
  113. package/components/InfiniteScroll/stories/ClassChildren.js +1 -1
  114. package/components/InfiniteScroll/stories/Marker.js +1 -1
  115. package/components/InfiniteScroll/stories/Show.js +1 -1
  116. package/components/InfiniteScroll/stories/ShowAfter.js +1 -1
  117. package/components/InfiniteScroll/stories/ShowBefore.js +1 -1
  118. package/components/Layer/Layer.js +1 -1
  119. package/components/Layer/LayerContainer.js +1 -1
  120. package/components/List/List.js +1 -1
  121. package/components/List/propTypes.js +1 -1
  122. package/components/Main/Main.js +1 -1
  123. package/components/Markdown/Markdown.js +1 -1
  124. package/components/MaskedInput/MaskedInput.js +37 -28
  125. package/components/Menu/Menu.js +105 -61
  126. package/components/Menu/index.d.ts +2 -2
  127. package/components/Menu/propTypes.js +2 -2
  128. package/components/Menu/stories/Grouped.js +52 -0
  129. package/components/Meter/Bar.js +1 -1
  130. package/components/Meter/Circle.js +5 -3
  131. package/components/Meter/Meter.js +1 -1
  132. package/components/Meter/propTypes.js +1 -1
  133. package/components/NameValueList/NameValueList.js +1 -1
  134. package/components/NameValuePair/NameValuePair.js +1 -1
  135. package/components/Nav/Nav.js +1 -1
  136. package/components/Nav/stories/CustomThemed/JustifySidebar.js +1 -1
  137. package/components/Nav/stories/Sidebar.js +1 -1
  138. package/components/Notification/Notification.js +1 -1
  139. package/components/Notification/index.d.ts +1 -1
  140. package/components/Notification/propTypes.js +1 -1
  141. package/components/Page/Page.js +1 -1
  142. package/components/PageContent/PageContent.js +1 -1
  143. package/components/PageHeader/PageHeader.js +1 -1
  144. package/components/PageHeader/propTypes.js +1 -1
  145. package/components/Pagination/PageControl.js +1 -1
  146. package/components/Pagination/Pagination.js +1 -1
  147. package/components/Pagination/propTypes.js +1 -1
  148. package/components/Paragraph/Paragraph.js +1 -1
  149. package/components/Paragraph/StyledParagraph.js +7 -1
  150. package/components/Paragraph/index.d.ts +1 -0
  151. package/components/Paragraph/propTypes.js +2 -1
  152. package/components/Paragraph/stories/MaxLines.js +37 -0
  153. package/components/RadioButton/RadioButton.js +1 -1
  154. package/components/RadioButtonGroup/RadioButtonGroup.js +1 -1
  155. package/components/RadioButtonGroup/stories/CustomThemed/CustomTheme.js +1 -1
  156. package/components/RadioButtonGroup/stories/Disabled.js +1 -1
  157. package/components/RangeInput/RangeInput.js +1 -1
  158. package/components/RangeSelector/EdgeControl.js +1 -1
  159. package/components/RangeSelector/RangeSelector.js +1 -1
  160. package/components/RangeSelector/stories/CustomThemed/Custom.js +1 -1
  161. package/components/RangeSelector/stories/CustomThemed/CustomEdgeControl.js +1 -1
  162. package/components/RangeSelector/stories/Step.js +1 -1
  163. package/components/RangeSelector/stories/Vertical.js +1 -1
  164. package/components/RoutedAnchor/RoutedAnchor.js +2 -2
  165. package/components/RoutedButton/RoutedButton.js +2 -2
  166. package/components/Select/Select.js +11 -30
  167. package/components/Select/SelectContainer.js +1 -1
  168. package/components/Select/propTypes.js +1 -1
  169. package/components/Select/stories/components/SearchBorderBox.js +1 -1
  170. package/components/Select/stories/components/SearchInput.js +1 -1
  171. package/components/Sidebar/Sidebar.js +1 -1
  172. package/components/Sidebar/stories/Labels.js +1 -1
  173. package/components/SkipLink/SkipLink.js +1 -1
  174. package/components/SkipLinkTarget/SkipLinkTarget.js +1 -1
  175. package/components/Spinner/Spinner.js +1 -1
  176. package/components/Stack/Stack.js +1 -1
  177. package/components/Stack/propTypes.js +1 -1
  178. package/components/Tab/StyledTab.js +2 -2
  179. package/components/Tab/Tab.js +35 -17
  180. package/components/Table/propTypes.js +1 -1
  181. package/components/TableBody/TableBody.js +1 -1
  182. package/components/TableCell/TableCell.js +1 -1
  183. package/components/TableFooter/TableFooter.js +1 -1
  184. package/components/TableHeader/TableHeader.js +1 -1
  185. package/components/TableRow/TableRow.js +1 -1
  186. package/components/Tabs/Tabs.js +231 -10
  187. package/components/Tabs/propTypes.js +1 -1
  188. package/components/Tabs/stories/Responsive.js +18 -0
  189. package/components/Tag/Tag.js +1 -1
  190. package/components/Tag/propTypes.js +1 -1
  191. package/components/Text/Text.js +1 -1
  192. package/components/Text/propTypes.js +1 -1
  193. package/components/TextArea/TextArea.js +1 -1
  194. package/components/TextArea/stories/NonResizable.js +1 -1
  195. package/components/TextArea/stories/Simple.js +1 -1
  196. package/components/TextInput/TextInput.js +1 -1
  197. package/components/TextInput/stories/InsideFormField.js +1 -1
  198. package/components/TextInput/stories/WithTags.js +1 -1
  199. package/components/Tip/Tip.js +4 -23
  200. package/components/Video/Video.js +1 -1
  201. package/components/Video/propTypes.js +1 -1
  202. package/components/WorldMap/WorldMap.js +1 -1
  203. package/components/WorldMap/propTypes.js +1 -1
  204. package/components/WorldMap/stories/Places.js +1 -1
  205. package/contexts/AnnounceContext/stories/Assertive.js +1 -1
  206. package/contexts/ResponsiveContext/stories/ResponsiveGrid.js +1 -1
  207. package/es6/all/stories/AllComponents.js +2 -7
  208. package/es6/components/Accordion/Accordion.js +1 -1
  209. package/es6/components/Accordion/propTypes.js +1 -1
  210. package/es6/components/Accordion/stories/CustomThemed/Custom.js +3 -2
  211. package/es6/components/AccordionPanel/AccordionPanel.js +2 -1
  212. package/es6/components/Anchor/Anchor.js +1 -1
  213. package/es6/components/Anchor/propTypes.js +1 -1
  214. package/es6/components/Avatar/Avatar.js +1 -1
  215. package/es6/components/Box/Box.js +1 -1
  216. package/es6/components/Box/StyledBox.js +1 -1
  217. package/es6/components/Box/propTypes.js +1 -1
  218. package/es6/components/Button/Button.js +1 -1
  219. package/es6/components/Button/propTypes.js +2 -2
  220. package/es6/components/Button/stories/Basic.js +1 -1
  221. package/es6/components/Button/stories/Fill.js +1 -1
  222. package/es6/components/Button/stories/Kind.js +1 -1
  223. package/es6/components/Calendar/Calendar.js +1 -1
  224. package/es6/components/Calendar/index.d.ts +2 -2
  225. package/es6/components/Calendar/propTypes.js +1 -1
  226. package/es6/components/Calendar/stories/ShowAdjacentDays.js +1 -1
  227. package/es6/components/Card/Card.js +1 -1
  228. package/es6/components/Card/stories/CustomThemed/Clickable.js +1 -1
  229. package/es6/components/Card/stories/CustomThemed/RichFooter.js +1 -1
  230. package/es6/components/Card/stories/CustomThemed/Themed.js +1 -1
  231. package/es6/components/CardBody/CardBody.js +1 -1
  232. package/es6/components/CardFooter/CardFooter.js +1 -1
  233. package/es6/components/CardHeader/CardHeader.js +1 -1
  234. package/es6/components/Carousel/Carousel.js +1 -1
  235. package/es6/components/Carousel/propTypes.js +1 -1
  236. package/es6/components/Carousel/stories/CustomThemed/Custom.js +1 -1
  237. package/es6/components/Chart/Chart.js +1 -1
  238. package/es6/components/Chart/index.d.ts +28 -2
  239. package/es6/components/Chart/propTypes.js +1 -1
  240. package/es6/components/Chart/stories/Rich.js +1 -1
  241. package/es6/components/Chart/stories/Window.js +1 -1
  242. package/es6/components/CheckBox/CheckBox.js +1 -1
  243. package/es6/components/CheckBox/stories/CustomThemed/Custom.js +1 -1
  244. package/es6/components/CheckBox/stories/CustomThemed/CustomToggle.js +1 -1
  245. package/es6/components/CheckBox/stories/NoLabel.js +1 -1
  246. package/es6/components/CheckBox/stories/Simple.js +1 -1
  247. package/es6/components/CheckBoxGroup/CheckBoxGroup.js +1 -1
  248. package/es6/components/Clock/Analog.js +1 -1
  249. package/es6/components/Clock/Clock.js +1 -1
  250. package/es6/components/Clock/Digital.js +1 -1
  251. package/es6/components/Clock/propTypes.js +1 -1
  252. package/es6/components/Collapsible/stories/Nested.js +1 -1
  253. package/es6/components/Collapsible/stories/Simple.js +1 -1
  254. package/es6/components/DataChart/DataChart.js +10 -30
  255. package/es6/components/DataChart/Legend.js +1 -1
  256. package/es6/components/DataChart/Swatch.js +64 -23
  257. package/es6/components/DataChart/XAxis.js +1 -1
  258. package/es6/components/DataChart/YGuide.js +1 -1
  259. package/es6/components/DataChart/propTypes.js +1 -1
  260. package/es6/components/DataChart/stories/Legend.js +6 -2
  261. package/es6/components/DataChart/utils.js +7 -0
  262. package/es6/components/DataTable/Body.js +10 -5
  263. package/es6/components/DataTable/Cell.js +1 -1
  264. package/es6/components/DataTable/DataTable.js +1 -1
  265. package/es6/components/DataTable/ExpanderCell.js +1 -1
  266. package/es6/components/DataTable/Footer.js +1 -1
  267. package/es6/components/DataTable/GroupedBody.js +1 -1
  268. package/es6/components/DataTable/Header.js +1 -1
  269. package/es6/components/DataTable/Resizer.js +1 -1
  270. package/es6/components/DataTable/Sorter.js +1 -1
  271. package/es6/components/DataTable/propTypes.js +1 -1
  272. package/es6/components/DataTable/stories/Controlled.js +1 -1
  273. package/es6/components/DataTable/stories/ControlledGrouped.js +1 -1
  274. package/es6/components/DataTable/stories/CustomThemed/Fill.js +1 -1
  275. package/es6/components/DataTable/stories/GroupedOnSelect.js +1 -1
  276. package/es6/components/DataTable/stories/OnUpdate.js +1 -1
  277. package/es6/components/DataTable/stories/Served.js +1 -1
  278. package/es6/components/DataTable/stories/Sort.js +1 -1
  279. package/es6/components/DataTable/stories/Tunable.js +1 -1
  280. package/es6/components/DataTable/stories/data.js +1 -1
  281. package/es6/components/DataTable/stories/rowDetails.js +1 -1
  282. package/es6/components/DateInput/DateInput.js +28 -24
  283. package/es6/components/DateInput/index.d.ts +1 -0
  284. package/es6/components/DateInput/propTypes.js +1 -0
  285. package/es6/components/DateInput/stories/Format.js +14 -1
  286. package/es6/components/DateInput/utils.js +1 -1
  287. package/es6/components/Diagram/Diagram.js +1 -1
  288. package/es6/components/Diagram/stories/Animated.js +1 -1
  289. package/es6/components/Diagram/stories/Progressing.js +1 -1
  290. package/es6/components/Distribution/Distribution.js +1 -1
  291. package/es6/components/Distribution/propTypes.js +1 -1
  292. package/es6/components/Drop/Drop.js +1 -1
  293. package/es6/components/Drop/DropContainer.js +1 -1
  294. package/es6/components/DropButton/DropButton.js +1 -1
  295. package/es6/components/DropButton/propTypes.js +1 -1
  296. package/es6/components/FileInput/FileInput.js +26 -8
  297. package/es6/components/FileInput/stories/Multiple.js +1 -0
  298. package/es6/components/FocusedContainer.js +1 -1
  299. package/es6/components/Footer/Footer.js +1 -1
  300. package/es6/components/Footer/stories/DoubleFooter.js +1 -1
  301. package/es6/components/Footer/stories/Sitemap.js +1 -1
  302. package/es6/components/Form/Form.js +1 -1
  303. package/es6/components/Form/stories/ArrayOfFormFields.js +1 -1
  304. package/es6/components/Form/stories/CustomThemed/FieldSpacingOptions.js +1 -1
  305. package/es6/components/FormField/FormField.js +1 -1
  306. package/es6/components/Grid/Grid.js +5 -3
  307. package/es6/components/Grid/README.md +0 -2
  308. package/es6/components/Grid/index.d.ts +4 -2
  309. package/es6/components/Grid/propTypes.js +1 -1
  310. package/es6/components/Grid/stories/CustomThemed/Responsive.js +1 -1
  311. package/es6/components/Grid/stories/typescript/App.tsx +42 -48
  312. package/es6/components/Grommet/Grommet.js +1 -1
  313. package/es6/components/Header/Header.js +1 -1
  314. package/es6/components/Heading/Heading.js +1 -1
  315. package/es6/components/Heading/propTypes.js +1 -1
  316. package/es6/components/Image/Image.js +1 -1
  317. package/es6/components/Image/propTypes.js +1 -1
  318. package/es6/components/InfiniteScroll/stories/Basics.js +1 -1
  319. package/es6/components/InfiniteScroll/stories/ClassChildren.js +1 -1
  320. package/es6/components/InfiniteScroll/stories/Marker.js +1 -1
  321. package/es6/components/InfiniteScroll/stories/Show.js +1 -1
  322. package/es6/components/InfiniteScroll/stories/ShowAfter.js +1 -1
  323. package/es6/components/InfiniteScroll/stories/ShowBefore.js +1 -1
  324. package/es6/components/Layer/Layer.js +1 -1
  325. package/es6/components/Layer/LayerContainer.js +1 -1
  326. package/es6/components/List/List.js +1 -1
  327. package/es6/components/List/propTypes.js +1 -1
  328. package/es6/components/Main/Main.js +1 -1
  329. package/es6/components/Markdown/Markdown.js +1 -1
  330. package/es6/components/MaskedInput/MaskedInput.js +38 -29
  331. package/es6/components/Menu/Menu.js +106 -61
  332. package/es6/components/Menu/index.d.ts +2 -2
  333. package/es6/components/Menu/propTypes.js +2 -2
  334. package/es6/components/Menu/stories/Grouped.js +40 -0
  335. package/es6/components/Meter/Bar.js +1 -1
  336. package/es6/components/Meter/Circle.js +5 -3
  337. package/es6/components/Meter/Meter.js +1 -1
  338. package/es6/components/Meter/propTypes.js +1 -1
  339. package/es6/components/NameValueList/NameValueList.js +1 -1
  340. package/es6/components/NameValuePair/NameValuePair.js +1 -1
  341. package/es6/components/Nav/Nav.js +1 -1
  342. package/es6/components/Nav/stories/CustomThemed/JustifySidebar.js +1 -1
  343. package/es6/components/Nav/stories/Sidebar.js +1 -1
  344. package/es6/components/Notification/Notification.js +1 -1
  345. package/es6/components/Notification/index.d.ts +1 -1
  346. package/es6/components/Notification/propTypes.js +1 -1
  347. package/es6/components/Page/Page.js +1 -1
  348. package/es6/components/PageContent/PageContent.js +1 -1
  349. package/es6/components/PageHeader/PageHeader.js +1 -1
  350. package/es6/components/PageHeader/propTypes.js +1 -1
  351. package/es6/components/Pagination/PageControl.js +1 -1
  352. package/es6/components/Pagination/Pagination.js +1 -1
  353. package/es6/components/Pagination/propTypes.js +1 -1
  354. package/es6/components/Paragraph/Paragraph.js +1 -1
  355. package/es6/components/Paragraph/StyledParagraph.js +8 -1
  356. package/es6/components/Paragraph/index.d.ts +1 -0
  357. package/es6/components/Paragraph/propTypes.js +2 -1
  358. package/es6/components/Paragraph/stories/MaxLines.js +24 -0
  359. package/es6/components/RadioButton/RadioButton.js +1 -1
  360. package/es6/components/RadioButtonGroup/RadioButtonGroup.js +1 -1
  361. package/es6/components/RadioButtonGroup/stories/CustomThemed/CustomTheme.js +1 -1
  362. package/es6/components/RadioButtonGroup/stories/Disabled.js +1 -1
  363. package/es6/components/RangeInput/RangeInput.js +1 -1
  364. package/es6/components/RangeSelector/EdgeControl.js +1 -1
  365. package/es6/components/RangeSelector/RangeSelector.js +1 -1
  366. package/es6/components/RangeSelector/stories/CustomThemed/Custom.js +1 -1
  367. package/es6/components/RangeSelector/stories/CustomThemed/CustomEdgeControl.js +1 -1
  368. package/es6/components/RangeSelector/stories/Step.js +1 -1
  369. package/es6/components/RangeSelector/stories/Vertical.js +1 -1
  370. package/es6/components/RoutedAnchor/RoutedAnchor.js +2 -2
  371. package/es6/components/RoutedButton/RoutedButton.js +2 -2
  372. package/es6/components/Select/Select.js +12 -31
  373. package/es6/components/Select/SelectContainer.js +1 -1
  374. package/es6/components/Select/propTypes.js +1 -1
  375. package/es6/components/Select/stories/components/SearchBorderBox.js +1 -1
  376. package/es6/components/Select/stories/components/SearchInput.js +1 -1
  377. package/es6/components/Sidebar/Sidebar.js +1 -1
  378. package/es6/components/Sidebar/stories/Labels.js +1 -1
  379. package/es6/components/SkipLink/SkipLink.js +1 -1
  380. package/es6/components/SkipLinkTarget/SkipLinkTarget.js +1 -1
  381. package/es6/components/Spinner/Spinner.js +1 -1
  382. package/es6/components/Stack/Stack.js +1 -1
  383. package/es6/components/Stack/propTypes.js +1 -1
  384. package/es6/components/Tab/StyledTab.js +2 -2
  385. package/es6/components/Tab/Tab.js +35 -18
  386. package/es6/components/Table/propTypes.js +1 -1
  387. package/es6/components/TableBody/TableBody.js +1 -1
  388. package/es6/components/TableCell/TableCell.js +1 -1
  389. package/es6/components/TableFooter/TableFooter.js +1 -1
  390. package/es6/components/TableHeader/TableHeader.js +1 -1
  391. package/es6/components/TableRow/TableRow.js +1 -1
  392. package/es6/components/Tabs/Tabs.js +227 -11
  393. package/es6/components/Tabs/propTypes.js +1 -1
  394. package/es6/components/Tabs/stories/Responsive.js +18 -0
  395. package/es6/components/Tag/Tag.js +1 -1
  396. package/es6/components/Tag/propTypes.js +1 -1
  397. package/es6/components/Text/Text.js +1 -1
  398. package/es6/components/Text/propTypes.js +1 -1
  399. package/es6/components/TextArea/TextArea.js +1 -1
  400. package/es6/components/TextArea/stories/NonResizable.js +1 -1
  401. package/es6/components/TextArea/stories/Simple.js +1 -1
  402. package/es6/components/TextInput/TextInput.js +1 -1
  403. package/es6/components/TextInput/stories/InsideFormField.js +1 -1
  404. package/es6/components/TextInput/stories/WithTags.js +1 -1
  405. package/es6/components/Tip/Tip.js +4 -23
  406. package/es6/components/Video/Video.js +1 -1
  407. package/es6/components/Video/propTypes.js +1 -1
  408. package/es6/components/WorldMap/WorldMap.js +1 -1
  409. package/es6/components/WorldMap/propTypes.js +1 -1
  410. package/es6/components/WorldMap/stories/Places.js +1 -1
  411. package/es6/contexts/AnnounceContext/stories/Assertive.js +1 -1
  412. package/es6/contexts/ResponsiveContext/stories/ResponsiveGrid.js +1 -1
  413. package/es6/index.d.ts +1 -0
  414. package/es6/themes/base.d.ts +14 -0
  415. package/es6/themes/base.js +21 -1
  416. package/es6/utils/index.js +2 -1
  417. package/es6/utils/object.js +1 -1
  418. package/es6/utils/pagination.js +1 -1
  419. package/es6/utils/use-keyboard.js +25 -0
  420. package/grommet.min.js +1 -1
  421. package/grommet.min.js.map +1 -1
  422. package/index.d.ts +1 -0
  423. package/package.json +26 -26
  424. package/themes/base.d.ts +14 -0
  425. package/themes/base.js +21 -1
  426. package/utils/index.js +8 -0
  427. package/utils/object.js +1 -1
  428. package/utils/pagination.js +1 -1
  429. 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 from 'react';
4
4
  import { Box } from '../Box';
@@ -1,6 +1,6 @@
1
1
  var _excluded = ["children", "components", "options", "theme"];
2
2
 
3
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
+ 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); }
4
4
 
5
5
  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; }
6
6
 
@@ -1,10 +1,10 @@
1
1
  var _excluded = ["a11yTitle", "dropHeight", "dropProps", "focus", "focusIndicator", "icon", "id", "mask", "name", "onBlur", "onChange", "onFocus", "onKeyDown", "placeholder", "plain", "reverse", "textAlign", "value"];
2
2
 
3
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
+ 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); }
4
4
 
5
5
  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; }
6
6
 
7
- import React, { forwardRef, useCallback, useContext, useEffect, useRef, useState } from 'react';
7
+ import React, { forwardRef, useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';
8
8
  import styled, { ThemeContext } from 'styled-components';
9
9
  import { defaultProps } from '../../default-props';
10
10
  import { Box } from '../Box';
@@ -136,7 +136,7 @@ var defaultMask = [{
136
136
  var ContainerBox = styled(Box).withConfig({
137
137
  displayName: "MaskedInput__ContainerBox",
138
138
  componentId: "sc-af8hzu-0"
139
- })(["", ";@media screen and (-ms-high-contrast:active),(-ms-high-contrast:none){width:100%;}"], function (props) {
139
+ })(["", ";"], function (props) {
140
140
  return props.dropHeight ? sizeStyle('max-height', props.dropHeight, props.theme) : 'max-height: inherit;';
141
141
  });
142
142
  var dropAlign = {
@@ -176,19 +176,15 @@ var MaskedInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
176
176
  value = _formContext$useFormI[0],
177
177
  setValue = _formContext$useFormI[1];
178
178
 
179
- var _useState = useState(parseValue(mask, value)),
180
- valueParts = _useState[0],
181
- setValueParts = _useState[1];
182
-
183
- useEffect(function () {
184
- setValueParts(parseValue(mask, value));
179
+ var valueParts = useMemo(function () {
180
+ return parseValue(mask, value);
185
181
  }, [mask, value]);
186
182
  var inputRef = useForwardedRef(ref);
187
183
  var dropRef = useRef(); // Caller's ref, if provided
188
184
 
189
- var _useState2 = useState(),
190
- dropPropsTarget = _useState2[0],
191
- setDropPropsTarget = _useState2[1];
185
+ var _useState = useState(),
186
+ dropPropsTarget = _useState[0],
187
+ setDropPropsTarget = _useState[1];
192
188
 
193
189
  useEffect(function () {
194
190
  var nextDropPropsTarget; // If caller provided a ref, set to 'pending' until ref.current is defined
@@ -199,21 +195,21 @@ var MaskedInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
199
195
  }
200
196
  }, [dropProps]);
201
197
 
202
- var _useState3 = useState(focusProp),
203
- focus = _useState3[0],
204
- setFocus = _useState3[1];
198
+ var _useState2 = useState(focusProp),
199
+ focus = _useState2[0],
200
+ setFocus = _useState2[1];
201
+
202
+ var _useState3 = useState(),
203
+ activeMaskIndex = _useState3[0],
204
+ setActiveMaskIndex = _useState3[1];
205
205
 
206
206
  var _useState4 = useState(),
207
- activeMaskIndex = _useState4[0],
208
- setActiveMaskIndex = _useState4[1];
207
+ activeOptionIndex = _useState4[0],
208
+ setActiveOptionIndex = _useState4[1];
209
209
 
210
210
  var _useState5 = useState(),
211
- activeOptionIndex = _useState5[0],
212
- setActiveOptionIndex = _useState5[1];
213
-
214
- var _useState6 = useState(),
215
- showDrop = _useState6[0],
216
- setShowDrop = _useState6[1];
211
+ showDrop = _useState5[0],
212
+ setShowDrop = _useState5[1];
217
213
 
218
214
  useEffect(function () {
219
215
  if (focus) {
@@ -267,16 +263,29 @@ var MaskedInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
267
263
  }, [inputRef]); // This could be due to a paste or as the user is typing.
268
264
 
269
265
  var onChangeInput = useCallback(function (event) {
270
- // Align with the mask.
271
- var nextValueParts = parseValue(mask, event.target.value);
266
+ var eventValue = event.target.value; // Align with the mask.
267
+
268
+ var nextValueParts = parseValue(mask, eventValue);
272
269
  var nextValue = nextValueParts.map(function (part) {
273
270
  return part.part;
274
271
  }).join('');
275
272
 
276
- if (nextValue !== event.target.value) {
277
- // The mask required inserting something, change the input.
278
- // This will re-trigger this callback with the next value
279
- setInputValue(nextValue);
273
+ if (nextValue !== eventValue) {
274
+ // The mask adjusted the next value. If something was added,
275
+ // the value must be valid. Change the actual input value
276
+ // to correspond.
277
+ // This will re-trigger this callback with the next value.
278
+ if (nextValue.length > eventValue.length) setInputValue(nextValue); // If the nextValue is shorter, something must be invalid.
279
+ else if (value && eventValue.length < value.length) {
280
+ // If the user is removing characters, preserve what the
281
+ // user is working on.
282
+ setValue(eventValue);
283
+ if (onChange) onChange(event);
284
+ } else {
285
+ // If the user is adding invalid characters, don't allow it.
286
+ // Revert to the prior value.
287
+ setInputValue(value);
288
+ }
280
289
  } else if (value !== nextValue) {
281
290
  setValue(nextValue);
282
291
  if (onChange) onChange(event);
@@ -1,7 +1,7 @@
1
1
  var _excluded = ["a11yTitle", "aria-label", "children", "disabled", "dropAlign", "dropBackground", "dropProps", "dropTarget", "justifyContent", "icon", "items", "label", "messages", "onKeyDown", "open", "plain", "size"],
2
2
  _excluded2 = ["align"];
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
 
@@ -75,13 +75,25 @@ var Menu = /*#__PURE__*/forwardRef(function (props, ref) {
75
75
  themeDropAlign = _theme$menu$drop.align,
76
76
  themeDropProps = _objectWithoutPropertiesLoose(_theme$menu$drop, _excluded2);
77
77
 
78
- var a11y = ariaLabel || a11yTitle;
78
+ var a11y = ariaLabel || a11yTitle; // total number of menu items
79
+
80
+ var itemCount = useMemo(function () {
81
+ var count = 0;
82
+
83
+ if (items && Array.isArray(items[0])) {
84
+ items.forEach(function (group) {
85
+ count += group.length;
86
+ });
87
+ } else count = items.length;
88
+
89
+ return count;
90
+ }, [items]);
79
91
  var align = dropProps && dropProps.align || dropAlign || themeDropAlign;
80
92
  var controlButtonIndex = useMemo(function () {
81
93
  if (align.top === 'top') return -1;
82
- if (align.bottom === 'bottom') return items.length;
94
+ if (align.bottom === 'bottom') return itemCount;
83
95
  return undefined;
84
- }, [align, items]); // Keeps track of whether menu options should be mirrored
96
+ }, [align, itemCount]); // Keeps track of whether menu options should be mirrored
85
97
  // when there's not enough space below DropButton. This state
86
98
  // is modified on /Drop/DropContainer.js.
87
99
 
@@ -157,7 +169,7 @@ var Menu = /*#__PURE__*/forwardRef(function (props, ref) {
157
169
 
158
170
  if (!isOpen) {
159
171
  onDropOpen();
160
- } else if (isTab(event) && (!constants.controlBottom && activeItemIndex === items.length - 1 || constants.controlBottom && activeItemIndex === controlButtonIndex)) {
172
+ } else if (isTab(event) && (!constants.controlBottom && activeItemIndex === itemCount - 1 || constants.controlBottom && activeItemIndex === controlButtonIndex)) {
161
173
  // User has reached end of the menu, this tab will close
162
174
  // the menu drop because there are no more "next items" to access
163
175
  onDropClose();
@@ -168,7 +180,7 @@ var Menu = /*#__PURE__*/forwardRef(function (props, ref) {
168
180
  // In the case the the menu control button is located at the
169
181
  // bottom of the menu, it checks if the user has reached the button.
170
182
  // Otherwise, it checks if the user is at the last menu item.
171
- constants.controlBottom && activeItemIndex === controlButtonIndex || !constants.controlBottom && activeItemIndex === items.length - 1 || activeItemIndex === constants.none) {
183
+ constants.controlBottom && activeItemIndex === controlButtonIndex || !constants.controlBottom && activeItemIndex === itemCount - 1 || activeItemIndex === constants.none) {
172
184
  // place focus on the first menu item
173
185
  index = 0;
174
186
  } else {
@@ -196,12 +208,12 @@ var Menu = /*#__PURE__*/forwardRef(function (props, ref) {
196
208
  var index;
197
209
 
198
210
  if (activeItemIndex === 'none') {
199
- index = items.length - 1;
211
+ index = itemCount - 1;
200
212
  } else if (activeItemIndex - 1 < 0) {
201
213
  if (constants.controlTop && activeItemIndex - 1 === controlButtonIndex) {
202
- index = items.length;
214
+ index = itemCount;
203
215
  } else {
204
- index = items.length - 1;
216
+ index = itemCount - 1;
205
217
  }
206
218
  } else {
207
219
  index = activeItemIndex - 1;
@@ -255,7 +267,7 @@ var Menu = /*#__PURE__*/forwardRef(function (props, ref) {
255
267
  }, /*#__PURE__*/React.createElement(Button, _extends({
256
268
  ref: function ref(r) {
257
269
  // make it accessible at the end of all menu items
258
- buttonRefs.current[items.length] = r;
270
+ buttonRefs.current[itemCount] = r;
259
271
  },
260
272
  a11yTitle: a11y || format({
261
273
  id: 'menu.closeMenu',
@@ -277,6 +289,89 @@ var Menu = /*#__PURE__*/forwardRef(function (props, ref) {
277
289
  drop: true
278
290
  }));
279
291
  } : content));
292
+
293
+ var menuItem = function menuItem(item, index) {
294
+ // Determine whether the label is done as a child or
295
+ // as an option Button kind property.
296
+ var child = !theme.button.option ? /*#__PURE__*/React.createElement(Box, {
297
+ align: "start",
298
+ pad: "small",
299
+ direction: "row",
300
+ gap: item.gap,
301
+ justify: item.justify
302
+ }, item.reverse && item.label, item.icon, !item.reverse && item.label) : undefined; // if we have a child, turn on plain, and hoverIndicator
303
+
304
+ return (
305
+ /*#__PURE__*/
306
+ // eslint-disable-next-line react/no-array-index-key
307
+ React.createElement(Box, {
308
+ key: index,
309
+ flex: false,
310
+ role: "none"
311
+ }, /*#__PURE__*/React.createElement(Button, _extends({
312
+ ref: function ref(r) {
313
+ buttonRefs.current[index] = r;
314
+ },
315
+ role: "menuitem",
316
+ onFocus: function onFocus() {
317
+ setActiveItemIndex(index);
318
+ },
319
+ active: activeItemIndex === index,
320
+ focusIndicator: false,
321
+ plain: !child ? undefined : true,
322
+ align: "start",
323
+ justify: item.justify,
324
+ kind: !child ? 'option' : undefined,
325
+ hoverIndicator: !child ? undefined : 'background'
326
+ }, !child ? item : _extends({}, item, {
327
+ gap: undefined,
328
+ icon: undefined,
329
+ label: undefined,
330
+ reverse: undefined
331
+ }), {
332
+ onClick: function onClick() {
333
+ if (item.onClick) {
334
+ item.onClick.apply(item, arguments);
335
+ }
336
+
337
+ if (item.close !== false) {
338
+ onDropClose();
339
+ }
340
+ }
341
+ }), child))
342
+ );
343
+ };
344
+
345
+ var menuContent;
346
+
347
+ if (itemCount && Array.isArray(items[0])) {
348
+ var index = 0;
349
+ menuContent = items.map(function (group, groupIndex) {
350
+ var _theme$menu$group, _theme$menu$group$sep, _theme$menu$group2, _theme$menu$group2$se, _theme$menu$group3;
351
+
352
+ return /*#__PURE__*/React.createElement(Box // eslint-disable-next-line react/no-array-index-key
353
+ , {
354
+ key: groupIndex
355
+ }, groupIndex > 0 && /*#__PURE__*/React.createElement(Box, {
356
+ pad: theme.menu.group.separator.pad
357
+ }, /*#__PURE__*/React.createElement(Box, {
358
+ border: {
359
+ side: 'top',
360
+ color: (_theme$menu$group = theme.menu.group) == null ? void 0 : (_theme$menu$group$sep = _theme$menu$group.separator) == null ? void 0 : _theme$menu$group$sep.color,
361
+ size: (_theme$menu$group2 = theme.menu.group) == null ? void 0 : (_theme$menu$group2$se = _theme$menu$group2.separator) == null ? void 0 : _theme$menu$group2$se.size
362
+ }
363
+ })), /*#__PURE__*/React.createElement(Box, (_theme$menu$group3 = theme.menu.group) == null ? void 0 : _theme$menu$group3.container, group.map(function (item) {
364
+ // item index needs to be its index in the entire menu as if
365
+ // it were a flat array
366
+ var currentIndex = index;
367
+ index += 1;
368
+ return menuItem(item, currentIndex);
369
+ })));
370
+ });
371
+ } else menuContent = items.map(function (item, index) {
372
+ return menuItem(item, index);
373
+ });
374
+
280
375
  return /*#__PURE__*/React.createElement(Keyboard, {
281
376
  onDown: onDropOpen,
282
377
  onUp: onDropOpen,
@@ -316,57 +411,7 @@ var Menu = /*#__PURE__*/forwardRef(function (props, ref) {
316
411
  overflow: "auto",
317
412
  role: "menu",
318
413
  a11yTitle: a11y
319
- }, items.map(function (item, index) {
320
- // Determine whether the label is done as a child or
321
- // as an option Button kind property.
322
- var child = !theme.button.option ? /*#__PURE__*/React.createElement(Box, {
323
- align: "start",
324
- pad: "small",
325
- direction: "row",
326
- gap: item.gap,
327
- justify: item.justify
328
- }, item.reverse && item.label, item.icon, !item.reverse && item.label) : undefined; // if we have a child, turn on plain, and hoverIndicator
329
-
330
- return (
331
- /*#__PURE__*/
332
- // eslint-disable-next-line react/no-array-index-key
333
- React.createElement(Box, {
334
- key: index,
335
- flex: false,
336
- role: "none"
337
- }, /*#__PURE__*/React.createElement(Button, _extends({
338
- ref: function ref(r) {
339
- buttonRefs.current[index] = r;
340
- },
341
- role: "menuitem",
342
- onFocus: function onFocus() {
343
- setActiveItemIndex(index);
344
- },
345
- active: activeItemIndex === index,
346
- focusIndicator: false,
347
- plain: !child ? undefined : true,
348
- align: "start",
349
- justify: item.justify,
350
- kind: !child ? 'option' : undefined,
351
- hoverIndicator: !child ? undefined : 'background'
352
- }, !child ? item : _extends({}, item, {
353
- gap: undefined,
354
- icon: undefined,
355
- label: undefined,
356
- reverse: undefined
357
- }), {
358
- onClick: function onClick() {
359
- if (item.onClick) {
360
- item.onClick.apply(item, arguments);
361
- }
362
-
363
- if (item.close !== false) {
364
- onDropClose();
365
- }
366
- }
367
- }), child))
368
- );
369
- })), !initialAlignTop && (alignControlMirror === 'bottom' || align.bottom === 'bottom') ? controlMirror : undefined))
414
+ }, menuContent), !initialAlignTop && (alignControlMirror === 'bottom' || align.bottom === 'bottom') ? controlMirror : undefined))
370
415
  }), content));
371
416
  });
372
417
  Menu.defaultProps = {
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { DropProps } from '../Drop';
3
- import { ButtonType } from '../Button';
3
+ import { ButtonProps, ButtonType } from '../Button';
4
4
  import {
5
5
  A11yTitleType,
6
6
  AlignSelfType,
@@ -31,7 +31,7 @@ export interface MenuProps {
31
31
  dropProps?: DropProps;
32
32
  gridArea?: GridAreaType;
33
33
  icon?: boolean | React.ReactNode;
34
- items: object[];
34
+ items: ButtonProps[] | ButtonProps[][];
35
35
  justifyContent?: JustifyContentType;
36
36
  label?: string | React.ReactNode;
37
37
  margin?: MarginType;
@@ -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';
@@ -24,7 +24,7 @@ if (process.env.NODE_ENV !== 'production') {
24
24
  dropProps: PropTypes.object,
25
25
  justifyContent: PropTypes.oneOf(['start', 'center', 'end', 'between', 'around', 'stretch']),
26
26
  icon: PropTypes.oneOfType([PropTypes.bool, PropTypes.node]),
27
- items: PropTypes.arrayOf(PropTypes.object).isRequired,
27
+ items: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.object), PropTypes.arrayOf(PropTypes.arrayOf(PropTypes.object))]).isRequired,
28
28
  label: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
29
29
  messages: PropTypes.shape({
30
30
  closeMenu: PropTypes.string,
@@ -0,0 +1,40 @@
1
+ import React from 'react';
2
+ import { Box, Menu } from 'grommet';
3
+ export var Grouped = function Grouped() {
4
+ return (
5
+ /*#__PURE__*/
6
+ // Uncomment <Grommet> lines when using outside of storybook
7
+ // <Grommet theme={...}>
8
+ React.createElement(Box, {
9
+ align: "center",
10
+ pad: "large"
11
+ }, /*#__PURE__*/React.createElement(Menu, {
12
+ dropProps: {
13
+ align: {
14
+ top: 'bottom',
15
+ left: 'left'
16
+ },
17
+ elevation: 'xlarge'
18
+ },
19
+ label: "Grouped Menu",
20
+ items: [[{
21
+ label: 'View Details'
22
+ }, {
23
+ label: 'Edit Permissions'
24
+ }, {
25
+ label: 'Update Password'
26
+ }], [{
27
+ label: 'Delete'
28
+ }]]
29
+ })) // </Grommet>
30
+
31
+ );
32
+ };
33
+ Grouped.parameters = {
34
+ chromatic: {
35
+ disable: true
36
+ }
37
+ };
38
+ export default {
39
+ title: 'Controls/Menu/Grouped'
40
+ };
@@ -1,7 +1,7 @@
1
1
  var _excluded = ["background", "max", "round", "size", "thickness", "direction", "values"],
2
2
  _excluded2 = ["color", "highlight", "label", "onHover", "value"];
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
 
@@ -1,7 +1,7 @@
1
1
  var _excluded = ["background", "max", "round", "size", "thickness", "type", "values"],
2
2
  _excluded2 = ["color", "highlight", "label", "onHover", "value"];
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
 
@@ -26,8 +26,10 @@ var Circle = /*#__PURE__*/forwardRef(function (props, ref) {
26
26
  var strokeWidth = type === 'pie' ? width / 2 : parseMetricToNum(theme.global.edgeSize[thickness] || thickness);
27
27
  var centerX = width / 2;
28
28
  var centerY = width / 2;
29
- var radius = width / 2 - strokeWidth / 2;
30
- var anglePer = (type === 'semicircle' ? 180 : 360) / max;
29
+ var radius = width / 2 - strokeWidth / 2; // truncate to avoid floating point arithmetic errors
30
+ // see: https://github.com/grommet/grommet/issues/6190
31
+
32
+ var anglePer = Math.floor((type === 'semicircle' ? 180 : 360) / max * 10000) / 10000;
31
33
  var someHighlight = (values || []).some(function (v) {
32
34
  return v.highlight;
33
35
  });
@@ -1,6 +1,6 @@
1
1
  var _excluded = ["background", "color", "direction", "size", "thickness", "type", "value", "values"];
2
2
 
3
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
+ 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); }
4
4
 
5
5
  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; }
6
6
 
@@ -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,6 +1,6 @@
1
1
  var _excluded = ["align", "layout", "nameProps", "pairProps", "valueProps"];
2
2
 
3
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
+ 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); }
4
4
 
5
5
  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; }
6
6
 
@@ -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, { Fragment, useContext } from 'react';
4
4
  import { 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 React from 'react';
4
4
  import { Box } from '../Box';
@@ -1,6 +1,6 @@
1
1
  var _excluded = ["label"];
2
2
 
3
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
+ 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); }
4
4
 
5
5
  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; }
6
6
 
@@ -1,6 +1,6 @@
1
1
  var _excluded = ["label"];
2
2
 
3
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
+ 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); }
4
4
 
5
5
  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; }
6
6
 
@@ -1,6 +1,6 @@
1
1
  var _excluded = ["actions", "message", "onClose", "id", "global", "status", "title", "toast"];
2
2
 
3
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
+ 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); }
4
4
 
5
5
  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; }
6
6
 
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { LayerPositionType } from '../Layer';
3
3
  import { AnchorType } from '..';
4
- export type StatusType = 'critical' | 'warning' | 'normal' | 'unknown';
4
+ export type StatusType = 'critical' | 'warning' | 'normal' | 'info' | 'unknown';
5
5
 
6
6
  export interface NotificationProps {
7
7
  actions?: AnchorType[];
@@ -8,7 +8,7 @@ if (process.env.NODE_ENV !== 'production') {
8
8
  global: PropTypes.bool,
9
9
  title: PropTypes.string,
10
10
  message: PropTypes.string,
11
- status: PropTypes.oneOf(['critical', 'warning', 'normal', 'unknown']),
11
+ status: PropTypes.oneOf(['critical', 'warning', 'normal', 'info', 'unknown']),
12
12
  toast: PropTypes.oneOfType([PropTypes.bool, PropTypes.shape({
13
13
  autoClose: PropTypes.bool,
14
14
  position: PropTypes.oneOf(['bottom', 'bottom-left', 'bottom-right', 'center', 'end', 'hidden', 'left', 'right', 'start', 'top', 'top-left', 'top-right'])
@@ -1,6 +1,6 @@
1
1
  var _excluded = ["kind"];
2
2
 
3
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
+ 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); }
4
4
 
5
5
  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; }
6
6
 
@@ -1,6 +1,6 @@
1
1
  var _excluded = ["children", "background"];
2
2
 
3
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
+ 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); }
4
4
 
5
5
  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; }
6
6
 
@@ -1,6 +1,6 @@
1
1
  var _excluded = ["actions", "gridProps", "parent", "responsive", "subtitle", "title"];
2
2
 
3
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
+ 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); }
4
4
 
5
5
  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; }
6
6
 
@@ -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,6 +1,6 @@
1
1
  var _excluded = ["control", "separator", "size"];
2
2
 
3
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
+ 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); }
4
4
 
5
5
  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; }
6
6
 
@@ -1,6 +1,6 @@
1
1
  var _excluded = ["a11yTitle", "aria-label", "numberItems", "numberEdgePages", "numberMiddlePages", "onChange", "page", "size", "step"];
2
2
 
3
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
+ 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); }
4
4
 
5
5
  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; }
6
6
 
@@ -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';