@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,62 @@
1
+ import { Cleanup } from '@reykjavik/hanna-utils';
2
+ import { DefaultTexts } from '@reykjavik/hanna-utils/i18n';
3
+ import { AuxilaryPanelIllustration, AuxiliaryPanelProps } from './MainMenu/_Auxiliary.js';
4
+ import { MegaMenuItem, MegaMenuPanel, PrimaryPanelI18n } from './MainMenu/_PrimaryPanel.js';
5
+ import { SSRSupport } from './utils.js';
6
+ export type MainMenuI18n = Cleanup<{
7
+ lang?: string;
8
+ homeLabel?: string;
9
+ } & PrimaryPanelI18n>;
10
+ export declare const defaultMainMenuTexts: DefaultTexts<Required<MainMenuI18n>>;
11
+ export type { AuxilaryPanelIllustration, AuxiliaryPanelProps, MegaMenuItem, MegaMenuPanel, };
12
+ export type MainMenuItem = {
13
+ label: string;
14
+ labelLong?: string;
15
+ lang?: string;
16
+ /**
17
+ * Puts a modifier className on the menu item element.
18
+ *
19
+ * Example:
20
+ *
21
+ * ```html
22
+ * <li class="MainMenu__item MainMenu__item--${modifier}">
23
+ * ```
24
+ * */
25
+ modifier?: string;
26
+ current?: boolean;
27
+ href?: string;
28
+ /**
29
+ * Adding `onClick` automatically results in a <button/> element being rendered.
30
+ *
31
+ * NOTE: Clicking a MainMenu item will automatically close HannaUIState's
32
+ * "Hamburger menu" (a.k.a. "Mobile menu")
33
+ * … unless the `onClick` function explicitly returns `false`.
34
+ */
35
+ onClick?: (index: number, item: MainMenuItem) => void | boolean;
36
+ controlsId?: string;
37
+ };
38
+ export type MainMenuSeparator = '---';
39
+ export type MainMenuItemList = Array<MainMenuItem | MainMenuSeparator>;
40
+ export type MainMenuProps = {
41
+ title: string;
42
+ items: MainMenuItemList;
43
+ /**
44
+ * Link for the homepage - defaults to `"/"` adding a
45
+ * generic sounding "Home"/"Forsíða" label
46
+ */
47
+ homeLink?: string | Omit<MainMenuItem, 'modifier'>;
48
+ megaPanels?: Array<MegaMenuPanel>;
49
+ auxiliaryPanel?: AuxiliaryPanelProps;
50
+ /**
51
+ * NOTE: Clicking a MainMenu item will automatically close HannaUIState's
52
+ * "Hamburger menu" (a.k.a. "Mobile menu")
53
+ * … unless the `onItemClick` function explicitly returns `false`.
54
+ */
55
+ onItemClick?: (index: number, item: MainMenuItem) => void | boolean;
56
+ activePanelId?: string;
57
+ texts?: MainMenuI18n;
58
+ lang?: string;
59
+ ssr?: SSRSupport;
60
+ };
61
+ export declare const MainMenu: (props: MainMenuProps) => JSX.Element | null;
62
+ export default MainMenu;
@@ -0,0 +1,221 @@
1
+ import React, { useEffect, useMemo, useRef, useState } from 'react';
2
+ import focusElm from '@hugsmidjan/qj/focusElm';
3
+ import useShortState from '@hugsmidjan/react/hooks/useShortState';
4
+ import getBemClass from '@hugsmidjan/react/utils/getBemClass';
5
+ import { getPageScrollElm } from '@reykjavik/hanna-utils';
6
+ import { getTexts } from '@reykjavik/hanna-utils/i18n';
7
+ import { Link } from './_abstract/_Link.js';
8
+ import { AuxiliaryPanel, } from './MainMenu/_Auxiliary.js';
9
+ import { PrimaryPanel, } from './MainMenu/_PrimaryPanel.js';
10
+ import { useHannaUIState } from './utils/HannaUIState.js';
11
+ import { useFormatMonitor } from './utils/useFormatMonitor.js';
12
+ import { useIsBrowserSide } from './utils.js';
13
+ const findActivePanel = (megaPanels, activeId) => activeId ? megaPanels.find((panel) => activeId === panel.id) : undefined;
14
+ export const defaultMainMenuTexts = {
15
+ is: {
16
+ lang: 'is',
17
+ homeLabel: 'Forsíða',
18
+ backToMenu: 'Loka',
19
+ backToMenuLong: 'Til baka í valmynd',
20
+ },
21
+ en: {
22
+ lang: 'en',
23
+ homeLabel: 'Home page',
24
+ backToMenu: 'Close',
25
+ backToMenuLong: 'Close and return to menu',
26
+ },
27
+ pl: {
28
+ lang: 'pl',
29
+ homeLabel: 'Strona główna',
30
+ backToMenu: 'Zamknij',
31
+ backToMenuLong: 'Zamknij i wróć do menu',
32
+ },
33
+ };
34
+ // ---------------------------------------------------------------------------
35
+ const _issueHomeLinkWarnings = (hasHomeItem, hasHomeLinkProp) => {
36
+ const bothDefined = hasHomeItem && hasHomeLinkProp;
37
+ const neitherDefined = !hasHomeItem && !hasHomeLinkProp;
38
+ if (bothDefined) {
39
+ console.warn('Ignoring a redundant `MainMenuProps.homeLink` value. ' +
40
+ '(As `MainMenuProps.items` already starts with a "Home" item.)');
41
+ }
42
+ else if (neitherDefined) {
43
+ console.warn('`MainMenuProps.homeLink` is missing. Auto-inserting a generic "home link" with `href="/"`.');
44
+ }
45
+ };
46
+ const normalizeMenuItems = (itemsProp, megaPanels, homeLink, texts) => {
47
+ const items = itemsProp.map((item) => {
48
+ if (item === '---') {
49
+ return item;
50
+ }
51
+ const href = item.href;
52
+ const controlsId = item.controlsId || (href && /^#/.test(href) && href.slice(1)) || undefined;
53
+ const megaPanel = controlsId
54
+ ? megaPanels.find((panel) => panel.id === controlsId)
55
+ : undefined;
56
+ return Object.assign(Object.assign({}, item), { controlsId, megaPanel });
57
+ });
58
+ const firstItem = items[0];
59
+ if (firstItem) {
60
+ // Prepend menu item list with a "home link", unless it's already there
61
+ const hasHomeItem = typeof firstItem === 'object' && firstItem.modifier === 'home';
62
+ if (process.env.NODE_ENV !== 'production') {
63
+ _issueHomeLinkWarnings(hasHomeItem, !!homeLink);
64
+ }
65
+ if (!hasHomeItem) {
66
+ if (!homeLink || typeof homeLink === 'string') {
67
+ let label = texts.homeLabel;
68
+ let lang;
69
+ if (label == null) {
70
+ const def = defaultMainMenuTexts[texts.lang || 'en'] ||
71
+ defaultMainMenuTexts.en ||
72
+ defaultMainMenuTexts.is;
73
+ label = def.homeLabel;
74
+ lang = def.lang;
75
+ }
76
+ homeLink = { href: homeLink || '/', label, lang };
77
+ }
78
+ items.unshift(Object.assign(Object.assign({}, homeLink), { modifier: 'home' }));
79
+ }
80
+ }
81
+ return items;
82
+ };
83
+ // ---------------------------------------------------------------------------
84
+ const emptyPanelList = [];
85
+ export const MainMenu = (props) => {
86
+ const { title, megaPanels = emptyPanelList, onItemClick, ssr, auxiliaryPanel } = props;
87
+ const texts = getTexts(props, defaultMainMenuTexts);
88
+ const { closeHamburgerMenu } = useHannaUIState();
89
+ const isBrowser = useIsBrowserSide(ssr);
90
+ const menuElmRef = useRef(null);
91
+ const pressedLinkRef = useRef(null);
92
+ const activePanelRef = useRef(null);
93
+ const [activePanel, _setActivePanel] = useState(() => isBrowser && findActivePanel(megaPanels, props.activePanelId));
94
+ const [laggyActivePanel, setLaggyActivePanel] = useShortState();
95
+ const setActivePanel = useMemo(() => isBrowser
96
+ ? (newActive, setFocus = true) => {
97
+ const htmlElmDataset = document.documentElement.dataset;
98
+ // const menuElm = menuElmRef.current as HTMLElement;
99
+ _setActivePanel((activePanel) => {
100
+ const scrollElm = getPageScrollElm();
101
+ if (!newActive) {
102
+ activePanel && setLaggyActivePanel(activePanel, 1000);
103
+ scrollElm.scrollTop = parseInt(htmlElmDataset.scrollTop || '') || 0;
104
+ delete htmlElmDataset.scrollTop;
105
+ delete htmlElmDataset.megaPanelActive;
106
+ }
107
+ else {
108
+ setLaggyActivePanel(undefined, 0);
109
+ htmlElmDataset.scrollTop = String(scrollElm.scrollTop);
110
+ scrollElm.scrollTop = 0;
111
+ htmlElmDataset.megaPanelActive = '';
112
+ }
113
+ if (setFocus) {
114
+ const pressedLinkElm = pressedLinkRef.current; // pressedLinkElm will be undefined when setTimeout fires
115
+ setTimeout(() => {
116
+ if (!newActive) {
117
+ // const buttonElm = menuElm.querySelector<HTMLButtonElement>(
118
+ // 'button.MainMenu__link[aria-pressed="true"]'
119
+ // );
120
+ focusElm(pressedLinkElm);
121
+ }
122
+ else if (newActive !== activePanel) {
123
+ // const panelElm = menuElm.querySelector<HTMLButtonElement>(
124
+ // '.PrimaryPanel--active'
125
+ // );
126
+ focusElm(activePanelRef.current);
127
+ }
128
+ }, 100);
129
+ }
130
+ return newActive;
131
+ });
132
+ }
133
+ : () => undefined, [setLaggyActivePanel, isBrowser]);
134
+ useFormatMonitor((media) => {
135
+ if (media.leftTopmenu) {
136
+ setActivePanel(undefined);
137
+ }
138
+ });
139
+ const hasActivePanel = !!activePanel;
140
+ const menuItems = useMemo(() => normalizeMenuItems(props.items, megaPanels, props.homeLink, texts), [props.items, props.homeLink, megaPanels, texts]);
141
+ useEffect(() => {
142
+ setActivePanel(findActivePanel(megaPanels, props.activePanelId));
143
+ }, [props.activePanelId, megaPanels, setActivePanel]);
144
+ useEffect(() => {
145
+ const menuElm = menuElmRef.current;
146
+ if (!isBrowser || !hasActivePanel || !menuElm) {
147
+ return;
148
+ }
149
+ const escHandler = (e) => {
150
+ if (e.key === 'Escape') {
151
+ setActivePanel(undefined);
152
+ }
153
+ };
154
+ const clickHandler = (e) => {
155
+ if (!menuElm.contains(e.target)) {
156
+ setActivePanel(undefined);
157
+ }
158
+ };
159
+ document.addEventListener('keydown', escHandler);
160
+ document.addEventListener('click', clickHandler, true);
161
+ return () => {
162
+ document.removeEventListener('keydown', escHandler);
163
+ document.removeEventListener('click', clickHandler, true);
164
+ };
165
+ }, [hasActivePanel, setActivePanel, isBrowser]);
166
+ if (menuItems.length === 0) {
167
+ return null;
168
+ }
169
+ /** Close mega panels on clicks their links. */
170
+ const handleMegaPanelClicks = (e) => {
171
+ if (
172
+ // NOTE: We can NOT check for `e.defaultPrevented` because if the current
173
+ // LinkRenderer is something like Next.js or Remix's <Link/> compponent
174
+ // then default is ALWAYS prevented
175
+ e.target.closest('a[href]')) {
176
+ setActivePanel(undefined);
177
+ closeHamburgerMenu();
178
+ }
179
+ };
180
+ return (React.createElement("nav", { className: "MainMenu", "aria-label": title, "data-sprinkled": isBrowser, ref: menuElmRef },
181
+ React.createElement("h2", { className: "MainMenu__title" }, title),
182
+ React.createElement("ul", { className: "MainMenu__items" }, menuItems.map((item, i) => {
183
+ if (item === '---') {
184
+ return React.createElement("li", { key: i, className: "MainMenu__separator", "aria-hidden": "true" });
185
+ }
186
+ const { label, labelLong, lang, controlsId, onClick } = item;
187
+ const pressed = (activePanel && controlsId === activePanel.id) || undefined;
188
+ return (React.createElement("li", { key: i, className: getBemClass('MainMenu__item', item.modifier), "aria-current": item.current || undefined }, onClick || (!!item.megaPanel && (isBrowser || !item.href)) ? (
189
+ // only print script-driven buttons in the browser
190
+ React.createElement("button", { className: "MainMenu__link", onClick: () => {
191
+ const keepOpen1 = onClick && onClick(i, item) === false;
192
+ const keepOpen2 = onItemClick && onItemClick(i, item) === false;
193
+ const { megaPanel } = item;
194
+ if (megaPanel) {
195
+ setActivePanel(megaPanel !== activePanel ? megaPanel : undefined);
196
+ }
197
+ else {
198
+ !(keepOpen1 || keepOpen2) && closeHamburgerMenu();
199
+ }
200
+ }, ref: pressed && pressedLinkRef, "aria-pressed": pressed, "aria-controls": controlsId, "aria-label": labelLong, title: labelLong, lang: lang, type: "button" }, label)) : item.href != null ? (
201
+ // always render links server-side
202
+ React.createElement(Link, { className: "MainMenu__link", href: item.href, "aria-label": labelLong, title: labelLong, onClick: () => {
203
+ const keepOpen = onItemClick && onItemClick(i, item) === false;
204
+ !keepOpen && closeHamburgerMenu();
205
+ }, lang: lang }, label)) : undefined // skip rendering non-link menu items server side
206
+ ));
207
+ })),
208
+ '\n\n',
209
+ megaPanels.length > 0 && (React.createElement("div", { className: getBemClass('MainMenu__panelsWrap', [activePanel && 'active']) },
210
+ React.createElement("ul", { className: "MainMenu__panels", onClick: handleMegaPanelClicks },
211
+ megaPanels.map((panel, i) => {
212
+ if (!panel.items.length) {
213
+ return;
214
+ }
215
+ const isActive = activePanel === panel || laggyActivePanel === panel || undefined;
216
+ const isParent = !!panel.items.find((item) => item.current);
217
+ return (React.createElement(PrimaryPanel, { key: i, isParent: isParent, isActive: isActive, panel: panel, isBrowser: isBrowser, setActivePanel: setActivePanel, texts: texts, activeRef: activePanelRef }));
218
+ }),
219
+ auxiliaryPanel && React.createElement(AuxiliaryPanel, Object.assign({}, auxiliaryPanel)))))));
220
+ };
221
+ export default MainMenu;
@@ -0,0 +1,8 @@
1
+ import { ButtonProps } from './_abstract/_Button.js';
2
+ import { SeenProp } from './utils/seenEffect.js';
3
+ export type MiniMetricsProps = {
4
+ text: string;
5
+ moreButton: ButtonProps;
6
+ } & SeenProp;
7
+ export declare const MiniMetrics: (props: MiniMetricsProps) => JSX.Element;
8
+ export default MiniMetrics;
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { Button } from './_abstract/_Button.js';
3
+ import SeenEffect from './SeenEffect.js';
4
+ export const MiniMetrics = (props) => {
5
+ const { text, moreButton, startSeen } = props;
6
+ return (React.createElement(SeenEffect, { className: "MiniMetrics", startSeen: startSeen },
7
+ React.createElement("strong", { className: "MiniMetrics__text" }, text),
8
+ " ",
9
+ '\n',
10
+ React.createElement(Button, Object.assign({ bem: "MiniMetrics__more" }, moreButton))));
11
+ };
12
+ export default MiniMetrics;
package/esm/Modal.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ import { ReactElement } from 'react';
2
+ import { ModalProps as _ModalProps } from '@hugsmidjan/react/Modal';
3
+ export type ModalProps = Omit<_ModalProps, 'bem' | 'bodyWrap' | 'modifier'> & {
4
+ modifier?: 'w6' | 'w8' | 'w10';
5
+ bling?: ReactElement;
6
+ };
7
+ export declare const Modal: (props: ModalProps) => JSX.Element;
8
+ export default Modal;
package/esm/Modal.js ADDED
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import _Modal from '@hugsmidjan/react/Modal';
3
+ export const Modal = (props) => {
4
+ const { closeDelay = 500, texts = {
5
+ closeButton: 'Loka ',
6
+ }, bling, children, render = () => children, } = props;
7
+ return (React.createElement(_Modal, Object.assign({}, props, { bodyWrap: false, bem: "Modal", closeDelay: closeDelay, texts: texts, render: (args) => bling ? (React.createElement(React.Fragment, null,
8
+ render(args),
9
+ React.createElement("div", { className: "Modal__blings" },
10
+ React.createElement("div", { className: "Modal__blings__inner" }, bling)))) : (render(args)),
11
+ // eslint-disable-next-line react/no-children-prop
12
+ children: undefined })));
13
+ };
14
+ export default Modal;
@@ -0,0 +1,64 @@
1
+ export type NameCardI18n = {
2
+ updatedLabel: string;
3
+ availableLabel: string;
4
+ unavailableLabel: string;
5
+ /** @deprecated Use availableLabel instead (will be removed in v0.11) */
6
+ vacancyLabel?: string;
7
+ /** @deprecated Use unavailableLabel instead (will be removed in v0.11) */
8
+ noVacancyLabel?: string;
9
+ /** @deprecated Not used anymore (will be rmoved in v0.11) */
10
+ telLabel?: string;
11
+ };
12
+ type ContactInfo = {
13
+ href: string;
14
+ label: string;
15
+ longLabel?: string;
16
+ };
17
+ /** @deprecated use label and longLabel props instead (Will be removed in v0.11) */
18
+ type DeprecatedContactInfo = {
19
+ href: string;
20
+ value: string;
21
+ label?: string;
22
+ };
23
+ export type NameCardProps = {
24
+ name: string;
25
+ /** Phone numbers, e-mail addresses, etc. */
26
+ contactInfo?: Array<string | ContactInfo | DeprecatedContactInfo>;
27
+ /** Address/location info
28
+ *
29
+ * Special handling of string:
30
+ * Inserts `<br/>`s on `\n`. Collapses multiple `\n`s.
31
+ *
32
+ * Only simple, inline element HTML allowed
33
+ */
34
+ location?: string | JSX.Element;
35
+ /** Misc info such as opening-hours, etc.
36
+ *
37
+ * Special handling of string:
38
+ * Inserts `<br/>`s on `\n`. Collapses multiple `\n`s.
39
+ *
40
+ * Only simple, inline element HTML allowed
41
+ */
42
+ aboutText?: string | JSX.Element;
43
+ /**
44
+ * Designated for info about working/opening hours
45
+ *
46
+ * Special handling of string:
47
+ * Inserts `<br/>`s on `\n`. Collapses multiple `\n`s.
48
+ *
49
+ * Only simple, inline element HTML allowed
50
+ */
51
+ hours?: string | JSX.Element;
52
+ /** Displays "active" indicator. Use for vacancies, inline-status, etc. */
53
+ available?: boolean;
54
+ /** Meta data about freshness status, etc. */
55
+ updated?: string | Date;
56
+ lang?: string;
57
+ texts?: NameCardI18n;
58
+ /** @deprecated Use `available` instead (will be removed in v0.11) */
59
+ vacancy?: boolean;
60
+ /** @deprecated Use `contactInfo` instead (will be removed in v0.11) */
61
+ tel?: string | Array<string>;
62
+ };
63
+ export declare const NameCard: (props: NameCardProps) => JSX.Element;
64
+ export default NameCard;
@@ -0,0 +1,82 @@
1
+ import React from 'react';
2
+ import getBemClass from '@hugsmidjan/react/utils/getBemClass';
3
+ import { getTexts } from '@reykjavik/hanna-utils/i18n';
4
+ import { Button } from './_abstract/_Button.js';
5
+ import { breakOnNL } from './_abstract/breakOnNL.js';
6
+ const formatDate = (date) => {
7
+ return typeof date === 'string'
8
+ ? date
9
+ : date.toISOString().slice(0, 10).replace(/-/g, '.');
10
+ };
11
+ const _telToContactInfo = (tel) => {
12
+ if (!tel) {
13
+ return;
14
+ }
15
+ tel = typeof tel === 'string' ? [tel] : tel;
16
+ return tel.map((tel) => ({
17
+ href: 'tel:' + tel,
18
+ value: tel,
19
+ }));
20
+ };
21
+ const renderContent = (content) => typeof content === 'string' ? breakOnNL(content) : content;
22
+ const defaultTexts = {
23
+ en: {
24
+ updatedLabel: 'Updated on',
25
+ availableLabel: '',
26
+ unavailableLabel: '',
27
+ vacancyLabel: 'Vacancy',
28
+ noVacancyLabel: 'No vacancy',
29
+ },
30
+ is: {
31
+ updatedLabel: 'Uppfært síðast',
32
+ availableLabel: '',
33
+ unavailableLabel: '',
34
+ vacancyLabel: 'Laus pláss',
35
+ noVacancyLabel: 'Ekki laus pláss',
36
+ },
37
+ };
38
+ export const NameCard = (props) => {
39
+ const { name, location, hours, aboutText, available = props.vacancy, updated } = props;
40
+ const renderMeta = () => {
41
+ if (available == null && !updated) {
42
+ return;
43
+ }
44
+ const texts = getTexts(props, defaultTexts);
45
+ const { updatedLabel, availableLabel, unavailableLabel } = texts;
46
+ return (React.createElement("div", { className: "NameCard__meta" },
47
+ available != null && (React.createElement("span", { className: getBemClass('NameCard__availability', available && 'available') },
48
+ available
49
+ ? availableLabel || texts.vacancyLabel
50
+ : unavailableLabel || texts.noVacancyLabel,
51
+ ' ')),
52
+ updated != null && (React.createElement("span", { className: "NameCard__updated" },
53
+ updatedLabel,
54
+ " ",
55
+ formatDate(updated)))));
56
+ };
57
+ let contactInfo = props.contactInfo;
58
+ if (!contactInfo) {
59
+ contactInfo = _telToContactInfo(props.tel) || [];
60
+ }
61
+ // Remove/map @deprecated contactinfo items
62
+ const cleanContactInfo = contactInfo.map((item) => {
63
+ if (typeof item !== 'string' && 'value' in item) {
64
+ return {
65
+ href: item.href,
66
+ label: item.value,
67
+ longLabel: item.label,
68
+ };
69
+ }
70
+ return item;
71
+ });
72
+ return (React.createElement("div", { className: "NameCard" },
73
+ React.createElement("div", { className: "NameCard__name" }, name),
74
+ contactInfo.length > 0 && (React.createElement("p", { className: "NameCard__contactinfo" }, cleanContactInfo.map((item, i) => (React.createElement(React.Fragment, null,
75
+ typeof item === 'string' ? (React.createElement("span", { className: "NameCard__contactinfo__item" }, item)) : (React.createElement(Button, { key: i, bem: "NameCard__contactinfo__item", href: item.href, "aria-label": item.longLabel, title: item.longLabel }, item.label)),
76
+ ' '))))),
77
+ location && React.createElement("p", { className: "NameCard__location" }, renderContent(location)),
78
+ hours && React.createElement("p", { className: "NameCard__hours" }, renderContent(hours)),
79
+ aboutText && React.createElement("p", { className: "NameCard__abouttext" }, renderContent(aboutText)),
80
+ renderMeta()));
81
+ };
82
+ export default NameCard;
@@ -0,0 +1,6 @@
1
+ import { NameCardProps } from './NameCard.js';
2
+ type NameCardsProps = {
3
+ items: Array<NameCardProps>;
4
+ };
5
+ export declare const NameCards: (props: NameCardsProps) => JSX.Element;
6
+ export default NameCards;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import NameCard from './NameCard.js';
3
+ export const NameCards = (props) => {
4
+ const { items } = props;
5
+ return (React.createElement("div", { className: "NameCards" }, items.map((item, i) => (React.createElement(NameCard, Object.assign({ key: i }, item))))));
6
+ };
7
+ export default NameCards;
@@ -0,0 +1,14 @@
1
+ import { ImageProps } from './_abstract/_Image.js';
2
+ import { SeenProp } from './utils/seenEffect.js';
3
+ type BlingOptions = 'interesting' | 'snake' | 'pentagon' | 'dome' | 'balls-small' | 'balls-large';
4
+ export type NewsHeroProps = {
5
+ title: string;
6
+ meta?: string;
7
+ summary?: string | JSX.Element;
8
+ /** For custom sharing component */
9
+ sharing?: boolean | (() => JSX.Element);
10
+ image?: ImageProps;
11
+ blingType?: BlingOptions;
12
+ } & SeenProp;
13
+ export declare const NewsHero: (props: NewsHeroProps) => JSX.Element;
14
+ export default NewsHero;
@@ -0,0 +1,86 @@
1
+ import React from 'react';
2
+ import getBemClass from '@hugsmidjan/react/utils/getBemClass';
3
+ import { getStableRandomItem } from '@reykjavik/hanna-utils';
4
+ import { Blings } from './_abstract/_Blings.js';
5
+ import { Image } from './_abstract/_Image.js';
6
+ import { useSeenEffect } from './utils/seenEffect.js';
7
+ import ShareButtons from './ShareButtons.js';
8
+ const blingOptions = {
9
+ interesting: [
10
+ {
11
+ type: 'circle-xlarge',
12
+ parent: 'center',
13
+ },
14
+ {
15
+ type: 'loops-small',
16
+ color: 'secondary',
17
+ align: 'left-ish',
18
+ vertical: 'down-ish',
19
+ parent: 'center',
20
+ },
21
+ ],
22
+ snake: [
23
+ {
24
+ type: 'snake-large',
25
+ align: 'left',
26
+ parent: 'top',
27
+ vertical: 'down',
28
+ },
29
+ ],
30
+ pentagon: [
31
+ {
32
+ type: 'pentagon-large',
33
+ align: 'left',
34
+ parent: 'center',
35
+ },
36
+ ],
37
+ dome: [
38
+ {
39
+ type: 'dome-large',
40
+ align: 'left-ish',
41
+ parent: 'top',
42
+ vertical: 'down',
43
+ },
44
+ ],
45
+ 'balls-small': [
46
+ {
47
+ type: 'circle-large',
48
+ align: 'left',
49
+ parent: 'center',
50
+ },
51
+ {
52
+ type: 'circle-small',
53
+ color: 'secondary',
54
+ align: 'right',
55
+ parent: 'bottom',
56
+ vertical: 'down',
57
+ },
58
+ ],
59
+ 'balls-large': [
60
+ {
61
+ type: 'halfcircle-down-large',
62
+ align: 'left',
63
+ parent: 'bottom',
64
+ vertical: 'up',
65
+ },
66
+ {
67
+ type: 'circle-medium',
68
+ color: 'secondary',
69
+ align: 'left-center',
70
+ parent: 'bottom',
71
+ },
72
+ ],
73
+ };
74
+ export const NewsHero = (props) => {
75
+ const { title, sharing = true, meta, summary, image, blingType, startSeen } = props;
76
+ const [ref] = useSeenEffect(startSeen);
77
+ const blings = (blingType && blingOptions[blingType]) || getStableRandomItem(blingOptions, title);
78
+ return (React.createElement("div", { className: getBemClass('NewsHero', [!image && 'align--right']), ref: ref },
79
+ React.createElement("div", { className: "NewsHero__content" },
80
+ React.createElement("h1", { className: "NewsHero__title" }, title),
81
+ meta && React.createElement("span", { className: "NewsHero__meta" }, meta),
82
+ React.createElement("div", { className: "NewsHero__summary" }, summary),
83
+ sharing === true ? React.createElement(ShareButtons, null) : sharing && sharing()),
84
+ image ? (React.createElement(Image, Object.assign({ className: "NewsHero__image" }, image))) : (React.createElement(Blings, { blings: blings }))));
85
+ };
86
+ export default NewsHero;
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import { EitherObj } from '@reykjavik/hanna-utils';
3
+ import { SeenProp } from './utils/seenEffect.js';
4
+ export type PageFilterProps = {
5
+ title: string;
6
+ summary?: React.ReactNode;
7
+ footnote?: React.ReactNode;
8
+ buttonRow?: React.ReactNode;
9
+ underlap?: boolean;
10
+ } & EitherObj<{
11
+ filters: React.ReactNode;
12
+ }, {
13
+ children: React.ReactNode;
14
+ }> & SeenProp;
15
+ export declare const PageFilter: (props: PageFilterProps) => JSX.Element;
16
+ export default PageFilter;
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import getBemClass from '@hugsmidjan/react/utils/getBemClass';
3
+ import { useSeenEffect } from './utils/seenEffect.js';
4
+ import Footnote from './Footnote.js';
5
+ export const PageFilter = (props) => {
6
+ const { title, summary, footnote, filters, children, buttonRow, underlap, startSeen } = props;
7
+ const [ref] = useSeenEffect(startSeen);
8
+ return (React.createElement("div", { className: getBemClass('PageFilter', underlap && 'underlap'), ref: ref },
9
+ React.createElement("h2", { className: "PageFilter__title" }, title),
10
+ summary && React.createElement("div", { className: "PageFilter__summary" }, summary),
11
+ React.createElement("div", { className: "PageFilter__filters" }, filters || children),
12
+ React.createElement("div", { className: "PageFilter__buttons" }, buttonRow),
13
+ footnote && React.createElement(Footnote, null, footnote)));
14
+ };
15
+ export default PageFilter;
@@ -0,0 +1,10 @@
1
+ import { ReactNode } from 'react';
2
+ import { SeenProp } from './utils/seenEffect.js';
3
+ export type PageHeadingProps = {
4
+ Tag?: 'h1' | 'h2';
5
+ align?: 'right';
6
+ small?: boolean;
7
+ children: ReactNode;
8
+ } & SeenProp;
9
+ export declare const PageHeading: (props: PageHeadingProps) => JSX.Element;
10
+ export default PageHeading;
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import getBemClass from '@hugsmidjan/react/utils/getBemClass';
3
+ import { useSeenEffect } from './utils/seenEffect.js';
4
+ export const PageHeading = (props) => {
5
+ const { Tag = 'h1', align, small, children, startSeen } = props;
6
+ const [ref] = useSeenEffect(startSeen);
7
+ return (React.createElement(Tag, { className: getBemClass('PageHeading', [
8
+ small && 'small',
9
+ align === 'right' && 'align--' + align,
10
+ ]), ref: ref }, children));
11
+ };
12
+ export default PageHeading;
@@ -0,0 +1,7 @@
1
+ import { ImagePropsLinked } from './_abstract/_Image.js';
2
+ export type PictureProps = ImagePropsLinked & {
3
+ contain?: boolean;
4
+ className?: string;
5
+ };
6
+ export declare const Picture: (props: PictureProps) => JSX.Element;
7
+ export default Picture;