grommet 2.58.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.
- package/all/stories/AllComponents.stories.js +2 -1
- package/components/Accordion/Accordion.js +2 -1
- package/components/Accordion/stories/CustomHeader.stories.js +2 -1
- package/components/AccordionPanel/AccordionPanel.js +2 -1
- package/components/Anchor/Anchor.js +2 -1
- package/components/Anchor/StyledAnchor.js +2 -1
- package/components/Avatar/Avatar.js +2 -1
- package/components/Box/Box.js +2 -1
- package/components/Box/ResponsiveContainerProvider.js +2 -1
- package/components/Box/StyledBox.js +2 -1
- package/components/Box/stories/ResponsiveContainer.stories.js +2 -1
- package/components/Button/Badge.js +2 -1
- package/components/Button/BusyAnimation.js +2 -1
- package/components/Button/Button.js +2 -1
- package/components/Button/StyledButton.js +2 -1
- package/components/Button/StyledButtonKind.js +2 -1
- package/components/Button/stories/Busy.stories.js +2 -1
- package/components/Calendar/Calendar.js +2 -1
- package/components/Calendar/StyledCalendar.js +2 -1
- package/components/Calendar/stories/ActiveDate.stories.js +2 -1
- package/components/Calendar/stories/CustomDay.stories.js +2 -1
- package/components/Calendar/stories/CustomHeader.stories.js +2 -1
- package/components/Calendar/stories/CustomThemed/CustomSizeHeading.stories.js +2 -1
- package/components/Calendar/stories/Dual.stories.js +2 -1
- package/components/Calendar/stories/HeaderLevel.stories.js +2 -1
- package/components/Calendar/stories/Multiple.stories.js +2 -1
- package/components/Calendar/stories/ShowAdjacentDays.stories.js +2 -1
- package/components/Calendar/stories/Simple.stories.js +2 -1
- package/components/Card/Card.js +2 -1
- package/components/Cards/Cards.js +2 -1
- package/components/Cards/index.d.ts +2 -16
- package/components/Carousel/Carousel.js +2 -1
- package/components/Carousel/CarouselChild.js +2 -1
- package/components/Carousel/StyledCarousel.js +2 -1
- package/components/Chart/Chart.js +2 -1
- package/components/Chart/StyledChart.js +2 -1
- package/components/Chart/stories/Rich.stories.js +2 -1
- package/components/Chart/stories/Scan.stories.js +2 -1
- package/components/Chart/stories/Window.stories.js +2 -1
- package/components/Chart/stories/Zoom.stories.js +2 -1
- package/components/CheckBox/CheckBox.js +2 -1
- package/components/CheckBox/README.md +95 -0
- package/components/CheckBox/StyledCheckBox.js +104 -16
- package/components/CheckBox/stories/CustomThemed/Appearance.stories.tsx +160 -0
- package/components/CheckBox/stories/CustomThemed/Custom.stories.js +2 -1
- package/components/CheckBox/stories/CustomThemed/CustomToggle.stories.js +2 -1
- package/components/CheckBox/stories/Indeterminate.stories.js +2 -1
- package/components/CheckBox/stories/NoLabel.stories.js +2 -1
- package/components/CheckBox/stories/Simple.stories.js +2 -1
- package/components/CheckBox/stories/WithStickyDiv.stories.js +2 -1
- package/components/CheckBoxGroup/CheckBoxGroup.js +2 -1
- package/components/CheckBoxGroup/stories/Children.stories.js +2 -1
- package/components/CheckBoxGroup/stories/InitialValues.stories.js +2 -1
- package/components/Clock/Analog.js +2 -1
- package/components/Clock/Clock.js +2 -1
- package/components/Clock/Digital.js +2 -1
- package/components/Clock/StyledClock.js +2 -1
- package/components/Collapsible/Collapsible.js +2 -1
- package/components/Data/Data.js +2 -1
- package/components/Data/DataForm.js +2 -1
- package/components/Data/stories/Infinite.stories.js +2 -1
- package/components/Data/stories/Inline.stories.js +2 -1
- package/components/Data/stories/OnSelect.stories.js +2 -1
- package/components/Data/stories/SpaceX.stories.js +2 -1
- package/components/Data/stories/StarWars.stories.js +2 -1
- package/components/DataChart/DataChart.js +2 -1
- package/components/DataChart/Detail.js +2 -1
- package/components/DataChart/Legend.js +2 -1
- package/components/DataChart/XAxis.js +2 -1
- package/components/DataChart/XGuide.js +2 -1
- package/components/DataChart/YAxis.js +2 -1
- package/components/DataChart/YGuide.js +2 -1
- package/components/DataChart/stories/Prediction.stories.js +2 -1
- package/components/DataClearFilters/DataClearFilters.js +2 -1
- package/components/DataClearFilters/stories/Simple.stories.js +2 -1
- package/components/DataFilter/DataFilter.js +2 -1
- package/components/DataFilters/DataFilters.js +2 -1
- package/components/DataSearch/DataSearch.js +2 -1
- package/components/DataSort/DataSort.js +2 -1
- package/components/DataSummary/DataSummary.js +2 -1
- package/components/DataTable/Body.js +2 -1
- package/components/DataTable/Cell.js +2 -1
- package/components/DataTable/DataTable.js +2 -1
- package/components/DataTable/ExpanderCell.js +2 -1
- package/components/DataTable/Footer.js +2 -1
- package/components/DataTable/GroupedBody.js +2 -1
- package/components/DataTable/Header.js +2 -1
- package/components/DataTable/PlaceholderBody.js +2 -1
- package/components/DataTable/Resizer.js +2 -1
- package/components/DataTable/Searcher.js +2 -1
- package/components/DataTable/StyledDataTable.js +2 -1
- package/components/DataTable/stories/ControlledGrouped.stories.js +2 -1
- package/components/DataTable/stories/OnUpdate.stories.js +2 -1
- package/components/DataTable/stories/SpaceX.stories.js +2 -1
- package/components/DataTable/stories/SpaceXUngrouped.stories.js +2 -1
- package/components/DataTable/stories/rowDetails.stories.js +2 -1
- package/components/DataTableColumns/DataTableColumns.js +2 -1
- package/components/DataTableGroupBy/DataTableGroupBy.js +2 -1
- package/components/DataView/DataView.js +2 -1
- package/components/DateInput/DateInput.js +11 -4
- package/components/DateInput/stories/FormatInline.stories.js +2 -1
- package/components/DateTimeInput/DateTimeInput.js +4 -1
- package/components/DateTimeInput/StyledDateTimeInput.js +11 -2
- package/components/Diagram/Diagram.js +2 -1
- package/components/Diagram/StyledDiagram.js +2 -1
- package/components/Diagram/stories/Animated.stories.js +2 -1
- package/components/Diagram/stories/Progressing.stories.js +2 -1
- package/components/Drop/Drop.js +2 -1
- package/components/Drop/DropContainer.js +2 -1
- package/components/Drop/StyledDrop.js +2 -1
- package/components/Drop/stories/CustomThemed/Lazy.stories.js +2 -1
- package/components/Drop/stories/CustomThemed/Themed.stories.js +2 -1
- package/components/Drop/stories/Inline.stories.js +2 -1
- package/components/Drop/stories/Meter.stories.js +2 -1
- package/components/Drop/stories/Multiple.stories.js +2 -1
- package/components/Drop/stories/Overflow.stories.js +2 -1
- package/components/Drop/stories/Plain.stories.js +2 -1
- package/components/Drop/stories/Progressive.stories.js +2 -1
- package/components/Drop/stories/Simple.stories.js +2 -1
- package/components/Drop/stories/Styled.stories.js +2 -1
- package/components/DropButton/DropButton.js +2 -1
- package/components/FileInput/FileInput.js +78 -21
- package/components/FileInput/README.md +5 -0
- package/components/FocusedContainer.js +2 -1
- package/components/Form/Form.js +2 -1
- package/components/Form/FormContext.js +2 -1
- package/components/Form/stories/ArrayOfFormFields.stories.js +2 -1
- package/components/Form/stories/Controlled.stories.js +2 -1
- package/components/Form/stories/ControlledInput.stories.js +2 -1
- package/components/Form/stories/ControlledInputLazy.stories.js +2 -1
- package/components/Form/stories/ControlledLazy.stories.js +2 -1
- package/components/Form/stories/CustomThemed/FieldBorderPosition.stories.js +2 -1
- package/components/Form/stories/CustomThemed/FieldCustomStates.stories.js +2 -1
- package/components/Form/stories/DynamicFields.stories.js +2 -1
- package/components/Form/stories/FieldStates.stories.js +2 -1
- package/components/Form/stories/SolicitedFeedback.stories.js +2 -1
- package/components/Form/stories/UnsolicitedFeedback.stories.js +2 -1
- package/components/Form/stories/ValidateOnChange.stories.js +2 -1
- package/components/Form/stories/ValidateOnMount.stories.js +2 -1
- package/components/FormField/FormField.js +207 -69
- package/components/FormField/README.md +56 -1
- package/components/FormField/stories/CustomThemed/Appearance.stories.tsx +630 -0
- package/components/FormField/stories/Simple.stories.js +2 -1
- package/components/Grid/Grid.js +2 -1
- package/components/Grid/StyledGrid.js +2 -1
- package/components/Grid/stories/ResponsiveCards.stories.js +2 -1
- package/components/Grommet/Grommet.js +2 -1
- package/components/Grommet/StyledGrommet.js +2 -1
- package/components/Grommet/index.d.ts +4 -0
- package/components/Grommet/propTypes.js +4 -1
- package/components/Header/Header.js +2 -1
- package/components/Header/stories/Sticky.stories.js +2 -1
- package/components/Heading/Heading.js +2 -1
- package/components/Heading/HeadingSkeleton.js +2 -1
- package/components/Heading/StyledHeading.js +2 -1
- package/components/Image/Image.js +2 -1
- package/components/Image/StyledImage.js +2 -1
- package/components/InfiniteScroll/InfiniteScroll.js +2 -1
- package/components/Layer/Layer.js +2 -1
- package/components/Layer/LayerContainer.js +2 -1
- package/components/Layer/StyledLayer.js +2 -1
- package/components/List/List.js +2 -1
- package/components/List/stories/Order.stories.js +2 -1
- package/components/List/stories/Pinned.stories.js +2 -1
- package/components/Markdown/Markdown.js +2 -1
- package/components/MaskedInput/MaskedInput.js +2 -1
- package/components/Menu/Menu.js +2 -1
- package/components/Meter/Bar.js +2 -1
- package/components/Meter/Circle.js +2 -1
- package/components/Meter/Meter.js +2 -1
- package/components/Meter/StyledMeter.js +2 -1
- package/components/Meter/stories/Circle.stories.js +2 -1
- package/components/Meter/stories/VerticalBarMultiple.stories.js +2 -1
- package/components/NameValueList/NameValueList.js +2 -1
- package/components/NameValuePair/NameValuePair.js +2 -1
- package/components/Nav/stories/CustomThemed/JustifySidebar.stories.js +2 -1
- package/components/Nav/stories/Sidebar.stories.js +2 -1
- package/components/Notification/Notification.js +2 -1
- package/components/Notification/stories/Global.stories.js +2 -1
- package/components/Notification/stories/Title.stories.js +2 -1
- package/components/Notification/stories/TitleAndMessage.stories.js +2 -1
- package/components/Page/Page.js +2 -1
- package/components/Page/stories/PageNotificaton.stories.js +2 -1
- package/components/PageContent/PageContent.js +2 -1
- package/components/PageHeader/PageHeader.js +2 -1
- package/components/PageHeader/stories/MultipleActions.stories.js +2 -1
- package/components/Pagination/Pagination.js +2 -1
- package/components/Pagination/PaginationStep.js +2 -1
- package/components/Pagination/PaginationSummary.js +2 -1
- package/components/Pagination/stories/Grid.stories.js +2 -1
- package/components/Paragraph/Paragraph.js +2 -1
- package/components/Paragraph/ParagraphSkeleton.js +2 -1
- package/components/Paragraph/StyledParagraph.js +2 -1
- package/components/RadioButton/README.md +93 -1
- package/components/RadioButton/RadioButton.js +13 -5
- package/components/RadioButton/StyledRadioButton.js +103 -10
- package/components/RadioButton/stories/CustomThemed/Appearance.stories.tsx +190 -0
- package/components/RadioButtonGroup/RadioButtonGroup.js +2 -1
- package/components/RadioButtonGroup/stories/Children.stories.js +2 -1
- package/components/RadioButtonGroup/stories/CustomThemed/CustomTheme.stories.js +2 -1
- package/components/RadioButtonGroup/stories/Disabled.stories.js +2 -1
- package/components/RangeInput/RangeInput.js +2 -1
- package/components/RangeInput/StyledRangeInput.js +2 -1
- package/components/RangeInput/stories/CustomThemed/Bounds.stories.js +2 -1
- package/components/RangeSelector/EdgeControl.js +2 -1
- package/components/RangeSelector/RangeSelector.js +2 -1
- package/components/RangeSelector/index.d.ts +1 -10
- package/components/RangeSelector/stories/Basic.stories.js +2 -1
- package/components/RangeSelector/stories/CustomThemed/Custom.stories.js +2 -1
- package/components/RangeSelector/stories/CustomThemed/CustomEdgeControl.stories.js +2 -1
- package/components/RangeSelector/stories/Label.stories.js +2 -1
- package/components/RangeSelector/stories/Simple.stories.js +2 -1
- package/components/RangeSelector/stories/Step.stories.js +2 -1
- package/components/RangeSelector/stories/Thin.stories.js +2 -1
- package/components/RangeSelector/stories/Vertical.stories.js +2 -1
- package/components/RoutedAnchor/RoutedAnchor.js +2 -1
- package/components/RoutedButton/RoutedButton.js +2 -1
- package/components/Select/DefaultSelectTextInput.js +2 -1
- package/components/Select/Select.js +2 -1
- package/components/Select/SelectContainer.js +2 -1
- package/components/Select/StyledSelect.js +11 -3
- package/components/Select/stories/ChildrenRender.stories.js +2 -1
- package/components/Select/stories/Clear.stories.js +2 -1
- package/components/Select/stories/Controlled.stories.js +2 -1
- package/components/Select/stories/CustomThemed/CustomSearch.stories.js +2 -1
- package/components/Select/stories/Disabled.stories.js +2 -1
- package/components/Select/stories/InsideFormField.stories.js +2 -1
- package/components/Select/stories/Multiple.stories.js +2 -1
- package/components/Select/stories/ObjectOptions.stories.js +2 -1
- package/components/Select/stories/Search.stories.js +2 -1
- package/components/Select/stories/Simple.stories.js +2 -1
- package/components/Select/stories/ValueLabel.stories.js +2 -1
- package/components/Select/stories/components/SearchBorderBox.js +2 -1
- package/components/Select/stories/components/SearchInput.js +2 -1
- package/components/Select/utils.js +2 -1
- package/components/SelectMultiple/SelectMultiple.js +10 -4
- package/components/SelectMultiple/SelectMultipleContainer.js +2 -1
- package/components/SelectMultiple/SelectMultipleValue.js +2 -1
- package/components/SelectMultiple/SelectionSummary.js +2 -1
- package/components/SelectMultiple/stories/CustomMessages.stories.js +2 -1
- package/components/SelectMultiple/stories/Default.stories.js +2 -1
- package/components/SelectMultiple/stories/Disabled.stories.js +2 -1
- package/components/SelectMultiple/stories/FormField.stories.js +2 -1
- package/components/SelectMultiple/stories/Help.stories.js +2 -1
- package/components/SelectMultiple/stories/Limited.stories.js +2 -1
- package/components/SelectMultiple/stories/ObjectOptions.stories.js +2 -1
- package/components/SelectMultiple/stories/ShowSelectedInline.stories.js +2 -1
- package/components/Skeleton/Skeleton.js +2 -1
- package/components/Skeleton/SkeletonContext.js +2 -1
- package/components/Skeleton/stories/CustomThemed/Custom.stories.js +2 -1
- package/components/Skeleton/stories/GridContainer.stories.js +2 -1
- package/components/SkipLink/SkipLink.js +2 -1
- package/components/SkipLinks/SkipLinks.js +2 -1
- package/components/Spinner/Spinner.js +2 -1
- package/components/Spinner/stories/Animation.stories.js +2 -1
- package/components/Spinner/stories/Announced.stories.js +2 -1
- package/components/Stack/Stack.js +2 -1
- package/components/Stack/StyledStack.js +2 -1
- package/components/StarRating/StarRating.js +2 -1
- package/components/Stepper/Stepper.js +138 -101
- package/components/Stepper/StepperContext.js +5 -4
- package/components/Stepper/StepperDescription.js +6 -8
- package/components/Stepper/StepperHelperText.js +13 -15
- package/components/Stepper/StepperIndicator.js +37 -34
- package/components/Stepper/StepperLabel.js +11 -23
- package/components/Stepper/StepperStep.js +139 -82
- package/components/Stepper/StyledStepper.js +168 -115
- package/components/Stepper/index.d.ts +25 -13
- package/components/Stepper/index.js +5 -1
- package/components/Stepper/propTypes.js +3 -0
- package/components/Stepper/stories/Children.stories.tsx +73 -0
- package/components/Stepper/stories/CustomThemed.stories.tsx +301 -0
- package/components/Stepper/stories/CustomThemedHpe.stories.tsx +328 -0
- package/components/Stepper/stories/DisabledSteps.stories.js +2 -1
- package/components/Stepper/stories/ErrorStates.stories.js +2 -1
- package/components/Stepper/stories/HorizontalSteps.stories.js +2 -1
- package/components/Stepper/stories/Interactive.stories.js +2 -1
- package/components/Stepper/stories/KeyboardNavigation.stories.js +2 -1
- package/components/Stepper/stories/NestedSubSteps.stories.js +2 -1
- package/components/Stepper/stories/ThemingLightDark.stories.js +2 -1
- package/components/Stepper/stories/VerticalSteps.stories.js +2 -1
- package/components/Stepper/utils.js +54 -0
- package/components/Tab/StyledTab.js +2 -1
- package/components/Tab/Tab.js +2 -1
- package/components/Table/StyledTable.js +2 -1
- package/components/Table/Table.js +2 -1
- package/components/Table/stories/InfiniteScrollInTable.stories.js +2 -1
- package/components/TableBody/TableBody.js +2 -1
- package/components/TableCell/TableCell.js +2 -1
- package/components/TableFooter/TableFooter.js +2 -1
- package/components/TableHeader/TableHeader.js +2 -1
- package/components/TableRow/TableRow.js +2 -1
- package/components/Tabs/StyledTabs.js +2 -1
- package/components/Tabs/Tabs.js +2 -1
- package/components/Tabs/stories/CustomThemed/States.stories.js +2 -1
- package/components/Tabs/stories/Responsive.stories.js +2 -1
- package/components/Tag/Tag.js +2 -1
- package/components/Text/StyledText.js +2 -1
- package/components/Text/Text.js +2 -1
- package/components/Text/TextSkeleton.js +2 -1
- package/components/TextArea/StyledTextArea.js +2 -1
- package/components/TextArea/TextArea.js +2 -1
- package/components/TextArea/stories/CustomThemed/Themed.stories.js +2 -1
- package/components/TextArea/stories/InsideFormField.stories.js +2 -1
- package/components/TextArea/stories/NonResizable.stories.js +2 -1
- package/components/TextArea/stories/Simple.stories.js +2 -1
- package/components/TextInput/CopyButton.js +2 -1
- package/components/TextInput/README.md +29 -1
- package/components/TextInput/StyledTextInput.js +20 -6
- package/components/TextInput/TextInput.js +103 -26
- package/components/TextInput/index.d.ts +2 -0
- package/components/TextInput/propTypes.js +2 -0
- package/components/TextInput/stories/Clear.stories.tsx +68 -0
- package/components/TextInput/stories/ClearFormField.stories.tsx +45 -0
- package/components/TextInput/stories/InsideFormField.stories.js +2 -1
- package/components/TimeInput/StyledTimeInput.js +28 -18
- package/components/TimeInput/TimeInput.js +4 -1
- package/components/TimeInput/TimeInputPopup.js +2 -1
- package/components/TimeInput/stories/Inline.stories.tsx +28 -0
- package/components/Tip/Tip.js +2 -1
- package/components/Tip/stories/HeaderActions.stories.js +2 -1
- package/components/ToggleGroup/ToggleGroup.js +2 -1
- package/components/ToggleGroup/stories/Controlled.stories.js +2 -1
- package/components/Toolbar/Toolbar.js +2 -1
- package/components/Video/StyledVideo.js +2 -1
- package/components/Video/Video.js +2 -1
- package/components/Wizard/Wizard.js +13 -2
- package/components/Wizard/WizardContent.js +2 -1
- package/components/Wizard/WizardContext.js +2 -1
- package/components/Wizard/WizardProgress.js +1 -4
- package/components/Wizard/stories/BasicLinear.stories.js +2 -1
- package/components/Wizard/stories/Branching.stories.js +2 -1
- package/components/Wizard/stories/ClickableSteps.stories.js +2 -1
- package/components/Wizard/stories/Composable.stories.js +2 -1
- package/components/Wizard/stories/Controlled.stories.js +2 -1
- package/components/Wizard/stories/ExternalForm.stories.js +2 -1
- package/components/Wizard/stories/LongContent.stories.js +2 -1
- package/components/Wizard/stories/Modal.stories.js +2 -1
- package/components/Wizard/stories/NestedSubSteps.stories.js +2 -1
- package/components/Wizard/stories/NonClosableHeader.stories.js +2 -1
- package/components/Wizard/stories/ProgressiveSubSteps.stories.tsx +209 -0
- package/components/Wizard/stories/Validation.stories.js +2 -1
- package/components/WorldMap/WorldMap.js +2 -1
- package/contexts/AnalyticsContext/AnalyticsContext.js +2 -1
- package/contexts/AnnounceContext/stories/Polite.stories.js +2 -1
- package/contexts/RootsContext.js +2 -1
- package/contexts/ThemeContext/stories/ThemeContextExtend.stories.js +2 -1
- package/es6/components/Cards/index.d.ts +2 -16
- package/es6/components/CheckBox/README.md +95 -0
- package/es6/components/CheckBox/StyledCheckBox.js +103 -14
- package/es6/components/CheckBox/stories/CustomThemed/Appearance.stories.tsx +160 -0
- package/es6/components/DateInput/DateInput.js +10 -3
- package/es6/components/DateTimeInput/DateTimeInput.js +2 -0
- package/es6/components/DateTimeInput/StyledDateTimeInput.js +10 -2
- package/es6/components/FileInput/FileInput.js +77 -20
- package/es6/components/FileInput/README.md +5 -0
- package/es6/components/FormField/FormField.js +203 -66
- package/es6/components/FormField/README.md +56 -1
- package/es6/components/FormField/stories/CustomThemed/Appearance.stories.tsx +630 -0
- package/es6/components/Grommet/index.d.ts +4 -0
- package/es6/components/Grommet/propTypes.js +4 -1
- package/es6/components/RadioButton/README.md +93 -1
- package/es6/components/RadioButton/RadioButton.js +11 -4
- package/es6/components/RadioButton/StyledRadioButton.js +102 -8
- package/es6/components/RadioButton/stories/CustomThemed/Appearance.stories.tsx +190 -0
- package/es6/components/RangeSelector/index.d.ts +1 -10
- package/es6/components/Select/StyledSelect.js +10 -3
- package/es6/components/SelectMultiple/SelectMultiple.js +9 -3
- package/es6/components/Stepper/Stepper.js +137 -101
- package/es6/components/Stepper/StepperContext.js +5 -4
- package/es6/components/Stepper/StepperDescription.js +6 -8
- package/es6/components/Stepper/StepperHelperText.js +13 -15
- package/es6/components/Stepper/StepperIndicator.js +38 -35
- package/es6/components/Stepper/StepperLabel.js +11 -23
- package/es6/components/Stepper/StepperStep.js +137 -81
- package/es6/components/Stepper/StyledStepper.js +167 -113
- package/es6/components/Stepper/index.d.ts +25 -13
- package/es6/components/Stepper/index.js +2 -1
- package/es6/components/Stepper/propTypes.js +3 -0
- package/es6/components/Stepper/stories/Children.stories.tsx +73 -0
- package/es6/components/Stepper/stories/CustomThemed.stories.tsx +301 -0
- package/es6/components/Stepper/stories/CustomThemedHpe.stories.tsx +328 -0
- package/es6/components/Stepper/utils.js +50 -0
- package/es6/components/TextInput/README.md +29 -1
- package/es6/components/TextInput/StyledTextInput.js +19 -6
- package/es6/components/TextInput/TextInput.js +101 -25
- package/es6/components/TextInput/index.d.ts +2 -0
- package/es6/components/TextInput/propTypes.js +2 -0
- package/es6/components/TextInput/stories/Clear.stories.tsx +68 -0
- package/es6/components/TextInput/stories/ClearFormField.stories.tsx +45 -0
- package/es6/components/TimeInput/StyledTimeInput.js +27 -18
- package/es6/components/TimeInput/TimeInput.js +2 -0
- package/es6/components/TimeInput/stories/Inline.stories.tsx +28 -0
- package/es6/components/Wizard/Wizard.js +10 -1
- package/es6/components/Wizard/WizardProgress.js +1 -4
- package/es6/components/Wizard/stories/ProgressiveSubSteps.stories.tsx +209 -0
- package/es6/languages/default.json +5 -1
- package/es6/themes/base.d.ts +88 -95
- package/es6/themes/base.js +198 -167
- package/es6/utils/border.js +7 -0
- package/es6/utils/styles.js +144 -24
- package/grommet.min.js +1 -1
- package/grommet.min.js.map +1 -1
- package/languages/default.json +5 -1
- package/package.json +35 -35
- package/themes/base.d.ts +88 -95
- package/themes/base.js +198 -167
- package/tools/draft-release-version-pr.js +1 -1
- package/tools/generate-release-notes.js +1 -1
- package/tools/license-header.js +1 -1
- package/tools/pack.js +1 -1
- package/tools/release-checklist.js +1 -1
- package/tools/release-notes-utils.js +1 -1
- package/tools/release-preparation.md +55 -0
- package/tools/release-stable.js +1 -1
- package/tools/release-styled-components-beta-stable.js +1 -1
- package/utils/border.js +8 -1
- package/utils/styles.js +145 -27
- package/utils/useId.js +2 -1
- package/components/Stepper/StepConnector.js +0 -38
- package/es6/components/Stepper/StepConnector.js +0 -33
|
@@ -1,2 +1,94 @@
|
|
|
1
1
|
## RadioButton
|
|
2
|
-
Documentation for this component: https://v2.grommet.io/radiobutton
|
|
2
|
+
Documentation for this component: https://v2.grommet.io/radiobutton
|
|
3
|
+
|
|
4
|
+
### Backgrounds
|
|
5
|
+
|
|
6
|
+
Use `control` to theme the circular radio control 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
|
+
| `radioButton.control.background` | Unselected circular control background. |
|
|
13
|
+
| `radioButton.control.hover.background` | Enabled unselected control on hover. |
|
|
14
|
+
| `radioButton.control.selected.background` | Selected control background. |
|
|
15
|
+
| `radioButton.control.selected.hover.background` | Enabled selected control on hover. |
|
|
16
|
+
| `radioButton.container.background` | Outer label background. |
|
|
17
|
+
| `radioButton.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 label text or icon colors.
|
|
23
|
+
|
|
24
|
+
### Appearance
|
|
25
|
+
|
|
26
|
+
`radioButton.control` and `radioButton.container` accept the shared
|
|
27
|
+
`BoxPartThemeType` properties: `background`, `border`, `elevation`, `height`,
|
|
28
|
+
`margin`, `pad`, `round`, and `width`. Control `hover`, `selected`, and
|
|
29
|
+
`selected.hover`, and container `hover`, accept the `BoxStateThemeType`
|
|
30
|
+
properties: `background`, `border`, `elevation`, `pad`, and `round`.
|
|
31
|
+
|
|
32
|
+
Selected control styles inherit unspecified properties from the normal part.
|
|
33
|
+
Backgrounds retain the compatibility fallbacks below. Partial control border
|
|
34
|
+
objects inherit unspecified fields from the underlying normal, selected, or
|
|
35
|
+
legacy border. Other border values replace it. Borders support Box boolean,
|
|
36
|
+
side, object, and array values; dimensions support strings and min/max objects.
|
|
37
|
+
Use `border: false` and `round: false` to remove these treatments.
|
|
38
|
+
|
|
39
|
+
Hovering the label applies the current selection state's control hover styles
|
|
40
|
+
and the container hover styles. Focus without a focus indicator applies the
|
|
41
|
+
same styling. Disabled radios retain normal and selected styling without hover
|
|
42
|
+
or focus-as-hover overrides. State-specific hover styles never cross over to
|
|
43
|
+
the other selection state.
|
|
44
|
+
|
|
45
|
+
Render-function children own their control styling; container parts still
|
|
46
|
+
apply to the outer label. `check.extend` and `container.extend` remain the final
|
|
47
|
+
styling overrides on their respective parts. These tokens also apply to radios
|
|
48
|
+
rendered inside a `RadioButtonGroup`.
|
|
49
|
+
|
|
50
|
+
#### Fallbacks and compatibility
|
|
51
|
+
|
|
52
|
+
New themes should use `control` and `container`. Legacy tokens remain supported:
|
|
53
|
+
|
|
54
|
+
- Unselected control: `control.background`, then legacy `background.color`.
|
|
55
|
+
- Selected control: `control.selected.background`, then legacy
|
|
56
|
+
`check.background.color`, then the resolved unselected control background.
|
|
57
|
+
- Unselected control hover: `control.hover.background`, otherwise retain the
|
|
58
|
+
unselected background.
|
|
59
|
+
- Selected control hover: `control.selected.hover.background`, otherwise retain
|
|
60
|
+
the selected background.
|
|
61
|
+
- Container hover: `container.hover.background`, then legacy
|
|
62
|
+
`hover.background.color`, otherwise retain `container.background`.
|
|
63
|
+
|
|
64
|
+
Legacy background tokens keep their `{ color: ... }` shape. An explicit new
|
|
65
|
+
token, including `'transparent'`, takes precedence over its corresponding legacy
|
|
66
|
+
fallback. Control hover fills use only the state-specific `control` tokens.
|
|
67
|
+
|
|
68
|
+
These existing theme properties are deprecated but retain runtime support:
|
|
69
|
+
|
|
70
|
+
| Property | Replacement |
|
|
71
|
+
| --- | --- |
|
|
72
|
+
| `background` | `control.background` |
|
|
73
|
+
| `check.background` | `control.selected.background` |
|
|
74
|
+
| `check.radius` | `control.round` |
|
|
75
|
+
| `border.color` | `control.border.color` |
|
|
76
|
+
| `border.width` | `control.border.size` |
|
|
77
|
+
| `color` | `control.selected.border.color` |
|
|
78
|
+
| `hover.border.color` | Both `control.hover.border.color` and `control.selected.hover.border.color` |
|
|
79
|
+
| `hover.background` | `container.hover.background` |
|
|
80
|
+
|
|
81
|
+
When migrating the normal border color, set `control.selected.border.color`
|
|
82
|
+
explicitly to preserve a distinct selected outline, since selected parts inherit
|
|
83
|
+
unspecified properties from the normal part.
|
|
84
|
+
|
|
85
|
+
Theme `extend` CSS runs after background tokens and can override them. An
|
|
86
|
+
existing `check.extend` that sets the control background takes precedence over
|
|
87
|
+
`control.background` and `control.selected.background`. Adjust that extension,
|
|
88
|
+
or set `check.extend: undefined`, when the theme tokens should determine the
|
|
89
|
+
fill. `container.extend` runs after the container and control hover styles.
|
|
90
|
+
|
|
91
|
+
When these tokens are omitted, the existing appearance is unchanged.
|
|
92
|
+
Render-function children own their control backgrounds, while container
|
|
93
|
+
backgrounds still apply. Existing border styling, custom icons, and
|
|
94
|
+
`RadioButtonGroup` integration with `Form` and `FormField` remain available.
|
|
@@ -9,7 +9,7 @@ import { StyledRadioButton, StyledRadioButtonContainer, StyledRadioButtonIcon, S
|
|
|
9
9
|
import { RadioButtonPropTypes } from './propTypes';
|
|
10
10
|
import { useThemeValue } from '../../utils/useThemeValue';
|
|
11
11
|
var RadioButton = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
12
|
-
var _theme$radioButton$ba;
|
|
12
|
+
var _theme$radioButton$ba, _theme$radioButton$co;
|
|
13
13
|
var a11yTitle = _ref.a11yTitle,
|
|
14
14
|
checked = _ref.checked,
|
|
15
15
|
children = _ref.children,
|
|
@@ -36,10 +36,12 @@ var RadioButton = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
36
36
|
var Icon = theme.radioButton.icons.circle;
|
|
37
37
|
var borderColor = normalizeColor(theme.radioButton.border.color, theme);
|
|
38
38
|
var backgroundColor = normalizeColor((_theme$radioButton$ba = theme.radioButton.background) == null ? void 0 : _theme$radioButton$ba.color, theme);
|
|
39
|
+
var controlBackground = (_theme$radioButton$co = theme.radioButton.control) == null ? void 0 : _theme$radioButton$co.background;
|
|
39
40
|
if (checked) {
|
|
40
|
-
var _theme$radioButton$ch;
|
|
41
|
+
var _theme$radioButton$co2, _theme$radioButton$co3, _theme$radioButton$ch, _theme$radioButton$ch2;
|
|
41
42
|
borderColor = normalizeColor(theme.radioButton.color || 'control', theme);
|
|
42
|
-
|
|
43
|
+
controlBackground = (_theme$radioButton$co2 = (_theme$radioButton$co3 = theme.radioButton.control) == null || (_theme$radioButton$co3 = _theme$radioButton$co3.selected) == null ? void 0 : _theme$radioButton$co3.background) != null ? _theme$radioButton$co2 : (_theme$radioButton$ch = theme.radioButton.check) != null && (_theme$radioButton$ch = _theme$radioButton$ch.background) != null && _theme$radioButton$ch.color ? undefined : controlBackground;
|
|
44
|
+
if ((_theme$radioButton$ch2 = theme.radioButton.check) != null && (_theme$radioButton$ch2 = _theme$radioButton$ch2.background) != null && _theme$radioButton$ch2.color) {
|
|
43
45
|
backgroundColor = normalizeColor(theme.radioButton.check.background.color, theme);
|
|
44
46
|
}
|
|
45
47
|
}
|
|
@@ -56,6 +58,7 @@ var RadioButton = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
56
58
|
},
|
|
57
59
|
focus: focus,
|
|
58
60
|
focusIndicator: focusIndicator,
|
|
61
|
+
$keyboardFocus: focus && focusIndicator && usingKeyboard,
|
|
59
62
|
onFocus: function onFocus() {
|
|
60
63
|
return setFocus(true);
|
|
61
64
|
},
|
|
@@ -89,6 +92,7 @@ var RadioButton = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
89
92
|
focus: focus && focusIndicator,
|
|
90
93
|
hover: hover
|
|
91
94
|
}) : /*#__PURE__*/React.createElement(StyledRadioButtonBox, _extends({
|
|
95
|
+
$checked: checked,
|
|
92
96
|
focus: focus && focusIndicator && usingKeyboard,
|
|
93
97
|
align: "center",
|
|
94
98
|
justify: "center",
|
|
@@ -98,7 +102,10 @@ var RadioButton = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
98
102
|
size: theme.radioButton.border.width,
|
|
99
103
|
color: borderColor
|
|
100
104
|
},
|
|
101
|
-
backgroundColor: backgroundColor
|
|
105
|
+
backgroundColor: controlBackground != null ? undefined : backgroundColor
|
|
106
|
+
}, controlBackground != null && {
|
|
107
|
+
$controlBackground: controlBackground
|
|
108
|
+
}, {
|
|
102
109
|
round: theme.radioButton.check.radius
|
|
103
110
|
}, passThemeFlag), checked && (Icon ? /*#__PURE__*/React.createElement(Icon, {
|
|
104
111
|
theme: theme,
|
|
@@ -1,9 +1,80 @@
|
|
|
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 { 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
|
var disabledStyle = "\n opacity: 0.5;\n cursor: default;\n";
|
|
8
|
+
var boxPartStyles = function boxPartStyles(part, props) {
|
|
9
|
+
var _props$responsive;
|
|
10
|
+
var theme = props.theme;
|
|
11
|
+
var responsive = (_props$responsive = props.responsive) != null ? _props$responsive : true;
|
|
12
|
+
var styles = [];
|
|
13
|
+
if (part.border !== undefined) {
|
|
14
|
+
if (part.border === false) styles.push('border: none;');else {
|
|
15
|
+
if (hasSideSpecificBorder(part.border)) styles.push('border: none;');
|
|
16
|
+
styles.push(borderStyle(part.border, responsive, theme));
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
if (part.elevation !== undefined) styles.push(elevationStyle(part.elevation));
|
|
20
|
+
if (part.height !== undefined) styles.push(heightStyle(part.height, theme));
|
|
21
|
+
if (part.width !== undefined) styles.push(widthStyle(part.width, theme));
|
|
22
|
+
if (part.margin !== undefined) styles.push(edgeStyle('margin', part.margin, responsive, theme.box.responsiveBreakpoint, theme));
|
|
23
|
+
if (part.pad !== undefined) styles.push(edgeStyle('padding', part.pad, responsive, theme.box.responsiveBreakpoint, theme));
|
|
24
|
+
if (part.round !== undefined) styles.push(part.round === false ? 'border-radius: 0;' : roundStyle(part.round, responsive, theme));
|
|
25
|
+
return styles;
|
|
26
|
+
};
|
|
27
|
+
var _mergeControlBorder = function mergeControlBorder(base, override) {
|
|
28
|
+
if (override === undefined) return base;
|
|
29
|
+
if (Array.isArray(base) && override && typeof override === 'object' && !Array.isArray(override) && !override.side) return base.map(function (part) {
|
|
30
|
+
return _mergeControlBorder(part, override);
|
|
31
|
+
});
|
|
32
|
+
if (base && override && typeof base === 'object' && typeof override === 'object' && !Array.isArray(base) && !Array.isArray(override)) return _extends({}, base, override);
|
|
33
|
+
if (typeof base === 'string' && override && typeof override === 'object' && !Array.isArray(override)) return _extends({
|
|
34
|
+
side: base
|
|
35
|
+
}, override);
|
|
36
|
+
return override;
|
|
37
|
+
};
|
|
38
|
+
var controlHoverStyle = function controlHoverStyle(props) {
|
|
39
|
+
var _control$selected2;
|
|
40
|
+
var control = props.theme.radioButton.control;
|
|
41
|
+
if (props.disabled) return undefined;
|
|
42
|
+
var stateStyle = function stateStyle(state, checked) {
|
|
43
|
+
var part = _extends({}, state);
|
|
44
|
+
if ((state == null ? void 0 : state.border) !== undefined) {
|
|
45
|
+
var _control$selected;
|
|
46
|
+
var radioButton = props.theme.radioButton;
|
|
47
|
+
var baseBorder = {
|
|
48
|
+
size: radioButton.border.width,
|
|
49
|
+
color: checked ? radioButton.color || 'control' : radioButton.border.color
|
|
50
|
+
};
|
|
51
|
+
part.border = _mergeControlBorder(_mergeControlBorder(_mergeControlBorder(baseBorder, control == null ? void 0 : control.border), checked ? control == null || (_control$selected = control.selected) == null ? void 0 : _control$selected.border : undefined), state.border);
|
|
52
|
+
}
|
|
53
|
+
var styles = boxPartStyles(part, props);
|
|
54
|
+
if ((state == null ? void 0 : state.background) != null) styles.push(backgroundStyle(state.background, props.theme, false));
|
|
55
|
+
if (props.$keyboardFocus) styles.push(focusStyle());
|
|
56
|
+
return styles.length > 0 ? css(["", ""], styles) : undefined;
|
|
57
|
+
};
|
|
58
|
+
var normal = stateStyle(control == null ? void 0 : control.hover, false);
|
|
59
|
+
var selected = stateStyle(control == null || (_control$selected2 = control.selected) == null ? void 0 : _control$selected2.hover, true);
|
|
60
|
+
if (normal === undefined && selected === undefined) return undefined;
|
|
61
|
+
return css(["", " ", ""], normal && css(["input:not([disabled]):not(:checked) + ", "{", "}"],
|
|
62
|
+
// eslint-disable-next-line no-use-before-define
|
|
63
|
+
StyledRadioButtonBox, normal), selected && css(["input:not([disabled]):checked + ", "{", "}"],
|
|
64
|
+
// eslint-disable-next-line no-use-before-define
|
|
65
|
+
StyledRadioButtonBox, selected));
|
|
66
|
+
};
|
|
67
|
+
var containerBackgroundStyle = function containerBackgroundStyle(props) {
|
|
68
|
+
var _container$hover, _container$hover2, _hover$background;
|
|
69
|
+
var _props$theme$radioBut = props.theme.radioButton,
|
|
70
|
+
container = _props$theme$radioBut.container,
|
|
71
|
+
hover = _props$theme$radioBut.hover;
|
|
72
|
+
var normalStyles = boxPartStyles(container, props);
|
|
73
|
+
var hoverStyles = boxPartStyles(container.hover || {}, props);
|
|
74
|
+
if (container.background == null && ((_container$hover = container.hover) == null ? void 0 : _container$hover.background) == null && normalStyles.length === 0 && hoverStyles.length === 0) return undefined;
|
|
75
|
+
var hoverBackground = ((_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));
|
|
76
|
+
return css(["", " ", " ", " ", ""], normalStyles.length > 0 && 'box-sizing: border-box;', normalStyles, backgroundStyle(container.background, props.theme, false), !props.disabled && (hoverBackground || hoverStyles.length > 0) && css(["&:hover{", " ", "}", ""], hoverBackground, hoverStyles, props.focus && !props.focusIndicator && css(["", " ", ""], hoverBackground, hoverStyles)));
|
|
77
|
+
};
|
|
7
78
|
var StyledRadioButtonContainer = styled.label.withConfig(styledComponentsConfig).withConfig({
|
|
8
79
|
displayName: "StyledRadioButton__StyledRadioButtonContainer",
|
|
9
80
|
componentId: "sc-g1f6ld-0"
|
|
@@ -14,11 +85,18 @@ var StyledRadioButtonContainer = styled.label.withConfig(styledComponentsConfig)
|
|
|
14
85
|
}, function (props) {
|
|
15
86
|
return normalizeColor(props.theme.radioButton.hover.border.color, props.theme);
|
|
16
87
|
}, function (props) {
|
|
17
|
-
|
|
88
|
+
var _props$theme$radioBut2;
|
|
89
|
+
return normalizeColor(!props.disabled && ((_props$theme$radioBut2 = props.theme.radioButton.container.hover) == null ? void 0 : _props$theme$radioBut2.background) == null && props.theme.radioButton.hover && props.theme.radioButton.hover.background && props.theme.radioButton.hover.background.color, props.theme);
|
|
18
90
|
}, function (props) {
|
|
19
|
-
|
|
91
|
+
var _props$theme$radioBut3;
|
|
92
|
+
return props.focus && !props.focusIndicator && "\n input:not([disabled]) + div,\n input:not([disabled]) + span {\n border-color: " + normalizeColor(props.theme.radioButton.hover.border.color, props.theme) + ";\n }\n background-color: " + normalizeColor(!props.disabled && ((_props$theme$radioBut3 = props.theme.radioButton.container.hover) == null ? void 0 : _props$theme$radioBut3.background) == null && props.theme.radioButton.hover && props.theme.radioButton.hover.background && props.theme.radioButton.hover.background.color, props.theme) + ";\n ";
|
|
20
93
|
}, function (props) {
|
|
21
|
-
|
|
94
|
+
var controlStyle = controlHoverStyle(props);
|
|
95
|
+
var containerStyle = containerBackgroundStyle(props);
|
|
96
|
+
if (containerStyle) {
|
|
97
|
+
return css(["", " ", " ", ""], containerStyle, controlStyle && css(["&:hover{", "}", ""], controlStyle, props.focus && !props.focusIndicator && controlStyle), props.theme.radioButton.container.extend);
|
|
98
|
+
}
|
|
99
|
+
return controlStyle ? css(["&:hover{", "}", " ", ""], controlStyle, props.focus && !props.focusIndicator && controlStyle, props.theme.radioButton.container.extend) : props.theme.radioButton.container.extend;
|
|
22
100
|
});
|
|
23
101
|
var StyledRadioButtonInput = styled.input.withConfig(styledComponentsConfig).withConfig({
|
|
24
102
|
displayName: "StyledRadioButton__StyledRadioButtonInput",
|
|
@@ -47,12 +125,28 @@ var StyledRadioButtonIcon = styled.svg.withConfig(styledComponentsConfig).withCo
|
|
|
47
125
|
var StyledRadioButtonBox = styled(Box).withConfig({
|
|
48
126
|
displayName: "StyledRadioButton__StyledRadioButtonBox",
|
|
49
127
|
componentId: "sc-g1f6ld-4"
|
|
50
|
-
})(["background-color:", ";transform:scale(1);", ";"
|
|
128
|
+
})(["background-color:", ";transform:scale(1);", ";"], function (props) {
|
|
51
129
|
return props.backgroundColor;
|
|
52
130
|
}, function (props) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
131
|
+
var _check$background;
|
|
132
|
+
var _props$theme$radioBut4 = props.theme.radioButton,
|
|
133
|
+
control = _props$theme$radioBut4.control,
|
|
134
|
+
check = _props$theme$radioBut4.check;
|
|
135
|
+
var selected = props.$checked ? control == null ? void 0 : control.selected : undefined;
|
|
136
|
+
var focus = props.focus && focusStyle();
|
|
137
|
+
var part = _extends({}, control, selected);
|
|
138
|
+
if ((control == null ? void 0 : control.border) !== undefined || (selected == null ? void 0 : selected.border) !== undefined) part.border = _mergeControlBorder(_mergeControlBorder(props.border, control == null ? void 0 : control.border), selected == null ? void 0 : selected.border);
|
|
139
|
+
var styles = boxPartStyles(part, props);
|
|
140
|
+
if (props.$checked === undefined && (control != null && control.selected || (_check$background = check.background) != null && _check$background.color)) {
|
|
141
|
+
var _control$selected3, _control$selected4, _ref, _control$selected$bac, _control$selected5, _check$background2;
|
|
142
|
+
var selectedPart = _extends({}, control, control == null ? void 0 : control.selected);
|
|
143
|
+
if ((control == null ? void 0 : control.border) !== undefined || (control == null || (_control$selected3 = control.selected) == null ? void 0 : _control$selected3.border) !== undefined) selectedPart.border = _mergeControlBorder(_mergeControlBorder(props.border, control == null ? void 0 : control.border), control == null || (_control$selected4 = control.selected) == null ? void 0 : _control$selected4.border);
|
|
144
|
+
var selectedBackground = (_ref = (_control$selected$bac = control == null || (_control$selected5 = control.selected) == null ? void 0 : _control$selected5.background) != null ? _control$selected$bac : (_check$background2 = check.background) == null ? void 0 : _check$background2.color) != null ? _ref : control == null ? void 0 : control.background;
|
|
145
|
+
styles.push(css(["input:checked + &{", " ", " ", " ", "}"], boxPartStyles(selectedPart, props), selectedBackground != null && backgroundStyle(selectedBackground, props.theme, false), focus, check.extend));
|
|
146
|
+
}
|
|
147
|
+
if (props.$controlBackground != null) return css(["", " ", " ", " ", ""], styles, backgroundStyle(props.$controlBackground, props.theme, false), focus, check.extend);
|
|
148
|
+
if (styles.length === 0) return focus ? css(["", " ", ""], focus, check.extend) : check.extend;
|
|
149
|
+
return css(["", " ", " ", ""], styles, focus, check.extend);
|
|
56
150
|
});
|
|
57
151
|
var StyledRadioButton = styled(Box).withConfig({
|
|
58
152
|
displayName: "StyledRadioButton",
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: © Hewlett Packard Enterprise Development LP
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import React, { useState } from 'react';
|
|
4
|
+
|
|
5
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
6
|
+
|
|
7
|
+
import {
|
|
8
|
+
Box,
|
|
9
|
+
Button,
|
|
10
|
+
CheckBox,
|
|
11
|
+
Form,
|
|
12
|
+
FormField,
|
|
13
|
+
Grommet,
|
|
14
|
+
Heading,
|
|
15
|
+
RadioButton,
|
|
16
|
+
RadioButtonGroup,
|
|
17
|
+
} from 'grommet';
|
|
18
|
+
import { ThemeType } from 'grommet/themes';
|
|
19
|
+
import { deepMerge } from 'grommet/utils';
|
|
20
|
+
import { hpe } from 'grommet-theme-hpe';
|
|
21
|
+
|
|
22
|
+
const customTheme: ThemeType = {
|
|
23
|
+
global: {
|
|
24
|
+
colors: {
|
|
25
|
+
background: { light: 'light-1', dark: 'dark-1' },
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
radioButton: {
|
|
29
|
+
control: {
|
|
30
|
+
background: { color: { light: 'light-3', dark: 'dark-3' } },
|
|
31
|
+
border: { color: 'border', size: 'xsmall' },
|
|
32
|
+
height: '32px',
|
|
33
|
+
width: '32px',
|
|
34
|
+
pad: 'none',
|
|
35
|
+
round: 'full',
|
|
36
|
+
hover: {
|
|
37
|
+
background: { color: { light: 'accent-3', dark: 'neutral-3' } },
|
|
38
|
+
border: { color: 'accent-3' },
|
|
39
|
+
},
|
|
40
|
+
selected: {
|
|
41
|
+
background: { color: { light: 'accent-1', dark: 'accent-2' } },
|
|
42
|
+
border: { color: 'accent-1' },
|
|
43
|
+
hover: {
|
|
44
|
+
background: { color: { light: 'accent-4', dark: 'neutral-4' } },
|
|
45
|
+
border: { color: 'accent-4' },
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
container: {
|
|
50
|
+
background: { color: { light: 'light-2', dark: 'dark-2' } },
|
|
51
|
+
border: { color: 'border', size: 'xsmall' },
|
|
52
|
+
elevation: 'none',
|
|
53
|
+
margin: { bottom: 'xxsmall' },
|
|
54
|
+
pad: { horizontal: 'small', vertical: 'xsmall' },
|
|
55
|
+
round: 'xsmall',
|
|
56
|
+
width: { min: '240px' },
|
|
57
|
+
hover: {
|
|
58
|
+
background: { color: { light: 'light-4', dark: 'dark-4' } },
|
|
59
|
+
border: { color: 'accent-3' },
|
|
60
|
+
elevation: 'small',
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
const hpeTheme: ThemeType = deepMerge(hpe, {
|
|
67
|
+
radioButton: {
|
|
68
|
+
control: {
|
|
69
|
+
background: 'background-front',
|
|
70
|
+
hover: {
|
|
71
|
+
background: 'background-hover',
|
|
72
|
+
border: { color: 'border-strong' },
|
|
73
|
+
},
|
|
74
|
+
selected: {
|
|
75
|
+
background: 'background-selected-primary-strong',
|
|
76
|
+
border: { color: 'border-selected' },
|
|
77
|
+
hover: { background: 'background-selected-primary-strong-hover' },
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
check: { extend: undefined },
|
|
81
|
+
container: { extend: undefined },
|
|
82
|
+
icon: { extend: undefined },
|
|
83
|
+
extend: undefined,
|
|
84
|
+
},
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
const AppearanceExample = () => {
|
|
88
|
+
const [dark, setDark] = useState(false);
|
|
89
|
+
const [selected, setSelected] = useState('selected');
|
|
90
|
+
const [value, setValue] = useState({ delivery: 'Standard' });
|
|
91
|
+
const [theme, setTheme] = useState(hpeTheme);
|
|
92
|
+
|
|
93
|
+
return (
|
|
94
|
+
<Grommet
|
|
95
|
+
theme={theme}
|
|
96
|
+
themeMode={dark ? 'dark' : 'light'}
|
|
97
|
+
background="background"
|
|
98
|
+
>
|
|
99
|
+
<Box pad="large" gap="medium">
|
|
100
|
+
<Heading level={2} margin="none">
|
|
101
|
+
Preferences
|
|
102
|
+
</Heading>
|
|
103
|
+
<Box
|
|
104
|
+
direction="row"
|
|
105
|
+
wrap
|
|
106
|
+
gap="large"
|
|
107
|
+
border={{ color: 'border', size: 'small', side: 'bottom' }}
|
|
108
|
+
pad="small"
|
|
109
|
+
>
|
|
110
|
+
<RadioButtonGroup
|
|
111
|
+
name="theme"
|
|
112
|
+
options={['Custom', 'HPE']}
|
|
113
|
+
value={theme === customTheme ? 'Custom' : 'HPE'}
|
|
114
|
+
onChange={(event) =>
|
|
115
|
+
setTheme(event.target.value === 'Custom' ? customTheme : hpeTheme)
|
|
116
|
+
}
|
|
117
|
+
/>
|
|
118
|
+
<CheckBox
|
|
119
|
+
toggle
|
|
120
|
+
label="Dark mode"
|
|
121
|
+
checked={dark}
|
|
122
|
+
onChange={(event) => setDark(event.target.checked)}
|
|
123
|
+
/>
|
|
124
|
+
</Box>
|
|
125
|
+
<Box gap="small" background="background-back" pad="small" round>
|
|
126
|
+
<RadioButton
|
|
127
|
+
name="example"
|
|
128
|
+
label="Unchecked"
|
|
129
|
+
value="unchecked"
|
|
130
|
+
checked={selected === 'unchecked'}
|
|
131
|
+
onChange={(event) => setSelected(event.target.value)}
|
|
132
|
+
/>
|
|
133
|
+
<RadioButton
|
|
134
|
+
name="example"
|
|
135
|
+
label="Selected"
|
|
136
|
+
value="selected"
|
|
137
|
+
checked={selected === 'selected'}
|
|
138
|
+
onChange={(event) => setSelected(event.target.value)}
|
|
139
|
+
/>
|
|
140
|
+
<RadioButton
|
|
141
|
+
name="disabled-unchecked"
|
|
142
|
+
label="Disabled unchecked"
|
|
143
|
+
disabled
|
|
144
|
+
/>
|
|
145
|
+
<RadioButton
|
|
146
|
+
name="disabled-selected"
|
|
147
|
+
label="Disabled selected"
|
|
148
|
+
disabled
|
|
149
|
+
checked
|
|
150
|
+
/>
|
|
151
|
+
</Box>
|
|
152
|
+
<Box gap="small" background="background-back" pad="small" round>
|
|
153
|
+
<Form value={value} onChange={setValue}>
|
|
154
|
+
<FormField name="delivery" label="Delivery">
|
|
155
|
+
<RadioButtonGroup
|
|
156
|
+
aria-label="Delivery"
|
|
157
|
+
name="delivery"
|
|
158
|
+
options={[
|
|
159
|
+
'Standard',
|
|
160
|
+
'Express',
|
|
161
|
+
{
|
|
162
|
+
label: 'Unavailable',
|
|
163
|
+
value: 'Unavailable',
|
|
164
|
+
disabled: true,
|
|
165
|
+
},
|
|
166
|
+
]}
|
|
167
|
+
/>
|
|
168
|
+
</FormField>
|
|
169
|
+
<Box direction="row" gap="small" margin={{ top: 'medium' }}>
|
|
170
|
+
<Button type="submit" label="Submit" primary />
|
|
171
|
+
<Button type="reset" label="Reset" />
|
|
172
|
+
</Box>
|
|
173
|
+
</Form>
|
|
174
|
+
</Box>
|
|
175
|
+
</Box>
|
|
176
|
+
</Grommet>
|
|
177
|
+
);
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
const meta: Meta<typeof RadioButton> = {
|
|
181
|
+
title: 'Input/RadioButton/Custom Themed/Appearance',
|
|
182
|
+
component: RadioButton,
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
export default meta;
|
|
186
|
+
type Story = StoryObj<typeof RadioButton>;
|
|
187
|
+
|
|
188
|
+
export const Appearance: Story = {
|
|
189
|
+
render: () => <AppearanceExample />,
|
|
190
|
+
};
|
|
@@ -38,15 +38,6 @@ export interface RangeSelectorExtendedProps
|
|
|
38
38
|
'color' | 'onChange'
|
|
39
39
|
> {}
|
|
40
40
|
|
|
41
|
-
declare const RangeSelector: React.FC<
|
|
42
|
-
RangeSelectorProps &
|
|
43
|
-
Omit<
|
|
44
|
-
React.DetailedHTMLProps<
|
|
45
|
-
React.HTMLAttributes<HTMLDivElement>,
|
|
46
|
-
HTMLDivElement
|
|
47
|
-
>,
|
|
48
|
-
'color'
|
|
49
|
-
>
|
|
50
|
-
>;
|
|
41
|
+
declare const RangeSelector: React.FC<RangeSelectorExtendedProps>;
|
|
51
42
|
|
|
52
43
|
export { RangeSelector };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// SPDX-FileCopyrightText: © Hewlett Packard Enterprise Development LP
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import styled from 'styled-components';
|
|
3
|
+
import styled, { css } from 'styled-components';
|
|
4
4
|
import { Box } from '../Box';
|
|
5
5
|
import { Button } from '../Button';
|
|
6
6
|
import { DropButton } from '../DropButton';
|
|
7
7
|
import { TextInput } from '../TextInput';
|
|
8
|
-
import { getHoverIndicatorStyle, selectedStyle, controlBorderStyle, overflowStyle, sizeStyle, styledComponentsConfig } from '../../utils';
|
|
8
|
+
import { getHoverIndicatorStyle, selectedStyle, controlBorderStyle, focusStyle, inputAppearanceStyle, overflowStyle, sizeStyle, styledComponentsConfig } from '../../utils';
|
|
9
9
|
export var StyledContainer = styled(Box).withConfig({
|
|
10
10
|
displayName: "StyledSelect__StyledContainer",
|
|
11
11
|
componentId: "sc-znp66n-0"
|
|
@@ -54,7 +54,14 @@ export var StyledSelectDropButton = styled(DropButton).withConfig({
|
|
|
54
54
|
return !props.plainSelect && controlBorderStyle;
|
|
55
55
|
}, function (props) {
|
|
56
56
|
var _props$theme$select;
|
|
57
|
-
|
|
57
|
+
var appearance = inputAppearanceStyle(props, {
|
|
58
|
+
wrapper: true,
|
|
59
|
+
skipPadding: true
|
|
60
|
+
});
|
|
61
|
+
var extend = (_props$theme$select = props.theme.select) == null || (_props$theme$select = _props$theme$select.control) == null ? void 0 : _props$theme$select.extend;
|
|
62
|
+
return appearance ? css(["", " ", " ", ""], appearance, (!props.plain || props.focusIndicator) && css(["&:focus:focus-visible{", "}"], focusStyle({
|
|
63
|
+
inset: props.focusIndicator === 'inset'
|
|
64
|
+
})), extend) : extend;
|
|
58
65
|
}, function (props) {
|
|
59
66
|
var _props$theme$select2;
|
|
60
67
|
return props.open && ((_props$theme$select2 = props.theme.select) == null || (_props$theme$select2 = _props$theme$select2.control) == null ? void 0 : _props$theme$select2.open);
|
|
@@ -4,8 +4,8 @@ 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, isValidElement, useCallback, useContext, useMemo, useState, useRef, useEffect } from 'react';
|
|
7
|
-
import styled from 'styled-components';
|
|
8
|
-
import { controlBorderStyle, useKeyboard, useForwardedRef } from '../../utils';
|
|
7
|
+
import styled, { css } from 'styled-components';
|
|
8
|
+
import { controlBorderStyle, inputAppearanceStyle, useKeyboard, useForwardedRef } from '../../utils';
|
|
9
9
|
import { Box } from '../Box';
|
|
10
10
|
import { DropButton } from '../DropButton';
|
|
11
11
|
import { Keyboard } from '../Keyboard';
|
|
@@ -25,7 +25,12 @@ var StyledSelectBox = styled(Box).withConfig({
|
|
|
25
25
|
return !props.plainSelect && controlBorderStyle;
|
|
26
26
|
}, function (props) {
|
|
27
27
|
var _props$theme$select;
|
|
28
|
-
|
|
28
|
+
var appearance = inputAppearanceStyle(props, {
|
|
29
|
+
wrapper: true,
|
|
30
|
+
skipPadding: true
|
|
31
|
+
});
|
|
32
|
+
var extend = (_props$theme$select = props.theme.select) == null || (_props$theme$select = _props$theme$select.control) == null ? void 0 : _props$theme$select.extend;
|
|
33
|
+
return appearance ? css(["", "", ""], appearance, extend) : extend;
|
|
29
34
|
}, function (props) {
|
|
30
35
|
var _props$theme$select$c;
|
|
31
36
|
return props.open && ((_props$theme$select$c = props.theme.select.control) == null ? void 0 : _props$theme$select$c.open);
|
|
@@ -460,6 +465,7 @@ var SelectMultiple = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
460
465
|
}, rest)), displaySelectIcon)), !open && (value == null ? void 0 : value.length) > 0 && (selectValue || displayLabelKey))) : /*#__PURE__*/React.createElement(Box, {
|
|
461
466
|
width: width
|
|
462
467
|
}, /*#__PURE__*/React.createElement(StyledSelectDropButton, _extends({}, dropButtonProps, {
|
|
468
|
+
$inputWidth: width,
|
|
463
469
|
dropAlign: dropAlign,
|
|
464
470
|
dropTarget: dropTarget,
|
|
465
471
|
alignSelf: alignSelf,
|