@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.
Files changed (322) hide show
  1. package/Accordion/index.d.ts +1 -1
  2. package/AccordionControls/index.d.ts +1 -1
  3. package/AccordionSection/index.d.ts +1 -1
  4. package/AccordionSectionContent/index.d.ts +1 -1
  5. package/AccordionSectionHeader/index.d.ts +1 -1
  6. package/AccordionSectionSummary/index.d.ts +1 -1
  7. package/AccordionSectionSummaryHeading/index.d.ts +1 -1
  8. package/Aside/index.d.ts +1 -1
  9. package/BackLink/index.d.ts +1 -1
  10. package/Base/index.d.ts +20 -0
  11. package/Base/index.js +25 -5
  12. package/Blockquote/index.d.ts +1 -1
  13. package/Bottom/index.d.ts +1 -1
  14. package/Breadcrumbs/index.d.ts +1 -1
  15. package/BreadcrumbsList/index.d.ts +1 -1
  16. package/BreadcrumbsListItem/index.d.ts +1 -1
  17. package/BurgerIcon/__snapshots__/index.test.tsx.snap +1 -211
  18. package/BurgerIcon/index.d.ts +0 -6
  19. package/BurgerIcon/index.js +2 -3
  20. package/BurgerIcon/index.test.js +2 -45
  21. package/Button/index.d.ts +1 -1
  22. package/ButtonGroup/index.d.ts +1 -1
  23. package/ButtonLink/index.d.ts +1 -1
  24. package/CHANGELOG.md +21 -1
  25. package/CallToAction/index.d.ts +1 -1
  26. package/Card/index.d.ts +1 -1
  27. package/CardAction/index.d.ts +1 -1
  28. package/CardHeading/index.d.ts +1 -1
  29. package/CardText/index.d.ts +1 -1
  30. package/Checkbox/index.d.ts +1 -1
  31. package/CheckboxConditional/index.d.ts +1 -1
  32. package/CheckboxItem/index.d.ts +1 -1
  33. package/Confirmation/index.d.ts +1 -1
  34. package/ConfirmationBody/index.d.ts +1 -1
  35. package/ConfirmationTitle/index.d.ts +1 -1
  36. package/Container/index.d.ts +1 -1
  37. package/CopyrightContainer/index.d.ts +1 -1
  38. package/DateInputContainer/index.d.ts +1 -1
  39. package/DateInputItem/index.d.ts +1 -1
  40. package/Details/index.d.ts +1 -1
  41. package/DetailsContent/index.d.ts +1 -1
  42. package/DetailsSummary/index.d.ts +1 -1
  43. package/ErrorMessage/index.d.ts +1 -1
  44. package/ErrorSummary/index.d.ts +1 -1
  45. package/FieldContainer/index.d.ts +1 -1
  46. package/Fieldset/index.d.ts +1 -1
  47. package/FieldsetLegend/index.d.ts +1 -1
  48. package/FileUpload/index.d.ts +1 -1
  49. package/FileUploadContainer/index.d.ts +1 -1
  50. package/Footer/index.d.ts +1 -1
  51. package/FooterContainer/index.d.ts +1 -1
  52. package/FooterContent/index.d.ts +1 -1
  53. package/FooterContentLogos/index.d.ts +1 -1
  54. package/FooterHeading/index.d.ts +1 -1
  55. package/FooterImage/index.d.ts +1 -1
  56. package/FooterInlineList/index.d.ts +1 -1
  57. package/FooterInlineListItem/index.d.ts +1 -1
  58. package/FooterLink/index.d.ts +1 -1
  59. package/FooterList/index.d.ts +1 -1
  60. package/FooterListItem/index.d.ts +1 -1
  61. package/FooterMeta/index.d.ts +1 -1
  62. package/FooterMetaItem/index.d.ts +1 -1
  63. package/FooterNavigation/index.d.ts +1 -1
  64. package/FooterSection/index.d.ts +1 -1
  65. package/Form/index.d.ts +1 -1
  66. package/GlobeIcon/__snapshots__/index.test.tsx.snap +178 -0
  67. package/GlobeIcon/index.d.ts +22 -0
  68. package/GlobeIcon/index.js +46 -0
  69. package/{NavHorizontal → GlobeIcon}/index.test.d.ts +0 -0
  70. package/GlobeIcon/index.test.js +56 -0
  71. package/GovGRLogo/index.d.ts +1 -1
  72. package/Grid/index.d.ts +1 -1
  73. package/Header/index.d.ts +1 -1
  74. package/HeaderContent/index.d.ts +1 -1
  75. package/HeaderLogo/index.d.ts +1 -1
  76. package/HeaderNavMenuContent/index.d.ts +1 -1
  77. package/HeaderSecondaryLogo/index.d.ts +1 -1
  78. package/HeaderSection/index.d.ts +1 -1
  79. package/HeaderSubtitle/index.d.ts +1 -1
  80. package/HeaderTitle/index.d.ts +1 -1
  81. package/Heading/index.d.ts +1 -1
  82. package/HeadingCaption/index.d.ts +1 -1
  83. package/HellenicRepublicLogo/index.d.ts +1 -1
  84. package/Hidden/index.d.ts +1 -1
  85. package/Hint/index.d.ts +1 -1
  86. package/LabelContainer/index.d.ts +1 -1
  87. package/LabelTitle/index.d.ts +1 -1
  88. package/Layout/index.d.ts +1 -1
  89. package/LinkBase/index.d.ts +1 -1
  90. package/List/index.d.ts +1 -1
  91. package/ListItem/index.d.ts +1 -1
  92. package/Main/index.d.ts +1 -1
  93. package/Masthead/__snapshots__/index.test.tsx.snap +2 -2
  94. package/Masthead/index.d.ts +1 -1
  95. package/MastheadBody/index.d.ts +1 -1
  96. package/Nav/__snapshots__/index.test.tsx.snap +33 -0
  97. package/Nav/index.d.ts +21 -0
  98. package/{NavHorizontal → Nav}/index.js +10 -8
  99. package/{NavHorizontalList → Nav}/index.test.d.ts +0 -0
  100. package/Nav/index.test.js +23 -0
  101. package/NavList/__snapshots__/index.test.tsx.snap +33 -0
  102. package/NavList/index.d.ts +20 -0
  103. package/{NavHorizontalList → NavList}/index.js +10 -8
  104. package/{NavHorizontalListItem → NavList}/index.test.d.ts +0 -0
  105. package/NavList/index.test.js +23 -0
  106. package/{esm/NavHorizontalListItem → NavListItem}/__snapshots__/index.test.tsx.snap +1 -1
  107. package/NavListItem/index.d.ts +15 -0
  108. package/{NavHorizontalListItem → NavListItem}/index.js +10 -8
  109. package/{NavHorizontalListItemButton → NavListItem}/index.test.d.ts +0 -0
  110. package/NavListItem/index.test.js +15 -0
  111. package/{esm/NavHorizontalListItemButton → NavListItemButton}/__snapshots__/index.test.tsx.snap +34 -28
  112. package/NavListItemButton/index.d.ts +22 -0
  113. package/{NavHorizontalListItemButton → NavListItemButton}/index.js +5 -5
  114. package/{NavHorizontalListItemLink → NavListItemButton}/index.test.d.ts +0 -0
  115. package/NavListItemButton/index.test.js +31 -0
  116. package/{esm/NavHorizontalListItemLink → NavListItemLink}/__snapshots__/index.test.tsx.snap +15 -15
  117. package/NavListItemLink/index.d.ts +20 -0
  118. package/{NavHorizontalListItemLink → NavListItemLink}/index.js +5 -5
  119. package/NavListItemLink/index.test.d.ts +1 -0
  120. package/NavListItemLink/index.test.js +49 -0
  121. package/NavMenu/__snapshots__/index.test.tsx.snap +4 -2
  122. package/NavMenu/index.d.ts +7 -2
  123. package/NavMenu/index.js +4 -2
  124. package/NavMenuContainer/__snapshots__/index.test.tsx.snap +1 -0
  125. package/NavMenuContainer/index.d.ts +6 -1
  126. package/NavMenuContainer/index.js +4 -1
  127. package/NavMenuContainerContent/index.d.ts +1 -1
  128. package/NavMenuContainerContentList/index.d.ts +6 -1
  129. package/NavMenuContainerContentList/index.js +4 -2
  130. package/NavMenuContainerContentListItem/index.d.ts +1 -1
  131. package/NavMenuContainerTitle/__snapshots__/index.test.tsx.snap +1 -0
  132. package/NavMenuContainerTitle/index.d.ts +6 -1
  133. package/NavMenuContainerTitle/index.js +6 -3
  134. package/NavVertical/index.d.ts +1 -1
  135. package/NavVerticalItem/index.d.ts +2 -2
  136. package/NormalText/index.d.ts +1 -1
  137. package/NotificationBannerContainer/index.d.ts +1 -1
  138. package/NotificationBannerContent/index.d.ts +1 -1
  139. package/NotificationBannerHeader/index.d.ts +1 -1
  140. package/NotificationBannerHeading/index.d.ts +1 -1
  141. package/NotificationBannerLink/index.d.ts +1 -1
  142. package/PageTitle/index.d.ts +1 -1
  143. package/PageTitleCaption/index.d.ts +1 -1
  144. package/PageTitleHeading/index.d.ts +1 -1
  145. package/PageTitleSection/index.d.ts +1 -1
  146. package/Paragraph/index.d.ts +1 -1
  147. package/PhaseBanner/index.d.ts +1 -1
  148. package/PhaseBannerHeaderContainer/index.d.ts +1 -1
  149. package/PhaseBannerTag/index.d.ts +1 -1
  150. package/PhaseBannerText/index.d.ts +1 -1
  151. package/RadioConditional/index.d.ts +1 -1
  152. package/RadioContainer/index.d.ts +1 -1
  153. package/RadioItem/index.d.ts +1 -1
  154. package/SectionBreak/index.d.ts +1 -1
  155. package/SelectContainer/index.d.ts +1 -1
  156. package/SelectOption/index.d.ts +1 -1
  157. package/SkipLink/index.d.ts +1 -1
  158. package/SummaryList/index.d.ts +1 -1
  159. package/SummaryListItem/index.d.ts +1 -1
  160. package/SummaryListItemAction/index.d.ts +1 -1
  161. package/SummaryListItemKey/index.d.ts +1 -1
  162. package/SummaryListItemValue/index.d.ts +1 -1
  163. package/SvgIcon/index.d.ts +1 -1
  164. package/Table/index.d.ts +1 -1
  165. package/TableBody/index.d.ts +1 -1
  166. package/TableCaption/index.d.ts +1 -1
  167. package/TableContainer/index.d.ts +1 -1
  168. package/TableDataCell/index.d.ts +1 -1
  169. package/TableHead/index.d.ts +1 -1
  170. package/TableHeadCell/index.d.ts +1 -1
  171. package/TableNoDataRow/index.d.ts +1 -1
  172. package/TableRow/index.d.ts +1 -1
  173. package/Tabs/index.d.ts +1 -1
  174. package/TabsHeading/index.d.ts +1 -1
  175. package/TabsList/index.d.ts +1 -1
  176. package/TabsListItem/index.d.ts +1 -1
  177. package/TabsPanel/index.d.ts +1 -1
  178. package/TextArea/index.d.ts +1 -1
  179. package/TextInput/index.d.ts +1 -1
  180. package/Top/index.d.ts +1 -1
  181. package/VisuallyHidden/index.d.ts +1 -1
  182. package/WarningText/index.d.ts +1 -1
  183. package/es/Base/index.js +25 -5
  184. package/es/BurgerIcon/__snapshots__/index.test.tsx.snap +1 -211
  185. package/es/BurgerIcon/index.js +2 -3
  186. package/es/BurgerIcon/index.test.js +2 -45
  187. package/es/GlobeIcon/__snapshots__/index.test.tsx.snap +178 -0
  188. package/es/GlobeIcon/index.js +30 -0
  189. package/es/GlobeIcon/index.test.js +50 -0
  190. package/es/Masthead/__snapshots__/index.test.tsx.snap +2 -2
  191. package/es/Nav/__snapshots__/index.test.tsx.snap +33 -0
  192. package/{esm/NavHorizontal → es/Nav}/index.js +8 -6
  193. package/es/Nav/index.test.js +17 -0
  194. package/es/NavList/__snapshots__/index.test.tsx.snap +33 -0
  195. package/{esm/NavHorizontalList → es/NavList}/index.js +8 -6
  196. package/es/NavList/index.test.js +17 -0
  197. package/{src/NavHorizontalListItem → es/NavListItem}/__snapshots__/index.test.tsx.snap +1 -1
  198. package/es/NavListItem/index.js +25 -0
  199. package/es/NavListItem/index.test.js +9 -0
  200. package/es/{NavHorizontalListItemButton → NavListItemButton}/__snapshots__/index.test.tsx.snap +34 -28
  201. package/{esm/NavHorizontalListItemButton → es/NavListItemButton}/index.js +3 -3
  202. package/es/NavListItemButton/index.test.js +25 -0
  203. package/{NavHorizontalListItemLink → es/NavListItemLink}/__snapshots__/index.test.tsx.snap +15 -15
  204. package/es/{NavHorizontalListItemLink → NavListItemLink}/index.js +3 -3
  205. package/es/NavListItemLink/index.test.js +43 -0
  206. package/es/NavMenu/__snapshots__/index.test.tsx.snap +4 -2
  207. package/es/NavMenu/index.js +4 -2
  208. package/es/NavMenuContainer/__snapshots__/index.test.tsx.snap +1 -0
  209. package/es/NavMenuContainer/index.js +4 -1
  210. package/es/NavMenuContainerContentList/index.js +4 -2
  211. package/es/NavMenuContainerTitle/__snapshots__/index.test.tsx.snap +1 -0
  212. package/es/NavMenuContainerTitle/index.js +6 -3
  213. package/es/index.js +6 -5
  214. package/es/registry.js +12 -10
  215. package/esm/Base/index.js +25 -5
  216. package/esm/BurgerIcon/__snapshots__/index.test.tsx.snap +1 -211
  217. package/esm/BurgerIcon/index.js +2 -3
  218. package/esm/BurgerIcon/index.test.js +2 -45
  219. package/esm/GlobeIcon/__snapshots__/index.test.tsx.snap +178 -0
  220. package/esm/GlobeIcon/index.js +30 -0
  221. package/esm/GlobeIcon/index.test.js +50 -0
  222. package/esm/Masthead/__snapshots__/index.test.tsx.snap +2 -2
  223. package/esm/Nav/__snapshots__/index.test.tsx.snap +33 -0
  224. package/{es/NavHorizontal → esm/Nav}/index.js +8 -6
  225. package/esm/Nav/index.test.js +17 -0
  226. package/esm/NavList/__snapshots__/index.test.tsx.snap +33 -0
  227. package/{es/NavHorizontalList → esm/NavList}/index.js +8 -6
  228. package/esm/NavList/index.test.js +17 -0
  229. package/{NavHorizontalListItem → esm/NavListItem}/__snapshots__/index.test.tsx.snap +1 -1
  230. package/esm/NavListItem/index.js +25 -0
  231. package/esm/NavListItem/index.test.js +9 -0
  232. package/{src/NavHorizontalListItemButton → esm/NavListItemButton}/__snapshots__/index.test.tsx.snap +34 -28
  233. package/{es/NavHorizontalListItemButton → esm/NavListItemButton}/index.js +3 -3
  234. package/esm/NavListItemButton/index.test.js +25 -0
  235. package/{src/NavHorizontalListItemLink → esm/NavListItemLink}/__snapshots__/index.test.tsx.snap +15 -15
  236. package/esm/{NavHorizontalListItemLink → NavListItemLink}/index.js +3 -3
  237. package/esm/NavListItemLink/index.test.js +43 -0
  238. package/esm/NavMenu/__snapshots__/index.test.tsx.snap +4 -2
  239. package/esm/NavMenu/index.js +4 -2
  240. package/esm/NavMenuContainer/__snapshots__/index.test.tsx.snap +1 -0
  241. package/esm/NavMenuContainer/index.js +4 -1
  242. package/esm/NavMenuContainerContentList/index.js +4 -2
  243. package/esm/NavMenuContainerTitle/__snapshots__/index.test.tsx.snap +1 -0
  244. package/esm/NavMenuContainerTitle/index.js +6 -3
  245. package/esm/index.js +7 -6
  246. package/esm/registry.js +12 -10
  247. package/index.d.ts +6 -5
  248. package/index.js +33 -20
  249. package/package.json +2 -3
  250. package/registry.d.ts +6 -5
  251. package/registry.js +13 -10
  252. package/src/Base/index.tsx +63 -3
  253. package/src/BurgerIcon/__snapshots__/index.test.tsx.snap +1 -211
  254. package/src/BurgerIcon/index.test.tsx +1 -20
  255. package/src/BurgerIcon/index.tsx +1 -14
  256. package/src/GlobeIcon/__snapshots__/index.test.tsx.snap +178 -0
  257. package/src/GlobeIcon/index.test.tsx +27 -0
  258. package/src/GlobeIcon/index.tsx +53 -0
  259. package/src/Masthead/__snapshots__/index.test.tsx.snap +2 -2
  260. package/src/Nav/__snapshots__/index.test.tsx.snap +33 -0
  261. package/src/Nav/index.test.tsx +12 -0
  262. package/src/Nav/index.tsx +42 -0
  263. package/src/NavList/__snapshots__/index.test.tsx.snap +33 -0
  264. package/src/NavList/index.test.tsx +11 -0
  265. package/src/NavList/index.tsx +44 -0
  266. package/{es/NavHorizontalListItem → src/NavListItem}/__snapshots__/index.test.tsx.snap +1 -1
  267. package/src/NavListItem/index.test.tsx +8 -0
  268. package/src/NavListItem/index.tsx +37 -0
  269. package/{NavHorizontalListItemButton → src/NavListItemButton}/__snapshots__/index.test.tsx.snap +34 -28
  270. package/src/NavListItemButton/index.test.tsx +19 -0
  271. package/src/{NavHorizontalListItemButton → NavListItemButton}/index.tsx +8 -8
  272. package/{es/NavHorizontalListItemLink → src/NavListItemLink}/__snapshots__/index.test.tsx.snap +15 -15
  273. package/src/NavListItemLink/index.test.tsx +37 -0
  274. package/src/{NavHorizontalListItemLink → NavListItemLink}/index.tsx +7 -7
  275. package/src/NavMenu/__snapshots__/index.test.tsx.snap +4 -2
  276. package/src/NavMenu/index.tsx +12 -3
  277. package/src/NavMenuContainer/__snapshots__/index.test.tsx.snap +1 -0
  278. package/src/NavMenuContainer/index.tsx +17 -3
  279. package/src/NavMenuContainerContentList/index.tsx +13 -3
  280. package/src/NavMenuContainerTitle/__snapshots__/index.test.tsx.snap +1 -0
  281. package/src/NavMenuContainerTitle/index.tsx +28 -4
  282. package/src/NavVerticalItem/index.tsx +1 -1
  283. package/src/index.ts +6 -5
  284. package/src/registry.js +12 -10
  285. package/NavHorizontal/__snapshots__/index.test.tsx.snap +0 -33
  286. package/NavHorizontal/index.d.ts +0 -16
  287. package/NavHorizontal/index.test.js +0 -23
  288. package/NavHorizontalList/__snapshots__/index.test.tsx.snap +0 -33
  289. package/NavHorizontalList/index.d.ts +0 -15
  290. package/NavHorizontalList/index.test.js +0 -23
  291. package/NavHorizontalListItem/index.d.ts +0 -10
  292. package/NavHorizontalListItem/index.test.js +0 -15
  293. package/NavHorizontalListItemButton/index.d.ts +0 -22
  294. package/NavHorizontalListItemButton/index.test.js +0 -31
  295. package/NavHorizontalListItemLink/index.d.ts +0 -20
  296. package/NavHorizontalListItemLink/index.test.js +0 -49
  297. package/es/NavHorizontal/__snapshots__/index.test.tsx.snap +0 -33
  298. package/es/NavHorizontal/index.test.js +0 -17
  299. package/es/NavHorizontalList/__snapshots__/index.test.tsx.snap +0 -33
  300. package/es/NavHorizontalList/index.test.js +0 -17
  301. package/es/NavHorizontalListItem/index.js +0 -23
  302. package/es/NavHorizontalListItem/index.test.js +0 -9
  303. package/es/NavHorizontalListItemButton/index.test.js +0 -25
  304. package/es/NavHorizontalListItemLink/index.test.js +0 -43
  305. package/esm/NavHorizontal/__snapshots__/index.test.tsx.snap +0 -33
  306. package/esm/NavHorizontal/index.test.js +0 -17
  307. package/esm/NavHorizontalList/__snapshots__/index.test.tsx.snap +0 -33
  308. package/esm/NavHorizontalList/index.test.js +0 -17
  309. package/esm/NavHorizontalListItem/index.js +0 -23
  310. package/esm/NavHorizontalListItem/index.test.js +0 -9
  311. package/esm/NavHorizontalListItemButton/index.test.js +0 -25
  312. package/esm/NavHorizontalListItemLink/index.test.js +0 -43
  313. package/src/NavHorizontal/__snapshots__/index.test.tsx.snap +0 -33
  314. package/src/NavHorizontal/index.test.tsx +0 -12
  315. package/src/NavHorizontal/index.tsx +0 -35
  316. package/src/NavHorizontalList/__snapshots__/index.test.tsx.snap +0 -33
  317. package/src/NavHorizontalList/index.test.tsx +0 -13
  318. package/src/NavHorizontalList/index.tsx +0 -39
  319. package/src/NavHorizontalListItem/index.test.tsx +0 -10
  320. package/src/NavHorizontalListItem/index.tsx +0 -28
  321. package/src/NavHorizontalListItemButton/index.test.tsx +0 -29
  322. package/src/NavHorizontalListItemLink/index.test.tsx +0 -45
@@ -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-background-dark"
7
+ className="govgr-background-dark govgr-masthead--primary govgr-masthead"
8
8
  >
9
9
  <div
10
- className="govgr-masthead govgr-background-dark"
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;
@@ -1,6 +1,6 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`renders the NavHorizontalListItem with no props 1`] = `
3
+ exports[`renders the NavListItem with no props 1`] = `
4
4
  <ForwardRef(NavHeaderListItem)>
5
5
  <ForwardRef(Base)
6
6
  as="li"
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { mount } from 'enzyme';
3
+
4
+ import NavListItem from '@digigov/react-core/NavListItem';
5
+
6
+ it('renders the NavListItem with no props', () => {
7
+ expect(mount(<NavListItem>hello</NavListItem>)).toMatchSnapshot();
8
+ });
@@ -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;