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
@@ -26,14 +26,20 @@ export var EllipsisAnimation = function EllipsisAnimation() {
26
26
  alignContent: "center",
27
27
  justify: "center"
28
28
  }, /*#__PURE__*/React.createElement(Box, {
29
+ flex: false,
30
+ basis: "auto",
29
31
  alignSelf: "center",
30
32
  direction: "row",
31
33
  gap: (_theme$button = theme.button) == null || (_theme$button = _theme$button.busy) == null ? void 0 : _theme$button.gap
32
34
  }, /*#__PURE__*/React.createElement(Dot, {
35
+ flex: false,
33
36
  delay: "-0.32s"
34
37
  }), /*#__PURE__*/React.createElement(Dot, {
38
+ flex: false,
35
39
  delay: "-0.16s"
36
- }), /*#__PURE__*/React.createElement(Dot, null)));
40
+ }), /*#__PURE__*/React.createElement(Dot, {
41
+ flex: false
42
+ })));
37
43
  };
38
44
  var grow = keyframes(["0%{opacity:0;transform:scale(.3);}20%{opacity:1;transform:scale(1.15);}30%{transform:scale(.9);}45%{transform:scale(1.05);}55%{transform:scale(1);}100%{transform:scale(1);}"]);
39
45
  export var GrowCheckmark = styled(Checkmark).withConfig({
@@ -291,7 +291,16 @@ var Button = /*#__PURE__*/forwardRef(function (_ref, ref) {
291
291
  // only used when theme does not have button.default
292
292
  var isDarkBackground = function isDarkBackground() {
293
293
  var backgroundColor = normalizeBackground(normalizeColor(color || theme.button.primary && theme.button.primary.color || theme.global.colors.control || 'brand', theme), theme);
294
- return colorIsDark(backgroundColor, theme);
294
+ return colorIsDark(backgroundColor, theme, theme.button.color);
295
+ };
296
+
297
+ // matches the text color backgroundStyle() selects for the label, so
298
+ // icon/animation colors stay in sync with an explicit theme.button.color.
299
+ // isDarkBackground() may be undefined (unknown shade); normalizeColor()
300
+ // then falls back to the ambient theme.dark, matching backgroundStyle().
301
+ var primaryTextColor = function primaryTextColor() {
302
+ var text = theme.button.color || theme.global.colors.text;
303
+ return normalizeColor(text, theme, isDarkBackground());
295
304
  };
296
305
  var onMouseOverButton = function onMouseOverButton(event) {
297
306
  setHover(true);
@@ -319,7 +328,7 @@ var Button = /*#__PURE__*/forwardRef(function (_ref, ref) {
319
328
  }
320
329
  } else if (primary) {
321
330
  buttonIcon = /*#__PURE__*/cloneElement(icon, {
322
- color: theme.global.colors.text[isDarkBackground() ? 'dark' : 'light']
331
+ color: primaryTextColor()
323
332
  });
324
333
  }
325
334
  } else if (kindIcon && !plain) {
@@ -383,7 +392,7 @@ var Button = /*#__PURE__*/forwardRef(function (_ref, ref) {
383
392
  animationColor = hover && getIconColor(themePaths.hover, theme) || getIconColor(themePaths.base, theme, color, kind);
384
393
  }
385
394
  } else if (primary) {
386
- animationColor = theme.global.colors.text[isDarkBackground() ? 'dark' : 'light'];
395
+ animationColor = primaryTextColor();
387
396
  }
388
397
  contents =
389
398
  /*#__PURE__*/
@@ -1,27 +1,14 @@
1
1
  // SPDX-FileCopyrightText: © Hewlett Packard Enterprise Development LP
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import * as React from 'react';
4
- import {
5
- A11yTitleType,
6
- AlignSelfType,
7
- GridAreaType,
8
- MarginType,
9
- PadType,
10
- } from '../../utils';
11
4
  import { GridProps, GridSizeType } from '../Grid';
12
5
  import { PaginationType } from '../Pagination';
13
6
 
14
- export interface CardsProps<CardType = any> {
15
- a11yTitle?: A11yTitleType;
16
- alignSelf?: AlignSelfType;
17
- as?: string;
18
- children?: (item: CardType, index: number) => JSX.Element;
7
+ export interface CardsProps<CardType = any> extends GridProps {
8
+ children?: (item: CardType, index: number) => React.ReactElement;
19
9
  data?: CardType[];
20
- gridArea?: GridAreaType;
21
- margin?: MarginType;
22
10
  onMore?: () => void;
23
11
  onOrder?: () => void;
24
- pad?: PadType;
25
12
  paginate?: boolean | PaginationType;
26
13
  show?: number | { page?: number };
27
14
  size?: GridSizeType;
@@ -39,7 +26,6 @@ type ulProps = Omit<
39
26
 
40
27
  export interface CardsExtendedProps<CardType>
41
28
  extends CardsProps<CardType>,
42
- Omit<GridProps, keyof CardsProps<CardType>>,
43
29
  ulProps {}
44
30
 
45
31
  declare class Cards<CardType = any> extends React.Component<
@@ -1,2 +1,97 @@
1
1
  ## CheckBox
2
2
  Documentation for this component: https://v2.grommet.io/checkbox
3
+
4
+ ### Backgrounds
5
+
6
+ Use `control` to theme the built-in square checkbox and `container` to theme its
7
+ outer label. These tokens accept `BackgroundType`: a color string, a symbolic
8
+ theme color, or an object such as `{ color: 'background-input' }`.
9
+
10
+ | Token | Applies to |
11
+ | --- | --- |
12
+ | `checkBox.control.background` | Unselected square control background. |
13
+ | `checkBox.control.hover.background` | Enabled unselected control on hover. |
14
+ | `checkBox.control.selected.background` | Checked or indeterminate control background. |
15
+ | `checkBox.control.selected.hover.background` | Enabled checked or indeterminate control on hover. |
16
+ | `checkBox.container.background` | Outer label background, including toggles and custom render-function children. |
17
+ | `checkBox.container.hover.background` | Enabled outer label hover background. |
18
+
19
+ Hovering the label text also hovers the control. Focus without a focus indicator
20
+ (for example, inside a `FormField`) uses the current selection state's hover
21
+ background. Disabled controls retain their state backgrounds and do not receive
22
+ hover treatment. Background tokens do not change text or icon colors.
23
+
24
+ ### Control appearance
25
+
26
+ `checkBox.control` accepts the shared Box-part properties `background`, `border`,
27
+ `elevation`, `height`, `margin`, `pad`, `round`, and `width`. Its `hover`,
28
+ `selected`, and `selected.hover` parts accept the Box-state properties
29
+ `background`, `border`, `elevation`, `pad`, and `round`. Checked and indeterminate
30
+ controls use `selected`, inheriting unspecified properties from the normal part.
31
+ Background inheritance follows the fallbacks listed below.
32
+
33
+ Width and height support Box string and min/max object values. Border supports
34
+ Box boolean, side, object, and array values. Partial border objects inherit
35
+ unspecified fields from the underlying normal, selected, or legacy border;
36
+ other border values replace it. Use `border: false` and `round: false` to remove
37
+ these treatments. Control padding is independent of the CheckBox `pad` prop.
38
+
39
+ Hovering the label applies the current selection state's hover part to the
40
+ square. Focus without a focus indicator applies the same styles. Disabled
41
+ controls retain normal and selected styles without hover or focus-as-hover
42
+ overrides. Toggle tracks, knobs, and custom render-function children do not use
43
+ these control parts. `checkBox.check.extend` remains the final square styling
44
+ override.
45
+
46
+ ### Container appearance
47
+
48
+ `checkBox.container` accepts the shared Box-part properties `background`,
49
+ `border`, `elevation`, `height`, `margin`, `pad`, `round`, and `width`.
50
+ `container.hover` accepts the Box-state properties `background`, `border`,
51
+ `elevation`, `pad`, and `round`. These styles affect the outer label, not the
52
+ square control or toggle track and knob. Width and height accept the same
53
+ string and min/max object values as Box; border accepts the same boolean,
54
+ side, object, and array values. Use `border: false` or `round: false` to remove
55
+ the corresponding treatment.
56
+
57
+ Partial hover border objects inherit unspecified properties from the normal
58
+ container border. With a normal border array, a hover object without `side`
59
+ overrides each entry while preserving its side, width, and style.
60
+
61
+ Hover styles also apply during focus when `focusIndicator` is false. Disabled
62
+ containers retain their normal styles without hover or focus-as-hover styling.
63
+ An explicit CheckBox `pad` prop takes precedence over both normal and hover
64
+ container padding; otherwise `container.pad` overrides legacy `checkBox.pad`.
65
+ `checkBox.extend` remains the final styling override.
66
+
67
+ #### Fallbacks and compatibility
68
+
69
+ New themes should use `control` and `container`. Legacy tokens remain supported:
70
+
71
+ - Unselected control: `control.background`.
72
+ - Selected or indeterminate control: `control.selected.background`, then
73
+ `control.background`.
74
+ - Unselected control hover: `control.hover.background`, otherwise retain the
75
+ unselected background.
76
+ - Selected control hover: `control.selected.hover.background`, otherwise retain
77
+ the selected background.
78
+ - Container hover: `container.hover.background`, then legacy
79
+ `hover.background.color`, otherwise retain `container.background`.
80
+
81
+ State-specific control hover tokens do not cross over to the other state.
82
+ Legacy container `hover.background` keeps its `{ color: ... }` shape. An explicit
83
+ `container.hover.background`, including `'transparent'`, takes precedence over
84
+ that fallback. Existing `check.radius`, `check.thickness`, and `check.extend`
85
+ remain supported; control fills use only the `control` background tokens.
86
+
87
+ Theme `extend` CSS runs after the background tokens and can override them. For
88
+ example, an existing `check.extend` that sets the control background wins over
89
+ `control.background` and `control.selected.background`. Adjust that extension,
90
+ or set `check.extend: undefined`, when the theme tokens should determine the
91
+ fill. `checkBox.extend` follows the container and control hover styles.
92
+
93
+ Control background tokens do not affect toggle tracks or knobs; those retain
94
+ `checkBox.toggle` styling. They also do not fill custom render-function
95
+ children, though container backgrounds still apply. Existing border styling,
96
+ custom icons, `checkBox.check.extend`, and `checkBox.toggle.extend` remain
97
+ available.
@@ -1,7 +1,8 @@
1
+ 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); }
1
2
  // SPDX-FileCopyrightText: © Hewlett Packard Enterprise Development LP
2
3
  // SPDX-License-Identifier: Apache-2.0
3
4
  import styled, { css } from 'styled-components';
4
- import { edgeStyle, focusStyle, normalizeColor, styledComponentsConfig } from '../../utils';
5
+ import { backgroundStyle, borderStyle, edgeStyle, elevationStyle, focusStyle, hasSideSpecificBorder, heightStyle, normalizeColor, roundStyle, styledComponentsConfig, widthStyle } from '../../utils';
5
6
  import { Box } from '../Box';
6
7
 
7
8
  // Note: since `fillStyle` is only used in one place, `justify-content` was
@@ -11,15 +12,85 @@ var fillStyle = function fillStyle() {
11
12
  return "\n width: auto;\n height: 100%;\n max-width: none;\n flex: 1 0 auto;\n justify-content: space-between;\n ";
12
13
  };
13
14
  var disabledStyle = "\n opacity: 0.5;\n cursor: default;\n";
15
+ var boxPartStyles = function boxPartStyles(part, props, container) {
16
+ var _props$responsive;
17
+ if (container === void 0) {
18
+ container = false;
19
+ }
20
+ var theme = props.theme;
21
+ var responsive = (_props$responsive = props.responsive) != null ? _props$responsive : true;
22
+ var styles = [];
23
+ if (part.border !== undefined) {
24
+ if (part.border === false) styles.push('border: none;');else {
25
+ if (hasSideSpecificBorder(part.border)) styles.push('border: none;');
26
+ styles.push(borderStyle(part.border, responsive, theme));
27
+ }
28
+ }
29
+ if (part.elevation !== undefined) styles.push(elevationStyle(part.elevation));
30
+ if (part.height !== undefined) styles.push(heightStyle(part.height, theme));
31
+ if (part.width !== undefined) styles.push(widthStyle(part.width, theme));
32
+ if (part.margin !== undefined) styles.push(edgeStyle('margin', part.margin, responsive, theme.box.responsiveBreakpoint, theme));
33
+ if (part.pad !== undefined && (!container || props.pad === undefined)) styles.push(edgeStyle('padding', part.pad, responsive, theme.box.responsiveBreakpoint, theme));
34
+ if (part.round !== undefined) styles.push(part.round === false ? 'border-radius: 0;' : roundStyle(part.round, responsive, theme));
35
+ return styles;
36
+ };
37
+ var _mergeControlBorder = function mergeControlBorder(base, override) {
38
+ if (override === undefined) return base;
39
+ if (Array.isArray(base) && override && typeof override === 'object' && !Array.isArray(override) && !override.side) return base.map(function (part) {
40
+ return _mergeControlBorder(part, override);
41
+ });
42
+ if (base && override && typeof base === 'object' && typeof override === 'object' && !Array.isArray(base) && !Array.isArray(override)) return _extends({}, base, override);
43
+ if (typeof base === 'string' && override && typeof override === 'object' && !Array.isArray(override)) return _extends({
44
+ side: base
45
+ }, override);
46
+ return override;
47
+ };
48
+ var controlHoverStyle = function controlHoverStyle(props) {
49
+ var _control$selected;
50
+ var control = props.theme.checkBox.control;
51
+ if (props.disabled) return undefined;
52
+ var selected = props.checked || props.indeterminate;
53
+ var state = selected ? control == null || (_control$selected = control.selected) == null ? void 0 : _control$selected.hover : control == null ? void 0 : control.hover;
54
+ var part = _extends({}, state);
55
+ if ((state == null ? void 0 : state.border) !== undefined) {
56
+ var _control$selected2;
57
+ var checkBox = props.theme.checkBox;
58
+ var baseBorder = {
59
+ size: checkBox.border.width,
60
+ color: props.checked ? checkBox.color || 'control' : checkBox.border.color
61
+ };
62
+ part.border = _mergeControlBorder(_mergeControlBorder(_mergeControlBorder(baseBorder, control == null ? void 0 : control.border), selected ? control == null || (_control$selected2 = control.selected) == null ? void 0 : _control$selected2.border : undefined), state.border);
63
+ }
64
+ var styles = boxPartStyles(part, props);
65
+ if ((state == null ? void 0 : state.background) != null) styles.push(backgroundStyle(state.background, props.theme, false));
66
+ if (props.focus && props.focusIndicator) styles.push(focusStyle());
67
+ if (styles.length === 0) return undefined;
68
+ return css(["input:not([disabled]) + ", "{", "}"],
69
+ // eslint-disable-next-line no-use-before-define
70
+ StyledCheckBoxBox, styles);
71
+ };
72
+ var containerBackgroundStyle = function containerBackgroundStyle(props) {
73
+ var _container$hover, _container$hover2, _hover$background;
74
+ var _props$theme$checkBox = props.theme.checkBox,
75
+ container = _props$theme$checkBox.container,
76
+ hover = _props$theme$checkBox.hover;
77
+ var normalStyles = boxPartStyles(container || {}, props, true);
78
+ var hoverContainer = _extends({}, container == null ? void 0 : container.hover);
79
+ if (hoverContainer.border !== undefined) hoverContainer.border = _mergeControlBorder(container == null ? void 0 : container.border, hoverContainer.border);
80
+ var hoverStyles = boxPartStyles(hoverContainer, props, true);
81
+ if ((container == null ? void 0 : container.background) == null && (container == null || (_container$hover = container.hover) == null ? void 0 : _container$hover.background) == null && normalStyles.length === 0 && hoverStyles.length === 0) return undefined;
82
+ var hoverBackground = (container == null || (_container$hover2 = container.hover) == null ? void 0 : _container$hover2.background) != null ? backgroundStyle(container.hover.background, props.theme, false) : (hover == null || (_hover$background = hover.background) == null ? void 0 : _hover$background.color) !== undefined && css(["background-color:", ";"], normalizeColor(hover.background.color, props.theme));
83
+ return css(["", " ", " ", " ", ""], normalStyles.length > 0 && 'box-sizing: border-box;', normalStyles, backgroundStyle(container == null ? void 0 : container.background, props.theme, false), !props.disabled && (hoverBackground || hoverStyles.length > 0) && css(["&:hover{", " ", "}", ""], hoverBackground, hoverStyles, props.focus && !props.focusIndicator && css(["", " ", ""], hoverBackground, hoverStyles)));
84
+ };
14
85
  var hoverStyle = css(["&:hover input:not([disabled]) + div,&:hover input:not([disabled]) + span{border-color:", ";", "}&:hover{background-color:", ";}"], function (props) {
15
- var _props$theme$checkBox;
16
- return normalizeColor((_props$theme$checkBox = props.theme.checkBox.hover) == null || (_props$theme$checkBox = _props$theme$checkBox.border) == null ? void 0 : _props$theme$checkBox.color, props.theme);
17
- }, function (props) {
18
86
  var _props$theme$checkBox2;
19
- return (_props$theme$checkBox2 = props.theme.checkBox.hover) == null ? void 0 : _props$theme$checkBox2.extend;
87
+ return normalizeColor((_props$theme$checkBox2 = props.theme.checkBox.hover) == null || (_props$theme$checkBox2 = _props$theme$checkBox2.border) == null ? void 0 : _props$theme$checkBox2.color, props.theme);
20
88
  }, function (props) {
21
89
  var _props$theme$checkBox3;
22
- return normalizeColor(!props.disabled && ((_props$theme$checkBox3 = props.theme.checkBox.hover) == null || (_props$theme$checkBox3 = _props$theme$checkBox3.background) == null ? void 0 : _props$theme$checkBox3.color), props.theme);
90
+ return (_props$theme$checkBox3 = props.theme.checkBox.hover) == null ? void 0 : _props$theme$checkBox3.extend;
91
+ }, function (props) {
92
+ var _props$theme$checkBox4, _props$theme$checkBox5;
93
+ return normalizeColor(!props.disabled && ((_props$theme$checkBox4 = props.theme.checkBox.container) == null || (_props$theme$checkBox4 = _props$theme$checkBox4.hover) == null ? void 0 : _props$theme$checkBox4.background) == null && ((_props$theme$checkBox5 = props.theme.checkBox.hover) == null || (_props$theme$checkBox5 = _props$theme$checkBox5.background) == null ? void 0 : _props$theme$checkBox5.color), props.theme);
23
94
  });
24
95
  var StyledCheckBoxIcon = styled.svg.withConfig(styledComponentsConfig).withConfig({
25
96
  displayName: "StyledCheckBox__StyledCheckBoxIcon",
@@ -49,10 +120,15 @@ var StyledCheckBoxContainer = styled.label.withConfig(styledComponentsConfig).wi
49
120
  }, function (props) {
50
121
  return !props.disabled && 'cursor: pointer;';
51
122
  }, hoverStyle, function (props) {
52
- var _props$theme$checkBox4, _props$theme$checkBox5;
53
- return props.focus && !props.focusIndicator && "\n input:not([disabled]) + div,\n input:not([disabled]) + span {\n border-color: " + normalizeColor((_props$theme$checkBox4 = props.theme.checkBox.hover) == null || (_props$theme$checkBox4 = _props$theme$checkBox4.border) == null ? void 0 : _props$theme$checkBox4.color, props.theme) + ";\n }\n\n background-color: " + normalizeColor(!props.disabled && ((_props$theme$checkBox5 = props.theme.checkBox.hover) == null || (_props$theme$checkBox5 = _props$theme$checkBox5.background) == null ? void 0 : _props$theme$checkBox5.color), props.theme) + ";";
54
- }, function (props) {
55
- return props.theme.checkBox.extend;
123
+ var _props$theme$checkBox6, _props$theme$checkBox7, _props$theme$checkBox8;
124
+ return props.focus && !props.focusIndicator && "\n input:not([disabled]) + div,\n input:not([disabled]) + span {\n border-color: " + normalizeColor((_props$theme$checkBox6 = props.theme.checkBox.hover) == null || (_props$theme$checkBox6 = _props$theme$checkBox6.border) == null ? void 0 : _props$theme$checkBox6.color, props.theme) + ";\n }\n\n background-color: " + normalizeColor(!props.disabled && ((_props$theme$checkBox7 = props.theme.checkBox.container) == null || (_props$theme$checkBox7 = _props$theme$checkBox7.hover) == null ? void 0 : _props$theme$checkBox7.background) == null && ((_props$theme$checkBox8 = props.theme.checkBox.hover) == null || (_props$theme$checkBox8 = _props$theme$checkBox8.background) == null ? void 0 : _props$theme$checkBox8.color), props.theme) + ";";
125
+ }, function (props) {
126
+ var controlStyle = controlHoverStyle(props);
127
+ var containerStyle = containerBackgroundStyle(props);
128
+ if (containerStyle) {
129
+ return css(["", " ", " ", ""], containerStyle, controlStyle && css(["&:hover{", "}", ""], controlStyle, props.focus && !props.focusIndicator && controlStyle), props.theme.checkBox.extend);
130
+ }
131
+ return controlStyle ? css(["&:hover{", "}", " ", ""], controlStyle, props.focus && !props.focusIndicator && controlStyle, props.theme.checkBox.extend) : props.theme.checkBox.extend;
56
132
  });
57
133
  var StyledCheckBoxInput = styled.input.withConfig(styledComponentsConfig).withConfig({
58
134
  displayName: "StyledCheckBox__StyledCheckBoxInput",
@@ -71,10 +147,23 @@ var StyledCheckBoxInput = styled.input.withConfig(styledComponentsConfig).withCo
71
147
  var StyledCheckBoxBox = styled(Box).withConfig({
72
148
  displayName: "StyledCheckBox__StyledCheckBoxBox",
73
149
  componentId: "sc-1dbk5ju-3"
74
- })(["", ";", ";"], function (props) {
75
- return props.focus && props.focusIndicator && focusStyle();
76
- }, function (props) {
77
- return props.theme.checkBox.check.extend;
150
+ })(["", ";"], function (props) {
151
+ var _selectedState$backgr;
152
+ var _props$theme$checkBox9 = props.theme.checkBox,
153
+ control = _props$theme$checkBox9.control,
154
+ check = _props$theme$checkBox9.check;
155
+ var selected = props.checked || props.indeterminate;
156
+ var selectedState = selected ? control == null ? void 0 : control.selected : undefined;
157
+ var focus = props.focus && props.focusIndicator && focusStyle();
158
+ var part = _extends({}, control, selectedState);
159
+ if ((control == null ? void 0 : control.border) !== undefined || (selectedState == null ? void 0 : selectedState.border) !== undefined) part.border = _mergeControlBorder(_mergeControlBorder(props.border, control == null ? void 0 : control.border), selectedState == null ? void 0 : selectedState.border);
160
+ var partStyles = boxPartStyles(part, props);
161
+ var background = (_selectedState$backgr = selectedState == null ? void 0 : selectedState.background) != null ? _selectedState$backgr : control == null ? void 0 : control.background;
162
+ if (background != null) {
163
+ return css(["", " ", " ", " ", ""], partStyles, backgroundStyle(background, props.theme, false), focus, check.extend);
164
+ }
165
+ if (partStyles.length === 0) return focus ? css(["", " ", ""], focus, check.extend) : check.extend;
166
+ return css(["", " ", " ", ""], partStyles, focus, check.extend);
78
167
  });
79
168
  var StyledCheckBoxToggle = styled.span.withConfig(styledComponentsConfig).withConfig({
80
169
  displayName: "StyledCheckBox__StyledCheckBoxToggle",
@@ -0,0 +1,160 @@
1
+ // SPDX-FileCopyrightText: © Hewlett Packard Enterprise Development LP
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import React, { useState } from 'react';
4
+ import type { Meta, StoryObj } from '@storybook/react';
5
+
6
+ import {
7
+ Box,
8
+ Button,
9
+ CheckBox,
10
+ Form,
11
+ FormField,
12
+ Grommet,
13
+ Heading,
14
+ RadioButtonGroup,
15
+ } from 'grommet';
16
+ import { ThemeType } from 'grommet/themes';
17
+ import { deepMerge } from 'grommet/utils';
18
+ import { hpe } from 'grommet-theme-hpe';
19
+
20
+ const customTheme: ThemeType = {
21
+ checkBox: {
22
+ control: {
23
+ background: { color: { light: 'light-3', dark: 'dark-3' } },
24
+ border: { color: 'border', size: 'xsmall' },
25
+ height: '32px',
26
+ width: '32px',
27
+ pad: 'none',
28
+ round: 'xsmall',
29
+ hover: {
30
+ background: { color: { light: 'accent-3', dark: 'neutral-3' } },
31
+ border: { color: 'accent-3' },
32
+ },
33
+ selected: {
34
+ background: { color: { light: 'accent-1', dark: 'accent-2' } },
35
+ border: { color: 'accent-1' },
36
+ hover: {
37
+ background: { color: { light: 'accent-4', dark: 'neutral-4' } },
38
+ border: { color: 'accent-4' },
39
+ },
40
+ },
41
+ },
42
+ container: {
43
+ background: { color: { light: 'light-2', dark: 'dark-2' } },
44
+ border: { color: 'border', size: 'xsmall' },
45
+ elevation: 'none',
46
+ margin: { bottom: 'xxsmall' },
47
+ pad: { horizontal: 'small', vertical: 'xsmall' },
48
+ round: 'xsmall',
49
+ width: { min: '240px' },
50
+ hover: {
51
+ background: { color: { light: 'light-4', dark: 'dark-4' } },
52
+ border: { color: 'accent-3' },
53
+ elevation: 'small',
54
+ },
55
+ },
56
+ },
57
+ };
58
+
59
+ const hpeTheme: ThemeType = deepMerge(hpe, {
60
+ checkBox: {
61
+ container: {},
62
+ control: {
63
+ background: 'background-front',
64
+ hover: {
65
+ background: 'background-hover',
66
+ border: { color: 'border-strong' },
67
+ },
68
+ selected: {
69
+ background: 'background-selected-primary-strong',
70
+ border: {
71
+ color: 'border-selected',
72
+ },
73
+ hover: {
74
+ background: 'background-selected-primary-strong-hover',
75
+ },
76
+ },
77
+ },
78
+ check: { extend: undefined },
79
+ hover: {
80
+ extend: undefined,
81
+ },
82
+ extend: undefined,
83
+ },
84
+ });
85
+
86
+ const AppearanceExample = () => {
87
+ const [dark, setDark] = useState(false);
88
+ const [value, setValue] = useState({ updates: true });
89
+ const [theme, setTheme] = useState(hpeTheme);
90
+
91
+ return (
92
+ <Grommet
93
+ theme={theme}
94
+ themeMode={dark ? 'dark' : 'light'}
95
+ background="background"
96
+ >
97
+ <Box pad="large" gap="medium">
98
+ <Heading level={2} margin="none">
99
+ Preferences
100
+ </Heading>
101
+ <Box
102
+ direction="row"
103
+ wrap
104
+ gap="large"
105
+ border={{ color: 'border', size: 'small', side: 'bottom' }}
106
+ pad="small"
107
+ >
108
+ <RadioButtonGroup
109
+ name="theme"
110
+ options={['Custom', 'HPE']}
111
+ value={theme === customTheme ? 'Custom' : 'HPE'}
112
+ onChange={(event) =>
113
+ setTheme(event.target.value === 'Custom' ? customTheme : hpeTheme)
114
+ }
115
+ />
116
+ <CheckBox
117
+ toggle
118
+ label="Dark mode"
119
+ checked={dark}
120
+ onChange={(event) => setDark(event.target.checked)}
121
+ />
122
+ </Box>
123
+ <Box gap="small" background="background-back" pad="medium" round>
124
+ <CheckBox label="Unchecked" />
125
+ <CheckBox label="Selected" defaultChecked />
126
+ <CheckBox label="Indeterminate" indeterminate />
127
+ <CheckBox label="Disabled unchecked" disabled />
128
+ <CheckBox label="Disabled selected" disabled checked />
129
+ </Box>
130
+ <Box gap="small" background="background-back" pad="medium" round>
131
+ <Form value={value} onChange={setValue}>
132
+ <FormField name="updates" htmlFor="updates" label="Notifications">
133
+ <CheckBox
134
+ id="updates"
135
+ name="updates"
136
+ label="Send product updates"
137
+ />
138
+ </FormField>
139
+ <Box direction="row" gap="small" margin={{ top: 'medium' }}>
140
+ <Button type="submit" label="Submit" primary />
141
+ <Button type="reset" label="Reset" />
142
+ </Box>
143
+ </Form>
144
+ </Box>
145
+ </Box>
146
+ </Grommet>
147
+ );
148
+ };
149
+
150
+ const meta: Meta<typeof CheckBox> = {
151
+ title: 'Input/CheckBox/Custom Themed/Appearance',
152
+ component: CheckBox,
153
+ };
154
+
155
+ export default meta;
156
+ type Story = StoryObj<typeof CheckBox>;
157
+
158
+ export const Appearance: Story = {
159
+ render: () => <AppearanceExample />,
160
+ };
@@ -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 { backgroundStyle, fillStyle, focusStyle, unfocusStyle, genericStyles, normalizeColor, styledComponentsConfig } from '../../utils';
4
+ import { backgroundStyle, fillStyle, focusStyle, unfocusStyle, genericStyles, overflowStyle, normalizeColor, styledComponentsConfig } from '../../utils';
5
5
  import { Box } from '../Box';
6
6
  import { TableRow } from '../TableRow';
7
7
  import { Table } from '../Table';
@@ -56,7 +56,7 @@ var StyledDataTableBody = styled(TableBody).withConfig({
56
56
  displayName: "StyledDataTable__StyledDataTableBody",
57
57
  componentId: "sc-xrlyjm-4"
58
58
  })(["", " &:focus{", "}&:focus:not(:focus-visible){", "}"], function (props) {
59
- return props.size && "\n display: block;\n width: 100%;\n max-height: " + (props.theme.global.size[props.size] || props.size) + ";\n overflow: auto;\n ";
59
+ return props.size && css(["display:block;width:100%;max-height:", ";", ""], props.theme.global.size[props.size] || props.size, overflowStyle('auto', props.theme));
60
60
  }, focusStyle({
61
61
  skipSvgChildren: true,
62
62
  forceOutline: true
@@ -5,7 +5,7 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
5
5
  // SPDX-FileCopyrightText: © Hewlett Packard Enterprise Development LP
6
6
  // SPDX-License-Identifier: Apache-2.0
7
7
  import React, { useRef, forwardRef, useContext, useEffect, useMemo, useState, useCallback } from 'react';
8
- import styled from 'styled-components';
8
+ import styled, { css } from 'styled-components';
9
9
  import { Calendar as GrommetCalendarIcon } from 'grommet-icons/icons/Calendar';
10
10
  import { AnnounceContext } from '../../contexts/AnnounceContext';
11
11
  import { MessageContext } from '../../contexts/MessageContext';
@@ -17,7 +17,7 @@ import { DropButton } from '../DropButton';
17
17
  import { FormContext } from '../Form';
18
18
  import { Keyboard } from '../Keyboard';
19
19
  import { MaskedInput } from '../MaskedInput';
20
- import { useForwardedRef, setHoursWithOffset, disabledStyle, useKeyboard } from '../../utils';
20
+ import { useForwardedRef, setHoursWithOffset, disabledStyle, inputAppearanceStyle, useKeyboard } from '../../utils';
21
21
  import { readOnlyStyle } from '../../utils/readOnly';
22
22
  import { formatToSchema, schemaToMask, valuesAreEqual, valueToText, textToValue, validateBounds } from './utils';
23
23
  import { DateInputPropTypes } from './propTypes';
@@ -35,7 +35,13 @@ var StyledDateInputContainer = styled(Box).withConfig({
35
35
  })(["", " ", "}"], function (props) {
36
36
  return props.disabled && disabledStyle();
37
37
  }, function (props) {
38
- return props.readOnlyProp && readOnlyStyle(props.theme);
38
+ var appearance = inputAppearanceStyle(props, {
39
+ wrapper: true,
40
+ skipPadding: true,
41
+ skipRound: true
42
+ });
43
+ var readOnly = props.readOnlyProp && readOnlyStyle(props.theme);
44
+ return appearance ? css(["", "", ""], readOnly, appearance) : readOnly;
39
45
  });
40
46
  var getReference = function getReference(value) {
41
47
  var adjustedDate;
@@ -305,7 +311,7 @@ var DateInput = /*#__PURE__*/forwardRef(function (_ref, refArg) {
305
311
  })
306
312
  }, buttonProps));
307
313
  }
308
- var onClickCopy = function onClickCopy() {
314
+ var onCopy = function onCopy() {
309
315
  navigator.clipboard.writeText(textValue);
310
316
  announce(readOnlyCopyValidation, 'assertive');
311
317
  setTip(readOnlyCopyValidation);
@@ -315,9 +321,9 @@ var DateInput = /*#__PURE__*/forwardRef(function (_ref, refArg) {
315
321
  };
316
322
  var DateInputButton = readOnlyCopy ? /*#__PURE__*/React.createElement(CopyButton, {
317
323
  disabled: disabled,
324
+ messages: messages,
318
325
  onBlurCopy: onBlurCopy,
319
- onClickCopy: onClickCopy,
320
- readOnlyCopyPrompt: readOnlyCopyPrompt,
326
+ onCopy: onCopy,
321
327
  tip: tip,
322
328
  value: value
323
329
  }) : /*#__PURE__*/React.createElement(Button, {
@@ -349,6 +355,7 @@ var DateInput = /*#__PURE__*/forwardRef(function (_ref, refArg) {
349
355
  }
350
356
  }
351
357
  }, /*#__PURE__*/React.createElement(StyledDateInputContainer, _extends({
358
+ $inputPlain: plain,
352
359
  ref: containerRef,
353
360
  border: !plain,
354
361
  round: theme.dateInput.container.round,