@reykjavik/hanna-react 0.10.84 → 0.10.85

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 (437) hide show
  1. package/AccordionList.d.ts +2 -2
  2. package/AccordionList.js +5 -5
  3. package/ActionCards.d.ts +2 -2
  4. package/ActionCards.js +4 -4
  5. package/Alert.d.ts +1 -1
  6. package/Alert.js +6 -6
  7. package/ArticleCards.d.ts +1 -1
  8. package/ArticleCards.js +2 -2
  9. package/ArticleCarousel/_ArticleCarouselCard.d.ts +2 -2
  10. package/ArticleCarousel/_ArticleCarouselCard.js +7 -7
  11. package/ArticleCarousel.d.ts +3 -3
  12. package/ArticleCarousel.js +3 -3
  13. package/ArticleMeta.js +2 -2
  14. package/BasicTable.d.ts +1 -1
  15. package/BasicTable.js +2 -2
  16. package/BgBox.d.ts +1 -1
  17. package/BgBox.js +3 -3
  18. package/Bling.js +2 -2
  19. package/BlockQuote.d.ts +1 -1
  20. package/BlockQuote.js +2 -2
  21. package/BreadCrumbs.js +2 -2
  22. package/ButtonBack.d.ts +1 -1
  23. package/ButtonBack.js +2 -2
  24. package/ButtonPrimary.d.ts +1 -1
  25. package/ButtonPrimary.js +2 -2
  26. package/ButtonSecondary.d.ts +1 -1
  27. package/ButtonSecondary.js +2 -2
  28. package/ButtonTertiary.d.ts +1 -1
  29. package/ButtonTertiary.js +2 -2
  30. package/CHANGELOG.md +7 -0
  31. package/Carousel.d.ts +2 -2
  32. package/Carousel.js +2 -2
  33. package/CenterColumn.d.ts +1 -1
  34. package/CenterColumn.js +2 -2
  35. package/Checkbox.d.ts +1 -1
  36. package/Checkbox.js +2 -2
  37. package/CheckboxButton.d.ts +1 -1
  38. package/CheckboxButton.js +2 -2
  39. package/CheckboxButtonsGroup.d.ts +1 -1
  40. package/CheckboxButtonsGroup.js +3 -3
  41. package/CheckboxGroup.d.ts +1 -1
  42. package/CheckboxGroup.js +3 -3
  43. package/CityBlock.d.ts +4 -4
  44. package/CityBlock.js +4 -4
  45. package/ContactBubble.d.ts +1 -1
  46. package/ContactBubble.js +6 -6
  47. package/ContentArticle.d.ts +4 -4
  48. package/ContentArticle.js +14 -14
  49. package/ContentImage.d.ts +1 -1
  50. package/ContentImage.js +2 -2
  51. package/Datepicker.d.ts +1 -1
  52. package/Datepicker.js +2 -2
  53. package/ExtraLinks.d.ts +2 -2
  54. package/ExtraLinks.js +6 -6
  55. package/FeatureList.d.ts +1 -1
  56. package/FeatureList.js +4 -4
  57. package/FileInput.d.ts +2 -2
  58. package/FileInput.js +4 -4
  59. package/Foonote.d.ts +1 -1
  60. package/Foonote.js +2 -2
  61. package/FooterBadges.js +2 -2
  62. package/Form.d.ts +1 -1
  63. package/FormField.d.ts +1 -1
  64. package/FormField.js +4 -4
  65. package/Gallery/_GalleryItem.d.ts +1 -1
  66. package/Gallery/_GalleryItem.js +7 -7
  67. package/Gallery/_GalleryModal.d.ts +1 -1
  68. package/Gallery/_GalleryModal.js +4 -4
  69. package/Gallery/_GalleryModalContext.d.ts +2 -2
  70. package/Gallery/_GalleryModalItem.d.ts +1 -1
  71. package/Gallery/_GalleryModalItem.js +2 -2
  72. package/Gallery.d.ts +4 -4
  73. package/Gallery.js +7 -7
  74. package/GridBlocks.d.ts +3 -3
  75. package/GridBlocks.js +8 -8
  76. package/Heading.d.ts +1 -1
  77. package/HeroBlock.d.ts +3 -3
  78. package/HeroBlock.js +8 -8
  79. package/Illustration.d.ts +1 -1
  80. package/Illustration.js +2 -2
  81. package/ImageCards.d.ts +2 -2
  82. package/ImageCards.js +4 -4
  83. package/InfoBlock.d.ts +1 -1
  84. package/InfoBlock.js +2 -2
  85. package/InfoHero.d.ts +3 -3
  86. package/InfoHero.js +10 -10
  87. package/IslandBlock.d.ts +4 -4
  88. package/IslandBlock.js +4 -4
  89. package/IslandPageBlock.d.ts +4 -4
  90. package/IslandPageBlock.js +4 -4
  91. package/LabeledTextBlock.d.ts +2 -2
  92. package/LabeledTextBlock.js +4 -4
  93. package/Layout.d.ts +1 -1
  94. package/Layout.js +13 -13
  95. package/MainMenu/_Auxiliary.d.ts +1 -1
  96. package/MainMenu/_Auxiliary.js +2 -2
  97. package/MainMenu/_PrimaryPanel.js +2 -2
  98. package/MainMenu.d.ts +3 -3
  99. package/MainMenu.js +15 -13
  100. package/MiniMetrics.d.ts +2 -2
  101. package/MiniMetrics.js +4 -4
  102. package/NameCard.js +4 -4
  103. package/NameCards.d.ts +1 -1
  104. package/NameCards.js +2 -2
  105. package/NewsHero.d.ts +2 -2
  106. package/NewsHero.js +7 -7
  107. package/PageFilter.d.ts +1 -1
  108. package/PageFilter.js +4 -4
  109. package/PageHeading.d.ts +1 -1
  110. package/PageHeading.js +2 -2
  111. package/Picture.d.ts +1 -1
  112. package/Picture.js +2 -2
  113. package/PullQuote.d.ts +1 -1
  114. package/PullQuote.js +2 -2
  115. package/RadioButtonsGroup.d.ts +1 -1
  116. package/RadioButtonsGroup.js +4 -4
  117. package/RadioGroup.d.ts +2 -2
  118. package/RadioGroup.js +4 -4
  119. package/RelatedLinks.js +2 -2
  120. package/RowBlock.d.ts +1 -1
  121. package/RowBlock.js +2 -2
  122. package/SearchInput.d.ts +1 -1
  123. package/SearchInput.js +2 -2
  124. package/SearchResults/_SearchResultsItem.js +4 -4
  125. package/SearchResults.d.ts +2 -2
  126. package/SearchResults.js +7 -7
  127. package/SeenEffect.d.ts +1 -1
  128. package/SeenEffect.js +3 -3
  129. package/Selectbox.d.ts +2 -2
  130. package/Selectbox.js +2 -2
  131. package/ShareButtons.d.ts +1 -1
  132. package/ShareButtons.js +2 -2
  133. package/SiteSearchAutocomplete.js +2 -2
  134. package/SiteSearchCurtain.js +2 -2
  135. package/SiteSearchInput.d.ts +2 -2
  136. package/SiteSearchInput.js +2 -2
  137. package/SubHeading.d.ts +2 -2
  138. package/SubHeading.js +2 -2
  139. package/Tabs.d.ts +2 -2
  140. package/Tabs.js +4 -4
  141. package/TagPill.d.ts +1 -1
  142. package/TagPill.js +3 -3
  143. package/TextBlock.d.ts +2 -2
  144. package/TextBlock.js +2 -2
  145. package/TextButton.d.ts +1 -1
  146. package/TextButton.js +2 -2
  147. package/TextInput.d.ts +1 -1
  148. package/TextInput.js +2 -2
  149. package/VerticalTabsTOC.d.ts +1 -1
  150. package/VerticalTabsTOC.js +2 -2
  151. package/WizardLayout.d.ts +1 -1
  152. package/WizardLayout.js +8 -8
  153. package/WizardLayoutClose.d.ts +1 -1
  154. package/WizardLayoutClose.js +2 -2
  155. package/_abstract/_AbstractCarousel.d.ts +2 -2
  156. package/_abstract/_AbstractCarousel.js +6 -6
  157. package/_abstract/_Blings.d.ts +1 -1
  158. package/_abstract/_Blings.js +2 -2
  159. package/_abstract/_Block.d.ts +3 -3
  160. package/_abstract/_Block.js +6 -6
  161. package/_abstract/_Button.js +2 -2
  162. package/_abstract/_CardList.d.ts +1 -1
  163. package/_abstract/_CardList.js +4 -4
  164. package/_abstract/_Image.js +2 -2
  165. package/_abstract/_Quote.js +2 -2
  166. package/_abstract/_TogglerGroup.d.ts +2 -2
  167. package/_abstract/_TogglerGroup.js +2 -2
  168. package/_abstract/_TogglerGroupField.d.ts +3 -3
  169. package/_abstract/_TogglerGroupField.js +4 -4
  170. package/assets.d.ts +2 -2
  171. package/esm/AccordionList.d.ts +25 -0
  172. package/esm/AccordionList.js +32 -0
  173. package/esm/ActionCards.d.ts +6 -0
  174. package/esm/ActionCards.js +9 -0
  175. package/esm/Alert.d.ts +48 -0
  176. package/esm/Alert.js +90 -0
  177. package/esm/ArticleCards.d.ts +8 -0
  178. package/esm/ArticleCards.js +4 -0
  179. package/esm/ArticleCarousel/_ArticleCarouselCard.d.ts +28 -0
  180. package/esm/ArticleCarousel/_ArticleCarouselCard.js +24 -0
  181. package/esm/ArticleCarousel.d.ts +12 -0
  182. package/esm/ArticleCarousel.js +8 -0
  183. package/esm/ArticleMeta.d.ts +10 -0
  184. package/esm/ArticleMeta.js +19 -0
  185. package/esm/Attention.d.ts +7 -0
  186. package/esm/Attention.js +4 -0
  187. package/esm/BasicTable.d.ts +14 -0
  188. package/esm/BasicTable.js +29 -0
  189. package/esm/BgBox.d.ts +8 -0
  190. package/esm/BgBox.js +9 -0
  191. package/esm/Bling.d.ts +81 -0
  192. package/esm/Bling.js +44 -0
  193. package/esm/BlockBreak.d.ts +2 -0
  194. package/esm/BlockBreak.js +6 -0
  195. package/esm/BlockQuote.d.ts +4 -0
  196. package/esm/BlockQuote.js +4 -0
  197. package/esm/BreadCrumbs.d.ts +11 -0
  198. package/esm/BreadCrumbs.js +28 -0
  199. package/esm/ButtonBack.d.ts +7 -0
  200. package/esm/ButtonBack.js +4 -0
  201. package/esm/ButtonBar.d.ts +17 -0
  202. package/esm/ButtonBar.js +15 -0
  203. package/esm/ButtonPrimary.d.ts +7 -0
  204. package/esm/ButtonPrimary.js +4 -0
  205. package/esm/ButtonSecondary.d.ts +7 -0
  206. package/esm/ButtonSecondary.js +4 -0
  207. package/esm/ButtonTertiary.d.ts +12 -0
  208. package/esm/ButtonTertiary.js +15 -0
  209. package/esm/Carousel.d.ts +4 -0
  210. package/esm/Carousel.js +4 -0
  211. package/esm/CarouselStepper.d.ts +4 -0
  212. package/esm/CarouselStepper.js +4 -0
  213. package/esm/CenterColumn.d.ts +7 -0
  214. package/esm/CenterColumn.js +7 -0
  215. package/esm/Checkbox.d.ts +4 -0
  216. package/esm/Checkbox.js +4 -0
  217. package/esm/CheckboxButton.d.ts +4 -0
  218. package/esm/CheckboxButton.js +4 -0
  219. package/esm/CheckboxButtonsGroup.d.ts +12 -0
  220. package/esm/CheckboxButtonsGroup.js +13 -0
  221. package/esm/CheckboxGroup.d.ts +10 -0
  222. package/esm/CheckboxGroup.js +7 -0
  223. package/esm/CityBlock.d.ts +21 -0
  224. package/esm/CityBlock.js +18 -0
  225. package/esm/ContactBubble.d.ts +58 -0
  226. package/esm/ContactBubble.js +152 -0
  227. package/esm/ContentArticle.d.ts +16 -0
  228. package/esm/ContentArticle.js +24 -0
  229. package/esm/ContentImage.d.ts +8 -0
  230. package/esm/ContentImage.js +18 -0
  231. package/esm/Datepicker.d.ts +40 -0
  232. package/esm/Datepicker.js +78 -0
  233. package/esm/ExtraLinks.d.ts +18 -0
  234. package/esm/ExtraLinks.js +24 -0
  235. package/esm/FeatureList.d.ts +12 -0
  236. package/esm/FeatureList.js +16 -0
  237. package/esm/FieldGroup.d.ts +10 -0
  238. package/esm/FieldGroup.js +9 -0
  239. package/esm/FileInput/_FileInput.utils.d.ts +36 -0
  240. package/esm/FileInput/_FileInput.utils.js +69 -0
  241. package/esm/FileInput/_FileInputFileList.d.ts +11 -0
  242. package/esm/FileInput/_FileInputFileList.js +19 -0
  243. package/esm/FileInput.d.ts +48 -0
  244. package/esm/FileInput.js +130 -0
  245. package/esm/Foonote.d.ts +12 -0
  246. package/esm/Foonote.js +7 -0
  247. package/esm/FooterBadges.d.ts +9 -0
  248. package/esm/FooterBadges.js +12 -0
  249. package/esm/FooterInfo.d.ts +20 -0
  250. package/esm/FooterInfo.js +12 -0
  251. package/esm/Footnote.d.ts +6 -0
  252. package/esm/Footnote.js +3 -0
  253. package/esm/Form.d.ts +7 -0
  254. package/esm/Form.js +10 -0
  255. package/esm/FormField.d.ts +65 -0
  256. package/esm/FormField.js +92 -0
  257. package/esm/Gallery/_GalleryItem.d.ts +7 -0
  258. package/esm/Gallery/_GalleryItem.js +19 -0
  259. package/esm/Gallery/_GalleryModal.d.ts +6 -0
  260. package/esm/Gallery/_GalleryModal.js +53 -0
  261. package/esm/Gallery/_GalleryModalContext.d.ts +9 -0
  262. package/esm/Gallery/_GalleryModalContext.js +2 -0
  263. package/esm/Gallery/_GalleryModalItem.d.ts +2 -0
  264. package/esm/Gallery/_GalleryModalItem.js +11 -0
  265. package/esm/Gallery.d.ts +17 -0
  266. package/esm/Gallery.js +27 -0
  267. package/esm/GridBlocks.d.ts +26 -0
  268. package/esm/GridBlocks.js +24 -0
  269. package/esm/Heading.d.ts +22 -0
  270. package/esm/Heading.js +19 -0
  271. package/esm/HeroBlock.d.ts +19 -0
  272. package/esm/HeroBlock.js +21 -0
  273. package/esm/IframeBlock.d.ts +28 -0
  274. package/esm/IframeBlock.js +26 -0
  275. package/esm/Illustration.d.ts +10 -0
  276. package/esm/Illustration.js +8 -0
  277. package/esm/ImageCards.d.ts +10 -0
  278. package/esm/ImageCards.js +12 -0
  279. package/esm/InfoBlock.d.ts +13 -0
  280. package/esm/InfoBlock.js +13 -0
  281. package/esm/InfoHero.d.ts +18 -0
  282. package/esm/InfoHero.js +83 -0
  283. package/esm/IslandBlock.d.ts +25 -0
  284. package/esm/IslandBlock.js +16 -0
  285. package/esm/IslandPageBlock.d.ts +24 -0
  286. package/esm/IslandPageBlock.js +16 -0
  287. package/esm/LabeledTextBlock.d.ts +11 -0
  288. package/esm/LabeledTextBlock.js +14 -0
  289. package/esm/Layout.d.ts +32 -0
  290. package/esm/Layout.js +56 -0
  291. package/esm/MainMenu/_Auxiliary.d.ts +6 -0
  292. package/esm/MainMenu/_Auxiliary.js +13 -0
  293. package/esm/MainMenu/_PrimaryPanel.d.ts +29 -0
  294. package/esm/MainMenu/_PrimaryPanel.js +22 -0
  295. package/esm/MainMenu.d.ts +62 -0
  296. package/esm/MainMenu.js +221 -0
  297. package/esm/MiniMetrics.d.ts +8 -0
  298. package/esm/MiniMetrics.js +12 -0
  299. package/esm/Modal.d.ts +8 -0
  300. package/esm/Modal.js +14 -0
  301. package/esm/NameCard.d.ts +64 -0
  302. package/esm/NameCard.js +82 -0
  303. package/esm/NameCards.d.ts +6 -0
  304. package/esm/NameCards.js +7 -0
  305. package/esm/NewsHero.d.ts +14 -0
  306. package/esm/NewsHero.js +86 -0
  307. package/esm/PageFilter.d.ts +16 -0
  308. package/esm/PageFilter.js +15 -0
  309. package/esm/PageHeading.d.ts +10 -0
  310. package/esm/PageHeading.js +12 -0
  311. package/esm/Picture.d.ts +7 -0
  312. package/esm/Picture.js +8 -0
  313. package/esm/ProcessOverview.d.ts +13 -0
  314. package/esm/ProcessOverview.js +17 -0
  315. package/esm/PullQuote.d.ts +4 -0
  316. package/esm/PullQuote.js +4 -0
  317. package/esm/RadioButtonsGroup.d.ts +12 -0
  318. package/esm/RadioButtonsGroup.js +14 -0
  319. package/esm/RadioGroup.d.ts +16 -0
  320. package/esm/RadioGroup.js +8 -0
  321. package/esm/RelatedLinks.d.ts +20 -0
  322. package/esm/RelatedLinks.js +26 -0
  323. package/esm/RowBlock.d.ts +12 -0
  324. package/esm/RowBlock.js +9 -0
  325. package/esm/RowBlockColumn.d.ts +8 -0
  326. package/esm/RowBlockColumn.js +11 -0
  327. package/esm/SearchInput.d.ts +18 -0
  328. package/esm/SearchInput.js +23 -0
  329. package/esm/SearchResults/_SearchResultsItem.d.ts +18 -0
  330. package/esm/SearchResults/_SearchResultsItem.js +14 -0
  331. package/esm/SearchResults.d.ts +37 -0
  332. package/esm/SearchResults.js +108 -0
  333. package/esm/SeenEffect.d.ts +4 -0
  334. package/esm/SeenEffect.js +9 -0
  335. package/esm/Selectbox.d.ts +11 -0
  336. package/esm/Selectbox.js +40 -0
  337. package/esm/ShareButtons.d.ts +9 -0
  338. package/esm/ShareButtons.js +56 -0
  339. package/esm/Sharpie.d.ts +23 -0
  340. package/esm/Sharpie.js +22 -0
  341. package/esm/SiteSearchAutocomplete.d.ts +40 -0
  342. package/esm/SiteSearchAutocomplete.js +48 -0
  343. package/esm/SiteSearchCurtain.d.ts +6 -0
  344. package/esm/SiteSearchCurtain.js +28 -0
  345. package/esm/SiteSearchInput.d.ts +24 -0
  346. package/esm/SiteSearchInput.js +30 -0
  347. package/esm/Skeleton.d.ts +25 -0
  348. package/esm/Skeleton.js +30 -0
  349. package/esm/SubHeading.d.ts +10 -0
  350. package/esm/SubHeading.js +13 -0
  351. package/esm/Tabs.d.ts +35 -0
  352. package/esm/Tabs.js +94 -0
  353. package/esm/TagPill.d.ts +25 -0
  354. package/esm/TagPill.js +34 -0
  355. package/esm/TextBlock.d.ts +15 -0
  356. package/esm/TextBlock.js +15 -0
  357. package/esm/TextButton.d.ts +9 -0
  358. package/esm/TextButton.js +9 -0
  359. package/esm/TextInput.d.ts +16 -0
  360. package/esm/TextInput.js +32 -0
  361. package/esm/Tooltip.d.ts +7 -0
  362. package/esm/Tooltip.js +58 -0
  363. package/esm/VSpacer.d.ts +22 -0
  364. package/esm/VSpacer.js +41 -0
  365. package/esm/VerticalTabsTOC.d.ts +14 -0
  366. package/esm/VerticalTabsTOC.js +68 -0
  367. package/esm/WizardLayout.d.ts +15 -0
  368. package/esm/WizardLayout.js +30 -0
  369. package/esm/WizardLayoutClose.d.ts +3 -0
  370. package/esm/WizardLayoutClose.js +4 -0
  371. package/esm/WizardStepper.d.ts +36 -0
  372. package/esm/WizardStepper.js +26 -0
  373. package/esm/_abstract/_AbstractCarousel.d.ts +29 -0
  374. package/esm/_abstract/_AbstractCarousel.js +108 -0
  375. package/esm/_abstract/_Blings.d.ts +11 -0
  376. package/esm/_abstract/_Blings.js +11 -0
  377. package/esm/_abstract/_Block.d.ts +21 -0
  378. package/esm/_abstract/_Block.js +23 -0
  379. package/esm/_abstract/_Button.d.ts +40 -0
  380. package/esm/_abstract/_Button.js +36 -0
  381. package/esm/_abstract/_CardList.d.ts +34 -0
  382. package/esm/_abstract/_CardList.js +37 -0
  383. package/esm/_abstract/_Image.d.ts +36 -0
  384. package/esm/_abstract/_Image.js +26 -0
  385. package/esm/_abstract/_Link.d.ts +60 -0
  386. package/esm/_abstract/_Link.js +64 -0
  387. package/esm/_abstract/_Quote.d.ts +11 -0
  388. package/esm/_abstract/_Quote.js +8 -0
  389. package/esm/_abstract/_TogglerGroup.d.ts +32 -0
  390. package/esm/_abstract/_TogglerGroup.js +28 -0
  391. package/esm/_abstract/_TogglerGroupField.d.ts +19 -0
  392. package/esm/_abstract/_TogglerGroupField.js +17 -0
  393. package/esm/_abstract/_TogglerInput.d.ts +23 -0
  394. package/esm/_abstract/_TogglerInput.js +23 -0
  395. package/esm/_abstract/breakOnNL.d.ts +1 -0
  396. package/esm/_abstract/breakOnNL.js +7 -0
  397. package/esm/assets.d.ts +42 -0
  398. package/esm/assets.js +58 -0
  399. package/esm/constants.d.ts +19 -0
  400. package/esm/constants.js +22 -0
  401. package/esm/focus-visible.d.ts +1 -0
  402. package/esm/focus-visible.js +3 -0
  403. package/esm/index.d.ts +97 -0
  404. package/esm/index.js +1 -0
  405. package/esm/package.json +1 -0
  406. package/esm/utils/HannaUIState.d.ts +8 -0
  407. package/esm/utils/HannaUIState.js +7 -0
  408. package/esm/utils/browserSide.d.ts +1 -0
  409. package/esm/utils/browserSide.js +1 -0
  410. package/esm/utils/config.d.ts +4 -0
  411. package/esm/utils/config.js +2 -0
  412. package/esm/utils/env.d.ts +1 -0
  413. package/esm/utils/env.js +8 -0
  414. package/esm/utils/seenEffect.d.ts +27 -0
  415. package/esm/utils/seenEffect.js +75 -0
  416. package/esm/utils/useDidChange.d.ts +37 -0
  417. package/esm/utils/useDidChange.js +43 -0
  418. package/esm/utils/useFormatMonitor.d.ts +38 -0
  419. package/esm/utils/useFormatMonitor.js +41 -0
  420. package/esm/utils/useGetSVGtext.d.ts +10 -0
  421. package/esm/utils/useGetSVGtext.js +23 -0
  422. package/esm/utils/useMenuToggling.d.ts +8 -0
  423. package/esm/utils/useMenuToggling.js +62 -0
  424. package/esm/utils/useMixedControlState.d.ts +137 -0
  425. package/esm/utils/useMixedControlState.js +101 -0
  426. package/esm/utils/useScrollbarWidthCSSVar.d.ts +17 -0
  427. package/esm/utils/useScrollbarWidthCSSVar.js +19 -0
  428. package/esm/utils.d.ts +8 -0
  429. package/esm/utils.js +8 -0
  430. package/package.json +389 -3
  431. package/utils/config.d.ts +2 -2
  432. package/utils/config.js +2 -2
  433. package/utils/useDidChange.d.ts +1 -1
  434. package/utils/useDidChange.js +1 -1
  435. package/utils/useMenuToggling.js +2 -2
  436. package/utils.d.ts +8 -8
  437. package/utils.js +8 -8
@@ -0,0 +1,24 @@
1
+ import React from 'react';
2
+ import getBemClass from '@hugsmidjan/react/utils/getBemClass';
3
+ import { getEfnistaknUrl } from '@reykjavik/hanna-utils/assets';
4
+ import { Image } from './_abstract/_Image.js';
5
+ import { Link } from './_abstract/_Link.js';
6
+ import { useSeenEffect } from './utils/seenEffect.js';
7
+ import ButtonTertiary from './ButtonTertiary.js';
8
+ export const GridBlocks = (props) => {
9
+ const { blocks, twocol, startSeen } = props;
10
+ const [ref] = useSeenEffect(startSeen);
11
+ return (React.createElement("div", { className: getBemClass('GridBlocks', [twocol && 'twocol']), ref: ref }, blocks.map(({ title, summary, href, links = [], icon, image }, i) => {
12
+ const imageProps = icon ? { src: getEfnistaknUrl(icon) } : image;
13
+ return (React.createElement("div", { key: i, className: "GridBlocks__item" },
14
+ imageProps && React.createElement(Image, Object.assign({ className: "GridBlocks__illustration" }, imageProps)),
15
+ React.createElement("div", { className: "GridBlocks__textwrap" },
16
+ React.createElement("h3", { className: "GridBlocks__item__title" }, href != null ? (React.createElement(Link, { className: "GridBlocks__item__titlelink", href: href }, title)) : (title)),
17
+ React.createElement("div", { className: "GridBlocks__item__summary" }, summary),
18
+ React.createElement("ul", { className: "GridBlocks__links" }, links.map((link, i) => {
19
+ return (React.createElement("li", { key: i, className: "GridBlocks__link" },
20
+ React.createElement(ButtonTertiary, Object.assign({}, link))));
21
+ })))));
22
+ })));
23
+ };
24
+ export default GridBlocks;
@@ -0,0 +1,22 @@
1
+ import { ReactNode } from 'react';
2
+ import { ComponentLayoutProps } from './constants.js';
3
+ declare const sizes: {
4
+ readonly small: "small";
5
+ /** Default value */
6
+ readonly normal: "";
7
+ readonly large: "large";
8
+ };
9
+ type HeadingSize = keyof typeof sizes;
10
+ export type HeadingProps = {
11
+ Tag?: 'h2' | 'h3';
12
+ size?: HeadingSize;
13
+ children: ReactNode;
14
+ /**
15
+ * Make an exception and render a `<h1/>` element.
16
+ *
17
+ * This prop is ignore if the `Tag` prop is defined.
18
+ */
19
+ forceH1?: boolean;
20
+ } & ComponentLayoutProps;
21
+ export declare const Heading: (props: HeadingProps) => JSX.Element;
22
+ export default Heading;
package/esm/Heading.js ADDED
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import getBemClass from '@hugsmidjan/react/utils/getBemClass';
3
+ const sizes = {
4
+ small: 'small',
5
+ /** Default value */
6
+ normal: '',
7
+ large: 'large',
8
+ };
9
+ export const Heading = (props) => {
10
+ const { size = 'normal', align, wide, children } = props;
11
+ const Tag = props.Tag || (props.forceH1 ? 'h1' : 'h2');
12
+ const suppressWarning = process.env.NODE_ENV !== 'production' && Tag === 'h1' ? true : undefined;
13
+ return (React.createElement(Tag, { "data-dev-forcedh1": suppressWarning, className: getBemClass('Heading', [
14
+ sizes[size],
15
+ align === 'right' && 'align--' + align,
16
+ !align && wide && 'wide',
17
+ ]) }, children));
18
+ };
19
+ export default Heading;
@@ -0,0 +1,19 @@
1
+ import { Illustration } from '@reykjavik/hanna-utils/assets';
2
+ import { ButtonProps } from './_abstract/_Button.js';
3
+ import { ImageProps } from './_abstract/_Image.js';
4
+ import { SeenProp } from './utils/seenEffect.js';
5
+ type HeroBlockImageProps = {
6
+ illustration: Illustration;
7
+ image?: undefined;
8
+ } | {
9
+ image: ImageProps;
10
+ illustration?: undefined;
11
+ };
12
+ export type HeroBlockProps = {
13
+ title: string;
14
+ summary: string | JSX.Element;
15
+ primaryButton?: ButtonProps;
16
+ secondaryButton?: ButtonProps;
17
+ } & HeroBlockImageProps & SeenProp;
18
+ export declare const HeroBlock: (props: HeroBlockProps) => JSX.Element;
19
+ export default HeroBlock;
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import { getIllustrationUrl } from '@reykjavik/hanna-utils/assets';
3
+ import { Image } from './_abstract/_Image.js';
4
+ import { useSeenEffect } from './utils/seenEffect.js';
5
+ import ButtonPrimary from './ButtonPrimary.js';
6
+ import ButtonTertiary from './ButtonTertiary.js';
7
+ export const HeroBlock = (props) => {
8
+ const { title, summary, illustration, image, primaryButton, secondaryButton, startSeen, } = props;
9
+ const hasButtons = Boolean(primaryButton || secondaryButton);
10
+ const imgProps = illustration ? { src: getIllustrationUrl(illustration) } : image;
11
+ const [ref] = useSeenEffect(startSeen);
12
+ return (React.createElement("div", { className: "HeroBlock", ref: ref },
13
+ React.createElement("h1", { className: "HeroBlock__title" }, title),
14
+ React.createElement(Image, Object.assign({ className: "HeroBlock__image" }, imgProps)),
15
+ React.createElement("div", { className: "HeroBlock__summary" }, summary),
16
+ hasButtons && (React.createElement("div", { className: "HeroBlock__buttons" },
17
+ primaryButton && React.createElement(ButtonPrimary, Object.assign({}, primaryButton)),
18
+ ' ',
19
+ secondaryButton && React.createElement(ButtonTertiary, Object.assign({}, secondaryButton))))));
20
+ };
21
+ export default HeroBlock;
@@ -0,0 +1,28 @@
1
+ import { EitherObj } from '@reykjavik/hanna-utils';
2
+ import { ResizerOptions } from 'iframe-resizer-react';
3
+ export type IframeBlockProps = {
4
+ src: string;
5
+ /** Accessible title attribute for the iframe (similar to alt="" on images) */
6
+ title: string;
7
+ framed?: boolean;
8
+ compact?: boolean;
9
+ align?: 'right';
10
+ } & EitherObj<{
11
+ /** Default: `'auto'` ... which initializes "iframe-resizer" script */
12
+ height?: 'auto';
13
+ /** Default: `false` ... Set to `true` for same-site only, or provide array of allowed domain-names */
14
+ checkOrigin?: ResizerOptions['checkOrigin'];
15
+ }, {
16
+ height: number;
17
+ scrolling?: boolean | 'no' | 'yes';
18
+ }>;
19
+ /**
20
+ * When `height` is undefined or "auto", then Add the following code-snipped to the iframed page:
21
+ *
22
+ * ```js
23
+ * <script> window.iFrameResizer = { targetOrigin: '*' }; </script>
24
+ * <script src="https://styles.reykjavik.is/assets/scripts/iframeResizer.contentWindow@4.js"></script>
25
+ * ```
26
+ */
27
+ export declare const IframeBlock: (props: IframeBlockProps) => JSX.Element;
28
+ export default IframeBlock;
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ import getBemClass from '@hugsmidjan/react/utils/getBemClass';
3
+ import IframeResizer from 'iframe-resizer-react';
4
+ /**
5
+ * When `height` is undefined or "auto", then Add the following code-snipped to the iframed page:
6
+ *
7
+ * ```js
8
+ * <script> window.iFrameResizer = { targetOrigin: '*' }; </script>
9
+ * <script src="https://styles.reykjavik.is/assets/scripts/iframeResizer.contentWindow@4.js"></script>
10
+ * ```
11
+ */
12
+ export const IframeBlock = (props) => {
13
+ const { title, src, framed, compact, scrolling, height = 'auto', align, checkOrigin = false, } = props;
14
+ const className = getBemClass('IframeBlock', [
15
+ framed && 'framed',
16
+ compact && 'compact',
17
+ align === 'right' && 'align--' + align,
18
+ ]);
19
+ return height === 'auto' ? (React.createElement(IframeResizer, { className: className, title: title, src: src, checkOrigin: checkOrigin })) : (React.createElement("iframe", { className: className, title: title, src: src,
20
+ // hidden tiger: pass negative height to disable iframe-resizer but not set height explicitly
21
+ // (Silly hack, don't rely on this)
22
+ height: height < 0 ? undefined : height,
23
+ // allow undefined to suppress scrolling attribute
24
+ scrolling: scrolling === true ? 'yes' : scrolling === false ? 'no' : scrolling }));
25
+ };
26
+ export default IframeBlock;
@@ -0,0 +1,10 @@
1
+ import { EitherObj } from '@reykjavik/hanna-utils';
2
+ import { Illustration as IllustrationName } from '@reykjavik/hanna-utils/assets';
3
+ import { ImageProps } from './_abstract/_Image.js';
4
+ type IllustrationProps = EitherObj<{
5
+ type: IllustrationName;
6
+ }, {
7
+ image: ImageProps;
8
+ }>;
9
+ export declare const Illustration: (props: IllustrationProps) => JSX.Element;
10
+ export default Illustration;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { getIllustrationUrl, } from '@reykjavik/hanna-utils/assets';
3
+ import { Image } from './_abstract/_Image.js';
4
+ export const Illustration = (props) => {
5
+ const imgProps = props.type ? { src: getIllustrationUrl(props.type) } : props.image;
6
+ return React.createElement(Image, Object.assign({ className: "Illustration" }, imgProps));
7
+ };
8
+ export default Illustration;
@@ -0,0 +1,10 @@
1
+ import { CardListSummaryProps, ImageCardListProps, ImageCardProps as _ImageCardProps } from './_abstract/_CardList.js';
2
+ import { SeenProp } from './utils/seenEffect.js';
3
+ export type ImageCardsItemProps = _ImageCardProps;
4
+ /** @deprecated Use `ImageCardsItemProps` instead. (Will be removed in v0.11) */
5
+ export type ImageCardProps = ImageCardsItemProps;
6
+ export type ImageCardsProps = ImageCardListProps & CardListSummaryProps & {
7
+ background?: boolean;
8
+ } & SeenProp;
9
+ export declare const ImageCards: (props: ImageCardsProps) => JSX.Element;
10
+ export default ImageCards;
@@ -0,0 +1,12 @@
1
+ import { __rest } from "tslib";
2
+ import React from 'react';
3
+ import getBemClass from '@hugsmidjan/react/utils/getBemClass';
4
+ import { CardList, } from './_abstract/_CardList.js';
5
+ import { useSeenEffect } from './utils/seenEffect.js';
6
+ export const ImageCards = (props) => {
7
+ const { background, startSeen } = props, cardListProps = __rest(props, ["background", "startSeen"]);
8
+ const [ref] = useSeenEffect(startSeen);
9
+ return (React.createElement("div", { className: getBemClass('ImageCards', background && 'background'), ref: ref },
10
+ React.createElement(CardList, Object.assign({}, cardListProps, { bemPrefix: "ImageCards", imgPlaceholder: props.imgPlaceholder || true }))));
11
+ };
12
+ export default ImageCards;
@@ -0,0 +1,13 @@
1
+ import { EitherObj } from '@reykjavik/hanna-utils';
2
+ import { SeenProp } from './utils/seenEffect.js';
3
+ export type InfoBlockProps = {
4
+ title: string;
5
+ subtitle?: string | JSX.Element;
6
+ items: Array<string | JSX.Element>;
7
+ } & EitherObj<{
8
+ attention?: string | JSX.Element;
9
+ }, {
10
+ extraInfo?: string | JSX.Element;
11
+ }> & SeenProp;
12
+ export declare const InfoBlock: (props: InfoBlockProps) => JSX.Element;
13
+ export default InfoBlock;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { useSeenEffect } from './utils/seenEffect.js';
3
+ export const InfoBlock = (props) => {
4
+ const { title, subtitle, items, startSeen } = props;
5
+ const [ref] = useSeenEffect(startSeen);
6
+ return (React.createElement("div", { className: "InfoBlock", ref: ref },
7
+ React.createElement("h2", { className: "InfoBlock__title" }, title),
8
+ subtitle && React.createElement("div", { className: "InfoBlock__subtitle" }, subtitle),
9
+ React.createElement("ul", { className: "InfoBlock__items" }, items.map((item, i) => (React.createElement("li", { key: i, className: "InfoBlock__item" }, item)))),
10
+ 'extraInfo' in props && (React.createElement("div", { className: "InfoBlock__extrainfo" }, props.extraInfo)),
11
+ 'attention' in props && (React.createElement("div", { className: "InfoBlock__attention" }, props.attention))));
12
+ };
13
+ export default InfoBlock;
@@ -0,0 +1,18 @@
1
+ import { ButtonProps } from './_abstract/_Button.js';
2
+ import { ImageProps } from './_abstract/_Image.js';
3
+ import { Alignment } from './constants.js';
4
+ type BlingOptions = 'waves' | 'sunny-waves' | 'triangles' | 'circles';
5
+ export type InfoHeroProps = {
6
+ title: string;
7
+ titleBlurb?: string | JSX.Element;
8
+ /** Inserts `<br/>`s on `\n`. Collapses multiple `\n`s. */
9
+ subTitle?: string;
10
+ blurb?: string | JSX.Element;
11
+ buttons?: Array<ButtonProps>;
12
+ footer?: string | JSX.Element;
13
+ align?: Alignment;
14
+ image?: ImageProps;
15
+ blingType?: BlingOptions;
16
+ };
17
+ export declare const InfoHero: (props: InfoHeroProps) => JSX.Element;
18
+ export default InfoHero;
@@ -0,0 +1,83 @@
1
+ import React from 'react';
2
+ import getBemClass from '@hugsmidjan/react/utils/getBemClass';
3
+ import { Blings } from './_abstract/_Blings.js';
4
+ import { Image } from './_abstract/_Image.js';
5
+ import { breakOnNL } from './_abstract/breakOnNL.js';
6
+ import ButtonTertiary from './ButtonTertiary.js';
7
+ import { aligns } from './constants.js';
8
+ const blingOptions = {
9
+ waves: [
10
+ {
11
+ type: 'waves-medium',
12
+ color: 'primary',
13
+ align: 'left',
14
+ vertical: 'up',
15
+ parent: 'bottom',
16
+ },
17
+ ],
18
+ 'sunny-waves': [
19
+ {
20
+ type: 'waves-medium',
21
+ align: 'left',
22
+ parent: 'bottom',
23
+ vertical: 'up',
24
+ },
25
+ {
26
+ type: 'circle-medium',
27
+ color: 'secondary',
28
+ align: 'right-center',
29
+ parent: 'top',
30
+ vertical: 'down-ish',
31
+ },
32
+ ],
33
+ triangles: [
34
+ {
35
+ type: 'triangle-large',
36
+ align: 'left-center',
37
+ parent: 'bottom',
38
+ vertical: 'up',
39
+ },
40
+ {
41
+ type: 'triangle-small',
42
+ color: 'secondary',
43
+ align: 'right',
44
+ parent: 'top-ish',
45
+ vertical: 'down-ish',
46
+ overlay: true,
47
+ },
48
+ ],
49
+ circles: [
50
+ {
51
+ type: 'circle-large',
52
+ align: 'left',
53
+ parent: 'top',
54
+ vertical: 'down',
55
+ },
56
+ {
57
+ type: 'circle-small',
58
+ color: 'secondary',
59
+ align: 'right',
60
+ parent: 'bottom-ish',
61
+ vertical: 'up-ish',
62
+ overlay: true,
63
+ },
64
+ ],
65
+ };
66
+ export const InfoHero = (props) => {
67
+ const { title, titleBlurb, subTitle, blurb, image, buttons = [], footer, align, blingType, } = props;
68
+ const showButtons = Boolean(buttons.length);
69
+ const alignment = align && aligns[align] ? align : 'right';
70
+ const blings = (blingType && blingOptions[blingType]) ||
71
+ blingOptions.waves; // default to `waves`
72
+ return (React.createElement("div", { className: getBemClass('InfoHero', 'align--' + alignment) },
73
+ React.createElement("div", { className: "InfoHero__content" },
74
+ React.createElement("h1", { className: "InfoHero__title" }, title),
75
+ titleBlurb && React.createElement("div", { className: "InfoHero__titleblurb" }, titleBlurb),
76
+ subTitle && React.createElement("div", { className: "InfoHero__subtitle" }, breakOnNL(subTitle)),
77
+ blurb && React.createElement("div", { className: "InfoHero__blurb" }, blurb),
78
+ showButtons && (React.createElement("div", { className: "InfoHero__buttons" }, buttons.map((buttonProps, i) => (React.createElement(ButtonTertiary, Object.assign({ key: i }, buttonProps)))))),
79
+ footer && React.createElement("div", { className: "InfoHero__footer" }, footer)),
80
+ React.createElement(Image, Object.assign({ className: "InfoHero__image", altText: title }, image, { placeholder: true })),
81
+ React.createElement(Blings, { blings: blings, mirror: alignment === 'right' })));
82
+ };
83
+ export default InfoHero;
@@ -0,0 +1,25 @@
1
+ import { Formheimur } from '@reykjavik/hanna-utils/assets';
2
+ import { BlockItem } from './_abstract/_Block.js';
3
+ import { ImageProps } from './_abstract/_Image.js';
4
+ import { SeenProp } from './utils/seenEffect.js';
5
+ import { Alignment } from './constants.js';
6
+ type IslandBaseBlockProps = {
7
+ align?: Alignment;
8
+ };
9
+ type IslandImageBlock = {
10
+ content: BlockItem;
11
+ } & ({
12
+ shapes: Formheimur;
13
+ image?: undefined;
14
+ } | {
15
+ image: ImageProps;
16
+ shapes?: undefined;
17
+ });
18
+ type IslandContentBlocks = {
19
+ content: Array<BlockItem>;
20
+ shapes?: undefined;
21
+ image?: undefined;
22
+ };
23
+ export type IslandBlockProps = IslandBaseBlockProps & (IslandContentBlocks | IslandImageBlock) & SeenProp;
24
+ export declare const IslandBlock: (props: IslandBlockProps) => JSX.Element;
25
+ export default IslandBlock;
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import { getFormheimurUrl } from '@reykjavik/hanna-utils/assets';
3
+ import { Block } from './_abstract/_Block.js';
4
+ import { aligns } from './constants.js';
5
+ export const IslandBlock = (props) => {
6
+ const { align, content, shapes, image, startSeen } = props;
7
+ const alignment = align && aligns[align] ? align : 'right';
8
+ const blockProps = Array.isArray(content)
9
+ ? { content }
10
+ : {
11
+ content,
12
+ image: shapes ? { src: getFormheimurUrl(shapes), inline: true } : image || {},
13
+ };
14
+ return (React.createElement(Block, Object.assign({ bem: "IslandBlock", modifier: 'align--' + alignment }, blockProps, { startSeen: startSeen })));
15
+ };
16
+ export default IslandBlock;
@@ -0,0 +1,24 @@
1
+ import { Illustration } from '@reykjavik/hanna-utils/assets';
2
+ import { BlockItem } from './_abstract/_Block.js';
3
+ import { ImageProps } from './_abstract/_Image.js';
4
+ import { SeenProp } from './utils/seenEffect.js';
5
+ import { Alignment } from './constants.js';
6
+ declare const backgrounds: {
7
+ none: undefined;
8
+ gray: string;
9
+ secondary: string;
10
+ };
11
+ type Background = keyof typeof backgrounds;
12
+ type IslandPageImageProps = {
13
+ illustration: Illustration;
14
+ image?: undefined;
15
+ } | {
16
+ illustration?: undefined;
17
+ image: ImageProps;
18
+ };
19
+ export type IslandPageBlockProps = BlockItem & IslandPageImageProps & {
20
+ align?: Alignment;
21
+ background?: Background;
22
+ } & SeenProp;
23
+ export declare const IslandPageBlock: (props: IslandPageBlockProps) => JSX.Element;
24
+ export default IslandPageBlock;
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import { getIllustrationUrl } from '@reykjavik/hanna-utils/assets';
3
+ import { Block } from './_abstract/_Block.js';
4
+ import { aligns } from './constants.js';
5
+ const backgrounds = {
6
+ none: undefined,
7
+ gray: 'gray',
8
+ secondary: 'secondary',
9
+ };
10
+ export const IslandPageBlock = (props) => {
11
+ const { title, summary, buttons, illustration, image, align, background, startSeen } = props;
12
+ const alignment = align && aligns[align] ? align : 'right';
13
+ const bg = backgrounds[background || 'none'];
14
+ return (React.createElement(Block, { bem: "IslandPageBlock", modifier: ['align--' + alignment, bg && 'background--' + bg], content: { title, summary, buttons }, image: illustration ? { src: getIllustrationUrl(illustration) } : image || {}, startSeen: startSeen }));
15
+ };
16
+ export default IslandPageBlock;
@@ -0,0 +1,11 @@
1
+ import { ReactElement } from 'react';
2
+ import { ButtonProps } from './_abstract/_Button.js';
3
+ import { SeenProp } from './utils/seenEffect.js';
4
+ export type LabeledTextBlockProps = {
5
+ label: string;
6
+ summary: string | ReactElement;
7
+ wide?: boolean;
8
+ buttons?: Array<ButtonProps>;
9
+ } & SeenProp;
10
+ export declare const LabeledTextBlock: (props: LabeledTextBlockProps) => JSX.Element;
11
+ export default LabeledTextBlock;
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import getBemClass from '@hugsmidjan/react/utils/getBemClass';
3
+ import { useSeenEffect } from './utils/seenEffect.js';
4
+ import ButtonTertiary from './ButtonTertiary.js';
5
+ export const LabeledTextBlock = (props) => {
6
+ const { label, summary, wide, buttons = [], startSeen } = props;
7
+ const [ref] = useSeenEffect(startSeen);
8
+ return (React.createElement("div", { className: getBemClass('LabeledTextBlock', wide && 'wide'), ref: ref },
9
+ React.createElement("h2", { className: "LabeledTextBlock__label" }, label),
10
+ React.createElement("div", { className: "LabeledTextBlock__summary" },
11
+ summary,
12
+ buttons.map((button, i) => (React.createElement(ButtonTertiary, Object.assign({ key: i }, button)))))));
13
+ };
14
+ export default LabeledTextBlock;
@@ -0,0 +1,32 @@
1
+ import { ReactNode } from 'react';
2
+ import { BemPropsModifier } from '@hugsmidjan/react/types';
3
+ import type { HannaColorTheme } from '@reykjavik/hanna-css';
4
+ import { EitherObj } from '@reykjavik/hanna-utils';
5
+ import { DefaultTexts } from '@reykjavik/hanna-utils/i18n';
6
+ import { SSRSupport } from './utils.js';
7
+ export type LayoutI18n = {
8
+ lang?: string;
9
+ skipLinkLabel: string;
10
+ closeMenuLabel: string;
11
+ closeMenuLabelLong?: string;
12
+ };
13
+ export declare const defaultLayoutTexts: DefaultTexts<LayoutI18n>;
14
+ type LayoutProps = {
15
+ globalAlerts?: ReactNode;
16
+ mainChildren?: ReactNode;
17
+ navChildren?: ReactNode;
18
+ footerChildren?: ReactNode;
19
+ colorTheme?: HannaColorTheme;
20
+ logoLink?: string;
21
+ siteName?: string;
22
+ modifier?: BemPropsModifier['modifier'];
23
+ ssr?: SSRSupport;
24
+ texts?: LayoutI18n;
25
+ lang?: string;
26
+ } & EitherObj<{
27
+ mainChildren: ReactNode;
28
+ }, {
29
+ children: ReactNode;
30
+ }>;
31
+ export declare const Layout: (props: LayoutProps) => JSX.Element;
32
+ export default Layout;
package/esm/Layout.js ADDED
@@ -0,0 +1,56 @@
1
+ import React from 'react';
2
+ import getBemClass from '@hugsmidjan/react/utils/getBemClass';
3
+ import { getAssetUrl } from '@reykjavik/hanna-utils/assets';
4
+ import { getTexts } from '@reykjavik/hanna-utils/i18n';
5
+ import { Image } from './_abstract/_Image.js';
6
+ import { Link } from './_abstract/_Link.js';
7
+ import { HannaUIState } from './utils/HannaUIState.js';
8
+ import { useMenuToggling } from './utils/useMenuToggling.js';
9
+ import { useScrollbarWidthCSSVar } from './utils/useScrollbarWidthCSSVar.js';
10
+ import { useIsBrowserSide } from './utils.js';
11
+ export const defaultLayoutTexts = {
12
+ is: {
13
+ lang: 'is',
14
+ skipLinkLabel: 'Valmynd',
15
+ closeMenuLabel: 'Loka',
16
+ closeMenuLabelLong: 'Loka valmynd',
17
+ },
18
+ en: {
19
+ lang: 'en',
20
+ skipLinkLabel: 'Skip to navigation',
21
+ closeMenuLabel: 'Close',
22
+ closeMenuLabelLong: 'Close menu',
23
+ },
24
+ };
25
+ export const Layout = (props) => {
26
+ useScrollbarWidthCSSVar();
27
+ const { ssr, globalAlerts, mainChildren, navChildren, footerChildren, colorTheme, children, siteName = 'Reykjavík', logoLink = '/', } = props;
28
+ const { isMenuActive, isMenuOpen, closeMenu, toggleMenu } = useMenuToggling(ssr !== 'ssr-only');
29
+ const isBrowser = useIsBrowserSide( /* ssr */);
30
+ const txt = getTexts(props, defaultLayoutTexts);
31
+ return (React.createElement("div", { className: getBemClass('Layout', props.modifier), "data-sprinkled": isBrowser, "data-color-theme": colorTheme },
32
+ globalAlerts && (React.createElement("div", { className: "Layout__alerts", role: "alert" }, globalAlerts)),
33
+ React.createElement("div", { className: "Layout__content" },
34
+ React.createElement("div", { className: "Layout__header", role: "banner" },
35
+ React.createElement(Link, { className: "Layout__header__logo", href: logoLink },
36
+ ' ',
37
+ React.createElement(Image, { className: undefined, inline: true, src: getAssetUrl('reykjavik-logo.svg') }),
38
+ ' ',
39
+ siteName,
40
+ ' '),
41
+ ' ',
42
+ navChildren && (React.createElement(Link, { className: "Layout__header__skiplink", href: "#pagenav", onClick: isMenuActive &&
43
+ ((e) => {
44
+ e.preventDefault();
45
+ toggleMenu();
46
+ }), "aria-label": txt.skipLinkLabel }, txt.skipLinkLabel))),
47
+ React.createElement("div", { className: "Layout__main", role: "main" }, mainChildren || children),
48
+ navChildren && (React.createElement("div", { className: "Layout__nav", id: "pagenav", role: "navigation" },
49
+ React.createElement(HannaUIState, { value: {
50
+ closeHamburgerMenu: closeMenu,
51
+ isHamburgerMenuOpen: isMenuOpen,
52
+ } }, navChildren),
53
+ isMenuActive && (React.createElement("button", { className: "Layout__nav__closebutton", onClick: closeMenu, "aria-label": txt.closeMenuLabelLong, type: "button" }, txt.closeMenuLabel)))),
54
+ React.createElement("div", { className: "Layout__footer", role: "complementary" }, footerChildren))));
55
+ };
56
+ export default Layout;
@@ -0,0 +1,6 @@
1
+ import { MegaMenuPanel } from './_PrimaryPanel.js';
2
+ export type AuxilaryPanelIllustration = 'hanna-veitiggi' | 'hanna-vandro' | 'hanna-hugsi' | 'hanna-hissa' | 'hanna-hahaha' | 'hanna-hae' | 'hanna-god_spurning' | 'hanna-gjuggiborg' | 'hanna-benda';
3
+ export type AuxiliaryPanelProps = MegaMenuPanel & {
4
+ image?: AuxilaryPanelIllustration;
5
+ };
6
+ export declare const AuxiliaryPanel: (props: AuxiliaryPanelProps) => JSX.Element;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { getIllustrationUrl } from '@reykjavik/hanna-utils/assets';
3
+ import { Link } from '../_abstract/_Link.js';
4
+ export const AuxiliaryPanel = (props) => {
5
+ const { title, id, items, image } = props;
6
+ const imageUrl = image ? getIllustrationUrl(image) : image;
7
+ return (React.createElement("li", { className: "AuxiliaryPanel", id: id, style: imageUrl
8
+ ? { '--menu-auxiliary-image': `url(${imageUrl})` }
9
+ : undefined },
10
+ React.createElement("h3", { className: "AuxiliaryPanel__title" }, title),
11
+ React.createElement("ul", { className: "AuxiliaryPanel__items" }, items.map((item, i) => (React.createElement("li", { key: i, className: "AuxiliaryPanel__item", "aria-current": item.current || undefined },
12
+ React.createElement(Link, { className: "AuxiliaryPanel__link", href: item.href, target: item.target, lang: item.lang }, item.label)))))));
13
+ };
@@ -0,0 +1,29 @@
1
+ import { RefObject } from 'react';
2
+ export type PrimaryPanelI18n = {
3
+ backToMenu: string;
4
+ backToMenuLong?: string;
5
+ };
6
+ export type MegaMenuItem = {
7
+ label: string;
8
+ summary?: string;
9
+ href: string;
10
+ lang?: string;
11
+ current?: boolean;
12
+ target?: string;
13
+ };
14
+ export type MegaMenuPanel = {
15
+ title: string;
16
+ items: Array<MegaMenuItem>;
17
+ id: string;
18
+ };
19
+ type PrimaryPanelProps = {
20
+ setActivePanel: (panel: MegaMenuPanel | undefined, setFocus?: boolean) => void;
21
+ isParent?: boolean;
22
+ isActive?: boolean;
23
+ panel: MegaMenuPanel;
24
+ texts: PrimaryPanelI18n;
25
+ activeRef: RefObject<HTMLLIElement>;
26
+ isBrowser: true | undefined;
27
+ };
28
+ export declare const PrimaryPanel: (props: PrimaryPanelProps) => JSX.Element;
29
+ export {};
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+ import getBemClass from '@hugsmidjan/react/utils/getBemClass';
3
+ import { Link } from '../_abstract/_Link.js';
4
+ export const PrimaryPanel = (props) => {
5
+ const { setActivePanel, panel, isParent, isActive, isBrowser, texts } = props;
6
+ const { items } = panel;
7
+ return (React.createElement("li", { ref: isActive ? props.activeRef : undefined, className: getBemClass('PrimaryPanel', [
8
+ isParent && 'parent',
9
+ isActive && 'active',
10
+ items.length > 5 && 'twocol', // TODO: allow setting twocol manually?
11
+ ]), id: panel.id },
12
+ React.createElement("h3", { className: "PrimaryPanel__title" },
13
+ ' ',
14
+ isBrowser && !isActive ? (React.createElement("button", { className: "MainMenu__mega__title-toggler", "aria-controls": panel.id, onClick: () => setActivePanel(panel, false), "aria-pressed": isActive, type: "button" }, panel.title)) : (panel.title)),
15
+ React.createElement("ul", { className: "PrimaryPanel__items" }, items.map((item, i) => (React.createElement("li", { key: i, className: "PrimaryPanel__item", "aria-current": item.current || undefined },
16
+ React.createElement(Link, { className: "PrimaryPanel__link", href: item.href, target: item.target, lang: item.lang },
17
+ React.createElement("span", { className: "PrimaryPanel__linkTitle" }, item.label),
18
+ ' ',
19
+ React.createElement("small", { className: "PrimaryPanel__summary" }, item.summary),
20
+ ' '))))),
21
+ isBrowser && isActive && (React.createElement("button", { className: "MainMenu__megapanel__backtomenu", "aria-controls": panel.id, "aria-label": texts.backToMenuLong, onClick: () => setActivePanel(undefined), type: "button" }, texts.backToMenu))));
22
+ };