grommet 2.22.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 (545) hide show
  1. package/all/stories/AllComponents.js +2 -7
  2. package/components/Accordion/Accordion.js +1 -1
  3. package/components/Accordion/propTypes.js +1 -1
  4. package/components/Accordion/stories/CustomThemed/Custom.js +3 -2
  5. package/components/AccordionPanel/AccordionPanel.js +2 -1
  6. package/components/Anchor/Anchor.js +3 -4
  7. package/components/Anchor/propTypes.js +1 -1
  8. package/components/Avatar/Avatar.js +1 -1
  9. package/components/Box/Box.js +1 -1
  10. package/components/Box/StyledBox.js +1 -1
  11. package/components/Box/propTypes.js +2 -2
  12. package/components/Button/Button.js +1 -1
  13. package/components/Button/index.d.ts +15 -16
  14. package/components/Button/propTypes.js +2 -2
  15. package/components/Button/stories/Basic.js +1 -1
  16. package/components/Button/stories/Fill.js +1 -1
  17. package/components/Button/stories/Kind.js +1 -1
  18. package/components/Calendar/Calendar.js +1 -1
  19. package/components/Calendar/index.d.ts +2 -2
  20. package/components/Calendar/propTypes.js +1 -1
  21. package/components/Calendar/stories/ShowAdjacentDays.js +1 -1
  22. package/components/Card/Card.js +1 -1
  23. package/components/Card/stories/CustomThemed/Clickable.js +1 -1
  24. package/components/Card/stories/CustomThemed/RichFooter.js +1 -1
  25. package/components/Card/stories/CustomThemed/Themed.js +1 -1
  26. package/components/CardBody/CardBody.js +1 -1
  27. package/components/CardFooter/CardFooter.js +1 -1
  28. package/components/CardHeader/CardHeader.js +1 -1
  29. package/components/Carousel/Carousel.js +1 -1
  30. package/components/Carousel/propTypes.js +1 -1
  31. package/components/Carousel/stories/CustomThemed/Custom.js +1 -1
  32. package/components/Chart/Chart.js +1 -1
  33. package/components/Chart/index.d.ts +28 -2
  34. package/components/Chart/propTypes.js +1 -1
  35. package/components/Chart/stories/Rich.js +1 -1
  36. package/components/Chart/stories/Window.js +1 -1
  37. package/components/CheckBox/CheckBox.js +2 -2
  38. package/components/CheckBox/StyledCheckBox.js +6 -2
  39. package/components/CheckBox/index.d.ts +2 -1
  40. package/components/CheckBox/stories/CustomThemed/Custom.js +1 -1
  41. package/components/CheckBox/stories/CustomThemed/CustomToggle.js +1 -1
  42. package/components/CheckBox/stories/NoLabel.js +1 -1
  43. package/components/CheckBox/stories/Simple.js +1 -1
  44. package/components/CheckBoxGroup/CheckBoxGroup.js +1 -1
  45. package/components/CheckBoxGroup/index.d.ts +1 -3
  46. package/components/Clock/Analog.js +1 -1
  47. package/components/Clock/Clock.js +1 -1
  48. package/components/Clock/Digital.js +1 -1
  49. package/components/Clock/propTypes.js +1 -1
  50. package/components/Collapsible/stories/Nested.js +1 -1
  51. package/components/Collapsible/stories/Simple.js +1 -1
  52. package/components/DataChart/DataChart.js +35 -43
  53. package/components/DataChart/Legend.js +1 -1
  54. package/components/DataChart/Swatch.js +64 -23
  55. package/components/DataChart/XAxis.js +19 -7
  56. package/components/DataChart/YGuide.js +1 -1
  57. package/components/DataChart/index.d.ts +1 -1
  58. package/components/DataChart/propTypes.js +4 -2
  59. package/components/DataChart/stories/Legend.js +6 -2
  60. package/components/DataChart/stories/Offset.js +6 -1
  61. package/components/DataChart/utils.js +11 -1
  62. package/components/DataTable/Body.js +84 -26
  63. package/components/DataTable/Cell.js +11 -5
  64. package/components/DataTable/DataTable.js +15 -6
  65. package/components/DataTable/ExpanderCell.js +1 -1
  66. package/components/DataTable/Footer.js +7 -4
  67. package/components/DataTable/GroupedBody.js +23 -7
  68. package/components/DataTable/Header.js +86 -41
  69. package/components/DataTable/Resizer.js +1 -1
  70. package/components/DataTable/Sorter.js +1 -1
  71. package/components/DataTable/StyledDataTable.js +2 -2
  72. package/components/DataTable/index.d.ts +14 -2
  73. package/components/DataTable/propTypes.js +10 -3
  74. package/components/DataTable/stories/Controlled.js +1 -1
  75. package/components/DataTable/stories/ControlledGrouped.js +1 -1
  76. package/components/DataTable/stories/CustomThemed/Fill.js +1 -1
  77. package/components/DataTable/stories/GroupedOnSelect.js +1 -1
  78. package/components/DataTable/stories/OnUpdate.js +1 -1
  79. package/components/DataTable/stories/Served.js +1 -1
  80. package/components/DataTable/stories/Sort.js +1 -1
  81. package/components/DataTable/stories/SpaceX.js +6 -4
  82. package/components/DataTable/stories/SpaceXUngrouped.js +4 -2
  83. package/components/DataTable/stories/Tunable.js +1 -1
  84. package/components/DataTable/stories/Units.js +41 -2
  85. package/components/DataTable/stories/VerticalAlign.js +51 -0
  86. package/components/DataTable/stories/data.js +1 -1
  87. package/components/DataTable/stories/rowDetails.js +1 -1
  88. package/components/DataTable/stories/typescript/Clickable.tsx +1 -0
  89. package/components/DataTable/stories/typescript/OnSelect.tsx +5 -10
  90. package/components/DateInput/DateInput.js +29 -24
  91. package/components/DateInput/index.d.ts +1 -0
  92. package/components/DateInput/propTypes.js +1 -0
  93. package/components/DateInput/stories/Format.js +14 -1
  94. package/components/DateInput/utils.js +1 -1
  95. package/components/Diagram/Diagram.js +1 -1
  96. package/components/Diagram/stories/Animated.js +1 -1
  97. package/components/Diagram/stories/Progressing.js +1 -1
  98. package/components/Distribution/Distribution.js +1 -1
  99. package/components/Distribution/propTypes.js +1 -1
  100. package/components/Drop/Drop.js +1 -1
  101. package/components/Drop/DropContainer.js +12 -5
  102. package/components/Drop/index.d.ts +2 -0
  103. package/components/DropButton/DropButton.js +1 -1
  104. package/components/DropButton/propTypes.js +1 -1
  105. package/components/FileInput/FileInput.js +26 -8
  106. package/components/FileInput/index.d.ts +6 -1
  107. package/components/FileInput/stories/Multiple.js +1 -0
  108. package/components/FocusedContainer.js +1 -1
  109. package/components/Footer/Footer.js +1 -1
  110. package/components/Footer/index.d.ts +2 -2
  111. package/components/Footer/stories/DoubleFooter.js +1 -1
  112. package/components/Footer/stories/Sitemap.js +1 -1
  113. package/components/Form/Form.js +1 -1
  114. package/components/Form/stories/ArrayOfFormFields.js +1 -1
  115. package/components/Form/stories/CustomThemed/FieldSpacingOptions.js +1 -1
  116. package/components/Form/stories/HelpAndError.js +1 -1
  117. package/components/FormField/FormField.js +1 -1
  118. package/components/FormField/index.d.ts +4 -1
  119. package/components/Grid/Grid.js +5 -3
  120. package/components/Grid/README.md +0 -2
  121. package/components/Grid/index.d.ts +9 -3
  122. package/components/Grid/propTypes.js +1 -1
  123. package/components/Grid/stories/CustomThemed/Responsive.js +1 -1
  124. package/components/Grid/stories/typescript/App.tsx +42 -48
  125. package/components/Grommet/Grommet.js +1 -1
  126. package/components/Header/Header.js +63 -8
  127. package/components/Header/index.d.ts +8 -2
  128. package/components/Header/propTypes.js +19 -0
  129. package/components/Header/stories/Sticky.js +134 -0
  130. package/components/Heading/Heading.js +1 -1
  131. package/components/Heading/propTypes.js +1 -1
  132. package/components/Image/Image.js +1 -1
  133. package/components/Image/propTypes.js +1 -1
  134. package/components/InfiniteScroll/index.d.ts +1 -0
  135. package/components/InfiniteScroll/stories/Basics.js +1 -1
  136. package/components/InfiniteScroll/stories/ClassChildren.js +1 -1
  137. package/components/InfiniteScroll/stories/Marker.js +1 -1
  138. package/components/InfiniteScroll/stories/Show.js +1 -1
  139. package/components/InfiniteScroll/stories/ShowAfter.js +1 -1
  140. package/components/InfiniteScroll/stories/ShowBefore.js +1 -1
  141. package/components/Keyboard/index.d.ts +1 -0
  142. package/components/Layer/Layer.js +2 -2
  143. package/components/Layer/LayerContainer.js +7 -3
  144. package/components/List/List.js +108 -42
  145. package/components/List/index.d.ts +4 -1
  146. package/components/List/propTypes.js +4 -2
  147. package/components/List/stories/Basic.js +1 -0
  148. package/components/List/stories/Disabled.js +33 -0
  149. package/components/Main/Main.js +1 -1
  150. package/components/Main/index.d.ts +2 -2
  151. package/components/Markdown/Markdown.js +1 -1
  152. package/components/MaskedInput/MaskedInput.js +37 -28
  153. package/components/Menu/Menu.js +108 -63
  154. package/components/Menu/index.d.ts +4 -3
  155. package/components/Menu/propTypes.js +2 -2
  156. package/components/Menu/stories/Grouped.js +52 -0
  157. package/components/Menu/stories/Simple.js +1 -0
  158. package/components/Menu/stories/typescript/Children.tsx +1 -1
  159. package/components/Meter/Bar.js +1 -1
  160. package/components/Meter/Circle.js +5 -3
  161. package/components/Meter/Meter.js +1 -1
  162. package/components/Meter/propTypes.js +1 -1
  163. package/components/NameValueList/NameValueList.js +1 -1
  164. package/components/NameValueList/index.d.ts +4 -1
  165. package/components/NameValuePair/NameValuePair.js +1 -1
  166. package/components/Nav/Nav.js +1 -1
  167. package/components/Nav/index.d.ts +2 -2
  168. package/components/Nav/stories/CustomThemed/JustifySidebar.js +1 -1
  169. package/components/Nav/stories/Sidebar.js +1 -1
  170. package/components/Notification/Notification.js +18 -9
  171. package/components/Notification/index.d.ts +2 -1
  172. package/components/Notification/propTypes.js +2 -1
  173. package/components/Page/Page.js +1 -1
  174. package/components/Page/index.d.ts +2 -2
  175. package/components/PageContent/PageContent.js +1 -1
  176. package/components/PageContent/index.d.ts +2 -2
  177. package/components/PageHeader/PageHeader.js +80 -0
  178. package/components/PageHeader/index.d.ts +26 -0
  179. package/components/PageHeader/index.js +8 -0
  180. package/components/PageHeader/propTypes.js +30 -0
  181. package/components/PageHeader/stories/Custom.js +47 -0
  182. package/components/PageHeader/stories/MultipleActions.js +79 -0
  183. package/components/PageHeader/stories/Responsive.js +37 -0
  184. package/components/PageHeader/stories/Simple.js +36 -0
  185. package/components/Pagination/PageControl.js +1 -1
  186. package/components/Pagination/Pagination.js +1 -1
  187. package/components/Pagination/propTypes.js +1 -1
  188. package/components/Paragraph/Paragraph.js +1 -1
  189. package/components/Paragraph/StyledParagraph.js +7 -1
  190. package/components/Paragraph/index.d.ts +1 -0
  191. package/components/Paragraph/propTypes.js +2 -1
  192. package/components/Paragraph/stories/MaxLines.js +37 -0
  193. package/components/RadioButton/RadioButton.js +1 -1
  194. package/components/RadioButton/index.d.ts +2 -1
  195. package/components/RadioButtonGroup/RadioButtonGroup.js +1 -1
  196. package/components/RadioButtonGroup/index.d.ts +2 -1
  197. package/components/RadioButtonGroup/stories/CustomThemed/CustomTheme.js +1 -1
  198. package/components/RadioButtonGroup/stories/Disabled.js +1 -1
  199. package/components/RangeInput/RangeInput.js +1 -1
  200. package/components/RangeSelector/EdgeControl.js +1 -1
  201. package/components/RangeSelector/RangeSelector.js +1 -1
  202. package/components/RangeSelector/stories/CustomThemed/Custom.js +1 -1
  203. package/components/RangeSelector/stories/CustomThemed/CustomEdgeControl.js +1 -1
  204. package/components/RangeSelector/stories/Step.js +1 -1
  205. package/components/RangeSelector/stories/Thin.js +1 -9
  206. package/components/RangeSelector/stories/Vertical.js +1 -1
  207. package/components/RoutedAnchor/RoutedAnchor.js +2 -2
  208. package/components/RoutedButton/RoutedButton.js +2 -2
  209. package/components/Select/Select.js +11 -32
  210. package/components/Select/SelectContainer.js +27 -11
  211. package/components/Select/propTypes.js +1 -1
  212. package/components/Select/stories/Clear.js +27 -2
  213. package/components/Select/stories/components/SearchBorderBox.js +1 -1
  214. package/components/Select/stories/components/SearchInput.js +1 -1
  215. package/components/Sidebar/Sidebar.js +1 -1
  216. package/components/Sidebar/stories/Labels.js +1 -1
  217. package/components/SkipLink/SkipLink.js +1 -1
  218. package/components/SkipLinkTarget/SkipLinkTarget.js +1 -1
  219. package/components/Spinner/Spinner.js +1 -1
  220. package/components/Spinner/index.d.ts +2 -1
  221. package/components/Stack/Stack.js +1 -1
  222. package/components/Stack/propTypes.js +1 -1
  223. package/components/Tab/StyledTab.js +2 -2
  224. package/components/Tab/Tab.js +35 -17
  225. package/components/Table/StyledTable.js +1 -1
  226. package/components/Table/propTypes.js +1 -1
  227. package/components/TableBody/TableBody.js +1 -1
  228. package/components/TableCell/TableCell.js +9 -5
  229. package/components/TableFooter/TableFooter.js +1 -1
  230. package/components/TableHeader/TableHeader.js +1 -1
  231. package/components/TableRow/TableRow.js +1 -1
  232. package/components/Tabs/Tabs.js +231 -10
  233. package/components/Tabs/propTypes.js +1 -1
  234. package/components/Tabs/stories/Responsive.js +18 -0
  235. package/components/Tag/Tag.js +1 -1
  236. package/components/Tag/propTypes.js +1 -1
  237. package/components/Text/Text.js +1 -1
  238. package/components/Text/propTypes.js +1 -1
  239. package/components/TextArea/TextArea.js +1 -1
  240. package/components/TextArea/stories/NonResizable.js +1 -1
  241. package/components/TextArea/stories/Simple.js +1 -1
  242. package/components/TextInput/TextInput.js +33 -4
  243. package/components/TextInput/stories/DefaultSuggestion.js +1 -0
  244. package/components/TextInput/stories/InsideFormField.js +1 -1
  245. package/components/TextInput/stories/Suggestions.js +1 -0
  246. package/components/TextInput/stories/WithTags.js +1 -1
  247. package/components/Tip/Tip.js +22 -29
  248. package/components/Tip/index.d.ts +1 -0
  249. package/components/Video/StyledVideo.js +1 -1
  250. package/components/Video/Video.js +161 -55
  251. package/components/Video/index.d.ts +15 -8
  252. package/components/Video/propTypes.js +8 -6
  253. package/components/Video/stories/typescript/ControlsBelow.tsx +10 -4
  254. package/components/Video/stories/typescript/Simple.tsx +1 -1
  255. package/components/Video/stories/typescript/TheaterMode.tsx +1 -2
  256. package/components/WorldMap/WorldMap.js +1 -1
  257. package/components/WorldMap/propTypes.js +1 -1
  258. package/components/WorldMap/stories/Places.js +1 -1
  259. package/components/index.d.ts +1 -0
  260. package/components/index.js +8 -0
  261. package/contexts/AnnounceContext/stories/Assertive.js +1 -1
  262. package/contexts/ResponsiveContext/stories/ResponsiveGrid.js +1 -1
  263. package/contexts/ThemeContext/index.d.ts +4 -1
  264. package/es6/all/stories/AllComponents.js +2 -7
  265. package/es6/components/Accordion/Accordion.js +1 -1
  266. package/es6/components/Accordion/propTypes.js +1 -1
  267. package/es6/components/Accordion/stories/CustomThemed/Custom.js +3 -2
  268. package/es6/components/AccordionPanel/AccordionPanel.js +2 -1
  269. package/es6/components/Anchor/Anchor.js +3 -4
  270. package/es6/components/Anchor/propTypes.js +1 -1
  271. package/es6/components/Avatar/Avatar.js +1 -1
  272. package/es6/components/Box/Box.js +1 -1
  273. package/es6/components/Box/StyledBox.js +1 -1
  274. package/es6/components/Box/propTypes.js +2 -2
  275. package/es6/components/Button/Button.js +1 -1
  276. package/es6/components/Button/index.d.ts +15 -16
  277. package/es6/components/Button/propTypes.js +2 -2
  278. package/es6/components/Button/stories/Basic.js +1 -1
  279. package/es6/components/Button/stories/Fill.js +1 -1
  280. package/es6/components/Button/stories/Kind.js +1 -1
  281. package/es6/components/Calendar/Calendar.js +1 -1
  282. package/es6/components/Calendar/index.d.ts +2 -2
  283. package/es6/components/Calendar/propTypes.js +1 -1
  284. package/es6/components/Calendar/stories/ShowAdjacentDays.js +1 -1
  285. package/es6/components/Card/Card.js +1 -1
  286. package/es6/components/Card/stories/CustomThemed/Clickable.js +1 -1
  287. package/es6/components/Card/stories/CustomThemed/RichFooter.js +1 -1
  288. package/es6/components/Card/stories/CustomThemed/Themed.js +1 -1
  289. package/es6/components/CardBody/CardBody.js +1 -1
  290. package/es6/components/CardFooter/CardFooter.js +1 -1
  291. package/es6/components/CardHeader/CardHeader.js +1 -1
  292. package/es6/components/Carousel/Carousel.js +1 -1
  293. package/es6/components/Carousel/propTypes.js +1 -1
  294. package/es6/components/Carousel/stories/CustomThemed/Custom.js +1 -1
  295. package/es6/components/Chart/Chart.js +1 -1
  296. package/es6/components/Chart/index.d.ts +28 -2
  297. package/es6/components/Chart/propTypes.js +1 -1
  298. package/es6/components/Chart/stories/Rich.js +1 -1
  299. package/es6/components/Chart/stories/Window.js +1 -1
  300. package/es6/components/CheckBox/CheckBox.js +2 -2
  301. package/es6/components/CheckBox/StyledCheckBox.js +6 -2
  302. package/es6/components/CheckBox/index.d.ts +2 -1
  303. package/es6/components/CheckBox/stories/CustomThemed/Custom.js +1 -1
  304. package/es6/components/CheckBox/stories/CustomThemed/CustomToggle.js +1 -1
  305. package/es6/components/CheckBox/stories/NoLabel.js +1 -1
  306. package/es6/components/CheckBox/stories/Simple.js +1 -1
  307. package/es6/components/CheckBoxGroup/CheckBoxGroup.js +1 -1
  308. package/es6/components/CheckBoxGroup/index.d.ts +1 -3
  309. package/es6/components/Clock/Analog.js +1 -1
  310. package/es6/components/Clock/Clock.js +1 -1
  311. package/es6/components/Clock/Digital.js +1 -1
  312. package/es6/components/Clock/propTypes.js +1 -1
  313. package/es6/components/Collapsible/stories/Nested.js +1 -1
  314. package/es6/components/Collapsible/stories/Simple.js +1 -1
  315. package/es6/components/DataChart/DataChart.js +36 -45
  316. package/es6/components/DataChart/Legend.js +1 -1
  317. package/es6/components/DataChart/Swatch.js +64 -23
  318. package/es6/components/DataChart/XAxis.js +19 -7
  319. package/es6/components/DataChart/YGuide.js +1 -1
  320. package/es6/components/DataChart/index.d.ts +1 -1
  321. package/es6/components/DataChart/propTypes.js +4 -2
  322. package/es6/components/DataChart/stories/Legend.js +6 -2
  323. package/es6/components/DataChart/stories/Offset.js +6 -1
  324. package/es6/components/DataChart/utils.js +7 -0
  325. package/es6/components/DataTable/Body.js +83 -26
  326. package/es6/components/DataTable/Cell.js +12 -5
  327. package/es6/components/DataTable/DataTable.js +15 -6
  328. package/es6/components/DataTable/ExpanderCell.js +1 -1
  329. package/es6/components/DataTable/Footer.js +7 -4
  330. package/es6/components/DataTable/GroupedBody.js +23 -7
  331. package/es6/components/DataTable/Header.js +86 -41
  332. package/es6/components/DataTable/Resizer.js +1 -1
  333. package/es6/components/DataTable/Sorter.js +1 -1
  334. package/es6/components/DataTable/StyledDataTable.js +2 -2
  335. package/es6/components/DataTable/index.d.ts +14 -2
  336. package/es6/components/DataTable/propTypes.js +10 -3
  337. package/es6/components/DataTable/stories/Controlled.js +1 -1
  338. package/es6/components/DataTable/stories/ControlledGrouped.js +1 -1
  339. package/es6/components/DataTable/stories/CustomThemed/Fill.js +1 -1
  340. package/es6/components/DataTable/stories/GroupedOnSelect.js +1 -1
  341. package/es6/components/DataTable/stories/OnUpdate.js +1 -1
  342. package/es6/components/DataTable/stories/Served.js +1 -1
  343. package/es6/components/DataTable/stories/Sort.js +1 -1
  344. package/es6/components/DataTable/stories/SpaceX.js +6 -4
  345. package/es6/components/DataTable/stories/SpaceXUngrouped.js +4 -2
  346. package/es6/components/DataTable/stories/Tunable.js +1 -1
  347. package/es6/components/DataTable/stories/Units.js +41 -2
  348. package/es6/components/DataTable/stories/VerticalAlign.js +38 -0
  349. package/es6/components/DataTable/stories/data.js +1 -1
  350. package/es6/components/DataTable/stories/rowDetails.js +1 -1
  351. package/es6/components/DataTable/stories/typescript/Clickable.tsx +1 -0
  352. package/es6/components/DataTable/stories/typescript/OnSelect.tsx +5 -10
  353. package/es6/components/DateInput/DateInput.js +28 -24
  354. package/es6/components/DateInput/index.d.ts +1 -0
  355. package/es6/components/DateInput/propTypes.js +1 -0
  356. package/es6/components/DateInput/stories/Format.js +14 -1
  357. package/es6/components/DateInput/utils.js +1 -1
  358. package/es6/components/Diagram/Diagram.js +1 -1
  359. package/es6/components/Diagram/stories/Animated.js +1 -1
  360. package/es6/components/Diagram/stories/Progressing.js +1 -1
  361. package/es6/components/Distribution/Distribution.js +1 -1
  362. package/es6/components/Distribution/propTypes.js +1 -1
  363. package/es6/components/Drop/Drop.js +1 -1
  364. package/es6/components/Drop/DropContainer.js +10 -5
  365. package/es6/components/Drop/index.d.ts +2 -0
  366. package/es6/components/DropButton/DropButton.js +1 -1
  367. package/es6/components/DropButton/propTypes.js +1 -1
  368. package/es6/components/FileInput/FileInput.js +26 -8
  369. package/es6/components/FileInput/index.d.ts +6 -1
  370. package/es6/components/FileInput/stories/Multiple.js +1 -0
  371. package/es6/components/FocusedContainer.js +1 -1
  372. package/es6/components/Footer/Footer.js +1 -1
  373. package/es6/components/Footer/index.d.ts +2 -2
  374. package/es6/components/Footer/stories/DoubleFooter.js +1 -1
  375. package/es6/components/Footer/stories/Sitemap.js +1 -1
  376. package/es6/components/Form/Form.js +1 -1
  377. package/es6/components/Form/stories/ArrayOfFormFields.js +1 -1
  378. package/es6/components/Form/stories/CustomThemed/FieldSpacingOptions.js +1 -1
  379. package/es6/components/Form/stories/HelpAndError.js +1 -1
  380. package/es6/components/FormField/FormField.js +1 -1
  381. package/es6/components/FormField/index.d.ts +4 -1
  382. package/es6/components/Grid/Grid.js +5 -3
  383. package/es6/components/Grid/README.md +0 -2
  384. package/es6/components/Grid/index.d.ts +9 -3
  385. package/es6/components/Grid/propTypes.js +1 -1
  386. package/es6/components/Grid/stories/CustomThemed/Responsive.js +1 -1
  387. package/es6/components/Grid/stories/typescript/App.tsx +42 -48
  388. package/es6/components/Grommet/Grommet.js +1 -1
  389. package/es6/components/Header/Header.js +58 -7
  390. package/es6/components/Header/index.d.ts +8 -2
  391. package/es6/components/Header/propTypes.js +10 -0
  392. package/es6/components/Header/stories/Sticky.js +121 -0
  393. package/es6/components/Heading/Heading.js +1 -1
  394. package/es6/components/Heading/propTypes.js +1 -1
  395. package/es6/components/Image/Image.js +1 -1
  396. package/es6/components/Image/propTypes.js +1 -1
  397. package/es6/components/InfiniteScroll/index.d.ts +1 -0
  398. package/es6/components/InfiniteScroll/stories/Basics.js +1 -1
  399. package/es6/components/InfiniteScroll/stories/ClassChildren.js +1 -1
  400. package/es6/components/InfiniteScroll/stories/Marker.js +1 -1
  401. package/es6/components/InfiniteScroll/stories/Show.js +1 -1
  402. package/es6/components/InfiniteScroll/stories/ShowAfter.js +1 -1
  403. package/es6/components/InfiniteScroll/stories/ShowBefore.js +1 -1
  404. package/es6/components/Keyboard/index.d.ts +1 -0
  405. package/es6/components/Layer/Layer.js +2 -2
  406. package/es6/components/Layer/LayerContainer.js +5 -3
  407. package/es6/components/List/List.js +109 -43
  408. package/es6/components/List/index.d.ts +4 -1
  409. package/es6/components/List/propTypes.js +4 -2
  410. package/es6/components/List/stories/Basic.js +1 -0
  411. package/es6/components/List/stories/Disabled.js +20 -0
  412. package/es6/components/Main/Main.js +1 -1
  413. package/es6/components/Main/index.d.ts +2 -2
  414. package/es6/components/Markdown/Markdown.js +1 -1
  415. package/es6/components/MaskedInput/MaskedInput.js +38 -29
  416. package/es6/components/Menu/Menu.js +109 -63
  417. package/es6/components/Menu/index.d.ts +4 -3
  418. package/es6/components/Menu/propTypes.js +2 -2
  419. package/es6/components/Menu/stories/Grouped.js +40 -0
  420. package/es6/components/Menu/stories/Simple.js +1 -0
  421. package/es6/components/Menu/stories/typescript/Children.tsx +1 -1
  422. package/es6/components/Meter/Bar.js +1 -1
  423. package/es6/components/Meter/Circle.js +5 -3
  424. package/es6/components/Meter/Meter.js +1 -1
  425. package/es6/components/Meter/propTypes.js +1 -1
  426. package/es6/components/NameValueList/NameValueList.js +1 -1
  427. package/es6/components/NameValueList/index.d.ts +4 -1
  428. package/es6/components/NameValuePair/NameValuePair.js +1 -1
  429. package/es6/components/Nav/Nav.js +1 -1
  430. package/es6/components/Nav/index.d.ts +2 -2
  431. package/es6/components/Nav/stories/CustomThemed/JustifySidebar.js +1 -1
  432. package/es6/components/Nav/stories/Sidebar.js +1 -1
  433. package/es6/components/Notification/Notification.js +18 -9
  434. package/es6/components/Notification/index.d.ts +2 -1
  435. package/es6/components/Notification/propTypes.js +2 -1
  436. package/es6/components/Page/Page.js +1 -1
  437. package/es6/components/Page/index.d.ts +2 -2
  438. package/es6/components/PageContent/PageContent.js +1 -1
  439. package/es6/components/PageContent/index.d.ts +2 -2
  440. package/es6/components/PageHeader/PageHeader.js +63 -0
  441. package/es6/components/PageHeader/index.d.ts +26 -0
  442. package/es6/components/PageHeader/index.js +1 -0
  443. package/es6/components/PageHeader/propTypes.js +19 -0
  444. package/es6/components/PageHeader/stories/Custom.js +32 -0
  445. package/es6/components/PageHeader/stories/MultipleActions.js +63 -0
  446. package/es6/components/PageHeader/stories/Responsive.js +25 -0
  447. package/es6/components/PageHeader/stories/Simple.js +24 -0
  448. package/es6/components/Pagination/PageControl.js +1 -1
  449. package/es6/components/Pagination/Pagination.js +1 -1
  450. package/es6/components/Pagination/propTypes.js +1 -1
  451. package/es6/components/Paragraph/Paragraph.js +1 -1
  452. package/es6/components/Paragraph/StyledParagraph.js +8 -1
  453. package/es6/components/Paragraph/index.d.ts +1 -0
  454. package/es6/components/Paragraph/propTypes.js +2 -1
  455. package/es6/components/Paragraph/stories/MaxLines.js +24 -0
  456. package/es6/components/RadioButton/RadioButton.js +1 -1
  457. package/es6/components/RadioButton/index.d.ts +2 -1
  458. package/es6/components/RadioButtonGroup/RadioButtonGroup.js +1 -1
  459. package/es6/components/RadioButtonGroup/index.d.ts +2 -1
  460. package/es6/components/RadioButtonGroup/stories/CustomThemed/CustomTheme.js +1 -1
  461. package/es6/components/RadioButtonGroup/stories/Disabled.js +1 -1
  462. package/es6/components/RangeInput/RangeInput.js +1 -1
  463. package/es6/components/RangeSelector/EdgeControl.js +1 -1
  464. package/es6/components/RangeSelector/RangeSelector.js +1 -1
  465. package/es6/components/RangeSelector/stories/CustomThemed/Custom.js +1 -1
  466. package/es6/components/RangeSelector/stories/CustomThemed/CustomEdgeControl.js +1 -1
  467. package/es6/components/RangeSelector/stories/Step.js +1 -1
  468. package/es6/components/RangeSelector/stories/Thin.js +1 -7
  469. package/es6/components/RangeSelector/stories/Vertical.js +1 -1
  470. package/es6/components/RoutedAnchor/RoutedAnchor.js +2 -2
  471. package/es6/components/RoutedButton/RoutedButton.js +2 -2
  472. package/es6/components/Select/Select.js +12 -33
  473. package/es6/components/Select/SelectContainer.js +27 -11
  474. package/es6/components/Select/propTypes.js +1 -1
  475. package/es6/components/Select/stories/Clear.js +27 -2
  476. package/es6/components/Select/stories/components/SearchBorderBox.js +1 -1
  477. package/es6/components/Select/stories/components/SearchInput.js +1 -1
  478. package/es6/components/Sidebar/Sidebar.js +1 -1
  479. package/es6/components/Sidebar/stories/Labels.js +1 -1
  480. package/es6/components/SkipLink/SkipLink.js +1 -1
  481. package/es6/components/SkipLinkTarget/SkipLinkTarget.js +1 -1
  482. package/es6/components/Spinner/Spinner.js +1 -1
  483. package/es6/components/Spinner/index.d.ts +2 -1
  484. package/es6/components/Stack/Stack.js +1 -1
  485. package/es6/components/Stack/propTypes.js +1 -1
  486. package/es6/components/Tab/StyledTab.js +2 -2
  487. package/es6/components/Tab/Tab.js +35 -18
  488. package/es6/components/Table/StyledTable.js +1 -1
  489. package/es6/components/Table/propTypes.js +1 -1
  490. package/es6/components/TableBody/TableBody.js +1 -1
  491. package/es6/components/TableCell/TableCell.js +8 -5
  492. package/es6/components/TableFooter/TableFooter.js +1 -1
  493. package/es6/components/TableHeader/TableHeader.js +1 -1
  494. package/es6/components/TableRow/TableRow.js +1 -1
  495. package/es6/components/Tabs/Tabs.js +227 -11
  496. package/es6/components/Tabs/propTypes.js +1 -1
  497. package/es6/components/Tabs/stories/Responsive.js +18 -0
  498. package/es6/components/Tag/Tag.js +1 -1
  499. package/es6/components/Tag/propTypes.js +1 -1
  500. package/es6/components/Text/Text.js +1 -1
  501. package/es6/components/Text/propTypes.js +1 -1
  502. package/es6/components/TextArea/TextArea.js +1 -1
  503. package/es6/components/TextArea/stories/NonResizable.js +1 -1
  504. package/es6/components/TextArea/stories/Simple.js +1 -1
  505. package/es6/components/TextInput/TextInput.js +33 -4
  506. package/es6/components/TextInput/stories/DefaultSuggestion.js +1 -0
  507. package/es6/components/TextInput/stories/InsideFormField.js +1 -1
  508. package/es6/components/TextInput/stories/Suggestions.js +1 -0
  509. package/es6/components/TextInput/stories/WithTags.js +1 -1
  510. package/es6/components/Tip/Tip.js +22 -29
  511. package/es6/components/Tip/index.d.ts +1 -0
  512. package/es6/components/Video/StyledVideo.js +2 -2
  513. package/es6/components/Video/Video.js +159 -55
  514. package/es6/components/Video/index.d.ts +15 -8
  515. package/es6/components/Video/propTypes.js +8 -6
  516. package/es6/components/Video/stories/typescript/ControlsBelow.tsx +10 -4
  517. package/es6/components/Video/stories/typescript/Simple.tsx +1 -1
  518. package/es6/components/Video/stories/typescript/TheaterMode.tsx +1 -2
  519. package/es6/components/WorldMap/WorldMap.js +1 -1
  520. package/es6/components/WorldMap/propTypes.js +1 -1
  521. package/es6/components/WorldMap/stories/Places.js +1 -1
  522. package/es6/components/index.d.ts +1 -0
  523. package/es6/components/index.js +1 -0
  524. package/es6/contexts/AnnounceContext/stories/Assertive.js +1 -1
  525. package/es6/contexts/ResponsiveContext/stories/ResponsiveGrid.js +1 -1
  526. package/es6/contexts/ThemeContext/index.d.ts +4 -1
  527. package/es6/index.d.ts +1 -0
  528. package/es6/languages/default.json +4 -1
  529. package/es6/themes/base.d.ts +82 -21
  530. package/es6/themes/base.js +103 -5
  531. package/es6/utils/index.js +2 -1
  532. package/es6/utils/object.js +1 -1
  533. package/es6/utils/pagination.js +1 -1
  534. package/es6/utils/use-keyboard.js +25 -0
  535. package/grommet.min.js +1 -1
  536. package/grommet.min.js.map +1 -1
  537. package/index.d.ts +1 -0
  538. package/languages/default.json +4 -1
  539. package/package.json +58 -54
  540. package/themes/base.d.ts +82 -21
  541. package/themes/base.js +104 -5
  542. package/utils/index.js +8 -0
  543. package/utils/object.js +1 -1
  544. package/utils/pagination.js +1 -1
  545. package/utils/use-keyboard.js +34 -0
@@ -11,6 +11,8 @@ var _useIsomorphicLayoutEffect = require("../../utils/use-isomorphic-layout-effe
11
11
 
12
12
  var _defaultProps = require("../../default-props");
13
13
 
14
+ var _AnnounceContext = require("../../contexts/AnnounceContext");
15
+
14
16
  var _Box = require("../Box");
15
17
 
16
18
  var _Button = require("../Button");
@@ -23,6 +25,8 @@ var _Stack = require("../Stack");
23
25
 
24
26
  var _Text = require("../Text");
25
27
 
28
+ var _Keyboard = require("../Keyboard");
29
+
26
30
  var _utils = require("../../utils");
27
31
 
28
32
  var _StyledVideo = require("./StyledVideo");
@@ -31,13 +35,13 @@ var _MessageContext = require("../../contexts/MessageContext");
31
35
 
32
36
  var _propTypes = require("./propTypes");
33
37
 
34
- var _excluded = ["alignSelf", "autoPlay", "children", "controls", "gridArea", "loop", "margin", "messages", "mute", "onDurationChange", "onEnded", "onPause", "onPlay", "onTimeUpdate", "onVolumeChange"];
38
+ var _excluded = ["alignSelf", "autoPlay", "children", "controls", "gridArea", "loop", "margin", "messages", "mute", "onDurationChange", "onEnded", "onPause", "onPlay", "onTimeUpdate", "onVolumeChange", "skipInterval"];
35
39
 
36
40
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
37
41
 
38
42
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
39
43
 
40
- 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); }
44
+ 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); }
41
45
 
42
46
  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; }
43
47
 
@@ -76,6 +80,7 @@ var Video = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
76
80
  _onPlay = _ref.onPlay,
77
81
  _onTimeUpdate = _ref.onTimeUpdate,
78
82
  _onVolumeChange = _ref.onVolumeChange,
83
+ skipInterval = _ref.skipInterval,
79
84
  rest = _objectWithoutPropertiesLoose(_ref, _excluded);
80
85
 
81
86
  var theme = (0, _react.useContext)(_styledComponents.ThemeContext) || _defaultProps.defaultProps.theme;
@@ -83,6 +88,8 @@ var Video = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
83
88
  var _useContext = (0, _react.useContext)(_MessageContext.MessageContext),
84
89
  format = _useContext.format;
85
90
 
91
+ var announce = (0, _react.useContext)(_AnnounceContext.AnnounceContext);
92
+
86
93
  var _useState = (0, _react.useState)([]),
87
94
  captions = _useState[0],
88
95
  setCaptions = _useState[1];
@@ -103,29 +110,33 @@ var Video = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
103
110
  playing = _useState5[0],
104
111
  setPlaying = _useState5[1];
105
112
 
106
- var _useState6 = (0, _react.useState)(),
107
- scrubTime = _useState6[0],
108
- setScrubTime = _useState6[1];
113
+ var _useState6 = (0, _react.useState)(false),
114
+ announceAudioDescription = _useState6[0],
115
+ setAnnounceAudioDescription = _useState6[1];
109
116
 
110
117
  var _useState7 = (0, _react.useState)(),
111
- volume = _useState7[0],
112
- setVolume = _useState7[1];
118
+ scrubTime = _useState7[0],
119
+ setScrubTime = _useState7[1];
113
120
 
114
- var _useState8 = (0, _react.useState)(false),
115
- hasPlayed = _useState8[0],
116
- setHasPlayed = _useState8[1];
121
+ var _useState8 = (0, _react.useState)(),
122
+ volume = _useState8[0],
123
+ setVolume = _useState8[1];
117
124
 
118
- var _useState9 = (0, _react.useState)(),
119
- interacting = _useState9[0],
120
- setInteracting = _useState9[1];
125
+ var _useState9 = (0, _react.useState)(false),
126
+ hasPlayed = _useState9[0],
127
+ setHasPlayed = _useState9[1];
121
128
 
122
129
  var _useState10 = (0, _react.useState)(),
123
- height = _useState10[0],
124
- setHeight = _useState10[1];
130
+ interacting = _useState10[0],
131
+ setInteracting = _useState10[1];
125
132
 
126
133
  var _useState11 = (0, _react.useState)(),
127
- width = _useState11[0],
128
- setWidth = _useState11[1];
134
+ height = _useState11[0],
135
+ setHeight = _useState11[1];
136
+
137
+ var _useState12 = (0, _react.useState)(),
138
+ width = _useState12[0],
139
+ setWidth = _useState12[1];
129
140
 
130
141
  var containerRef = (0, _react.useRef)();
131
142
  var scrubberRef = (0, _react.useRef)();
@@ -179,7 +190,12 @@ var Video = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
179
190
  return function () {
180
191
  return clearTimeout(timer);
181
192
  };
182
- }, [interacting]);
193
+ }, [interacting]); // track which audio description track is active
194
+
195
+ var _useState13 = (0, _react.useState)(),
196
+ activeTrack = _useState13[0],
197
+ setActiveTrack = _useState13[1];
198
+
183
199
  (0, _useIsomorphicLayoutEffect.useLayoutEffect)(function () {
184
200
  var video = videoRef.current;
185
201
 
@@ -209,42 +225,66 @@ var Video = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
209
225
 
210
226
 
211
227
  var textTracks = video.textTracks;
228
+ var nextCaptions = [];
229
+ var set = false; // iterate through all of the tracks provided
212
230
 
213
- if (textTracks.length > 0) {
214
- if (textTracks.length === 1) {
215
- var active = textTracks[0].mode === 'showing';
231
+ var _loop = function _loop(i) {
232
+ var track = textTracks[i];
233
+ var active = track.mode === 'showing';
216
234
 
217
- if (!captions || !captions[0] || captions[0].active !== active) {
218
- setCaptions([{
219
- active: active
220
- }]);
235
+ var getActiveTrack = function getActiveTrack(currentVideoTime) {
236
+ var nextActiveTrack;
237
+
238
+ for (var j = 0; j < track.cues.length; j += 1) {
239
+ var _track$cues$j, _track$cues$j2;
240
+
241
+ if (currentVideoTime > (track == null ? void 0 : (_track$cues$j = track.cues[j]) == null ? void 0 : _track$cues$j.startTime) && currentVideoTime < (track == null ? void 0 : (_track$cues$j2 = track.cues[j]) == null ? void 0 : _track$cues$j2.endTime)) {
242
+ var _track$cues$j3;
243
+
244
+ nextActiveTrack = track == null ? void 0 : (_track$cues$j3 = track.cues[j]) == null ? void 0 : _track$cues$j3.text;
245
+ }
221
246
  }
222
- } else {
223
- var nextCaptions = [];
224
- var set = false;
225
247
 
226
- for (var i = 0; i < textTracks.length; i += 1) {
227
- var track = textTracks[i];
248
+ return nextActiveTrack;
249
+ }; // track is an audio description
228
250
 
229
- var _active = track.mode === 'showing';
230
251
 
231
- nextCaptions.push({
232
- label: track.label,
233
- active: _active
234
- });
252
+ if (track.kind === 'descriptions') {
253
+ if (announceAudioDescription) {
254
+ video.ontimeupdate = function () {
255
+ var nextActiveTrack = getActiveTrack(video.currentTime);
235
256
 
236
- if (!captions || !captions[i] || captions[i].active !== _active) {
237
- set = true;
238
- }
257
+ if (activeTrack !== nextActiveTrack) {
258
+ if (nextActiveTrack) {
259
+ announce(nextActiveTrack, 'assertive');
260
+ }
261
+
262
+ setActiveTrack(nextActiveTrack);
263
+ }
264
+ };
265
+ }
266
+ } // otherwise treat as captions
267
+ else {
268
+ nextCaptions.push({
269
+ label: track.label,
270
+ active: active
271
+ });
272
+
273
+ if (!captions || !captions[i] || captions[i].active !== active) {
274
+ set = true;
239
275
  }
240
276
 
241
277
  if (set) {
242
278
  setCaptions(nextCaptions);
243
279
  }
244
280
  }
281
+ };
282
+
283
+ for (var i = 0; i < textTracks.length; i += 1) {
284
+ _loop(i);
245
285
  }
246
286
  }
247
- }, [captions, height, videoRef, width]);
287
+ }, [activeTrack, announce, announceAudioDescription, captions, height, videoRef, width]);
248
288
  var play = (0, _react.useCallback)(function () {
249
289
  return videoRef.current.play();
250
290
  }, [videoRef]);
@@ -265,21 +305,27 @@ var Video = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
265
305
  if (duration) videoRef.current.currentTime = duration * percent;
266
306
  }
267
307
  }, [duration, videoRef]);
308
+ var seekForward = (0, _react.useCallback)(function () {
309
+ setInteracting(true);
310
+ videoRef.current.currentTime += skipInterval || theme.video.scrubber.interval;
311
+ }, [skipInterval, theme.video.scrubber.interval, videoRef]);
312
+ var seekBackward = (0, _react.useCallback)(function () {
313
+ setInteracting(true);
314
+ videoRef.current.currentTime -= skipInterval || theme.video.scrubber.interval;
315
+ }, [skipInterval, theme.video.scrubber.interval, videoRef]);
268
316
  var louder = (0, _react.useCallback)(function () {
269
317
  videoRef.current.volume += VOLUME_STEP;
270
318
  }, [videoRef]);
271
319
  var quieter = (0, _react.useCallback)(function () {
272
320
  videoRef.current.volume -= VOLUME_STEP;
273
321
  }, [videoRef]);
274
-
275
- var showCaptions = function showCaptions(index) {
322
+ var showCaptions = (0, _react.useCallback)(function (index) {
276
323
  var textTracks = videoRef.current.textTracks;
277
324
 
278
325
  for (var i = 0; i < textTracks.length; i += 1) {
279
326
  textTracks[i].mode = i === index ? 'showing' : 'hidden';
280
327
  }
281
- };
282
-
328
+ }, [videoRef]);
283
329
  var fullscreen = (0, _react.useCallback)(function () {
284
330
  var video = videoRef.current;
285
331
 
@@ -315,20 +361,48 @@ var Video = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
315
361
  Pause: theme.video.icons.pause,
316
362
  Play: theme.video.icons.play,
317
363
  ReduceVolume: theme.video.icons.reduceVolume,
318
- Volume: theme.video.icons.volume
364
+ Volume: theme.video.icons.volume,
365
+ Description: theme.video.icons.description
319
366
  };
320
- var captionControls = captions.map(function (caption) {
367
+ var captionControls = captions.map(function (caption, index) {
321
368
  return {
322
369
  icon: caption.label ? undefined : /*#__PURE__*/_react["default"].createElement(Icons.ClosedCaption, {
323
370
  color: iconColor
324
371
  }),
325
372
  label: caption.label,
326
373
  active: caption.active,
374
+ a11yTitle: caption.label || format({
375
+ id: 'video.captions',
376
+ messages: messages
377
+ }),
327
378
  onClick: function onClick() {
328
- return showCaptions(caption.active ? -1 : 0);
379
+ showCaptions(caption.active ? -1 : index);
380
+ var updatedCaptions = [];
381
+
382
+ for (var i = 0; i < captions.length; i += 1) {
383
+ updatedCaptions.push(captions[i]); // set other captions to active=false
384
+
385
+ if (i !== index && updatedCaptions[i].active) updatedCaptions[i].active = false; // set the currently selected captions to active
386
+ else if (i === index) updatedCaptions[i].active = !captions[index].active;
387
+ }
388
+
389
+ setCaptions(updatedCaptions);
329
390
  }
330
391
  };
331
392
  });
393
+ var descriptionControls = {
394
+ icon: /*#__PURE__*/_react["default"].createElement(Icons.Description, {
395
+ color: iconColor
396
+ }),
397
+ a11yTitle: format({
398
+ id: 'video.audioDescriptions',
399
+ messages: messages
400
+ }),
401
+ active: announceAudioDescription,
402
+ onClick: function onClick() {
403
+ return setAnnounceAudioDescription(!announceAudioDescription);
404
+ }
405
+ };
332
406
  var volumeControls = ['volume', 'reduceVolume'].map(function (control) {
333
407
  return {
334
408
  icon: control === 'volume' ? /*#__PURE__*/_react["default"].createElement(Icons.Volume, {
@@ -356,6 +430,7 @@ var Video = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
356
430
  });
357
431
  var buttonProps = {
358
432
  captions: captionControls,
433
+ descriptions: descriptionControls,
359
434
  volume: volumeControls,
360
435
  fullScreen: {
361
436
  icon: /*#__PURE__*/_react["default"].createElement(Icons.FullScreen, {
@@ -375,7 +450,8 @@ var Video = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
375
450
  id: 'video.pauseButton',
376
451
  messages: messages
377
452
  }),
378
- onClick: playing ? pause : play
453
+ disabled: !playing,
454
+ onClick: pause
379
455
  },
380
456
  play: {
381
457
  icon: /*#__PURE__*/_react["default"].createElement(Icons.Play, {
@@ -385,7 +461,8 @@ var Video = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
385
461
  id: 'video.playButton',
386
462
  messages: messages
387
463
  }),
388
- onClick: playing ? pause : play
464
+ disabled: playing,
465
+ onClick: play
389
466
  }
390
467
  };
391
468
  var controlsMenuItems = [];
@@ -397,7 +474,23 @@ var Video = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
397
474
  return undefined;
398
475
  }
399
476
 
400
- if (typeof item === 'string') return controlsMenuItems.push(buttonProps[item]);
477
+ if (item === 'captions' && typeof buttonProps[item] === 'object') {
478
+ for (var i = 0; i < buttonProps[item].length; i += 1) {
479
+ controlsMenuItems.push(buttonProps[item][i]);
480
+ }
481
+
482
+ return undefined;
483
+ }
484
+
485
+ if (item === 'descriptions') {
486
+ controlsMenuItems.push(buttonProps[item]);
487
+ return undefined;
488
+ }
489
+
490
+ if (typeof item === 'string') {
491
+ return controlsMenuItems.push(buttonProps[item]);
492
+ }
493
+
401
494
  return controlsMenuItems.push(item);
402
495
  });
403
496
  controlsElement = /*#__PURE__*/_react["default"].createElement(_StyledVideo.StyledVideoControls, {
@@ -426,7 +519,10 @@ var Video = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
426
519
  })
427
520
  }),
428
521
  hoverIndicator: "background",
429
- onClick: playing ? pause : play
522
+ onClick: playing ? pause : play,
523
+ onFocus: function onFocus() {
524
+ return setInteracting(true);
525
+ }
430
526
  }), /*#__PURE__*/_react["default"].createElement(_Box.Box, {
431
527
  direction: "row",
432
528
  align: "center",
@@ -457,7 +553,10 @@ var Video = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
457
553
  onMouseLeave: function onMouseLeave() {
458
554
  return setScrubTime(undefined);
459
555
  },
460
- onClick: seek
556
+ onClick: seek,
557
+ onFocus: function onFocus() {
558
+ return setInteracting(true);
559
+ }
461
560
  }))), /*#__PURE__*/_react["default"].createElement(_Box.Box, {
462
561
  pad: {
463
562
  horizontal: 'small'
@@ -483,7 +582,10 @@ var Video = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
483
582
  messages: messages
484
583
  })
485
584
  },
486
- items: [].concat(controlsMenuItems)
585
+ items: [].concat(controlsMenuItems),
586
+ onFocus: function onFocus() {
587
+ return setInteracting(true);
588
+ }
487
589
  })));
488
590
  }
489
591
 
@@ -519,13 +621,17 @@ var Video = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
519
621
  }
520
622
  }
521
623
 
522
- return /*#__PURE__*/_react["default"].createElement(_StyledVideo.StyledVideoContainer, _extends({
624
+ return /*#__PURE__*/_react["default"].createElement(_Keyboard.Keyboard, {
625
+ onLeft: seekBackward,
626
+ onRight: seekForward
627
+ }, /*#__PURE__*/_react["default"].createElement(_StyledVideo.StyledVideoContainer, _extends({
523
628
  ref: containerRef
524
629
  }, mouseEventListeners, {
525
630
  alignSelf: alignSelf,
526
631
  gridArea: gridArea,
527
632
  margin: margin,
528
- style: style
633
+ style: style,
634
+ tabIndex: "-1"
529
635
  }), /*#__PURE__*/_react["default"].createElement(_StyledVideo.StyledVideo, _extends({}, rest, {
530
636
  ref: videoRef,
531
637
  onDurationChange: function onDurationChange(event) {
@@ -559,7 +665,7 @@ var Video = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
559
665
  },
560
666
  autoPlay: autoPlay || false,
561
667
  loop: loop || false
562
- }), children), controlsElement);
668
+ }), children), controlsElement));
563
669
  });
564
670
  exports.Video = Video;
565
671
  Video.defaultProps = {};
@@ -7,6 +7,19 @@ import {
7
7
  Omit,
8
8
  } from '../../utils';
9
9
 
10
+ type controlsItems =
11
+ | 'captions'
12
+ | 'descriptions'
13
+ | 'fullScreen'
14
+ | 'play'
15
+ | 'pause'
16
+ | 'volume'
17
+ | {
18
+ icon?: React.ReactNode;
19
+ a11yTitle?: A11yTitleType;
20
+ onClick?: (...args: any[]) => any;
21
+ };
22
+
10
23
  export interface VideoProps {
11
24
  a11yTitle?: A11yTitleType;
12
25
  alignSelf?: AlignSelfType;
@@ -17,14 +30,7 @@ export interface VideoProps {
17
30
  | 'below'
18
31
  | {
19
32
  position?: false | 'over' | 'below';
20
- items?: [
21
- 'captions' | 'fullScreen' | 'play' | 'pause' | 'volume',
22
- {
23
- icon?: React.ReactNode;
24
- a11yTitle?: A11yTitleType;
25
- onClick?: () => {};
26
- },
27
- ];
33
+ items?: controlsItems[];
28
34
  };
29
35
  fit?: 'cover' | 'contain';
30
36
  gridArea?: GridAreaType;
@@ -42,6 +48,7 @@ export interface VideoProps {
42
48
  volumeDown?: string;
43
49
  };
44
50
  mute?: boolean;
51
+ skipInterval?: number;
45
52
  }
46
53
 
47
54
  export interface VideoExtendedProps
@@ -9,7 +9,7 @@ var _generalPropTypes = require("../../utils/general-prop-types");
9
9
 
10
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
11
11
 
12
- 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); }
12
+ 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); }
13
13
 
14
14
  var PropType = {};
15
15
 
@@ -17,11 +17,12 @@ if (process.env.NODE_ENV !== 'production') {
17
17
  PropType = _extends({}, _generalPropTypes.genericProps, {
18
18
  autoPlay: _propTypes["default"].bool,
19
19
  controls: _propTypes["default"].oneOfType([_propTypes["default"].oneOf([false, 'over', 'below']), _propTypes["default"].shape({
20
- position: _propTypes["default"].oneOf[(false, 'over', 'below')],
21
- items: _propTypes["default"].arrayOf(_propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].shape({
20
+ position: _propTypes["default"].oneOf([false, 'over', 'below']),
21
+ items: _propTypes["default"].arrayOf(_propTypes["default"].oneOfType([_propTypes["default"].oneOf(['captions', 'descriptions', 'fullScreen', 'play', 'pause', 'volume']), _propTypes["default"].shape({
22
22
  icon: _propTypes["default"].element,
23
23
  a11yTitle: _propTypes["default"].string,
24
- onClick: _propTypes["default"].func
24
+ onClick: _propTypes["default"].func,
25
+ disabled: _propTypes["default"].bool
25
26
  })]))
26
27
  })]),
27
28
  fit: _propTypes["default"].oneOf(['cover', 'contain']),
@@ -30,14 +31,15 @@ if (process.env.NODE_ENV !== 'production') {
30
31
  messages: _propTypes["default"].shape({
31
32
  closeMenu: _propTypes["default"].string,
32
33
  fullScreen: _propTypes["default"].string,
33
- progressMeter: _propTypes["default"].string,
34
34
  openMenu: _propTypes["default"].string,
35
35
  pauseButton: _propTypes["default"].string,
36
36
  playButton: _propTypes["default"].string,
37
+ progressMeter: _propTypes["default"].string,
37
38
  scrubber: _propTypes["default"].string,
38
39
  volumeDown: _propTypes["default"].string,
39
40
  volumeUp: _propTypes["default"].string
40
- })
41
+ }),
42
+ skipInterval: _propTypes["default"].number
41
43
  });
42
44
  }
43
45
 
@@ -2,9 +2,15 @@ import React from 'react';
2
2
 
3
3
  import { Box, Video } from 'grommet';
4
4
 
5
- const SimpleVideo = (props) => (
5
+ export const ControlsBelow = () => (
6
6
  <Box align="center" pad="large">
7
- <Video {...props}>
7
+ <Video
8
+ skipInterval={2}
9
+ controls={{
10
+ position: 'below',
11
+ items: ['captions', 'descriptions'],
12
+ }}
13
+ >
8
14
  <source src="small.mp4" type="video/mp4" />
9
15
  <source
10
16
  src="http://techslides.com/demos/sample-videos/small.webm"
@@ -18,12 +24,12 @@ const SimpleVideo = (props) => (
18
24
  src="http://techslides.com/demos/sample-videos/small.3gp"
19
25
  type="video/3gp"
20
26
  />
27
+ <track kind="captions" srcLang="en" src="small-en.vtt" />
28
+ <track kind="descriptions" srcLang="en" src="small-en-description.vtt" />
21
29
  </Video>
22
30
  </Box>
23
31
  );
24
32
 
25
- export const ControlsBelow = () => <SimpleVideo controls="below" />;
26
-
27
33
  ControlsBelow.storyName = 'Controls below';
28
34
 
29
35
  export default {
@@ -4,7 +4,7 @@ import { Box, Video } from 'grommet';
4
4
 
5
5
  export const Simple = () => (
6
6
  <Box align="center" pad="large">
7
- <Video>
7
+ <Video skipInterval={2}>
8
8
  <source src="small.mp4" type="video/mp4" />
9
9
  <source
10
10
  src="http://techslides.com/demos/sample-videos/small.webm"
@@ -3,7 +3,7 @@ import React, { useState } from 'react';
3
3
  import { Box, Video } from 'grommet';
4
4
  import { Monitor } from 'grommet-icons/icons/Monitor';
5
5
 
6
- const TheaterMode = (props) => {
6
+ const TheaterMode = () => {
7
7
  const [theaterMode, setTheaterMode] = useState(false);
8
8
 
9
9
  return (
@@ -27,7 +27,6 @@ const TheaterMode = (props) => {
27
27
  'fullScreen',
28
28
  ],
29
29
  }}
30
- {...props}
31
30
  />
32
31
  </Box>
33
32
  );
@@ -26,7 +26,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
26
26
 
27
27
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
28
28
 
29
- 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); }
29
+ 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); }
30
30
 
31
31
  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; }
32
32
 
@@ -9,7 +9,7 @@ var _generalPropTypes = require("../../utils/general-prop-types");
9
9
 
10
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
11
11
 
12
- 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); }
12
+ 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); }
13
13
 
14
14
  var PropType = {};
15
15
 
@@ -9,7 +9,7 @@ var _grommet = require("grommet");
9
9
 
10
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
11
11
 
12
- 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); }
12
+ 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); }
13
13
 
14
14
  var placeProps = function placeProps(name, color, showDrop) {
15
15
  return _extends({
@@ -40,6 +40,7 @@ export * from './Markdown';
40
40
  export * from './MaskedInput';
41
41
  export * from './Menu';
42
42
  export * from './Meter';
43
+ export * from './PageHeader';
43
44
  export * from './Pagination';
44
45
  export * from './Paragraph';
45
46
  export * from './Nav';
@@ -354,6 +354,14 @@ Object.keys(_PageContent).forEach(function (key) {
354
354
  exports[key] = _PageContent[key];
355
355
  });
356
356
 
357
+ var _PageHeader = require("./PageHeader");
358
+
359
+ Object.keys(_PageHeader).forEach(function (key) {
360
+ if (key === "default" || key === "__esModule") return;
361
+ if (key in exports && exports[key] === _PageHeader[key]) return;
362
+ exports[key] = _PageHeader[key];
363
+ });
364
+
357
365
  var _Pagination = require("./Pagination");
358
366
 
359
367
  Object.keys(_Pagination).forEach(function (key) {
@@ -13,7 +13,7 @@ var _grommet = require("grommet");
13
13
 
14
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15
15
 
16
- 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); }
16
+ 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); }
17
17
 
18
18
  var Announcer = function Announcer(_ref) {
19
19
  var announce = _ref.announce,
@@ -15,7 +15,7 @@ var _excluded = ["children", "areas"];
15
15
 
16
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
17
17
 
18
- 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); }
18
+ 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); }
19
19
 
20
20
  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; }
21
21
 
@@ -3,7 +3,10 @@ import * as React from 'react';
3
3
  export type ThemeValue = object;
4
4
 
5
5
  export interface ThemeContextI extends React.Context<ThemeValue> {
6
- Extend: React.FC<{ value: ThemeValue }>;
6
+ Extend: React.FC<{
7
+ value: ThemeValue;
8
+ children: React.ReactNode;
9
+ }>;
7
10
  }
8
11
 
9
12
  declare const ThemeContext: ThemeContextI;