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
|
@@ -23,11 +23,15 @@ var _Text = require("../Text");
|
|
|
23
23
|
|
|
24
24
|
var _propTypes = require("./propTypes");
|
|
25
25
|
|
|
26
|
+
var _excluded = ["actions", "message", "onClose", "id", "global", "status", "title", "toast"];
|
|
27
|
+
|
|
26
28
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
27
29
|
|
|
28
30
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
29
31
|
|
|
30
|
-
function _extends() { _extends = Object.assign
|
|
32
|
+
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); }
|
|
33
|
+
|
|
34
|
+
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; }
|
|
31
35
|
|
|
32
36
|
var adaptThemeStyle = function adaptThemeStyle(value, theme) {
|
|
33
37
|
var textStyle = value;
|
|
@@ -72,7 +76,7 @@ var NotificationAnchor = (0, _styledComponents["default"])(_Anchor.Anchor).withC
|
|
|
72
76
|
})(["white-space:nowrap;"]);
|
|
73
77
|
|
|
74
78
|
var Notification = function Notification(_ref) {
|
|
75
|
-
var _theme$notification, _theme$
|
|
79
|
+
var _theme$notification, _theme$notification2, _theme$notification2$, _theme$notification2$2, _theme$notification3, _theme$notification3$, _theme$notification4, _theme$notification4$, _theme$notification4$2;
|
|
76
80
|
|
|
77
81
|
var actionsProp = _ref.actions,
|
|
78
82
|
messageProp = _ref.message,
|
|
@@ -81,7 +85,9 @@ var Notification = function Notification(_ref) {
|
|
|
81
85
|
global = _ref.global,
|
|
82
86
|
status = _ref.status,
|
|
83
87
|
title = _ref.title,
|
|
84
|
-
toast = _ref.toast
|
|
88
|
+
toast = _ref.toast,
|
|
89
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
90
|
+
|
|
85
91
|
var autoClose = toast && (toast == null ? void 0 : toast.autoClose) === undefined ? true : toast.autoClose;
|
|
86
92
|
|
|
87
93
|
var theme = (0, _react.useContext)(_styledComponents.ThemeContext) || _defaultProps.defaultProps.theme;
|
|
@@ -108,9 +114,11 @@ var Notification = function Notification(_ref) {
|
|
|
108
114
|
return undefined;
|
|
109
115
|
}, [autoClose, close, theme.notification.toast.time, theme.notification.time]);
|
|
110
116
|
var CloseIcon = theme.notification.close.icon;
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
117
|
+
|
|
118
|
+
var _ref2 = ((_theme$notification = theme.notification) == null ? void 0 : _theme$notification[status]) || theme.notification.unknown,
|
|
119
|
+
StatusIcon = _ref2.icon,
|
|
120
|
+
color = _ref2.color;
|
|
121
|
+
|
|
114
122
|
var closeIconColor = theme.notification.close.color;
|
|
115
123
|
var kind = (0, _react.useMemo)(function () {
|
|
116
124
|
if (toast) return 'toast';
|
|
@@ -120,7 +128,7 @@ var Notification = function Notification(_ref) {
|
|
|
120
128
|
var direction;
|
|
121
129
|
if (kind && theme.notification[kind].direction) direction = theme.notification[kind].direction;else direction = theme.notification.direction;
|
|
122
130
|
var background;
|
|
123
|
-
if (kind && (_theme$
|
|
131
|
+
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;
|
|
124
132
|
var TextWrapper = direction === 'row' ? _Text.Text : _react.Fragment; // notification is built with two child boxes that contain:
|
|
125
133
|
// 1. icon + text (wrapped in button when clickable)
|
|
126
134
|
// 2. close button
|
|
@@ -164,8 +172,9 @@ var Notification = function Notification(_ref) {
|
|
|
164
172
|
,
|
|
165
173
|
pad: undefined,
|
|
166
174
|
direction: "row",
|
|
167
|
-
gap: "small"
|
|
168
|
-
|
|
175
|
+
gap: "small",
|
|
176
|
+
id: toast ? undefined : id
|
|
177
|
+
}, rest), /*#__PURE__*/_react["default"].createElement(_Box.Box, {
|
|
169
178
|
direction: "row",
|
|
170
179
|
pad: textPad,
|
|
171
180
|
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;
|
|
@@ -14,9 +14,10 @@ var PropType = {};
|
|
|
14
14
|
if (process.env.NODE_ENV !== 'production') {
|
|
15
15
|
PropType = {
|
|
16
16
|
actions: _propTypes["default"].arrayOf(_propTypes["default"].shape(_propTypes2.AnchorPropTypes)),
|
|
17
|
+
global: _propTypes["default"].bool,
|
|
17
18
|
title: _propTypes["default"].string,
|
|
18
19
|
message: _propTypes["default"].string,
|
|
19
|
-
status: _propTypes["default"].oneOf(['critical', 'warning', 'normal', 'unknown']),
|
|
20
|
+
status: _propTypes["default"].oneOf(['critical', 'warning', 'normal', 'info', 'unknown']),
|
|
20
21
|
toast: _propTypes["default"].oneOfType([_propTypes["default"].bool, _propTypes["default"].shape({
|
|
21
22
|
autoClose: _propTypes["default"].bool,
|
|
22
23
|
position: _propTypes["default"].oneOf(['bottom', 'bottom-left', 'bottom-right', 'center', 'end', 'hidden', 'left', 'right', 'start', 'top', 'top-left', 'top-right'])
|
package/components/Page/Page.js
CHANGED
|
@@ -21,7 +21,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
21
21
|
|
|
22
22
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
23
|
|
|
24
|
-
function _extends() { _extends = Object.assign
|
|
24
|
+
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); }
|
|
25
25
|
|
|
26
26
|
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; }
|
|
27
27
|
|
|
@@ -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
|
|
|
@@ -17,7 +17,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
17
17
|
|
|
18
18
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
19
19
|
|
|
20
|
-
function _extends() { _extends = Object.assign
|
|
20
|
+
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); }
|
|
21
21
|
|
|
22
22
|
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; }
|
|
23
23
|
|
|
@@ -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
|
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.PageHeader = void 0;
|
|
5
|
+
|
|
6
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
7
|
+
|
|
8
|
+
var _styledComponents = require("styled-components");
|
|
9
|
+
|
|
10
|
+
var _Box = require("../Box");
|
|
11
|
+
|
|
12
|
+
var _Header = require("../Header");
|
|
13
|
+
|
|
14
|
+
var _Heading = require("../Heading");
|
|
15
|
+
|
|
16
|
+
var _Grid = require("../Grid");
|
|
17
|
+
|
|
18
|
+
var _Paragraph = require("../Paragraph");
|
|
19
|
+
|
|
20
|
+
var _ResponsiveContext = require("../../contexts/ResponsiveContext");
|
|
21
|
+
|
|
22
|
+
var _excluded = ["actions", "gridProps", "parent", "responsive", "subtitle", "title"];
|
|
23
|
+
|
|
24
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
25
|
+
|
|
26
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
27
|
+
|
|
28
|
+
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); }
|
|
29
|
+
|
|
30
|
+
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; }
|
|
31
|
+
|
|
32
|
+
var PageHeader = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
33
|
+
var actions = _ref.actions,
|
|
34
|
+
gridPropsProp = _ref.gridProps,
|
|
35
|
+
parent = _ref.parent,
|
|
36
|
+
responsive = _ref.responsive,
|
|
37
|
+
subtitle = _ref.subtitle,
|
|
38
|
+
title = _ref.title,
|
|
39
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
40
|
+
|
|
41
|
+
var theme = (0, _react.useContext)(_styledComponents.ThemeContext);
|
|
42
|
+
var breakpoint = (0, _react.useContext)(_ResponsiveContext.ResponsiveContext);
|
|
43
|
+
|
|
44
|
+
var actionsProps = _extends({}, theme.pageHeader.actions);
|
|
45
|
+
|
|
46
|
+
var gridProps = theme.pageHeader[breakpoint] || theme.pageHeader.medium;
|
|
47
|
+
|
|
48
|
+
if (responsive && theme.pageHeader.responsive.breakpoints.includes(breakpoint)) {
|
|
49
|
+
gridProps = _extends({}, gridProps, theme.pageHeader.responsive);
|
|
50
|
+
actionsProps = _extends({}, actionsProps, theme.pageHeader.responsive.actions);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
var _gridProps = gridProps,
|
|
54
|
+
areas = _gridProps.areas,
|
|
55
|
+
columns = _gridProps.columns,
|
|
56
|
+
gap = _gridProps.gap,
|
|
57
|
+
rows = _gridProps.rows;
|
|
58
|
+
return /*#__PURE__*/_react["default"].createElement(_Header.Header, _extends({
|
|
59
|
+
ref: ref,
|
|
60
|
+
direction: "column",
|
|
61
|
+
gap: "none",
|
|
62
|
+
pad: theme.pageHeader.pad
|
|
63
|
+
}, rest), /*#__PURE__*/_react["default"].createElement(_Grid.Grid, _extends({
|
|
64
|
+
columns: columns,
|
|
65
|
+
rows: rows,
|
|
66
|
+
areas: areas,
|
|
67
|
+
gap: gap,
|
|
68
|
+
fill: "horizontal"
|
|
69
|
+
}, gridPropsProp), /*#__PURE__*/_react["default"].createElement(_Box.Box, _extends({
|
|
70
|
+
gridArea: "parent"
|
|
71
|
+
}, theme.pageHeader.parent), parent), /*#__PURE__*/_react["default"].createElement(_Box.Box, {
|
|
72
|
+
gridArea: "title"
|
|
73
|
+
}, typeof title === 'string' ? /*#__PURE__*/_react["default"].createElement(_Heading.Heading, theme.pageHeader.title, title) : title), /*#__PURE__*/_react["default"].createElement(_Box.Box, {
|
|
74
|
+
gridArea: "subtitle"
|
|
75
|
+
}, typeof subtitle === 'string' ? /*#__PURE__*/_react["default"].createElement(_Paragraph.Paragraph, theme.pageHeader.subtitle, subtitle) : subtitle), /*#__PURE__*/_react["default"].createElement(_Box.Box, _extends({
|
|
76
|
+
gridArea: "actions"
|
|
77
|
+
}, actionsProps), actions)));
|
|
78
|
+
});
|
|
79
|
+
exports.PageHeader = PageHeader;
|
|
80
|
+
PageHeader.displayName = 'PageHeader';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
A11yTitleType,
|
|
4
|
+
AlignSelfType,
|
|
5
|
+
GridAreaType,
|
|
6
|
+
MarginType,
|
|
7
|
+
} from '../../utils';
|
|
8
|
+
|
|
9
|
+
import { GridProps } from '../Grid';
|
|
10
|
+
export interface PageHeaderProps {
|
|
11
|
+
a11yTitle?: A11yTitleType;
|
|
12
|
+
alignSelf?: AlignSelfType;
|
|
13
|
+
gridArea?: GridAreaType;
|
|
14
|
+
margin?: MarginType;
|
|
15
|
+
actions?: JSX.Element;
|
|
16
|
+
gridProps?: GridProps;
|
|
17
|
+
parent?: JSX.Element;
|
|
18
|
+
responsive?: boolean;
|
|
19
|
+
subtitle?: string | JSX.Element;
|
|
20
|
+
title?: string | JSX.Element;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
declare const PageHeader: React.FC<PageHeaderProps>;
|
|
24
|
+
export type PageHeaderType = PageHeaderProps;
|
|
25
|
+
|
|
26
|
+
export { PageHeader };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.PageHeaderPropTypes = void 0;
|
|
5
|
+
|
|
6
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
7
|
+
|
|
8
|
+
var _generalPropTypes = require("../../utils/general-prop-types");
|
|
9
|
+
|
|
10
|
+
var _propTypes2 = require("../Grid/propTypes");
|
|
11
|
+
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
|
+
|
|
14
|
+
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); }
|
|
15
|
+
|
|
16
|
+
var PropType = {};
|
|
17
|
+
|
|
18
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
19
|
+
PropType = _extends({}, _generalPropTypes.genericProps, {
|
|
20
|
+
actions: _propTypes["default"].element,
|
|
21
|
+
gridProps: _propTypes2.GridPropTypes,
|
|
22
|
+
parent: _propTypes["default"].element,
|
|
23
|
+
responsive: _propTypes["default"].bool,
|
|
24
|
+
subtitle: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].element]),
|
|
25
|
+
title: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].element])
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
var PageHeaderPropTypes = PropType;
|
|
30
|
+
exports.PageHeaderPropTypes = PageHeaderPropTypes;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports["default"] = exports.Custom = void 0;
|
|
5
|
+
|
|
6
|
+
var _react = _interopRequireDefault(require("react"));
|
|
7
|
+
|
|
8
|
+
var _grommet = require("grommet");
|
|
9
|
+
|
|
10
|
+
var _utils = require("grommet/utils");
|
|
11
|
+
|
|
12
|
+
var _grommetIcons = require("grommet-icons");
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
|
+
|
|
16
|
+
var customTheme = (0, _utils.deepMerge)(_grommet.grommet, {
|
|
17
|
+
pageHeader: {
|
|
18
|
+
medium: {
|
|
19
|
+
areas: [['parent', 'parent'], ['title', 'null'], ['subtitle', 'null'], ['actions', 'actions']]
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
var Custom = function Custom() {
|
|
25
|
+
return /*#__PURE__*/_react["default"].createElement(_grommet.Grommet, {
|
|
26
|
+
theme: customTheme
|
|
27
|
+
}, /*#__PURE__*/_react["default"].createElement(_grommet.Page, null, /*#__PURE__*/_react["default"].createElement(_grommet.PageContent, null, /*#__PURE__*/_react["default"].createElement(_grommet.PageHeader, {
|
|
28
|
+
title: "Permissions",
|
|
29
|
+
subtitle: "View and assign permissions.",
|
|
30
|
+
actions: /*#__PURE__*/_react["default"].createElement(_grommet.Box, {
|
|
31
|
+
alignSelf: "start"
|
|
32
|
+
}, /*#__PURE__*/_react["default"].createElement(_grommet.Button, {
|
|
33
|
+
label: "Edit",
|
|
34
|
+
primary: true
|
|
35
|
+
})),
|
|
36
|
+
parent: /*#__PURE__*/_react["default"].createElement(_grommet.Anchor, {
|
|
37
|
+
icon: /*#__PURE__*/_react["default"].createElement(_grommetIcons.FormPrevious, null),
|
|
38
|
+
label: "Settings"
|
|
39
|
+
})
|
|
40
|
+
}))));
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
exports.Custom = Custom;
|
|
44
|
+
var _default = {
|
|
45
|
+
title: 'Layout/PageHeader/Custom Themed/Custom'
|
|
46
|
+
};
|
|
47
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports["default"] = exports.MultipleActions = void 0;
|
|
5
|
+
|
|
6
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
7
|
+
|
|
8
|
+
var _grommet = require("grommet");
|
|
9
|
+
|
|
10
|
+
var _grommetIcons = require("grommet-icons");
|
|
11
|
+
|
|
12
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
|
+
|
|
14
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
|
+
|
|
16
|
+
var actions = [{
|
|
17
|
+
label: 'Get Started',
|
|
18
|
+
primary: true
|
|
19
|
+
}, {
|
|
20
|
+
label: 'Follow',
|
|
21
|
+
secondary: true
|
|
22
|
+
}, {
|
|
23
|
+
label: 'File Issue',
|
|
24
|
+
secondary: true
|
|
25
|
+
}];
|
|
26
|
+
var controls = {
|
|
27
|
+
small: /*#__PURE__*/_react["default"].createElement(_grommet.Menu, {
|
|
28
|
+
dropAlign: {
|
|
29
|
+
top: 'bottom',
|
|
30
|
+
right: 'right'
|
|
31
|
+
},
|
|
32
|
+
items: actions.map(function (action) {
|
|
33
|
+
return {
|
|
34
|
+
label: action.label
|
|
35
|
+
};
|
|
36
|
+
}),
|
|
37
|
+
icon: /*#__PURE__*/_react["default"].createElement(_grommetIcons.More, null)
|
|
38
|
+
}),
|
|
39
|
+
medium: /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_grommet.Button, actions[0]), /*#__PURE__*/_react["default"].createElement(_grommet.Menu, {
|
|
40
|
+
dropAlign: {
|
|
41
|
+
top: 'bottom',
|
|
42
|
+
right: 'right'
|
|
43
|
+
},
|
|
44
|
+
items: actions.slice(1),
|
|
45
|
+
icon: /*#__PURE__*/_react["default"].createElement(_grommetIcons.More, null)
|
|
46
|
+
})),
|
|
47
|
+
large: actions.map(function (action) {
|
|
48
|
+
return /*#__PURE__*/_react["default"].createElement(_grommet.Button, action);
|
|
49
|
+
})
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
var MultipleActions = function MultipleActions() {
|
|
53
|
+
var size = (0, _react.useContext)(_grommet.ResponsiveContext);
|
|
54
|
+
return (
|
|
55
|
+
/*#__PURE__*/
|
|
56
|
+
// Uncomment <Grommet> lines when using outside of storybook
|
|
57
|
+
// <Grommet theme={...}>
|
|
58
|
+
_react["default"].createElement(_grommet.Page, null, /*#__PURE__*/_react["default"].createElement(_grommet.PageContent, null, /*#__PURE__*/_react["default"].createElement(_grommet.PageHeader, {
|
|
59
|
+
title: "Grommet",
|
|
60
|
+
subtitle: "Grommet helps you build responsive and accessible \n mobile-first projects for the web with an easy to use component \n library.",
|
|
61
|
+
actions: /*#__PURE__*/_react["default"].createElement(_grommet.Box, {
|
|
62
|
+
direction: "row",
|
|
63
|
+
gap: "small",
|
|
64
|
+
align: "center"
|
|
65
|
+
}, controls[size]),
|
|
66
|
+
parent: /*#__PURE__*/_react["default"].createElement(_grommet.Anchor, {
|
|
67
|
+
label: "Parent Page"
|
|
68
|
+
})
|
|
69
|
+
}))) // </Grommet>
|
|
70
|
+
|
|
71
|
+
);
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
exports.MultipleActions = MultipleActions;
|
|
75
|
+
MultipleActions.storyName = 'Multiple Actions';
|
|
76
|
+
var _default = {
|
|
77
|
+
title: 'Layout/PageHeader/Multiple Actions'
|
|
78
|
+
};
|
|
79
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports["default"] = exports.Responsive = void 0;
|
|
5
|
+
|
|
6
|
+
var _react = _interopRequireDefault(require("react"));
|
|
7
|
+
|
|
8
|
+
var _grommet = require("grommet");
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
+
|
|
12
|
+
var Responsive = function Responsive() {
|
|
13
|
+
return (
|
|
14
|
+
/*#__PURE__*/
|
|
15
|
+
// Uncomment <Grommet> lines when using outside of storybook
|
|
16
|
+
// <Grommet theme={...}>
|
|
17
|
+
_react["default"].createElement(_grommet.Page, null, /*#__PURE__*/_react["default"].createElement(_grommet.PageContent, null, /*#__PURE__*/_react["default"].createElement(_grommet.PageHeader, {
|
|
18
|
+
title: "Grommet",
|
|
19
|
+
subtitle: "Responsive allows PageHeader layout to switch to a \n single column at responsive breakpoints specified in the theme.",
|
|
20
|
+
actions: /*#__PURE__*/_react["default"].createElement(_grommet.Button, {
|
|
21
|
+
label: "Get Started",
|
|
22
|
+
primary: true
|
|
23
|
+
}),
|
|
24
|
+
parent: /*#__PURE__*/_react["default"].createElement(_grommet.Anchor, {
|
|
25
|
+
label: "Parent Page"
|
|
26
|
+
}),
|
|
27
|
+
responsive: true
|
|
28
|
+
}))) // </Grommet>
|
|
29
|
+
|
|
30
|
+
);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
exports.Responsive = Responsive;
|
|
34
|
+
var _default = {
|
|
35
|
+
title: 'Layout/PageHeader/Responsive'
|
|
36
|
+
};
|
|
37
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports["default"] = exports.Simple = void 0;
|
|
5
|
+
|
|
6
|
+
var _react = _interopRequireDefault(require("react"));
|
|
7
|
+
|
|
8
|
+
var _grommet = require("grommet");
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
+
|
|
12
|
+
var Simple = function Simple() {
|
|
13
|
+
return (
|
|
14
|
+
/*#__PURE__*/
|
|
15
|
+
// Uncomment <Grommet> lines when using outside of storybook
|
|
16
|
+
// <Grommet theme={...}>
|
|
17
|
+
_react["default"].createElement(_grommet.Page, null, /*#__PURE__*/_react["default"].createElement(_grommet.PageContent, null, /*#__PURE__*/_react["default"].createElement(_grommet.PageHeader, {
|
|
18
|
+
title: "Grommet",
|
|
19
|
+
subtitle: "Grommet helps you build responsive and accessible \n mobile-first projects for the web with an easy to use component \n library.",
|
|
20
|
+
actions: /*#__PURE__*/_react["default"].createElement(_grommet.Button, {
|
|
21
|
+
label: "Get Started",
|
|
22
|
+
primary: true
|
|
23
|
+
}),
|
|
24
|
+
parent: /*#__PURE__*/_react["default"].createElement(_grommet.Anchor, {
|
|
25
|
+
label: "Parent Page"
|
|
26
|
+
})
|
|
27
|
+
}))) // </Grommet>
|
|
28
|
+
|
|
29
|
+
);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
exports.Simple = Simple;
|
|
33
|
+
var _default = {
|
|
34
|
+
title: 'Layout/PageHeader/Simple'
|
|
35
|
+
};
|
|
36
|
+
exports["default"] = _default;
|
|
@@ -15,7 +15,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
15
15
|
|
|
16
16
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
17
|
|
|
18
|
-
function _extends() { _extends = Object.assign
|
|
18
|
+
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); }
|
|
19
19
|
|
|
20
20
|
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; }
|
|
21
21
|
|
|
@@ -23,7 +23,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
23
23
|
|
|
24
24
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
25
25
|
|
|
26
|
-
function _extends() { _extends = Object.assign
|
|
26
|
+
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); }
|
|
27
27
|
|
|
28
28
|
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; }
|
|
29
29
|
|
|
@@ -9,7 +9,7 @@ var _generalPropTypes = require("../../utils/general-prop-types");
|
|
|
9
9
|
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
11
|
|
|
12
|
-
function _extends() { _extends = Object.assign
|
|
12
|
+
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); }
|
|
13
13
|
|
|
14
14
|
var PropType = {};
|
|
15
15
|
|
|
@@ -15,7 +15,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
15
15
|
|
|
16
16
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
17
|
|
|
18
|
-
function _extends() { _extends = Object.assign
|
|
18
|
+
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); }
|
|
19
19
|
|
|
20
20
|
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; }
|
|
21
21
|
|
|
@@ -27,10 +27,16 @@ var fontFamily = (0, _styledComponents.css)(["font-family:", ";"], function (pro
|
|
|
27
27
|
return props.theme.paragraph.font.family;
|
|
28
28
|
});
|
|
29
29
|
|
|
30
|
+
var maxlinesStyle = function maxlinesStyle(props) {
|
|
31
|
+
return props.maxLines && (0, _styledComponents.css)(["display:-webkit-box;-webkit-line-clamp:", ";-webkit-box-orient:vertical;overflow:hidden;"], props.maxLines);
|
|
32
|
+
};
|
|
33
|
+
|
|
30
34
|
var StyledParagraph = _styledComponents["default"].p.withConfig({
|
|
31
35
|
displayName: "StyledParagraph",
|
|
32
36
|
componentId: "sc-tbetod-0"
|
|
33
|
-
})(["", " ", " ", " ", " ", " ", ""], _utils.genericStyles, function (props) {
|
|
37
|
+
})(["", " ", " ", " ", " ", " ", " ", ""], _utils.genericStyles, function (props) {
|
|
38
|
+
return maxlinesStyle(props);
|
|
39
|
+
}, function (props) {
|
|
34
40
|
return sizeStyle(props);
|
|
35
41
|
}, function (props) {
|
|
36
42
|
return props.textAlign && _utils.textAlignStyle;
|
|
@@ -9,7 +9,7 @@ var _generalPropTypes = require("../../utils/general-prop-types");
|
|
|
9
9
|
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
11
|
|
|
12
|
-
function _extends() { _extends = Object.assign
|
|
12
|
+
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); }
|
|
13
13
|
|
|
14
14
|
var PropType = {};
|
|
15
15
|
|
|
@@ -17,6 +17,7 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
17
17
|
PropType = _extends({}, _generalPropTypes.genericProps, {
|
|
18
18
|
color: _generalPropTypes.colorPropType,
|
|
19
19
|
fill: _propTypes["default"].bool,
|
|
20
|
+
maxLines: _propTypes["default"].number,
|
|
20
21
|
responsive: _propTypes["default"].bool,
|
|
21
22
|
size: _propTypes["default"].oneOfType([_propTypes["default"].oneOf(['small', 'medium', 'large', 'xlarge', 'xxlarge']), _propTypes["default"].string]),
|
|
22
23
|
textAlign: _propTypes["default"].oneOf(['start', 'center', 'end', 'justify'])
|