@digigov/react-core 0.20.0-navlist.alpha.2 → 0.20.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/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 +21 -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
package/src/BurgerIcon/index.tsx
CHANGED
|
@@ -14,13 +14,6 @@ export interface BurgerIconProps extends SvgIconProps {
|
|
|
14
14
|
* This prop should be 'true' whenever the NavHorizontal is 'active', so whenever the user clicks at the burger menu.
|
|
15
15
|
*/
|
|
16
16
|
active?: boolean;
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* hidden is optional.
|
|
20
|
-
* The default is 's'.
|
|
21
|
-
* It can be used to control the visibility of the icon across screens.
|
|
22
|
-
*/
|
|
23
|
-
hidden?: 's' | 'm' | 'l';
|
|
24
17
|
}
|
|
25
18
|
/**
|
|
26
19
|
* BurgerIcon is used inside the Header component.
|
|
@@ -29,10 +22,7 @@ export interface BurgerIconProps extends SvgIconProps {
|
|
|
29
22
|
export const BurgerIcon: React.FC<BurgerIconProps> = React.forwardRef<
|
|
30
23
|
SVGSVGElement,
|
|
31
24
|
BurgerIconProps
|
|
32
|
-
>(function BurgerIcon(
|
|
33
|
-
{ variant, size, active, hidden, className, ...props },
|
|
34
|
-
ref
|
|
35
|
-
) {
|
|
25
|
+
>(function BurgerIcon({ variant, size, active, className, ...props }, ref) {
|
|
36
26
|
return (
|
|
37
27
|
<SvgIcon
|
|
38
28
|
variant={variant}
|
|
@@ -40,9 +30,6 @@ export const BurgerIcon: React.FC<BurgerIconProps> = React.forwardRef<
|
|
|
40
30
|
className={clsx(className, {
|
|
41
31
|
'govgr-burger-icon': true,
|
|
42
32
|
'govgr-burger-icon--active': active === true,
|
|
43
|
-
'govgr-burger-icon--hidden-s': hidden === 's',
|
|
44
|
-
'govgr-burger-icon--hidden-m': hidden === 'm',
|
|
45
|
-
'govgr-burger-icon--hidden-l': hidden === 'l',
|
|
46
33
|
})}
|
|
47
34
|
ref={ref}
|
|
48
35
|
{...props}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`renders the GlobeIcon prop variant= "error" 1`] = `
|
|
4
|
+
<ForwardRef(GlobeIcon)
|
|
5
|
+
variant="error"
|
|
6
|
+
>
|
|
7
|
+
<ForwardRef(SvgIcon)
|
|
8
|
+
className="govgr-globe-icon"
|
|
9
|
+
variant="error"
|
|
10
|
+
>
|
|
11
|
+
<ForwardRef(Base)
|
|
12
|
+
aria-hidden="true"
|
|
13
|
+
as="svg"
|
|
14
|
+
className="govgr-globe-icon govgr-svg-icon--error govgr-svg-icon"
|
|
15
|
+
focusable="false"
|
|
16
|
+
viewBox="0 0 24 24"
|
|
17
|
+
>
|
|
18
|
+
<svg
|
|
19
|
+
aria-hidden="true"
|
|
20
|
+
className="govgr-globe-icon govgr-svg-icon--error govgr-svg-icon"
|
|
21
|
+
focusable="false"
|
|
22
|
+
viewBox="0 0 24 24"
|
|
23
|
+
>
|
|
24
|
+
<path
|
|
25
|
+
d="M12,0C5.4,0,0,5.4,0,12s5.4,12,12,12s12-5.4,12-12S18.6,0,12,0z M22.4,13.1C22.4,13.1,22.4,13.2,22.4,13.1 c0,0.4-0.1,0.8-0.2,1.1v0h-3.6c0.2-1.5,0.2-3,0-4.5h3.6v0c0.1,0.4,0.1,0.7,0.2,1.1c0,0,0,0,0,0C22.5,11.6,22.5,12.4,22.4,13.1z M16,21.7c1.1-1.5,2-3.5,2.4-6h3.4c0,0,0,0,0,0C20.8,18.4,18.7,20.6,16,21.7z M21.8,8.2C21.8,8.2,21.8,8.2,21.8,8.2l-3.4,0 c-0.4-2.4-1.3-4.5-2.4-6C18.7,3.4,20.8,5.6,21.8,8.2L21.8,8.2z M17.1,9.7c0.2,1.5,0.2,3,0,4.5h-4.4V9.7L17.1,9.7L17.1,9.7z M12.7,8.2V1.6c1.9,0.6,3.5,3.2,4.1,6.6L12.7,8.2L12.7,8.2z M12.7,15.7h4.1c-0.7,3.4-2.3,6.1-4.1,6.6V15.7L12.7,15.7z M2.2,15.8 C2.2,15.8,2.2,15.8,2.2,15.8l3.4,0c0.4,2.4,1.3,4.5,2.4,6C5.3,20.6,3.2,18.4,2.2,15.8L2.2,15.8z M8,2.3c-1.1,1.5-2,3.5-2.4,6H2.2 c0,0,0,0,0,0C3.2,5.6,5.3,3.4,8,2.3z M6.9,14.3c-0.2-1.5-0.2-3,0-4.5h4.4v4.5H6.9L6.9,14.3z M11.2,15.8v6.6 c-1.9-0.6-3.5-3.2-4.1-6.6L11.2,15.8L11.2,15.8z M11.2,8.3H7.1c0.7-3.4,2.3-6.1,4.1-6.6V8.3L11.2,8.3z M1.6,10.9 C1.6,10.9,1.6,10.8,1.6,10.9c0-0.4,0.1-0.8,0.2-1.1v0h3.6c-0.2,1.5-0.2,3,0,4.5H1.7v0c-0.1-0.4-0.1-0.7-0.2-1.1c0,0,0,0,0,0 C1.5,12.4,1.5,11.6,1.6,10.9z"
|
|
26
|
+
/>
|
|
27
|
+
</svg>
|
|
28
|
+
</ForwardRef(Base)>
|
|
29
|
+
</ForwardRef(SvgIcon)>
|
|
30
|
+
</ForwardRef(GlobeIcon)>
|
|
31
|
+
`;
|
|
32
|
+
|
|
33
|
+
exports[`renders the GlobeIcon prop variant= "light" 1`] = `
|
|
34
|
+
<ForwardRef(GlobeIcon)
|
|
35
|
+
variant="light"
|
|
36
|
+
>
|
|
37
|
+
<ForwardRef(SvgIcon)
|
|
38
|
+
className="govgr-globe-icon"
|
|
39
|
+
variant="light"
|
|
40
|
+
>
|
|
41
|
+
<ForwardRef(Base)
|
|
42
|
+
aria-hidden="true"
|
|
43
|
+
as="svg"
|
|
44
|
+
className="govgr-globe-icon govgr-svg-icon--light govgr-svg-icon"
|
|
45
|
+
focusable="false"
|
|
46
|
+
viewBox="0 0 24 24"
|
|
47
|
+
>
|
|
48
|
+
<svg
|
|
49
|
+
aria-hidden="true"
|
|
50
|
+
className="govgr-globe-icon govgr-svg-icon--light govgr-svg-icon"
|
|
51
|
+
focusable="false"
|
|
52
|
+
viewBox="0 0 24 24"
|
|
53
|
+
>
|
|
54
|
+
<path
|
|
55
|
+
d="M12,0C5.4,0,0,5.4,0,12s5.4,12,12,12s12-5.4,12-12S18.6,0,12,0z M22.4,13.1C22.4,13.1,22.4,13.2,22.4,13.1 c0,0.4-0.1,0.8-0.2,1.1v0h-3.6c0.2-1.5,0.2-3,0-4.5h3.6v0c0.1,0.4,0.1,0.7,0.2,1.1c0,0,0,0,0,0C22.5,11.6,22.5,12.4,22.4,13.1z M16,21.7c1.1-1.5,2-3.5,2.4-6h3.4c0,0,0,0,0,0C20.8,18.4,18.7,20.6,16,21.7z M21.8,8.2C21.8,8.2,21.8,8.2,21.8,8.2l-3.4,0 c-0.4-2.4-1.3-4.5-2.4-6C18.7,3.4,20.8,5.6,21.8,8.2L21.8,8.2z M17.1,9.7c0.2,1.5,0.2,3,0,4.5h-4.4V9.7L17.1,9.7L17.1,9.7z M12.7,8.2V1.6c1.9,0.6,3.5,3.2,4.1,6.6L12.7,8.2L12.7,8.2z M12.7,15.7h4.1c-0.7,3.4-2.3,6.1-4.1,6.6V15.7L12.7,15.7z M2.2,15.8 C2.2,15.8,2.2,15.8,2.2,15.8l3.4,0c0.4,2.4,1.3,4.5,2.4,6C5.3,20.6,3.2,18.4,2.2,15.8L2.2,15.8z M8,2.3c-1.1,1.5-2,3.5-2.4,6H2.2 c0,0,0,0,0,0C3.2,5.6,5.3,3.4,8,2.3z M6.9,14.3c-0.2-1.5-0.2-3,0-4.5h4.4v4.5H6.9L6.9,14.3z M11.2,15.8v6.6 c-1.9-0.6-3.5-3.2-4.1-6.6L11.2,15.8L11.2,15.8z M11.2,8.3H7.1c0.7-3.4,2.3-6.1,4.1-6.6V8.3L11.2,8.3z M1.6,10.9 C1.6,10.9,1.6,10.8,1.6,10.9c0-0.4,0.1-0.8,0.2-1.1v0h3.6c-0.2,1.5-0.2,3,0,4.5H1.7v0c-0.1-0.4-0.1-0.7-0.2-1.1c0,0,0,0,0,0 C1.5,12.4,1.5,11.6,1.6,10.9z"
|
|
56
|
+
/>
|
|
57
|
+
</svg>
|
|
58
|
+
</ForwardRef(Base)>
|
|
59
|
+
</ForwardRef(SvgIcon)>
|
|
60
|
+
</ForwardRef(GlobeIcon)>
|
|
61
|
+
`;
|
|
62
|
+
|
|
63
|
+
exports[`renders the GlobeIcon props active variant= "light" 1`] = `
|
|
64
|
+
<ForwardRef(GlobeIcon)
|
|
65
|
+
active={true}
|
|
66
|
+
variant="light"
|
|
67
|
+
>
|
|
68
|
+
<ForwardRef(SvgIcon)
|
|
69
|
+
className="govgr-globe-icon--active govgr-globe-icon"
|
|
70
|
+
variant="light"
|
|
71
|
+
>
|
|
72
|
+
<ForwardRef(Base)
|
|
73
|
+
aria-hidden="true"
|
|
74
|
+
as="svg"
|
|
75
|
+
className="govgr-globe-icon--active govgr-globe-icon govgr-svg-icon--light govgr-svg-icon"
|
|
76
|
+
focusable="false"
|
|
77
|
+
viewBox="0 0 24 24"
|
|
78
|
+
>
|
|
79
|
+
<svg
|
|
80
|
+
aria-hidden="true"
|
|
81
|
+
className="govgr-globe-icon--active govgr-globe-icon govgr-svg-icon--light govgr-svg-icon"
|
|
82
|
+
focusable="false"
|
|
83
|
+
viewBox="0 0 24 24"
|
|
84
|
+
>
|
|
85
|
+
<path
|
|
86
|
+
d="M12,0C5.4,0,0,5.4,0,12s5.4,12,12,12s12-5.4,12-12S18.6,0,12,0z M22.4,13.1C22.4,13.1,22.4,13.2,22.4,13.1 c0,0.4-0.1,0.8-0.2,1.1v0h-3.6c0.2-1.5,0.2-3,0-4.5h3.6v0c0.1,0.4,0.1,0.7,0.2,1.1c0,0,0,0,0,0C22.5,11.6,22.5,12.4,22.4,13.1z M16,21.7c1.1-1.5,2-3.5,2.4-6h3.4c0,0,0,0,0,0C20.8,18.4,18.7,20.6,16,21.7z M21.8,8.2C21.8,8.2,21.8,8.2,21.8,8.2l-3.4,0 c-0.4-2.4-1.3-4.5-2.4-6C18.7,3.4,20.8,5.6,21.8,8.2L21.8,8.2z M17.1,9.7c0.2,1.5,0.2,3,0,4.5h-4.4V9.7L17.1,9.7L17.1,9.7z M12.7,8.2V1.6c1.9,0.6,3.5,3.2,4.1,6.6L12.7,8.2L12.7,8.2z M12.7,15.7h4.1c-0.7,3.4-2.3,6.1-4.1,6.6V15.7L12.7,15.7z M2.2,15.8 C2.2,15.8,2.2,15.8,2.2,15.8l3.4,0c0.4,2.4,1.3,4.5,2.4,6C5.3,20.6,3.2,18.4,2.2,15.8L2.2,15.8z M8,2.3c-1.1,1.5-2,3.5-2.4,6H2.2 c0,0,0,0,0,0C3.2,5.6,5.3,3.4,8,2.3z M6.9,14.3c-0.2-1.5-0.2-3,0-4.5h4.4v4.5H6.9L6.9,14.3z M11.2,15.8v6.6 c-1.9-0.6-3.5-3.2-4.1-6.6L11.2,15.8L11.2,15.8z M11.2,8.3H7.1c0.7-3.4,2.3-6.1,4.1-6.6V8.3L11.2,8.3z M1.6,10.9 C1.6,10.9,1.6,10.8,1.6,10.9c0-0.4,0.1-0.8,0.2-1.1v0h3.6c-0.2,1.5-0.2,3,0,4.5H1.7v0c-0.1-0.4-0.1-0.7-0.2-1.1c0,0,0,0,0,0 C1.5,12.4,1.5,11.6,1.6,10.9z"
|
|
87
|
+
/>
|
|
88
|
+
</svg>
|
|
89
|
+
</ForwardRef(Base)>
|
|
90
|
+
</ForwardRef(SvgIcon)>
|
|
91
|
+
</ForwardRef(GlobeIcon)>
|
|
92
|
+
`;
|
|
93
|
+
|
|
94
|
+
exports[`renders the GlobeIcon with no props 1`] = `
|
|
95
|
+
<ForwardRef(GlobeIcon)>
|
|
96
|
+
<ForwardRef(SvgIcon)
|
|
97
|
+
className="govgr-globe-icon"
|
|
98
|
+
>
|
|
99
|
+
<ForwardRef(Base)
|
|
100
|
+
aria-hidden="true"
|
|
101
|
+
as="svg"
|
|
102
|
+
className="govgr-globe-icon govgr-svg-icon"
|
|
103
|
+
focusable="false"
|
|
104
|
+
viewBox="0 0 24 24"
|
|
105
|
+
>
|
|
106
|
+
<svg
|
|
107
|
+
aria-hidden="true"
|
|
108
|
+
className="govgr-globe-icon govgr-svg-icon"
|
|
109
|
+
focusable="false"
|
|
110
|
+
viewBox="0 0 24 24"
|
|
111
|
+
>
|
|
112
|
+
<path
|
|
113
|
+
d="M12,0C5.4,0,0,5.4,0,12s5.4,12,12,12s12-5.4,12-12S18.6,0,12,0z M22.4,13.1C22.4,13.1,22.4,13.2,22.4,13.1 c0,0.4-0.1,0.8-0.2,1.1v0h-3.6c0.2-1.5,0.2-3,0-4.5h3.6v0c0.1,0.4,0.1,0.7,0.2,1.1c0,0,0,0,0,0C22.5,11.6,22.5,12.4,22.4,13.1z M16,21.7c1.1-1.5,2-3.5,2.4-6h3.4c0,0,0,0,0,0C20.8,18.4,18.7,20.6,16,21.7z M21.8,8.2C21.8,8.2,21.8,8.2,21.8,8.2l-3.4,0 c-0.4-2.4-1.3-4.5-2.4-6C18.7,3.4,20.8,5.6,21.8,8.2L21.8,8.2z M17.1,9.7c0.2,1.5,0.2,3,0,4.5h-4.4V9.7L17.1,9.7L17.1,9.7z M12.7,8.2V1.6c1.9,0.6,3.5,3.2,4.1,6.6L12.7,8.2L12.7,8.2z M12.7,15.7h4.1c-0.7,3.4-2.3,6.1-4.1,6.6V15.7L12.7,15.7z M2.2,15.8 C2.2,15.8,2.2,15.8,2.2,15.8l3.4,0c0.4,2.4,1.3,4.5,2.4,6C5.3,20.6,3.2,18.4,2.2,15.8L2.2,15.8z M8,2.3c-1.1,1.5-2,3.5-2.4,6H2.2 c0,0,0,0,0,0C3.2,5.6,5.3,3.4,8,2.3z M6.9,14.3c-0.2-1.5-0.2-3,0-4.5h4.4v4.5H6.9L6.9,14.3z M11.2,15.8v6.6 c-1.9-0.6-3.5-3.2-4.1-6.6L11.2,15.8L11.2,15.8z M11.2,8.3H7.1c0.7-3.4,2.3-6.1,4.1-6.6V8.3L11.2,8.3z M1.6,10.9 C1.6,10.9,1.6,10.8,1.6,10.9c0-0.4,0.1-0.8,0.2-1.1v0h3.6c-0.2,1.5-0.2,3,0,4.5H1.7v0c-0.1-0.4-0.1-0.7-0.2-1.1c0,0,0,0,0,0 C1.5,12.4,1.5,11.6,1.6,10.9z"
|
|
114
|
+
/>
|
|
115
|
+
</svg>
|
|
116
|
+
</ForwardRef(Base)>
|
|
117
|
+
</ForwardRef(SvgIcon)>
|
|
118
|
+
</ForwardRef(GlobeIcon)>
|
|
119
|
+
`;
|
|
120
|
+
|
|
121
|
+
exports[`renders the GlobeIcon with prop active=true 1`] = `
|
|
122
|
+
<ForwardRef(GlobeIcon)
|
|
123
|
+
active={true}
|
|
124
|
+
>
|
|
125
|
+
<ForwardRef(SvgIcon)
|
|
126
|
+
className="govgr-globe-icon--active govgr-globe-icon"
|
|
127
|
+
>
|
|
128
|
+
<ForwardRef(Base)
|
|
129
|
+
aria-hidden="true"
|
|
130
|
+
as="svg"
|
|
131
|
+
className="govgr-globe-icon--active govgr-globe-icon govgr-svg-icon"
|
|
132
|
+
focusable="false"
|
|
133
|
+
viewBox="0 0 24 24"
|
|
134
|
+
>
|
|
135
|
+
<svg
|
|
136
|
+
aria-hidden="true"
|
|
137
|
+
className="govgr-globe-icon--active govgr-globe-icon govgr-svg-icon"
|
|
138
|
+
focusable="false"
|
|
139
|
+
viewBox="0 0 24 24"
|
|
140
|
+
>
|
|
141
|
+
<path
|
|
142
|
+
d="M12,0C5.4,0,0,5.4,0,12s5.4,12,12,12s12-5.4,12-12S18.6,0,12,0z M22.4,13.1C22.4,13.1,22.4,13.2,22.4,13.1 c0,0.4-0.1,0.8-0.2,1.1v0h-3.6c0.2-1.5,0.2-3,0-4.5h3.6v0c0.1,0.4,0.1,0.7,0.2,1.1c0,0,0,0,0,0C22.5,11.6,22.5,12.4,22.4,13.1z M16,21.7c1.1-1.5,2-3.5,2.4-6h3.4c0,0,0,0,0,0C20.8,18.4,18.7,20.6,16,21.7z M21.8,8.2C21.8,8.2,21.8,8.2,21.8,8.2l-3.4,0 c-0.4-2.4-1.3-4.5-2.4-6C18.7,3.4,20.8,5.6,21.8,8.2L21.8,8.2z M17.1,9.7c0.2,1.5,0.2,3,0,4.5h-4.4V9.7L17.1,9.7L17.1,9.7z M12.7,8.2V1.6c1.9,0.6,3.5,3.2,4.1,6.6L12.7,8.2L12.7,8.2z M12.7,15.7h4.1c-0.7,3.4-2.3,6.1-4.1,6.6V15.7L12.7,15.7z M2.2,15.8 C2.2,15.8,2.2,15.8,2.2,15.8l3.4,0c0.4,2.4,1.3,4.5,2.4,6C5.3,20.6,3.2,18.4,2.2,15.8L2.2,15.8z M8,2.3c-1.1,1.5-2,3.5-2.4,6H2.2 c0,0,0,0,0,0C3.2,5.6,5.3,3.4,8,2.3z M6.9,14.3c-0.2-1.5-0.2-3,0-4.5h4.4v4.5H6.9L6.9,14.3z M11.2,15.8v6.6 c-1.9-0.6-3.5-3.2-4.1-6.6L11.2,15.8L11.2,15.8z M11.2,8.3H7.1c0.7-3.4,2.3-6.1,4.1-6.6V8.3L11.2,8.3z M1.6,10.9 C1.6,10.9,1.6,10.8,1.6,10.9c0-0.4,0.1-0.8,0.2-1.1v0h3.6c-0.2,1.5-0.2,3,0,4.5H1.7v0c-0.1-0.4-0.1-0.7-0.2-1.1c0,0,0,0,0,0 C1.5,12.4,1.5,11.6,1.6,10.9z"
|
|
143
|
+
/>
|
|
144
|
+
</svg>
|
|
145
|
+
</ForwardRef(Base)>
|
|
146
|
+
</ForwardRef(SvgIcon)>
|
|
147
|
+
</ForwardRef(GlobeIcon)>
|
|
148
|
+
`;
|
|
149
|
+
|
|
150
|
+
exports[`renders the GlobeIcon with prop variant=dark 1`] = `
|
|
151
|
+
<ForwardRef(GlobeIcon)
|
|
152
|
+
variant="dark"
|
|
153
|
+
>
|
|
154
|
+
<ForwardRef(SvgIcon)
|
|
155
|
+
className="govgr-globe-icon"
|
|
156
|
+
variant="dark"
|
|
157
|
+
>
|
|
158
|
+
<ForwardRef(Base)
|
|
159
|
+
aria-hidden="true"
|
|
160
|
+
as="svg"
|
|
161
|
+
className="govgr-globe-icon govgr-svg-icon--dark govgr-svg-icon"
|
|
162
|
+
focusable="false"
|
|
163
|
+
viewBox="0 0 24 24"
|
|
164
|
+
>
|
|
165
|
+
<svg
|
|
166
|
+
aria-hidden="true"
|
|
167
|
+
className="govgr-globe-icon govgr-svg-icon--dark govgr-svg-icon"
|
|
168
|
+
focusable="false"
|
|
169
|
+
viewBox="0 0 24 24"
|
|
170
|
+
>
|
|
171
|
+
<path
|
|
172
|
+
d="M12,0C5.4,0,0,5.4,0,12s5.4,12,12,12s12-5.4,12-12S18.6,0,12,0z M22.4,13.1C22.4,13.1,22.4,13.2,22.4,13.1 c0,0.4-0.1,0.8-0.2,1.1v0h-3.6c0.2-1.5,0.2-3,0-4.5h3.6v0c0.1,0.4,0.1,0.7,0.2,1.1c0,0,0,0,0,0C22.5,11.6,22.5,12.4,22.4,13.1z M16,21.7c1.1-1.5,2-3.5,2.4-6h3.4c0,0,0,0,0,0C20.8,18.4,18.7,20.6,16,21.7z M21.8,8.2C21.8,8.2,21.8,8.2,21.8,8.2l-3.4,0 c-0.4-2.4-1.3-4.5-2.4-6C18.7,3.4,20.8,5.6,21.8,8.2L21.8,8.2z M17.1,9.7c0.2,1.5,0.2,3,0,4.5h-4.4V9.7L17.1,9.7L17.1,9.7z M12.7,8.2V1.6c1.9,0.6,3.5,3.2,4.1,6.6L12.7,8.2L12.7,8.2z M12.7,15.7h4.1c-0.7,3.4-2.3,6.1-4.1,6.6V15.7L12.7,15.7z M2.2,15.8 C2.2,15.8,2.2,15.8,2.2,15.8l3.4,0c0.4,2.4,1.3,4.5,2.4,6C5.3,20.6,3.2,18.4,2.2,15.8L2.2,15.8z M8,2.3c-1.1,1.5-2,3.5-2.4,6H2.2 c0,0,0,0,0,0C3.2,5.6,5.3,3.4,8,2.3z M6.9,14.3c-0.2-1.5-0.2-3,0-4.5h4.4v4.5H6.9L6.9,14.3z M11.2,15.8v6.6 c-1.9-0.6-3.5-3.2-4.1-6.6L11.2,15.8L11.2,15.8z M11.2,8.3H7.1c0.7-3.4,2.3-6.1,4.1-6.6V8.3L11.2,8.3z M1.6,10.9 C1.6,10.9,1.6,10.8,1.6,10.9c0-0.4,0.1-0.8,0.2-1.1v0h3.6c-0.2,1.5-0.2,3,0,4.5H1.7v0c-0.1-0.4-0.1-0.7-0.2-1.1c0,0,0,0,0,0 C1.5,12.4,1.5,11.6,1.6,10.9z"
|
|
173
|
+
/>
|
|
174
|
+
</svg>
|
|
175
|
+
</ForwardRef(Base)>
|
|
176
|
+
</ForwardRef(SvgIcon)>
|
|
177
|
+
</ForwardRef(GlobeIcon)>
|
|
178
|
+
`;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { mount } from 'enzyme';
|
|
3
|
+
|
|
4
|
+
import GlobeIcon from '@digigov/react-core/GlobeIcon';
|
|
5
|
+
|
|
6
|
+
it('renders the GlobeIcon with no props', () => {
|
|
7
|
+
expect(mount(<GlobeIcon />)).toMatchSnapshot();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('renders the GlobeIcon with prop active=true', () => {
|
|
11
|
+
expect(mount(<GlobeIcon active={true} />)).toMatchSnapshot();
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
it('renders the GlobeIcon with prop variant=dark', () => {
|
|
15
|
+
expect(mount(<GlobeIcon variant="dark" />)).toMatchSnapshot();
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('renders the GlobeIcon prop variant= "light"', () => {
|
|
19
|
+
expect(mount(<GlobeIcon variant="light" />)).toMatchSnapshot();
|
|
20
|
+
});
|
|
21
|
+
it('renders the GlobeIcon prop variant= "error"', () => {
|
|
22
|
+
expect(mount(<GlobeIcon variant="error" />)).toMatchSnapshot();
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it('renders the GlobeIcon props active variant= "light"', () => {
|
|
26
|
+
expect(mount(<GlobeIcon active variant="light" />)).toMatchSnapshot();
|
|
27
|
+
});
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import SvgIcon, { SvgIconProps } from '@digigov/react-core/SvgIcon';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
export interface GlobeIconProps extends SvgIconProps {
|
|
5
|
+
/**
|
|
6
|
+
* ref is optional.
|
|
7
|
+
* ref prop declares the reference of the svg icon component.
|
|
8
|
+
* It can be used to to access the DOM element and the React element.
|
|
9
|
+
*/
|
|
10
|
+
ref?: React.Ref<SVGSVGElement>;
|
|
11
|
+
/**
|
|
12
|
+
* active is optional.
|
|
13
|
+
* The default is 'false'.
|
|
14
|
+
* This prop should be 'true' whenever the user clicks at the globe icon.
|
|
15
|
+
*/
|
|
16
|
+
active?: boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* GlobeIcon is used inside the Header component.
|
|
20
|
+
* It should be linked with the NavHorizontal component. It is hidden when the NavHorizontal is visible and vice versa.
|
|
21
|
+
*/
|
|
22
|
+
export const GlobeIcon: React.FC<GlobeIconProps> = React.forwardRef<
|
|
23
|
+
SVGSVGElement,
|
|
24
|
+
GlobeIconProps
|
|
25
|
+
>(function GlobeIcon({ variant, size, active, className, ...props }, ref) {
|
|
26
|
+
return (
|
|
27
|
+
<SvgIcon
|
|
28
|
+
variant={variant}
|
|
29
|
+
size={size}
|
|
30
|
+
className={clsx(className, {
|
|
31
|
+
'govgr-globe-icon': true,
|
|
32
|
+
'govgr-globe-icon--active': active === true,
|
|
33
|
+
})}
|
|
34
|
+
ref={ref}
|
|
35
|
+
{...props}
|
|
36
|
+
>
|
|
37
|
+
<path
|
|
38
|
+
d="M12,0C5.4,0,0,5.4,0,12s5.4,12,12,12s12-5.4,12-12S18.6,0,12,0z M22.4,13.1C22.4,13.1,22.4,13.2,22.4,13.1
|
|
39
|
+
c0,0.4-0.1,0.8-0.2,1.1v0h-3.6c0.2-1.5,0.2-3,0-4.5h3.6v0c0.1,0.4,0.1,0.7,0.2,1.1c0,0,0,0,0,0C22.5,11.6,22.5,12.4,22.4,13.1z
|
|
40
|
+
M16,21.7c1.1-1.5,2-3.5,2.4-6h3.4c0,0,0,0,0,0C20.8,18.4,18.7,20.6,16,21.7z M21.8,8.2C21.8,8.2,21.8,8.2,21.8,8.2l-3.4,0
|
|
41
|
+
c-0.4-2.4-1.3-4.5-2.4-6C18.7,3.4,20.8,5.6,21.8,8.2L21.8,8.2z M17.1,9.7c0.2,1.5,0.2,3,0,4.5h-4.4V9.7L17.1,9.7L17.1,9.7z
|
|
42
|
+
M12.7,8.2V1.6c1.9,0.6,3.5,3.2,4.1,6.6L12.7,8.2L12.7,8.2z M12.7,15.7h4.1c-0.7,3.4-2.3,6.1-4.1,6.6V15.7L12.7,15.7z M2.2,15.8
|
|
43
|
+
C2.2,15.8,2.2,15.8,2.2,15.8l3.4,0c0.4,2.4,1.3,4.5,2.4,6C5.3,20.6,3.2,18.4,2.2,15.8L2.2,15.8z M8,2.3c-1.1,1.5-2,3.5-2.4,6H2.2
|
|
44
|
+
c0,0,0,0,0,0C3.2,5.6,5.3,3.4,8,2.3z M6.9,14.3c-0.2-1.5-0.2-3,0-4.5h4.4v4.5H6.9L6.9,14.3z M11.2,15.8v6.6
|
|
45
|
+
c-1.9-0.6-3.5-3.2-4.1-6.6L11.2,15.8L11.2,15.8z M11.2,8.3H7.1c0.7-3.4,2.3-6.1,4.1-6.6V8.3L11.2,8.3z M1.6,10.9
|
|
46
|
+
C1.6,10.9,1.6,10.8,1.6,10.9c0-0.4,0.1-0.8,0.2-1.1v0h3.6c-0.2,1.5-0.2,3,0,4.5H1.7v0c-0.1-0.4-0.1-0.7-0.2-1.1c0,0,0,0,0,0
|
|
47
|
+
C1.5,12.4,1.5,11.6,1.6,10.9z"
|
|
48
|
+
/>
|
|
49
|
+
</SvgIcon>
|
|
50
|
+
);
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
export default GlobeIcon;
|
|
@@ -4,10 +4,10 @@ exports[`renders the Masthead with no props 1`] = `
|
|
|
4
4
|
<ForwardRef(Masthead)>
|
|
5
5
|
<ForwardRef(Base)
|
|
6
6
|
as="div"
|
|
7
|
-
className="govgr-masthead govgr-
|
|
7
|
+
className="govgr-background-dark govgr-masthead--primary govgr-masthead"
|
|
8
8
|
>
|
|
9
9
|
<div
|
|
10
|
-
className="govgr-masthead govgr-
|
|
10
|
+
className="govgr-background-dark govgr-masthead--primary govgr-masthead"
|
|
11
11
|
>
|
|
12
12
|
hello
|
|
13
13
|
</div>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`renders the Nav with no props 1`] = `
|
|
4
|
+
<ForwardRef(Nav)>
|
|
5
|
+
<ForwardRef(Base)
|
|
6
|
+
as="nav"
|
|
7
|
+
className="govgr-nav-horizontal--border govgr-horizontal-nav"
|
|
8
|
+
>
|
|
9
|
+
<nav
|
|
10
|
+
className="govgr-nav-horizontal--border govgr-horizontal-nav"
|
|
11
|
+
>
|
|
12
|
+
hello
|
|
13
|
+
</nav>
|
|
14
|
+
</ForwardRef(Base)>
|
|
15
|
+
</ForwardRef(Nav)>
|
|
16
|
+
`;
|
|
17
|
+
|
|
18
|
+
exports[`renders the Nav with open prop 1`] = `
|
|
19
|
+
<ForwardRef(Nav)
|
|
20
|
+
open={true}
|
|
21
|
+
>
|
|
22
|
+
<ForwardRef(Base)
|
|
23
|
+
as="nav"
|
|
24
|
+
className="govgr-nav-horizontal--border govgr-horizontal-nav govgr-horizontal-nav--open"
|
|
25
|
+
>
|
|
26
|
+
<nav
|
|
27
|
+
className="govgr-nav-horizontal--border govgr-horizontal-nav govgr-horizontal-nav--open"
|
|
28
|
+
>
|
|
29
|
+
hello
|
|
30
|
+
</nav>
|
|
31
|
+
</ForwardRef(Base)>
|
|
32
|
+
</ForwardRef(Nav)>
|
|
33
|
+
`;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { mount } from 'enzyme';
|
|
3
|
+
|
|
4
|
+
import Nav from '@digigov/react-core/Nav';
|
|
5
|
+
|
|
6
|
+
it('renders the Nav with no props', () => {
|
|
7
|
+
expect(mount(<Nav>hello</Nav>)).toMatchSnapshot();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('renders the Nav with open prop', () => {
|
|
11
|
+
expect(mount(<Nav open>hello</Nav>)).toMatchSnapshot();
|
|
12
|
+
});
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Base, { BaseProps } from '@digigov/react-core/Base';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
|
|
5
|
+
export interface NavProps extends BaseProps<'nav'> {
|
|
6
|
+
/**
|
|
7
|
+
* active is optional.
|
|
8
|
+
* active prop add background color to navigation link.
|
|
9
|
+
* use this prop only for header navigation;
|
|
10
|
+
*/
|
|
11
|
+
open?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* layout prop sets the display layout for the nav list
|
|
14
|
+
* layout is horizontal by default.
|
|
15
|
+
*/
|
|
16
|
+
layout?: 'vertical' | 'horizontal';
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Nav is mainly used under the Header.
|
|
20
|
+
* This is a wrapper for the NavList component.
|
|
21
|
+
*/
|
|
22
|
+
export const Nav = React.forwardRef<HTMLElement, NavProps>(function Nav(
|
|
23
|
+
{ className, open = false, layout = 'horizontal', children, ...props },
|
|
24
|
+
ref
|
|
25
|
+
) {
|
|
26
|
+
return (
|
|
27
|
+
<Base
|
|
28
|
+
as="nav"
|
|
29
|
+
ref={ref}
|
|
30
|
+
className={clsx(className, {
|
|
31
|
+
'govgr-horizontal-nav': true,
|
|
32
|
+
'govgr-nav-horizontal--border': layout === 'horizontal',
|
|
33
|
+
'govgr-horizontal-nav--open': open,
|
|
34
|
+
})}
|
|
35
|
+
{...props}
|
|
36
|
+
>
|
|
37
|
+
{children}
|
|
38
|
+
</Base>
|
|
39
|
+
);
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
export default Nav;
|
|
@@ -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
|
+
`;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { mount } from 'enzyme';
|
|
3
|
+
|
|
4
|
+
import NavList from '@digigov/react-core/NavList';
|
|
5
|
+
|
|
6
|
+
it('renders the NavList with no props', () => {
|
|
7
|
+
expect(mount(<NavList>hello</NavList>)).toMatchSnapshot();
|
|
8
|
+
});
|
|
9
|
+
it('renders the NavList with active prop', () => {
|
|
10
|
+
expect(mount(<NavList active>hello</NavList>)).toMatchSnapshot();
|
|
11
|
+
});
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Base, { BaseProps } from '@digigov/react-core/Base';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
|
|
5
|
+
export interface NavListProps extends BaseProps<'ul'> {
|
|
6
|
+
/**
|
|
7
|
+
* active prop sets active background color to the nav list.
|
|
8
|
+
* active is false by default.
|
|
9
|
+
*/
|
|
10
|
+
active?: boolean;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* layout prop sets the display layout for the nav list
|
|
14
|
+
* layout is horizontal by default.
|
|
15
|
+
*/
|
|
16
|
+
layout?: 'vertical' | 'horizontal';
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* NavList must be inside the Nav.
|
|
20
|
+
* This component has a list of NavListItem component inside.
|
|
21
|
+
*/
|
|
22
|
+
export const NavList = React.forwardRef<HTMLUListElement, NavListProps>(
|
|
23
|
+
function NavList(
|
|
24
|
+
{ className, active = false, layout = 'horizontal', children, ...props },
|
|
25
|
+
ref
|
|
26
|
+
) {
|
|
27
|
+
return (
|
|
28
|
+
<Base
|
|
29
|
+
as="ul"
|
|
30
|
+
ref={ref}
|
|
31
|
+
className={clsx(className, {
|
|
32
|
+
'govgr-horizontal-nav__list': layout === 'horizontal',
|
|
33
|
+
'govgr-vertical-nav__list': layout === 'vertical',
|
|
34
|
+
'govgr-horizontal-nav__list--active': active,
|
|
35
|
+
})}
|
|
36
|
+
{...props}
|
|
37
|
+
>
|
|
38
|
+
{children}
|
|
39
|
+
</Base>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
export default NavList;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Base, { BaseProps } from '@digigov/react-core/Base';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
|
|
5
|
+
export interface NavListItemProps extends BaseProps<'li'> {
|
|
6
|
+
/**
|
|
7
|
+
* layout prop sets the display layout for the nav list
|
|
8
|
+
* layout is horizontal by default.
|
|
9
|
+
*/
|
|
10
|
+
layout?: 'horizontal' | 'vertical';
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* NavListItem must be inside the NavList.
|
|
14
|
+
* This component has a items of NavListItemLink component inside.
|
|
15
|
+
*/
|
|
16
|
+
export const NavListItem = React.forwardRef<HTMLLIElement, NavListItemProps>(
|
|
17
|
+
function NavHeaderListItem(
|
|
18
|
+
{ className, layout = 'horizontal', children, ...props },
|
|
19
|
+
ref
|
|
20
|
+
) {
|
|
21
|
+
return (
|
|
22
|
+
<Base
|
|
23
|
+
as="li"
|
|
24
|
+
ref={ref}
|
|
25
|
+
className={clsx(className, {
|
|
26
|
+
'govgr-horizontal-nav__list-item': layout === 'horizontal',
|
|
27
|
+
'govgr-vertical-nav__list-item': layout === 'vertical',
|
|
28
|
+
})}
|
|
29
|
+
{...props}
|
|
30
|
+
>
|
|
31
|
+
{children}
|
|
32
|
+
</Base>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
export default NavListItem;
|