grommet 2.47.0 → 2.49.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 +1 -2
- package/components/Accordion/Accordion.js +1 -2
- package/components/Accordion/stories/CustomHeader.stories.js +1 -2
- package/components/AccordionPanel/AccordionPanel.js +4 -8
- package/components/Anchor/Anchor.js +5 -6
- package/components/Anchor/StyledAnchor.js +2 -3
- package/components/Avatar/Avatar.js +1 -2
- package/components/Box/Box.js +6 -3
- package/components/Box/ResponsiveContainerProvider.js +1 -2
- package/components/Box/StyledBox.js +5 -4
- package/components/Box/stories/ResponsiveContainer.stories.js +1 -2
- package/components/Button/Badge.js +1 -2
- package/components/Button/BusyAnimation.js +6 -3
- package/components/Button/Button.js +4 -3
- package/components/Button/StyledButton.js +4 -3
- package/components/Button/StyledButtonKind.js +4 -3
- package/components/Button/index.d.ts +1 -1
- package/components/Button/propTypes.js +1 -1
- package/components/Button/stories/Busy.stories.js +1 -2
- package/components/Calendar/Calendar.js +159 -140
- package/components/Calendar/StyledCalendar.js +34 -37
- package/components/Calendar/stories/ActiveDate.stories.js +1 -2
- package/components/Calendar/stories/CustomDay.stories.js +1 -2
- package/components/Calendar/stories/CustomHeader.stories.js +1 -2
- package/components/Calendar/stories/CustomThemed/CustomSizeHeading.stories.js +1 -2
- package/components/Calendar/stories/Dual.stories.js +1 -4
- package/components/Calendar/stories/HeaderLevel.stories.js +1 -2
- package/components/Calendar/stories/Multiple.stories.js +1 -2
- package/components/Calendar/stories/ShowAdjacentDays.stories.js +2 -3
- package/components/Calendar/stories/Simple.stories.js +1 -2
- package/components/Card/Card.js +1 -2
- package/components/Cards/Cards.js +4 -6
- package/components/Carousel/Carousel.js +1 -2
- package/components/Carousel/CarouselChild.js +1 -2
- package/components/Carousel/StyledCarousel.js +1 -2
- package/components/Chart/Chart.js +15 -14
- package/components/Chart/StyledChart.js +1 -2
- package/components/Chart/calcs.js +21 -13
- package/components/Chart/stories/Rich.stories.js +1 -2
- package/components/Chart/stories/Scan.stories.js +1 -2
- package/components/Chart/stories/Window.stories.js +1 -2
- package/components/Chart/stories/Zoom.stories.js +1 -2
- package/components/CheckBox/CheckBox.js +2 -3
- package/components/CheckBox/StyledCheckBox.js +1 -2
- package/components/CheckBox/stories/CustomThemed/Custom.stories.js +1 -2
- package/components/CheckBox/stories/CustomThemed/CustomToggle.stories.js +1 -2
- package/components/CheckBox/stories/Indeterminate.stories.js +1 -2
- package/components/CheckBox/stories/NoLabel.stories.js +1 -2
- package/components/CheckBox/stories/Simple.stories.js +1 -2
- package/components/CheckBox/stories/WithStickyDiv.stories.js +1 -2
- package/components/CheckBoxGroup/CheckBoxGroup.js +15 -5
- package/components/CheckBoxGroup/stories/Children.stories.js +1 -2
- package/components/CheckBoxGroup/stories/InitialValues.stories.js +1 -2
- package/components/Clock/Analog.js +1 -2
- package/components/Clock/Clock.js +1 -2
- package/components/Clock/Digital.js +1 -2
- package/components/Clock/StyledClock.js +1 -2
- package/components/Collapsible/Collapsible.js +1 -2
- package/components/Data/Data.js +6 -3
- package/components/Data/DataForm.js +7 -6
- package/components/Data/index.d.ts +3 -0
- package/components/Data/propTypes.js +4 -1
- package/components/Data/stories/Infinite.stories.js +11 -17
- package/components/Data/stories/Inline.stories.js +1 -2
- package/components/Data/stories/OnSelect.stories.js +11 -17
- package/components/Data/stories/SpaceX.stories.js +11 -17
- package/components/Data/stories/StarWars.stories.js +16 -44
- package/components/DataChart/DataChart.js +18 -17
- package/components/DataChart/Detail.js +3 -4
- package/components/DataChart/Legend.js +9 -11
- package/components/DataChart/XAxis.js +1 -2
- package/components/DataChart/XGuide.js +1 -2
- package/components/DataChart/YAxis.js +1 -2
- package/components/DataChart/YGuide.js +1 -2
- package/components/DataChart/stories/Prediction.stories.js +1 -2
- package/components/DataChart/utils.js +15 -8
- package/components/DataClearFilters/DataClearFilters.js +1 -2
- package/components/DataClearFilters/stories/Simple.stories.js +1 -2
- package/components/DataFilter/DataFilter.js +15 -12
- package/components/DataFilters/DataFilters.js +10 -12
- package/components/DataSearch/DataSearch.js +6 -6
- package/components/DataSort/DataSort.js +7 -6
- package/components/DataSummary/DataSummary.js +7 -8
- package/components/DataTable/Body.js +106 -35
- package/components/DataTable/Cell.js +1 -2
- package/components/DataTable/DataTable.js +49 -16
- package/components/DataTable/ExpanderCell.js +55 -7
- package/components/DataTable/Footer.js +7 -5
- package/components/DataTable/GroupedBody.js +12 -5
- package/components/DataTable/Header.js +87 -34
- package/components/DataTable/PlaceholderBody.js +1 -2
- package/components/DataTable/Resizer.js +167 -47
- package/components/DataTable/Searcher.js +40 -13
- package/components/DataTable/StyledDataTable.js +2 -3
- package/components/DataTable/index.d.ts +19 -0
- package/components/DataTable/propTypes.js +19 -0
- package/components/DataTable/stories/ControlledGrouped.stories.js +5 -2
- package/components/DataTable/stories/Grouped.stories.js +7 -1
- package/components/DataTable/stories/GroupedOnSelect.stories.js +7 -1
- package/components/DataTable/stories/OnUpdate.stories.js +4 -2
- package/components/DataTable/stories/SpaceX.stories.js +23 -18
- package/components/DataTable/stories/SpaceXUngrouped.stories.js +8 -9
- package/components/DataTable/stories/Styled.stories.js +5 -1
- package/components/DataTable/stories/rowDetails.stories.js +22 -48
- package/components/DataTableColumns/DataTableColumns.js +39 -24
- package/components/DataTableGroupBy/DataTableGroupBy.js +1 -2
- package/components/DataView/DataView.js +1 -2
- package/components/DateInput/DateInput.js +20 -19
- package/components/DateInput/stories/FormatInline.stories.js +1 -2
- package/components/Diagram/Diagram.js +1 -2
- package/components/Diagram/StyledDiagram.js +1 -2
- package/components/Diagram/stories/Animated.stories.js +1 -2
- package/components/Diagram/stories/Progressing.stories.js +1 -2
- package/components/Distribution/Distribution.js +8 -5
- package/components/Drop/Drop.js +1 -2
- package/components/Drop/DropContainer.js +1 -2
- package/components/Drop/StyledDrop.js +1 -2
- package/components/Drop/stories/CustomThemed/Lazy.stories.js +1 -2
- package/components/Drop/stories/CustomThemed/Themed.stories.js +1 -2
- package/components/Drop/stories/Inline.stories.js +1 -2
- package/components/Drop/stories/Meter.stories.js +1 -2
- package/components/Drop/stories/Multiple.stories.js +1 -2
- package/components/Drop/stories/Overflow.stories.js +1 -2
- package/components/Drop/stories/Plain.stories.js +1 -2
- package/components/Drop/stories/Progressive.stories.js +1 -2
- package/components/Drop/stories/Simple.stories.js +1 -2
- package/components/Drop/stories/Styled.stories.js +1 -2
- package/components/DropButton/DropButton.js +1 -2
- package/components/FileInput/FileInput.js +78 -41
- package/components/FileInput/index.d.ts +10 -1
- package/components/FileInput/propTypes.js +11 -0
- package/components/FocusedContainer.js +1 -2
- package/components/Footer/Footer.js +5 -1
- package/components/Form/Form.js +11 -12
- package/components/Form/FormContext.js +1 -2
- package/components/Form/stories/ArrayOfFormFields.stories.js +1 -2
- package/components/Form/stories/Controlled.stories.js +2 -2
- package/components/Form/stories/ControlledInput.stories.js +2 -2
- package/components/Form/stories/ControlledInputLazy.stories.js +2 -2
- package/components/Form/stories/ControlledLazy.stories.js +2 -2
- package/components/Form/stories/CustomThemed/Custom.stories.js +1 -0
- package/components/Form/stories/CustomThemed/FieldBorderPosition.stories.js +1 -2
- package/components/Form/stories/CustomThemed/FieldCustomStates.stories.js +1 -2
- package/components/Form/stories/DynamicFields.stories.js +1 -2
- package/components/Form/stories/FieldStates.stories.js +1 -2
- package/components/Form/stories/FieldWithChildren.stories.js +2 -0
- package/components/Form/stories/SolicitedFeedback.stories.js +1 -2
- package/components/Form/stories/Uncontrolled.stories.js +1 -0
- package/components/Form/stories/UnsolicitedFeedback.stories.js +1 -2
- package/components/Form/stories/ValidateOnBlur.stories.js +1 -1
- package/components/Form/stories/ValidateOnChange.stories.js +1 -2
- package/components/Form/stories/ValidateOnMount.stories.js +1 -2
- package/components/Form/stories/typescript/TypedForm.stories.tsx +7 -1
- package/components/FormField/FormField.js +23 -3
- package/components/FormField/stories/Simple.stories.js +1 -2
- package/components/Grid/Grid.js +1 -2
- package/components/Grid/StyledGrid.js +1 -2
- package/components/Grid/stories/ResponsiveCards.stories.js +1 -2
- package/components/Grommet/Grommet.js +1 -2
- package/components/Grommet/StyledGrommet.js +1 -2
- package/components/Grommet/index.d.ts +30 -0
- package/components/Grommet/propTypes.js +31 -1
- package/components/Header/Header.js +3 -4
- package/components/Header/stories/Sticky.stories.js +1 -2
- package/components/Heading/Heading.js +1 -2
- package/components/Heading/HeadingSkeleton.js +1 -2
- package/components/Heading/StyledHeading.js +1 -2
- package/components/Image/Image.js +1 -2
- package/components/Image/StyledImage.js +1 -2
- package/components/InfiniteScroll/InfiniteScroll.js +1 -2
- package/components/Layer/Layer.js +47 -18
- package/components/Layer/LayerContainer.js +19 -17
- package/components/Layer/StyledLayer.js +3 -4
- package/components/Layer/stories/Form.stories.js +1 -1
- package/components/List/List.js +140 -150
- package/components/List/index.d.ts +3 -0
- package/components/List/propTypes.js +3 -0
- package/components/List/stories/Order.stories.js +1 -2
- package/components/List/stories/Pinned.stories.js +1 -2
- package/components/Markdown/Markdown.js +1 -2
- package/components/MaskedInput/MaskedInput.js +7 -3
- package/components/Menu/Menu.js +14 -3
- package/components/Meter/Bar.js +39 -19
- package/components/Meter/Circle.js +32 -48
- package/components/Meter/Meter.js +1 -2
- package/components/Meter/StyledMeter.js +1 -2
- package/components/Meter/stories/Circle.stories.js +7 -10
- package/components/Meter/stories/VerticalBarMultiple.stories.js +1 -2
- package/components/Meter/utils.js +15 -1
- package/components/NameValueList/NameValueList.js +1 -2
- package/components/NameValuePair/NameValuePair.js +1 -2
- package/components/Nav/Nav.js +5 -1
- package/components/Nav/stories/CustomThemed/JustifySidebar.stories.js +1 -2
- package/components/Nav/stories/Sidebar.stories.js +1 -2
- package/components/Notification/Notification.js +26 -13
- package/components/Notification/index.d.ts +3 -0
- package/components/Notification/propTypes.js +3 -0
- package/components/Notification/stories/Global.stories.js +1 -2
- package/components/Notification/stories/Title.stories.js +1 -2
- package/components/Notification/stories/TitleAndMessage.stories.js +1 -2
- package/components/Page/Page.js +1 -2
- package/components/Page/stories/PageNotificaton.stories.js +1 -2
- package/components/PageContent/PageContent.js +1 -2
- package/components/PageHeader/PageHeader.js +1 -2
- package/components/PageHeader/stories/MultipleActions.stories.js +1 -2
- package/components/Pagination/Pagination.js +6 -12
- package/components/Pagination/PaginationStep.js +3 -3
- package/components/Pagination/PaginationSummary.js +1 -2
- package/components/Pagination/stories/Grid.stories.js +1 -2
- package/components/Paragraph/Paragraph.js +1 -2
- package/components/Paragraph/ParagraphSkeleton.js +3 -3
- package/components/Paragraph/StyledParagraph.js +1 -2
- package/components/RadioButton/RadioButton.js +2 -3
- package/components/RadioButton/StyledRadioButton.js +3 -4
- package/components/RadioButtonGroup/RadioButtonGroup.js +18 -8
- package/components/RadioButtonGroup/stories/Children.stories.js +1 -2
- package/components/RadioButtonGroup/stories/CustomThemed/CustomTheme.stories.js +1 -2
- package/components/RadioButtonGroup/stories/Disabled.stories.js +1 -2
- package/components/RangeInput/RangeInput.js +2 -3
- package/components/RangeInput/StyledRangeInput.js +1 -2
- package/components/RangeInput/stories/CustomThemed/Bounds.stories.js +1 -2
- package/components/RangeSelector/EdgeControl.js +56 -13
- package/components/RangeSelector/RangeSelector.js +14 -31
- package/components/RangeSelector/stories/Basic.stories.js +1 -2
- package/components/RangeSelector/stories/CustomThemed/Custom.stories.js +1 -2
- package/components/RangeSelector/stories/CustomThemed/CustomEdgeControl.stories.js +1 -2
- package/components/RangeSelector/stories/Label.stories.js +1 -2
- package/components/RangeSelector/stories/Simple.stories.js +1 -2
- package/components/RangeSelector/stories/Step.stories.js +1 -2
- package/components/RangeSelector/stories/Thin.stories.js +1 -2
- package/components/RangeSelector/stories/Vertical.stories.js +1 -2
- package/components/RoutedAnchor/RoutedAnchor.js +1 -2
- package/components/RoutedButton/RoutedButton.js +1 -2
- package/components/Select/DefaultSelectTextInput.js +1 -2
- package/components/Select/Select.js +17 -4
- package/components/Select/SelectContainer.js +35 -11
- package/components/Select/stories/ChildrenRender.stories.js +1 -2
- package/components/Select/stories/Clear.stories.js +1 -2
- package/components/Select/stories/Controlled.stories.js +1 -2
- package/components/Select/stories/CustomThemed/CustomSearch.stories.js +1 -2
- package/components/Select/stories/Disabled.stories.js +1 -2
- package/components/Select/stories/InsideFormField.stories.js +1 -2
- package/components/Select/stories/Multiple.stories.js +1 -2
- package/components/Select/stories/ObjectOptions.stories.js +1 -2
- package/components/Select/stories/Search.stories.js +1 -2
- package/components/Select/stories/Simple.stories.js +1 -2
- package/components/Select/stories/ValueLabel.stories.js +1 -2
- package/components/Select/stories/components/SearchBorderBox.js +1 -2
- package/components/Select/stories/components/SearchInput.js +1 -2
- package/components/Select/utils.js +13 -4
- package/components/SelectMultiple/SelectMultiple.js +32 -19
- package/components/SelectMultiple/SelectMultipleContainer.js +34 -21
- package/components/SelectMultiple/SelectMultipleValue.js +6 -9
- package/components/SelectMultiple/SelectionSummary.js +8 -10
- package/components/SelectMultiple/stories/CustomMessages.stories.js +1 -2
- package/components/SelectMultiple/stories/Default.stories.js +1 -2
- package/components/SelectMultiple/stories/Disabled.stories.js +1 -2
- package/components/SelectMultiple/stories/FormField.stories.js +1 -2
- package/components/SelectMultiple/stories/Help.stories.js +1 -2
- package/components/SelectMultiple/stories/Limited.stories.js +1 -2
- package/components/SelectMultiple/stories/ObjectOptions.stories.js +1 -2
- package/components/SelectMultiple/stories/ShowSelectedInline.stories.js +1 -2
- package/components/Sidebar/Sidebar.js +6 -3
- package/components/Skeleton/Skeleton.js +6 -3
- package/components/Skeleton/SkeletonContext.js +1 -2
- package/components/Skeleton/stories/CustomThemed/Custom.stories.js +1 -4
- package/components/Skeleton/stories/GridContainer.stories.js +1 -2
- package/components/Skeleton/stories/Simple.stories.js +0 -1
- package/components/SkipLink/SkipLink.js +1 -2
- package/components/SkipLinks/SkipLinks.js +1 -2
- package/components/Spinner/Spinner.js +8 -6
- package/components/Spinner/stories/Animation.stories.js +1 -2
- package/components/Spinner/stories/Announced.stories.js +1 -2
- package/components/Stack/Stack.js +1 -2
- package/components/Stack/StyledStack.js +1 -2
- package/components/StarRating/StarRating.js +9 -7
- package/components/Tab/StyledTab.js +1 -2
- package/components/Tab/Tab.js +3 -3
- package/components/Table/StyledTable.js +3 -4
- package/components/Table/Table.js +1 -2
- package/components/Table/stories/InfiniteScrollInTable.stories.js +1 -2
- package/components/TableBody/TableBody.js +1 -2
- package/components/TableCell/TableCell.js +21 -5
- package/components/TableFooter/TableFooter.js +1 -2
- package/components/TableHeader/TableHeader.js +1 -2
- package/components/TableRow/TableRow.js +1 -2
- package/components/Tabs/StyledTabs.js +1 -2
- package/components/Tabs/Tabs.js +9 -14
- package/components/Tabs/stories/CustomThemed/States.stories.js +1 -2
- package/components/Tabs/stories/Responsive.stories.js +1 -2
- package/components/Tag/StyledTag.js +9 -1
- package/components/Tag/Tag.js +1 -2
- package/components/Text/StyledText.js +1 -2
- package/components/Text/Text.js +1 -2
- package/components/Text/TextSkeleton.js +1 -2
- package/components/TextArea/StyledTextArea.js +1 -2
- package/components/TextArea/TextArea.js +1 -2
- package/components/TextArea/stories/CustomThemed/Themed.stories.js +1 -2
- package/components/TextArea/stories/InsideFormField.stories.js +1 -2
- package/components/TextArea/stories/NonResizable.stories.js +1 -2
- package/components/TextArea/stories/Simple.stories.js +1 -2
- package/components/TextInput/CopyButton.js +6 -3
- package/components/TextInput/StyledTextInput.js +1 -2
- package/components/TextInput/TextInput.js +10 -3
- package/components/TextInput/stories/InsideFormField.stories.js +1 -2
- package/components/ThumbsRating/ThumbsRating.js +15 -10
- package/components/Tip/Tip.js +1 -2
- package/components/Tip/stories/HeaderActions.stories.js +1 -2
- package/components/ToggleGroup/ToggleGroup.js +1 -2
- package/components/ToggleGroup/stories/Controlled.stories.js +1 -2
- package/components/Toolbar/Toolbar.js +16 -13
- package/components/Video/StyledVideo.js +1 -2
- package/components/Video/Video.js +16 -19
- package/components/WorldMap/WorldMap.js +1 -2
- package/contexts/AnalyticsContext/AnalyticsContext.js +1 -2
- package/contexts/AnnounceContext/AnnounceContext.js +28 -5
- package/contexts/AnnounceContext/stories/Polite.stories.js +1 -2
- package/contexts/RootsContext.js +1 -2
- package/contexts/ThemeContext/stories/ThemeContextExtend.stories.js +1 -2
- package/es6/components/AccordionPanel/AccordionPanel.js +3 -6
- package/es6/components/Anchor/Anchor.js +4 -4
- package/es6/components/Anchor/StyledAnchor.js +2 -2
- package/es6/components/Box/Box.js +5 -1
- package/es6/components/Box/StyledBox.js +5 -3
- package/es6/components/Button/BusyAnimation.js +5 -1
- package/es6/components/Button/Button.js +3 -1
- package/es6/components/Button/StyledButton.js +3 -1
- package/es6/components/Button/StyledButtonKind.js +3 -1
- package/es6/components/Button/index.d.ts +1 -1
- package/es6/components/Button/propTypes.js +1 -1
- package/es6/components/Calendar/Calendar.js +158 -138
- package/es6/components/Calendar/StyledCalendar.js +34 -36
- package/es6/components/Calendar/stories/Dual.stories.js +0 -2
- package/es6/components/Calendar/stories/ShowAdjacentDays.stories.js +1 -1
- package/es6/components/Cards/Cards.js +3 -4
- package/es6/components/Chart/Chart.js +14 -12
- package/es6/components/Chart/calcs.js +21 -13
- package/es6/components/CheckBox/CheckBox.js +1 -1
- package/es6/components/CheckBoxGroup/CheckBoxGroup.js +14 -3
- package/es6/components/Data/Data.js +5 -1
- package/es6/components/Data/DataForm.js +6 -4
- package/es6/components/Data/index.d.ts +3 -0
- package/es6/components/Data/propTypes.js +4 -1
- package/es6/components/Data/stories/Infinite.stories.js +10 -15
- package/es6/components/Data/stories/OnSelect.stories.js +10 -15
- package/es6/components/Data/stories/SpaceX.stories.js +10 -15
- package/es6/components/Data/stories/StarWars.stories.js +16 -43
- package/es6/components/DataChart/DataChart.js +17 -15
- package/es6/components/DataChart/Detail.js +2 -2
- package/es6/components/DataChart/Legend.js +8 -9
- package/es6/components/DataChart/utils.js +15 -8
- package/es6/components/DataFilter/DataFilter.js +14 -10
- package/es6/components/DataFilters/DataFilters.js +9 -10
- package/es6/components/DataSearch/DataSearch.js +5 -4
- package/es6/components/DataSort/DataSort.js +6 -4
- package/es6/components/DataSummary/DataSummary.js +6 -6
- package/es6/components/DataTable/Body.js +106 -33
- package/es6/components/DataTable/DataTable.js +48 -14
- package/es6/components/DataTable/ExpanderCell.js +54 -6
- package/es6/components/DataTable/Footer.js +4 -1
- package/es6/components/DataTable/GroupedBody.js +11 -3
- package/es6/components/DataTable/Header.js +86 -32
- package/es6/components/DataTable/Resizer.js +168 -46
- package/es6/components/DataTable/Searcher.js +40 -12
- package/es6/components/DataTable/StyledDataTable.js +1 -1
- package/es6/components/DataTable/index.d.ts +19 -0
- package/es6/components/DataTable/propTypes.js +19 -0
- package/es6/components/DataTable/stories/ControlledGrouped.stories.js +4 -0
- package/es6/components/DataTable/stories/Grouped.stories.js +7 -1
- package/es6/components/DataTable/stories/GroupedOnSelect.stories.js +7 -1
- package/es6/components/DataTable/stories/OnUpdate.stories.js +3 -0
- package/es6/components/DataTable/stories/SpaceX.stories.js +22 -16
- package/es6/components/DataTable/stories/SpaceXUngrouped.stories.js +7 -7
- package/es6/components/DataTable/stories/Styled.stories.js +5 -1
- package/es6/components/DataTable/stories/rowDetails.stories.js +22 -47
- package/es6/components/DataTableColumns/DataTableColumns.js +37 -21
- package/es6/components/DateInput/DateInput.js +19 -17
- package/es6/components/Distribution/Distribution.js +8 -5
- package/es6/components/FileInput/FileInput.js +78 -40
- package/es6/components/FileInput/index.d.ts +10 -1
- package/es6/components/FileInput/propTypes.js +11 -0
- package/es6/components/Footer/Footer.js +5 -1
- package/es6/components/Form/Form.js +10 -10
- package/es6/components/Form/stories/Controlled.stories.js +1 -0
- package/es6/components/Form/stories/ControlledInput.stories.js +1 -0
- package/es6/components/Form/stories/ControlledInputLazy.stories.js +1 -0
- package/es6/components/Form/stories/ControlledLazy.stories.js +1 -0
- package/es6/components/Form/stories/CustomThemed/Custom.stories.js +1 -0
- package/es6/components/Form/stories/FieldWithChildren.stories.js +2 -0
- package/es6/components/Form/stories/Uncontrolled.stories.js +1 -0
- package/es6/components/Form/stories/ValidateOnBlur.stories.js +1 -1
- package/es6/components/Form/stories/typescript/TypedForm.stories.tsx +7 -1
- package/es6/components/FormField/FormField.js +22 -1
- package/es6/components/Grommet/index.d.ts +30 -0
- package/es6/components/Grommet/propTypes.js +31 -1
- package/es6/components/Header/Header.js +2 -2
- package/es6/components/Layer/Layer.js +47 -17
- package/es6/components/Layer/LayerContainer.js +20 -16
- package/es6/components/Layer/StyledLayer.js +3 -3
- package/es6/components/Layer/stories/Form.stories.js +1 -1
- package/es6/components/List/List.js +141 -150
- package/es6/components/List/index.d.ts +3 -0
- package/es6/components/List/propTypes.js +3 -0
- package/es6/components/MaskedInput/MaskedInput.js +6 -1
- package/es6/components/Menu/Menu.js +13 -1
- package/es6/components/Meter/Bar.js +39 -18
- package/es6/components/Meter/Circle.js +33 -48
- package/es6/components/Meter/stories/Circle.stories.js +7 -9
- package/es6/components/Meter/utils.js +14 -0
- package/es6/components/Nav/Nav.js +5 -1
- package/es6/components/Notification/Notification.js +27 -12
- package/es6/components/Notification/index.d.ts +3 -0
- package/es6/components/Notification/propTypes.js +3 -0
- package/es6/components/Pagination/Pagination.js +5 -10
- package/es6/components/Pagination/PaginationStep.js +2 -1
- package/es6/components/Paragraph/ParagraphSkeleton.js +2 -1
- package/es6/components/RadioButton/RadioButton.js +1 -1
- package/es6/components/RadioButton/StyledRadioButton.js +2 -2
- package/es6/components/RadioButtonGroup/RadioButtonGroup.js +17 -6
- package/es6/components/RangeInput/RangeInput.js +1 -1
- package/es6/components/RangeSelector/EdgeControl.js +57 -12
- package/es6/components/RangeSelector/RangeSelector.js +13 -29
- package/es6/components/Select/Select.js +17 -3
- package/es6/components/Select/SelectContainer.js +34 -9
- package/es6/components/Select/utils.js +11 -1
- package/es6/components/SelectMultiple/SelectMultiple.js +32 -18
- package/es6/components/SelectMultiple/SelectMultipleContainer.js +33 -19
- package/es6/components/SelectMultiple/SelectMultipleValue.js +5 -7
- package/es6/components/SelectMultiple/SelectionSummary.js +7 -8
- package/es6/components/Sidebar/Sidebar.js +6 -3
- package/es6/components/Skeleton/Skeleton.js +5 -1
- package/es6/components/Skeleton/stories/CustomThemed/Custom.stories.js +0 -2
- package/es6/components/Skeleton/stories/Simple.stories.js +0 -1
- package/es6/components/Spinner/Spinner.js +6 -3
- package/es6/components/StarRating/StarRating.js +8 -5
- package/es6/components/Tab/Tab.js +2 -1
- package/es6/components/Table/StyledTable.js +2 -2
- package/es6/components/TableCell/TableCell.js +20 -3
- package/es6/components/Tabs/Tabs.js +8 -12
- package/es6/components/Tag/StyledTag.js +10 -2
- package/es6/components/TextInput/CopyButton.js +6 -3
- package/es6/components/TextInput/TextInput.js +9 -1
- package/es6/components/ThumbsRating/ThumbsRating.js +15 -10
- package/es6/components/Toolbar/Toolbar.js +15 -11
- package/es6/components/Video/Video.js +15 -17
- package/es6/contexts/AnnounceContext/AnnounceContext.js +28 -5
- package/es6/languages/default.json +33 -3
- package/es6/themes/base.d.ts +301 -4
- package/es6/themes/base.js +387 -28
- package/es6/utils/graphics.js +123 -0
- package/es6/utils/styles.js +53 -45
- package/grommet.min.js +1 -1
- package/grommet.min.js.map +1 -1
- package/languages/default.json +33 -3
- package/package.json +55 -55
- package/themes/base.d.ts +301 -4
- package/themes/base.js +387 -28
- package/utils/graphics.js +124 -1
- package/utils/styles.js +53 -45
- package/utils/useId.js +1 -2
|
@@ -5,9 +5,10 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
|
|
|
5
5
|
import React, { forwardRef } from 'react';
|
|
6
6
|
import { parseMetricToNum } from '../../utils';
|
|
7
7
|
import { StyledMeter } from './StyledMeter';
|
|
8
|
-
import { strokeProps, defaultColor } from './utils';
|
|
8
|
+
import { strokeProps, defaultColor, fillProps } from './utils';
|
|
9
9
|
import { useThemeValue } from '../../utils/useThemeValue';
|
|
10
10
|
var Bar = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
11
|
+
var _theme$meter$gap, _theme$meter;
|
|
11
12
|
var _props$background = props.background,
|
|
12
13
|
background = _props$background === void 0 ? 'light-1' : _props$background,
|
|
13
14
|
max = props.max,
|
|
@@ -23,13 +24,20 @@ var Bar = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
23
24
|
passThemeFlag = _useThemeValue.passThemeFlag;
|
|
24
25
|
var length = size === 'full' ? 288 : parseMetricToNum(theme.global.size[size] || size);
|
|
25
26
|
var thickness = parseMetricToNum(theme.global.edgeSize[thicknessProp] || thicknessProp);
|
|
27
|
+
var gapTheme = (_theme$meter$gap = (_theme$meter = theme.meter) == null ? void 0 : _theme$meter.gap) != null ? _theme$meter$gap : 0;
|
|
28
|
+
var gap = parseMetricToNum(theme.global.edgeSize[gapTheme] || gapTheme);
|
|
29
|
+
|
|
26
30
|
// account for the round cap, if any
|
|
27
|
-
var
|
|
31
|
+
var capRadius = round ? thickness / 2 : 0;
|
|
28
32
|
var mid = thickness / 2;
|
|
29
33
|
var someHighlight = (values || []).some(function (v) {
|
|
30
34
|
return v.highlight;
|
|
31
35
|
});
|
|
32
|
-
var start = direction === 'horizontal' ?
|
|
36
|
+
var start = direction === 'horizontal' ? capRadius : length - capRadius;
|
|
37
|
+
|
|
38
|
+
// Available space for the bar is the length of the meter minus an end cap
|
|
39
|
+
// on each end, minus the gap between bars.
|
|
40
|
+
var lengthAvailable = length - 2 * capRadius - gap * (values.length - 1);
|
|
33
41
|
var paths = (values || []).reduce(function (acc, valueArg, index) {
|
|
34
42
|
if (valueArg.value > 0) {
|
|
35
43
|
var color = valueArg.color,
|
|
@@ -39,8 +47,22 @@ var Bar = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
39
47
|
value = valueArg.value,
|
|
40
48
|
pathRest = _objectWithoutPropertiesLoose(valueArg, _excluded2);
|
|
41
49
|
var key = "p-" + index;
|
|
42
|
-
var delta = value *
|
|
43
|
-
|
|
50
|
+
var delta = value * lengthAvailable / max;
|
|
51
|
+
|
|
52
|
+
// add a little bit extra to start to allow for larger rounded inset cap
|
|
53
|
+
// The extra needed can be calculated by the Pythagorean theorem
|
|
54
|
+
var extraGap = round && index !== 0 ? Math.sqrt(Math.pow(thickness / 2 + gap / 4, 2) - Math.pow(thickness / 2, 2)) : 0;
|
|
55
|
+
var initialStart = direction === 'horizontal' ? start + extraGap : start - extraGap;
|
|
56
|
+
|
|
57
|
+
// define the x,y points for the corners of the bar.
|
|
58
|
+
var points = direction === 'horizontal' ? [initialStart + "," + thickness, initialStart + ",0", start + delta + ",0", start + delta + "," + thickness] : [thickness + "," + initialStart, "0," + initialStart, "0," + (start - delta), thickness + "," + (start - delta)];
|
|
59
|
+
|
|
60
|
+
// if rounded, the starting cap is an arc. All but the first bar
|
|
61
|
+
// will have a gap and a slightly larger radius
|
|
62
|
+
var startRadius = index === 0 ? capRadius : capRadius + gap / 2;
|
|
63
|
+
var startCap = round ? "A " + startRadius + "," + startRadius + " 0 0 " + (index === 0 ? 1 : 0) + " " + points[1] : "L " + points[1];
|
|
64
|
+
var endCap = round ? "A " + capRadius + "," + capRadius + " 0 0 1 " + points[3] : "L " + points[3];
|
|
65
|
+
var d = "M " + points[0] + " " + startCap + " L " + points[2] + " " + endCap + " Z";
|
|
44
66
|
var colorName = color || defaultColor(index, theme, values ? values.length : 0);
|
|
45
67
|
var hoverProps;
|
|
46
68
|
if (onHover) {
|
|
@@ -53,23 +75,22 @@ var Bar = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
53
75
|
}
|
|
54
76
|
};
|
|
55
77
|
}
|
|
78
|
+
var fill = fillProps(someHighlight && !highlight ? background : colorName, theme);
|
|
79
|
+
acc.push(/*#__PURE__*/React.createElement("path", _extends({
|
|
80
|
+
key: key,
|
|
81
|
+
d: d
|
|
82
|
+
}, fill, {
|
|
83
|
+
strokeWidth: 0,
|
|
84
|
+
stroke: "none"
|
|
85
|
+
}, hoverProps, pathRest)));
|
|
56
86
|
if (direction === 'horizontal') {
|
|
57
|
-
start += delta;
|
|
87
|
+
start += delta + gap;
|
|
58
88
|
} else {
|
|
59
|
-
start -= delta;
|
|
89
|
+
start -= delta + gap;
|
|
60
90
|
}
|
|
61
|
-
var result = /*#__PURE__*/React.createElement("path", _extends({
|
|
62
|
-
key: key,
|
|
63
|
-
d: d,
|
|
64
|
-
fill: "none"
|
|
65
|
-
}, strokeProps(someHighlight && !highlight ? background : colorName, theme), {
|
|
66
|
-
strokeWidth: direction === 'horizontal' ? thickness : length,
|
|
67
|
-
strokeLinecap: round ? 'round' : 'butt'
|
|
68
|
-
}, hoverProps, pathRest));
|
|
69
|
-
acc.push(result);
|
|
70
91
|
}
|
|
71
92
|
return acc;
|
|
72
|
-
}, []).reverse(); // reverse so the caps
|
|
93
|
+
}, []).reverse(); // reverse so the caps look right
|
|
73
94
|
|
|
74
95
|
var width;
|
|
75
96
|
if (direction === 'horizontal') {
|
|
@@ -77,7 +98,7 @@ var Bar = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
77
98
|
} else {
|
|
78
99
|
width = size === 'full' ? '100%' : thickness;
|
|
79
100
|
}
|
|
80
|
-
var backgroundPath = direction === 'horizontal' ? "M " +
|
|
101
|
+
var backgroundPath = direction === 'horizontal' ? "M " + capRadius + "," + mid + " L " + (length - capRadius) + "," + mid : "M " + mid + "," + capRadius + " L " + mid + "," + (length - capRadius);
|
|
81
102
|
return /*#__PURE__*/React.createElement(StyledMeter, _extends({
|
|
82
103
|
ref: ref,
|
|
83
104
|
viewBox: direction === 'horizontal' ? "0 0 " + length + " " + thickness : "0 0 " + thickness + " " + length,
|
|
@@ -3,11 +3,12 @@ var _excluded = ["background", "max", "round", "size", "thickness", "type", "val
|
|
|
3
3
|
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); }
|
|
4
4
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
5
5
|
import React, { forwardRef } from 'react';
|
|
6
|
-
import { arcCommands, parseMetricToNum, translateEndAngle } from '../../utils';
|
|
6
|
+
import { arcCommands, wedgeCommands, parseMetricToNum, translateEndAngle } from '../../utils';
|
|
7
7
|
import { StyledMeter } from './StyledMeter';
|
|
8
|
-
import { strokeProps, defaultColor } from './utils';
|
|
8
|
+
import { strokeProps, defaultColor, fillProps } from './utils';
|
|
9
9
|
import { useThemeValue } from '../../utils/useThemeValue';
|
|
10
10
|
var Circle = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
11
|
+
var _theme$meter$gap, _theme$meter;
|
|
11
12
|
var background = props.background,
|
|
12
13
|
max = props.max,
|
|
13
14
|
round = props.round,
|
|
@@ -20,7 +21,7 @@ var Circle = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
20
21
|
theme = _useThemeValue.theme,
|
|
21
22
|
passThemeFlag = _useThemeValue.passThemeFlag;
|
|
22
23
|
var width = size === 'full' ? 288 : parseMetricToNum(theme.global.size[size] || size);
|
|
23
|
-
var strokeWidth = type === 'pie' ? width / 2 : parseMetricToNum(theme.global.edgeSize[thickness] || thickness);
|
|
24
|
+
var strokeWidth = type === 'pie' ? width / 2 : Math.min(width / 2 - 8, parseMetricToNum(theme.global.edgeSize[thickness] || thickness));
|
|
24
25
|
var centerX = width / 2;
|
|
25
26
|
var centerY = width / 2;
|
|
26
27
|
var radius = width / 2 - strokeWidth / 2;
|
|
@@ -30,17 +31,22 @@ var Circle = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
30
31
|
var scalePower = Math.max(5, Math.ceil(Math.log10(max)) + 3);
|
|
31
32
|
var scale = Math.pow(10, scalePower);
|
|
32
33
|
var anglePer = Math.floor((type === 'semicircle' ? 180 : 360) / max * scale) / scale;
|
|
33
|
-
// (type === 'semicircle' ? 180 : 360) / max;
|
|
34
34
|
var someHighlight = (values || []).some(function (v) {
|
|
35
35
|
return v.highlight;
|
|
36
36
|
});
|
|
37
|
+
var gapTheme = (_theme$meter$gap = (_theme$meter = theme.meter) == null ? void 0 : _theme$meter.gap) != null ? _theme$meter$gap : '0';
|
|
38
|
+
var gap = parseMetricToNum(theme.global.edgeSize[gapTheme] || gapTheme);
|
|
39
|
+
var isSemi = type === 'semicircle';
|
|
40
|
+
var isFull = values.reduce(function (total, currentValue) {
|
|
41
|
+
return total + currentValue.value;
|
|
42
|
+
}, 0) >= max;
|
|
37
43
|
var startValue = 0;
|
|
38
|
-
var startAngle =
|
|
44
|
+
var startAngle = isSemi ? 270 : 0;
|
|
39
45
|
var paths = [];
|
|
40
|
-
var pathCaps = [];
|
|
41
46
|
(values || []).filter(function (v) {
|
|
42
47
|
return v.value > 0;
|
|
43
|
-
}).forEach(function (valueArg, index) {
|
|
48
|
+
}).forEach(function (valueArg, index, _ref) {
|
|
49
|
+
var length = _ref.length;
|
|
44
50
|
var color = valueArg.color,
|
|
45
51
|
highlight = valueArg.highlight,
|
|
46
52
|
label = valueArg.label,
|
|
@@ -51,7 +57,7 @@ var Circle = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
51
57
|
var colorName = color || defaultColor(index, theme, values ? values.length : 0);
|
|
52
58
|
var endAngle;
|
|
53
59
|
if (startValue + value >= max) {
|
|
54
|
-
endAngle =
|
|
60
|
+
endAngle = isSemi ? 90 : 360;
|
|
55
61
|
} else {
|
|
56
62
|
endAngle = translateEndAngle(startAngle, anglePer, value);
|
|
57
63
|
}
|
|
@@ -67,46 +73,25 @@ var Circle = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
67
73
|
};
|
|
68
74
|
}
|
|
69
75
|
var stroke = strokeProps(someHighlight && !highlight ? background : colorName, theme);
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
key: key,
|
|
74
|
-
d: d1,
|
|
75
|
-
fill: "none"
|
|
76
|
-
}, stroke, {
|
|
77
|
-
strokeWidth: strokeWidth,
|
|
78
|
-
strokeLinecap: "round"
|
|
79
|
-
}, hoverProps, pathRest)));
|
|
76
|
+
var fill = fillProps(someHighlight && !highlight ? background : colorName, theme);
|
|
77
|
+
var outerRadius = width / 2;
|
|
78
|
+
var innerRadius = type === 'pie' ? 0 : width / 2 - strokeWidth;
|
|
80
79
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
pathCaps = [];
|
|
97
|
-
}
|
|
98
|
-
pathCaps.unshift(pathCap);
|
|
99
|
-
} else {
|
|
100
|
-
var d = arcCommands(centerX, centerY, radius, startAngle, endAngle);
|
|
101
|
-
paths.push(/*#__PURE__*/React.createElement("path", _extends({
|
|
102
|
-
key: key,
|
|
103
|
-
d: d,
|
|
104
|
-
fill: "none"
|
|
105
|
-
}, stroke, {
|
|
106
|
-
strokeWidth: strokeWidth,
|
|
107
|
-
strokeLinecap: "butt"
|
|
108
|
-
}, hoverProps, pathRest)));
|
|
109
|
-
}
|
|
80
|
+
// We want a start gap if there's another segment before this one.
|
|
81
|
+
// A circle's last segment can bump against the first segment if at max.
|
|
82
|
+
var startGap = index === 0 && (isSemi || length === 1 || length > 1 && !isFull) ? 0 : gap / 2;
|
|
83
|
+
|
|
84
|
+
// Similarly, we only need an end gap if there's a segment after this one.
|
|
85
|
+
var endGap = index === length - 1 && (isSemi || length === 1) ? 0 : -gap / 2;
|
|
86
|
+
var startRound = index === 0 && isSemi ? false : round;
|
|
87
|
+
var d = wedgeCommands(centerX, centerY, outerRadius, innerRadius, startAngle, endAngle, startGap, endGap, startRound, round, index === 0 ? 1 : 0);
|
|
88
|
+
paths.push(/*#__PURE__*/React.createElement("path", _extends({
|
|
89
|
+
key: key,
|
|
90
|
+
d: d
|
|
91
|
+
}, fill, stroke, {
|
|
92
|
+
strokeWidth: 0,
|
|
93
|
+
strokeLinecap: "butt"
|
|
94
|
+
}, hoverProps, pathRest)));
|
|
110
95
|
startValue += value;
|
|
111
96
|
startAngle = endAngle;
|
|
112
97
|
});
|
|
@@ -137,7 +122,7 @@ var Circle = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
137
122
|
viewBox: "0 0 " + width + " " + viewBoxHeight,
|
|
138
123
|
width: size === 'full' ? '100%' : width,
|
|
139
124
|
height: size === 'full' ? '100%' : viewBoxHeight
|
|
140
|
-
}, passThemeFlag, rest), track, paths
|
|
125
|
+
}, passThemeFlag, rest), track, paths);
|
|
141
126
|
});
|
|
142
127
|
Circle.displayName = 'Circle';
|
|
143
128
|
export { Circle };
|
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
import React, { useState, useEffect
|
|
1
|
+
import React, { useState, useEffect } from 'react';
|
|
2
2
|
import { Box, Meter } from 'grommet';
|
|
3
3
|
export var Circle = function Circle() {
|
|
4
4
|
var _useState = useState(20),
|
|
5
5
|
value = _useState[0],
|
|
6
6
|
setValue = _useState[1];
|
|
7
|
-
var timer = useRef();
|
|
8
|
-
clearTimeout(timer.current);
|
|
9
|
-
timer.current = setTimeout(function () {
|
|
10
|
-
setValue(value < 100 ? value + 8 : 20);
|
|
11
|
-
}, 2000);
|
|
12
7
|
useEffect(function () {
|
|
8
|
+
var interval = setInterval(function () {
|
|
9
|
+
setValue(value < 60 ? value + 8 : 20);
|
|
10
|
+
}, 2000);
|
|
13
11
|
return function () {
|
|
14
|
-
|
|
12
|
+
return clearInterval(interval);
|
|
15
13
|
};
|
|
16
|
-
}, []);
|
|
14
|
+
}, [value]);
|
|
17
15
|
return (
|
|
18
16
|
/*#__PURE__*/
|
|
19
17
|
// Uncomment <Grommet> lines when using outside of storybook
|
|
@@ -26,7 +24,7 @@ export var Circle = function Circle() {
|
|
|
26
24
|
background: "light-2",
|
|
27
25
|
values: [{
|
|
28
26
|
value: value,
|
|
29
|
-
color: value > 50 ? '
|
|
27
|
+
color: value > 50 ? 'status-critical' : 'status-ok'
|
|
30
28
|
}]
|
|
31
29
|
}))
|
|
32
30
|
// </Grommet>
|
|
@@ -13,6 +13,20 @@ export var strokeProps = function strokeProps(color, theme) {
|
|
|
13
13
|
}
|
|
14
14
|
return result;
|
|
15
15
|
};
|
|
16
|
+
export var fillProps = function fillProps(color, theme) {
|
|
17
|
+
var result = {};
|
|
18
|
+
if (color) {
|
|
19
|
+
if (typeof color === 'object') {
|
|
20
|
+
result.fill = normalizeColor(color.color, theme);
|
|
21
|
+
if (color.opacity) {
|
|
22
|
+
result.fillOpacity = "" + (color.opacity === true ? theme.global.opacity.medium : theme.global.opacity[color.opacity] || color.opacity);
|
|
23
|
+
}
|
|
24
|
+
} else {
|
|
25
|
+
result.fill = normalizeColor(color, theme);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return result;
|
|
29
|
+
};
|
|
16
30
|
var neutralExp = /^neutral-\d+/;
|
|
17
31
|
export var defaultColor = function defaultColor(index, theme, valuesLength) {
|
|
18
32
|
if (index === valuesLength - 1 && theme.meter.color) {
|
|
@@ -2,12 +2,16 @@ function _objectDestructuringEmpty(t) { if (null == t) throw new TypeError("Cann
|
|
|
2
2
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { Box } from '../Box';
|
|
5
|
+
import { useThemeValue } from '../../utils/useThemeValue';
|
|
5
6
|
var Nav = function Nav(_ref) {
|
|
7
|
+
var _theme$nav;
|
|
6
8
|
var rest = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
|
|
9
|
+
var _useThemeValue = useThemeValue(),
|
|
10
|
+
theme = _useThemeValue.theme;
|
|
7
11
|
return /*#__PURE__*/React.createElement(Box, _extends({
|
|
8
12
|
as: "nav",
|
|
9
13
|
flex: false,
|
|
10
|
-
gap:
|
|
14
|
+
gap: (_theme$nav = theme.nav) == null ? void 0 : _theme$nav.gap
|
|
11
15
|
}, rest));
|
|
12
16
|
};
|
|
13
17
|
export { Nav };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var _excluded = ["fill", "direction"],
|
|
2
|
-
_excluded2 = ["actions", "message", "onClose", "id", "global", "status", "title", "toast", "icon", "time"];
|
|
2
|
+
_excluded2 = ["actions", "message", "messages", "onClose", "id", "global", "status", "title", "toast", "icon", "time"];
|
|
3
3
|
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); }
|
|
4
4
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
5
|
-
import React, { useCallback, useEffect, useState, useMemo, Fragment } from 'react';
|
|
5
|
+
import React, { useCallback, useEffect, useState, useMemo, Fragment, useContext } from 'react';
|
|
6
6
|
import styled from 'styled-components';
|
|
7
7
|
import { Anchor } from '../Anchor';
|
|
8
8
|
import { Box } from '../Box';
|
|
@@ -10,6 +10,9 @@ import { Button } from '../Button';
|
|
|
10
10
|
import { Layer } from '../Layer';
|
|
11
11
|
import { Paragraph } from '../Paragraph';
|
|
12
12
|
import { Text } from '../Text';
|
|
13
|
+
// eslint-disable-next-line max-len
|
|
14
|
+
import { AnnounceContext } from '../../contexts/AnnounceContext/AnnounceContext';
|
|
15
|
+
import { MessageContext } from '../../contexts/MessageContext';
|
|
13
16
|
import { NotificationType } from './propTypes';
|
|
14
17
|
import { useThemeValue } from '../../utils/useThemeValue';
|
|
15
18
|
var Message = function Message(_ref) {
|
|
@@ -65,9 +68,10 @@ var NotificationAnchor = styled(Anchor).withConfig({
|
|
|
65
68
|
componentId: "sc-1yq09yz-0"
|
|
66
69
|
})(["white-space:nowrap;"]);
|
|
67
70
|
var Notification = function Notification(_ref2) {
|
|
68
|
-
var _theme$notification6, _theme$notification7, _theme$notification8, _theme$notification9, _theme$
|
|
71
|
+
var _theme$notification6, _theme$notification7, _theme$notification8, _theme$notification9, _theme$notification0, _theme$notification1;
|
|
69
72
|
var actionsProp = _ref2.actions,
|
|
70
73
|
messageProp = _ref2.message,
|
|
74
|
+
messages = _ref2.messages,
|
|
71
75
|
onClose = _ref2.onClose,
|
|
72
76
|
id = _ref2.id,
|
|
73
77
|
global = _ref2.global,
|
|
@@ -85,9 +89,18 @@ var Notification = function Notification(_ref2) {
|
|
|
85
89
|
var _useState = useState(true),
|
|
86
90
|
visible = _useState[0],
|
|
87
91
|
setVisible = _useState[1];
|
|
92
|
+
var _useContext = useContext(MessageContext),
|
|
93
|
+
format = _useContext.format;
|
|
88
94
|
var position = useMemo(function () {
|
|
89
95
|
return toast && (toast == null ? void 0 : toast.position) || 'top';
|
|
90
96
|
}, [toast]);
|
|
97
|
+
var announce = useContext(AnnounceContext);
|
|
98
|
+
useEffect(function () {
|
|
99
|
+
if (visible && toast) {
|
|
100
|
+
var announceText = typeof messageProp === 'string' ? title + ". " + messageProp : title;
|
|
101
|
+
announce(announceText, 'polite', time || theme.notification.toast.time || theme.notification.time);
|
|
102
|
+
}
|
|
103
|
+
}, [announce, visible, toast, messageProp, title, theme.notification.toast.time, theme.notification.time, time]);
|
|
91
104
|
var close = useCallback(function (event) {
|
|
92
105
|
setVisible(false);
|
|
93
106
|
if (onClose) onClose(event);
|
|
@@ -136,35 +149,33 @@ var Notification = function Notification(_ref2) {
|
|
|
136
149
|
var messageColor = getTextColor('message', status, kind, theme);
|
|
137
150
|
var titleColor = getTextColor('title', status, kind, theme);
|
|
138
151
|
if (actionsProp) actions = actionsProp.map(function (action) {
|
|
152
|
+
var _theme$notification$a;
|
|
139
153
|
return /*#__PURE__*/React.createElement(Fragment, {
|
|
140
154
|
key: action.label
|
|
141
155
|
}, /*#__PURE__*/React.createElement(NotificationAnchor
|
|
142
156
|
// create space between first anchor and
|
|
143
157
|
// text content and next anchor
|
|
144
158
|
, _extends({
|
|
145
|
-
margin:
|
|
146
|
-
right: 'xsmall'
|
|
147
|
-
}
|
|
159
|
+
margin: (_theme$notification$a = theme.notification.actions) == null ? void 0 : _theme$notification$a.margin
|
|
148
160
|
}, action, theme.notification.actions)), ' ');
|
|
149
161
|
});
|
|
150
162
|
if (message || actions) {
|
|
163
|
+
var _theme$notification$m;
|
|
151
164
|
message = typeof message === 'string' ? /*#__PURE__*/React.createElement(Message, _extends({}, theme.notification.message, {
|
|
152
165
|
color: messageColor,
|
|
153
166
|
direction: direction
|
|
154
167
|
}), /*#__PURE__*/React.createElement(Text, {
|
|
155
|
-
margin:
|
|
156
|
-
right: 'xsmall'
|
|
157
|
-
}
|
|
168
|
+
margin: (_theme$notification$m = theme.notification.message) == null || (_theme$notification$m = _theme$notification$m.text) == null ? void 0 : _theme$notification$m.margin
|
|
158
169
|
}, message), actions) : message;
|
|
159
170
|
}
|
|
160
|
-
var iconDimension = ((_theme$
|
|
171
|
+
var iconDimension = ((_theme$notification0 = theme.notification) == null || (_theme$notification0 = _theme$notification0.message) == null ? void 0 : _theme$notification0.size) || 'medium';
|
|
161
172
|
var content = /*#__PURE__*/React.createElement(Box, _extends({}, theme.notification.container, global ? _extends({}, theme.notification.global.container) : {}, toast ? _extends({}, theme.notification.toast.container) : {}, {
|
|
162
173
|
background: background
|
|
163
174
|
// let internal box control pad
|
|
164
175
|
,
|
|
165
176
|
pad: undefined,
|
|
166
177
|
direction: "row",
|
|
167
|
-
gap:
|
|
178
|
+
gap: (_theme$notification1 = theme.notification) == null ? void 0 : _theme$notification1.gap,
|
|
168
179
|
id: toast ? undefined : id
|
|
169
180
|
}, rest), /*#__PURE__*/React.createElement(Box, {
|
|
170
181
|
direction: "row",
|
|
@@ -182,6 +193,10 @@ var Notification = function Notification(_ref2) {
|
|
|
182
193
|
React.createElement(Box, {
|
|
183
194
|
pad: closeButtonPad
|
|
184
195
|
}, /*#__PURE__*/React.createElement(Box, theme.notification.textContainer, /*#__PURE__*/React.createElement(Button, {
|
|
196
|
+
a11yTitle: format({
|
|
197
|
+
id: 'notification.close',
|
|
198
|
+
messages: messages
|
|
199
|
+
}),
|
|
185
200
|
icon: /*#__PURE__*/React.createElement(CloseIcon, {
|
|
186
201
|
color: closeIconColor,
|
|
187
202
|
height: iconDimension,
|
|
@@ -193,7 +208,7 @@ var Notification = function Notification(_ref2) {
|
|
|
193
208
|
}))));
|
|
194
209
|
if (toast) {
|
|
195
210
|
content = visible && /*#__PURE__*/React.createElement(Layer, _extends({}, theme.notification.toast.layer, {
|
|
196
|
-
role: "
|
|
211
|
+
role: "status",
|
|
197
212
|
modal: false,
|
|
198
213
|
onEsc: onClose,
|
|
199
214
|
id: id,
|
|
@@ -8,6 +8,9 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
8
8
|
global: PropTypes.bool,
|
|
9
9
|
title: PropTypes.string,
|
|
10
10
|
message: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
|
11
|
+
messages: PropTypes.shape({
|
|
12
|
+
close: PropTypes.string
|
|
13
|
+
}),
|
|
11
14
|
status: PropTypes.oneOf(['critical', 'warning', 'normal', 'info', 'unknown']),
|
|
12
15
|
toast: PropTypes.oneOfType([PropTypes.bool, PropTypes.shape({
|
|
13
16
|
autoClose: PropTypes.bool,
|
|
@@ -25,7 +25,7 @@ var getPageIndices = function getPageIndices(begin, end) {
|
|
|
25
25
|
return indices;
|
|
26
26
|
};
|
|
27
27
|
var Pagination = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
28
|
-
var _ref2;
|
|
28
|
+
var _ref2, _theme$pagination$con;
|
|
29
29
|
var a11yTitle = _ref.a11yTitle,
|
|
30
30
|
ariaLabel = _ref['aria-label'],
|
|
31
31
|
numberItems = _ref.numberItems,
|
|
@@ -201,14 +201,12 @@ var Pagination = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
201
201
|
// for backwards compatibility
|
|
202
202
|
if (!summary && !stepOptions) return /*#__PURE__*/React.createElement(StyledPaginationContainer, _extends({
|
|
203
203
|
flex: false
|
|
204
|
-
}, theme.pagination.container,
|
|
204
|
+
}, _extends({}, theme.pagination.container, {
|
|
205
|
+
gap: undefined
|
|
206
|
+
}), passThemeFlag, rest), paginationControls);
|
|
205
207
|
return /*#__PURE__*/React.createElement(StyledPaginationContainer, _extends({
|
|
206
208
|
direction: "row",
|
|
207
209
|
align: "center",
|
|
208
|
-
gap: {
|
|
209
|
-
column: 'xsmall',
|
|
210
|
-
row: 'small'
|
|
211
|
-
},
|
|
212
210
|
wrap: true,
|
|
213
211
|
flex: false
|
|
214
212
|
}, theme.pagination.container, passThemeFlag, rest), /*#__PURE__*/React.createElement(Box, {
|
|
@@ -221,10 +219,7 @@ var Pagination = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
221
219
|
})), /*#__PURE__*/React.createElement(Box, {
|
|
222
220
|
align: "center",
|
|
223
221
|
direction: "row",
|
|
224
|
-
gap:
|
|
225
|
-
column: 'xsmall',
|
|
226
|
-
row: 'small'
|
|
227
|
-
},
|
|
222
|
+
gap: (_theme$pagination$con = theme.pagination.container) == null ? void 0 : _theme$pagination$con.gap,
|
|
228
223
|
wrap: true
|
|
229
224
|
}, stepOptions && /*#__PURE__*/React.createElement(PaginationStep, {
|
|
230
225
|
messages: messages,
|
|
@@ -8,6 +8,7 @@ import { Text } from '../Text';
|
|
|
8
8
|
import { MessageContext } from '../../contexts/MessageContext';
|
|
9
9
|
import { useThemeValue } from '../../utils/useThemeValue';
|
|
10
10
|
export var PaginationStep = function PaginationStep(_ref) {
|
|
11
|
+
var _theme$pagination;
|
|
11
12
|
var messages = _ref.messages,
|
|
12
13
|
onChange = _ref.onChange,
|
|
13
14
|
_ref$options = _ref.options,
|
|
@@ -21,7 +22,7 @@ export var PaginationStep = function PaginationStep(_ref) {
|
|
|
21
22
|
return /*#__PURE__*/React.createElement(Box, _extends({
|
|
22
23
|
direction: "row",
|
|
23
24
|
align: "center",
|
|
24
|
-
gap:
|
|
25
|
+
gap: (_theme$pagination = theme.pagination) == null || (_theme$pagination = _theme$pagination.step) == null || (_theme$pagination = _theme$pagination.container) == null ? void 0 : _theme$pagination.gap
|
|
25
26
|
}, rest), /*#__PURE__*/React.createElement(Text, null, formatMessage({
|
|
26
27
|
id: 'pagination.stepLabel',
|
|
27
28
|
messages: messages
|
|
@@ -3,6 +3,7 @@ import { Skeleton } from '../Skeleton';
|
|
|
3
3
|
import { Box } from '../Box';
|
|
4
4
|
import { useThemeValue } from '../../utils/useThemeValue';
|
|
5
5
|
var ParagraphSkeleton = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
6
|
+
var _theme$paragraph;
|
|
6
7
|
var fill = _ref.fill,
|
|
7
8
|
sizeProp = _ref.size;
|
|
8
9
|
var _useThemeValue = useThemeValue(),
|
|
@@ -12,7 +13,7 @@ var ParagraphSkeleton = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
12
13
|
var height = data ? data.size : size;
|
|
13
14
|
return /*#__PURE__*/React.createElement(Box, {
|
|
14
15
|
ref: ref,
|
|
15
|
-
gap:
|
|
16
|
+
gap: (_theme$paragraph = theme.paragraph) == null || (_theme$paragraph = _theme$paragraph.skeleton) == null ? void 0 : _theme$paragraph.gap,
|
|
16
17
|
width: {
|
|
17
18
|
max: fill ? 'none' : data && data.maxWidth
|
|
18
19
|
}
|
|
@@ -69,7 +69,7 @@ var RadioButton = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
69
69
|
}, passThemeFlag), /*#__PURE__*/React.createElement(StyledRadioButton, _extends({
|
|
70
70
|
flex: false,
|
|
71
71
|
margin: label ? {
|
|
72
|
-
right: theme.radioButton.gap
|
|
72
|
+
right: theme.radioButton.gap
|
|
73
73
|
} : undefined
|
|
74
74
|
}, passThemeFlag), /*#__PURE__*/React.createElement(StyledRadioButtonInput, _extends({
|
|
75
75
|
"aria-label": a11yTitle
|
|
@@ -33,7 +33,7 @@ var StyledRadioButtonLabel = styled.span.withConfig(styledComponentsConfig).with
|
|
|
33
33
|
var StyledRadioButtonIcon = styled.svg.withConfig(styledComponentsConfig).withConfig({
|
|
34
34
|
displayName: "StyledRadioButton__StyledRadioButtonIcon",
|
|
35
35
|
componentId: "sc-g1f6ld-3"
|
|
36
|
-
})(["box-sizing:border-box;width:", ";height:", ";fill:", ";", ";"], function (props) {
|
|
36
|
+
})(["box-sizing:border-box;width:", ";height:", ";fill:", ";transform:scale(1);", ";"], function (props) {
|
|
37
37
|
return props.theme.radioButton.icon.size || props.theme.radioButton.size;
|
|
38
38
|
}, function (props) {
|
|
39
39
|
return props.theme.radioButton.icon.size || props.theme.radioButton.size;
|
|
@@ -45,7 +45,7 @@ var StyledRadioButtonIcon = styled.svg.withConfig(styledComponentsConfig).withCo
|
|
|
45
45
|
var StyledRadioButtonBox = styled(Box).withConfig({
|
|
46
46
|
displayName: "StyledRadioButton__StyledRadioButtonBox",
|
|
47
47
|
componentId: "sc-g1f6ld-4"
|
|
48
|
-
})(["background-color:", ";", ";", ";"], function (props) {
|
|
48
|
+
})(["background-color:", ";transform:scale(1);", ";", ";"], function (props) {
|
|
49
49
|
return props.backgroundColor;
|
|
50
50
|
}, function (props) {
|
|
51
51
|
return props.focus && focusStyle();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["children", "defaultValue", "disabled", "focusIndicator", "name", "onChange", "options", "value", "gap"],
|
|
1
|
+
var _excluded = ["aria-label", "aria-labelledby", "children", "defaultValue", "disabled", "focusIndicator", "id", "name", "onChange", "options", "value", "gap"],
|
|
2
2
|
_excluded2 = ["disabled", "id", "label", "value"];
|
|
3
3
|
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); }
|
|
4
4
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
@@ -10,11 +10,15 @@ import { RadioButton } from '../RadioButton';
|
|
|
10
10
|
import { RadioButtonGroupPropTypes } from './propTypes';
|
|
11
11
|
import { useThemeValue } from '../../utils/useThemeValue';
|
|
12
12
|
var RadioButtonGroup = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
13
|
-
var
|
|
13
|
+
var _formContext$useFormF, _theme$radioButtonGro;
|
|
14
|
+
var ariaLabelProp = _ref['aria-label'],
|
|
15
|
+
ariaLabelledByProp = _ref['aria-labelledby'],
|
|
16
|
+
children = _ref.children,
|
|
14
17
|
defaultValue = _ref.defaultValue,
|
|
15
18
|
disabled = _ref.disabled,
|
|
16
19
|
_ref$focusIndicator = _ref.focusIndicator,
|
|
17
20
|
focusIndicator = _ref$focusIndicator === void 0 ? true : _ref$focusIndicator,
|
|
21
|
+
id = _ref.id,
|
|
18
22
|
name = _ref.name,
|
|
19
23
|
onChange = _ref.onChange,
|
|
20
24
|
optionsProp = _ref.options,
|
|
@@ -29,7 +33,7 @@ var RadioButtonGroup = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
29
33
|
var options = optionsProp.map(function (o) {
|
|
30
34
|
return typeof o !== 'object' ? {
|
|
31
35
|
disabled: disabled,
|
|
32
|
-
id:
|
|
36
|
+
id: id ? id + "-" + o : "" + o,
|
|
33
37
|
// force string
|
|
34
38
|
label: typeof o !== 'string' ? JSON.stringify(o) : o,
|
|
35
39
|
value: o
|
|
@@ -98,6 +102,10 @@ var RadioButtonGroup = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
98
102
|
var onBlur = function onBlur() {
|
|
99
103
|
return setFocus(false);
|
|
100
104
|
};
|
|
105
|
+
var ariaLabelledBy;
|
|
106
|
+
if (formContext != null && (_formContext$useFormF = formContext.useFormField({})) != null && _formContext$useFormF.inForm && id && !ariaLabelProp) {
|
|
107
|
+
ariaLabelledBy = "grommet-" + id + "__label";
|
|
108
|
+
}
|
|
101
109
|
return /*#__PURE__*/React.createElement(Keyboard, {
|
|
102
110
|
target: "document",
|
|
103
111
|
onUp: focus ? onPrevious : undefined,
|
|
@@ -105,13 +113,16 @@ var RadioButtonGroup = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
105
113
|
onLeft: focus ? onPrevious : undefined,
|
|
106
114
|
onRight: focus ? onNext : undefined
|
|
107
115
|
}, /*#__PURE__*/React.createElement(Box, _extends({
|
|
116
|
+
"aria-label": ariaLabelProp,
|
|
117
|
+
"aria-labelledby": ariaLabelledByProp || ariaLabelledBy,
|
|
118
|
+
id: id,
|
|
108
119
|
ref: ref,
|
|
109
120
|
role: "radiogroup"
|
|
110
121
|
}, theme.radioButtonGroup.container, {
|
|
111
|
-
gap: gap || (
|
|
122
|
+
gap: gap || ((_theme$radioButtonGro = theme.radioButtonGroup.container) == null ? void 0 : _theme$radioButtonGro.gap)
|
|
112
123
|
}, rest), options.map(function (_ref2, index) {
|
|
113
124
|
var optionDisabled = _ref2.disabled,
|
|
114
|
-
|
|
125
|
+
optionId = _ref2.id,
|
|
115
126
|
label = _ref2.label,
|
|
116
127
|
optionValue = _ref2.value,
|
|
117
128
|
optionRest = _objectWithoutPropertiesLoose(_ref2, _excluded2);
|
|
@@ -142,7 +153,7 @@ var RadioButtonGroup = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
142
153
|
// we will apply the hover treament.
|
|
143
154
|
,
|
|
144
155
|
focusIndicator: focusIndicator,
|
|
145
|
-
id:
|
|
156
|
+
id: optionId,
|
|
146
157
|
value: optionValue,
|
|
147
158
|
onFocus: onFocus,
|
|
148
159
|
onBlur: onBlur,
|
|
@@ -102,7 +102,7 @@ var RangeInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
102
102
|
"aria-label": a11yTitle,
|
|
103
103
|
"aria-valuemax": max,
|
|
104
104
|
"aria-valuemin": min,
|
|
105
|
-
"aria-valuenow": value,
|
|
105
|
+
"aria-valuenow": value !== '' ? value : undefined,
|
|
106
106
|
ref: rangeInputRef,
|
|
107
107
|
name: name,
|
|
108
108
|
focus: focus,
|