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
@@ -330,7 +330,7 @@ var formatSectionText = function formatSectionText(section, value) {
330
330
  return pad(value);
331
331
  };
332
332
  var DateTimeInput = /*#__PURE__*/forwardRef(function (_ref, refArg) {
333
- var _theme$dateTimeInput, _theme$global$edgeSiz, _theme$global$edgeSiz2, _theme$dateTimeInput2, _theme$dateTimeInput3, _theme$dateTimeInput4, _theme$dateTimeInput5, _theme$calendar, _theme$dateTimeInput6, _theme$dateTimeInput7, _theme$dateTimeInput8, _theme$dateTimeInput9;
333
+ var _theme$dateTimeInput, _theme$global$edgeSiz, _theme$global$edgeSiz2, _theme$dateTimeInput2, _theme$dateTimeInput3, _theme$dateTimeInput4, _theme$dateTimeInput5, _theme$dateTimeInput6, _theme$calendar, _theme$dateTimeInput7, _theme$dateTimeInput8, _theme$dateTimeInput9, _theme$dateTimeInput0;
334
334
  var defaultValue = _ref.defaultValue,
335
335
  disabled = _ref.disabled,
336
336
  format = _ref.format,
@@ -951,29 +951,34 @@ var DateTimeInput = /*#__PURE__*/forwardRef(function (_ref, refArg) {
951
951
  "aria-label": groupLabel,
952
952
  "aria-labelledby": formFieldLabelId,
953
953
  direction: "row",
954
+ cssGap: true,
954
955
  pad: (_theme$dateTimeInput3 = theme.dateTimeInput) == null || (_theme$dateTimeInput3 = _theme$dateTimeInput3.drop) == null ? void 0 : _theme$dateTimeInput3.pad,
955
- gap: (_theme$dateTimeInput4 = theme.dateTimeInput) == null || (_theme$dateTimeInput4 = _theme$dateTimeInput4.drop) == null ? void 0 : _theme$dateTimeInput4.gap
956
+ gap: (_theme$dateTimeInput4 = theme.dateTimeInput) == null || (_theme$dateTimeInput4 = _theme$dateTimeInput4.drop) == null ? void 0 : _theme$dateTimeInput4.gap,
957
+ height: (_theme$dateTimeInput5 = theme.dateTimeInput) == null || (_theme$dateTimeInput5 = _theme$dateTimeInput5.drop) == null ? void 0 : _theme$dateTimeInput5.height
956
958
  }, /*#__PURE__*/React.createElement(ThemeContext.Extend, {
957
959
  value: {
958
960
  calendar: {
959
961
  day: {
960
962
  selected: {
961
- background: ((_theme$dateTimeInput5 = theme.dateTimeInput) == null || (_theme$dateTimeInput5 = _theme$dateTimeInput5.calendar) == null || (_theme$dateTimeInput5 = _theme$dateTimeInput5.day) == null || (_theme$dateTimeInput5 = _theme$dateTimeInput5.selected) == null ? void 0 : _theme$dateTimeInput5.background) || ((_theme$calendar = theme.calendar) == null || (_theme$calendar = _theme$calendar.day) == null || (_theme$calendar = _theme$calendar.selected) == null ? void 0 : _theme$calendar.background)
963
+ background: ((_theme$dateTimeInput6 = theme.dateTimeInput) == null || (_theme$dateTimeInput6 = _theme$dateTimeInput6.calendar) == null || (_theme$dateTimeInput6 = _theme$dateTimeInput6.day) == null || (_theme$dateTimeInput6 = _theme$dateTimeInput6.selected) == null ? void 0 : _theme$dateTimeInput6.background) || ((_theme$calendar = theme.calendar) == null || (_theme$calendar = _theme$calendar.day) == null || (_theme$calendar = _theme$calendar.selected) == null ? void 0 : _theme$calendar.background)
962
964
  }
963
965
  }
964
966
  }
965
967
  }
968
+ }, /*#__PURE__*/React.createElement(Box, {
969
+ width: "medium",
970
+ flex: false
966
971
  }, /*#__PURE__*/React.createElement(Calendar, {
967
972
  date: getCalendarDate(sections),
968
973
  initialFocus: inline ? undefined : 'days',
969
- onSelect: disabled || readOnly ? undefined : handleCalendarSelect
970
- })), /*#__PURE__*/React.createElement(Box, {
974
+ onSelect: disabled || readOnly ? undefined : handleCalendarSelect,
975
+ fill: true
976
+ }))), /*#__PURE__*/React.createElement(Box, {
971
977
  alignSelf: "stretch",
972
- flex: false,
973
978
  border: {
974
979
  side: 'start',
975
- color: (_theme$dateTimeInput6 = theme.dateTimeInput) == null || (_theme$dateTimeInput6 = _theme$dateTimeInput6.drop) == null || (_theme$dateTimeInput6 = _theme$dateTimeInput6.border) == null ? void 0 : _theme$dateTimeInput6.color,
976
- size: (_theme$dateTimeInput7 = theme.dateTimeInput) == null || (_theme$dateTimeInput7 = _theme$dateTimeInput7.drop) == null || (_theme$dateTimeInput7 = _theme$dateTimeInput7.border) == null ? void 0 : _theme$dateTimeInput7.size
980
+ color: (_theme$dateTimeInput7 = theme.dateTimeInput) == null || (_theme$dateTimeInput7 = _theme$dateTimeInput7.drop) == null || (_theme$dateTimeInput7 = _theme$dateTimeInput7.border) == null ? void 0 : _theme$dateTimeInput7.color,
981
+ size: (_theme$dateTimeInput8 = theme.dateTimeInput) == null || (_theme$dateTimeInput8 = _theme$dateTimeInput8.drop) == null || (_theme$dateTimeInput8 = _theme$dateTimeInput8.border) == null ? void 0 : _theme$dateTimeInput8.size
977
982
  }
978
983
  }), /*#__PURE__*/React.createElement(TimeInput, {
979
984
  inline: true,
@@ -986,7 +991,8 @@ var DateTimeInput = /*#__PURE__*/forwardRef(function (_ref, refArg) {
986
991
  disabled: disabled,
987
992
  readOnly: readOnly,
988
993
  onChange: disabled || readOnly ? undefined : handleTimeSelect,
989
- onPartialChange: disabled || readOnly ? undefined : handleTimePartialChange
994
+ onPartialChange: disabled || readOnly ? undefined : handleTimePartialChange,
995
+ fill: true
990
996
  }));
991
997
  if (inline) {
992
998
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("input", _extends({}, rest, {
@@ -1007,8 +1013,10 @@ var DateTimeInput = /*#__PURE__*/forwardRef(function (_ref, refArg) {
1007
1013
  direction: "row",
1008
1014
  border: !plainProp,
1009
1015
  fill: true,
1010
- round: (_theme$dateTimeInput8 = theme.dateTimeInput) == null || (_theme$dateTimeInput8 = _theme$dateTimeInput8.container) == null ? void 0 : _theme$dateTimeInput8.round,
1016
+ round: (_theme$dateTimeInput9 = theme.dateTimeInput) == null || (_theme$dateTimeInput9 = _theme$dateTimeInput9.container) == null ? void 0 : _theme$dateTimeInput9.round,
1011
1017
  disabled: disabled,
1018
+ plain: plainProp,
1019
+ $inputPlain: plainProp,
1012
1020
  readOnlyProp: readOnly,
1013
1021
  focusIndicator: focusIndicatorProp != null ? focusIndicatorProp : true
1014
1022
  }, passThemeFlag), /*#__PURE__*/React.createElement(StyledDateTimeInputField, passThemeFlag, /*#__PURE__*/React.createElement(StyledDateTimeInputDisplay, _extends({
@@ -1075,7 +1083,7 @@ var DateTimeInput = /*#__PURE__*/forwardRef(function (_ref, refArg) {
1075
1083
  icon: /*#__PURE__*/React.createElement(CalendarIcon, null),
1076
1084
  plain: true,
1077
1085
  disabled: disabled,
1078
- margin: (_theme$dateTimeInput9 = theme.dateTimeInput) == null || (_theme$dateTimeInput9 = _theme$dateTimeInput9.button) == null ? void 0 : _theme$dateTimeInput9.margin,
1086
+ margin: (_theme$dateTimeInput0 = theme.dateTimeInput) == null || (_theme$dateTimeInput0 = _theme$dateTimeInput0.button) == null ? void 0 : _theme$dateTimeInput0.margin,
1079
1087
  "aria-label": formatMessage({
1080
1088
  id: 'dateTimeInput.chooseDateTime',
1081
1089
  messages: messages
@@ -1,7 +1,7 @@
1
1
  // SPDX-FileCopyrightText: © Hewlett Packard Enterprise Development LP
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import styled, { css } from 'styled-components';
4
- import { disabledStyle, edgeStyle, focusStyle, inputStyle, normalizeColor, parseMetricToNum, plainInputStyle, readOnlyStyle, styledComponentsConfig } from '../../utils';
4
+ import { disabledStyle, edgeStyle, focusStyle, inputAppearanceStyle, inputStyle, normalizeColor, parseMetricToNum, plainInputStyle, readOnlyStyle, styledComponentsConfig } from '../../utils';
5
5
  import { Box } from '../Box';
6
6
  var getActiveTokens = function getActiveTokens(theme) {
7
7
  var _theme$dateTimeInput, _theme$timeInput;
@@ -14,10 +14,16 @@ export var StyledDateTimeInputContainer = styled(Box).withConfig({
14
14
  }).withConfig({
15
15
  displayName: "StyledDateTimeInput__StyledDateTimeInputContainer",
16
16
  componentId: "sc-d6m1ya-0"
17
- })(["", " ", " ", ""], function (props) {
17
+ })(["", " ", " ", " ", ""], function (props) {
18
18
  return props.disabled && disabledStyle();
19
19
  }, function (props) {
20
20
  return props.readOnlyProp && readOnlyStyle(props.theme);
21
+ }, function (props) {
22
+ return inputAppearanceStyle(props, {
23
+ wrapper: true,
24
+ skipPadding: true,
25
+ padSelector: '[role="group"]'
26
+ });
21
27
  }, function (props) {
22
28
  return props.focusIndicator !== false && css(["&:focus-within:not(:has(button:focus-visible)){", "}"], focusStyle());
23
29
  });
@@ -33,6 +39,8 @@ export var StyledDateTimeInputDisplay = styled.div.withConfig(styledComponentsCo
33
39
  displayName: "StyledDateTimeInput__StyledDateTimeInputDisplay",
34
40
  componentId: "sc-d6m1ya-3"
35
41
  })(["position:absolute;inset:0;display:flex;align-items:center;overflow:hidden;", ""], function (props) {
42
+ var inputPad = props.theme.global.input.pad;
43
+ if (inputPad !== undefined) return edgeStyle('padding', inputPad, props.responsive, props.theme.box.responsiveBreakpoint, props.theme);
36
44
  return props.theme.global.input.padding && (typeof props.theme.global.input.padding !== 'object' ? "padding: " + (parseMetricToNum(props.theme.global.edgeSize[props.theme.global.input.padding] || props.theme.global.input.padding) - parseMetricToNum(props.theme.global.control.border.width)) + "px;" : edgeStyle('padding', props.theme.global.input.padding, props.responsive, props.theme.box.responsiveBreakpoint, props.theme));
37
45
  });
38
46
  export var StyledDateTimeInputSeparator = styled.span.withConfig(styledComponentsConfig).withConfig({
@@ -4,10 +4,11 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
4
4
  // SPDX-FileCopyrightText: © Hewlett Packard Enterprise Development LP
5
5
  // SPDX-License-Identifier: Apache-2.0
6
6
  import React, { forwardRef, useContext, useRef, useState } from 'react';
7
- import styled from 'styled-components';
7
+ import styled, { css } from 'styled-components';
8
8
  import { CircleAlert } from 'grommet-icons/icons/CircleAlert';
9
+ import { useLayoutEffect } from '../../utils/use-isomorphic-layout-effect';
9
10
  import { MessageContext } from '../../contexts/MessageContext';
10
- import { disabledStyle, focusStyle, unfocusStyle, useForwardedRef, useKeyboard } from '../../utils';
11
+ import { backgroundStyle, borderStyle, disabledStyle, focusStyle, inputAppearanceStyle, unfocusStyle, useForwardedRef, useKeyboard } from '../../utils';
11
12
  import { Anchor } from '../Anchor';
12
13
  import { Box } from '../Box';
13
14
  import { Button } from '../Button';
@@ -28,16 +29,30 @@ import { useThemeValue } from '../../utils/useThemeValue';
28
29
  var ContentsBox = styled(Box).withConfig({
29
30
  displayName: "FileInput__ContentsBox",
30
31
  componentId: "sc-1jzq7im-0"
31
- })(["cursor:pointer;position:relative;", " ", ";", ";", ";", ";", ";"], function (props) {
32
+ })(["cursor:pointer;position:relative;", " ", ";", " ", " ", ";", ";", ";", ";"], function (props) {
32
33
  return props.disabled && disabledStyle();
33
34
  }, function (props) {
34
- return props.theme.fileInput && props.theme.fileInput.extend;
35
+ return inputAppearanceStyle(props, {
36
+ wrapper: true,
37
+ skipBasePadding: true
38
+ });
39
+ }, function (props) {
40
+ var _shared$hover, _shared$focus, _shared$hover2, _shared$focus2, _props$responsive, _props$theme$fileInpu, _props$theme$fileInpu2, _props$theme$fileInpu3;
41
+ var shared = props.theme.global.input;
42
+ var sharedBackground = shared.background !== undefined || ((_shared$hover = shared.hover) == null ? void 0 : _shared$hover.background) !== undefined || ((_shared$focus = shared.focus) == null ? void 0 : _shared$focus.background) !== undefined;
43
+ var sharedBorder = shared.border !== undefined || ((_shared$hover2 = shared.hover) == null ? void 0 : _shared$hover2.border) !== undefined || ((_shared$focus2 = shared.focus) == null ? void 0 : _shared$focus2.border) !== undefined;
44
+ var background = props.$fileBackground !== undefined && !props.disabled && (props.$backgroundState || sharedBackground) && backgroundStyle(props.$fileBackground, props.theme, false);
45
+ var border = props.$fileBorder === false ? 'border: none;' : props.$fileBorder !== undefined && !props.disabled && (props.$borderState || sharedBorder) && borderStyle(props.$fileBorder, (_props$responsive = props.responsive) != null ? _props$responsive : true, props.theme);
46
+ return css(["", ""], (background || border) && css(["&&{", " ", " ", " ", " ", "}"], background, border, (_props$theme$fileInpu = props.theme.fileInput) == null ? void 0 : _props$theme$fileInpu.extend, props.hover && ((_props$theme$fileInpu2 = props.theme.fileInput) == null || (_props$theme$fileInpu2 = _props$theme$fileInpu2.hover) == null ? void 0 : _props$theme$fileInpu2.extend), props.dragOver && ((_props$theme$fileInpu3 = props.theme.fileInput) == null || (_props$theme$fileInpu3 = _props$theme$fileInpu3.dragOver) == null ? void 0 : _props$theme$fileInpu3.extend)));
47
+ }, function (props) {
48
+ var _props$theme$fileInpu4;
49
+ return (_props$theme$fileInpu4 = props.theme.fileInput) == null ? void 0 : _props$theme$fileInpu4.extend;
35
50
  }, function (props) {
36
51
  return props.hover && props.theme.fileInput && props.theme.fileInput.hover && props.theme.fileInput.hover.extend;
37
52
  }, function (props) {
38
53
  return props.dragOver && props.theme.fileInput && props.theme.fileInput.dragOver && props.theme.fileInput.dragOver.extend;
39
54
  }, function (props) {
40
- return props.focus && focusStyle();
55
+ return props.focus && css(["&&{", "}"], focusStyle());
41
56
  }, function (props) {
42
57
  return !props.focus && unfocusStyle();
43
58
  });
@@ -58,7 +73,7 @@ var defaultPendingRemoval = {
58
73
  index: undefined
59
74
  };
60
75
  var FileInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
61
- var _theme$fileInput, _theme$fileInput$anch;
76
+ var _theme$fileInput, _mergeTheme, _theme$fileInput$anch;
62
77
  var a11yTitle = _ref.a11yTitle,
63
78
  background = _ref.background,
64
79
  border = _ref.border,
@@ -100,8 +115,12 @@ var FileInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
100
115
  var aggregateThreshold = multiple && multiple.aggregateThreshold || 10;
101
116
  var max = multiple == null ? void 0 : multiple.max;
102
117
  var inputRef = useForwardedRef(ref);
118
+ var containerRef = useRef();
103
119
  var controlRef = useRef();
104
120
  var removeRef = useRef();
121
+ var _useState3 = useState(),
122
+ measuredRightOffset = _useState3[0],
123
+ setMeasuredRightOffset = _useState3[1];
105
124
  var ConfirmRemove = confirmRemove;
106
125
  var RemoveIcon = theme.fileInput.icons.remove;
107
126
  var ErrorIcon = ((_theme$fileInput = theme.fileInput) == null || (_theme$fileInput = _theme$fileInput.icons) == null ? void 0 : _theme$fileInput.error) || CircleAlert;
@@ -154,6 +173,36 @@ var FileInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
154
173
  }),
155
174
  files = _formContext$useFormI[0],
156
175
  setFiles = _formContext$useFormI[1];
176
+
177
+ // Measure after layout so shared/state padding is included before paint.
178
+ // Keep the transparent file input off the action controls as bounds change,
179
+ // otherwise it intercepts Remove clicks and opens the file picker instead.
180
+ useLayoutEffect(function () {
181
+ var container = containerRef.current;
182
+ var controls = [removeRef.current, files.length <= 1 ? controlRef.current : undefined].filter(Boolean);
183
+ var measure = function measure() {
184
+ var containerBounds = container.getBoundingClientRect();
185
+ var bounds = controls.map(function (control) {
186
+ return control.getBoundingClientRect();
187
+ }).filter(function (rect) {
188
+ return rect.width > 0;
189
+ });
190
+ if (containerBounds.width > 0 && bounds.length > 0) setMeasuredRightOffset(Math.max(0, containerBounds.right - Math.min.apply(Math, bounds.map(function (rect) {
191
+ return rect.left;
192
+ }))));else setMeasuredRightOffset(undefined);
193
+ };
194
+ measure();
195
+ var observer = typeof window.ResizeObserver !== 'undefined' ? new window.ResizeObserver(measure) : undefined;
196
+ observer == null || observer.observe(container);
197
+ controls.forEach(function (control) {
198
+ return observer == null ? void 0 : observer.observe(control);
199
+ });
200
+ window.addEventListener('resize', measure);
201
+ return function () {
202
+ observer == null || observer.disconnect();
203
+ window.removeEventListener('resize', measure);
204
+ };
205
+ }, [files, theme, hover, dragOver, focus, disabled, plain, multiple]);
157
206
  var mergeTheme = function mergeTheme(propertyName, defaultKey) {
158
207
  var result = {};
159
208
  var themeProp = theme.fileInput[propertyName];
@@ -165,6 +214,7 @@ var FileInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
165
214
  if (defaultKey) result[defaultKey] = hoverThemeProp;else result = hoverThemeProp;
166
215
  } else result = _extends({}, result, hoverThemeProp);
167
216
  var dragOverThemeProp = theme.fileInput.dragOver[propertyName];
217
+ if (propertyName === 'border' && dragOver && dragOverThemeProp === 'none') return false;
168
218
  if (dragOver && dragOverThemeProp) if (typeof dragOverThemeProp !== 'object') {
169
219
  if (defaultKey) result[defaultKey] = dragOverThemeProp;else result = dragOverThemeProp;
170
220
  } else result = _extends({}, result, dragOverThemeProp);
@@ -212,20 +262,17 @@ var FileInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
212
262
  });
213
263
  inputRef.current.focus();
214
264
  };
265
+ var fileInputPad = (_mergeTheme = mergeTheme('pad')) != null ? _mergeTheme : theme.global.input.pad;
266
+ var fileBackground = mergeTheme('background', 'color');
267
+ var fileBorder = !plain ? mergeTheme('border', 'side') : undefined;
215
268
 
216
269
  // rightPad needs to be included in the rightOffset
217
270
  // otherwise input may cover the RemoveButton, making it
218
271
  // unreachable by mouse click.
219
272
  var rightPad = '0px';
220
- if (mergeTheme('pad')) {
221
- var _mergeTheme = mergeTheme('pad'),
222
- horizontal = _mergeTheme.horizontal,
223
- right = _mergeTheme.right;
224
- if (right) {
225
- rightPad = theme.global.edgeSize[right] || right;
226
- } else if (horizontal) {
227
- rightPad = theme.global.edgeSize[horizontal] || horizontal;
228
- }
273
+ var rightPadValue = typeof fileInputPad === 'string' ? fileInputPad : (fileInputPad == null ? void 0 : fileInputPad.right) || (fileInputPad == null ? void 0 : fileInputPad.horizontal);
274
+ if (rightPadValue) {
275
+ rightPad = theme.global.edgeSize[rightPadValue] || rightPadValue;
229
276
  }
230
277
  var removeWidth = removeRef.current ? removeRef.current.getBoundingClientRect().width : 0;
231
278
  var controlWidth = controlRef.current ? controlRef.current.getBoundingClientRect().width : 0;
@@ -247,13 +294,19 @@ var FileInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
247
294
  }
248
295
  var rightOffset = files.length > 1 ? removeWidth + parseInt(rightPad, 10) : removeWidth + controlWidth + parseInt(rightPad, 10);
249
296
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ContentsBox, _extends({
297
+ ref: containerRef,
298
+ $inputPlain: plain,
250
299
  theme: theme,
251
300
  flex: false,
252
301
  disabled: disabled,
253
- background: mergeTheme('background', 'color'),
254
- border: !plain ? mergeTheme('border', 'side') : undefined,
302
+ background: fileBackground,
303
+ border: fileBorder,
304
+ $fileBackground: fileBackground,
305
+ $fileBorder: fileBorder,
306
+ $backgroundState: dragOver && theme.fileInput.dragOver.background !== undefined || hover && theme.fileInput.hover.background !== undefined,
307
+ $borderState: dragOver && theme.fileInput.dragOver.border !== undefined || hover && theme.fileInput.hover.border !== undefined,
255
308
  margin: mergeTheme('margin'),
256
- pad: mergeTheme('pad'),
309
+ pad: fileInputPad,
257
310
  round: mergeTheme('round', 'size'),
258
311
  align: files.length ? 'stretch' : 'center',
259
312
  justify: "center",
@@ -278,14 +331,18 @@ var FileInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
278
331
  "aria-invalid": maxSize && files.some(function (f) {
279
332
  return f.size > maxSize;
280
333
  }) || max != null && files.length > max,
281
- rightOffset: rightOffset || undefined
334
+ rightOffset: measuredRightOffset != null ? measuredRightOffset : rightOffset || undefined
282
335
  }, passThemeFlag, rest, {
283
336
  onDragOver: function onDragOver() {
284
- return setDragOver(true);
337
+ if (!disabled) setDragOver(true);
285
338
  },
286
339
  onDragLeave: function onDragLeave() {
287
340
  return setDragOver(false);
288
341
  },
342
+ onDrop: function onDrop(event) {
343
+ setDragOver(false);
344
+ if (rest.onDrop) rest.onDrop(event);
345
+ },
289
346
  onChange: function onChange(event) {
290
347
  event.persist();
291
348
  var fileList = event.target.files;
@@ -1,2 +1,7 @@
1
1
  ## FileInput
2
2
  Documentation for this component: https://v2.grommet.io/fileinput
3
+
4
+ FileInput appearance values override shared `global.input` appearance values.
5
+ The component's hover and drag-over theme values apply on top of its normal
6
+ appearance. A drag-over border of `'none'` removes the border, including the
7
+ border owned by a surrounding FormField; the normal border returns afterward.
@@ -6,6 +6,7 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
6
6
  import React, { useEffect, useRef, useState } from 'react';
7
7
  import { makeNodeFocusable, makeNodeUnfocusable } from '../utils';
8
8
  import { RootsContext, useRoots } from '../contexts/RootsContext';
9
+ import { useLayoutEffect } from '../utils/use-isomorphic-layout-effect';
9
10
  var isFocusable = function isFocusable(element) {
10
11
  if ((element == null ? void 0 : element.tabIndex) < 0 || element != null && element.disabled) {
11
12
  return false;
@@ -47,7 +48,7 @@ export var FocusedContainer = function FocusedContainer(_ref) {
47
48
  // set this to true so handleTrapFocus doesn't focus the element.
48
49
  var ignoreUtilFocusRef = useRef(false);
49
50
  var lastFocusRef = useRef(null);
50
- useEffect(function () {
51
+ useLayoutEffect(function () {
51
52
  var container = ref.current;
52
53
  var roots = contextRoots.current;
53
54
  var attemptFocus = function attemptFocus(element) {