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
@@ -1,4 +1,7 @@
1
- var _excluded = ["activeSection", "align", "format", "formatMessage", "hoursOptions", "focusOnOpen", "id", "incrementSection", "messages", "minuteOptions", "onClose", "onFocusLeave", "secondOptions", "sectionOrder", "sections", "setActiveSection", "setSectionValue", "target", "dropProps", "label", "inline", "onKeyDown"];
1
+ var _excluded = ["hover", "selected"],
2
+ _excluded2 = ["hover"],
3
+ _excluded3 = ["activeSection", "align", "format", "formatMessage", "hoursOptions", "focusOnOpen", "id", "incrementSection", "messages", "minuteOptions", "onClose", "onFocusLeave", "secondOptions", "sectionOrder", "sections", "setActiveSection", "setSectionValue", "target", "dropProps", "label", "inline", "onKeyDown"],
4
+ _excluded4 = ["column", "option"];
2
5
  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); }
3
6
  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; }
4
7
  // SPDX-FileCopyrightText: © Hewlett Packard Enterprise Development LP
@@ -7,7 +10,7 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
7
10
  import React, { useCallback, useEffect, useRef } from 'react';
8
11
  import styled from 'styled-components';
9
12
  import { useLayoutEffect } from '../../utils/use-isomorphic-layout-effect';
10
- import { edgeStyle, focusStyle, normalizeColor, roundStyle } from '../../utils';
13
+ import { backgroundStyle, borderStyle, edgeStyle, elevationStyle, focusStyle, roundStyle } from '../../utils';
11
14
  import { useThemeValue } from '../../utils/useThemeValue';
12
15
  import { Box } from '../Box';
13
16
  import { Drop } from '../Drop';
@@ -16,36 +19,22 @@ import { defaultHourForFormat, pad, getSectionName, SECTION_HOUR, SECTION_MINUTE
16
19
  var PopupColumnBox = styled(Box).withConfig({
17
20
  displayName: "TimeInputPopup__PopupColumnBox",
18
21
  componentId: "sc-r2j8uh-0"
19
- })(["scrollbar-gutter:stable;scrollbar-width:thin;"]);
20
- var PopupOption = styled.div.withConfig({
22
+ })(["scrollbar-gutter:stable;"]);
23
+ var PopupOption = styled(Box).withConfig({
21
24
  displayName: "TimeInputPopup__PopupOption",
22
25
  componentId: "sc-r2j8uh-1"
23
- })(["box-sizing:border-box;cursor:pointer;display:flex;justify-content:center;", " ", " background:", ";&:hover{background:", ";}&:focus-visible{", "}"], function (props) {
24
- var _props$theme$timeInpu;
25
- var optionPad = (_props$theme$timeInpu = props.theme.timeInput) == null || (_props$theme$timeInpu = _props$theme$timeInpu.drop) == null || (_props$theme$timeInpu = _props$theme$timeInpu.option) == null ? void 0 : _props$theme$timeInpu.pad;
26
- return optionPad && edgeStyle('padding', optionPad, false, props.theme.box.responsiveBreakpoint, props.theme);
27
- }, function (props) {
28
- var _props$theme$timeInpu2, _props$theme$global$c;
29
- var round = ((_props$theme$timeInpu2 = props.theme.timeInput) == null || (_props$theme$timeInpu2 = _props$theme$timeInpu2.drop) == null || (_props$theme$timeInpu2 = _props$theme$timeInpu2.option) == null ? void 0 : _props$theme$timeInpu2.round) || ((_props$theme$global$c = props.theme.global.control) == null || (_props$theme$global$c = _props$theme$global$c.border) == null ? void 0 : _props$theme$global$c.radius);
30
- return round && roundStyle(round, false, props.theme);
31
- }, function (props) {
32
- var _props$theme$timeInpu5;
33
- if (props.$selected) {
34
- var _props$theme$timeInpu3;
35
- return normalizeColor((_props$theme$timeInpu3 = props.theme.timeInput) == null || (_props$theme$timeInpu3 = _props$theme$timeInpu3.drop) == null || (_props$theme$timeInpu3 = _props$theme$timeInpu3.option) == null || (_props$theme$timeInpu3 = _props$theme$timeInpu3.selected) == null ? void 0 : _props$theme$timeInpu3.background, props.theme);
36
- }
37
- if (props.$active) {
38
- var _props$theme$timeInpu4;
39
- return normalizeColor((_props$theme$timeInpu4 = props.theme.timeInput) == null || (_props$theme$timeInpu4 = _props$theme$timeInpu4.drop) == null || (_props$theme$timeInpu4 = _props$theme$timeInpu4.option) == null || (_props$theme$timeInpu4 = _props$theme$timeInpu4.hover) == null ? void 0 : _props$theme$timeInpu4.background, props.theme);
40
- }
41
- return normalizeColor((_props$theme$timeInpu5 = props.theme.timeInput) == null || (_props$theme$timeInpu5 = _props$theme$timeInpu5.drop) == null || (_props$theme$timeInpu5 = _props$theme$timeInpu5.option) == null ? void 0 : _props$theme$timeInpu5.background, props.theme);
42
- }, function (props) {
43
- var _props$theme$timeInpu8;
44
- if (props.$selected) {
45
- var _props$theme$timeInpu6, _props$theme$timeInpu7;
46
- return normalizeColor(((_props$theme$timeInpu6 = props.theme.timeInput) == null || (_props$theme$timeInpu6 = _props$theme$timeInpu6.drop) == null || (_props$theme$timeInpu6 = _props$theme$timeInpu6.option) == null || (_props$theme$timeInpu6 = _props$theme$timeInpu6.selected) == null || (_props$theme$timeInpu6 = _props$theme$timeInpu6.hover) == null ? void 0 : _props$theme$timeInpu6.background) || ((_props$theme$timeInpu7 = props.theme.timeInput) == null || (_props$theme$timeInpu7 = _props$theme$timeInpu7.drop) == null || (_props$theme$timeInpu7 = _props$theme$timeInpu7.option) == null || (_props$theme$timeInpu7 = _props$theme$timeInpu7.selected) == null ? void 0 : _props$theme$timeInpu7.background), props.theme);
47
- }
48
- return normalizeColor((_props$theme$timeInpu8 = props.theme.timeInput) == null || (_props$theme$timeInpu8 = _props$theme$timeInpu8.drop) == null || (_props$theme$timeInpu8 = _props$theme$timeInpu8.option) == null || (_props$theme$timeInpu8 = _props$theme$timeInpu8.hover) == null ? void 0 : _props$theme$timeInpu8.background, props.theme);
26
+ })(["cursor:pointer;&:hover{", "}&:focus-visible{", "}"], function (props) {
27
+ var theme = props.theme,
28
+ $hoverState = props.$hoverState,
29
+ $hoverBackground = props.$hoverBackground;
30
+ var responsive = props.responsive === undefined ? true : props.responsive;
31
+ var styles = [];
32
+ if ($hoverBackground !== undefined) styles.push(backgroundStyle($hoverBackground, theme));
33
+ if (($hoverState == null ? void 0 : $hoverState.border) !== undefined) styles.push(borderStyle($hoverState.border, responsive, theme));
34
+ if (($hoverState == null ? void 0 : $hoverState.elevation) !== undefined) styles.push(elevationStyle($hoverState.elevation));
35
+ if (($hoverState == null ? void 0 : $hoverState.pad) !== undefined) styles.push(edgeStyle('padding', $hoverState.pad, responsive, theme.box.responsiveBreakpoint, theme));
36
+ if (($hoverState == null ? void 0 : $hoverState.round) !== undefined) styles.push($hoverState.round === false ? 'border-radius: 0;' : roundStyle($hoverState.round, responsive, theme));
37
+ return styles;
49
38
  }, focusStyle({
50
39
  inset: true
51
40
  }));
@@ -64,7 +53,7 @@ var getDefaultPopupOption = function getDefaultPopupOption(_ref) {
64
53
  return options[0];
65
54
  };
66
55
  var PopupColumn = function PopupColumn(_ref2) {
67
- var _theme$global$size, _theme$timeInput, _theme$timeInput2;
56
+ var _theme$timeInput;
68
57
  var activeSection = _ref2.activeSection,
69
58
  format = _ref2.format,
70
59
  formatMessage = _ref2.formatMessage,
@@ -72,37 +61,40 @@ var PopupColumn = function PopupColumn(_ref2) {
72
61
  label = _ref2.label,
73
62
  messages = _ref2.messages,
74
63
  onClickCommitOption = _ref2.onClickCommitOption,
75
- onPointerCommitOption = _ref2.onPointerCommitOption,
76
64
  onSetSection = _ref2.onSetSection,
77
65
  options = _ref2.options,
78
66
  section = _ref2.section,
79
67
  sections = _ref2.sections,
80
- theme = _ref2.theme;
81
- // When inline (in DateTimeInput), use 'medium' to match Calendar height.
82
- // Otherwise use timeInput drop maxHeight with fallback to 'small'.
83
- var maxHeightToken = inline ? 'medium' : null;
84
- var maxHeight = maxHeightToken && ((_theme$global$size = theme.global.size) == null ? void 0 : _theme$global$size[maxHeightToken]) || ((_theme$timeInput = theme.timeInput) == null || (_theme$timeInput = _theme$timeInput.drop) == null || (_theme$timeInput = _theme$timeInput.column) == null ? void 0 : _theme$timeInput.maxHeight) || theme.global.size.small;
85
- return /*#__PURE__*/React.createElement(PopupColumnBox, {
68
+ theme = _ref2.theme,
69
+ passThemeFlag = _ref2.passThemeFlag;
70
+ var columnTheme = ((_theme$timeInput = theme.timeInput) == null || (_theme$timeInput = _theme$timeInput.drop) == null ? void 0 : _theme$timeInput.column) || {};
71
+ return /*#__PURE__*/React.createElement(PopupColumnBox, _extends({
86
72
  role: "listbox",
87
73
  "aria-label": label,
88
- gap: ((_theme$timeInput2 = theme.timeInput) == null || (_theme$timeInput2 = _theme$timeInput2.drop) == null || (_theme$timeInput2 = _theme$timeInput2.option) == null ? void 0 : _theme$timeInput2.gap) || 'xxsmall',
89
- height: {
90
- max: maxHeight
91
- },
92
74
  overflow: "auto",
93
75
  flex: {
94
76
  grow: 0,
95
77
  shrink: 0
96
78
  }
97
- }, options.map(function (option) {
98
- var _theme$timeInput3, _theme$timeInput4, _theme$timeInput5;
79
+ }, columnTheme, passThemeFlag), options.map(function (option) {
80
+ var _theme$timeInput2, _theme$timeInput3, _theme$timeInput4, _theme$timeInput5, _ref3, _hoverState$backgroun, _theme$timeInput6, _theme$timeInput7, _theme$timeInput8, _theme$timeInput$drop, _theme$timeInput9, _theme$timeInput0, _theme$timeInput1;
99
81
  var key = optionKey(label, option);
100
82
  var sectionHasValue = section === SECTION_HOUR && sections.hour !== undefined || section === SECTION_MINUTE && sections.minute !== undefined || section === SECTION_SECOND && sections.second !== undefined || section === SECTION_PERIOD && sections.period !== undefined;
101
83
 
102
84
  // In empty state, keep focus defaults but avoid visually selecting
103
85
  // options until the user makes an explicit choice.
104
86
  var selected = section === SECTION_HOUR && sections.hour === option || section === SECTION_MINUTE && sections.minute === option || section === SECTION_SECOND && sections.second === option || section === SECTION_PERIOD && sections.period === option;
105
- var optionColor = selected ? ((_theme$timeInput3 = theme.timeInput) == null || (_theme$timeInput3 = _theme$timeInput3.drop) == null || (_theme$timeInput3 = _theme$timeInput3.option) == null || (_theme$timeInput3 = _theme$timeInput3.selected) == null ? void 0 : _theme$timeInput3.color) || 'text' : 'text';
87
+ var optionColor = selected ? ((_theme$timeInput2 = theme.timeInput) == null || (_theme$timeInput2 = _theme$timeInput2.drop) == null || (_theme$timeInput2 = _theme$timeInput2.option) == null || (_theme$timeInput2 = _theme$timeInput2.text) == null || (_theme$timeInput2 = _theme$timeInput2.selected) == null ? void 0 : _theme$timeInput2.color) || ((_theme$timeInput3 = theme.timeInput) == null || (_theme$timeInput3 = _theme$timeInput3.drop) == null || (_theme$timeInput3 = _theme$timeInput3.option) == null || (_theme$timeInput3 = _theme$timeInput3.text) == null ? void 0 : _theme$timeInput3.color) || 'text' : ((_theme$timeInput4 = theme.timeInput) == null || (_theme$timeInput4 = _theme$timeInput4.drop) == null || (_theme$timeInput4 = _theme$timeInput4.option) == null || (_theme$timeInput4 = _theme$timeInput4.text) == null ? void 0 : _theme$timeInput4.color) || 'text';
88
+ var optionContainer = ((_theme$timeInput5 = theme.timeInput) == null || (_theme$timeInput5 = _theme$timeInput5.drop) == null || (_theme$timeInput5 = _theme$timeInput5.option) == null ? void 0 : _theme$timeInput5.container) || {};
89
+ var optionHover = optionContainer.hover,
90
+ _optionContainer$sele = optionContainer.selected,
91
+ selectedContainer = _optionContainer$sele === void 0 ? {} : _optionContainer$sele,
92
+ baseOptionStyles = _objectWithoutPropertiesLoose(optionContainer, _excluded);
93
+ var selectedHover = selectedContainer.hover,
94
+ selectedOptionStyles = _objectWithoutPropertiesLoose(selectedContainer, _excluded2);
95
+ var optionStyles = selected ? _extends({}, baseOptionStyles, selectedOptionStyles) : baseOptionStyles;
96
+ var hoverState = selected ? selectedHover : optionHover;
97
+ var hoverBackground = selected ? (_ref3 = (_hoverState$backgroun = hoverState == null ? void 0 : hoverState.background) != null ? _hoverState$backgroun : selectedContainer.background) != null ? _ref3 : baseOptionStyles.background : hoverState == null ? void 0 : hoverState.background;
106
98
  var isActive = selected && activeSection === section;
107
99
  var optionTabIndex = -1;
108
100
  if (inline) {
@@ -119,66 +111,66 @@ var PopupColumn = function PopupColumn(_ref2) {
119
111
  } else if (isActive) {
120
112
  optionTabIndex = 0;
121
113
  }
122
- return /*#__PURE__*/React.createElement(PopupOption, {
114
+ return /*#__PURE__*/React.createElement(PopupOption, _extends({
123
115
  key: key,
124
- "data-option-key": key,
125
116
  role: "option",
117
+ "data-option-key": key,
126
118
  "aria-selected": selected,
127
119
  tabIndex: optionTabIndex,
128
120
  "aria-label": (section === SECTION_PERIOD ? option : pad(option)) + " " + getSectionName(section, format, formatMessage, messages),
129
- $active: isActive,
130
- $selected: selected,
131
- onMouseDown: function onMouseDown(event) {
132
- if (event.button !== 0) return;
133
- // Commit on pointer press so momentum scroll does not swallow
134
- // the first click commit on some trackpad/mouse flows.
135
- onPointerCommitOption(section, option);
136
- },
121
+ flex: false,
122
+ $hoverState: hoverState,
123
+ $hoverBackground: hoverBackground
124
+ }, optionStyles, {
125
+ // This option owns its inset :focus-visible indicator. Box's
126
+ // focus tracking can retain state when tabIndex becomes -1.
127
+ focusIndicator: false,
137
128
  onClick: function onClick() {
138
129
  return onClickCommitOption(section, option);
139
130
  },
140
131
  onFocus: function onFocus() {
141
132
  return onSetSection(section);
142
133
  }
143
- }, /*#__PURE__*/React.createElement(Text, {
144
- size: ((_theme$timeInput4 = theme.timeInput) == null || (_theme$timeInput4 = _theme$timeInput4.drop) == null || (_theme$timeInput4 = _theme$timeInput4.option) == null ? void 0 : _theme$timeInput4.size) || theme.global.input.font.size || 'small',
145
- weight: selected ? (_theme$timeInput5 = theme.timeInput) == null || (_theme$timeInput5 = _theme$timeInput5.drop) == null || (_theme$timeInput5 = _theme$timeInput5.option) == null || (_theme$timeInput5 = _theme$timeInput5.selected) == null || (_theme$timeInput5 = _theme$timeInput5.text) == null ? void 0 : _theme$timeInput5.weight : undefined,
146
- color: optionColor
134
+ }), /*#__PURE__*/React.createElement(Text, {
135
+ size: selected ? ((_theme$timeInput6 = theme.timeInput) == null || (_theme$timeInput6 = _theme$timeInput6.drop) == null || (_theme$timeInput6 = _theme$timeInput6.option) == null || (_theme$timeInput6 = _theme$timeInput6.text) == null || (_theme$timeInput6 = _theme$timeInput6.selected) == null ? void 0 : _theme$timeInput6.size) || ((_theme$timeInput7 = theme.timeInput) == null || (_theme$timeInput7 = _theme$timeInput7.drop) == null || (_theme$timeInput7 = _theme$timeInput7.option) == null || (_theme$timeInput7 = _theme$timeInput7.text) == null ? void 0 : _theme$timeInput7.size) || theme.global.input.font.size || 'small' : ((_theme$timeInput8 = theme.timeInput) == null || (_theme$timeInput8 = _theme$timeInput8.drop) == null || (_theme$timeInput8 = _theme$timeInput8.option) == null || (_theme$timeInput8 = _theme$timeInput8.text) == null ? void 0 : _theme$timeInput8.size) || theme.global.input.font.size || 'small',
136
+ weight: selected ? (_theme$timeInput$drop = (_theme$timeInput9 = theme.timeInput) == null || (_theme$timeInput9 = _theme$timeInput9.drop) == null || (_theme$timeInput9 = _theme$timeInput9.option) == null || (_theme$timeInput9 = _theme$timeInput9.text) == null || (_theme$timeInput9 = _theme$timeInput9.selected) == null ? void 0 : _theme$timeInput9.weight) != null ? _theme$timeInput$drop : (_theme$timeInput0 = theme.timeInput) == null || (_theme$timeInput0 = _theme$timeInput0.drop) == null || (_theme$timeInput0 = _theme$timeInput0.option) == null || (_theme$timeInput0 = _theme$timeInput0.text) == null ? void 0 : _theme$timeInput0.weight : (_theme$timeInput1 = theme.timeInput) == null || (_theme$timeInput1 = _theme$timeInput1.drop) == null || (_theme$timeInput1 = _theme$timeInput1.option) == null || (_theme$timeInput1 = _theme$timeInput1.text) == null ? void 0 : _theme$timeInput1.weight,
137
+ color: optionColor,
138
+ textAlign: "center"
147
139
  }, section === SECTION_PERIOD ? option : pad(option)));
148
140
  }));
149
141
  };
150
- var TimeInputPopup = function TimeInputPopup(_ref3) {
151
- var _theme$timeInput6, _theme$timeInput7, _theme$timeInput8, _theme$timeInput9;
152
- var activeSection = _ref3.activeSection,
153
- align = _ref3.align,
154
- format = _ref3.format,
155
- formatMessage = _ref3.formatMessage,
156
- hoursOptions = _ref3.hoursOptions,
157
- _ref3$focusOnOpen = _ref3.focusOnOpen,
158
- focusOnOpen = _ref3$focusOnOpen === void 0 ? true : _ref3$focusOnOpen,
159
- id = _ref3.id,
160
- incrementSection = _ref3.incrementSection,
161
- messages = _ref3.messages,
162
- minuteOptions = _ref3.minuteOptions,
163
- onClose = _ref3.onClose,
164
- onFocusLeave = _ref3.onFocusLeave,
165
- secondOptions = _ref3.secondOptions,
166
- sectionOrder = _ref3.sectionOrder,
167
- sections = _ref3.sections,
168
- setActiveSection = _ref3.setActiveSection,
169
- setSectionValue = _ref3.setSectionValue,
170
- target = _ref3.target,
171
- dropProps = _ref3.dropProps,
172
- label = _ref3.label,
173
- _ref3$inline = _ref3.inline,
174
- inline = _ref3$inline === void 0 ? false : _ref3$inline,
175
- onKeyDownProp = _ref3.onKeyDown,
176
- rest = _objectWithoutPropertiesLoose(_ref3, _excluded);
142
+ var TimeInputPopup = function TimeInputPopup(_ref4) {
143
+ var _theme$timeInput10, _dropWidth$max;
144
+ var activeSection = _ref4.activeSection,
145
+ align = _ref4.align,
146
+ format = _ref4.format,
147
+ formatMessage = _ref4.formatMessage,
148
+ hoursOptions = _ref4.hoursOptions,
149
+ _ref4$focusOnOpen = _ref4.focusOnOpen,
150
+ focusOnOpen = _ref4$focusOnOpen === void 0 ? true : _ref4$focusOnOpen,
151
+ id = _ref4.id,
152
+ incrementSection = _ref4.incrementSection,
153
+ messages = _ref4.messages,
154
+ minuteOptions = _ref4.minuteOptions,
155
+ onClose = _ref4.onClose,
156
+ onFocusLeave = _ref4.onFocusLeave,
157
+ secondOptions = _ref4.secondOptions,
158
+ sectionOrder = _ref4.sectionOrder,
159
+ sections = _ref4.sections,
160
+ setActiveSection = _ref4.setActiveSection,
161
+ setSectionValue = _ref4.setSectionValue,
162
+ target = _ref4.target,
163
+ dropProps = _ref4.dropProps,
164
+ label = _ref4.label,
165
+ _ref4$inline = _ref4.inline,
166
+ inline = _ref4$inline === void 0 ? false : _ref4$inline,
167
+ onKeyDownProp = _ref4.onKeyDown,
168
+ rest = _objectWithoutPropertiesLoose(_ref4, _excluded3);
177
169
  var _useThemeValue = useThemeValue(),
178
- theme = _useThemeValue.theme;
170
+ theme = _useThemeValue.theme,
171
+ passThemeFlag = _useThemeValue.passThemeFlag;
179
172
  var dialogRef = useRef();
180
173
  var pointerDownInsideRef = useRef(false);
181
- var pointerSelectionCommittedRef = useRef(false);
182
174
  var suppressNextAutoScrollRef = useRef(false);
183
175
  var wheelInteractionTimeoutRef = useRef();
184
176
  var pointerReleaseTimeoutRef = useRef();
@@ -214,18 +206,14 @@ var TimeInputPopup = function TimeInputPopup(_ref3) {
214
206
  setActiveSection(section);
215
207
  setSectionValue(section, option);
216
208
  }, [setActiveSection, setSectionValue]);
217
- var commitPointerOptionSelection = useCallback(function (section, option) {
218
- pointerSelectionCommittedRef.current = true;
209
+
210
+ // Commit on the up-event (click), not mousedown - see WCAG 2.5.2 (Pointer
211
+ // Cancellation). Committing on press would leave no way to abort by
212
+ // moving the pointer off-target before releasing.
213
+ var commitClickOptionSelection = useCallback(function (section, option) {
219
214
  suppressNextAutoScroll();
220
215
  commitOptionSelection(section, option);
221
216
  }, [commitOptionSelection, suppressNextAutoScroll]);
222
- var commitClickOptionSelection = useCallback(function (section, option) {
223
- if (pointerSelectionCommittedRef.current) {
224
- pointerSelectionCommittedRef.current = false;
225
- return;
226
- }
227
- commitOptionSelection(section, option);
228
- }, [commitOptionSelection]);
229
217
  var onPopupWheelCapture = useCallback(function () {
230
218
  pointerDownInsideRef.current = true;
231
219
  if (wheelInteractionTimeoutRef.current) {
@@ -264,8 +252,8 @@ var TimeInputPopup = function TimeInputPopup(_ref3) {
264
252
  label: 'period',
265
253
  options: ['AM', 'PM']
266
254
  }];
267
- var visiblePopupSections = popupSections.filter(function (_ref4) {
268
- var section = _ref4.section;
255
+ var visiblePopupSections = popupSections.filter(function (_ref5) {
256
+ var section = _ref5.section;
269
257
  return sectionOrder.includes(section);
270
258
  });
271
259
  var getSectionFromLabel = useCallback(function (listboxLabel) {
@@ -310,8 +298,8 @@ var TimeInputPopup = function TimeInputPopup(_ref3) {
310
298
  format: format,
311
299
  options: secondOptions
312
300
  }), _sectionValue[SECTION_PERIOD] = sections.period || 'AM', _sectionValue);
313
- visiblePopupSections.forEach(function (_ref5) {
314
- var section = _ref5.section;
301
+ visiblePopupSections.forEach(function (_ref6) {
302
+ var section = _ref6.section;
315
303
  var labelValue = sectionLabel[section];
316
304
  if (!labelValue) return;
317
305
  var listboxNode = popupNode.querySelector("[role=\"listbox\"][aria-label=\"" + labelValue + "\"]");
@@ -397,27 +385,36 @@ var TimeInputPopup = function TimeInputPopup(_ref3) {
397
385
  if (rafB) window.cancelAnimationFrame(rafB);
398
386
  };
399
387
  }, [focusCurrentPopupOption, focusOnOpen, scrollSelectedOptionsIntoView]);
388
+ var dropTheme = (_theme$timeInput10 = theme.timeInput) == null ? void 0 : _theme$timeInput10.drop;
389
+ var column = dropTheme.column,
390
+ option = dropTheme.option,
391
+ dropBoxTheme = _objectWithoutPropertiesLoose(dropTheme, _excluded4);
392
+ var dropWidth = dropBoxTheme.width;
393
+ var popupWidth = typeof dropWidth === 'object' ? _extends({}, dropWidth, {
394
+ max: (_dropWidth$max = dropWidth.max) != null ? _dropWidth$max : '100%'
395
+ }) : {
396
+ width: dropWidth,
397
+ max: '100%'
398
+ };
400
399
  var popupContent = /*#__PURE__*/React.createElement(Box, _extends({
401
400
  ref: dialogRef,
402
401
  role: inline ? undefined : 'dialog',
403
402
  "aria-label": inline ? undefined : label,
404
403
  direction: "row",
405
- width: {
406
- width: (_theme$timeInput6 = theme.timeInput) == null || (_theme$timeInput6 = _theme$timeInput6.drop) == null ? void 0 : _theme$timeInput6.width,
407
- max: '100%'
408
- },
409
- minHeight: (_theme$timeInput7 = theme.timeInput) == null || (_theme$timeInput7 = _theme$timeInput7.drop) == null ? void 0 : _theme$timeInput7.minHeight,
410
- gap: ((_theme$timeInput8 = theme.timeInput) == null || (_theme$timeInput8 = _theme$timeInput8.drop) == null ? void 0 : _theme$timeInput8.gap) || 'xsmall',
411
- pad: inline ? 'none' : ((_theme$timeInput9 = theme.timeInput) == null || (_theme$timeInput9 = _theme$timeInput9.drop) == null ? void 0 : _theme$timeInput9.pad) || 'small',
404
+ width: popupWidth
405
+ }, dropBoxTheme, {
406
+ height: inline ? '100%' : dropBoxTheme.height,
407
+ pad: inline ? 'none' : dropBoxTheme.pad,
408
+ responsive: false,
412
409
  onPointerDownCapture: markInteractionInProgress,
413
410
  onPointerUpCapture: releaseInteractionAfterClick,
414
411
  onPointerCancelCapture: clearInteractionInProgress,
415
412
  onWheelCapture: onPopupWheelCapture,
416
413
  onKeyDown: function onKeyDown(event) {
417
- var _ref6;
414
+ var _ref7;
418
415
  var eventSectionFromTarget = getSectionFromEventTarget(event.target);
419
416
  var eventSectionFromActiveElement = getSectionFromEventTarget(document.activeElement);
420
- var eventSection = (_ref6 = eventSectionFromTarget != null ? eventSectionFromTarget : eventSectionFromActiveElement) != null ? _ref6 : activeSection;
417
+ var eventSection = (_ref7 = eventSectionFromTarget != null ? eventSectionFromTarget : eventSectionFromActiveElement) != null ? _ref7 : activeSection;
421
418
  if (event.key === 'Escape') {
422
419
  if (onClose) {
423
420
  event.preventDefault();
@@ -446,10 +443,10 @@ var TimeInputPopup = function TimeInputPopup(_ref3) {
446
443
  setActiveSection(getAdjacentSection(eventSection, 1));
447
444
  } else if (event.key === 'ArrowUp') {
448
445
  event.preventDefault();
449
- incrementSection(eventSection, 1);
446
+ incrementSection(eventSection, -1, true);
450
447
  } else if (event.key === 'ArrowDown') {
451
448
  event.preventDefault();
452
- incrementSection(eventSection, -1);
449
+ incrementSection(eventSection, 1, true);
453
450
  }
454
451
  onKeyDownProp == null || onKeyDownProp(event);
455
452
  },
@@ -469,10 +466,10 @@ var TimeInputPopup = function TimeInputPopup(_ref3) {
469
466
  onFocusLeave == null || onFocusLeave();
470
467
  }
471
468
  }
472
- }, rest), visiblePopupSections.map(function (_ref7) {
473
- var section = _ref7.section,
474
- sectionLabel = _ref7.label,
475
- options = _ref7.options;
469
+ }, rest), visiblePopupSections.map(function (_ref8) {
470
+ var section = _ref8.section,
471
+ sectionLabel = _ref8.label,
472
+ options = _ref8.options;
476
473
  return /*#__PURE__*/React.createElement(PopupColumn, {
477
474
  key: sectionLabel,
478
475
  activeSection: activeSection,
@@ -482,12 +479,12 @@ var TimeInputPopup = function TimeInputPopup(_ref3) {
482
479
  label: sectionLabel,
483
480
  messages: messages,
484
481
  onClickCommitOption: commitClickOptionSelection,
485
- onPointerCommitOption: commitPointerOptionSelection,
486
482
  onSetSection: setActiveSection,
487
483
  options: options,
488
484
  section: section,
489
485
  sections: sections,
490
- theme: theme
486
+ theme: theme,
487
+ passThemeFlag: passThemeFlag
491
488
  });
492
489
  }));
493
490
  if (inline) return popupContent;
@@ -7,12 +7,14 @@ export interface TimeInputProps {
7
7
  disabled?: boolean;
8
8
  format?: '12' | '24';
9
9
  id?: string;
10
+ inline?: boolean;
10
11
  messages?: {
11
12
  activePeriodValue?: string;
12
13
  activeSection?: string;
13
14
  activeSectionValue?: string;
14
15
  chooseTime?: string;
15
16
  currentValue?: string;
17
+ currentValueWithoutSeconds?: string;
16
18
  inputLabel?: string;
17
19
  invalidTime?: string;
18
20
  openDrop?: string;
@@ -8,12 +8,14 @@ if (process.env.NODE_ENV !== 'production') {
8
8
  disabled: PropTypes.bool,
9
9
  format: PropTypes.oneOf(['12', '24']),
10
10
  id: PropTypes.string,
11
+ inline: PropTypes.bool,
11
12
  messages: PropTypes.shape({
12
13
  activePeriodValue: PropTypes.string,
13
14
  activeSection: PropTypes.string,
14
15
  activeSectionValue: PropTypes.string,
15
16
  chooseTime: PropTypes.string,
16
17
  currentValue: PropTypes.string,
18
+ currentValueWithoutSeconds: PropTypes.string,
17
19
  inputLabel: PropTypes.string,
18
20
  invalidTime: PropTypes.string,
19
21
  openDrop: PropTypes.string,
@@ -5,7 +5,7 @@ import React from 'react';
5
5
  import { Box, Button, Text, TimeInput } from 'grommet';
6
6
 
7
7
  export const Controlled = () => {
8
- const [value, setValue] = React.useState('12:34:56');
8
+ const [value, setValue] = React.useState('12:34');
9
9
 
10
10
  const onChange = ({ value: next }: { value?: string }) => {
11
11
  console.log('onChange iso time:', next);
@@ -19,7 +19,7 @@ export const Controlled = () => {
19
19
  </Text>
20
20
  <TimeInput format="12" value={value} onChange={onChange} />
21
21
  <Box direction="row" gap="small">
22
- <Button label="Set 01:02:03 PM" onClick={() => setValue('13:02:03')} />
22
+ <Button label="Set 01:02 PM" onClick={() => setValue('13:02')} />
23
23
  <Button label="Clear" onClick={() => setValue('')} />
24
24
  </Box>
25
25
  </Box>
@@ -0,0 +1,79 @@
1
+ // SPDX-FileCopyrightText: © Hewlett Packard Enterprise Development LP
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import React from 'react';
4
+ import { Box, Grommet, Heading, TimeInput, ThemeType } from 'grommet';
5
+ import { FormClock } from 'grommet-icons';
6
+
7
+ const theme: ThemeType = {
8
+ timeInput: {
9
+ container: {
10
+ border: { color: 'brand', size: 'small' },
11
+ round: 'small',
12
+ },
13
+ value: {
14
+ pad: { horizontal: 'small' },
15
+ background: 'background-front',
16
+ round: 'xsmall',
17
+ },
18
+ segment: {
19
+ color: 'text',
20
+ placeholder: { color: 'text-weak' },
21
+ size: 'medium',
22
+ weight: 500,
23
+ pad: 'xxsmall',
24
+ active: {
25
+ background: 'background-contrast',
26
+ border: { color: 'brand', side: 'bottom', size: 'small' },
27
+ },
28
+ },
29
+ dropButton: {
30
+ icon: <FormClock />,
31
+ background: 'brand',
32
+ color: 'white',
33
+ padding: { vertical: 'xsmall', horizontal: 'small' },
34
+ },
35
+ drop: {
36
+ background: 'background-front',
37
+ border: { color: 'border', size: 'small' },
38
+ round: 'small',
39
+ pad: 'xsmall',
40
+ width: '20rem',
41
+ column: {
42
+ height: { max: 'medium' },
43
+ gap: 'xxsmall',
44
+ pad: { horizontal: 'xsmall' },
45
+ round: 'small',
46
+ },
47
+ option: {
48
+ container: {
49
+ pad: { vertical: 'xsmall', horizontal: 'small' },
50
+ round: 'xsmall',
51
+ hover: { background: 'background-contrast' },
52
+ selected: {
53
+ background: 'selected',
54
+ hover: { background: 'brand' },
55
+ },
56
+ },
57
+ text: {
58
+ size: 'small',
59
+ selected: { color: 'white', weight: 600 },
60
+ },
61
+ },
62
+ },
63
+ },
64
+ };
65
+
66
+ export const CustomThemed = () => (
67
+ <Grommet theme={theme}>
68
+ <Box gap="medium" pad="large" width="medium">
69
+ <Heading level={3} margin="none">
70
+ Custom themed time input
71
+ </Heading>
72
+ <TimeInput format="12" defaultValue="10:15:20" />
73
+ </Box>
74
+ </Grommet>
75
+ );
76
+
77
+ export default {
78
+ title: 'Input/TimeInput/Custom Themed',
79
+ };
@@ -0,0 +1,115 @@
1
+ // SPDX-FileCopyrightText: © Hewlett Packard Enterprise Development LP
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import React from 'react';
4
+
5
+ import { hpe } from 'grommet-theme-hpe';
6
+ import {
7
+ Box,
8
+ Grommet,
9
+ Heading,
10
+ ThemeContext,
11
+ ThemeType,
12
+ TimeInput,
13
+ } from 'grommet';
14
+ import { deepMerge } from 'grommet/utils';
15
+ import {
16
+ components,
17
+ dimension,
18
+ global as globalTokens,
19
+ } from 'hpe-design-tokens/grommet';
20
+
21
+ const { hpe: hpeComponents } = components;
22
+ const { hpe: hpeDimension } = dimension;
23
+ const { hpe: hpeGlobal } = globalTokens;
24
+
25
+ const theme: ThemeType = deepMerge({}, hpe);
26
+ theme.timeInput = {
27
+ container: {
28
+ round: hpeComponents.formField.default.medium.input.container.borderRadius,
29
+ },
30
+ segment: {
31
+ pad: {
32
+ start: hpeDimension.spacing['5xsmall'],
33
+ end: hpeDimension.spacing['5xsmall'],
34
+ },
35
+ active: {
36
+ background: 'background-active',
37
+ border: {
38
+ size: 'small',
39
+ color: 'focus',
40
+ },
41
+ pad: {
42
+ start: hpeDimension.spacing['5xsmall'],
43
+ end: hpeDimension.spacing['5xsmall'],
44
+ },
45
+ },
46
+ },
47
+ drop: {
48
+ column: {
49
+ gap: hpeDimension.spacing['4xsmall'],
50
+ pad: { horizontal: '3xsmall' },
51
+ },
52
+ pad: { horizontal: '3xsmall', vertical: 'xsmall' },
53
+ option: {
54
+ container: {
55
+ pad: {
56
+ vertical: hpeComponents.element.medium.paddingY,
57
+ horizontal: hpeComponents.element.medium.paddingX.default,
58
+ },
59
+ round: hpeDimension.radius.xxsmall,
60
+ hover: {
61
+ background: 'background-active',
62
+ },
63
+ selected: {
64
+ background: 'background-selected-primary-strong',
65
+ hover: {
66
+ background: 'background-selected-primary-strong-hover',
67
+ },
68
+ },
69
+ },
70
+ text: {
71
+ size: hpeDimension.text.medium.fontSize,
72
+ selected: {
73
+ color: 'text-onSelectedPrimaryStrong',
74
+ weight: hpeGlobal.fontWeight.medium,
75
+ },
76
+ },
77
+ },
78
+ },
79
+ };
80
+
81
+ export const CustomThemedHpe = () => (
82
+ <Grommet theme={theme}>
83
+ <Box gap="xlarge" pad="large">
84
+ <Box width="medium" gap="medium">
85
+ <Heading level={3} margin="none">
86
+ Full TimeInput theme, extending grommet-theme-hpe
87
+ </Heading>
88
+ <TimeInput format="12" showSeconds />
89
+ <TimeInput format="12" />
90
+ <TimeInput format="24" showSeconds />
91
+ <TimeInput format="24" />
92
+ </Box>
93
+ <ThemeContext.Extend value={{ dark: true }}>
94
+ <Box
95
+ width="medium"
96
+ gap="medium"
97
+ pad="large"
98
+ background="background-front"
99
+ >
100
+ <Heading level={3} margin="none">
101
+ Dark Theme
102
+ </Heading>
103
+ <TimeInput format="12" showSeconds />
104
+ <TimeInput format="12" />
105
+ <TimeInput format="24" showSeconds />
106
+ <TimeInput format="24" />
107
+ </Box>
108
+ </ThemeContext.Extend>
109
+ </Box>
110
+ </Grommet>
111
+ );
112
+
113
+ export default {
114
+ title: 'Input/TimeInput/Custom Themed/Hpe',
115
+ };
@@ -16,6 +16,7 @@ export const TimeForm = () => {
16
16
  value={value}
17
17
  onChange={onChange}
18
18
  onSubmit={() => {
19
+ console.log('Form submitted with value:', value);
19
20
  setValue({ value: '' });
20
21
  }}
21
22
  >