@digigov/ui 0.30.3 → 0.32.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 (352) hide show
  1. package/CHANGELOG.md +28 -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/CopyToClipboard/CopyToClipboard.stories.playwright.json +2 -2
  8. package/admin/Drawer/__stories__/Default.js +19 -12
  9. package/admin/Dropdown/__stories__/AlignRight.js +0 -2
  10. package/admin/Dropdown/__stories__/Default.js +0 -2
  11. package/admin/Dropdown/__stories__/PlacementTop.js +0 -2
  12. package/admin/FilterSection/index.d.ts +1 -2
  13. package/admin/FilterSection/index.js +4 -18
  14. package/admin/Modal/index.d.ts +2 -2
  15. package/admin/Modal/index.js +17 -12
  16. package/admin/Pagination/__stories__/Default.js +4 -7
  17. package/admin/Pagination/__stories__/PaginationSmall.js +2 -3
  18. package/app/Footer/__stories__/FooterAllInclusive.js +1 -0
  19. package/app/Footer/__stories__/FooterWithSecondaryNavigation.js +1 -0
  20. package/app/Header/__stories__/WithNavigation.js +10 -8
  21. package/app/QrCodeScanner/__stories__/Default.js +3 -3
  22. package/app/QrCodeViewer/QRCode.stories.d.ts +0 -1
  23. package/app/QrCodeViewer/index.d.ts +1 -2
  24. package/app/QrCodeViewer/index.js +10 -10
  25. package/app/ThemeOptionsForm/index.d.ts +2 -0
  26. package/app/ThemeOptionsForm/index.js +243 -0
  27. package/app/ThemePaletteForm/index.d.ts +2 -0
  28. package/app/{ThemeSelectorOptions → ThemePaletteForm}/index.js +9 -8
  29. package/app/index.d.ts +2 -1
  30. package/app/index.js +17 -4
  31. package/core/Accordion/Accordion.stories.playwright.json +2 -2
  32. package/core/Accordion/index.d.ts +2 -2
  33. package/core/Accordion/index.js +7 -7
  34. package/core/Divider/__stories__/Default.js +5 -10
  35. package/core/ErrorSummary/ErrorSummary.stories.playwright.json +1 -1
  36. package/core/ErrorSummary/__stories__/Default.js +3 -3
  37. package/core/ErrorSummary/__stories__/LinkedToCheckbox.js +3 -3
  38. package/core/ErrorSummary/__stories__/LinkedToField.js +3 -3
  39. package/core/ErrorSummary/__stories__/LinkedToInput.js +3 -3
  40. package/core/Link/__stories__/DarkBackground.js +6 -2
  41. package/core/Link/__stories__/DarkBackgroundNoUnderline.js +6 -2
  42. package/core/NavList/NavList.stories.d.ts +1 -3
  43. package/core/NavList/NavList.stories.js +4 -32
  44. package/core/NavList/NavList.stories.playwright.json +6 -6
  45. package/core/NavList/{NavListAuto.js → NavListAuto/NavListAuto.js} +11 -5
  46. package/core/NavList/{NavListBase.d.ts → NavListAuto/NavListBaseAuto.d.ts} +1 -1
  47. package/core/NavList/{NavListBase.js → NavListAuto/NavListBaseAuto.js} +6 -6
  48. package/core/NavList/{NavListContext.d.ts → NavListAuto/NavListContextAuto.d.ts} +7 -4
  49. package/core/NavList/{NavListContext.js → NavListAuto/NavListContextAuto.js} +23 -11
  50. package/core/NavList/NavListAuto/NavListItemAnchorAuto.d.ts +9 -0
  51. package/core/NavList/{NavListSubMenu.js → NavListAuto/NavListItemAnchorAuto.js} +22 -21
  52. package/core/NavList/{NavListItemAuto.js → NavListAuto/NavListItemAuto.js} +20 -22
  53. package/core/NavList/NavListAuto/NavListItemButtonAuto.d.ts +12 -0
  54. package/core/NavList/NavListAuto/NavListItemButtonAuto.js +48 -0
  55. package/core/NavList/NavListAuto/NavListMenuAuto.d.ts +11 -0
  56. package/core/NavList/NavListAuto/NavListMenuAuto.js +56 -0
  57. package/core/NavList/NavListAuto/NavListSubMenuAuto.d.ts +9 -0
  58. package/core/NavList/NavListAuto/NavListSubMenuAuto.js +44 -0
  59. package/core/NavList/NavListItem.js +6 -8
  60. package/core/NavList/NavListItemBase.d.ts +1 -1
  61. package/core/NavList/NavListItemBase.js +4 -9
  62. package/core/NavList/NavMenuContainerContentList.d.ts +3 -1
  63. package/core/NavList/NavMenuContainerContentList.js +73 -3
  64. package/core/NavList/__stories__/Default.js +22 -15
  65. package/core/NavList/__stories__/NavVerticalLayout.d.ts +2 -0
  66. package/core/NavList/__stories__/{NavHorizontalLayout.js → NavVerticalLayout.js} +24 -18
  67. package/core/NavList/index.d.ts +3 -5
  68. package/core/NavList/index.js +9 -23
  69. package/core/NavList/types.d.ts +20 -11
  70. package/core/SingleCharacterInputContainer/SingleCharacterInputContainer.stories.d.ts +13 -0
  71. package/core/SingleCharacterInputContainer/SingleCharacterInputContainer.stories.js +75 -0
  72. package/core/SingleCharacterInputContainer/__stories__/Default.d.ts +2 -0
  73. package/core/SingleCharacterInputContainer/__stories__/Default.js +46 -0
  74. package/core/SingleCharacterInputContainer/__stories__/WithDefaultError.d.ts +2 -0
  75. package/core/SingleCharacterInputContainer/__stories__/WithDefaultError.js +52 -0
  76. package/core/SingleCharacterInputContainer/__stories__/WithErrorMessageInvalidCode.d.ts +2 -0
  77. package/core/SingleCharacterInputContainer/__stories__/WithErrorMessageInvalidCode.js +58 -0
  78. package/core/SingleCharacterInputContainer/__stories__/WithErrorMessageLessDigit.d.ts +2 -0
  79. package/core/SingleCharacterInputContainer/__stories__/WithErrorMessageLessDigit.js +52 -0
  80. package/core/SingleCharacterInputContainer/index.d.ts +4 -0
  81. package/core/SingleCharacterInputContainer/index.js +44 -0
  82. package/core/SingleCharacterInputContainer/index.mdx +29 -0
  83. package/core/Tabs/__stories__/Default.js +5 -5
  84. package/core/Tabs/index.d.ts +2 -2
  85. package/core/Tabs/index.js +5 -7
  86. package/es/admin/AccessibilityMenu/index.js +13 -0
  87. package/es/admin/Chip/index.js +1 -0
  88. package/es/admin/CopyToClipboard/CopyToClipboard.stories.playwright.json +2 -2
  89. package/es/admin/Drawer/__stories__/Default.js +20 -13
  90. package/es/admin/Dropdown/__stories__/AlignRight.js +0 -2
  91. package/es/admin/Dropdown/__stories__/Default.js +0 -2
  92. package/es/admin/Dropdown/__stories__/PlacementTop.js +0 -2
  93. package/es/admin/FilterSection/index.js +1 -2
  94. package/es/admin/Modal/index.js +16 -11
  95. package/es/admin/Pagination/__stories__/Default.js +4 -7
  96. package/es/admin/Pagination/__stories__/PaginationSmall.js +2 -3
  97. package/es/app/Footer/__stories__/FooterAllInclusive.js +1 -0
  98. package/es/app/Footer/__stories__/FooterWithSecondaryNavigation.js +1 -0
  99. package/es/app/Header/__stories__/WithNavigation.js +10 -8
  100. package/es/app/QrCodeScanner/__stories__/Default.js +3 -3
  101. package/es/app/QrCodeViewer/index.js +8 -9
  102. package/es/app/ThemeOptionsForm/index.js +215 -0
  103. package/es/app/{ThemeSelectorOptions → ThemePaletteForm}/index.js +5 -4
  104. package/es/app/index.js +2 -1
  105. package/es/core/Accordion/Accordion.stories.playwright.json +2 -2
  106. package/es/core/Accordion/index.js +7 -7
  107. package/es/core/Divider/__stories__/Default.js +5 -10
  108. package/es/core/ErrorSummary/ErrorSummary.stories.playwright.json +1 -1
  109. package/es/core/ErrorSummary/__stories__/Default.js +3 -3
  110. package/es/core/ErrorSummary/__stories__/LinkedToCheckbox.js +3 -3
  111. package/es/core/ErrorSummary/__stories__/LinkedToField.js +3 -3
  112. package/es/core/ErrorSummary/__stories__/LinkedToInput.js +3 -3
  113. package/es/core/Link/__stories__/DarkBackground.js +6 -2
  114. package/es/core/Link/__stories__/DarkBackgroundNoUnderline.js +6 -2
  115. package/es/core/NavList/NavList.stories.js +1 -3
  116. package/es/core/NavList/NavList.stories.playwright.json +6 -6
  117. package/{esm/core/NavList → es/core/NavList/NavListAuto}/NavListAuto.js +11 -5
  118. package/{esm/core/NavList/NavListBase.js → es/core/NavList/NavListAuto/NavListBaseAuto.js} +4 -4
  119. package/es/core/NavList/{NavListContext.js → NavListAuto/NavListContextAuto.js} +20 -8
  120. package/es/core/NavList/NavListAuto/NavListItemAnchorAuto.js +26 -0
  121. package/es/core/NavList/NavListAuto/NavListItemAuto.js +38 -0
  122. package/es/core/NavList/NavListAuto/NavListItemButtonAuto.js +30 -0
  123. package/es/core/NavList/NavListAuto/NavListMenuAuto.js +36 -0
  124. package/es/core/NavList/NavListAuto/NavListSubMenuAuto.js +26 -0
  125. package/es/core/NavList/NavListItem.js +7 -9
  126. package/es/core/NavList/NavListItemBase.js +4 -9
  127. package/es/core/NavList/NavMenuContainerContentList.js +64 -1
  128. package/es/core/NavList/__stories__/Default.js +22 -15
  129. package/{esm/core/NavList/__stories__/NavHorizontalLayout.js → es/core/NavList/__stories__/NavVerticalLayout.js} +22 -16
  130. package/es/core/NavList/index.js +3 -5
  131. package/es/core/SingleCharacterInputContainer/SingleCharacterInputContainer.stories.js +12 -0
  132. package/es/core/SingleCharacterInputContainer/__stories__/Default.js +31 -0
  133. package/es/core/SingleCharacterInputContainer/__stories__/WithDefaultError.js +35 -0
  134. package/es/core/SingleCharacterInputContainer/__stories__/WithErrorMessageInvalidCode.js +41 -0
  135. package/es/core/SingleCharacterInputContainer/__stories__/WithErrorMessageLessDigit.js +35 -0
  136. package/es/core/SingleCharacterInputContainer/index.js +4 -0
  137. package/es/core/SingleCharacterInputContainer/index.mdx +29 -0
  138. package/es/core/Tabs/__stories__/Default.js +5 -5
  139. package/es/core/Tabs/index.js +5 -7
  140. package/es/hooks/useFontSize.js +10 -0
  141. package/es/hooks/useHighlightLinks.js +38 -0
  142. package/es/hooks/useLetterSpacing.js +10 -0
  143. package/es/hooks/useLineHeight.js +10 -0
  144. package/es/hooks/useNavList.js +10 -7
  145. package/es/hooks/useTheme.js +19 -11
  146. package/es/hooks/useTogglableNav.js +292 -0
  147. package/es/hooks/{useTogglableSections.js → useTogglableTab.js} +2 -8
  148. package/es/hooks/useVariantVars.js +30 -0
  149. package/es/layouts/Basic/__stories__/Default.js +2 -2
  150. package/es/layouts/Basic/__stories__/MultipleRowsLayout.js +3 -3
  151. package/es/layouts/Basic/__stories__/TwoThirdsOneThirdColumns.js +3 -3
  152. package/es/locales/el.js +4 -0
  153. package/es/registry.js +40 -14
  154. package/es/typography/NormalText/__stories__/FontSizes.js +18 -6
  155. package/es/typography/NormalText/__stories__/FontWeight.js +3 -1
  156. package/es/typography/NormalText/__stories__/Variants.js +3 -1
  157. package/esm/admin/AccessibilityMenu/index.js +13 -0
  158. package/esm/admin/Chip/index.js +1 -0
  159. package/esm/admin/CopyToClipboard/CopyToClipboard.stories.playwright.json +2 -2
  160. package/esm/admin/Drawer/__stories__/Default.js +20 -13
  161. package/esm/admin/Dropdown/__stories__/AlignRight.js +0 -2
  162. package/esm/admin/Dropdown/__stories__/Default.js +0 -2
  163. package/esm/admin/Dropdown/__stories__/PlacementTop.js +0 -2
  164. package/esm/admin/FilterSection/index.js +1 -2
  165. package/esm/admin/Modal/index.js +16 -11
  166. package/esm/admin/Pagination/__stories__/Default.js +4 -7
  167. package/esm/admin/Pagination/__stories__/PaginationSmall.js +2 -3
  168. package/esm/app/Footer/__stories__/FooterAllInclusive.js +1 -0
  169. package/esm/app/Footer/__stories__/FooterWithSecondaryNavigation.js +1 -0
  170. package/esm/app/Header/__stories__/WithNavigation.js +10 -8
  171. package/esm/app/QrCodeScanner/__stories__/Default.js +3 -3
  172. package/esm/app/QrCodeViewer/index.js +8 -9
  173. package/esm/app/ThemeOptionsForm/index.js +215 -0
  174. package/esm/app/{ThemeSelectorOptions → ThemePaletteForm}/index.js +5 -4
  175. package/esm/app/index.js +2 -1
  176. package/esm/core/Accordion/Accordion.stories.playwright.json +2 -2
  177. package/esm/core/Accordion/index.js +7 -7
  178. package/esm/core/Divider/__stories__/Default.js +5 -10
  179. package/esm/core/ErrorSummary/ErrorSummary.stories.playwright.json +1 -1
  180. package/esm/core/ErrorSummary/__stories__/Default.js +3 -3
  181. package/esm/core/ErrorSummary/__stories__/LinkedToCheckbox.js +3 -3
  182. package/esm/core/ErrorSummary/__stories__/LinkedToField.js +3 -3
  183. package/esm/core/ErrorSummary/__stories__/LinkedToInput.js +3 -3
  184. package/esm/core/Link/__stories__/DarkBackground.js +6 -2
  185. package/esm/core/Link/__stories__/DarkBackgroundNoUnderline.js +6 -2
  186. package/esm/core/NavList/NavList.stories.js +1 -3
  187. package/esm/core/NavList/NavList.stories.playwright.json +6 -6
  188. package/{es/core/NavList → esm/core/NavList/NavListAuto}/NavListAuto.js +11 -5
  189. package/{es/core/NavList/NavListBase.js → esm/core/NavList/NavListAuto/NavListBaseAuto.js} +4 -4
  190. package/esm/core/NavList/{NavListContext.js → NavListAuto/NavListContextAuto.js} +20 -8
  191. package/esm/core/NavList/NavListAuto/NavListItemAnchorAuto.js +26 -0
  192. package/esm/core/NavList/NavListAuto/NavListItemAuto.js +38 -0
  193. package/esm/core/NavList/NavListAuto/NavListItemButtonAuto.js +30 -0
  194. package/esm/core/NavList/NavListAuto/NavListMenuAuto.js +36 -0
  195. package/esm/core/NavList/NavListAuto/NavListSubMenuAuto.js +26 -0
  196. package/esm/core/NavList/NavListItem.js +7 -9
  197. package/esm/core/NavList/NavListItemBase.js +4 -9
  198. package/esm/core/NavList/NavMenuContainerContentList.js +64 -1
  199. package/esm/core/NavList/__stories__/Default.js +22 -15
  200. package/{es/core/NavList/__stories__/NavHorizontalLayout.js → esm/core/NavList/__stories__/NavVerticalLayout.js} +22 -16
  201. package/esm/core/NavList/index.js +3 -5
  202. package/esm/core/SingleCharacterInputContainer/SingleCharacterInputContainer.stories.js +12 -0
  203. package/esm/core/SingleCharacterInputContainer/__stories__/Default.js +31 -0
  204. package/esm/core/SingleCharacterInputContainer/__stories__/WithDefaultError.js +35 -0
  205. package/esm/core/SingleCharacterInputContainer/__stories__/WithErrorMessageInvalidCode.js +41 -0
  206. package/esm/core/SingleCharacterInputContainer/__stories__/WithErrorMessageLessDigit.js +35 -0
  207. package/esm/core/SingleCharacterInputContainer/index.js +4 -0
  208. package/esm/core/SingleCharacterInputContainer/index.mdx +29 -0
  209. package/esm/core/Tabs/__stories__/Default.js +5 -5
  210. package/esm/core/Tabs/index.js +5 -7
  211. package/esm/hooks/useFontSize.js +10 -0
  212. package/esm/hooks/useHighlightLinks.js +38 -0
  213. package/esm/hooks/useLetterSpacing.js +10 -0
  214. package/esm/hooks/useLineHeight.js +10 -0
  215. package/esm/hooks/useNavList.js +10 -7
  216. package/esm/hooks/useTheme.js +19 -11
  217. package/esm/hooks/useTogglableNav.js +292 -0
  218. package/esm/hooks/{useTogglableSections.js → useTogglableTab.js} +2 -8
  219. package/esm/hooks/useVariantVars.js +30 -0
  220. package/esm/index.js +1 -1
  221. package/esm/layouts/Basic/__stories__/Default.js +2 -2
  222. package/esm/layouts/Basic/__stories__/MultipleRowsLayout.js +3 -3
  223. package/esm/layouts/Basic/__stories__/TwoThirdsOneThirdColumns.js +3 -3
  224. package/esm/locales/el.js +4 -0
  225. package/esm/registry.js +40 -14
  226. package/esm/typography/NormalText/__stories__/FontSizes.js +18 -6
  227. package/esm/typography/NormalText/__stories__/FontWeight.js +3 -1
  228. package/esm/typography/NormalText/__stories__/Variants.js +3 -1
  229. package/hooks/useFontSize.d.ts +6 -0
  230. package/hooks/useFontSize.js +23 -0
  231. package/hooks/useHighlightLinks.d.ts +8 -0
  232. package/hooks/useHighlightLinks.js +52 -0
  233. package/hooks/useLetterSpacing.d.ts +6 -0
  234. package/hooks/useLetterSpacing.js +23 -0
  235. package/hooks/useLineHeight.d.ts +6 -0
  236. package/hooks/useLineHeight.js +23 -0
  237. package/hooks/useNavList.d.ts +2 -2
  238. package/hooks/useNavList.js +11 -8
  239. package/hooks/useTheme.d.ts +4 -4
  240. package/hooks/useTheme.js +19 -12
  241. package/hooks/useTogglableNav.d.ts +25 -0
  242. package/hooks/useTogglableNav.js +305 -0
  243. package/hooks/{useTogglableSections.d.ts → useTogglableTab.d.ts} +4 -3
  244. package/hooks/{useTogglableSections.js → useTogglableTab.js} +3 -9
  245. package/hooks/useVariantVars.d.ts +11 -0
  246. package/hooks/useVariantVars.js +41 -0
  247. package/layouts/Basic/__stories__/Default.js +2 -2
  248. package/layouts/Basic/__stories__/MultipleRowsLayout.js +3 -3
  249. package/layouts/Basic/__stories__/TwoThirdsOneThirdColumns.js +3 -3
  250. package/locales/el.d.ts +4 -0
  251. package/locales/el.js +4 -0
  252. package/package.json +3 -3
  253. package/registry.d.ts +21 -7
  254. package/registry.js +55 -16
  255. package/src/admin/AccessibilityMenu/index.tsx +14 -0
  256. package/src/admin/AutoComplete/index.tsx +2 -2
  257. package/src/admin/Chip/index.tsx +1 -0
  258. package/src/admin/CopyToClipboard/CopyToClipboard.stories.playwright.json +2 -2
  259. package/src/admin/Drawer/__stories__/Default.tsx +24 -13
  260. package/src/admin/Dropdown/__stories__/AlignRight.tsx +2 -2
  261. package/src/admin/Dropdown/__stories__/Default.tsx +2 -2
  262. package/src/admin/Dropdown/__stories__/PlacementTop.tsx +2 -2
  263. package/src/admin/FilterSection/index.tsx +1 -2
  264. package/src/admin/Modal/index.tsx +43 -39
  265. package/src/admin/Pagination/__stories__/Default.tsx +4 -4
  266. package/src/admin/Pagination/__stories__/PaginationSmall.tsx +2 -2
  267. package/src/app/Footer/__stories__/FooterAllInclusive.tsx +1 -1
  268. package/src/app/Footer/__stories__/FooterWithSecondaryNavigation.tsx +1 -1
  269. package/src/app/Header/__stories__/WithNavigation.tsx +8 -8
  270. package/src/app/QrCodeScanner/__stories__/Default.tsx +2 -2
  271. package/src/app/QrCodeViewer/index.tsx +16 -14
  272. package/src/app/ThemeOptionsForm/index.tsx +220 -0
  273. package/src/app/{ThemeSelectorOptions → ThemePaletteForm}/index.tsx +3 -3
  274. package/src/app/index.ts +2 -1
  275. package/src/core/Accordion/Accordion.stories.playwright.json +2 -2
  276. package/src/core/Accordion/index.tsx +5 -11
  277. package/src/core/Divider/__stories__/Default.tsx +5 -5
  278. package/src/core/ErrorSummary/ErrorSummary.stories.playwright.json +1 -1
  279. package/src/core/ErrorSummary/__stories__/Default.tsx +2 -2
  280. package/src/core/ErrorSummary/__stories__/LinkedToCheckbox.tsx +2 -2
  281. package/src/core/ErrorSummary/__stories__/LinkedToField.tsx +2 -2
  282. package/src/core/ErrorSummary/__stories__/LinkedToInput.tsx +2 -2
  283. package/src/core/Link/__stories__/DarkBackground.tsx +2 -3
  284. package/src/core/Link/__stories__/DarkBackgroundNoUnderline.tsx +2 -3
  285. package/src/core/NavList/NavList.stories.js +1 -3
  286. package/src/core/NavList/NavList.stories.playwright.json +6 -6
  287. package/src/core/NavList/NavListAuto/NavListAuto.tsx +34 -0
  288. package/src/core/NavList/{NavListBase.tsx → NavListAuto/NavListBaseAuto.tsx} +3 -3
  289. package/src/core/NavList/{NavListContext.tsx → NavListAuto/NavListContextAuto.tsx} +26 -11
  290. package/src/core/NavList/NavListAuto/NavListItemAnchorAuto.tsx +38 -0
  291. package/src/core/NavList/NavListAuto/NavListItemAuto.tsx +49 -0
  292. package/src/core/NavList/NavListAuto/NavListItemButtonAuto.tsx +53 -0
  293. package/src/core/NavList/NavListAuto/NavListMenuAuto.tsx +51 -0
  294. package/src/core/NavList/NavListAuto/NavListSubMenuAuto.tsx +32 -0
  295. package/src/core/NavList/NavListItem.tsx +15 -10
  296. package/src/core/NavList/NavListItemBase.tsx +5 -8
  297. package/src/core/NavList/NavMenuContainerContentList.tsx +61 -1
  298. package/src/core/NavList/__stories__/Default.tsx +26 -14
  299. package/src/core/NavList/__stories__/{NavHorizontalLayout.tsx → NavVerticalLayout.tsx} +29 -16
  300. package/src/core/NavList/index.tsx +3 -5
  301. package/src/core/NavList/types.tsx +23 -10
  302. package/src/core/SingleCharacterInputContainer/SingleCharacterInputContainer.stories.js +13 -0
  303. package/src/core/SingleCharacterInputContainer/__stories__/Default.tsx +35 -0
  304. package/src/core/SingleCharacterInputContainer/__stories__/WithDefaultError.tsx +38 -0
  305. package/src/core/SingleCharacterInputContainer/__stories__/WithErrorMessageInvalidCode.tsx +38 -0
  306. package/src/core/SingleCharacterInputContainer/__stories__/WithErrorMessageLessDigit.tsx +38 -0
  307. package/src/core/SingleCharacterInputContainer/index.mdx +29 -0
  308. package/src/core/SingleCharacterInputContainer/index.tsx +4 -0
  309. package/src/core/Tabs/__stories__/Default.tsx +5 -5
  310. package/src/core/Tabs/index.tsx +5 -9
  311. package/src/hooks/useFontSize.ts +32 -0
  312. package/src/hooks/useHighlightLinks.ts +45 -0
  313. package/src/hooks/useLetterSpacing.ts +27 -0
  314. package/src/hooks/useLineHeight.ts +31 -0
  315. package/src/hooks/useNavList.ts +5 -7
  316. package/src/hooks/useTheme.ts +28 -20
  317. package/src/hooks/useTogglableNav.tsx +294 -0
  318. package/src/hooks/{useTogglableSections.tsx → useTogglableTab.tsx} +12 -13
  319. package/src/hooks/useVariantVars.ts +35 -0
  320. package/src/layouts/Basic/__stories__/Default.tsx +3 -3
  321. package/src/layouts/Basic/__stories__/MultipleRowsLayout.tsx +8 -8
  322. package/src/layouts/Basic/__stories__/TwoThirdsOneThirdColumns.tsx +6 -6
  323. package/src/locales/el.ts +4 -0
  324. package/src/registry.js +40 -14
  325. package/src/typography/NormalText/__stories__/FontSizes.tsx +6 -6
  326. package/src/typography/NormalText/__stories__/FontWeight.tsx +1 -1
  327. package/src/typography/NormalText/__stories__/Variants.tsx +1 -1
  328. package/typography/NormalText/__stories__/FontSizes.js +18 -6
  329. package/typography/NormalText/__stories__/FontWeight.js +3 -1
  330. package/typography/NormalText/__stories__/Variants.js +3 -1
  331. package/app/ThemeSelectorOptions/index.d.ts +0 -2
  332. package/core/NavList/NavListSubMenu.d.ts +0 -8
  333. package/core/NavList/__stories__/NavHorizontalLayout.d.ts +0 -2
  334. package/core/NavList/__stories__/NavListAutoExample.d.ts +0 -2
  335. package/core/NavList/__stories__/NavListAutoExample.js +0 -63
  336. package/core/NavList/__stories__/NavListEpathlaExample.d.ts +0 -2
  337. package/core/NavList/__stories__/NavListEpathlaExample.js +0 -141
  338. package/es/core/NavList/NavListItemAuto.js +0 -40
  339. package/es/core/NavList/NavListSubMenu.js +0 -25
  340. package/es/core/NavList/__stories__/NavListAutoExample.js +0 -48
  341. package/es/core/NavList/__stories__/NavListEpathlaExample.js +0 -123
  342. package/esm/core/NavList/NavListItemAuto.js +0 -40
  343. package/esm/core/NavList/NavListSubMenu.js +0 -25
  344. package/esm/core/NavList/__stories__/NavListAutoExample.js +0 -48
  345. package/esm/core/NavList/__stories__/NavListEpathlaExample.js +0 -123
  346. package/src/core/NavList/NavListAuto.tsx +0 -20
  347. package/src/core/NavList/NavListItemAuto.tsx +0 -41
  348. package/src/core/NavList/NavListSubMenu.tsx +0 -28
  349. package/src/core/NavList/__stories__/NavListAutoExample.tsx +0 -53
  350. package/src/core/NavList/__stories__/NavListEpathlaExample.tsx +0 -174
  351. /package/core/NavList/{NavListAuto.d.ts → NavListAuto/NavListAuto.d.ts} +0 -0
  352. /package/core/NavList/{NavListItemAuto.d.ts → NavListAuto/NavListItemAuto.d.ts} +0 -0
@@ -6,37 +6,49 @@ var _ref = /*#__PURE__*/React.createElement(NormalText, {
6
6
  fontSize: "14"
7
7
  }, " govgr-!-font-size-14 ");
8
8
 
9
- var _ref2 = /*#__PURE__*/React.createElement(SectionBreak, null);
9
+ var _ref2 = /*#__PURE__*/React.createElement(SectionBreak, {
10
+ visible: false
11
+ });
10
12
 
11
13
  var _ref3 = /*#__PURE__*/React.createElement(NormalText, {
12
14
  fontSize: "16"
13
15
  }, " govgr-!-font-size-16 ");
14
16
 
15
- var _ref4 = /*#__PURE__*/React.createElement(SectionBreak, null);
17
+ var _ref4 = /*#__PURE__*/React.createElement(SectionBreak, {
18
+ visible: false
19
+ });
16
20
 
17
21
  var _ref5 = /*#__PURE__*/React.createElement(NormalText, {
18
22
  fontSize: "19"
19
23
  }, " govgr-!-font-size-19 ");
20
24
 
21
- var _ref6 = /*#__PURE__*/React.createElement(SectionBreak, null);
25
+ var _ref6 = /*#__PURE__*/React.createElement(SectionBreak, {
26
+ visible: false
27
+ });
22
28
 
23
29
  var _ref7 = /*#__PURE__*/React.createElement(NormalText, {
24
30
  fontSize: "24"
25
31
  }, " govgr-!-font-size-24 ");
26
32
 
27
- var _ref8 = /*#__PURE__*/React.createElement(SectionBreak, null);
33
+ var _ref8 = /*#__PURE__*/React.createElement(SectionBreak, {
34
+ visible: false
35
+ });
28
36
 
29
37
  var _ref9 = /*#__PURE__*/React.createElement(NormalText, {
30
38
  fontSize: "30"
31
39
  }, " govgr-!-font-size-30 ");
32
40
 
33
- var _ref10 = /*#__PURE__*/React.createElement(SectionBreak, null);
41
+ var _ref10 = /*#__PURE__*/React.createElement(SectionBreak, {
42
+ visible: false
43
+ });
34
44
 
35
45
  var _ref11 = /*#__PURE__*/React.createElement(NormalText, {
36
46
  fontSize: "48"
37
47
  }, " govgr-!-font-size-48 ");
38
48
 
39
- var _ref12 = /*#__PURE__*/React.createElement(SectionBreak, null);
49
+ var _ref12 = /*#__PURE__*/React.createElement(SectionBreak, {
50
+ visible: false
51
+ });
40
52
 
41
53
  var _ref13 = /*#__PURE__*/React.createElement(NormalText, {
42
54
  fontSize: "72"
@@ -6,7 +6,9 @@ var _ref = /*#__PURE__*/React.createElement(NormalText, {
6
6
  fontWeight: "regular"
7
7
  }, " govgr-!-font-weight-regular ");
8
8
 
9
- var _ref2 = /*#__PURE__*/React.createElement(SectionBreak, null);
9
+ var _ref2 = /*#__PURE__*/React.createElement(SectionBreak, {
10
+ visible: false
11
+ });
10
12
 
11
13
  var _ref3 = /*#__PURE__*/React.createElement(NormalText, {
12
14
  fontWeight: "bold"
@@ -6,7 +6,9 @@ var _ref = /*#__PURE__*/React.createElement(NormalText, {
6
6
  variant: "small"
7
7
  }, " govgr-variant-small ");
8
8
 
9
- var _ref2 = /*#__PURE__*/React.createElement(SectionBreak, null);
9
+ var _ref2 = /*#__PURE__*/React.createElement(SectionBreak, {
10
+ visible: false
11
+ });
10
12
 
11
13
  var _ref3 = /*#__PURE__*/React.createElement(NormalText, {
12
14
  variant: "lead"
@@ -0,0 +1,6 @@
1
+ import { UseVariantVarsResult } from "@digigov/ui/hooks/useVariantVars";
2
+ export declare type FontSizeOptions = 'default' | 'large';
3
+ export declare type StoredFontSizeOptions = FontSizeOptions | null;
4
+ export declare type UseFontSizeResult = UseVariantVarsResult<FontSizeOptions>;
5
+ export declare const useFontSize: () => UseFontSizeResult;
6
+ export default useFontSize;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.useFontSize = exports["default"] = void 0;
9
+
10
+ var _useVariantVars = _interopRequireDefault(require("@digigov/ui/hooks/useVariantVars"));
11
+
12
+ var useFontSize = function useFontSize() {
13
+ var config = {
14
+ 'name': 'font-size',
15
+ 'variables': ['text-sm', 'text-base', 'text-lg', 'text-xl', 'text-2xl', 'text-3xl', 'text-4xl', 'text-5xl'],
16
+ 'variants': ['default', 'large']
17
+ };
18
+ return (0, _useVariantVars["default"])(config);
19
+ };
20
+
21
+ exports.useFontSize = useFontSize;
22
+ var _default = useFontSize;
23
+ exports["default"] = _default;
@@ -0,0 +1,8 @@
1
+ export declare type HighlightLinksOptions = 'default' | 'highlight';
2
+ export declare type StoredHighlightLinksOptions = HighlightLinksOptions | null;
3
+ export declare type UseHighlightLinksResult = [
4
+ highlightLinks: HighlightLinksOptions,
5
+ changeHighlightLinks: (selectedHighlightLinks: HighlightLinksOptions) => void
6
+ ];
7
+ export declare const useHighlightLinks: () => UseHighlightLinksResult;
8
+ export default useHighlightLinks;
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.useHighlightLinks = exports["default"] = void 0;
9
+
10
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
11
+
12
+ var _react = require("react");
13
+
14
+ var useHighlightLinks = function useHighlightLinks() {
15
+ var storedHighlightLinks = localStorage.getItem('--theme-highlight-links');
16
+
17
+ var _useState = (0, _react.useState)(storedHighlightLinks || 'default'),
18
+ _useState2 = (0, _slicedToArray2["default"])(_useState, 2),
19
+ highlightLinks = _useState2[0],
20
+ changeHighlightLinks = _useState2[1];
21
+
22
+ (0, _react.useEffect)(function () {
23
+ if (highlightLinks === 'highlight') {
24
+ document.documentElement.classList.add("govgr-highlight-links");
25
+ } else {
26
+ document.documentElement.classList.remove("govgr-highlight-links");
27
+ }
28
+
29
+ localStorage.setItem('--theme-highlight-links', highlightLinks);
30
+ }, [highlightLinks]);
31
+ (0, _react.useEffect)(function () {
32
+ var beforePrintListener = function beforePrintListener() {
33
+ document.documentElement.classList.remove("govgr-highlight-links");
34
+ };
35
+
36
+ var afterPrintListener = function afterPrintListener() {
37
+ document.documentElement.classList.add(localStorage.getItem('--theme-highlight-links') === 'highlight' ? "govgr-highlight-links" : '');
38
+ };
39
+
40
+ window.addEventListener('beforeprint', beforePrintListener);
41
+ window.addEventListener('afterprint', afterPrintListener);
42
+ return function () {
43
+ window.removeEventListener('beforeprint', beforePrintListener);
44
+ window.removeEventListener('afterprint', afterPrintListener);
45
+ };
46
+ }, []);
47
+ return [highlightLinks, changeHighlightLinks];
48
+ };
49
+
50
+ exports.useHighlightLinks = useHighlightLinks;
51
+ var _default = useHighlightLinks;
52
+ exports["default"] = _default;
@@ -0,0 +1,6 @@
1
+ import { UseVariantVarsResult } from '@digigov/ui/hooks/useVariantVars';
2
+ export declare type LetterSpacingOptions = 'default' | 'extra';
3
+ export declare type StoredLetterSpacingOptions = LetterSpacingOptions | null;
4
+ export declare type UseLetterSpacingResult = UseVariantVarsResult<LetterSpacingOptions>;
5
+ export declare const useLetterSpacing: () => UseLetterSpacingResult;
6
+ export default useLetterSpacing;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.useLetterSpacing = exports["default"] = void 0;
9
+
10
+ var _useVariantVars = _interopRequireDefault(require("@digigov/ui/hooks/useVariantVars"));
11
+
12
+ var useLetterSpacing = function useLetterSpacing() {
13
+ var config = {
14
+ name: 'letter-spacing',
15
+ variables: ["letter-spacing-normal", "letter-spacing-wide", "letter-spacing-wider", "letter-spacing-widest"],
16
+ variants: ['default', 'extra']
17
+ };
18
+ return (0, _useVariantVars["default"])(config);
19
+ };
20
+
21
+ exports.useLetterSpacing = useLetterSpacing;
22
+ var _default = useLetterSpacing;
23
+ exports["default"] = _default;
@@ -0,0 +1,6 @@
1
+ import { UseVariantVarsResult } from '@digigov/ui/hooks/useVariantVars';
2
+ export declare type LineHeightOptions = 'default' | 'large';
3
+ export declare type StoredLineHeightOptions = LineHeightOptions | null;
4
+ export declare type UseLineHeightResult = UseVariantVarsResult<LineHeightOptions>;
5
+ export declare const useLineHeight: () => UseLineHeightResult;
6
+ export default useLineHeight;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.useLineHeight = exports["default"] = void 0;
9
+
10
+ var _useVariantVars = _interopRequireDefault(require("@digigov/ui/hooks/useVariantVars"));
11
+
12
+ var useLineHeight = function useLineHeight() {
13
+ var config = {
14
+ name: 'line-height',
15
+ variables: ["line-h-sm", "line-h-base", "line-h-lg", "line-h-xl", "line-h-2xl", "line-h-3xl", "line-h-4xl", "line-h-5xl"],
16
+ variants: ['default', 'large']
17
+ };
18
+ return (0, _useVariantVars["default"])(config);
19
+ };
20
+
21
+ exports.useLineHeight = useLineHeight;
22
+ var _default = useLineHeight;
23
+ exports["default"] = _default;
@@ -1,5 +1,5 @@
1
- import { UseTogglableSectionsReturn } from '@digigov/ui/hooks/useTogglableSections';
2
- export interface UseNavListReturn extends UseTogglableSectionsReturn {
1
+ import { UseTogglableNavReturn } from '@digigov/ui/hooks/useTogglableNav';
2
+ export interface UseNavListReturn extends UseTogglableNavReturn {
3
3
  container: (key: string) => {
4
4
  active: boolean;
5
5
  id: string;
@@ -11,25 +11,27 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
11
11
 
12
12
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
13
13
 
14
- var _react = require("react");
14
+ var _useTogglableNav2 = require("@digigov/ui/hooks/useTogglableNav");
15
15
 
16
- var _useTogglableSections2 = require("@digigov/ui/hooks/useTogglableSections");
16
+ var _react = require("react");
17
17
 
18
- var _excluded = ["register", "opened"];
18
+ var _excluded = ["registerButton", "registerLink", "opened"];
19
19
 
20
20
  var useNavList = function useNavList() {
21
21
  var registeredContainers = (0, _react.useRef)({});
22
22
 
23
- var _useTogglableSections = (0, _useTogglableSections2.useTogglableSections)({
23
+ var _useTogglableNav = (0, _useTogglableNav2.useTogglableNav)({
24
24
  singleOpen: true,
25
25
  toggleOpenClose: true,
26
+ toggleParentOpen: true,
26
27
  toggleProperty: 'active',
27
28
  onToggleProperty: 'onClick',
28
29
  ariaNavigation: true
29
30
  }),
30
- register = _useTogglableSections.register,
31
- opened = _useTogglableSections.opened,
32
- rest = (0, _objectWithoutProperties2["default"])(_useTogglableSections, _excluded);
31
+ registerButton = _useTogglableNav.registerButton,
32
+ registerLink = _useTogglableNav.registerLink,
33
+ opened = _useTogglableNav.opened,
34
+ rest = (0, _objectWithoutProperties2["default"])(_useTogglableNav, _excluded);
33
35
 
34
36
  var container = (0, _react.useCallback)(function (key) {
35
37
  return {
@@ -43,7 +45,8 @@ var useNavList = function useNavList() {
43
45
  };
44
46
  }, [opened]);
45
47
  return (0, _extends2["default"])({
46
- register: register,
48
+ registerButton: registerButton,
49
+ registerLink: registerLink,
47
50
  opened: opened,
48
51
  container: container
49
52
  }, rest);
@@ -1,8 +1,8 @@
1
1
  export declare type ThemeSelectOptions = 'light' | 'dark' | 'auto';
2
2
  export declare type StoredThemeOptions = ThemeSelectOptions | null;
3
- export interface UseThemeResult {
4
- theme: ThemeSelectOptions;
5
- changeTheme: (selectedTheme: ThemeSelectOptions) => void;
6
- }
3
+ export declare type UseThemeResult = [
4
+ theme: ThemeSelectOptions,
5
+ changeTheme: (selectedTheme: ThemeSelectOptions) => void
6
+ ];
7
7
  export declare const useTheme: () => UseThemeResult;
8
8
  export default useTheme;
package/hooks/useTheme.js CHANGED
@@ -11,11 +11,9 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
11
11
 
12
12
  var _react = require("react");
13
13
 
14
- ;
15
-
16
14
  var useTheme = function useTheme() {
17
15
  var prefersDarkScheme = window.matchMedia('(prefers-color-scheme: dark)').matches;
18
- var storedTheme = localStorage.getItem('theme');
16
+ var storedTheme = localStorage.getItem('--theme-palette');
19
17
 
20
18
  var _useState = (0, _react.useState)(storedTheme || 'auto'),
21
19
  _useState2 = (0, _slicedToArray2["default"])(_useState, 2),
@@ -23,21 +21,33 @@ var useTheme = function useTheme() {
23
21
  changeTheme = _useState2[1];
24
22
 
25
23
  (0, _react.useEffect)(function () {
24
+ document.documentElement.classList.remove('dark', 'light', 'auto');
25
+
26
26
  if (theme === 'auto') {
27
- document.documentElement.className = prefersDarkScheme ? 'dark' : 'light';
27
+ document.documentElement.classList.add(prefersDarkScheme ? 'dark' : 'light');
28
28
  } else {
29
- document.documentElement.className = theme;
29
+ document.documentElement.classList.add(theme);
30
30
  }
31
31
 
32
- localStorage.setItem('theme', theme);
32
+ localStorage.setItem('--theme-palette', theme);
33
33
  }, [theme]);
34
34
  (0, _react.useEffect)(function () {
35
35
  var beforePrintListener = function beforePrintListener() {
36
- document.documentElement.className = 'light';
36
+ document.documentElement.classList.remove('dark');
37
+ document.documentElement.classList.add('light');
37
38
  };
38
39
 
39
40
  var afterPrintListener = function afterPrintListener() {
40
- document.documentElement.className = localStorage.getItem('theme') || theme;
41
+ document.documentElement.classList.remove('light');
42
+ var localtheme;
43
+
44
+ if (localStorage.getItem('--theme-palette') === 'auto') {
45
+ localtheme = prefersDarkScheme ? 'dark' : 'light';
46
+ } else {
47
+ localtheme = localStorage.getItem('--theme-palette');
48
+ }
49
+
50
+ document.documentElement.classList.add(localtheme || theme);
41
51
  };
42
52
 
43
53
  window.addEventListener('beforeprint', beforePrintListener);
@@ -47,10 +57,7 @@ var useTheme = function useTheme() {
47
57
  window.removeEventListener('afterprint', afterPrintListener);
48
58
  };
49
59
  }, []);
50
- return {
51
- theme: theme,
52
- changeTheme: changeTheme
53
- };
60
+ return [theme, changeTheme];
54
61
  };
55
62
 
56
63
  exports.useTheme = useTheme;
@@ -0,0 +1,25 @@
1
+ export interface UseTogglableNavInterface {
2
+ toggleProperty: string;
3
+ singleOpen?: boolean;
4
+ toggleOpenClose?: boolean;
5
+ toggleParentOpen?: boolean;
6
+ onToggleProperty: string;
7
+ initial?: Record<string, boolean>;
8
+ firstOpen?: boolean;
9
+ ariaNavigation?: boolean;
10
+ toggleHook?: (id: string) => void;
11
+ }
12
+ export interface UseTogglableNavReturn {
13
+ registerButton: (el: string) => any;
14
+ registerLink: (el: string) => any;
15
+ registered: {
16
+ current: Record<string, {
17
+ el: HTMLElement;
18
+ type: string;
19
+ }>;
20
+ };
21
+ opened: Record<string, boolean>;
22
+ toggle: (id: string) => void;
23
+ setOpened: (opened: ((curOpened: Record<string, boolean>) => Record<string, boolean>) | Record<string, boolean>) => void;
24
+ }
25
+ export declare function useTogglableNav({ toggleProperty, toggleOpenClose, toggleParentOpen, onToggleProperty, initial, ariaNavigation, toggleHook, }: UseTogglableNavInterface): UseTogglableNavReturn;