grommet 2.57.0 → 2.59.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 (484) hide show
  1. package/all/stories/AllComponents.stories.js +2 -1
  2. package/components/Accordion/Accordion.js +2 -1
  3. package/components/Accordion/stories/CustomHeader.stories.js +2 -1
  4. package/components/AccordionPanel/AccordionPanel.js +2 -1
  5. package/components/Anchor/Anchor.js +2 -1
  6. package/components/Anchor/StyledAnchor.js +2 -1
  7. package/components/Avatar/Avatar.js +2 -1
  8. package/components/Box/Box.js +2 -1
  9. package/components/Box/ResponsiveContainerProvider.js +2 -1
  10. package/components/Box/StyledBox.js +3 -2
  11. package/components/Box/stories/ColorContrast.stories.js +36 -0
  12. package/components/Box/stories/ResponsiveContainer.stories.js +2 -1
  13. package/components/Button/Badge.js +2 -1
  14. package/components/Button/BusyAnimation.js +9 -2
  15. package/components/Button/Button.js +14 -4
  16. package/components/Button/StyledButton.js +2 -1
  17. package/components/Button/StyledButtonKind.js +2 -1
  18. package/components/Button/stories/Busy.stories.js +2 -1
  19. package/components/Calendar/Calendar.js +2 -1
  20. package/components/Calendar/StyledCalendar.js +2 -1
  21. package/components/Calendar/stories/ActiveDate.stories.js +2 -1
  22. package/components/Calendar/stories/CustomDay.stories.js +2 -1
  23. package/components/Calendar/stories/CustomHeader.stories.js +2 -1
  24. package/components/Calendar/stories/CustomThemed/CustomSizeHeading.stories.js +2 -1
  25. package/components/Calendar/stories/Dual.stories.js +2 -1
  26. package/components/Calendar/stories/HeaderLevel.stories.js +2 -1
  27. package/components/Calendar/stories/Multiple.stories.js +2 -1
  28. package/components/Calendar/stories/ShowAdjacentDays.stories.js +2 -1
  29. package/components/Calendar/stories/Simple.stories.js +2 -1
  30. package/components/Card/Card.js +2 -1
  31. package/components/Cards/Cards.js +2 -1
  32. package/components/Cards/index.d.ts +2 -16
  33. package/components/Carousel/Carousel.js +2 -1
  34. package/components/Carousel/CarouselChild.js +2 -1
  35. package/components/Carousel/StyledCarousel.js +2 -1
  36. package/components/Chart/Chart.js +2 -1
  37. package/components/Chart/StyledChart.js +2 -1
  38. package/components/Chart/stories/Rich.stories.js +2 -1
  39. package/components/Chart/stories/Scan.stories.js +2 -1
  40. package/components/Chart/stories/Window.stories.js +2 -1
  41. package/components/Chart/stories/Zoom.stories.js +2 -1
  42. package/components/CheckBox/CheckBox.js +2 -1
  43. package/components/CheckBox/README.md +95 -0
  44. package/components/CheckBox/StyledCheckBox.js +104 -16
  45. package/components/CheckBox/stories/CustomThemed/Appearance.stories.tsx +160 -0
  46. package/components/CheckBox/stories/CustomThemed/Custom.stories.js +2 -1
  47. package/components/CheckBox/stories/CustomThemed/CustomToggle.stories.js +2 -1
  48. package/components/CheckBox/stories/Indeterminate.stories.js +2 -1
  49. package/components/CheckBox/stories/NoLabel.stories.js +2 -1
  50. package/components/CheckBox/stories/Simple.stories.js +2 -1
  51. package/components/CheckBox/stories/WithStickyDiv.stories.js +2 -1
  52. package/components/CheckBoxGroup/CheckBoxGroup.js +2 -1
  53. package/components/CheckBoxGroup/stories/Children.stories.js +2 -1
  54. package/components/CheckBoxGroup/stories/InitialValues.stories.js +2 -1
  55. package/components/Clock/Analog.js +2 -1
  56. package/components/Clock/Clock.js +2 -1
  57. package/components/Clock/Digital.js +2 -1
  58. package/components/Clock/StyledClock.js +2 -1
  59. package/components/Collapsible/Collapsible.js +2 -1
  60. package/components/Data/Data.js +2 -1
  61. package/components/Data/DataForm.js +2 -1
  62. package/components/Data/stories/Infinite.stories.js +2 -1
  63. package/components/Data/stories/Inline.stories.js +2 -1
  64. package/components/Data/stories/OnSelect.stories.js +2 -1
  65. package/components/Data/stories/SpaceX.stories.js +2 -1
  66. package/components/Data/stories/StarWars.stories.js +2 -1
  67. package/components/DataChart/DataChart.js +2 -1
  68. package/components/DataChart/Detail.js +2 -1
  69. package/components/DataChart/Legend.js +2 -1
  70. package/components/DataChart/XAxis.js +2 -1
  71. package/components/DataChart/XGuide.js +2 -1
  72. package/components/DataChart/YAxis.js +2 -1
  73. package/components/DataChart/YGuide.js +2 -1
  74. package/components/DataChart/stories/Prediction.stories.js +2 -1
  75. package/components/DataClearFilters/DataClearFilters.js +2 -1
  76. package/components/DataClearFilters/stories/Simple.stories.js +2 -1
  77. package/components/DataFilter/DataFilter.js +2 -1
  78. package/components/DataFilters/DataFilters.js +2 -1
  79. package/components/DataSearch/DataSearch.js +2 -1
  80. package/components/DataSort/DataSort.js +2 -1
  81. package/components/DataSummary/DataSummary.js +2 -1
  82. package/components/DataTable/Body.js +2 -1
  83. package/components/DataTable/Cell.js +2 -1
  84. package/components/DataTable/DataTable.js +2 -1
  85. package/components/DataTable/ExpanderCell.js +2 -1
  86. package/components/DataTable/Footer.js +2 -1
  87. package/components/DataTable/GroupedBody.js +2 -1
  88. package/components/DataTable/Header.js +2 -1
  89. package/components/DataTable/PlaceholderBody.js +2 -1
  90. package/components/DataTable/Resizer.js +2 -1
  91. package/components/DataTable/Searcher.js +2 -1
  92. package/components/DataTable/StyledDataTable.js +3 -2
  93. package/components/DataTable/stories/ControlledGrouped.stories.js +2 -1
  94. package/components/DataTable/stories/OnUpdate.stories.js +2 -1
  95. package/components/DataTable/stories/SpaceX.stories.js +2 -1
  96. package/components/DataTable/stories/SpaceXUngrouped.stories.js +2 -1
  97. package/components/DataTable/stories/rowDetails.stories.js +2 -1
  98. package/components/DataTableColumns/DataTableColumns.js +2 -1
  99. package/components/DataTableGroupBy/DataTableGroupBy.js +2 -1
  100. package/components/DataView/DataView.js +2 -1
  101. package/components/DateInput/DateInput.js +14 -7
  102. package/components/DateInput/stories/FormatInline.stories.js +2 -1
  103. package/components/DateTimeInput/DateTimeInput.js +21 -12
  104. package/components/DateTimeInput/StyledDateTimeInput.js +11 -2
  105. package/components/Diagram/Diagram.js +2 -1
  106. package/components/Diagram/StyledDiagram.js +2 -1
  107. package/components/Diagram/stories/Animated.stories.js +2 -1
  108. package/components/Diagram/stories/Progressing.stories.js +2 -1
  109. package/components/Drop/Drop.js +2 -1
  110. package/components/Drop/DropContainer.js +2 -1
  111. package/components/Drop/StyledDrop.js +2 -1
  112. package/components/Drop/stories/CustomThemed/Lazy.stories.js +2 -1
  113. package/components/Drop/stories/CustomThemed/Themed.stories.js +2 -1
  114. package/components/Drop/stories/Inline.stories.js +2 -1
  115. package/components/Drop/stories/Meter.stories.js +2 -1
  116. package/components/Drop/stories/Multiple.stories.js +2 -1
  117. package/components/Drop/stories/Overflow.stories.js +2 -1
  118. package/components/Drop/stories/Plain.stories.js +2 -1
  119. package/components/Drop/stories/Progressive.stories.js +2 -1
  120. package/components/Drop/stories/Simple.stories.js +2 -1
  121. package/components/Drop/stories/Styled.stories.js +2 -1
  122. package/components/DropButton/DropButton.js +2 -1
  123. package/components/FileInput/FileInput.js +78 -21
  124. package/components/FileInput/README.md +5 -0
  125. package/components/FocusedContainer.js +4 -2
  126. package/components/Form/Form.js +2 -1
  127. package/components/Form/FormContext.js +2 -1
  128. package/components/Form/stories/ArrayOfFormFields.stories.js +2 -1
  129. package/components/Form/stories/Controlled.stories.js +2 -1
  130. package/components/Form/stories/ControlledInput.stories.js +2 -1
  131. package/components/Form/stories/ControlledInputLazy.stories.js +2 -1
  132. package/components/Form/stories/ControlledLazy.stories.js +2 -1
  133. package/components/Form/stories/CustomThemed/FieldBorderPosition.stories.js +2 -1
  134. package/components/Form/stories/CustomThemed/FieldCustomStates.stories.js +2 -1
  135. package/components/Form/stories/DynamicFields.stories.js +2 -1
  136. package/components/Form/stories/FieldStates.stories.js +2 -1
  137. package/components/Form/stories/SolicitedFeedback.stories.js +2 -1
  138. package/components/Form/stories/UnsolicitedFeedback.stories.js +2 -1
  139. package/components/Form/stories/ValidateOnChange.stories.js +2 -1
  140. package/components/Form/stories/ValidateOnMount.stories.js +2 -1
  141. package/components/FormField/FormField.js +235 -76
  142. package/components/FormField/FormFieldContext.js +12 -0
  143. package/components/FormField/README.md +56 -1
  144. package/components/FormField/stories/CustomThemed/Appearance.stories.tsx +630 -0
  145. package/components/FormField/stories/Simple.stories.js +2 -1
  146. package/components/Grid/Grid.js +2 -1
  147. package/components/Grid/StyledGrid.js +2 -1
  148. package/components/Grid/stories/ResponsiveCards.stories.js +2 -1
  149. package/components/Grommet/Grommet.js +6 -2
  150. package/components/Grommet/StyledGrommet.js +5 -4
  151. package/components/Grommet/index.d.ts +10 -0
  152. package/components/Grommet/propTypes.js +6 -1
  153. package/components/Header/Header.js +2 -1
  154. package/components/Header/stories/Sticky.stories.js +2 -1
  155. package/components/Heading/Heading.js +2 -1
  156. package/components/Heading/HeadingSkeleton.js +2 -1
  157. package/components/Heading/StyledHeading.js +2 -1
  158. package/components/Image/Image.js +2 -1
  159. package/components/Image/StyledImage.js +2 -1
  160. package/components/InfiniteScroll/InfiniteScroll.js +2 -1
  161. package/components/Layer/Layer.js +2 -1
  162. package/components/Layer/LayerContainer.js +2 -1
  163. package/components/Layer/StyledLayer.js +2 -1
  164. package/components/List/List.js +2 -1
  165. package/components/List/stories/Order.stories.js +2 -1
  166. package/components/List/stories/Pinned.stories.js +2 -1
  167. package/components/Markdown/Markdown.js +2 -1
  168. package/components/MaskedInput/MaskedInput.js +2 -1
  169. package/components/Menu/Menu.js +3 -2
  170. package/components/Meter/Bar.js +2 -1
  171. package/components/Meter/Circle.js +2 -1
  172. package/components/Meter/Meter.js +2 -1
  173. package/components/Meter/StyledMeter.js +2 -1
  174. package/components/Meter/stories/Circle.stories.js +2 -1
  175. package/components/Meter/stories/VerticalBarMultiple.stories.js +2 -1
  176. package/components/NameValueList/NameValueList.js +2 -1
  177. package/components/NameValuePair/NameValuePair.js +2 -1
  178. package/components/Nav/stories/CustomThemed/JustifySidebar.stories.js +2 -1
  179. package/components/Nav/stories/Sidebar.stories.js +2 -1
  180. package/components/Notification/Notification.js +2 -1
  181. package/components/Notification/stories/Global.stories.js +2 -1
  182. package/components/Notification/stories/Title.stories.js +2 -1
  183. package/components/Notification/stories/TitleAndMessage.stories.js +2 -1
  184. package/components/Page/Page.js +2 -1
  185. package/components/Page/stories/PageNotificaton.stories.js +2 -1
  186. package/components/PageContent/PageContent.js +2 -1
  187. package/components/PageHeader/PageHeader.js +2 -1
  188. package/components/PageHeader/stories/MultipleActions.stories.js +2 -1
  189. package/components/Pagination/Pagination.js +2 -1
  190. package/components/Pagination/PaginationStep.js +2 -1
  191. package/components/Pagination/PaginationSummary.js +2 -1
  192. package/components/Pagination/stories/Grid.stories.js +2 -1
  193. package/components/Paragraph/Paragraph.js +2 -1
  194. package/components/Paragraph/ParagraphSkeleton.js +2 -1
  195. package/components/Paragraph/StyledParagraph.js +2 -1
  196. package/components/RadioButton/README.md +93 -1
  197. package/components/RadioButton/RadioButton.js +13 -5
  198. package/components/RadioButton/StyledRadioButton.js +103 -10
  199. package/components/RadioButton/stories/CustomThemed/Appearance.stories.tsx +190 -0
  200. package/components/RadioButtonGroup/RadioButtonGroup.js +2 -1
  201. package/components/RadioButtonGroup/stories/Children.stories.js +2 -1
  202. package/components/RadioButtonGroup/stories/CustomThemed/CustomTheme.stories.js +2 -1
  203. package/components/RadioButtonGroup/stories/Disabled.stories.js +2 -1
  204. package/components/RangeInput/RangeInput.js +2 -1
  205. package/components/RangeInput/StyledRangeInput.js +2 -1
  206. package/components/RangeInput/stories/CustomThemed/Bounds.stories.js +2 -1
  207. package/components/RangeSelector/EdgeControl.js +2 -1
  208. package/components/RangeSelector/RangeSelector.js +2 -1
  209. package/components/RangeSelector/index.d.ts +1 -10
  210. package/components/RangeSelector/stories/Basic.stories.js +2 -1
  211. package/components/RangeSelector/stories/CustomThemed/Custom.stories.js +2 -1
  212. package/components/RangeSelector/stories/CustomThemed/CustomEdgeControl.stories.js +2 -1
  213. package/components/RangeSelector/stories/Label.stories.js +2 -1
  214. package/components/RangeSelector/stories/Simple.stories.js +2 -1
  215. package/components/RangeSelector/stories/Step.stories.js +2 -1
  216. package/components/RangeSelector/stories/Thin.stories.js +2 -1
  217. package/components/RangeSelector/stories/Vertical.stories.js +2 -1
  218. package/components/RoutedAnchor/RoutedAnchor.js +2 -1
  219. package/components/RoutedButton/RoutedButton.js +2 -1
  220. package/components/Select/DefaultSelectTextInput.js +2 -1
  221. package/components/Select/Select.js +2 -1
  222. package/components/Select/SelectContainer.js +4 -3
  223. package/components/Select/StyledSelect.js +14 -4
  224. package/components/Select/stories/ChildrenRender.stories.js +2 -1
  225. package/components/Select/stories/Clear.stories.js +2 -1
  226. package/components/Select/stories/Controlled.stories.js +2 -1
  227. package/components/Select/stories/CustomThemed/CustomSearch.stories.js +2 -1
  228. package/components/Select/stories/Disabled.stories.js +2 -1
  229. package/components/Select/stories/InsideFormField.stories.js +2 -1
  230. package/components/Select/stories/Multiple.stories.js +2 -1
  231. package/components/Select/stories/ObjectOptions.stories.js +2 -1
  232. package/components/Select/stories/Search.stories.js +2 -1
  233. package/components/Select/stories/Simple.stories.js +2 -1
  234. package/components/Select/stories/ValueLabel.stories.js +2 -1
  235. package/components/Select/stories/components/SearchBorderBox.js +2 -1
  236. package/components/Select/stories/components/SearchInput.js +2 -1
  237. package/components/Select/utils.js +2 -1
  238. package/components/SelectMultiple/SelectMultiple.js +10 -4
  239. package/components/SelectMultiple/SelectMultipleContainer.js +2 -1
  240. package/components/SelectMultiple/SelectMultipleValue.js +2 -1
  241. package/components/SelectMultiple/SelectionSummary.js +2 -1
  242. package/components/SelectMultiple/stories/CustomMessages.stories.js +2 -1
  243. package/components/SelectMultiple/stories/Default.stories.js +2 -1
  244. package/components/SelectMultiple/stories/Disabled.stories.js +2 -1
  245. package/components/SelectMultiple/stories/FormField.stories.js +2 -1
  246. package/components/SelectMultiple/stories/Help.stories.js +2 -1
  247. package/components/SelectMultiple/stories/Limited.stories.js +2 -1
  248. package/components/SelectMultiple/stories/ObjectOptions.stories.js +2 -1
  249. package/components/SelectMultiple/stories/ShowSelectedInline.stories.js +2 -1
  250. package/components/Skeleton/Skeleton.js +2 -1
  251. package/components/Skeleton/SkeletonContext.js +2 -1
  252. package/components/Skeleton/stories/CustomThemed/Custom.stories.js +2 -1
  253. package/components/Skeleton/stories/GridContainer.stories.js +2 -1
  254. package/components/SkipLink/SkipLink.js +2 -1
  255. package/components/SkipLinks/SkipLinks.js +2 -1
  256. package/components/Spinner/Spinner.js +2 -1
  257. package/components/Spinner/stories/Animation.stories.js +2 -1
  258. package/components/Spinner/stories/Announced.stories.js +2 -1
  259. package/components/Stack/Stack.js +2 -1
  260. package/components/Stack/StyledStack.js +2 -1
  261. package/components/StarRating/StarRating.js +2 -1
  262. package/components/Stepper/Stepper.js +138 -101
  263. package/components/Stepper/StepperContext.js +5 -4
  264. package/components/Stepper/StepperDescription.js +6 -8
  265. package/components/Stepper/StepperHelperText.js +13 -15
  266. package/components/Stepper/StepperIndicator.js +37 -34
  267. package/components/Stepper/StepperLabel.js +11 -23
  268. package/components/Stepper/StepperStep.js +139 -82
  269. package/components/Stepper/StyledStepper.js +168 -115
  270. package/components/Stepper/index.d.ts +25 -13
  271. package/components/Stepper/index.js +5 -1
  272. package/components/Stepper/propTypes.js +3 -0
  273. package/components/Stepper/stories/Children.stories.tsx +73 -0
  274. package/components/Stepper/stories/CustomThemed.stories.tsx +301 -0
  275. package/components/Stepper/stories/CustomThemedHpe.stories.tsx +328 -0
  276. package/components/Stepper/stories/DisabledSteps.stories.js +2 -1
  277. package/components/Stepper/stories/ErrorStates.stories.js +2 -1
  278. package/components/Stepper/stories/HorizontalSteps.stories.js +2 -1
  279. package/components/Stepper/stories/Interactive.stories.js +2 -1
  280. package/components/Stepper/stories/KeyboardNavigation.stories.js +2 -1
  281. package/components/Stepper/stories/NestedSubSteps.stories.js +2 -1
  282. package/components/Stepper/stories/ThemingLightDark.stories.js +2 -1
  283. package/components/Stepper/stories/VerticalSteps.stories.js +2 -1
  284. package/components/Stepper/utils.js +54 -0
  285. package/components/Tab/StyledTab.js +2 -1
  286. package/components/Tab/Tab.js +2 -1
  287. package/components/Table/StyledTable.js +2 -1
  288. package/components/Table/Table.js +2 -1
  289. package/components/Table/stories/InfiniteScrollInTable.stories.js +2 -1
  290. package/components/TableBody/TableBody.js +2 -1
  291. package/components/TableCell/TableCell.js +2 -1
  292. package/components/TableFooter/TableFooter.js +2 -1
  293. package/components/TableHeader/TableHeader.js +2 -1
  294. package/components/TableRow/TableRow.js +2 -1
  295. package/components/Tabs/StyledTabs.js +2 -1
  296. package/components/Tabs/Tabs.js +2 -1
  297. package/components/Tabs/stories/CustomThemed/States.stories.js +2 -1
  298. package/components/Tabs/stories/Responsive.stories.js +2 -1
  299. package/components/Tag/Tag.js +2 -1
  300. package/components/Text/StyledText.js +2 -1
  301. package/components/Text/Text.js +2 -1
  302. package/components/Text/TextSkeleton.js +2 -1
  303. package/components/TextArea/StyledTextArea.js +5 -2
  304. package/components/TextArea/TextArea.js +2 -1
  305. package/components/TextArea/stories/CustomThemed/Themed.stories.js +2 -1
  306. package/components/TextArea/stories/InsideFormField.stories.js +2 -1
  307. package/components/TextArea/stories/NonResizable.stories.js +2 -1
  308. package/components/TextArea/stories/Simple.stories.js +2 -1
  309. package/components/TextInput/CopyButton.js +24 -6
  310. package/components/TextInput/README.md +29 -1
  311. package/components/TextInput/StyledTextInput.js +34 -26
  312. package/components/TextInput/TextInput.js +165 -41
  313. package/components/TextInput/index.d.ts +14 -3
  314. package/components/TextInput/propTypes.js +4 -0
  315. package/components/TextInput/stories/Clear.stories.tsx +68 -0
  316. package/components/TextInput/stories/ClearFormField.stories.tsx +45 -0
  317. package/components/TextInput/stories/Copy.stories.tsx +42 -0
  318. package/components/TextInput/stories/CopySecret.stories.tsx +44 -0
  319. package/components/TextInput/stories/InsideFormField.stories.js +2 -1
  320. package/components/TimeInput/README.md +24 -1
  321. package/components/TimeInput/StyledTimeInput.js +102 -28
  322. package/components/TimeInput/TimeInput.js +189 -121
  323. package/components/TimeInput/TimeInputPopup.js +116 -118
  324. package/components/TimeInput/index.d.ts +2 -0
  325. package/components/TimeInput/propTypes.js +2 -0
  326. package/components/TimeInput/stories/Controlled.stories.tsx +2 -2
  327. package/components/TimeInput/stories/CustomThemed.stories.tsx +79 -0
  328. package/components/TimeInput/stories/CustomThemedHpe.stories.tsx +115 -0
  329. package/components/TimeInput/stories/Form.stories.tsx +1 -0
  330. package/components/TimeInput/stories/Inline.stories.tsx +28 -0
  331. package/components/TimeInput/stories/ShowSeconds.stories.tsx +28 -0
  332. package/components/TimeInput/useSectionedTimeField.js +2 -2
  333. package/components/TimeInput/utils.js +13 -62
  334. package/components/Tip/Tip.js +2 -1
  335. package/components/Tip/stories/HeaderActions.stories.js +2 -1
  336. package/components/ToggleGroup/ToggleGroup.js +2 -1
  337. package/components/ToggleGroup/stories/Controlled.stories.js +2 -1
  338. package/components/Toolbar/Toolbar.js +2 -1
  339. package/components/Video/StyledVideo.js +2 -1
  340. package/components/Video/Video.js +2 -1
  341. package/components/Wizard/Wizard.js +409 -212
  342. package/components/Wizard/WizardContent.js +63 -36
  343. package/components/Wizard/WizardContext.js +5 -1
  344. package/components/Wizard/WizardFooter.js +14 -15
  345. package/components/Wizard/WizardHeader.js +12 -7
  346. package/components/Wizard/WizardProgress.js +28 -6
  347. package/components/Wizard/index.d.ts +35 -4
  348. package/components/Wizard/propTypes.js +6 -1
  349. package/components/Wizard/stories/BasicLinear.stories.js +14 -11
  350. package/components/Wizard/stories/Branching.stories.js +2 -1
  351. package/components/Wizard/stories/ClickableSteps.stories.js +105 -0
  352. package/components/Wizard/stories/Composable.stories.js +2 -1
  353. package/components/Wizard/stories/Controlled.stories.js +2 -1
  354. package/components/Wizard/stories/ExternalForm.stories.js +115 -0
  355. package/components/Wizard/stories/LongContent.stories.js +2 -1
  356. package/components/Wizard/stories/Modal.stories.js +2 -1
  357. package/components/Wizard/stories/NestedSubSteps.stories.js +2 -1
  358. package/components/Wizard/stories/NonClosableHeader.stories.js +69 -0
  359. package/components/Wizard/stories/ProgressiveSubSteps.stories.tsx +209 -0
  360. package/components/Wizard/stories/Validation.stories.js +20 -9
  361. package/components/WorldMap/WorldMap.js +2 -1
  362. package/contexts/AnalyticsContext/AnalyticsContext.js +2 -1
  363. package/contexts/AnnounceContext/stories/Polite.stories.js +2 -1
  364. package/contexts/RootsContext.js +2 -1
  365. package/contexts/ThemeContext/stories/ThemeContextExtend.stories.js +2 -1
  366. package/es6/components/Box/StyledBox.js +1 -1
  367. package/es6/components/Box/stories/ColorContrast.stories.js +31 -0
  368. package/es6/components/Button/BusyAnimation.js +7 -1
  369. package/es6/components/Button/Button.js +12 -3
  370. package/es6/components/Cards/index.d.ts +2 -16
  371. package/es6/components/CheckBox/README.md +95 -0
  372. package/es6/components/CheckBox/StyledCheckBox.js +103 -14
  373. package/es6/components/CheckBox/stories/CustomThemed/Appearance.stories.tsx +160 -0
  374. package/es6/components/DataTable/StyledDataTable.js +2 -2
  375. package/es6/components/DateInput/DateInput.js +13 -6
  376. package/es6/components/DateTimeInput/DateTimeInput.js +19 -11
  377. package/es6/components/DateTimeInput/StyledDateTimeInput.js +10 -2
  378. package/es6/components/FileInput/FileInput.js +77 -20
  379. package/es6/components/FileInput/README.md +5 -0
  380. package/es6/components/FocusedContainer.js +2 -1
  381. package/es6/components/FormField/FormField.js +231 -73
  382. package/es6/components/FormField/FormFieldContext.js +7 -0
  383. package/es6/components/FormField/README.md +56 -1
  384. package/es6/components/FormField/stories/CustomThemed/Appearance.stories.tsx +630 -0
  385. package/es6/components/Grommet/Grommet.js +4 -1
  386. package/es6/components/Grommet/StyledGrommet.js +4 -4
  387. package/es6/components/Grommet/index.d.ts +10 -0
  388. package/es6/components/Grommet/propTypes.js +6 -1
  389. package/es6/components/Menu/Menu.js +1 -1
  390. package/es6/components/RadioButton/README.md +93 -1
  391. package/es6/components/RadioButton/RadioButton.js +11 -4
  392. package/es6/components/RadioButton/StyledRadioButton.js +102 -8
  393. package/es6/components/RadioButton/stories/CustomThemed/Appearance.stories.tsx +190 -0
  394. package/es6/components/RangeSelector/index.d.ts +1 -10
  395. package/es6/components/Select/SelectContainer.js +2 -2
  396. package/es6/components/Select/StyledSelect.js +13 -4
  397. package/es6/components/SelectMultiple/SelectMultiple.js +9 -3
  398. package/es6/components/Stepper/Stepper.js +137 -101
  399. package/es6/components/Stepper/StepperContext.js +5 -4
  400. package/es6/components/Stepper/StepperDescription.js +6 -8
  401. package/es6/components/Stepper/StepperHelperText.js +13 -15
  402. package/es6/components/Stepper/StepperIndicator.js +38 -35
  403. package/es6/components/Stepper/StepperLabel.js +11 -23
  404. package/es6/components/Stepper/StepperStep.js +137 -81
  405. package/es6/components/Stepper/StyledStepper.js +167 -113
  406. package/es6/components/Stepper/index.d.ts +25 -13
  407. package/es6/components/Stepper/index.js +2 -1
  408. package/es6/components/Stepper/propTypes.js +3 -0
  409. package/es6/components/Stepper/stories/Children.stories.tsx +73 -0
  410. package/es6/components/Stepper/stories/CustomThemed.stories.tsx +301 -0
  411. package/es6/components/Stepper/stories/CustomThemedHpe.stories.tsx +328 -0
  412. package/es6/components/Stepper/utils.js +50 -0
  413. package/es6/components/TextArea/StyledTextArea.js +4 -2
  414. package/es6/components/TextInput/CopyButton.js +22 -6
  415. package/es6/components/TextInput/README.md +29 -1
  416. package/es6/components/TextInput/StyledTextInput.js +34 -27
  417. package/es6/components/TextInput/TextInput.js +164 -41
  418. package/es6/components/TextInput/index.d.ts +14 -3
  419. package/es6/components/TextInput/propTypes.js +4 -0
  420. package/es6/components/TextInput/stories/Clear.stories.tsx +68 -0
  421. package/es6/components/TextInput/stories/ClearFormField.stories.tsx +45 -0
  422. package/es6/components/TextInput/stories/Copy.stories.tsx +42 -0
  423. package/es6/components/TextInput/stories/CopySecret.stories.tsx +44 -0
  424. package/es6/components/TimeInput/README.md +24 -1
  425. package/es6/components/TimeInput/StyledTimeInput.js +101 -28
  426. package/es6/components/TimeInput/TimeInput.js +189 -122
  427. package/es6/components/TimeInput/TimeInputPopup.js +115 -118
  428. package/es6/components/TimeInput/index.d.ts +2 -0
  429. package/es6/components/TimeInput/propTypes.js +2 -0
  430. package/es6/components/TimeInput/stories/Controlled.stories.tsx +2 -2
  431. package/es6/components/TimeInput/stories/CustomThemed.stories.tsx +79 -0
  432. package/es6/components/TimeInput/stories/CustomThemedHpe.stories.tsx +115 -0
  433. package/es6/components/TimeInput/stories/Form.stories.tsx +1 -0
  434. package/es6/components/TimeInput/stories/Inline.stories.tsx +28 -0
  435. package/es6/components/TimeInput/stories/ShowSeconds.stories.tsx +28 -0
  436. package/es6/components/TimeInput/useSectionedTimeField.js +2 -2
  437. package/es6/components/TimeInput/utils.js +12 -61
  438. package/es6/components/Wizard/Wizard.js +407 -212
  439. package/es6/components/Wizard/WizardContent.js +62 -36
  440. package/es6/components/Wizard/WizardContext.js +3 -0
  441. package/es6/components/Wizard/WizardFooter.js +14 -15
  442. package/es6/components/Wizard/WizardHeader.js +12 -7
  443. package/es6/components/Wizard/WizardProgress.js +28 -6
  444. package/es6/components/Wizard/index.d.ts +35 -4
  445. package/es6/components/Wizard/propTypes.js +6 -1
  446. package/es6/components/Wizard/stories/BasicLinear.stories.js +11 -11
  447. package/es6/components/Wizard/stories/ClickableSteps.stories.js +99 -0
  448. package/es6/components/Wizard/stories/ExternalForm.stories.js +111 -0
  449. package/es6/components/Wizard/stories/NonClosableHeader.stories.js +63 -0
  450. package/es6/components/Wizard/stories/ProgressiveSubSteps.stories.tsx +209 -0
  451. package/es6/components/Wizard/stories/Validation.stories.js +18 -9
  452. package/es6/languages/default.json +7 -1
  453. package/es6/themes/base.d.ts +166 -153
  454. package/es6/themes/base.js +263 -201
  455. package/es6/utils/DOM.js +10 -7
  456. package/es6/utils/background.js +9 -7
  457. package/es6/utils/border.js +7 -0
  458. package/es6/utils/colors.js +84 -12
  459. package/es6/utils/legacyColorIsDark.js +17 -0
  460. package/es6/utils/styles.js +157 -29
  461. package/grommet.min.js +1 -1
  462. package/grommet.min.js.map +1 -1
  463. package/languages/default.json +7 -1
  464. package/package.json +36 -36
  465. package/themes/base.d.ts +166 -153
  466. package/themes/base.js +263 -201
  467. package/tools/draft-release-version-pr.js +1 -0
  468. package/tools/generate-release-notes.js +1 -1
  469. package/tools/license-header.js +1 -1
  470. package/tools/pack.js +1 -1
  471. package/tools/release-checklist.js +1 -1
  472. package/tools/release-notes-utils.js +1 -0
  473. package/tools/release-preparation.md +55 -0
  474. package/tools/release-stable.js +1 -1
  475. package/tools/release-styled-components-beta-stable.js +1 -1
  476. package/utils/DOM.js +10 -7
  477. package/utils/background.js +9 -7
  478. package/utils/border.js +8 -1
  479. package/utils/colors.js +84 -12
  480. package/utils/legacyColorIsDark.js +21 -0
  481. package/utils/styles.js +158 -32
  482. package/utils/useId.js +2 -1
  483. package/components/Stepper/StepConnector.js +0 -38
  484. package/es6/components/Stepper/StepConnector.js +0 -33
@@ -13,6 +13,7 @@ var _sectionHelpers = require("../../utils/sectionHelpers");
13
13
  var _Box = require("../Box");
14
14
  var _Button = require("../Button");
15
15
  var _Form = require("../Form");
16
+ var _FormFieldContext = require("../FormField/FormFieldContext");
16
17
  var _Keyboard = require("../Keyboard");
17
18
  var _StyledTimeInput = require("./StyledTimeInput");
18
19
  var _TimeInputPopup = require("./TimeInputPopup");
@@ -20,44 +21,51 @@ var _propTypes = require("./propTypes");
20
21
  var _useSectionedTimeField = require("./useSectionedTimeField");
21
22
  var _utils2 = require("./utils");
22
23
  var _excluded = ["defaultValue", "disabled", "focusOnOpen", "format", "id", "inline", "messages", "minuteStep", "name", "onChange", "onPartialChange", "readOnly", "showSeconds", "value"],
23
- _excluded2 = ["plain", "focusIndicator"]; // SPDX-FileCopyrightText: © Hewlett Packard Enterprise Development LP
24
+ _excluded2 = ["plain", "focusIndicator", "aria-describedby", "aria-invalid"],
25
+ _excluded3 = ["icon", "kind"]; // SPDX-FileCopyrightText: © Hewlett Packard Enterprise Development LP
24
26
  // SPDX-License-Identifier: Apache-2.0
25
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
27
+ var cache;
28
+ function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var r, c, a = Object.defineProperty, n = { __proto__: null, "default": e }; if (Object(e) !== e) return n; if (cache || "function" != typeof WeakMap || (cache = new WeakMap()), cache) { if (cache.has(e)) return cache.get(e); cache.set(e, n); } for (c in e) "default" !== c && {}.hasOwnProperty.call(e, c) && ((r = a && Object.getOwnPropertyDescriptor(e, c)) && (r.get || r.set) ? a(n, c, r) : n[c] = e[c]); return n; }
26
29
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
27
30
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
28
- var getDisplaySectionKey = function getDisplaySectionKey(section) {
29
- if (section === _utils2.SECTION_HOUR) return 'hour';
30
- if (section === _utils2.SECTION_MINUTE) return 'minute';
31
- if (section === _utils2.SECTION_SECOND) return 'second';
32
- return 'period';
33
- };
34
31
  var getDisplaySectionPrefix = function getDisplaySectionPrefix(section, index) {
35
32
  if (index === 0) return '';
36
33
  return section === _utils2.SECTION_PERIOD ? ' ' : ':';
37
34
  };
38
- var getDisplaySectionText = function getDisplaySectionText(_ref) {
39
- var key = _ref.key,
40
- section = _ref.section,
41
- sections = _ref.sections;
42
- if (sections[key] === undefined) return (0, _sectionHelpers.getSectionTokenFromType)((0, _utils2.sectionTypeFromSection)(section));
43
- if (section === _utils2.SECTION_PERIOD) return sections[key];
44
- return (0, _utils2.pad)(sections[key]);
45
- };
46
35
  var getSectionOrder = function getSectionOrder(format, showSeconds) {
47
- if (showSeconds === void 0) {
48
- showSeconds = format === '12';
49
- }
50
36
  var numericSections = showSeconds ? [_utils2.SECTION_HOUR, _utils2.SECTION_MINUTE, _utils2.SECTION_SECOND] : [_utils2.SECTION_HOUR, _utils2.SECTION_MINUTE];
51
37
  if (format === '12') {
52
38
  return [].concat(numericSections, [_utils2.SECTION_PERIOD]);
53
39
  }
54
40
  return numericSections;
55
41
  };
42
+ var getContainerFill = function getContainerFill(container) {
43
+ if (container === void 0) {
44
+ container = {};
45
+ }
46
+ var fillWidth = container.width === undefined;
47
+ var fillHeight = container.height === undefined;
48
+ if (fillWidth && fillHeight) return true;
49
+ if (fillWidth) return 'horizontal';
50
+ if (fillHeight) return 'vertical';
51
+ return false;
52
+ };
53
+ var resolveDropButtonIcon = function resolveDropButtonIcon(icon) {
54
+ if (/*#__PURE__*/_react["default"].isValidElement(icon)) {
55
+ var _icon$props$ariaHidd;
56
+ return /*#__PURE__*/_react["default"].cloneElement(icon, {
57
+ 'aria-hidden': (_icon$props$ariaHidd = icon.props['aria-hidden']) != null ? _icon$props$ariaHidd : true
58
+ });
59
+ }
60
+ if (typeof icon === 'function' || icon != null && icon.$$typeof) return /*#__PURE__*/_react["default"].createElement(icon, {
61
+ 'aria-hidden': true
62
+ });
63
+ return icon;
64
+ };
56
65
  var buildPlaceholder = function buildPlaceholder(sectionOrder) {
57
66
  return sectionOrder.map(function (section, index) {
58
67
  var token = (0, _sectionHelpers.getSectionTokenFromType)((0, _utils2.sectionTypeFromSection)(section));
59
- if (index === 0) return token;
60
- return "" + (section === _utils2.SECTION_PERIOD ? ' ' : ':') + token;
68
+ return "" + getDisplaySectionPrefix(section, index) + token;
61
69
  }).join('');
62
70
  };
63
71
 
@@ -75,28 +83,29 @@ var getDefaultFormat = function getDefaultFormat() {
75
83
  }
76
84
  };
77
85
  var DEFAULT_FORMAT = getDefaultFormat();
78
- var TimeInput = exports.TimeInput = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, refArg) {
79
- var _theme$timeInput, _theme$global, _theme$timeInput2;
80
- var defaultValue = _ref2.defaultValue,
81
- disabled = _ref2.disabled,
82
- _ref2$focusOnOpen = _ref2.focusOnOpen,
83
- focusOnOpen = _ref2$focusOnOpen === void 0 ? true : _ref2$focusOnOpen,
84
- _ref2$format = _ref2.format,
85
- format = _ref2$format === void 0 ? DEFAULT_FORMAT : _ref2$format,
86
- id = _ref2.id,
87
- _ref2$inline = _ref2.inline,
88
- inline = _ref2$inline === void 0 ? false : _ref2$inline,
89
- messages = _ref2.messages,
90
- _ref2$minuteStep = _ref2.minuteStep,
91
- minuteStep = _ref2$minuteStep === void 0 ? 1 : _ref2$minuteStep,
92
- name = _ref2.name,
93
- onChange = _ref2.onChange,
94
- onPartialChange = _ref2.onPartialChange,
95
- _ref2$readOnly = _ref2.readOnly,
96
- readOnly = _ref2$readOnly === void 0 ? false : _ref2$readOnly,
97
- showSeconds = _ref2.showSeconds,
98
- valueArg = _ref2.value,
99
- rest = _objectWithoutPropertiesLoose(_ref2, _excluded);
86
+ var TimeInput = exports.TimeInput = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, refArg) {
87
+ var _theme$timeInput, _theme$timeInput2, _theme$timeInput$cont, _theme$timeInput3, _theme$global, _theme$timeInput4;
88
+ var defaultValue = _ref.defaultValue,
89
+ disabled = _ref.disabled,
90
+ _ref$focusOnOpen = _ref.focusOnOpen,
91
+ focusOnOpen = _ref$focusOnOpen === void 0 ? true : _ref$focusOnOpen,
92
+ _ref$format = _ref.format,
93
+ format = _ref$format === void 0 ? DEFAULT_FORMAT : _ref$format,
94
+ id = _ref.id,
95
+ _ref$inline = _ref.inline,
96
+ inline = _ref$inline === void 0 ? false : _ref$inline,
97
+ messages = _ref.messages,
98
+ _ref$minuteStep = _ref.minuteStep,
99
+ minuteStep = _ref$minuteStep === void 0 ? 1 : _ref$minuteStep,
100
+ name = _ref.name,
101
+ onChange = _ref.onChange,
102
+ onPartialChange = _ref.onPartialChange,
103
+ _ref$readOnly = _ref.readOnly,
104
+ readOnly = _ref$readOnly === void 0 ? false : _ref$readOnly,
105
+ _ref$showSeconds = _ref.showSeconds,
106
+ showSeconds = _ref$showSeconds === void 0 ? false : _ref$showSeconds,
107
+ valueArg = _ref.value,
108
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded);
100
109
  var _useThemeValue = (0, _useThemeValue2.useThemeValue)(),
101
110
  theme = _useThemeValue.theme,
102
111
  passThemeFlag = _useThemeValue.passThemeFlag;
@@ -104,6 +113,8 @@ var TimeInput = exports.TimeInput = /*#__PURE__*/(0, _react.forwardRef)(function
104
113
  var _useContext = (0, _react.useContext)(_MessageContext.MessageContext),
105
114
  formatMessage = _useContext.format;
106
115
  var formContext = (0, _react.useContext)(_Form.FormContext);
116
+ var _useContext2 = (0, _react.useContext)(_FormFieldContext.FormFieldContext),
117
+ setFieldFocusIndicator = _useContext2.setFocusIndicator;
107
118
  var useFormInput = formContext.useFormInput;
108
119
  var inputRef = (0, _utils.useForwardedRef)(refArg);
109
120
  var containerRef = (0, _react.useRef)();
@@ -114,11 +125,9 @@ var TimeInput = exports.TimeInput = /*#__PURE__*/(0, _react.forwardRef)(function
114
125
  }),
115
126
  value = _useFormInput[0],
116
127
  setValue = _useFormInput[1];
117
- (0, _react.useEffect)(function () {
118
- if (process.env.NODE_ENV !== 'production') {
119
- console.warn('Warning: TimeInput is currently in beta. The API is subject ' + 'to change in future releases.');
120
- }
121
- }, []);
128
+ if (inline && (disabled || readOnly)) {
129
+ console.warn('TimeInput is rendered inline and is either disabled or read-only. ' + 'TimeInput ignores disabled and readOnly props when rendered inline.');
130
+ }
122
131
  var _formContext$useFormF = formContext.useFormField({}),
123
132
  inForm = _formContext$useFormF.inForm;
124
133
  var formFieldLabelId = inForm && id ? "grommet-" + id + "__label" : undefined;
@@ -138,11 +147,23 @@ var TimeInput = exports.TimeInput = /*#__PURE__*/(0, _react.forwardRef)(function
138
147
  var segmentRefs = (0, _react.useRef)({});
139
148
  var plainProp = rest.plain,
140
149
  focusIndicatorProp = rest.focusIndicator,
150
+ ariaDescribedBy = rest['aria-describedby'],
151
+ ariaInvalid = rest['aria-invalid'],
141
152
  inputRest = _objectWithoutPropertiesLoose(rest, _excluded2);
153
+
154
+ // FormField merges its generated error id into aria-describedby
155
+ // alongside any id the consumer already had on the child. Split those
156
+ // back apart so a pre-existing description stays on every segment,
157
+ // while the error id itself is only added to the segment(s) it's about.
158
+ var errorId = id ? "grommet-" + id + "__error" : undefined;
159
+ var describedByTokens = ariaDescribedBy ? ariaDescribedBy.split(' ').filter(Boolean) : [];
160
+ var hasErrorDescribedBy = !!errorId && describedByTokens.includes(errorId);
161
+ var consumerDescribedBy = describedByTokens.filter(function (token) {
162
+ return token !== errorId;
163
+ }).join(' ') || undefined;
142
164
  var normalizedMinuteStep = (0, _react.useMemo)(function () {
143
165
  return (0, _dates.normalizeStep)(minuteStep);
144
166
  }, [minuteStep]);
145
- var resolvedShowSeconds = showSeconds !== undefined ? showSeconds : format === '12';
146
167
  var handleInvalid = (0, _react.useCallback)(function () {
147
168
  var error = formatMessage({
148
169
  id: 'timeInput.invalidTime',
@@ -151,22 +172,25 @@ var TimeInput = exports.TimeInput = /*#__PURE__*/(0, _react.forwardRef)(function
151
172
  announce(error, 'assertive');
152
173
  }, [announce, formatMessage, messages]);
153
174
  var announceCurrentValue = (0, _react.useCallback)(function (nextSections) {
154
- if (nextSections.hour === undefined || nextSections.minute === undefined || nextSections.second === undefined) return;
175
+ if (nextSections.hour === undefined || nextSections.minute === undefined || showSeconds && nextSections.second === undefined) return;
155
176
  var period = format === '12' ? " " + (nextSections.period || 'AM') : '';
177
+ var messageId = showSeconds ? 'timeInput.currentValue' : 'timeInput.currentValueWithoutSeconds';
156
178
  announce(formatMessage({
157
- id: 'timeInput.currentValue',
179
+ id: messageId,
158
180
  messages: messages,
159
- values: {
181
+ values: _extends({
160
182
  hour: nextSections.hour,
161
- minute: nextSections.minute,
162
- second: nextSections.second,
183
+ minute: nextSections.minute
184
+ }, showSeconds ? {
185
+ second: nextSections.second
186
+ } : {}, {
163
187
  period: period
164
- }
188
+ })
165
189
  }), 'polite');
166
- }, [announce, format, formatMessage, messages]);
190
+ }, [announce, format, formatMessage, messages, showSeconds]);
167
191
  var sectionOrder = (0, _react.useMemo)(function () {
168
- return getSectionOrder(format, resolvedShowSeconds);
169
- }, [format, resolvedShowSeconds]);
192
+ return getSectionOrder(format, showSeconds);
193
+ }, [format, showSeconds]);
170
194
  var firstSection = sectionOrder[0] || _utils2.SECTION_HOUR;
171
195
  var lastSection = sectionOrder[sectionOrder.length - 1] || _utils2.SECTION_HOUR;
172
196
  var _useSectionedTimeFiel = (0, _useSectionedTimeField.useSectionedTimeField)({
@@ -231,8 +255,7 @@ var TimeInput = exports.TimeInput = /*#__PURE__*/(0, _react.forwardRef)(function
231
255
  }
232
256
  });
233
257
  }
234
- var sectionKey = (0, _sectionHelpers.getSectionKeyFromType)((0, _utils2.sectionTypeFromSection)(section));
235
- var sectionValue = sections[sectionKey];
258
+ var sectionValue = sections[(0, _utils2.sectionKey)(section)];
236
259
  if (sectionValue === undefined) {
237
260
  return formatMessage({
238
261
  id: 'timeInput.activeSection',
@@ -270,19 +293,36 @@ var TimeInput = exports.TimeInput = /*#__PURE__*/(0, _react.forwardRef)(function
270
293
  displaySectionsData[pendingSection] = pendingDigits[pendingSection];
271
294
  }
272
295
  return sectionOrder.map(function (section, index) {
273
- var key = getDisplaySectionKey(section);
296
+ var key = (0, _utils2.sectionKey)(section);
297
+ var sectionValue = displaySectionsData[key];
298
+ var text;
299
+ if (sectionValue === undefined) {
300
+ text = (0, _sectionHelpers.getSectionTokenFromType)((0, _utils2.sectionTypeFromSection)(section));
301
+ } else if (section === _utils2.SECTION_PERIOD) {
302
+ text = sectionValue;
303
+ } else {
304
+ text = (0, _utils2.pad)(sectionValue);
305
+ }
274
306
  return {
275
- section: section,
276
- prefix: getDisplaySectionPrefix(section, index),
277
- text: getDisplaySectionText({
278
- key: key,
307
+ ariaMeta: (0, _utils2.getSectionAriaMeta)({
279
308
  section: section,
280
- sections: displaySectionsData
309
+ format: format,
310
+ sections: sections
281
311
  }),
282
- filled: displaySectionsData[key] !== undefined
312
+ section: section,
313
+ prefix: getDisplaySectionPrefix(section, index),
314
+ text: text,
315
+ filled: sectionValue !== undefined
283
316
  };
284
317
  });
285
- }, [sectionOrder, sections, pendingDigits]);
318
+ }, [format, pendingDigits, sectionOrder, sections]);
319
+
320
+ // A required-field error is caused by whichever section(s) are still
321
+ // empty, so only announce it there; once every section has a value the
322
+ // error must be about the value as a whole, so announce it everywhere.
323
+ var allSectionsFilled = displaySections.every(function (entry) {
324
+ return entry.filled;
325
+ });
286
326
  var onDisplaySectionMouseDown = (0, _react.useCallback)(function (section, event) {
287
327
  if (readOnly) return;
288
328
  if (disabled) return;
@@ -319,8 +359,8 @@ var TimeInput = exports.TimeInput = /*#__PURE__*/(0, _react.forwardRef)(function
319
359
  }).sort(function (a, b) {
320
360
  return a.rect.left - b.rect.left;
321
361
  });
322
- var sectionFromBounds = sectionsWithRects.find(function (_ref3) {
323
- var rect = _ref3.rect;
362
+ var sectionFromBounds = sectionsWithRects.find(function (_ref2) {
363
+ var rect = _ref2.rect;
324
364
  return x >= rect.left && x <= rect.right;
325
365
  });
326
366
  if ((sectionFromBounds == null || (_sectionFromBounds$no = sectionFromBounds.node) == null || (_sectionFromBounds$no = _sectionFromBounds$no.dataset) == null ? void 0 : _sectionFromBounds$no.section) !== undefined) {
@@ -330,8 +370,8 @@ var TimeInput = exports.TimeInput = /*#__PURE__*/(0, _react.forwardRef)(function
330
370
  return;
331
371
  }
332
372
  }
333
- var zones = sectionsWithRects.map(function (_ref4, index) {
334
- var rect = _ref4.rect;
373
+ var zones = sectionsWithRects.map(function (_ref3, index) {
374
+ var rect = _ref3.rect;
335
375
  var prev = sectionsWithRects[index - 1];
336
376
  var next = sectionsWithRects[index + 1];
337
377
  var start = prev !== undefined ? (prev.rect.right + rect.left) / 2 : Number.NEGATIVE_INFINITY;
@@ -342,9 +382,9 @@ var TimeInput = exports.TimeInput = /*#__PURE__*/(0, _react.forwardRef)(function
342
382
  end: end
343
383
  };
344
384
  });
345
- var zone = zones.find(function (_ref5) {
346
- var start = _ref5.start,
347
- end = _ref5.end;
385
+ var zone = zones.find(function (_ref4) {
386
+ var start = _ref4.start,
387
+ end = _ref4.end;
348
388
  return x >= start && x <= end;
349
389
  }) || zones[0] || null;
350
390
  if (zone) {
@@ -376,6 +416,7 @@ var TimeInput = exports.TimeInput = /*#__PURE__*/(0, _react.forwardRef)(function
376
416
  }, 0);
377
417
  }, [activeSection, focusSection]);
378
418
  var onSegmentFocus = (0, _react.useCallback)(function (section) {
419
+ setFieldFocusIndicator == null || setFieldFocusIndicator(true);
379
420
  if (!segmentFocused && !readOnly && !disabled && !open) {
380
421
  announce(formatMessage({
381
422
  id: 'timeInput.openDrop',
@@ -385,24 +426,26 @@ var TimeInput = exports.TimeInput = /*#__PURE__*/(0, _react.forwardRef)(function
385
426
  setSegmentFocused(true);
386
427
  if (readOnly || disabled) return;
387
428
  setActiveSection(section);
388
- }, [announce, disabled, formatMessage, messages, open, readOnly, segmentFocused, setActiveSection]);
429
+ }, [announce, disabled, formatMessage, messages, open, readOnly, segmentFocused, setFieldFocusIndicator, setActiveSection]);
389
430
  var onSegmentBlur = (0, _react.useCallback)(function () {
390
431
  requestAnimationFrame(function () {
432
+ var _containerRef$current;
391
433
  var _document = document,
392
434
  activeElement = _document.activeElement;
393
435
  var isSegmentFocused = Object.values(segmentRefs.current).includes(activeElement);
394
- if (!isSegmentFocused && activeElement === document.body && !readOnly && !disabled) {
395
- focusSection(activeSection);
396
- return;
397
- }
398
- if (!isSegmentFocused) {
436
+ var isInsideTimeInput = (_containerRef$current = containerRef.current) == null ? void 0 : _containerRef$current.contains(activeElement);
437
+ if (!isSegmentFocused || !isInsideTimeInput) {
399
438
  setSegmentFocused(false);
400
439
  }
401
440
  });
402
- }, [activeSection, disabled, focusSection, readOnly]);
441
+ }, []);
403
442
  var onSegmentKeyDown = (0, _react.useCallback)(function (section, event) {
404
443
  if (readOnly || disabled) return;
405
- var key = event.key;
444
+ var key = event.key,
445
+ ctrlKey = event.ctrlKey,
446
+ metaKey = event.metaKey,
447
+ altKey = event.altKey;
448
+ if (ctrlKey || metaKey || altKey && key !== 'ArrowDown') return;
406
449
  if (activeSection !== section) {
407
450
  setActiveSection(section);
408
451
  }
@@ -411,10 +454,12 @@ var TimeInput = exports.TimeInput = /*#__PURE__*/(0, _react.forwardRef)(function
411
454
  var next = moveSection(1);
412
455
  setActiveSection(next);
413
456
  focusSection(next);
457
+ event.stopPropagation();
414
458
  return;
415
459
  }
416
460
  if (key === 'ArrowLeft') {
417
461
  event.preventDefault();
462
+ event.stopPropagation();
418
463
  var _next = moveSection(-1);
419
464
  setActiveSection(_next);
420
465
  focusSection(_next);
@@ -422,48 +467,51 @@ var TimeInput = exports.TimeInput = /*#__PURE__*/(0, _react.forwardRef)(function
422
467
  }
423
468
  if (key === 'Home') {
424
469
  event.preventDefault();
470
+ event.stopPropagation();
425
471
  setActiveSection(firstSection);
426
472
  focusSection(firstSection);
427
473
  return;
428
474
  }
429
475
  if (key === 'End') {
430
476
  event.preventDefault();
477
+ event.stopPropagation();
431
478
  setActiveSection(lastSection);
432
479
  focusSection(lastSection);
433
480
  return;
434
481
  }
435
482
  if (key === 'ArrowUp') {
436
483
  event.preventDefault();
484
+ event.stopPropagation();
437
485
  incrementSection(section, open ? -1 : 1);
438
486
  return;
439
487
  }
440
488
  if (key === 'ArrowDown') {
441
- if (event.altKey) {
489
+ if (altKey) {
442
490
  event.preventDefault();
491
+ event.stopPropagation();
443
492
  openPicker();
444
493
  return;
445
494
  }
446
495
  event.preventDefault();
496
+ event.stopPropagation();
447
497
  incrementSection(section, open ? 1 : -1);
448
498
  return;
449
499
  }
450
500
  if (key === 'Delete' || key === 'Backspace') {
451
501
  event.preventDefault();
502
+ event.stopPropagation();
452
503
  clearActiveSection();
453
504
  return;
454
505
  }
455
- if (key === 'Enter') {
456
- event.preventDefault();
457
- if (open) closePicker();
458
- return;
459
- }
460
- if (key === 'Escape' && open) {
506
+ if ((key === 'Enter' || key === 'Escape') && open) {
461
507
  event.preventDefault();
508
+ event.stopPropagation();
462
509
  closePicker();
463
510
  return;
464
511
  }
465
512
  if (key === ' ' || key === 'Spacebar') {
466
513
  event.preventDefault();
514
+ event.stopPropagation();
467
515
  openPicker();
468
516
  return;
469
517
  }
@@ -471,21 +519,23 @@ var TimeInput = exports.TimeInput = /*#__PURE__*/(0, _react.forwardRef)(function
471
519
  var lower = key.toLowerCase();
472
520
  if (lower === 'a') {
473
521
  event.preventDefault();
522
+ event.stopPropagation();
474
523
  setSectionValue(_utils2.SECTION_PERIOD, 'AM');
475
524
  } else if (lower === 'p') {
476
525
  event.preventDefault();
526
+ event.stopPropagation();
477
527
  setSectionValue(_utils2.SECTION_PERIOD, 'PM');
478
528
  }
479
529
  return;
480
530
  }
481
531
  if (/^\d$/.test(key)) {
482
532
  event.preventDefault();
533
+ event.stopPropagation();
483
534
  var _next2 = applyDigit(Number(key));
484
535
  var targetSection = _next2 != null ? _next2 : section;
485
536
  setActiveSection(targetSection);
486
- if (targetSection === section) {
487
- event.currentTarget.focus();
488
- } else {
537
+ if (targetSection !== section) {
538
+ // moving to a different section focus for digit',
489
539
  focusSection(targetSection);
490
540
  }
491
541
  }
@@ -541,13 +591,33 @@ var TimeInput = exports.TimeInput = /*#__PURE__*/(0, _react.forwardRef)(function
541
591
  });
542
592
  }, []);
543
593
  var showActiveSection = (segmentFocused || open) && !readOnly && !disabled;
594
+ var containerTheme = (_theme$timeInput = theme.timeInput) == null ? void 0 : _theme$timeInput.container;
595
+ var dropButtonTheme = (_theme$timeInput2 = theme.timeInput) == null ? void 0 : _theme$timeInput2.dropButton;
596
+ var dropButtonKind = 'toolbar';
597
+ var dropButtonIcon = /*#__PURE__*/_react["default"].createElement(_Clock.Clock, {
598
+ "aria-hidden": "true"
599
+ });
600
+ if (typeof dropButtonTheme === 'string') {
601
+ dropButtonKind = dropButtonTheme;
602
+ } else if (dropButtonTheme && typeof dropButtonTheme === 'object' && ! /*#__PURE__*/_react["default"].isValidElement(dropButtonTheme) && !dropButtonTheme.$$typeof) {
603
+ var icon = dropButtonTheme.icon,
604
+ kind = dropButtonTheme.kind,
605
+ buttonTheme = _objectWithoutPropertiesLoose(dropButtonTheme, _excluded3);
606
+ dropButtonIcon = resolveDropButtonIcon(icon != null ? icon : dropButtonIcon);
607
+ if (kind) {
608
+ dropButtonKind = kind;
609
+ } else {
610
+ var hasButtonTheme = Object.keys(buttonTheme).length > 0;
611
+ dropButtonKind = hasButtonTheme ? buttonTheme : 'toolbar';
612
+ }
613
+ }
544
614
  if (inline) {
545
615
  return /*#__PURE__*/_react["default"].createElement(_TimeInputPopup.TimeInputPopup, _extends({
546
616
  inline: true,
547
617
  activeSection: activeSection,
548
618
  format: format,
549
619
  formatMessage: formatMessage,
550
- focusOnOpen: focusOnOpen,
620
+ focusOnOpen: inline ? false : focusOnOpen,
551
621
  hoursOptions: hoursOptions,
552
622
  incrementSection: incrementSection,
553
623
  messages: messages,
@@ -565,21 +635,29 @@ var TimeInput = exports.TimeInput = /*#__PURE__*/(0, _react.forwardRef)(function
565
635
  ref: containerRef,
566
636
  direction: "row",
567
637
  border: !plainProp,
568
- fill: true,
569
- round: ((_theme$timeInput = theme.timeInput) == null || (_theme$timeInput = _theme$timeInput.container) == null ? void 0 : _theme$timeInput.round) || ((_theme$global = theme.global) == null || (_theme$global = _theme$global.control) == null || (_theme$global = _theme$global.border) == null ? void 0 : _theme$global.radius),
638
+ fill: getContainerFill(containerTheme)
639
+ }, containerTheme, {
640
+ round: (_theme$timeInput$cont = (_theme$timeInput3 = theme.timeInput) == null || (_theme$timeInput3 = _theme$timeInput3.container) == null ? void 0 : _theme$timeInput3.round) != null ? _theme$timeInput$cont : (_theme$global = theme.global) == null || (_theme$global = _theme$global.control) == null || (_theme$global = _theme$global.border) == null ? void 0 : _theme$global.radius,
570
641
  disabled: disabled,
642
+ plain: plainProp,
643
+ $inputPlain: plainProp,
571
644
  readOnlyProp: readOnly,
572
645
  focusIndicator: (focusIndicatorProp != null ? focusIndicatorProp : true) && !iconFocused
573
- }, passThemeFlag), /*#__PURE__*/_react["default"].createElement(_StyledTimeInput.StyledTimeInputField, passThemeFlag, /*#__PURE__*/_react["default"].createElement(_StyledTimeInput.StyledTimeInputDisplay, _extends({
646
+ }, passThemeFlag), /*#__PURE__*/_react["default"].createElement(_StyledTimeInput.StyledTimeInputField, passThemeFlag, /*#__PURE__*/_react["default"].createElement(_StyledTimeInput.StyledTimeInputDisplay, _extends({}, (_theme$timeInput4 = theme.timeInput) == null ? void 0 : _theme$timeInput4.value, {
647
+ align: "center",
648
+ direction: "row",
649
+ overflow: "hidden",
574
650
  role: "group",
575
651
  "aria-label": groupLabel,
576
652
  "aria-labelledby": formFieldLabelId,
577
653
  onMouseDown: onDisplayMouseDown
578
- }, passThemeFlag), displaySections.map(function (_ref6) {
579
- var section = _ref6.section,
580
- prefix = _ref6.prefix,
581
- text = _ref6.text,
582
- filled = _ref6.filled;
654
+ }, passThemeFlag), displaySections.map(function (_ref5) {
655
+ var ariaMeta = _ref5.ariaMeta,
656
+ section = _ref5.section,
657
+ prefix = _ref5.prefix,
658
+ text = _ref5.text,
659
+ filled = _ref5.filled;
660
+ var describeSegment = !filled || allSectionsFilled;
583
661
  return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, {
584
662
  key: section
585
663
  }, !!prefix && /*#__PURE__*/_react["default"].createElement(_StyledTimeInput.StyledTimeInputSeparator, _extends({
@@ -588,6 +666,7 @@ var TimeInput = exports.TimeInput = /*#__PURE__*/(0, _react.forwardRef)(function
588
666
  ref: function ref(segmentNode) {
589
667
  segmentRefs.current[section] = segmentNode;
590
668
  },
669
+ responsive: false,
591
670
  tabIndex: !readOnly && !disabled && activeSection === section ? 0 : -1,
592
671
  $active: showActiveSection && activeSection === section,
593
672
  $filled: filled,
@@ -600,28 +679,17 @@ var TimeInput = exports.TimeInput = /*#__PURE__*/(0, _react.forwardRef)(function
600
679
  },
601
680
  onPaste: onSegmentPaste,
602
681
  "data-active": showActiveSection && activeSection === section,
603
- "data-testid": showActiveSection && activeSection === section ? 'time-input-active-section' : undefined,
604
682
  "data-section": section
605
683
  }, passThemeFlag, {
606
684
  "aria-label": (0, _utils2.getSectionName)(section, format, formatMessage, messages),
607
685
  role: "spinbutton",
608
686
  "aria-disabled": disabled || undefined,
609
687
  "aria-readonly": readOnly || undefined,
610
- "aria-valuenow": (0, _utils2.getSectionAriaMeta)({
611
- section: section,
612
- format: format,
613
- sections: sections
614
- }).now,
615
- "aria-valuemin": (0, _utils2.getSectionAriaMeta)({
616
- section: section,
617
- format: format,
618
- sections: sections
619
- }).min,
620
- "aria-valuemax": (0, _utils2.getSectionAriaMeta)({
621
- section: section,
622
- format: format,
623
- sections: sections
624
- }).max,
688
+ "aria-invalid": ariaInvalid && describeSegment || undefined,
689
+ "aria-describedby": [consumerDescribedBy, describeSegment && hasErrorDescribedBy ? errorId : undefined].filter(Boolean).join(' ') || undefined,
690
+ "aria-valuenow": ariaMeta.now,
691
+ "aria-valuemin": ariaMeta.min,
692
+ "aria-valuemax": ariaMeta.max,
625
693
  "aria-valuetext": getSectionValueAnnouncement(section)
626
694
  }), text));
627
695
  })), /*#__PURE__*/_react["default"].createElement(_StyledTimeInput.StyledTimeInput, _extends({
@@ -643,10 +711,9 @@ var TimeInput = exports.TimeInput = /*#__PURE__*/(0, _react.forwardRef)(function
643
711
  type: "hidden",
644
712
  value: value || ''
645
713
  }), !readOnly && /*#__PURE__*/_react["default"].createElement(_Button.Button, {
646
- icon: /*#__PURE__*/_react["default"].createElement(_Clock.Clock, null),
647
- plain: true,
714
+ kind: dropButtonKind,
715
+ icon: dropButtonIcon,
648
716
  disabled: disabled,
649
- margin: (_theme$timeInput2 = theme.timeInput) == null || (_theme$timeInput2 = _theme$timeInput2.button) == null ? void 0 : _theme$timeInput2.margin,
650
717
  "aria-label": formatMessage({
651
718
  id: 'timeInput.chooseTime',
652
719
  messages: messages
@@ -656,6 +723,7 @@ var TimeInput = exports.TimeInput = /*#__PURE__*/(0, _react.forwardRef)(function
656
723
  "aria-controls": id ? id + "__drop" : undefined,
657
724
  onFocus: function onFocus() {
658
725
  setIconFocused(true);
726
+ setFieldFocusIndicator == null || setFieldFocusIndicator(false);
659
727
  },
660
728
  onBlur: function onBlur() {
661
729
  setIconFocused(false);