grommet 2.22.0 → 2.25.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.js +2 -7
- package/components/Accordion/Accordion.js +1 -1
- package/components/Accordion/propTypes.js +1 -1
- package/components/Accordion/stories/CustomThemed/Custom.js +3 -2
- package/components/AccordionPanel/AccordionPanel.js +2 -1
- package/components/Anchor/Anchor.js +3 -4
- package/components/Anchor/propTypes.js +1 -1
- package/components/Avatar/Avatar.js +1 -1
- package/components/Box/Box.js +1 -1
- package/components/Box/StyledBox.js +1 -1
- package/components/Box/propTypes.js +2 -2
- package/components/Button/Button.js +1 -1
- package/components/Button/index.d.ts +15 -16
- package/components/Button/propTypes.js +2 -2
- package/components/Button/stories/Basic.js +1 -1
- package/components/Button/stories/Fill.js +1 -1
- package/components/Button/stories/Kind.js +1 -1
- package/components/Calendar/Calendar.js +1 -1
- package/components/Calendar/index.d.ts +2 -2
- package/components/Calendar/propTypes.js +1 -1
- package/components/Calendar/stories/ShowAdjacentDays.js +1 -1
- package/components/Card/Card.js +1 -1
- package/components/Card/stories/CustomThemed/Clickable.js +1 -1
- package/components/Card/stories/CustomThemed/RichFooter.js +1 -1
- package/components/Card/stories/CustomThemed/Themed.js +1 -1
- package/components/CardBody/CardBody.js +1 -1
- package/components/CardFooter/CardFooter.js +1 -1
- package/components/CardHeader/CardHeader.js +1 -1
- package/components/Carousel/Carousel.js +1 -1
- package/components/Carousel/propTypes.js +1 -1
- package/components/Carousel/stories/CustomThemed/Custom.js +1 -1
- package/components/Chart/Chart.js +1 -1
- package/components/Chart/index.d.ts +28 -2
- package/components/Chart/propTypes.js +1 -1
- package/components/Chart/stories/Rich.js +1 -1
- package/components/Chart/stories/Window.js +1 -1
- package/components/CheckBox/CheckBox.js +2 -2
- package/components/CheckBox/StyledCheckBox.js +6 -2
- package/components/CheckBox/index.d.ts +2 -1
- package/components/CheckBox/stories/CustomThemed/Custom.js +1 -1
- package/components/CheckBox/stories/CustomThemed/CustomToggle.js +1 -1
- package/components/CheckBox/stories/NoLabel.js +1 -1
- package/components/CheckBox/stories/Simple.js +1 -1
- package/components/CheckBoxGroup/CheckBoxGroup.js +1 -1
- package/components/CheckBoxGroup/index.d.ts +1 -3
- package/components/Clock/Analog.js +1 -1
- package/components/Clock/Clock.js +1 -1
- package/components/Clock/Digital.js +1 -1
- package/components/Clock/propTypes.js +1 -1
- package/components/Collapsible/stories/Nested.js +1 -1
- package/components/Collapsible/stories/Simple.js +1 -1
- package/components/DataChart/DataChart.js +35 -43
- package/components/DataChart/Legend.js +1 -1
- package/components/DataChart/Swatch.js +64 -23
- package/components/DataChart/XAxis.js +19 -7
- package/components/DataChart/YGuide.js +1 -1
- package/components/DataChart/index.d.ts +1 -1
- package/components/DataChart/propTypes.js +4 -2
- package/components/DataChart/stories/Legend.js +6 -2
- package/components/DataChart/stories/Offset.js +6 -1
- package/components/DataChart/utils.js +11 -1
- package/components/DataTable/Body.js +84 -26
- package/components/DataTable/Cell.js +11 -5
- package/components/DataTable/DataTable.js +15 -6
- package/components/DataTable/ExpanderCell.js +1 -1
- package/components/DataTable/Footer.js +7 -4
- package/components/DataTable/GroupedBody.js +23 -7
- package/components/DataTable/Header.js +86 -41
- package/components/DataTable/Resizer.js +1 -1
- package/components/DataTable/Sorter.js +1 -1
- package/components/DataTable/StyledDataTable.js +2 -2
- package/components/DataTable/index.d.ts +14 -2
- package/components/DataTable/propTypes.js +10 -3
- package/components/DataTable/stories/Controlled.js +1 -1
- package/components/DataTable/stories/ControlledGrouped.js +1 -1
- package/components/DataTable/stories/CustomThemed/Fill.js +1 -1
- package/components/DataTable/stories/GroupedOnSelect.js +1 -1
- package/components/DataTable/stories/OnUpdate.js +1 -1
- package/components/DataTable/stories/Served.js +1 -1
- package/components/DataTable/stories/Sort.js +1 -1
- package/components/DataTable/stories/SpaceX.js +6 -4
- package/components/DataTable/stories/SpaceXUngrouped.js +4 -2
- package/components/DataTable/stories/Tunable.js +1 -1
- package/components/DataTable/stories/Units.js +41 -2
- package/components/DataTable/stories/VerticalAlign.js +51 -0
- package/components/DataTable/stories/data.js +1 -1
- package/components/DataTable/stories/rowDetails.js +1 -1
- package/components/DataTable/stories/typescript/Clickable.tsx +1 -0
- package/components/DataTable/stories/typescript/OnSelect.tsx +5 -10
- package/components/DateInput/DateInput.js +29 -24
- package/components/DateInput/index.d.ts +1 -0
- package/components/DateInput/propTypes.js +1 -0
- package/components/DateInput/stories/Format.js +14 -1
- package/components/DateInput/utils.js +1 -1
- package/components/Diagram/Diagram.js +1 -1
- package/components/Diagram/stories/Animated.js +1 -1
- package/components/Diagram/stories/Progressing.js +1 -1
- package/components/Distribution/Distribution.js +1 -1
- package/components/Distribution/propTypes.js +1 -1
- package/components/Drop/Drop.js +1 -1
- package/components/Drop/DropContainer.js +12 -5
- package/components/Drop/index.d.ts +2 -0
- package/components/DropButton/DropButton.js +1 -1
- package/components/DropButton/propTypes.js +1 -1
- package/components/FileInput/FileInput.js +26 -8
- package/components/FileInput/index.d.ts +6 -1
- package/components/FileInput/stories/Multiple.js +1 -0
- package/components/FocusedContainer.js +1 -1
- package/components/Footer/Footer.js +1 -1
- package/components/Footer/index.d.ts +2 -2
- package/components/Footer/stories/DoubleFooter.js +1 -1
- package/components/Footer/stories/Sitemap.js +1 -1
- package/components/Form/Form.js +1 -1
- package/components/Form/stories/ArrayOfFormFields.js +1 -1
- package/components/Form/stories/CustomThemed/FieldSpacingOptions.js +1 -1
- package/components/Form/stories/HelpAndError.js +1 -1
- package/components/FormField/FormField.js +1 -1
- package/components/FormField/index.d.ts +4 -1
- package/components/Grid/Grid.js +5 -3
- package/components/Grid/README.md +0 -2
- package/components/Grid/index.d.ts +9 -3
- package/components/Grid/propTypes.js +1 -1
- package/components/Grid/stories/CustomThemed/Responsive.js +1 -1
- package/components/Grid/stories/typescript/App.tsx +42 -48
- package/components/Grommet/Grommet.js +1 -1
- package/components/Header/Header.js +63 -8
- package/components/Header/index.d.ts +8 -2
- package/components/Header/propTypes.js +19 -0
- package/components/Header/stories/Sticky.js +134 -0
- package/components/Heading/Heading.js +1 -1
- package/components/Heading/propTypes.js +1 -1
- package/components/Image/Image.js +1 -1
- package/components/Image/propTypes.js +1 -1
- package/components/InfiniteScroll/index.d.ts +1 -0
- package/components/InfiniteScroll/stories/Basics.js +1 -1
- package/components/InfiniteScroll/stories/ClassChildren.js +1 -1
- package/components/InfiniteScroll/stories/Marker.js +1 -1
- package/components/InfiniteScroll/stories/Show.js +1 -1
- package/components/InfiniteScroll/stories/ShowAfter.js +1 -1
- package/components/InfiniteScroll/stories/ShowBefore.js +1 -1
- package/components/Keyboard/index.d.ts +1 -0
- package/components/Layer/Layer.js +2 -2
- package/components/Layer/LayerContainer.js +7 -3
- package/components/List/List.js +108 -42
- package/components/List/index.d.ts +4 -1
- package/components/List/propTypes.js +4 -2
- package/components/List/stories/Basic.js +1 -0
- package/components/List/stories/Disabled.js +33 -0
- package/components/Main/Main.js +1 -1
- package/components/Main/index.d.ts +2 -2
- package/components/Markdown/Markdown.js +1 -1
- package/components/MaskedInput/MaskedInput.js +37 -28
- package/components/Menu/Menu.js +108 -63
- package/components/Menu/index.d.ts +4 -3
- package/components/Menu/propTypes.js +2 -2
- package/components/Menu/stories/Grouped.js +52 -0
- package/components/Menu/stories/Simple.js +1 -0
- package/components/Menu/stories/typescript/Children.tsx +1 -1
- package/components/Meter/Bar.js +1 -1
- package/components/Meter/Circle.js +5 -3
- package/components/Meter/Meter.js +1 -1
- package/components/Meter/propTypes.js +1 -1
- package/components/NameValueList/NameValueList.js +1 -1
- package/components/NameValueList/index.d.ts +4 -1
- package/components/NameValuePair/NameValuePair.js +1 -1
- package/components/Nav/Nav.js +1 -1
- package/components/Nav/index.d.ts +2 -2
- package/components/Nav/stories/CustomThemed/JustifySidebar.js +1 -1
- package/components/Nav/stories/Sidebar.js +1 -1
- package/components/Notification/Notification.js +18 -9
- package/components/Notification/index.d.ts +2 -1
- package/components/Notification/propTypes.js +2 -1
- package/components/Page/Page.js +1 -1
- package/components/Page/index.d.ts +2 -2
- package/components/PageContent/PageContent.js +1 -1
- package/components/PageContent/index.d.ts +2 -2
- package/components/PageHeader/PageHeader.js +80 -0
- package/components/PageHeader/index.d.ts +26 -0
- package/components/PageHeader/index.js +8 -0
- package/components/PageHeader/propTypes.js +30 -0
- package/components/PageHeader/stories/Custom.js +47 -0
- package/components/PageHeader/stories/MultipleActions.js +79 -0
- package/components/PageHeader/stories/Responsive.js +37 -0
- package/components/PageHeader/stories/Simple.js +36 -0
- package/components/Pagination/PageControl.js +1 -1
- package/components/Pagination/Pagination.js +1 -1
- package/components/Pagination/propTypes.js +1 -1
- package/components/Paragraph/Paragraph.js +1 -1
- package/components/Paragraph/StyledParagraph.js +7 -1
- package/components/Paragraph/index.d.ts +1 -0
- package/components/Paragraph/propTypes.js +2 -1
- package/components/Paragraph/stories/MaxLines.js +37 -0
- package/components/RadioButton/RadioButton.js +1 -1
- package/components/RadioButton/index.d.ts +2 -1
- package/components/RadioButtonGroup/RadioButtonGroup.js +1 -1
- package/components/RadioButtonGroup/index.d.ts +2 -1
- package/components/RadioButtonGroup/stories/CustomThemed/CustomTheme.js +1 -1
- package/components/RadioButtonGroup/stories/Disabled.js +1 -1
- package/components/RangeInput/RangeInput.js +1 -1
- package/components/RangeSelector/EdgeControl.js +1 -1
- package/components/RangeSelector/RangeSelector.js +1 -1
- package/components/RangeSelector/stories/CustomThemed/Custom.js +1 -1
- package/components/RangeSelector/stories/CustomThemed/CustomEdgeControl.js +1 -1
- package/components/RangeSelector/stories/Step.js +1 -1
- package/components/RangeSelector/stories/Thin.js +1 -9
- package/components/RangeSelector/stories/Vertical.js +1 -1
- package/components/RoutedAnchor/RoutedAnchor.js +2 -2
- package/components/RoutedButton/RoutedButton.js +2 -2
- package/components/Select/Select.js +11 -32
- package/components/Select/SelectContainer.js +27 -11
- package/components/Select/propTypes.js +1 -1
- package/components/Select/stories/Clear.js +27 -2
- package/components/Select/stories/components/SearchBorderBox.js +1 -1
- package/components/Select/stories/components/SearchInput.js +1 -1
- package/components/Sidebar/Sidebar.js +1 -1
- package/components/Sidebar/stories/Labels.js +1 -1
- package/components/SkipLink/SkipLink.js +1 -1
- package/components/SkipLinkTarget/SkipLinkTarget.js +1 -1
- package/components/Spinner/Spinner.js +1 -1
- package/components/Spinner/index.d.ts +2 -1
- package/components/Stack/Stack.js +1 -1
- package/components/Stack/propTypes.js +1 -1
- package/components/Tab/StyledTab.js +2 -2
- package/components/Tab/Tab.js +35 -17
- package/components/Table/StyledTable.js +1 -1
- package/components/Table/propTypes.js +1 -1
- package/components/TableBody/TableBody.js +1 -1
- package/components/TableCell/TableCell.js +9 -5
- package/components/TableFooter/TableFooter.js +1 -1
- package/components/TableHeader/TableHeader.js +1 -1
- package/components/TableRow/TableRow.js +1 -1
- package/components/Tabs/Tabs.js +231 -10
- package/components/Tabs/propTypes.js +1 -1
- package/components/Tabs/stories/Responsive.js +18 -0
- package/components/Tag/Tag.js +1 -1
- package/components/Tag/propTypes.js +1 -1
- package/components/Text/Text.js +1 -1
- package/components/Text/propTypes.js +1 -1
- package/components/TextArea/TextArea.js +1 -1
- package/components/TextArea/stories/NonResizable.js +1 -1
- package/components/TextArea/stories/Simple.js +1 -1
- package/components/TextInput/TextInput.js +33 -4
- package/components/TextInput/stories/DefaultSuggestion.js +1 -0
- package/components/TextInput/stories/InsideFormField.js +1 -1
- package/components/TextInput/stories/Suggestions.js +1 -0
- package/components/TextInput/stories/WithTags.js +1 -1
- package/components/Tip/Tip.js +22 -29
- package/components/Tip/index.d.ts +1 -0
- package/components/Video/StyledVideo.js +1 -1
- package/components/Video/Video.js +161 -55
- package/components/Video/index.d.ts +15 -8
- package/components/Video/propTypes.js +8 -6
- package/components/Video/stories/typescript/ControlsBelow.tsx +10 -4
- package/components/Video/stories/typescript/Simple.tsx +1 -1
- package/components/Video/stories/typescript/TheaterMode.tsx +1 -2
- package/components/WorldMap/WorldMap.js +1 -1
- package/components/WorldMap/propTypes.js +1 -1
- package/components/WorldMap/stories/Places.js +1 -1
- package/components/index.d.ts +1 -0
- package/components/index.js +8 -0
- package/contexts/AnnounceContext/stories/Assertive.js +1 -1
- package/contexts/ResponsiveContext/stories/ResponsiveGrid.js +1 -1
- package/contexts/ThemeContext/index.d.ts +4 -1
- package/es6/all/stories/AllComponents.js +2 -7
- package/es6/components/Accordion/Accordion.js +1 -1
- package/es6/components/Accordion/propTypes.js +1 -1
- package/es6/components/Accordion/stories/CustomThemed/Custom.js +3 -2
- package/es6/components/AccordionPanel/AccordionPanel.js +2 -1
- package/es6/components/Anchor/Anchor.js +3 -4
- package/es6/components/Anchor/propTypes.js +1 -1
- package/es6/components/Avatar/Avatar.js +1 -1
- package/es6/components/Box/Box.js +1 -1
- package/es6/components/Box/StyledBox.js +1 -1
- package/es6/components/Box/propTypes.js +2 -2
- package/es6/components/Button/Button.js +1 -1
- package/es6/components/Button/index.d.ts +15 -16
- package/es6/components/Button/propTypes.js +2 -2
- package/es6/components/Button/stories/Basic.js +1 -1
- package/es6/components/Button/stories/Fill.js +1 -1
- package/es6/components/Button/stories/Kind.js +1 -1
- package/es6/components/Calendar/Calendar.js +1 -1
- package/es6/components/Calendar/index.d.ts +2 -2
- package/es6/components/Calendar/propTypes.js +1 -1
- package/es6/components/Calendar/stories/ShowAdjacentDays.js +1 -1
- package/es6/components/Card/Card.js +1 -1
- package/es6/components/Card/stories/CustomThemed/Clickable.js +1 -1
- package/es6/components/Card/stories/CustomThemed/RichFooter.js +1 -1
- package/es6/components/Card/stories/CustomThemed/Themed.js +1 -1
- package/es6/components/CardBody/CardBody.js +1 -1
- package/es6/components/CardFooter/CardFooter.js +1 -1
- package/es6/components/CardHeader/CardHeader.js +1 -1
- package/es6/components/Carousel/Carousel.js +1 -1
- package/es6/components/Carousel/propTypes.js +1 -1
- package/es6/components/Carousel/stories/CustomThemed/Custom.js +1 -1
- package/es6/components/Chart/Chart.js +1 -1
- package/es6/components/Chart/index.d.ts +28 -2
- package/es6/components/Chart/propTypes.js +1 -1
- package/es6/components/Chart/stories/Rich.js +1 -1
- package/es6/components/Chart/stories/Window.js +1 -1
- package/es6/components/CheckBox/CheckBox.js +2 -2
- package/es6/components/CheckBox/StyledCheckBox.js +6 -2
- package/es6/components/CheckBox/index.d.ts +2 -1
- package/es6/components/CheckBox/stories/CustomThemed/Custom.js +1 -1
- package/es6/components/CheckBox/stories/CustomThemed/CustomToggle.js +1 -1
- package/es6/components/CheckBox/stories/NoLabel.js +1 -1
- package/es6/components/CheckBox/stories/Simple.js +1 -1
- package/es6/components/CheckBoxGroup/CheckBoxGroup.js +1 -1
- package/es6/components/CheckBoxGroup/index.d.ts +1 -3
- package/es6/components/Clock/Analog.js +1 -1
- package/es6/components/Clock/Clock.js +1 -1
- package/es6/components/Clock/Digital.js +1 -1
- package/es6/components/Clock/propTypes.js +1 -1
- package/es6/components/Collapsible/stories/Nested.js +1 -1
- package/es6/components/Collapsible/stories/Simple.js +1 -1
- package/es6/components/DataChart/DataChart.js +36 -45
- package/es6/components/DataChart/Legend.js +1 -1
- package/es6/components/DataChart/Swatch.js +64 -23
- package/es6/components/DataChart/XAxis.js +19 -7
- package/es6/components/DataChart/YGuide.js +1 -1
- package/es6/components/DataChart/index.d.ts +1 -1
- package/es6/components/DataChart/propTypes.js +4 -2
- package/es6/components/DataChart/stories/Legend.js +6 -2
- package/es6/components/DataChart/stories/Offset.js +6 -1
- package/es6/components/DataChart/utils.js +7 -0
- package/es6/components/DataTable/Body.js +83 -26
- package/es6/components/DataTable/Cell.js +12 -5
- package/es6/components/DataTable/DataTable.js +15 -6
- package/es6/components/DataTable/ExpanderCell.js +1 -1
- package/es6/components/DataTable/Footer.js +7 -4
- package/es6/components/DataTable/GroupedBody.js +23 -7
- package/es6/components/DataTable/Header.js +86 -41
- package/es6/components/DataTable/Resizer.js +1 -1
- package/es6/components/DataTable/Sorter.js +1 -1
- package/es6/components/DataTable/StyledDataTable.js +2 -2
- package/es6/components/DataTable/index.d.ts +14 -2
- package/es6/components/DataTable/propTypes.js +10 -3
- package/es6/components/DataTable/stories/Controlled.js +1 -1
- package/es6/components/DataTable/stories/ControlledGrouped.js +1 -1
- package/es6/components/DataTable/stories/CustomThemed/Fill.js +1 -1
- package/es6/components/DataTable/stories/GroupedOnSelect.js +1 -1
- package/es6/components/DataTable/stories/OnUpdate.js +1 -1
- package/es6/components/DataTable/stories/Served.js +1 -1
- package/es6/components/DataTable/stories/Sort.js +1 -1
- package/es6/components/DataTable/stories/SpaceX.js +6 -4
- package/es6/components/DataTable/stories/SpaceXUngrouped.js +4 -2
- package/es6/components/DataTable/stories/Tunable.js +1 -1
- package/es6/components/DataTable/stories/Units.js +41 -2
- package/es6/components/DataTable/stories/VerticalAlign.js +38 -0
- package/es6/components/DataTable/stories/data.js +1 -1
- package/es6/components/DataTable/stories/rowDetails.js +1 -1
- package/es6/components/DataTable/stories/typescript/Clickable.tsx +1 -0
- package/es6/components/DataTable/stories/typescript/OnSelect.tsx +5 -10
- package/es6/components/DateInput/DateInput.js +28 -24
- package/es6/components/DateInput/index.d.ts +1 -0
- package/es6/components/DateInput/propTypes.js +1 -0
- package/es6/components/DateInput/stories/Format.js +14 -1
- package/es6/components/DateInput/utils.js +1 -1
- package/es6/components/Diagram/Diagram.js +1 -1
- package/es6/components/Diagram/stories/Animated.js +1 -1
- package/es6/components/Diagram/stories/Progressing.js +1 -1
- package/es6/components/Distribution/Distribution.js +1 -1
- package/es6/components/Distribution/propTypes.js +1 -1
- package/es6/components/Drop/Drop.js +1 -1
- package/es6/components/Drop/DropContainer.js +10 -5
- package/es6/components/Drop/index.d.ts +2 -0
- package/es6/components/DropButton/DropButton.js +1 -1
- package/es6/components/DropButton/propTypes.js +1 -1
- package/es6/components/FileInput/FileInput.js +26 -8
- package/es6/components/FileInput/index.d.ts +6 -1
- package/es6/components/FileInput/stories/Multiple.js +1 -0
- package/es6/components/FocusedContainer.js +1 -1
- package/es6/components/Footer/Footer.js +1 -1
- package/es6/components/Footer/index.d.ts +2 -2
- package/es6/components/Footer/stories/DoubleFooter.js +1 -1
- package/es6/components/Footer/stories/Sitemap.js +1 -1
- package/es6/components/Form/Form.js +1 -1
- package/es6/components/Form/stories/ArrayOfFormFields.js +1 -1
- package/es6/components/Form/stories/CustomThemed/FieldSpacingOptions.js +1 -1
- package/es6/components/Form/stories/HelpAndError.js +1 -1
- package/es6/components/FormField/FormField.js +1 -1
- package/es6/components/FormField/index.d.ts +4 -1
- package/es6/components/Grid/Grid.js +5 -3
- package/es6/components/Grid/README.md +0 -2
- package/es6/components/Grid/index.d.ts +9 -3
- package/es6/components/Grid/propTypes.js +1 -1
- package/es6/components/Grid/stories/CustomThemed/Responsive.js +1 -1
- package/es6/components/Grid/stories/typescript/App.tsx +42 -48
- package/es6/components/Grommet/Grommet.js +1 -1
- package/es6/components/Header/Header.js +58 -7
- package/es6/components/Header/index.d.ts +8 -2
- package/es6/components/Header/propTypes.js +10 -0
- package/es6/components/Header/stories/Sticky.js +121 -0
- package/es6/components/Heading/Heading.js +1 -1
- package/es6/components/Heading/propTypes.js +1 -1
- package/es6/components/Image/Image.js +1 -1
- package/es6/components/Image/propTypes.js +1 -1
- package/es6/components/InfiniteScroll/index.d.ts +1 -0
- package/es6/components/InfiniteScroll/stories/Basics.js +1 -1
- package/es6/components/InfiniteScroll/stories/ClassChildren.js +1 -1
- package/es6/components/InfiniteScroll/stories/Marker.js +1 -1
- package/es6/components/InfiniteScroll/stories/Show.js +1 -1
- package/es6/components/InfiniteScroll/stories/ShowAfter.js +1 -1
- package/es6/components/InfiniteScroll/stories/ShowBefore.js +1 -1
- package/es6/components/Keyboard/index.d.ts +1 -0
- package/es6/components/Layer/Layer.js +2 -2
- package/es6/components/Layer/LayerContainer.js +5 -3
- package/es6/components/List/List.js +109 -43
- package/es6/components/List/index.d.ts +4 -1
- package/es6/components/List/propTypes.js +4 -2
- package/es6/components/List/stories/Basic.js +1 -0
- package/es6/components/List/stories/Disabled.js +20 -0
- package/es6/components/Main/Main.js +1 -1
- package/es6/components/Main/index.d.ts +2 -2
- package/es6/components/Markdown/Markdown.js +1 -1
- package/es6/components/MaskedInput/MaskedInput.js +38 -29
- package/es6/components/Menu/Menu.js +109 -63
- package/es6/components/Menu/index.d.ts +4 -3
- package/es6/components/Menu/propTypes.js +2 -2
- package/es6/components/Menu/stories/Grouped.js +40 -0
- package/es6/components/Menu/stories/Simple.js +1 -0
- package/es6/components/Menu/stories/typescript/Children.tsx +1 -1
- package/es6/components/Meter/Bar.js +1 -1
- package/es6/components/Meter/Circle.js +5 -3
- package/es6/components/Meter/Meter.js +1 -1
- package/es6/components/Meter/propTypes.js +1 -1
- package/es6/components/NameValueList/NameValueList.js +1 -1
- package/es6/components/NameValueList/index.d.ts +4 -1
- package/es6/components/NameValuePair/NameValuePair.js +1 -1
- package/es6/components/Nav/Nav.js +1 -1
- package/es6/components/Nav/index.d.ts +2 -2
- package/es6/components/Nav/stories/CustomThemed/JustifySidebar.js +1 -1
- package/es6/components/Nav/stories/Sidebar.js +1 -1
- package/es6/components/Notification/Notification.js +18 -9
- package/es6/components/Notification/index.d.ts +2 -1
- package/es6/components/Notification/propTypes.js +2 -1
- package/es6/components/Page/Page.js +1 -1
- package/es6/components/Page/index.d.ts +2 -2
- package/es6/components/PageContent/PageContent.js +1 -1
- package/es6/components/PageContent/index.d.ts +2 -2
- package/es6/components/PageHeader/PageHeader.js +63 -0
- package/es6/components/PageHeader/index.d.ts +26 -0
- package/es6/components/PageHeader/index.js +1 -0
- package/es6/components/PageHeader/propTypes.js +19 -0
- package/es6/components/PageHeader/stories/Custom.js +32 -0
- package/es6/components/PageHeader/stories/MultipleActions.js +63 -0
- package/es6/components/PageHeader/stories/Responsive.js +25 -0
- package/es6/components/PageHeader/stories/Simple.js +24 -0
- package/es6/components/Pagination/PageControl.js +1 -1
- package/es6/components/Pagination/Pagination.js +1 -1
- package/es6/components/Pagination/propTypes.js +1 -1
- package/es6/components/Paragraph/Paragraph.js +1 -1
- package/es6/components/Paragraph/StyledParagraph.js +8 -1
- package/es6/components/Paragraph/index.d.ts +1 -0
- package/es6/components/Paragraph/propTypes.js +2 -1
- package/es6/components/Paragraph/stories/MaxLines.js +24 -0
- package/es6/components/RadioButton/RadioButton.js +1 -1
- package/es6/components/RadioButton/index.d.ts +2 -1
- package/es6/components/RadioButtonGroup/RadioButtonGroup.js +1 -1
- package/es6/components/RadioButtonGroup/index.d.ts +2 -1
- package/es6/components/RadioButtonGroup/stories/CustomThemed/CustomTheme.js +1 -1
- package/es6/components/RadioButtonGroup/stories/Disabled.js +1 -1
- package/es6/components/RangeInput/RangeInput.js +1 -1
- package/es6/components/RangeSelector/EdgeControl.js +1 -1
- package/es6/components/RangeSelector/RangeSelector.js +1 -1
- package/es6/components/RangeSelector/stories/CustomThemed/Custom.js +1 -1
- package/es6/components/RangeSelector/stories/CustomThemed/CustomEdgeControl.js +1 -1
- package/es6/components/RangeSelector/stories/Step.js +1 -1
- package/es6/components/RangeSelector/stories/Thin.js +1 -7
- package/es6/components/RangeSelector/stories/Vertical.js +1 -1
- package/es6/components/RoutedAnchor/RoutedAnchor.js +2 -2
- package/es6/components/RoutedButton/RoutedButton.js +2 -2
- package/es6/components/Select/Select.js +12 -33
- package/es6/components/Select/SelectContainer.js +27 -11
- package/es6/components/Select/propTypes.js +1 -1
- package/es6/components/Select/stories/Clear.js +27 -2
- package/es6/components/Select/stories/components/SearchBorderBox.js +1 -1
- package/es6/components/Select/stories/components/SearchInput.js +1 -1
- package/es6/components/Sidebar/Sidebar.js +1 -1
- package/es6/components/Sidebar/stories/Labels.js +1 -1
- package/es6/components/SkipLink/SkipLink.js +1 -1
- package/es6/components/SkipLinkTarget/SkipLinkTarget.js +1 -1
- package/es6/components/Spinner/Spinner.js +1 -1
- package/es6/components/Spinner/index.d.ts +2 -1
- package/es6/components/Stack/Stack.js +1 -1
- package/es6/components/Stack/propTypes.js +1 -1
- package/es6/components/Tab/StyledTab.js +2 -2
- package/es6/components/Tab/Tab.js +35 -18
- package/es6/components/Table/StyledTable.js +1 -1
- package/es6/components/Table/propTypes.js +1 -1
- package/es6/components/TableBody/TableBody.js +1 -1
- package/es6/components/TableCell/TableCell.js +8 -5
- package/es6/components/TableFooter/TableFooter.js +1 -1
- package/es6/components/TableHeader/TableHeader.js +1 -1
- package/es6/components/TableRow/TableRow.js +1 -1
- package/es6/components/Tabs/Tabs.js +227 -11
- package/es6/components/Tabs/propTypes.js +1 -1
- package/es6/components/Tabs/stories/Responsive.js +18 -0
- package/es6/components/Tag/Tag.js +1 -1
- package/es6/components/Tag/propTypes.js +1 -1
- package/es6/components/Text/Text.js +1 -1
- package/es6/components/Text/propTypes.js +1 -1
- package/es6/components/TextArea/TextArea.js +1 -1
- package/es6/components/TextArea/stories/NonResizable.js +1 -1
- package/es6/components/TextArea/stories/Simple.js +1 -1
- package/es6/components/TextInput/TextInput.js +33 -4
- package/es6/components/TextInput/stories/DefaultSuggestion.js +1 -0
- package/es6/components/TextInput/stories/InsideFormField.js +1 -1
- package/es6/components/TextInput/stories/Suggestions.js +1 -0
- package/es6/components/TextInput/stories/WithTags.js +1 -1
- package/es6/components/Tip/Tip.js +22 -29
- package/es6/components/Tip/index.d.ts +1 -0
- package/es6/components/Video/StyledVideo.js +2 -2
- package/es6/components/Video/Video.js +159 -55
- package/es6/components/Video/index.d.ts +15 -8
- package/es6/components/Video/propTypes.js +8 -6
- package/es6/components/Video/stories/typescript/ControlsBelow.tsx +10 -4
- package/es6/components/Video/stories/typescript/Simple.tsx +1 -1
- package/es6/components/Video/stories/typescript/TheaterMode.tsx +1 -2
- package/es6/components/WorldMap/WorldMap.js +1 -1
- package/es6/components/WorldMap/propTypes.js +1 -1
- package/es6/components/WorldMap/stories/Places.js +1 -1
- package/es6/components/index.d.ts +1 -0
- package/es6/components/index.js +1 -0
- package/es6/contexts/AnnounceContext/stories/Assertive.js +1 -1
- package/es6/contexts/ResponsiveContext/stories/ResponsiveGrid.js +1 -1
- package/es6/contexts/ThemeContext/index.d.ts +4 -1
- package/es6/index.d.ts +1 -0
- package/es6/languages/default.json +4 -1
- package/es6/themes/base.d.ts +82 -21
- package/es6/themes/base.js +103 -5
- package/es6/utils/index.js +2 -1
- package/es6/utils/object.js +1 -1
- package/es6/utils/pagination.js +1 -1
- package/es6/utils/use-keyboard.js +25 -0
- package/grommet.min.js +1 -1
- package/grommet.min.js.map +1 -1
- package/index.d.ts +1 -0
- package/languages/default.json +4 -1
- package/package.json +58 -54
- package/themes/base.d.ts +82 -21
- package/themes/base.js +104 -5
- package/utils/index.js +8 -0
- package/utils/object.js +1 -1
- package/utils/pagination.js +1 -1
- package/utils/use-keyboard.js +34 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var _excluded = ["a11yTitle", "aria-label", "children", "disabled", "dropAlign", "dropBackground", "dropProps", "dropTarget", "justifyContent", "icon", "items", "label", "messages", "onKeyDown", "open", "plain", "size"],
|
|
2
2
|
_excluded2 = ["align"];
|
|
3
3
|
|
|
4
|
-
function _extends() { _extends = Object.assign
|
|
4
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
5
5
|
|
|
6
6
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
7
7
|
|
|
@@ -75,12 +75,25 @@ var Menu = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
75
75
|
themeDropAlign = _theme$menu$drop.align,
|
|
76
76
|
themeDropProps = _objectWithoutPropertiesLoose(_theme$menu$drop, _excluded2);
|
|
77
77
|
|
|
78
|
+
var a11y = ariaLabel || a11yTitle; // total number of menu items
|
|
79
|
+
|
|
80
|
+
var itemCount = useMemo(function () {
|
|
81
|
+
var count = 0;
|
|
82
|
+
|
|
83
|
+
if (items && Array.isArray(items[0])) {
|
|
84
|
+
items.forEach(function (group) {
|
|
85
|
+
count += group.length;
|
|
86
|
+
});
|
|
87
|
+
} else count = items.length;
|
|
88
|
+
|
|
89
|
+
return count;
|
|
90
|
+
}, [items]);
|
|
78
91
|
var align = dropProps && dropProps.align || dropAlign || themeDropAlign;
|
|
79
92
|
var controlButtonIndex = useMemo(function () {
|
|
80
93
|
if (align.top === 'top') return -1;
|
|
81
|
-
if (align.bottom === 'bottom') return
|
|
94
|
+
if (align.bottom === 'bottom') return itemCount;
|
|
82
95
|
return undefined;
|
|
83
|
-
}, [align,
|
|
96
|
+
}, [align, itemCount]); // Keeps track of whether menu options should be mirrored
|
|
84
97
|
// when there's not enough space below DropButton. This state
|
|
85
98
|
// is modified on /Drop/DropContainer.js.
|
|
86
99
|
|
|
@@ -156,7 +169,7 @@ var Menu = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
156
169
|
|
|
157
170
|
if (!isOpen) {
|
|
158
171
|
onDropOpen();
|
|
159
|
-
} else if (isTab(event) && (!constants.controlBottom && activeItemIndex ===
|
|
172
|
+
} else if (isTab(event) && (!constants.controlBottom && activeItemIndex === itemCount - 1 || constants.controlBottom && activeItemIndex === controlButtonIndex)) {
|
|
160
173
|
// User has reached end of the menu, this tab will close
|
|
161
174
|
// the menu drop because there are no more "next items" to access
|
|
162
175
|
onDropClose();
|
|
@@ -167,7 +180,7 @@ var Menu = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
167
180
|
// In the case the the menu control button is located at the
|
|
168
181
|
// bottom of the menu, it checks if the user has reached the button.
|
|
169
182
|
// Otherwise, it checks if the user is at the last menu item.
|
|
170
|
-
constants.controlBottom && activeItemIndex === controlButtonIndex || !constants.controlBottom && activeItemIndex ===
|
|
183
|
+
constants.controlBottom && activeItemIndex === controlButtonIndex || !constants.controlBottom && activeItemIndex === itemCount - 1 || activeItemIndex === constants.none) {
|
|
171
184
|
// place focus on the first menu item
|
|
172
185
|
index = 0;
|
|
173
186
|
} else {
|
|
@@ -195,12 +208,12 @@ var Menu = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
195
208
|
var index;
|
|
196
209
|
|
|
197
210
|
if (activeItemIndex === 'none') {
|
|
198
|
-
index =
|
|
211
|
+
index = itemCount - 1;
|
|
199
212
|
} else if (activeItemIndex - 1 < 0) {
|
|
200
213
|
if (constants.controlTop && activeItemIndex - 1 === controlButtonIndex) {
|
|
201
|
-
index =
|
|
214
|
+
index = itemCount;
|
|
202
215
|
} else {
|
|
203
|
-
index =
|
|
216
|
+
index = itemCount - 1;
|
|
204
217
|
}
|
|
205
218
|
} else {
|
|
206
219
|
index = activeItemIndex - 1;
|
|
@@ -254,9 +267,9 @@ var Menu = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
254
267
|
}, /*#__PURE__*/React.createElement(Button, _extends({
|
|
255
268
|
ref: function ref(r) {
|
|
256
269
|
// make it accessible at the end of all menu items
|
|
257
|
-
buttonRefs.current[
|
|
270
|
+
buttonRefs.current[itemCount] = r;
|
|
258
271
|
},
|
|
259
|
-
a11yTitle:
|
|
272
|
+
a11yTitle: a11y || format({
|
|
260
273
|
id: 'menu.closeMenu',
|
|
261
274
|
messages: messages
|
|
262
275
|
}),
|
|
@@ -276,6 +289,89 @@ var Menu = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
276
289
|
drop: true
|
|
277
290
|
}));
|
|
278
291
|
} : content));
|
|
292
|
+
|
|
293
|
+
var menuItem = function menuItem(item, index) {
|
|
294
|
+
// Determine whether the label is done as a child or
|
|
295
|
+
// as an option Button kind property.
|
|
296
|
+
var child = !theme.button.option ? /*#__PURE__*/React.createElement(Box, {
|
|
297
|
+
align: "start",
|
|
298
|
+
pad: "small",
|
|
299
|
+
direction: "row",
|
|
300
|
+
gap: item.gap,
|
|
301
|
+
justify: item.justify
|
|
302
|
+
}, item.reverse && item.label, item.icon, !item.reverse && item.label) : undefined; // if we have a child, turn on plain, and hoverIndicator
|
|
303
|
+
|
|
304
|
+
return (
|
|
305
|
+
/*#__PURE__*/
|
|
306
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
307
|
+
React.createElement(Box, {
|
|
308
|
+
key: index,
|
|
309
|
+
flex: false,
|
|
310
|
+
role: "none"
|
|
311
|
+
}, /*#__PURE__*/React.createElement(Button, _extends({
|
|
312
|
+
ref: function ref(r) {
|
|
313
|
+
buttonRefs.current[index] = r;
|
|
314
|
+
},
|
|
315
|
+
role: "menuitem",
|
|
316
|
+
onFocus: function onFocus() {
|
|
317
|
+
setActiveItemIndex(index);
|
|
318
|
+
},
|
|
319
|
+
active: activeItemIndex === index,
|
|
320
|
+
focusIndicator: false,
|
|
321
|
+
plain: !child ? undefined : true,
|
|
322
|
+
align: "start",
|
|
323
|
+
justify: item.justify,
|
|
324
|
+
kind: !child ? 'option' : undefined,
|
|
325
|
+
hoverIndicator: !child ? undefined : 'background'
|
|
326
|
+
}, !child ? item : _extends({}, item, {
|
|
327
|
+
gap: undefined,
|
|
328
|
+
icon: undefined,
|
|
329
|
+
label: undefined,
|
|
330
|
+
reverse: undefined
|
|
331
|
+
}), {
|
|
332
|
+
onClick: function onClick() {
|
|
333
|
+
if (item.onClick) {
|
|
334
|
+
item.onClick.apply(item, arguments);
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
if (item.close !== false) {
|
|
338
|
+
onDropClose();
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
}), child))
|
|
342
|
+
);
|
|
343
|
+
};
|
|
344
|
+
|
|
345
|
+
var menuContent;
|
|
346
|
+
|
|
347
|
+
if (itemCount && Array.isArray(items[0])) {
|
|
348
|
+
var index = 0;
|
|
349
|
+
menuContent = items.map(function (group, groupIndex) {
|
|
350
|
+
var _theme$menu$group, _theme$menu$group$sep, _theme$menu$group2, _theme$menu$group2$se, _theme$menu$group3;
|
|
351
|
+
|
|
352
|
+
return /*#__PURE__*/React.createElement(Box // eslint-disable-next-line react/no-array-index-key
|
|
353
|
+
, {
|
|
354
|
+
key: groupIndex
|
|
355
|
+
}, groupIndex > 0 && /*#__PURE__*/React.createElement(Box, {
|
|
356
|
+
pad: theme.menu.group.separator.pad
|
|
357
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
358
|
+
border: {
|
|
359
|
+
side: 'top',
|
|
360
|
+
color: (_theme$menu$group = theme.menu.group) == null ? void 0 : (_theme$menu$group$sep = _theme$menu$group.separator) == null ? void 0 : _theme$menu$group$sep.color,
|
|
361
|
+
size: (_theme$menu$group2 = theme.menu.group) == null ? void 0 : (_theme$menu$group2$se = _theme$menu$group2.separator) == null ? void 0 : _theme$menu$group2$se.size
|
|
362
|
+
}
|
|
363
|
+
})), /*#__PURE__*/React.createElement(Box, (_theme$menu$group3 = theme.menu.group) == null ? void 0 : _theme$menu$group3.container, group.map(function (item) {
|
|
364
|
+
// item index needs to be its index in the entire menu as if
|
|
365
|
+
// it were a flat array
|
|
366
|
+
var currentIndex = index;
|
|
367
|
+
index += 1;
|
|
368
|
+
return menuItem(item, currentIndex);
|
|
369
|
+
})));
|
|
370
|
+
});
|
|
371
|
+
} else menuContent = items.map(function (item, index) {
|
|
372
|
+
return menuItem(item, index);
|
|
373
|
+
});
|
|
374
|
+
|
|
279
375
|
return /*#__PURE__*/React.createElement(Keyboard, {
|
|
280
376
|
onDown: onDropOpen,
|
|
281
377
|
onUp: onDropOpen,
|
|
@@ -286,7 +382,7 @@ var Menu = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
286
382
|
}, /*#__PURE__*/React.createElement(DropButton, _extends({
|
|
287
383
|
ref: ref
|
|
288
384
|
}, rest, buttonProps, {
|
|
289
|
-
a11yTitle:
|
|
385
|
+
a11yTitle: a11y || format({
|
|
290
386
|
id: 'menu.openMenu',
|
|
291
387
|
messages: messages
|
|
292
388
|
}),
|
|
@@ -314,58 +410,8 @@ var Menu = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
314
410
|
}, alignControlMirror === 'top' && align.top === 'top' ? controlMirror : undefined, /*#__PURE__*/React.createElement(Box, {
|
|
315
411
|
overflow: "auto",
|
|
316
412
|
role: "menu",
|
|
317
|
-
a11yTitle:
|
|
318
|
-
},
|
|
319
|
-
// Determine whether the label is done as a child or
|
|
320
|
-
// as an option Button kind property.
|
|
321
|
-
var child = !theme.button.option ? /*#__PURE__*/React.createElement(Box, {
|
|
322
|
-
align: "start",
|
|
323
|
-
pad: "small",
|
|
324
|
-
direction: "row",
|
|
325
|
-
gap: item.gap,
|
|
326
|
-
justify: item.justify
|
|
327
|
-
}, item.reverse && item.label, item.icon, !item.reverse && item.label) : undefined; // if we have a child, turn on plain, and hoverIndicator
|
|
328
|
-
|
|
329
|
-
return (
|
|
330
|
-
/*#__PURE__*/
|
|
331
|
-
// eslint-disable-next-line react/no-array-index-key
|
|
332
|
-
React.createElement(Box, {
|
|
333
|
-
key: index,
|
|
334
|
-
flex: false,
|
|
335
|
-
role: "none"
|
|
336
|
-
}, /*#__PURE__*/React.createElement(Button, _extends({
|
|
337
|
-
ref: function ref(r) {
|
|
338
|
-
buttonRefs.current[index] = r;
|
|
339
|
-
},
|
|
340
|
-
role: "menuitem",
|
|
341
|
-
onFocus: function onFocus() {
|
|
342
|
-
setActiveItemIndex(index);
|
|
343
|
-
},
|
|
344
|
-
active: activeItemIndex === index,
|
|
345
|
-
focusIndicator: false,
|
|
346
|
-
plain: !child ? undefined : true,
|
|
347
|
-
align: "start",
|
|
348
|
-
justify: item.justify,
|
|
349
|
-
kind: !child ? 'option' : undefined,
|
|
350
|
-
hoverIndicator: !child ? undefined : 'background'
|
|
351
|
-
}, !child ? item : _extends({}, item, {
|
|
352
|
-
gap: undefined,
|
|
353
|
-
icon: undefined,
|
|
354
|
-
label: undefined,
|
|
355
|
-
reverse: undefined
|
|
356
|
-
}), {
|
|
357
|
-
onClick: function onClick() {
|
|
358
|
-
if (item.onClick) {
|
|
359
|
-
item.onClick.apply(item, arguments);
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
if (item.close !== false) {
|
|
363
|
-
onDropClose();
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
}), child))
|
|
367
|
-
);
|
|
368
|
-
})), !initialAlignTop && (alignControlMirror === 'bottom' || align.bottom === 'bottom') ? controlMirror : undefined))
|
|
413
|
+
a11yTitle: a11y
|
|
414
|
+
}, menuContent), !initialAlignTop && (alignControlMirror === 'bottom' || align.bottom === 'bottom') ? controlMirror : undefined))
|
|
369
415
|
}), content));
|
|
370
416
|
});
|
|
371
417
|
Menu.defaultProps = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { DropProps } from '../Drop';
|
|
3
|
-
import { ButtonType } from '../Button';
|
|
3
|
+
import { ButtonProps, ButtonType } from '../Button';
|
|
4
4
|
import {
|
|
5
5
|
A11yTitleType,
|
|
6
6
|
AlignSelfType,
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
export interface MenuProps {
|
|
14
14
|
a11yTitle?: A11yTitleType;
|
|
15
15
|
alignSelf?: AlignSelfType;
|
|
16
|
+
children?: Function | React.ReactNode;
|
|
16
17
|
disabled?: boolean;
|
|
17
18
|
dropAlign?: {
|
|
18
19
|
top?: 'top' | 'bottom';
|
|
@@ -30,7 +31,7 @@ export interface MenuProps {
|
|
|
30
31
|
dropProps?: DropProps;
|
|
31
32
|
gridArea?: GridAreaType;
|
|
32
33
|
icon?: boolean | React.ReactNode;
|
|
33
|
-
items:
|
|
34
|
+
items: ButtonProps[] | ButtonProps[][];
|
|
34
35
|
justifyContent?: JustifyContentType;
|
|
35
36
|
label?: string | React.ReactNode;
|
|
36
37
|
margin?: MarginType;
|
|
@@ -41,7 +42,7 @@ export interface MenuProps {
|
|
|
41
42
|
|
|
42
43
|
export interface MenuExtendedProps
|
|
43
44
|
extends MenuProps,
|
|
44
|
-
Omit<ButtonType, 'icon' | 'size'> {}
|
|
45
|
+
Omit<ButtonType, 'icon' | 'size' | 'children'> {}
|
|
45
46
|
|
|
46
47
|
declare const Menu: React.FC<MenuExtendedProps>;
|
|
47
48
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { genericProps } from '../../utils/general-prop-types';
|
|
@@ -24,7 +24,7 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
24
24
|
dropProps: PropTypes.object,
|
|
25
25
|
justifyContent: PropTypes.oneOf(['start', 'center', 'end', 'between', 'around', 'stretch']),
|
|
26
26
|
icon: PropTypes.oneOfType([PropTypes.bool, PropTypes.node]),
|
|
27
|
-
items: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
27
|
+
items: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.object), PropTypes.arrayOf(PropTypes.arrayOf(PropTypes.object))]).isRequired,
|
|
28
28
|
label: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
|
29
29
|
messages: PropTypes.shape({
|
|
30
30
|
closeMenu: PropTypes.string,
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Box, Menu } from 'grommet';
|
|
3
|
+
export var Grouped = function Grouped() {
|
|
4
|
+
return (
|
|
5
|
+
/*#__PURE__*/
|
|
6
|
+
// Uncomment <Grommet> lines when using outside of storybook
|
|
7
|
+
// <Grommet theme={...}>
|
|
8
|
+
React.createElement(Box, {
|
|
9
|
+
align: "center",
|
|
10
|
+
pad: "large"
|
|
11
|
+
}, /*#__PURE__*/React.createElement(Menu, {
|
|
12
|
+
dropProps: {
|
|
13
|
+
align: {
|
|
14
|
+
top: 'bottom',
|
|
15
|
+
left: 'left'
|
|
16
|
+
},
|
|
17
|
+
elevation: 'xlarge'
|
|
18
|
+
},
|
|
19
|
+
label: "Grouped Menu",
|
|
20
|
+
items: [[{
|
|
21
|
+
label: 'View Details'
|
|
22
|
+
}, {
|
|
23
|
+
label: 'Edit Permissions'
|
|
24
|
+
}, {
|
|
25
|
+
label: 'Update Password'
|
|
26
|
+
}], [{
|
|
27
|
+
label: 'Delete'
|
|
28
|
+
}]]
|
|
29
|
+
})) // </Grommet>
|
|
30
|
+
|
|
31
|
+
);
|
|
32
|
+
};
|
|
33
|
+
Grouped.parameters = {
|
|
34
|
+
chromatic: {
|
|
35
|
+
disable: true
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
export default {
|
|
39
|
+
title: 'Controls/Menu/Grouped'
|
|
40
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var _excluded = ["background", "max", "round", "size", "thickness", "direction", "values"],
|
|
2
2
|
_excluded2 = ["color", "highlight", "label", "onHover", "value"];
|
|
3
3
|
|
|
4
|
-
function _extends() { _extends = Object.assign
|
|
4
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
5
5
|
|
|
6
6
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var _excluded = ["background", "max", "round", "size", "thickness", "type", "values"],
|
|
2
2
|
_excluded2 = ["color", "highlight", "label", "onHover", "value"];
|
|
3
3
|
|
|
4
|
-
function _extends() { _extends = Object.assign
|
|
4
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
5
5
|
|
|
6
6
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
7
7
|
|
|
@@ -26,8 +26,10 @@ var Circle = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
26
26
|
var strokeWidth = type === 'pie' ? width / 2 : parseMetricToNum(theme.global.edgeSize[thickness] || thickness);
|
|
27
27
|
var centerX = width / 2;
|
|
28
28
|
var centerY = width / 2;
|
|
29
|
-
var radius = width / 2 - strokeWidth / 2;
|
|
30
|
-
|
|
29
|
+
var radius = width / 2 - strokeWidth / 2; // truncate to avoid floating point arithmetic errors
|
|
30
|
+
// see: https://github.com/grommet/grommet/issues/6190
|
|
31
|
+
|
|
32
|
+
var anglePer = Math.floor((type === 'semicircle' ? 180 : 360) / max * 10000) / 10000;
|
|
31
33
|
var someHighlight = (values || []).some(function (v) {
|
|
32
34
|
return v.highlight;
|
|
33
35
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var _excluded = ["background", "color", "direction", "size", "thickness", "type", "value", "values"];
|
|
2
2
|
|
|
3
|
-
function _extends() { _extends = Object.assign
|
|
3
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
|
|
5
5
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
6
6
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { genericProps } from '../../utils/general-prop-types';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var _excluded = ["align", "layout", "nameProps", "pairProps", "valueProps"];
|
|
2
2
|
|
|
3
|
-
function _extends() { _extends = Object.assign
|
|
3
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
|
|
5
5
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
6
6
|
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { AlignType, WidthType } from '../../utils';
|
|
3
|
+
import { GridProps } from '../Grid';
|
|
3
4
|
export interface NameValueListProps {
|
|
4
5
|
align?: AlignType;
|
|
6
|
+
children?: React.ReactNode;
|
|
5
7
|
layout?: 'column' | 'grid';
|
|
6
8
|
nameProps?: {
|
|
7
9
|
align?: AlignType;
|
|
@@ -17,8 +19,9 @@ export interface NameValueListProps {
|
|
|
17
19
|
}
|
|
18
20
|
export interface NameValueListExtendedProps
|
|
19
21
|
extends NameValueListProps,
|
|
22
|
+
GridProps,
|
|
20
23
|
Omit<JSX.IntrinsicElements['dl'], keyof NameValueListProps> {}
|
|
21
24
|
|
|
22
|
-
declare const NameValueList: React.FC<
|
|
25
|
+
declare const NameValueList: React.FC<NameValueListExtendedProps>;
|
|
23
26
|
|
|
24
27
|
export { NameValueList };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
3
|
import React, { Fragment, useContext } from 'react';
|
|
4
4
|
import { ThemeContext } from 'styled-components';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { Box } from '../Box';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var _excluded = ["label"];
|
|
2
2
|
|
|
3
|
-
function _extends() { _extends = Object.assign
|
|
3
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
|
|
5
5
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var _excluded = ["label"];
|
|
2
2
|
|
|
3
|
-
function _extends() { _extends = Object.assign
|
|
3
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
|
|
5
5
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
6
6
|
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
var _excluded = ["actions", "message", "onClose", "id", "global", "status", "title", "toast"];
|
|
2
|
+
|
|
3
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
|
+
|
|
5
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
2
6
|
|
|
3
7
|
import React, { useCallback, useContext, useEffect, useState, useMemo, Fragment } from 'react';
|
|
4
8
|
import styled, { ThemeContext } from 'styled-components';
|
|
@@ -54,7 +58,7 @@ var NotificationAnchor = styled(Anchor).withConfig({
|
|
|
54
58
|
})(["white-space:nowrap;"]);
|
|
55
59
|
|
|
56
60
|
var Notification = function Notification(_ref) {
|
|
57
|
-
var _theme$notification, _theme$
|
|
61
|
+
var _theme$notification, _theme$notification2, _theme$notification2$, _theme$notification2$2, _theme$notification3, _theme$notification3$, _theme$notification4, _theme$notification4$, _theme$notification4$2;
|
|
58
62
|
|
|
59
63
|
var actionsProp = _ref.actions,
|
|
60
64
|
messageProp = _ref.message,
|
|
@@ -63,7 +67,9 @@ var Notification = function Notification(_ref) {
|
|
|
63
67
|
global = _ref.global,
|
|
64
68
|
status = _ref.status,
|
|
65
69
|
title = _ref.title,
|
|
66
|
-
toast = _ref.toast
|
|
70
|
+
toast = _ref.toast,
|
|
71
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
72
|
+
|
|
67
73
|
var autoClose = toast && (toast == null ? void 0 : toast.autoClose) === undefined ? true : toast.autoClose;
|
|
68
74
|
var theme = useContext(ThemeContext) || defaultProps.theme;
|
|
69
75
|
|
|
@@ -89,9 +95,11 @@ var Notification = function Notification(_ref) {
|
|
|
89
95
|
return undefined;
|
|
90
96
|
}, [autoClose, close, theme.notification.toast.time, theme.notification.time]);
|
|
91
97
|
var CloseIcon = theme.notification.close.icon;
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
98
|
+
|
|
99
|
+
var _ref2 = ((_theme$notification = theme.notification) == null ? void 0 : _theme$notification[status]) || theme.notification.unknown,
|
|
100
|
+
StatusIcon = _ref2.icon,
|
|
101
|
+
color = _ref2.color;
|
|
102
|
+
|
|
95
103
|
var closeIconColor = theme.notification.close.color;
|
|
96
104
|
var kind = useMemo(function () {
|
|
97
105
|
if (toast) return 'toast';
|
|
@@ -101,7 +109,7 @@ var Notification = function Notification(_ref) {
|
|
|
101
109
|
var direction;
|
|
102
110
|
if (kind && theme.notification[kind].direction) direction = theme.notification[kind].direction;else direction = theme.notification.direction;
|
|
103
111
|
var background;
|
|
104
|
-
if (kind && (_theme$
|
|
112
|
+
if (kind && (_theme$notification2 = theme.notification) != null && (_theme$notification2$ = _theme$notification2[status]) != null && (_theme$notification2$2 = _theme$notification2$[kind]) != null && _theme$notification2$2.background) background = theme.notification[status][kind].background;else if ((_theme$notification3 = theme.notification) != null && (_theme$notification3$ = _theme$notification3[status]) != null && _theme$notification3$.background) background = theme.notification[status].background;else background = ((_theme$notification4 = theme.notification) == null ? void 0 : (_theme$notification4$ = _theme$notification4[kind]) == null ? void 0 : (_theme$notification4$2 = _theme$notification4$.container) == null ? void 0 : _theme$notification4$2.background) || theme.notification.container.background;
|
|
105
113
|
var TextWrapper = direction === 'row' ? Text : Fragment; // notification is built with two child boxes that contain:
|
|
106
114
|
// 1. icon + text (wrapped in button when clickable)
|
|
107
115
|
// 2. close button
|
|
@@ -144,8 +152,9 @@ var Notification = function Notification(_ref) {
|
|
|
144
152
|
,
|
|
145
153
|
pad: undefined,
|
|
146
154
|
direction: "row",
|
|
147
|
-
gap: "small"
|
|
148
|
-
|
|
155
|
+
gap: "small",
|
|
156
|
+
id: toast ? undefined : id
|
|
157
|
+
}, rest), /*#__PURE__*/React.createElement(Box, {
|
|
149
158
|
direction: "row",
|
|
150
159
|
pad: textPad,
|
|
151
160
|
flex: true
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { LayerPositionType } from '../Layer';
|
|
3
3
|
import { AnchorType } from '..';
|
|
4
|
-
export type StatusType = 'critical' | 'warning' | 'normal' | 'unknown';
|
|
4
|
+
export type StatusType = 'critical' | 'warning' | 'normal' | 'info' | 'unknown';
|
|
5
5
|
|
|
6
6
|
export interface NotificationProps {
|
|
7
7
|
actions?: AnchorType[];
|
|
8
|
+
global?: boolean;
|
|
8
9
|
title?: string;
|
|
9
10
|
message?: string;
|
|
10
11
|
status?: StatusType;
|
|
@@ -5,9 +5,10 @@ var PropType = {};
|
|
|
5
5
|
if (process.env.NODE_ENV !== 'production') {
|
|
6
6
|
PropType = {
|
|
7
7
|
actions: PropTypes.arrayOf(PropTypes.shape(AnchorPropTypes)),
|
|
8
|
+
global: PropTypes.bool,
|
|
8
9
|
title: PropTypes.string,
|
|
9
10
|
message: PropTypes.string,
|
|
10
|
-
status: PropTypes.oneOf(['critical', 'warning', 'normal', 'unknown']),
|
|
11
|
+
status: PropTypes.oneOf(['critical', 'warning', 'normal', 'info', 'unknown']),
|
|
11
12
|
toast: PropTypes.oneOfType([PropTypes.bool, PropTypes.shape({
|
|
12
13
|
autoClose: PropTypes.bool,
|
|
13
14
|
position: PropTypes.oneOf(['bottom', 'bottom-left', 'bottom-right', 'center', 'end', 'hidden', 'left', 'right', 'start', 'top', 'top-left', 'top-right'])
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var _excluded = ["kind"];
|
|
2
2
|
|
|
3
|
-
function _extends() { _extends = Object.assign
|
|
3
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
|
|
5
5
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
6
6
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { BoxExtendedProps } from '../Box/index';
|
|
3
3
|
|
|
4
4
|
export interface PageProps {
|
|
5
5
|
kind?: 'wide' | 'narrow' | 'full' | string;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
export interface PageExtendedProps extends PageProps,
|
|
8
|
+
export interface PageExtendedProps extends PageProps, BoxExtendedProps {}
|
|
9
9
|
|
|
10
10
|
declare const Page: React.FC<PageExtendedProps>;
|
|
11
11
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var _excluded = ["children", "background"];
|
|
2
2
|
|
|
3
|
-
function _extends() { _extends = Object.assign
|
|
3
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
|
|
5
5
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
6
6
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { BoxExtendedProps } from '../Box/index';
|
|
3
3
|
import { BackgroundObject } from '../../utils';
|
|
4
4
|
|
|
5
5
|
type PageBackground = BackgroundObject & {
|
|
@@ -12,7 +12,7 @@ export interface PageContentProps {
|
|
|
12
12
|
|
|
13
13
|
export interface PageContentExtendedProps
|
|
14
14
|
extends PageContentProps,
|
|
15
|
-
Omit<
|
|
15
|
+
Omit<BoxExtendedProps, 'background'> {}
|
|
16
16
|
|
|
17
17
|
declare const PageContent: React.FC<PageContentExtendedProps>;
|
|
18
18
|
|