@digigov/react-core 0.20.0-navlist.alpha.3 → 0.20.1
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/Accordion/index.d.ts +1 -1
- package/AccordionControls/index.d.ts +1 -1
- package/AccordionSection/index.d.ts +1 -1
- package/AccordionSectionContent/index.d.ts +1 -1
- package/AccordionSectionHeader/index.d.ts +1 -1
- package/AccordionSectionSummary/index.d.ts +1 -1
- package/AccordionSectionSummaryHeading/index.d.ts +1 -1
- package/Aside/index.d.ts +1 -1
- package/BackLink/index.d.ts +1 -1
- package/Base/index.d.ts +20 -0
- package/Base/index.js +25 -5
- package/Blockquote/index.d.ts +1 -1
- package/Bottom/index.d.ts +1 -1
- package/Breadcrumbs/index.d.ts +1 -1
- package/BreadcrumbsList/index.d.ts +1 -1
- package/BreadcrumbsListItem/index.d.ts +1 -1
- package/BurgerIcon/__snapshots__/index.test.tsx.snap +1 -211
- package/BurgerIcon/index.d.ts +0 -6
- package/BurgerIcon/index.js +2 -3
- package/BurgerIcon/index.test.js +2 -45
- package/Button/index.d.ts +1 -1
- package/ButtonGroup/index.d.ts +1 -1
- package/ButtonLink/index.d.ts +1 -1
- package/CHANGELOG.md +26 -1
- package/CallToAction/index.d.ts +1 -1
- package/Card/index.d.ts +1 -1
- package/CardAction/index.d.ts +1 -1
- package/CardHeading/index.d.ts +1 -1
- package/CardText/index.d.ts +1 -1
- package/Checkbox/index.d.ts +1 -1
- package/CheckboxConditional/index.d.ts +1 -1
- package/CheckboxItem/index.d.ts +1 -1
- package/Confirmation/index.d.ts +1 -1
- package/ConfirmationBody/index.d.ts +1 -1
- package/ConfirmationTitle/index.d.ts +1 -1
- package/Container/index.d.ts +1 -1
- package/CopyrightContainer/index.d.ts +1 -1
- package/DateInputContainer/index.d.ts +1 -1
- package/DateInputItem/index.d.ts +1 -1
- package/Details/index.d.ts +1 -1
- package/DetailsContent/index.d.ts +1 -1
- package/DetailsSummary/index.d.ts +1 -1
- package/ErrorMessage/index.d.ts +1 -1
- package/ErrorSummary/index.d.ts +1 -1
- package/FieldContainer/index.d.ts +1 -1
- package/Fieldset/index.d.ts +1 -1
- package/FieldsetLegend/index.d.ts +1 -1
- package/FileUpload/index.d.ts +1 -1
- package/FileUploadContainer/index.d.ts +1 -1
- package/Footer/index.d.ts +1 -1
- package/FooterContainer/index.d.ts +1 -1
- package/FooterContent/index.d.ts +1 -1
- package/FooterContentLogos/index.d.ts +1 -1
- package/FooterHeading/index.d.ts +1 -1
- package/FooterImage/index.d.ts +1 -1
- package/FooterInlineList/index.d.ts +1 -1
- package/FooterInlineListItem/index.d.ts +1 -1
- package/FooterLink/index.d.ts +1 -1
- package/FooterList/index.d.ts +1 -1
- package/FooterListItem/index.d.ts +1 -1
- package/FooterMeta/index.d.ts +1 -1
- package/FooterMetaItem/index.d.ts +1 -1
- package/FooterNavigation/index.d.ts +1 -1
- package/FooterSection/index.d.ts +1 -1
- package/Form/index.d.ts +1 -1
- package/GlobeIcon/__snapshots__/index.test.tsx.snap +178 -0
- package/GlobeIcon/index.d.ts +22 -0
- package/GlobeIcon/index.js +46 -0
- package/{NavHorizontal → GlobeIcon}/index.test.d.ts +0 -0
- package/GlobeIcon/index.test.js +56 -0
- package/GovGRLogo/index.d.ts +1 -1
- package/Grid/index.d.ts +1 -1
- package/Header/index.d.ts +1 -1
- package/HeaderContent/index.d.ts +1 -1
- package/HeaderLogo/index.d.ts +1 -1
- package/HeaderNavMenuContent/index.d.ts +1 -1
- package/HeaderSecondaryLogo/index.d.ts +1 -1
- package/HeaderSection/index.d.ts +1 -1
- package/HeaderSubtitle/index.d.ts +1 -1
- package/HeaderTitle/index.d.ts +1 -1
- package/Heading/index.d.ts +1 -1
- package/HeadingCaption/index.d.ts +1 -1
- package/HellenicRepublicLogo/index.d.ts +1 -1
- package/Hidden/index.d.ts +1 -1
- package/Hint/index.d.ts +1 -1
- package/LabelContainer/index.d.ts +1 -1
- package/LabelTitle/index.d.ts +1 -1
- package/Layout/index.d.ts +1 -1
- package/LinkBase/index.d.ts +1 -1
- package/List/index.d.ts +1 -1
- package/ListItem/index.d.ts +1 -1
- package/Main/index.d.ts +1 -1
- package/Masthead/__snapshots__/index.test.tsx.snap +2 -2
- package/Masthead/index.d.ts +1 -1
- package/MastheadBody/index.d.ts +1 -1
- package/Nav/__snapshots__/index.test.tsx.snap +33 -0
- package/Nav/index.d.ts +21 -0
- package/{NavHorizontal → Nav}/index.js +10 -8
- package/{NavHorizontalList → Nav}/index.test.d.ts +0 -0
- package/Nav/index.test.js +23 -0
- package/NavList/__snapshots__/index.test.tsx.snap +33 -0
- package/NavList/index.d.ts +20 -0
- package/{NavHorizontalList → NavList}/index.js +10 -8
- package/{NavHorizontalListItem → NavList}/index.test.d.ts +0 -0
- package/NavList/index.test.js +23 -0
- package/{esm/NavHorizontalListItem → NavListItem}/__snapshots__/index.test.tsx.snap +1 -1
- package/NavListItem/index.d.ts +15 -0
- package/{NavHorizontalListItem → NavListItem}/index.js +10 -8
- package/{NavHorizontalListItemButton → NavListItem}/index.test.d.ts +0 -0
- package/NavListItem/index.test.js +15 -0
- package/{esm/NavHorizontalListItemButton → NavListItemButton}/__snapshots__/index.test.tsx.snap +34 -28
- package/NavListItemButton/index.d.ts +22 -0
- package/{NavHorizontalListItemButton → NavListItemButton}/index.js +5 -5
- package/{NavHorizontalListItemLink → NavListItemButton}/index.test.d.ts +0 -0
- package/NavListItemButton/index.test.js +31 -0
- package/{esm/NavHorizontalListItemLink → NavListItemLink}/__snapshots__/index.test.tsx.snap +15 -15
- package/NavListItemLink/index.d.ts +20 -0
- package/{NavHorizontalListItemLink → NavListItemLink}/index.js +5 -5
- package/NavListItemLink/index.test.d.ts +1 -0
- package/NavListItemLink/index.test.js +49 -0
- package/NavMenu/__snapshots__/index.test.tsx.snap +4 -2
- package/NavMenu/index.d.ts +7 -2
- package/NavMenu/index.js +4 -2
- package/NavMenuContainer/__snapshots__/index.test.tsx.snap +1 -0
- package/NavMenuContainer/index.d.ts +6 -1
- package/NavMenuContainer/index.js +4 -1
- package/NavMenuContainerContent/index.d.ts +1 -1
- package/NavMenuContainerContentList/index.d.ts +6 -1
- package/NavMenuContainerContentList/index.js +4 -2
- package/NavMenuContainerContentListItem/index.d.ts +1 -1
- package/NavMenuContainerTitle/__snapshots__/index.test.tsx.snap +1 -0
- package/NavMenuContainerTitle/index.d.ts +6 -1
- package/NavMenuContainerTitle/index.js +6 -3
- package/NavVertical/index.d.ts +1 -1
- package/NavVerticalItem/index.d.ts +2 -2
- package/NormalText/index.d.ts +1 -1
- package/NotificationBannerContainer/index.d.ts +1 -1
- package/NotificationBannerContent/index.d.ts +1 -1
- package/NotificationBannerHeader/index.d.ts +1 -1
- package/NotificationBannerHeading/index.d.ts +1 -1
- package/NotificationBannerLink/index.d.ts +1 -1
- package/PageTitle/index.d.ts +1 -1
- package/PageTitleCaption/index.d.ts +1 -1
- package/PageTitleHeading/index.d.ts +1 -1
- package/PageTitleSection/index.d.ts +1 -1
- package/Paragraph/index.d.ts +1 -1
- package/PhaseBanner/index.d.ts +1 -1
- package/PhaseBannerHeaderContainer/index.d.ts +1 -1
- package/PhaseBannerTag/index.d.ts +1 -1
- package/PhaseBannerText/index.d.ts +1 -1
- package/RadioConditional/index.d.ts +1 -1
- package/RadioContainer/index.d.ts +1 -1
- package/RadioItem/index.d.ts +1 -1
- package/SectionBreak/index.d.ts +1 -1
- package/SelectContainer/index.d.ts +1 -1
- package/SelectOption/index.d.ts +1 -1
- package/SkipLink/index.d.ts +1 -1
- package/SummaryList/index.d.ts +1 -1
- package/SummaryListItem/index.d.ts +1 -1
- package/SummaryListItemAction/index.d.ts +1 -1
- package/SummaryListItemKey/index.d.ts +1 -1
- package/SummaryListItemValue/index.d.ts +1 -1
- package/SvgIcon/index.d.ts +1 -1
- package/Table/index.d.ts +1 -1
- package/TableBody/index.d.ts +1 -1
- package/TableCaption/index.d.ts +1 -1
- package/TableContainer/index.d.ts +1 -1
- package/TableDataCell/index.d.ts +1 -1
- package/TableHead/index.d.ts +1 -1
- package/TableHeadCell/index.d.ts +1 -1
- package/TableNoDataRow/index.d.ts +1 -1
- package/TableRow/index.d.ts +1 -1
- package/Tabs/index.d.ts +1 -1
- package/TabsHeading/index.d.ts +1 -1
- package/TabsList/index.d.ts +1 -1
- package/TabsListItem/index.d.ts +1 -1
- package/TabsPanel/index.d.ts +1 -1
- package/TextArea/index.d.ts +1 -1
- package/TextInput/index.d.ts +1 -1
- package/Top/index.d.ts +1 -1
- package/VisuallyHidden/index.d.ts +1 -1
- package/WarningText/index.d.ts +1 -1
- package/es/Base/index.js +25 -5
- package/es/BurgerIcon/__snapshots__/index.test.tsx.snap +1 -211
- package/es/BurgerIcon/index.js +2 -3
- package/es/BurgerIcon/index.test.js +2 -45
- package/es/GlobeIcon/__snapshots__/index.test.tsx.snap +178 -0
- package/es/GlobeIcon/index.js +30 -0
- package/es/GlobeIcon/index.test.js +50 -0
- package/es/Masthead/__snapshots__/index.test.tsx.snap +2 -2
- package/es/Nav/__snapshots__/index.test.tsx.snap +33 -0
- package/{esm/NavHorizontal → es/Nav}/index.js +8 -6
- package/es/Nav/index.test.js +17 -0
- package/es/NavList/__snapshots__/index.test.tsx.snap +33 -0
- package/{esm/NavHorizontalList → es/NavList}/index.js +8 -6
- package/es/NavList/index.test.js +17 -0
- package/{src/NavHorizontalListItem → es/NavListItem}/__snapshots__/index.test.tsx.snap +1 -1
- package/es/NavListItem/index.js +25 -0
- package/es/NavListItem/index.test.js +9 -0
- package/es/{NavHorizontalListItemButton → NavListItemButton}/__snapshots__/index.test.tsx.snap +34 -28
- package/{esm/NavHorizontalListItemButton → es/NavListItemButton}/index.js +3 -3
- package/es/NavListItemButton/index.test.js +25 -0
- package/{NavHorizontalListItemLink → es/NavListItemLink}/__snapshots__/index.test.tsx.snap +15 -15
- package/es/{NavHorizontalListItemLink → NavListItemLink}/index.js +3 -3
- package/es/NavListItemLink/index.test.js +43 -0
- package/es/NavMenu/__snapshots__/index.test.tsx.snap +4 -2
- package/es/NavMenu/index.js +4 -2
- package/es/NavMenuContainer/__snapshots__/index.test.tsx.snap +1 -0
- package/es/NavMenuContainer/index.js +4 -1
- package/es/NavMenuContainerContentList/index.js +4 -2
- package/es/NavMenuContainerTitle/__snapshots__/index.test.tsx.snap +1 -0
- package/es/NavMenuContainerTitle/index.js +6 -3
- package/es/index.js +6 -5
- package/es/registry.js +12 -10
- package/esm/Base/index.js +25 -5
- package/esm/BurgerIcon/__snapshots__/index.test.tsx.snap +1 -211
- package/esm/BurgerIcon/index.js +2 -3
- package/esm/BurgerIcon/index.test.js +2 -45
- package/esm/GlobeIcon/__snapshots__/index.test.tsx.snap +178 -0
- package/esm/GlobeIcon/index.js +30 -0
- package/esm/GlobeIcon/index.test.js +50 -0
- package/esm/Masthead/__snapshots__/index.test.tsx.snap +2 -2
- package/esm/Nav/__snapshots__/index.test.tsx.snap +33 -0
- package/{es/NavHorizontal → esm/Nav}/index.js +8 -6
- package/esm/Nav/index.test.js +17 -0
- package/esm/NavList/__snapshots__/index.test.tsx.snap +33 -0
- package/{es/NavHorizontalList → esm/NavList}/index.js +8 -6
- package/esm/NavList/index.test.js +17 -0
- package/{NavHorizontalListItem → esm/NavListItem}/__snapshots__/index.test.tsx.snap +1 -1
- package/esm/NavListItem/index.js +25 -0
- package/esm/NavListItem/index.test.js +9 -0
- package/{src/NavHorizontalListItemButton → esm/NavListItemButton}/__snapshots__/index.test.tsx.snap +34 -28
- package/{es/NavHorizontalListItemButton → esm/NavListItemButton}/index.js +3 -3
- package/esm/NavListItemButton/index.test.js +25 -0
- package/{src/NavHorizontalListItemLink → esm/NavListItemLink}/__snapshots__/index.test.tsx.snap +15 -15
- package/esm/{NavHorizontalListItemLink → NavListItemLink}/index.js +3 -3
- package/esm/NavListItemLink/index.test.js +43 -0
- package/esm/NavMenu/__snapshots__/index.test.tsx.snap +4 -2
- package/esm/NavMenu/index.js +4 -2
- package/esm/NavMenuContainer/__snapshots__/index.test.tsx.snap +1 -0
- package/esm/NavMenuContainer/index.js +4 -1
- package/esm/NavMenuContainerContentList/index.js +4 -2
- package/esm/NavMenuContainerTitle/__snapshots__/index.test.tsx.snap +1 -0
- package/esm/NavMenuContainerTitle/index.js +6 -3
- package/esm/index.js +7 -6
- package/esm/registry.js +12 -10
- package/index.d.ts +6 -5
- package/index.js +33 -20
- package/package.json +2 -3
- package/registry.d.ts +6 -5
- package/registry.js +13 -10
- package/src/Base/index.tsx +63 -3
- package/src/BurgerIcon/__snapshots__/index.test.tsx.snap +1 -211
- package/src/BurgerIcon/index.test.tsx +1 -20
- package/src/BurgerIcon/index.tsx +1 -14
- package/src/GlobeIcon/__snapshots__/index.test.tsx.snap +178 -0
- package/src/GlobeIcon/index.test.tsx +27 -0
- package/src/GlobeIcon/index.tsx +53 -0
- package/src/Masthead/__snapshots__/index.test.tsx.snap +2 -2
- package/src/Nav/__snapshots__/index.test.tsx.snap +33 -0
- package/src/Nav/index.test.tsx +12 -0
- package/src/Nav/index.tsx +42 -0
- package/src/NavList/__snapshots__/index.test.tsx.snap +33 -0
- package/src/NavList/index.test.tsx +11 -0
- package/src/NavList/index.tsx +44 -0
- package/{es/NavHorizontalListItem → src/NavListItem}/__snapshots__/index.test.tsx.snap +1 -1
- package/src/NavListItem/index.test.tsx +8 -0
- package/src/NavListItem/index.tsx +37 -0
- package/{NavHorizontalListItemButton → src/NavListItemButton}/__snapshots__/index.test.tsx.snap +34 -28
- package/src/NavListItemButton/index.test.tsx +19 -0
- package/src/{NavHorizontalListItemButton → NavListItemButton}/index.tsx +8 -8
- package/{es/NavHorizontalListItemLink → src/NavListItemLink}/__snapshots__/index.test.tsx.snap +15 -15
- package/src/NavListItemLink/index.test.tsx +37 -0
- package/src/{NavHorizontalListItemLink → NavListItemLink}/index.tsx +7 -7
- package/src/NavMenu/__snapshots__/index.test.tsx.snap +4 -2
- package/src/NavMenu/index.tsx +12 -3
- package/src/NavMenuContainer/__snapshots__/index.test.tsx.snap +1 -0
- package/src/NavMenuContainer/index.tsx +17 -3
- package/src/NavMenuContainerContentList/index.tsx +13 -3
- package/src/NavMenuContainerTitle/__snapshots__/index.test.tsx.snap +1 -0
- package/src/NavMenuContainerTitle/index.tsx +28 -4
- package/src/NavVerticalItem/index.tsx +1 -1
- package/src/index.ts +6 -5
- package/src/registry.js +12 -10
- package/NavHorizontal/__snapshots__/index.test.tsx.snap +0 -33
- package/NavHorizontal/index.d.ts +0 -16
- package/NavHorizontal/index.test.js +0 -23
- package/NavHorizontalList/__snapshots__/index.test.tsx.snap +0 -33
- package/NavHorizontalList/index.d.ts +0 -15
- package/NavHorizontalList/index.test.js +0 -23
- package/NavHorizontalListItem/index.d.ts +0 -10
- package/NavHorizontalListItem/index.test.js +0 -15
- package/NavHorizontalListItemButton/index.d.ts +0 -22
- package/NavHorizontalListItemButton/index.test.js +0 -31
- package/NavHorizontalListItemLink/index.d.ts +0 -20
- package/NavHorizontalListItemLink/index.test.js +0 -49
- package/es/NavHorizontal/__snapshots__/index.test.tsx.snap +0 -33
- package/es/NavHorizontal/index.test.js +0 -17
- package/es/NavHorizontalList/__snapshots__/index.test.tsx.snap +0 -33
- package/es/NavHorizontalList/index.test.js +0 -17
- package/es/NavHorizontalListItem/index.js +0 -23
- package/es/NavHorizontalListItem/index.test.js +0 -9
- package/es/NavHorizontalListItemButton/index.test.js +0 -25
- package/es/NavHorizontalListItemLink/index.test.js +0 -43
- package/esm/NavHorizontal/__snapshots__/index.test.tsx.snap +0 -33
- package/esm/NavHorizontal/index.test.js +0 -17
- package/esm/NavHorizontalList/__snapshots__/index.test.tsx.snap +0 -33
- package/esm/NavHorizontalList/index.test.js +0 -17
- package/esm/NavHorizontalListItem/index.js +0 -23
- package/esm/NavHorizontalListItem/index.test.js +0 -9
- package/esm/NavHorizontalListItemButton/index.test.js +0 -25
- package/esm/NavHorizontalListItemLink/index.test.js +0 -43
- package/src/NavHorizontal/__snapshots__/index.test.tsx.snap +0 -33
- package/src/NavHorizontal/index.test.tsx +0 -12
- package/src/NavHorizontal/index.tsx +0 -35
- package/src/NavHorizontalList/__snapshots__/index.test.tsx.snap +0 -33
- package/src/NavHorizontalList/index.test.tsx +0 -13
- package/src/NavHorizontalList/index.tsx +0 -39
- package/src/NavHorizontalListItem/index.test.tsx +0 -10
- package/src/NavHorizontalListItem/index.tsx +0 -28
- package/src/NavHorizontalListItemButton/index.test.tsx +0 -29
- package/src/NavHorizontalListItemLink/index.test.tsx +0 -45
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`renders the NavList with active prop 1`] = `
|
|
4
|
+
<ForwardRef(NavList)
|
|
5
|
+
active={true}
|
|
6
|
+
>
|
|
7
|
+
<ForwardRef(Base)
|
|
8
|
+
as="ul"
|
|
9
|
+
className="govgr-horizontal-nav__list govgr-horizontal-nav__list--active"
|
|
10
|
+
>
|
|
11
|
+
<ul
|
|
12
|
+
className="govgr-horizontal-nav__list govgr-horizontal-nav__list--active"
|
|
13
|
+
>
|
|
14
|
+
hello
|
|
15
|
+
</ul>
|
|
16
|
+
</ForwardRef(Base)>
|
|
17
|
+
</ForwardRef(NavList)>
|
|
18
|
+
`;
|
|
19
|
+
|
|
20
|
+
exports[`renders the NavList with no props 1`] = `
|
|
21
|
+
<ForwardRef(NavList)>
|
|
22
|
+
<ForwardRef(Base)
|
|
23
|
+
as="ul"
|
|
24
|
+
className="govgr-horizontal-nav__list"
|
|
25
|
+
>
|
|
26
|
+
<ul
|
|
27
|
+
className="govgr-horizontal-nav__list"
|
|
28
|
+
>
|
|
29
|
+
hello
|
|
30
|
+
</ul>
|
|
31
|
+
</ForwardRef(Base)>
|
|
32
|
+
</ForwardRef(NavList)>
|
|
33
|
+
`;
|
|
@@ -1,25 +1,27 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["className", "active", "children"];
|
|
3
|
+
var _excluded = ["className", "active", "layout", "children"];
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import Base from '@digigov/react-core/Base';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
10
|
-
* This component has a list of
|
|
9
|
+
* NavList must be inside the Nav.
|
|
10
|
+
* This component has a list of NavListItem component inside.
|
|
11
11
|
*/
|
|
12
|
-
export var
|
|
12
|
+
export var NavList = /*#__PURE__*/React.forwardRef(function NavList(_ref, ref) {
|
|
13
13
|
var className = _ref.className,
|
|
14
14
|
_ref$active = _ref.active,
|
|
15
15
|
active = _ref$active === void 0 ? false : _ref$active,
|
|
16
|
+
_ref$layout = _ref.layout,
|
|
17
|
+
layout = _ref$layout === void 0 ? 'horizontal' : _ref$layout,
|
|
16
18
|
children = _ref.children,
|
|
17
19
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
18
20
|
|
|
19
21
|
return /*#__PURE__*/React.createElement(Base, _extends({
|
|
20
22
|
as: "ul",
|
|
21
23
|
ref: ref,
|
|
22
|
-
className: clsx(className,
|
|
24
|
+
className: clsx(className, layout === 'horizontal' && 'govgr-horizontal-nav__list', layout === 'vertical' && 'govgr-vertical-nav__list', active && 'govgr-horizontal-nav__list--active')
|
|
23
25
|
}, props), children);
|
|
24
26
|
});
|
|
25
|
-
export default
|
|
27
|
+
export default NavList;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { mount } from 'enzyme';
|
|
3
|
+
import NavList from '@digigov/react-core/NavList';
|
|
4
|
+
|
|
5
|
+
var _ref = /*#__PURE__*/React.createElement(NavList, null, "hello");
|
|
6
|
+
|
|
7
|
+
it('renders the NavList with no props', function () {
|
|
8
|
+
expect(mount(_ref)).toMatchSnapshot();
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
var _ref2 = /*#__PURE__*/React.createElement(NavList, {
|
|
12
|
+
active: true
|
|
13
|
+
}, "hello");
|
|
14
|
+
|
|
15
|
+
it('renders the NavList with active prop', function () {
|
|
16
|
+
expect(mount(_ref2)).toMatchSnapshot();
|
|
17
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["className", "layout", "children"];
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import Base from '@digigov/react-core/Base';
|
|
6
|
+
import clsx from 'clsx';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* NavListItem must be inside the NavList.
|
|
10
|
+
* This component has a items of NavListItemLink component inside.
|
|
11
|
+
*/
|
|
12
|
+
export var NavListItem = /*#__PURE__*/React.forwardRef(function NavHeaderListItem(_ref, ref) {
|
|
13
|
+
var className = _ref.className,
|
|
14
|
+
_ref$layout = _ref.layout,
|
|
15
|
+
layout = _ref$layout === void 0 ? 'horizontal' : _ref$layout,
|
|
16
|
+
children = _ref.children,
|
|
17
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
18
|
+
|
|
19
|
+
return /*#__PURE__*/React.createElement(Base, _extends({
|
|
20
|
+
as: "li",
|
|
21
|
+
ref: ref,
|
|
22
|
+
className: clsx(className, layout === 'horizontal' && 'govgr-horizontal-nav__list-item', layout === 'vertical' && 'govgr-vertical-nav__list-item')
|
|
23
|
+
}, props), children);
|
|
24
|
+
});
|
|
25
|
+
export default NavListItem;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { mount } from 'enzyme';
|
|
3
|
+
import NavListItem from '@digigov/react-core/NavListItem';
|
|
4
|
+
|
|
5
|
+
var _ref = /*#__PURE__*/React.createElement(NavListItem, null, "hello");
|
|
6
|
+
|
|
7
|
+
it('renders the NavListItem with no props', function () {
|
|
8
|
+
expect(mount(_ref)).toMatchSnapshot();
|
|
9
|
+
});
|
package/{src/NavHorizontalListItemButton → esm/NavListItemButton}/__snapshots__/index.test.tsx.snap
RENAMED
|
@@ -1,43 +1,46 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`renders the
|
|
4
|
-
<ForwardRef(
|
|
5
|
-
active={
|
|
3
|
+
exports[`renders the NavListItemButton with active=false 1`] = `
|
|
4
|
+
<ForwardRef(NavListItemButton)
|
|
5
|
+
active={false}
|
|
6
6
|
>
|
|
7
7
|
<ForwardRef(Button)
|
|
8
|
-
|
|
8
|
+
aria-selected={false}
|
|
9
|
+
className="govgr-horizontal-nav__list-item-btn"
|
|
9
10
|
variant="link"
|
|
10
11
|
>
|
|
11
12
|
<ForwardRef(Base)
|
|
13
|
+
aria-selected={false}
|
|
12
14
|
as="button"
|
|
13
|
-
className="govgr-horizontal-nav__list-item-btn
|
|
15
|
+
className="govgr-horizontal-nav__list-item-btn govgr-link"
|
|
14
16
|
printHidden={true}
|
|
15
17
|
>
|
|
16
18
|
<button
|
|
17
|
-
|
|
19
|
+
aria-selected={false}
|
|
20
|
+
className="govgr-horizontal-nav__list-item-btn govgr-link govgr-print-hidden"
|
|
18
21
|
>
|
|
19
22
|
hello
|
|
20
23
|
<ForwardRef(ArrowIcon)
|
|
21
|
-
direction="
|
|
24
|
+
direction="down"
|
|
22
25
|
>
|
|
23
26
|
<ForwardRef(SvgIcon)
|
|
24
|
-
className="govgr-arrow--
|
|
27
|
+
className="govgr-arrow--down"
|
|
25
28
|
>
|
|
26
29
|
<ForwardRef(Base)
|
|
27
30
|
aria-hidden="true"
|
|
28
31
|
as="svg"
|
|
29
|
-
className="govgr-arrow--
|
|
32
|
+
className="govgr-arrow--down govgr-svg-icon"
|
|
30
33
|
focusable="false"
|
|
31
34
|
viewBox="0 0 24 24"
|
|
32
35
|
>
|
|
33
36
|
<svg
|
|
34
37
|
aria-hidden="true"
|
|
35
|
-
className="govgr-arrow--
|
|
38
|
+
className="govgr-arrow--down govgr-svg-icon"
|
|
36
39
|
focusable="false"
|
|
37
40
|
viewBox="0 0 24 24"
|
|
38
41
|
>
|
|
39
42
|
<path
|
|
40
|
-
d="
|
|
43
|
+
d="M22,8.2l-2.3-2.4L12,13.4L4.4,5.8L2,8.2l10,10L22,8.2z"
|
|
41
44
|
/>
|
|
42
45
|
</svg>
|
|
43
46
|
</ForwardRef(Base)>
|
|
@@ -46,45 +49,50 @@ exports[`renders the NavHorizontalListItemButton with active=true 1`] = `
|
|
|
46
49
|
</button>
|
|
47
50
|
</ForwardRef(Base)>
|
|
48
51
|
</ForwardRef(Button)>
|
|
49
|
-
</ForwardRef(
|
|
52
|
+
</ForwardRef(NavListItemButton)>
|
|
50
53
|
`;
|
|
51
54
|
|
|
52
|
-
exports[`renders the
|
|
53
|
-
<ForwardRef(
|
|
55
|
+
exports[`renders the NavListItemButton with active=true 1`] = `
|
|
56
|
+
<ForwardRef(NavListItemButton)
|
|
57
|
+
active={true}
|
|
58
|
+
>
|
|
54
59
|
<ForwardRef(Button)
|
|
55
|
-
|
|
60
|
+
aria-selected={true}
|
|
61
|
+
className="govgr-horizontal-nav__list-item-btn--active govgr-horizontal-nav__list-item-btn"
|
|
56
62
|
variant="link"
|
|
57
63
|
>
|
|
58
64
|
<ForwardRef(Base)
|
|
65
|
+
aria-selected={true}
|
|
59
66
|
as="button"
|
|
60
|
-
className="govgr-horizontal-nav__list-item-btn govgr-link"
|
|
67
|
+
className="govgr-horizontal-nav__list-item-btn--active govgr-horizontal-nav__list-item-btn govgr-link"
|
|
61
68
|
printHidden={true}
|
|
62
69
|
>
|
|
63
70
|
<button
|
|
64
|
-
|
|
71
|
+
aria-selected={true}
|
|
72
|
+
className="govgr-horizontal-nav__list-item-btn--active govgr-horizontal-nav__list-item-btn govgr-link govgr-print-hidden"
|
|
65
73
|
>
|
|
66
74
|
hello
|
|
67
75
|
<ForwardRef(ArrowIcon)
|
|
68
|
-
direction="
|
|
76
|
+
direction="up"
|
|
69
77
|
>
|
|
70
78
|
<ForwardRef(SvgIcon)
|
|
71
|
-
className="govgr-arrow--
|
|
79
|
+
className="govgr-arrow--up"
|
|
72
80
|
>
|
|
73
81
|
<ForwardRef(Base)
|
|
74
82
|
aria-hidden="true"
|
|
75
83
|
as="svg"
|
|
76
|
-
className="govgr-arrow--
|
|
84
|
+
className="govgr-arrow--up govgr-svg-icon"
|
|
77
85
|
focusable="false"
|
|
78
86
|
viewBox="0 0 24 24"
|
|
79
87
|
>
|
|
80
88
|
<svg
|
|
81
89
|
aria-hidden="true"
|
|
82
|
-
className="govgr-arrow--
|
|
90
|
+
className="govgr-arrow--up govgr-svg-icon"
|
|
83
91
|
focusable="false"
|
|
84
92
|
viewBox="0 0 24 24"
|
|
85
93
|
>
|
|
86
94
|
<path
|
|
87
|
-
d="
|
|
95
|
+
d="M2,15.8l2.3,2.4l7.7-7.6l7.6,7.6l2.4-2.4l-10-10L2,15.8z"
|
|
88
96
|
/>
|
|
89
97
|
</svg>
|
|
90
98
|
</ForwardRef(Base)>
|
|
@@ -93,13 +101,11 @@ exports[`renders the NavHorizontalListItemButton with no props 1`] = `
|
|
|
93
101
|
</button>
|
|
94
102
|
</ForwardRef(Base)>
|
|
95
103
|
</ForwardRef(Button)>
|
|
96
|
-
</ForwardRef(
|
|
104
|
+
</ForwardRef(NavListItemButton)>
|
|
97
105
|
`;
|
|
98
106
|
|
|
99
|
-
exports[`renders the
|
|
100
|
-
<ForwardRef(
|
|
101
|
-
active={false}
|
|
102
|
-
>
|
|
107
|
+
exports[`renders the NavListItemButton with no props 1`] = `
|
|
108
|
+
<ForwardRef(NavListItemButton)>
|
|
103
109
|
<ForwardRef(Button)
|
|
104
110
|
className="govgr-horizontal-nav__list-item-btn"
|
|
105
111
|
variant="link"
|
|
@@ -142,5 +148,5 @@ exports[`renders the NavHorizontalListItemLink with active=false 1`] = `
|
|
|
142
148
|
</button>
|
|
143
149
|
</ForwardRef(Base)>
|
|
144
150
|
</ForwardRef(Button)>
|
|
145
|
-
</ForwardRef(
|
|
151
|
+
</ForwardRef(NavListItemButton)>
|
|
146
152
|
`;
|
|
@@ -7,9 +7,9 @@ import Button from '@digigov/react-core/Button';
|
|
|
7
7
|
import ArrowIcon from '@digigov/react-core/ArrowIcon';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* NavListItemButton is an <button> element. It should be inside the NavListItem component.
|
|
11
11
|
*/
|
|
12
|
-
export var
|
|
12
|
+
export var NavListItemButton = /*#__PURE__*/React.forwardRef(function NavListItemButton(_ref, ref) {
|
|
13
13
|
var active = _ref.active,
|
|
14
14
|
className = _ref.className,
|
|
15
15
|
_ref$arrow = _ref.arrow,
|
|
@@ -26,4 +26,4 @@ export var NavHorizontalListItemButton = /*#__PURE__*/React.forwardRef(function
|
|
|
26
26
|
direction: active ? 'up' : 'down'
|
|
27
27
|
}));
|
|
28
28
|
});
|
|
29
|
-
export default
|
|
29
|
+
export default NavListItemButton;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { mount } from 'enzyme';
|
|
3
|
+
import NavListItemButton from '@digigov/react-core/NavListItemButton';
|
|
4
|
+
|
|
5
|
+
var _ref = /*#__PURE__*/React.createElement(NavListItemButton, null, "hello");
|
|
6
|
+
|
|
7
|
+
it('renders the NavListItemButton with no props', function () {
|
|
8
|
+
expect(mount(_ref)).toMatchSnapshot();
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
var _ref2 = /*#__PURE__*/React.createElement(NavListItemButton, {
|
|
12
|
+
active: true
|
|
13
|
+
}, "hello");
|
|
14
|
+
|
|
15
|
+
it('renders the NavListItemButton with active=true', function () {
|
|
16
|
+
expect(mount(_ref2)).toMatchSnapshot();
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
var _ref3 = /*#__PURE__*/React.createElement(NavListItemButton, {
|
|
20
|
+
active: false
|
|
21
|
+
}, "hello");
|
|
22
|
+
|
|
23
|
+
it('renders the NavListItemButton with active=false', function () {
|
|
24
|
+
expect(mount(_ref3)).toMatchSnapshot();
|
|
25
|
+
});
|
package/{src/NavHorizontalListItemLink → esm/NavListItemLink}/__snapshots__/index.test.tsx.snap
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`renders the
|
|
4
|
-
<ForwardRef(
|
|
3
|
+
exports[`renders the NavListItemLink with active=false 1`] = `
|
|
4
|
+
<ForwardRef(NavListItemLink)
|
|
5
5
|
active={false}
|
|
6
6
|
>
|
|
7
7
|
<ForwardRef(LinkBase)
|
|
@@ -21,11 +21,11 @@ exports[`renders the NavHorizontalListItemLink with active=false 1`] = `
|
|
|
21
21
|
</a>
|
|
22
22
|
</ForwardRef(Base)>
|
|
23
23
|
</ForwardRef(LinkBase)>
|
|
24
|
-
</ForwardRef(
|
|
24
|
+
</ForwardRef(NavListItemLink)>
|
|
25
25
|
`;
|
|
26
26
|
|
|
27
|
-
exports[`renders the
|
|
28
|
-
<ForwardRef(
|
|
27
|
+
exports[`renders the NavListItemLink with active=true 1`] = `
|
|
28
|
+
<ForwardRef(NavListItemLink)
|
|
29
29
|
active={true}
|
|
30
30
|
>
|
|
31
31
|
<ForwardRef(LinkBase)
|
|
@@ -45,11 +45,11 @@ exports[`renders the NavHorizontalListItemLink with active=true 1`] = `
|
|
|
45
45
|
</a>
|
|
46
46
|
</ForwardRef(Base)>
|
|
47
47
|
</ForwardRef(LinkBase)>
|
|
48
|
-
</ForwardRef(
|
|
48
|
+
</ForwardRef(NavListItemLink)>
|
|
49
49
|
`;
|
|
50
50
|
|
|
51
|
-
exports[`renders the
|
|
52
|
-
<ForwardRef(
|
|
51
|
+
exports[`renders the NavListItemLink with href and active=false 1`] = `
|
|
52
|
+
<ForwardRef(NavListItemLink)
|
|
53
53
|
active={false}
|
|
54
54
|
href="/"
|
|
55
55
|
>
|
|
@@ -70,11 +70,11 @@ exports[`renders the NavHorizontalListItemLink with href and active=false 1`] =
|
|
|
70
70
|
</a>
|
|
71
71
|
</ForwardRef(Base)>
|
|
72
72
|
</ForwardRef(LinkBase)>
|
|
73
|
-
</ForwardRef(
|
|
73
|
+
</ForwardRef(NavListItemLink)>
|
|
74
74
|
`;
|
|
75
75
|
|
|
76
|
-
exports[`renders the
|
|
77
|
-
<ForwardRef(
|
|
76
|
+
exports[`renders the NavListItemLink with href and active=true 1`] = `
|
|
77
|
+
<ForwardRef(NavListItemLink)
|
|
78
78
|
active={false}
|
|
79
79
|
href="/"
|
|
80
80
|
>
|
|
@@ -95,11 +95,11 @@ exports[`renders the NavHorizontalListItemLink with href and active=true 1`] = `
|
|
|
95
95
|
</a>
|
|
96
96
|
</ForwardRef(Base)>
|
|
97
97
|
</ForwardRef(LinkBase)>
|
|
98
|
-
</ForwardRef(
|
|
98
|
+
</ForwardRef(NavListItemLink)>
|
|
99
99
|
`;
|
|
100
100
|
|
|
101
|
-
exports[`renders the
|
|
102
|
-
<ForwardRef(
|
|
101
|
+
exports[`renders the NavListItemLink with no props 1`] = `
|
|
102
|
+
<ForwardRef(NavListItemLink)>
|
|
103
103
|
<ForwardRef(LinkBase)
|
|
104
104
|
className="govgr-horizontal-nav__list-item-link"
|
|
105
105
|
href="#"
|
|
@@ -117,5 +117,5 @@ exports[`renders the NavHorizontalListItemLink with no props 1`] = `
|
|
|
117
117
|
</a>
|
|
118
118
|
</ForwardRef(Base)>
|
|
119
119
|
</ForwardRef(LinkBase)>
|
|
120
|
-
</ForwardRef(
|
|
120
|
+
</ForwardRef(NavListItemLink)>
|
|
121
121
|
`;
|
|
@@ -6,9 +6,9 @@ import clsx from 'clsx';
|
|
|
6
6
|
import Link from '@digigov/react-core/LinkBase';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* NavListItemLink is an <a> element. It should be inside the NavListItem component.
|
|
10
10
|
*/
|
|
11
|
-
export var
|
|
11
|
+
export var NavListItemLink = /*#__PURE__*/React.forwardRef(function NavListItemLink(_ref, ref) {
|
|
12
12
|
var active = _ref.active,
|
|
13
13
|
_ref$href = _ref.href,
|
|
14
14
|
href = _ref$href === void 0 ? '#' : _ref$href,
|
|
@@ -22,4 +22,4 @@ export var NavHorizontalListItemLink = /*#__PURE__*/React.forwardRef(function Na
|
|
|
22
22
|
className: clsx(className, active === true && 'govgr-horizontal-nav__list-item-link--active', true && 'govgr-horizontal-nav__list-item-link')
|
|
23
23
|
}, props), children);
|
|
24
24
|
});
|
|
25
|
-
export default
|
|
25
|
+
export default NavListItemLink;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { mount } from 'enzyme';
|
|
3
|
+
import NavListItemLink from '@digigov/react-core/NavListItemLink';
|
|
4
|
+
|
|
5
|
+
var _ref = /*#__PURE__*/React.createElement(NavListItemLink, null, "hello");
|
|
6
|
+
|
|
7
|
+
it('renders the NavListItemLink with no props', function () {
|
|
8
|
+
expect(mount(_ref)).toMatchSnapshot();
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
var _ref2 = /*#__PURE__*/React.createElement(NavListItemLink, {
|
|
12
|
+
active: true
|
|
13
|
+
}, "hello");
|
|
14
|
+
|
|
15
|
+
it('renders the NavListItemLink with active=true', function () {
|
|
16
|
+
expect(mount(_ref2)).toMatchSnapshot();
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
var _ref3 = /*#__PURE__*/React.createElement(NavListItemLink, {
|
|
20
|
+
active: false
|
|
21
|
+
}, "hello");
|
|
22
|
+
|
|
23
|
+
it('renders the NavListItemLink with active=false', function () {
|
|
24
|
+
expect(mount(_ref3)).toMatchSnapshot();
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
var _ref4 = /*#__PURE__*/React.createElement(NavListItemLink, {
|
|
28
|
+
href: "/",
|
|
29
|
+
active: false
|
|
30
|
+
}, "hello");
|
|
31
|
+
|
|
32
|
+
it('renders the NavListItemLink with href and active=false', function () {
|
|
33
|
+
expect(mount(_ref4)).toMatchSnapshot();
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
var _ref5 = /*#__PURE__*/React.createElement(NavListItemLink, {
|
|
37
|
+
href: "/",
|
|
38
|
+
active: false
|
|
39
|
+
}, "hello");
|
|
40
|
+
|
|
41
|
+
it('renders the NavListItemLink with href and active=true', function () {
|
|
42
|
+
expect(mount(_ref5)).toMatchSnapshot();
|
|
43
|
+
});
|
|
@@ -3,11 +3,13 @@
|
|
|
3
3
|
exports[`renders the NavMenu with no props 1`] = `
|
|
4
4
|
<ForwardRef(NavMenu)>
|
|
5
5
|
<ForwardRef(Base)
|
|
6
|
+
aria-hidden={true}
|
|
6
7
|
as="div"
|
|
7
|
-
className="govgr-nav-list__menu"
|
|
8
|
+
className="govgr-nav-list__menu govgr-nav-list__menu-hidden"
|
|
8
9
|
>
|
|
9
10
|
<div
|
|
10
|
-
|
|
11
|
+
aria-hidden={true}
|
|
12
|
+
className="govgr-nav-list__menu govgr-nav-list__menu-hidden"
|
|
11
13
|
>
|
|
12
14
|
hello
|
|
13
15
|
</div>
|
package/esm/NavMenu/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["active", "className", "children"];
|
|
3
|
+
var _excluded = ["active", "layout", "className", "children"];
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import Base from '@digigov/react-core/Base';
|
|
6
6
|
import clsx from 'clsx';
|
|
@@ -11,6 +11,8 @@ import clsx from 'clsx';
|
|
|
11
11
|
*/
|
|
12
12
|
export var NavMenu = /*#__PURE__*/React.forwardRef(function NavMenu(_ref, ref) {
|
|
13
13
|
var active = _ref.active,
|
|
14
|
+
_ref$layout = _ref.layout,
|
|
15
|
+
layout = _ref$layout === void 0 ? 'horizontal' : _ref$layout,
|
|
14
16
|
className = _ref.className,
|
|
15
17
|
children = _ref.children,
|
|
16
18
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
@@ -19,7 +21,7 @@ export var NavMenu = /*#__PURE__*/React.forwardRef(function NavMenu(_ref, ref) {
|
|
|
19
21
|
as: "div",
|
|
20
22
|
ref: ref,
|
|
21
23
|
"aria-hidden": !active,
|
|
22
|
-
className: clsx(className,
|
|
24
|
+
className: clsx(className, layout === 'horizontal' && 'govgr-nav-list__menu', layout === 'vertical' && 'govgr-vertical-nav-list__menu', !active && 'govgr-nav-list__menu-hidden')
|
|
23
25
|
}, props), children);
|
|
24
26
|
});
|
|
25
27
|
export default NavMenu;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["className", "children"];
|
|
3
|
+
var _excluded = ["className", "layout", "children"];
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import Container from '@digigov/react-core/Container';
|
|
@@ -11,10 +11,13 @@ import Container from '@digigov/react-core/Container';
|
|
|
11
11
|
*/
|
|
12
12
|
export var NavMenuContainer = /*#__PURE__*/React.forwardRef(function NavMenuContainer(_ref, ref) {
|
|
13
13
|
var className = _ref.className,
|
|
14
|
+
_ref$layout = _ref.layout,
|
|
15
|
+
layout = _ref$layout === void 0 ? 'horizontal' : _ref$layout,
|
|
14
16
|
children = _ref.children,
|
|
15
17
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
16
18
|
|
|
17
19
|
return /*#__PURE__*/React.createElement(Container, _extends({
|
|
20
|
+
cols: layout === 'horizontal',
|
|
18
21
|
ref: ref,
|
|
19
22
|
className: clsx(className)
|
|
20
23
|
}, props), children);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["className", "children"];
|
|
3
|
+
var _excluded = ["className", "layout", "children"];
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import Base from '@digigov/react-core/Base';
|
|
6
6
|
import clsx from 'clsx';
|
|
@@ -11,13 +11,15 @@ import clsx from 'clsx';
|
|
|
11
11
|
*/
|
|
12
12
|
export var NavMenuContainerContentList = /*#__PURE__*/React.forwardRef(function NavMenuContainerContentList(_ref, ref) {
|
|
13
13
|
var className = _ref.className,
|
|
14
|
+
_ref$layout = _ref.layout,
|
|
15
|
+
layout = _ref$layout === void 0 ? 'horizontal' : _ref$layout,
|
|
14
16
|
children = _ref.children,
|
|
15
17
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
16
18
|
|
|
17
19
|
return /*#__PURE__*/React.createElement(Base, _extends({
|
|
18
20
|
as: "ul",
|
|
19
21
|
ref: ref,
|
|
20
|
-
className: clsx(className,
|
|
22
|
+
className: clsx(className, layout === 'horizontal' && 'govgr-nav-list__content-list', layout === 'vertical' && 'govgr-vertical-nav-list__content-list')
|
|
21
23
|
}, props), children);
|
|
22
24
|
});
|
|
23
25
|
export default NavMenuContainerContentList;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["className", "children"];
|
|
3
|
+
var _excluded = ["className", "layout", "children"];
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import Grid from '@digigov/react-core/Grid';
|
|
@@ -13,6 +13,8 @@ import Heading from '@digigov/react-core/Heading';
|
|
|
13
13
|
*/
|
|
14
14
|
export var NavMenuContainerTitle = /*#__PURE__*/React.forwardRef(function NavMenuContainerTitle(_ref, ref) {
|
|
15
15
|
var className = _ref.className,
|
|
16
|
+
_ref$layout = _ref.layout,
|
|
17
|
+
layout = _ref$layout === void 0 ? 'horizontal' : _ref$layout,
|
|
16
18
|
children = _ref.children,
|
|
17
19
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
18
20
|
|
|
@@ -20,10 +22,11 @@ export var NavMenuContainerTitle = /*#__PURE__*/React.forwardRef(function NavMen
|
|
|
20
22
|
item: true,
|
|
21
23
|
md: 1,
|
|
22
24
|
ref: ref,
|
|
23
|
-
className: clsx(className)
|
|
25
|
+
className: clsx(className, layout === 'vertical' && 'govgr-vertical-nav-list__container-title')
|
|
24
26
|
}, props), /*#__PURE__*/React.createElement(Heading, {
|
|
25
27
|
element: "h3",
|
|
26
|
-
size: "m"
|
|
28
|
+
size: "m",
|
|
29
|
+
className: clsx(layout === 'vertical' && 'govgr-vertical-nav-list__container-title-heading')
|
|
27
30
|
}, children));
|
|
28
31
|
});
|
|
29
32
|
export default NavMenuContainerTitle;
|
package/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license Digigov v0.20.
|
|
1
|
+
/** @license Digigov v0.20.1
|
|
2
2
|
*
|
|
3
3
|
* This source code is licensed under the BSD-2-Clause license found in the
|
|
4
4
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -67,6 +67,7 @@ export * from '@digigov/react-core/FooterSection';
|
|
|
67
67
|
export * from '@digigov/react-core/FieldContainer';
|
|
68
68
|
export * from '@digigov/react-core/GovGRLogo';
|
|
69
69
|
export * from '@digigov/react-core/Grid';
|
|
70
|
+
export * from '@digigov/react-core/GlobeIcon';
|
|
70
71
|
export * from '@digigov/react-core/Header';
|
|
71
72
|
export * from '@digigov/react-core/HeaderContent';
|
|
72
73
|
export * from '@digigov/react-core/HeaderLogo';
|
|
@@ -89,11 +90,11 @@ export * from '@digigov/react-core/Main';
|
|
|
89
90
|
export * from '@digigov/react-core/Masthead';
|
|
90
91
|
export * from '@digigov/react-core/MastheadBody';
|
|
91
92
|
export * from '@digigov/react-core/MoreVertIcon';
|
|
92
|
-
export * from '@digigov/react-core/
|
|
93
|
-
export * from '@digigov/react-core/
|
|
94
|
-
export * from '@digigov/react-core/
|
|
95
|
-
export * from '@digigov/react-core/
|
|
96
|
-
export * from '@digigov/react-core/
|
|
93
|
+
export * from '@digigov/react-core/Nav';
|
|
94
|
+
export * from '@digigov/react-core/NavList';
|
|
95
|
+
export * from '@digigov/react-core/NavListItem';
|
|
96
|
+
export * from '@digigov/react-core/NavListItemLink';
|
|
97
|
+
export * from '@digigov/react-core/NavListItemButton';
|
|
97
98
|
export * from '@digigov/react-core/NavMenu';
|
|
98
99
|
export * from '@digigov/react-core/NavMenuContainer';
|
|
99
100
|
export * from '@digigov/react-core/NavMenuContainerContent';
|