@digigov/ui 0.30.2 → 0.31.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 (313) hide show
  1. package/CHANGELOG.md +16 -1
  2. package/admin/AccessibilityMenu/index.d.ts +13 -0
  3. package/admin/AccessibilityMenu/index.js +170 -0
  4. package/admin/AutoComplete/index.d.ts +2 -2
  5. package/admin/Chip/index.d.ts +1 -0
  6. package/admin/Chip/index.js +14 -0
  7. package/admin/Drawer/__stories__/Default.js +18 -7
  8. package/admin/Dropdown/__stories__/AlignRight.js +0 -2
  9. package/admin/Dropdown/__stories__/Default.js +0 -2
  10. package/admin/Dropdown/__stories__/PlacementTop.js +0 -2
  11. package/admin/FilterSection/index.d.ts +1 -2
  12. package/admin/FilterSection/index.js +4 -18
  13. package/admin/Modal/index.d.ts +2 -2
  14. package/admin/Modal/index.js +17 -12
  15. package/admin/Pagination/__stories__/Default.js +4 -7
  16. package/admin/Pagination/__stories__/PaginationSmall.js +2 -3
  17. package/app/Footer/__stories__/FooterAllInclusive.js +1 -0
  18. package/app/Footer/__stories__/FooterWithSecondaryNavigation.js +1 -0
  19. package/app/Header/__stories__/WithNavigation.js +10 -8
  20. package/app/QrCodeScanner/__stories__/Default.js +3 -3
  21. package/app/QrCodeViewer/QRCode.stories.d.ts +0 -1
  22. package/app/QrCodeViewer/index.d.ts +1 -2
  23. package/app/QrCodeViewer/index.js +10 -10
  24. package/app/ThemeOptionsForm/index.d.ts +2 -0
  25. package/app/ThemeOptionsForm/index.js +243 -0
  26. package/app/ThemePaletteForm/index.d.ts +2 -0
  27. package/app/{ThemeSelectorOptions → ThemePaletteForm}/index.js +9 -8
  28. package/app/index.d.ts +2 -1
  29. package/app/index.js +17 -4
  30. package/core/Accordion/index.d.ts +2 -2
  31. package/core/Accordion/index.js +7 -7
  32. package/core/Divider/__stories__/Default.js +5 -10
  33. package/core/ErrorSummary/__stories__/Default.js +3 -3
  34. package/core/ErrorSummary/__stories__/LinkedToCheckbox.js +3 -3
  35. package/core/ErrorSummary/__stories__/LinkedToField.js +3 -3
  36. package/core/ErrorSummary/__stories__/LinkedToInput.js +3 -3
  37. package/core/Link/__stories__/DarkBackground.js +6 -2
  38. package/core/Link/__stories__/DarkBackgroundNoUnderline.js +6 -2
  39. package/core/NavList/NavList.stories.d.ts +3 -1
  40. package/core/NavList/NavList.stories.js +32 -4
  41. package/core/NavList/NavList.stories.playwright.json +6 -6
  42. package/core/NavList/{NavListAuto.js → NavListAuto/NavListAuto.js} +11 -5
  43. package/core/NavList/{NavListBase.d.ts → NavListAuto/NavListBaseAuto.d.ts} +1 -1
  44. package/core/NavList/{NavListBase.js → NavListAuto/NavListBaseAuto.js} +6 -4
  45. package/core/NavList/{NavListContext.d.ts → NavListAuto/NavListContextAuto.d.ts} +7 -4
  46. package/core/NavList/{NavListContext.js → NavListAuto/NavListContextAuto.js} +23 -11
  47. package/core/NavList/NavListAuto/NavListItemAnchorAuto.d.ts +11 -0
  48. package/core/NavList/{NavListSubMenu.js → NavListAuto/NavListItemAnchorAuto.js} +25 -21
  49. package/core/NavList/{NavListItemAuto.js → NavListAuto/NavListItemAuto.js} +23 -20
  50. package/core/NavList/NavListAuto/NavListItemButtonAuto.d.ts +12 -0
  51. package/core/NavList/NavListAuto/NavListItemButtonAuto.js +50 -0
  52. package/core/NavList/NavListAuto/NavListMenuAuto.d.ts +11 -0
  53. package/core/NavList/NavListAuto/NavListMenuAuto.js +59 -0
  54. package/core/NavList/NavListAuto/NavListSubMenuAuto.d.ts +9 -0
  55. package/core/NavList/NavListAuto/NavListSubMenuAuto.js +46 -0
  56. package/core/NavList/NavListItem.js +6 -5
  57. package/core/NavList/NavListItemBase.d.ts +1 -1
  58. package/core/NavList/NavListItemBase.js +3 -3
  59. package/core/NavList/NavMenuContainerContentList.d.ts +3 -1
  60. package/core/NavList/NavMenuContainerContentList.js +76 -3
  61. package/core/NavList/__stories__/Default.js +19 -6
  62. package/core/NavList/__stories__/NavHorizontalLayout.js +17 -5
  63. package/core/NavList/__stories__/NavListEpathlaExample.js +24 -12
  64. package/core/NavList/__stories__/NavListHorizontalAutoExample.d.ts +2 -0
  65. package/core/NavList/__stories__/NavListHorizontalAutoExample.js +67 -0
  66. package/core/NavList/__stories__/NavListSecondaryAutoExample.d.ts +2 -0
  67. package/core/NavList/__stories__/NavListSecondaryAutoExample.js +281 -0
  68. package/core/NavList/__stories__/NavListVerticalAutoExample.d.ts +2 -0
  69. package/core/NavList/__stories__/NavListVerticalAutoExample.js +67 -0
  70. package/core/NavList/index.d.ts +2 -5
  71. package/core/NavList/index.js +5 -33
  72. package/core/NavList/types.d.ts +20 -10
  73. package/core/Tabs/__stories__/Default.js +5 -5
  74. package/core/Tabs/index.d.ts +2 -2
  75. package/core/Tabs/index.js +5 -7
  76. package/es/admin/AccessibilityMenu/index.js +13 -0
  77. package/es/admin/Chip/index.js +1 -0
  78. package/es/admin/Drawer/__stories__/Default.js +19 -8
  79. package/es/admin/Dropdown/__stories__/AlignRight.js +0 -2
  80. package/es/admin/Dropdown/__stories__/Default.js +0 -2
  81. package/es/admin/Dropdown/__stories__/PlacementTop.js +0 -2
  82. package/es/admin/FilterSection/index.js +1 -2
  83. package/es/admin/Modal/index.js +16 -11
  84. package/es/admin/Pagination/__stories__/Default.js +4 -7
  85. package/es/admin/Pagination/__stories__/PaginationSmall.js +2 -3
  86. package/es/app/Footer/__stories__/FooterAllInclusive.js +1 -0
  87. package/es/app/Footer/__stories__/FooterWithSecondaryNavigation.js +1 -0
  88. package/es/app/Header/__stories__/WithNavigation.js +10 -8
  89. package/es/app/QrCodeScanner/__stories__/Default.js +3 -3
  90. package/es/app/QrCodeViewer/index.js +8 -9
  91. package/es/app/ThemeOptionsForm/index.js +215 -0
  92. package/es/app/{ThemeSelectorOptions → ThemePaletteForm}/index.js +5 -4
  93. package/es/app/index.js +2 -1
  94. package/es/core/Accordion/index.js +7 -7
  95. package/es/core/Divider/__stories__/Default.js +5 -10
  96. package/es/core/ErrorSummary/__stories__/Default.js +3 -3
  97. package/es/core/ErrorSummary/__stories__/LinkedToCheckbox.js +3 -3
  98. package/es/core/ErrorSummary/__stories__/LinkedToField.js +3 -3
  99. package/es/core/ErrorSummary/__stories__/LinkedToInput.js +3 -3
  100. package/es/core/Link/__stories__/DarkBackground.js +6 -2
  101. package/es/core/Link/__stories__/DarkBackgroundNoUnderline.js +6 -2
  102. package/es/core/NavList/NavList.stories.js +3 -1
  103. package/es/core/NavList/NavList.stories.playwright.json +6 -6
  104. package/{esm/core/NavList → es/core/NavList/NavListAuto}/NavListAuto.js +11 -5
  105. package/{esm/core/NavList/NavListBase.js → es/core/NavList/NavListAuto/NavListBaseAuto.js} +4 -2
  106. package/es/core/NavList/{NavListContext.js → NavListAuto/NavListContextAuto.js} +20 -8
  107. package/es/core/NavList/NavListAuto/NavListItemAnchorAuto.js +29 -0
  108. package/es/core/NavList/NavListAuto/NavListItemAuto.js +42 -0
  109. package/es/core/NavList/NavListAuto/NavListItemButtonAuto.js +32 -0
  110. package/es/core/NavList/NavListAuto/NavListMenuAuto.js +39 -0
  111. package/es/core/NavList/NavListAuto/NavListSubMenuAuto.js +28 -0
  112. package/es/core/NavList/NavListItem.js +8 -7
  113. package/es/core/NavList/NavListItemBase.js +3 -3
  114. package/es/core/NavList/NavMenuContainerContentList.js +67 -1
  115. package/es/core/NavList/__stories__/Default.js +19 -6
  116. package/es/core/NavList/__stories__/NavHorizontalLayout.js +17 -5
  117. package/es/core/NavList/__stories__/NavListEpathlaExample.js +24 -12
  118. package/es/core/NavList/__stories__/NavListHorizontalAutoExample.js +51 -0
  119. package/es/core/NavList/__stories__/NavListSecondaryAutoExample.js +255 -0
  120. package/es/core/NavList/__stories__/NavListVerticalAutoExample.js +51 -0
  121. package/es/core/NavList/index.js +2 -5
  122. package/es/core/Tabs/__stories__/Default.js +5 -5
  123. package/es/core/Tabs/index.js +5 -7
  124. package/es/hooks/useFontSize.js +10 -0
  125. package/es/hooks/useHighlightLinks.js +38 -0
  126. package/es/hooks/useLetterSpacing.js +10 -0
  127. package/es/hooks/useLineHeight.js +10 -0
  128. package/es/hooks/useNavList.js +10 -7
  129. package/es/hooks/useTheme.js +19 -11
  130. package/es/hooks/useTogglableNav.js +292 -0
  131. package/es/hooks/{useTogglableSections.js → useTogglableTab.js} +2 -8
  132. package/es/hooks/useVariantVars.js +30 -0
  133. package/es/layouts/Basic/__stories__/Default.js +2 -2
  134. package/es/layouts/Basic/__stories__/MultipleRowsLayout.js +3 -3
  135. package/es/layouts/Basic/__stories__/TwoThirdsOneThirdColumns.js +3 -3
  136. package/es/registry.js +36 -14
  137. package/es/typography/NormalText/__stories__/FontSizes.js +18 -6
  138. package/es/typography/NormalText/__stories__/FontWeight.js +3 -1
  139. package/es/typography/NormalText/__stories__/Variants.js +3 -1
  140. package/esm/admin/AccessibilityMenu/index.js +13 -0
  141. package/esm/admin/Chip/index.js +1 -0
  142. package/esm/admin/Drawer/__stories__/Default.js +19 -8
  143. package/esm/admin/Dropdown/__stories__/AlignRight.js +0 -2
  144. package/esm/admin/Dropdown/__stories__/Default.js +0 -2
  145. package/esm/admin/Dropdown/__stories__/PlacementTop.js +0 -2
  146. package/esm/admin/FilterSection/index.js +1 -2
  147. package/esm/admin/Modal/index.js +16 -11
  148. package/esm/admin/Pagination/__stories__/Default.js +4 -7
  149. package/esm/admin/Pagination/__stories__/PaginationSmall.js +2 -3
  150. package/esm/app/Footer/__stories__/FooterAllInclusive.js +1 -0
  151. package/esm/app/Footer/__stories__/FooterWithSecondaryNavigation.js +1 -0
  152. package/esm/app/Header/__stories__/WithNavigation.js +10 -8
  153. package/esm/app/QrCodeScanner/__stories__/Default.js +3 -3
  154. package/esm/app/QrCodeViewer/index.js +8 -9
  155. package/esm/app/ThemeOptionsForm/index.js +215 -0
  156. package/esm/app/{ThemeSelectorOptions → ThemePaletteForm}/index.js +5 -4
  157. package/esm/app/index.js +2 -1
  158. package/esm/core/Accordion/index.js +7 -7
  159. package/esm/core/Divider/__stories__/Default.js +5 -10
  160. package/esm/core/ErrorSummary/__stories__/Default.js +3 -3
  161. package/esm/core/ErrorSummary/__stories__/LinkedToCheckbox.js +3 -3
  162. package/esm/core/ErrorSummary/__stories__/LinkedToField.js +3 -3
  163. package/esm/core/ErrorSummary/__stories__/LinkedToInput.js +3 -3
  164. package/esm/core/Link/__stories__/DarkBackground.js +6 -2
  165. package/esm/core/Link/__stories__/DarkBackgroundNoUnderline.js +6 -2
  166. package/esm/core/NavList/NavList.stories.js +3 -1
  167. package/esm/core/NavList/NavList.stories.playwright.json +6 -6
  168. package/{es/core/NavList → esm/core/NavList/NavListAuto}/NavListAuto.js +11 -5
  169. package/{es/core/NavList/NavListBase.js → esm/core/NavList/NavListAuto/NavListBaseAuto.js} +4 -2
  170. package/esm/core/NavList/{NavListContext.js → NavListAuto/NavListContextAuto.js} +20 -8
  171. package/esm/core/NavList/NavListAuto/NavListItemAnchorAuto.js +29 -0
  172. package/esm/core/NavList/NavListAuto/NavListItemAuto.js +42 -0
  173. package/esm/core/NavList/NavListAuto/NavListItemButtonAuto.js +32 -0
  174. package/esm/core/NavList/NavListAuto/NavListMenuAuto.js +39 -0
  175. package/esm/core/NavList/NavListAuto/NavListSubMenuAuto.js +28 -0
  176. package/esm/core/NavList/NavListItem.js +8 -7
  177. package/esm/core/NavList/NavListItemBase.js +3 -3
  178. package/esm/core/NavList/NavMenuContainerContentList.js +67 -1
  179. package/esm/core/NavList/__stories__/Default.js +19 -6
  180. package/esm/core/NavList/__stories__/NavHorizontalLayout.js +17 -5
  181. package/esm/core/NavList/__stories__/NavListEpathlaExample.js +24 -12
  182. package/esm/core/NavList/__stories__/NavListHorizontalAutoExample.js +51 -0
  183. package/esm/core/NavList/__stories__/NavListSecondaryAutoExample.js +255 -0
  184. package/esm/core/NavList/__stories__/NavListVerticalAutoExample.js +51 -0
  185. package/esm/core/NavList/index.js +2 -5
  186. package/esm/core/Tabs/__stories__/Default.js +5 -5
  187. package/esm/core/Tabs/index.js +5 -7
  188. package/esm/hooks/useFontSize.js +10 -0
  189. package/esm/hooks/useHighlightLinks.js +38 -0
  190. package/esm/hooks/useLetterSpacing.js +10 -0
  191. package/esm/hooks/useLineHeight.js +10 -0
  192. package/esm/hooks/useNavList.js +10 -7
  193. package/esm/hooks/useTheme.js +19 -11
  194. package/esm/hooks/useTogglableNav.js +292 -0
  195. package/esm/hooks/{useTogglableSections.js → useTogglableTab.js} +2 -8
  196. package/esm/hooks/useVariantVars.js +30 -0
  197. package/esm/index.js +1 -1
  198. package/esm/layouts/Basic/__stories__/Default.js +2 -2
  199. package/esm/layouts/Basic/__stories__/MultipleRowsLayout.js +3 -3
  200. package/esm/layouts/Basic/__stories__/TwoThirdsOneThirdColumns.js +3 -3
  201. package/esm/registry.js +36 -14
  202. package/esm/typography/NormalText/__stories__/FontSizes.js +18 -6
  203. package/esm/typography/NormalText/__stories__/FontWeight.js +3 -1
  204. package/esm/typography/NormalText/__stories__/Variants.js +3 -1
  205. package/hooks/useFontSize.d.ts +6 -0
  206. package/hooks/useFontSize.js +23 -0
  207. package/hooks/useHighlightLinks.d.ts +8 -0
  208. package/hooks/useHighlightLinks.js +52 -0
  209. package/hooks/useLetterSpacing.d.ts +6 -0
  210. package/hooks/useLetterSpacing.js +23 -0
  211. package/hooks/useLineHeight.d.ts +6 -0
  212. package/hooks/useLineHeight.js +23 -0
  213. package/hooks/useNavList.d.ts +2 -2
  214. package/hooks/useNavList.js +11 -8
  215. package/hooks/useTheme.d.ts +4 -4
  216. package/hooks/useTheme.js +19 -12
  217. package/hooks/useTogglableNav.d.ts +25 -0
  218. package/hooks/useTogglableNav.js +305 -0
  219. package/hooks/{useTogglableSections.d.ts → useTogglableTab.d.ts} +4 -3
  220. package/hooks/{useTogglableSections.js → useTogglableTab.js} +3 -9
  221. package/hooks/useVariantVars.d.ts +11 -0
  222. package/hooks/useVariantVars.js +41 -0
  223. package/layouts/Basic/__stories__/Default.js +2 -2
  224. package/layouts/Basic/__stories__/MultipleRowsLayout.js +3 -3
  225. package/layouts/Basic/__stories__/TwoThirdsOneThirdColumns.js +3 -3
  226. package/package.json +3 -3
  227. package/registry.d.ts +18 -7
  228. package/registry.js +49 -16
  229. package/src/admin/AccessibilityMenu/index.tsx +14 -0
  230. package/src/admin/AutoComplete/index.tsx +2 -2
  231. package/src/admin/Chip/index.tsx +1 -0
  232. package/src/admin/Drawer/__stories__/Default.tsx +23 -9
  233. package/src/admin/Dropdown/__stories__/AlignRight.tsx +2 -2
  234. package/src/admin/Dropdown/__stories__/Default.tsx +2 -2
  235. package/src/admin/Dropdown/__stories__/PlacementTop.tsx +2 -2
  236. package/src/admin/FilterSection/index.tsx +1 -2
  237. package/src/admin/Modal/index.tsx +43 -39
  238. package/src/admin/Pagination/__stories__/Default.tsx +4 -4
  239. package/src/admin/Pagination/__stories__/PaginationSmall.tsx +2 -2
  240. package/src/app/Footer/__stories__/FooterAllInclusive.tsx +1 -1
  241. package/src/app/Footer/__stories__/FooterWithSecondaryNavigation.tsx +1 -1
  242. package/src/app/Header/__stories__/WithNavigation.tsx +8 -8
  243. package/src/app/QrCodeScanner/__stories__/Default.tsx +2 -2
  244. package/src/app/QrCodeViewer/index.tsx +16 -14
  245. package/src/app/ThemeOptionsForm/index.tsx +220 -0
  246. package/src/app/{ThemeSelectorOptions → ThemePaletteForm}/index.tsx +3 -3
  247. package/src/app/index.ts +2 -1
  248. package/src/core/Accordion/index.tsx +5 -11
  249. package/src/core/Divider/__stories__/Default.tsx +5 -5
  250. package/src/core/ErrorSummary/__stories__/Default.tsx +2 -2
  251. package/src/core/ErrorSummary/__stories__/LinkedToCheckbox.tsx +2 -2
  252. package/src/core/ErrorSummary/__stories__/LinkedToField.tsx +2 -2
  253. package/src/core/ErrorSummary/__stories__/LinkedToInput.tsx +2 -2
  254. package/src/core/Link/__stories__/DarkBackground.tsx +2 -3
  255. package/src/core/Link/__stories__/DarkBackgroundNoUnderline.tsx +2 -3
  256. package/src/core/NavList/NavList.stories.js +3 -1
  257. package/src/core/NavList/NavList.stories.playwright.json +6 -6
  258. package/src/core/NavList/NavListAuto/NavListAuto.tsx +34 -0
  259. package/src/core/NavList/{NavListBase.tsx → NavListAuto/NavListBaseAuto.tsx} +2 -2
  260. package/src/core/NavList/{NavListContext.tsx → NavListAuto/NavListContextAuto.tsx} +26 -11
  261. package/src/core/NavList/NavListAuto/NavListItemAnchorAuto.tsx +41 -0
  262. package/src/core/NavList/NavListAuto/NavListItemAuto.tsx +51 -0
  263. package/src/core/NavList/NavListAuto/NavListItemButtonAuto.tsx +53 -0
  264. package/src/core/NavList/NavListAuto/NavListMenuAuto.tsx +51 -0
  265. package/src/core/NavList/NavListAuto/NavListSubMenuAuto.tsx +32 -0
  266. package/src/core/NavList/NavListItem.tsx +15 -9
  267. package/src/core/NavList/NavListItemBase.tsx +3 -3
  268. package/src/core/NavList/NavMenuContainerContentList.tsx +63 -1
  269. package/src/core/NavList/__stories__/Default.tsx +23 -8
  270. package/src/core/NavList/__stories__/NavHorizontalLayout.tsx +24 -8
  271. package/src/core/NavList/__stories__/NavListEpathlaExample.tsx +46 -25
  272. package/src/core/NavList/__stories__/NavListHorizontalAutoExample.tsx +65 -0
  273. package/src/core/NavList/__stories__/NavListSecondaryAutoExample.tsx +284 -0
  274. package/src/core/NavList/__stories__/NavListVerticalAutoExample.tsx +65 -0
  275. package/src/core/NavList/index.tsx +2 -5
  276. package/src/core/NavList/types.tsx +23 -9
  277. package/src/core/Tabs/__stories__/Default.tsx +5 -5
  278. package/src/core/Tabs/index.tsx +5 -9
  279. package/src/hooks/useFontSize.ts +32 -0
  280. package/src/hooks/useHighlightLinks.ts +45 -0
  281. package/src/hooks/useLetterSpacing.ts +27 -0
  282. package/src/hooks/useLineHeight.ts +31 -0
  283. package/src/hooks/useNavList.ts +5 -7
  284. package/src/hooks/useTheme.ts +28 -20
  285. package/src/hooks/useTogglableNav.tsx +294 -0
  286. package/src/hooks/{useTogglableSections.tsx → useTogglableTab.tsx} +12 -13
  287. package/src/hooks/useVariantVars.ts +35 -0
  288. package/src/layouts/Basic/__stories__/Default.tsx +3 -3
  289. package/src/layouts/Basic/__stories__/MultipleRowsLayout.tsx +8 -8
  290. package/src/layouts/Basic/__stories__/TwoThirdsOneThirdColumns.tsx +6 -6
  291. package/src/registry.js +36 -14
  292. package/src/typography/NormalText/__stories__/FontSizes.tsx +6 -6
  293. package/src/typography/NormalText/__stories__/FontWeight.tsx +1 -1
  294. package/src/typography/NormalText/__stories__/Variants.tsx +1 -1
  295. package/typography/NormalText/__stories__/FontSizes.js +18 -6
  296. package/typography/NormalText/__stories__/FontWeight.js +3 -1
  297. package/typography/NormalText/__stories__/Variants.js +3 -1
  298. package/app/ThemeSelectorOptions/index.d.ts +0 -2
  299. package/core/NavList/NavListSubMenu.d.ts +0 -8
  300. package/core/NavList/__stories__/NavListAutoExample.d.ts +0 -2
  301. package/core/NavList/__stories__/NavListAutoExample.js +0 -63
  302. package/es/core/NavList/NavListItemAuto.js +0 -40
  303. package/es/core/NavList/NavListSubMenu.js +0 -25
  304. package/es/core/NavList/__stories__/NavListAutoExample.js +0 -48
  305. package/esm/core/NavList/NavListItemAuto.js +0 -40
  306. package/esm/core/NavList/NavListSubMenu.js +0 -25
  307. package/esm/core/NavList/__stories__/NavListAutoExample.js +0 -48
  308. package/src/core/NavList/NavListAuto.tsx +0 -20
  309. package/src/core/NavList/NavListItemAuto.tsx +0 -41
  310. package/src/core/NavList/NavListSubMenu.tsx +0 -28
  311. package/src/core/NavList/__stories__/NavListAutoExample.tsx +0 -53
  312. /package/core/NavList/{NavListAuto.d.ts → NavListAuto/NavListAuto.d.ts} +0 -0
  313. /package/core/NavList/{NavListItemAuto.d.ts → NavListAuto/NavListItemAuto.d.ts} +0 -0
@@ -19,7 +19,7 @@ const DEFAULT_HREF_FLAG = true;
19
19
  const epathlaLinks = [
20
20
  {
21
21
  name: 'index',
22
- href: DEFAULT_HREF_FLAG ? '#' : `/${LANG}`,
22
+ href: DEFAULT_HREF_FLAG ? '#index' : `/${LANG}`,
23
23
  label: 'Αρχική',
24
24
  },
25
25
  {
@@ -108,7 +108,7 @@ const epathlaLinks = [
108
108
  },
109
109
  {
110
110
  name: 'news',
111
- href: DEFAULT_HREF_FLAG ? '#' : `/${LANG}/news`,
111
+ href: DEFAULT_HREF_FLAG ? '#news' : `/${LANG}/news`,
112
112
  label: 'Νέα',
113
113
  },
114
114
  {
@@ -129,10 +129,14 @@ const epathlaLinks = [
129
129
  ];
130
130
 
131
131
  export const NavListEpathlaExample = () => {
132
- const { container, register } = useNavList();
132
+ const { container, registerButton, registerLink } = useNavList();
133
133
 
134
- const setRegister = (name: string) => {
135
- return { ...register(name) };
134
+ const setRegisterButton = (name: string) => {
135
+ return { ...registerButton(name) };
136
+ };
137
+
138
+ const setRegisterLink = (name: string) => {
139
+ return { ...registerLink(name) };
136
140
  };
137
141
 
138
142
  return (
@@ -141,29 +145,46 @@ export const NavListEpathlaExample = () => {
141
145
  layout={'horizontal'}
142
146
  links={epathlaLinks}
143
147
  aria-label="Nav list"
144
- role="menu"
145
148
  >
146
149
  {epathlaLinks.map((item, key) => (
147
150
  <React.Fragment key={key}>
148
- <NavListItem link={item} setRegister={setRegister} />
149
- <NavMenu {...container(item.name)}>
150
- <NavMenuContainer paddingLeft={5} paddingRight={5}>
151
- <NavMenuContainerTitle>{item.label}</NavMenuContainerTitle>
152
- <NavMenuContainerContent>
153
- <NavMenuContainerContentList>
154
- {item.subMenu?.map((subMenu, menuIndex) => {
155
- return (
156
- isNavListItemLinkInterface(subMenu) && (
157
- <NavMenuContainerContentListItem key={menuIndex}>
158
- <Link href={subMenu.href}>{subMenu.label}</Link>
159
- </NavMenuContainerContentListItem>
160
- )
161
- );
162
- })}
163
- </NavMenuContainerContentList>
164
- </NavMenuContainerContent>
165
- </NavMenuContainer>
166
- </NavMenu>
151
+ <NavListItem
152
+ link={item}
153
+ setRegisterButton={setRegisterButton}
154
+ setRegisterLink={setRegisterLink}
155
+ />
156
+ {item?.subMenu && (
157
+ <NavMenu
158
+ {...container(item.name)}
159
+ aria-expanded={container(item.name)?.active}
160
+ >
161
+ <NavMenuContainer paddingLeft={5} paddingRight={5}>
162
+ <NavMenuContainerTitle>{item.label}</NavMenuContainerTitle>
163
+ <NavMenuContainerContent>
164
+ <NavMenuContainerContentList role="menu">
165
+ {item.subMenu?.map((subMenu, menuIndex) => {
166
+ return (
167
+ isNavListItemLinkInterface(subMenu) && (
168
+ <NavMenuContainerContentListItem
169
+ key={menuIndex}
170
+ role="presentation"
171
+ >
172
+ <Link
173
+ role="menuitem"
174
+ id={`${item.name}-${menuIndex}`}
175
+ href={subMenu.href}
176
+ >
177
+ {subMenu.label}
178
+ </Link>
179
+ </NavMenuContainerContentListItem>
180
+ )
181
+ );
182
+ })}
183
+ </NavMenuContainerContentList>
184
+ </NavMenuContainerContent>
185
+ </NavMenuContainer>
186
+ </NavMenu>
187
+ )}
167
188
  </React.Fragment>
168
189
  ))}
169
190
  </NavListAuto>
@@ -0,0 +1,65 @@
1
+ import React from 'react';
2
+ import { NavListAuto } from '@digigov/ui/core/NavList';
3
+ import NavListItemAuto from '@digigov/ui/core/NavList/NavListAuto/NavListItemAuto';
4
+
5
+ const links = [
6
+ {
7
+ name: 'Nav1',
8
+ label: 'Nav list item 1',
9
+ href: '#',
10
+ },
11
+ {
12
+ name: 'Nav2',
13
+ label: 'Nav list item 2',
14
+ menu: {
15
+ title: 'This is the first Menu',
16
+ links: [
17
+ {
18
+ name: 'Nav2.1',
19
+ label: 'link navigation',
20
+ href: '#',
21
+ },
22
+ {
23
+ name: 'Nav2.2',
24
+ label: 'link navigation',
25
+ href: '#',
26
+ },
27
+ {
28
+ name: 'Nav2.3',
29
+ label: 'link navigation',
30
+ href: '#',
31
+ },
32
+ {
33
+ name: 'Nav2.4',
34
+ label: 'link navigation',
35
+ href: '#',
36
+ },
37
+ ],
38
+ },
39
+ },
40
+ {
41
+ name: 'Nav3',
42
+ label: 'Nav list item 3',
43
+ href: '#',
44
+ },
45
+ ];
46
+
47
+ export const NavListHorizontalAutoExample = () => {
48
+ const layout = 'horizontal';
49
+ const border = true;
50
+
51
+ return (
52
+ <NavListAuto
53
+ layout={layout}
54
+ border={border}
55
+ links={links}
56
+ aria-label="Nav list"
57
+ >
58
+ {links.map((item, key) => (
59
+ <NavListItemAuto key={key} item={item} />
60
+ ))}
61
+ </NavListAuto>
62
+ );
63
+ };
64
+
65
+ export default NavListHorizontalAutoExample;
@@ -0,0 +1,284 @@
1
+ import React, { useState } from 'react';
2
+ import { NavListAuto, NavListLayout } from '@digigov/ui/core/NavList';
3
+ import NavListItemAuto from '@digigov/ui/core/NavList/NavListAuto/NavListItemAuto';
4
+ import FieldContainer, { Fieldset } from '@digigov/ui/core/FieldContainer';
5
+ import Hint from '@digigov/ui/typography/Hint';
6
+ import { RadioContainer, RadioItem } from '@digigov/ui/core/RadioContainer';
7
+ import { SectionBreak } from '@digigov/ui/core/SectionBreak';
8
+
9
+ const links = [
10
+ {
11
+ name: 'Nav1',
12
+ label: 'Item list 1',
13
+ menu: {
14
+ title: 'This is the first Menu',
15
+ links: [
16
+ {
17
+ name: 'Nav1__Nav1.1',
18
+ label: 'link navigation',
19
+ href: '?q=item',
20
+ },
21
+ {
22
+ name: 'Nav1__Nav1.2',
23
+ label: 'link navigation',
24
+ href: '?q=item',
25
+ },
26
+ ],
27
+ },
28
+ },
29
+ {
30
+ name: 'Nav2',
31
+ label: 'Item list 2',
32
+ menu: {
33
+ title: 'This is the second Menu',
34
+ links: [
35
+ {
36
+ name: 'Nav2__Nav2.1',
37
+ label: 'link navigation',
38
+ href: '?q=item',
39
+ },
40
+ {
41
+ name: 'Nav2__Nav2.2',
42
+ label: 'link navigation',
43
+ href: '?q=item',
44
+ },
45
+ {
46
+ name: 'Nav2__Nav2.3',
47
+ label: 'link navigation',
48
+ href: '?q=item',
49
+ },
50
+ {
51
+ name: 'Nav2__Nav2.4',
52
+ label: 'link navigation',
53
+ href: '?q=item',
54
+ },
55
+ {
56
+ name: 'Nav2__Nav2.5',
57
+ label: 'link navigation',
58
+ href: '?q=item',
59
+ },
60
+ {
61
+ name: 'Nav2__Nav2.6',
62
+ label: 'link navigation',
63
+ href: '?q=item',
64
+ },
65
+ {
66
+ name: 'Nav2__Nav2.7',
67
+ label: 'link navigation',
68
+ href: '?q=item',
69
+ },
70
+ ],
71
+ },
72
+ },
73
+ {
74
+ name: 'Nav3',
75
+ label: 'Item list 3',
76
+ subMenu: [
77
+ {
78
+ name: 'Nav3__Nav3.1',
79
+ label: 'Item list 4',
80
+ href: '?q=item4',
81
+ },
82
+ {
83
+ name: 'Nav3__Nav3.2',
84
+ label: 'Item list 5',
85
+ subMenu: [
86
+ {
87
+ name: 'Nav3__Nav3.2__Nav3.2.1',
88
+ label: 'Item list 5.2',
89
+ menu: {
90
+ title: 'This is the fifth Menu',
91
+ links: [
92
+ {
93
+ name: 'Nav3__Nav3.2__Nav3.2.1__Nav3.2.1.1',
94
+ label: 'link navigation',
95
+ href: '?q=item',
96
+ },
97
+ {
98
+ name: 'Nav3__Nav3.2__Nav3.2.1__Nav3.2.1.2',
99
+ label: 'link navigation',
100
+ href: '?q=item',
101
+ },
102
+ {
103
+ name: 'Nav3__Nav3.2__Nav3.2.1__Nav3.2.1.3',
104
+ label: 'link navigation',
105
+ href: '?q=item',
106
+ },
107
+ {
108
+ name: 'Nav3__Nav3.2__Nav3.2.1__Nav3.2.1.4',
109
+ label: 'link navigation',
110
+ href: '?q=item',
111
+ },
112
+ {
113
+ name: 'Nav3__Nav3.2__Nav3.2.1__Nav3.2.1.5',
114
+ label: 'link navigation',
115
+ href: '?q=item',
116
+ },
117
+ {
118
+ name: 'Nav3__Nav3.2__Nav3.2.1__Nav3.2.1.6',
119
+ label: 'link navigation',
120
+ href: '?q=item',
121
+ },
122
+ {
123
+ name: 'Nav3__Nav3.2__Nav3.2.1__Nav3.2.1.7',
124
+ label: 'link navigation',
125
+ href: '?q=item',
126
+ },
127
+ ],
128
+ },
129
+ },
130
+ ],
131
+ },
132
+ {
133
+ name: 'Nav3__Nav3.3',
134
+ label: 'Item list 6',
135
+ menu: {
136
+ title: 'This is the sixth Menu',
137
+ links: [
138
+ {
139
+ name: 'Nav3__Nav3.3__Nav3.3.1',
140
+ label: 'link navigation',
141
+ href: '?q=item',
142
+ },
143
+ {
144
+ name: 'Nav3__Nav3.3__Nav3.3.2',
145
+ label: 'link navigation',
146
+ href: '?q=item',
147
+ },
148
+ {
149
+ name: 'Nav3__Nav3.3__Nav3.3.3',
150
+ label: 'link navigation',
151
+ href: '?q=item',
152
+ },
153
+ {
154
+ name: 'Nav3__Nav3.3__Nav3.3.4',
155
+ label: 'link navigation',
156
+ href: '?q=item',
157
+ },
158
+ {
159
+ name: 'Nav3__Nav3.3__Nav3.3.5',
160
+ label: 'link navigation',
161
+ href: '?q=item',
162
+ },
163
+ {
164
+ name: 'Nav3__Nav3.3__Nav3.3.6',
165
+ label: 'link navigation',
166
+ href: '?q=item',
167
+ },
168
+ {
169
+ name: 'Nav3__Nav3.3__Nav3.3.7',
170
+ label: 'link navigation',
171
+ href: '?q=item',
172
+ },
173
+ {
174
+ name: 'Nav3__Nav3.3__Nav3.3.8',
175
+ label: 'link navigation',
176
+ href: '?q=item',
177
+ },
178
+ {
179
+ name: 'Nav3__Nav3.3__Nav3.3.9',
180
+ label: 'link navigation',
181
+ href: '?q=item',
182
+ },
183
+ {
184
+ name: 'Nav3__Nav3.3__Nav3.3.10',
185
+ label: 'link navigation',
186
+ href: '?q=item',
187
+ },
188
+ {
189
+ name: 'Nav3__Nav3.3__Nav3.3.11',
190
+ label: 'link navigation',
191
+ href: '?q=item',
192
+ },
193
+ ],
194
+ },
195
+ },
196
+ ],
197
+ },
198
+ ];
199
+
200
+ export const NavListSecondaryAutoExample = () => {
201
+ const [layout, setLayout] = useState<NavListLayout>('horizontal');
202
+ const [border, setBorder] = useState<string>('no');
203
+ const [fixed, setFixed] = useState<string>('no');
204
+
205
+ return (
206
+ <>
207
+ <NavListAuto
208
+ layout={layout}
209
+ border={border === 'yes'}
210
+ fixed={fixed === 'yes'}
211
+ links={links}
212
+ aria-label="Nav list"
213
+ >
214
+ {links.map((item, key) => (
215
+ <NavListItemAuto key={key} item={item} />
216
+ ))}
217
+ </NavListAuto>
218
+ <SectionBreak visible={false} size="l" />
219
+ <FieldContainer>
220
+ <Fieldset aria-describedby="name-hint">
221
+ <Hint id="name-hint">Layout options:</Hint>
222
+ <RadioContainer inline>
223
+ <RadioItem
224
+ defaultChecked={layout === 'vertical'}
225
+ name="changed_display"
226
+ value="vertical"
227
+ onClick={() => setLayout('vertical')}
228
+ >
229
+ Vertical
230
+ </RadioItem>
231
+ <RadioItem
232
+ defaultChecked={layout === 'horizontal'}
233
+ name="changed_display"
234
+ value="horizontal"
235
+ onClick={() => setLayout('horizontal')}
236
+ >
237
+ Horizontal
238
+ </RadioItem>
239
+ </RadioContainer>
240
+ <Hint id="name-hint">Bottom border:</Hint>
241
+ <RadioContainer inline>
242
+ <RadioItem
243
+ defaultChecked={border === 'yes'}
244
+ name="changed_border"
245
+ value="yes"
246
+ onClick={() => setBorder('yes')}
247
+ >
248
+ Yes
249
+ </RadioItem>
250
+ <RadioItem
251
+ defaultChecked={border === 'no'}
252
+ name="changed_border"
253
+ value="no"
254
+ onClick={() => setBorder('no')}
255
+ >
256
+ No
257
+ </RadioItem>
258
+ </RadioContainer>
259
+ <Hint id="name-hint">Position fixed:</Hint>
260
+ <RadioContainer inline>
261
+ <RadioItem
262
+ defaultChecked={fixed === 'yes'}
263
+ name="changed_position"
264
+ value="yes"
265
+ onClick={() => setFixed('yes')}
266
+ >
267
+ Yes
268
+ </RadioItem>
269
+ <RadioItem
270
+ defaultChecked={fixed === 'no'}
271
+ name="changed_position"
272
+ value="no"
273
+ onClick={() => setFixed('no')}
274
+ >
275
+ No
276
+ </RadioItem>
277
+ </RadioContainer>
278
+ </Fieldset>
279
+ </FieldContainer>
280
+ </>
281
+ );
282
+ };
283
+
284
+ export default NavListSecondaryAutoExample;
@@ -0,0 +1,65 @@
1
+ import React from 'react';
2
+ import { NavListAuto } from '@digigov/ui/core/NavList';
3
+ import NavListItemAuto from '@digigov/ui/core/NavList/NavListAuto/NavListItemAuto';
4
+
5
+ const links = [
6
+ {
7
+ name: 'Nav1',
8
+ label: 'Nav list item 1',
9
+ href: '#',
10
+ },
11
+ {
12
+ name: 'Nav2',
13
+ label: 'Nav list item 2',
14
+ menu: {
15
+ title: 'This is the first Menu',
16
+ links: [
17
+ {
18
+ name: 'Nav2.1',
19
+ label: 'link navigation',
20
+ href: '#',
21
+ },
22
+ {
23
+ name: 'Nav2.2',
24
+ label: 'link navigation',
25
+ href: '#',
26
+ },
27
+ {
28
+ name: 'Nav2.3',
29
+ label: 'link navigation',
30
+ href: '#',
31
+ },
32
+ {
33
+ name: 'Nav2.4',
34
+ label: 'link navigation',
35
+ href: '#',
36
+ },
37
+ ],
38
+ },
39
+ },
40
+ {
41
+ name: 'Nav3',
42
+ label: 'Nav list item 3',
43
+ href: '#',
44
+ },
45
+ ];
46
+
47
+ export const NavListVerticalAutoExample = () => {
48
+ const layout = 'vertical';
49
+ const border = false;
50
+
51
+ return (
52
+ <NavListAuto
53
+ layout={layout}
54
+ border={border}
55
+ links={links}
56
+ aria-label="Nav list"
57
+ >
58
+ {links.map((item, key) => (
59
+ <NavListItemAuto key={key} item={item} />
60
+ ))}
61
+ </NavListAuto>
62
+ );
63
+ };
64
+
65
+ export default NavListVerticalAutoExample;
@@ -1,11 +1,8 @@
1
1
  export * from '@digigov/ui/core/NavList/NavListItem';
2
- export * from '@digigov/ui/core/NavList/NavListAuto';
3
- export * from '@digigov/ui/core/NavList/NavListItemAuto';
4
- export * from '@digigov/ui/core/NavList/NavListSubMenu';
5
- export * from '@digigov/ui/core/NavList/NavListContext';
2
+ export * from '@digigov/ui/core/NavList/NavListAuto/NavListAuto';
3
+ export * from '@digigov/ui/core/NavList/NavListAuto/NavListContextAuto';
6
4
  export * from '@digigov/ui/core/NavList/Nav';
7
5
  export * from '@digigov/ui/core/NavList/NavList';
8
- export * from '@digigov/ui/core/NavList/NavListItem';
9
6
  export * from '@digigov/ui/core/NavList/NavListItemLink';
10
7
  export * from '@digigov/ui/core/NavList/NavListItemButton';
11
8
  export * from '@digigov/ui/core/NavList/NavMenu';
@@ -1,13 +1,16 @@
1
1
  import React from 'react';
2
- import { NavLinkInterface } from '@digigov/ui/core/NavList/NavListContext';
2
+ import { NavLinkInterface } from '@digigov/ui/core/NavList/NavListAuto/NavListContextAuto';
3
3
  import { BaseCSSProperties } from '@material-ui/core/styles/withStyles';
4
+ import { NavProps } from '@digigov/ui/core/NavList';
4
5
 
5
6
  export type NavListLayout = 'horizontal' | 'vertical';
6
7
 
7
- export interface NavListAutoProps {
8
+ export interface NavListAutoProps extends NavProps {
8
9
  children?: React.ReactNode;
9
10
  className?: string;
10
11
  layout?: NavListLayout;
12
+ border?: boolean;
13
+ fixed?: boolean;
11
14
  role?: string;
12
15
  openSubMenus?: boolean;
13
16
  floating?: boolean;
@@ -16,6 +19,14 @@ export interface NavListAutoProps {
16
19
  style?: BaseCSSProperties;
17
20
  }
18
21
 
22
+ export interface NavListHeaderItemType {
23
+ name: string;
24
+ label?: string;
25
+ title?: string;
26
+ children?: React.ReactNode;
27
+ subMenu: NavListItemLinkInterface[];
28
+ }
29
+
19
30
  interface NavListItemInterface {
20
31
  name: string;
21
32
  label?: string;
@@ -27,18 +38,20 @@ interface NavListItemLinkInterface extends NavListItemInterface {
27
38
  href: string;
28
39
  }
29
40
 
30
- export interface NavListHeaderItemType {
31
- name: string;
32
- label?: string;
33
- title?: string;
34
- children?: React.ReactNode;
35
- subMenu: NavListItemLinkInterface[];
41
+ interface NavListItemMenuInterface extends NavListItemInterface {
42
+ links: NavListItemLinkInterface[];
36
43
  }
37
44
 
38
45
  export type NavListItemType =
39
46
  | NavListItemLinkInterface
47
+ | NavListItemMenuContainerInterface
40
48
  | NavListItemSubMenuInterface;
41
49
 
50
+ export interface NavListItemMenuContainerInterface
51
+ extends NavListItemInterface {
52
+ menu: NavListItemMenuInterface[];
53
+ }
54
+
42
55
  export interface NavListItemSubMenuInterface extends NavListItemInterface {
43
56
  subMenu: NavListItemType[];
44
57
  }
@@ -61,5 +74,6 @@ export interface NavListItemProps {
61
74
  link?: NavListItemType;
62
75
  layout?: NavListLayout;
63
76
  active?: boolean;
64
- setRegister?: (name: string) => any;
77
+ setRegisterButton?: (name: string) => any;
78
+ setRegisterLink?: (name: string) => any;
65
79
  }
@@ -8,7 +8,7 @@ import {
8
8
  useTabs,
9
9
  } from '@digigov/ui/core/Tabs';
10
10
 
11
- import { Title } from '@digigov/ui/typography/Title';
11
+ import { Heading } from '@digigov/ui/typography/Heading';
12
12
  import { VisuallyHidden } from '@digigov/ui/core/VisuallyHidden';
13
13
 
14
14
  import {
@@ -30,9 +30,9 @@ export function Default() {
30
30
  <TabsListItem {...register('b')}>Yποθέσεις</TabsListItem>
31
31
  </TabsList>
32
32
  <TabsPanel {...panel('a')}>
33
- <Title size="md" element="h3">
33
+ <Heading size="m" element="h3">
34
34
  Στοιχεία πολίτη
35
- </Title>
35
+ </Heading>
36
36
  <SummaryList>
37
37
  <SummaryListItem>
38
38
  <SummaryListItemKey>Όνομα</SummaryListItemKey>
@@ -62,9 +62,9 @@ export function Default() {
62
62
  </SummaryList>
63
63
  </TabsPanel>
64
64
  <TabsPanel {...panel('b')}>
65
- <Title size="md" element="h3">
65
+ <Heading size="m" element="h3">
66
66
  Yποθέσεις
67
- </Title>
67
+ </Heading>
68
68
  Περιεχόμενα υποθέσεων
69
69
  </TabsPanel>
70
70
  </Tabs>
@@ -1,20 +1,16 @@
1
1
  import { useCallback, useRef } from 'react';
2
2
  import Tabs from '@digigov/react-core/Tabs';
3
3
  import {
4
- useTogglableSections,
5
- UseTogglableSectionsReturn,
6
- } from '@digigov/ui/hooks/useTogglableSections';
4
+ useTogglableTab,
5
+ UseTogglableTabReturn,
6
+ } from '@digigov/ui/hooks/useTogglableTab';
7
7
 
8
- export interface UseTabsReturn extends UseTogglableSectionsReturn {
8
+ export interface UseTabsReturn extends UseTogglableTabReturn {
9
9
  panel: (key: string) => { active: boolean; tabIndex: number; id: string };
10
10
  }
11
11
  export const useTabs = (): UseTabsReturn => {
12
12
  const registeredPanels = useRef({});
13
13
  const goTo = useCallback((key: string) => {
14
- console.log(
15
- registeredPanels.current[key].offsetTop -
16
- rest.registered.current[key].offsetTop
17
- );
18
14
  if (
19
15
  registeredPanels.current[key].offsetTop -
20
16
  rest.registered.current[key].offsetTop >=
@@ -26,7 +22,7 @@ export const useTabs = (): UseTabsReturn => {
26
22
  });
27
23
  }
28
24
  }, []);
29
- const { register, opened, ...rest } = useTogglableSections({
25
+ const { register, opened, ...rest } = useTogglableTab({
30
26
  singleOpen: true,
31
27
  toggleProperty: 'selected',
32
28
  onToggleProperty: 'onClick',