@reykjavik/hanna-react 0.10.57 → 0.10.60

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 (392) hide show
  1. package/AccordionList.js +3 -28
  2. package/ActionCards.d.ts +1 -1
  3. package/ActionCards.js +4 -6
  4. package/Alert.js +5 -30
  5. package/ArticleCards.d.ts +6 -0
  6. package/ArticleCards.js +7 -0
  7. package/ArticleCarousel/_ArticleCarouselCard.d.ts +1 -1
  8. package/ArticleCarousel/_ArticleCarouselCard.js +8 -10
  9. package/ArticleCarousel.js +3 -5
  10. package/ArticleMeta.d.ts +1 -0
  11. package/ArticleMeta.js +7 -28
  12. package/Attention.js +3 -5
  13. package/BasicTable.js +5 -7
  14. package/{esm/CenterColumn.d.ts → BgBox.d.ts} +4 -3
  15. package/BgBox.js +12 -0
  16. package/Bling.js +3 -5
  17. package/BlockBreak.js +2 -4
  18. package/BlockQuote.js +2 -4
  19. package/BreadCrumbs.js +4 -6
  20. package/ButtonBack.d.ts +1 -1
  21. package/ButtonBack.js +4 -6
  22. package/ButtonBar.js +3 -5
  23. package/ButtonPrimary.d.ts +1 -1
  24. package/ButtonPrimary.js +4 -6
  25. package/ButtonSecondary.d.ts +1 -1
  26. package/ButtonSecondary.js +4 -6
  27. package/ButtonTertiary.d.ts +1 -1
  28. package/ButtonTertiary.js +4 -6
  29. package/CHANGELOG.md +20 -1
  30. package/Carousel.js +3 -5
  31. package/CarouselStepper.js +3 -5
  32. package/CenterColumn.js +3 -5
  33. package/Checkbox.d.ts +1 -1
  34. package/Checkbox.js +4 -6
  35. package/CheckboxButtonsGroup.d.ts +1 -1
  36. package/CheckboxButtonsGroup.js +6 -8
  37. package/CheckboxGroup.d.ts +1 -1
  38. package/CheckboxGroup.js +5 -7
  39. package/CityBlock.d.ts +1 -1
  40. package/CityBlock.js +3 -5
  41. package/ContactBubble.js +6 -31
  42. package/ContentArticle.js +8 -10
  43. package/ContentImage.d.ts +1 -1
  44. package/ContentImage.js +4 -6
  45. package/Datepicker.js +6 -31
  46. package/ExtraLinks.d.ts +1 -1
  47. package/ExtraLinks.js +8 -21
  48. package/FeatureList.js +3 -5
  49. package/FieldGroup.js +3 -5
  50. package/FileInput.js +5 -41
  51. package/Foonote.js +2 -4
  52. package/FooterBadges.js +4 -6
  53. package/FooterInfo.js +3 -5
  54. package/Footnote.js +2 -4
  55. package/Form.js +3 -5
  56. package/FormField.js +3 -28
  57. package/Gallery/_GalleryItem.d.ts +1 -1
  58. package/Gallery/_GalleryItem.js +9 -45
  59. package/Gallery/_GalleryModal.js +6 -31
  60. package/Gallery/_GalleryModalContext.js +2 -4
  61. package/Gallery/_GalleryModalItem.js +5 -18
  62. package/Gallery.js +6 -31
  63. package/GridBlocks.d.ts +2 -2
  64. package/GridBlocks.js +8 -10
  65. package/Heading.d.ts +1 -1
  66. package/Heading.js +4 -6
  67. package/HeroBlock.d.ts +2 -2
  68. package/HeroBlock.js +6 -8
  69. package/IframeBlock.d.ts +5 -1
  70. package/IframeBlock.js +6 -8
  71. package/Illustration.d.ts +1 -1
  72. package/Illustration.js +4 -6
  73. package/ImageCards.d.ts +1 -1
  74. package/ImageCards.js +6 -19
  75. package/InfoBlock.js +2 -4
  76. package/InfoHero.d.ts +2 -2
  77. package/InfoHero.js +8 -10
  78. package/IslandBlock.d.ts +1 -1
  79. package/IslandBlock.js +3 -5
  80. package/IslandPageBlock.d.ts +1 -1
  81. package/IslandPageBlock.js +3 -5
  82. package/LabeledTextBlock.d.ts +1 -1
  83. package/LabeledTextBlock.js +4 -6
  84. package/Layout.js +9 -11
  85. package/MainMenu/_Auxiliary.js +4 -6
  86. package/MainMenu/_PrimaryPanel.js +5 -7
  87. package/MainMenu.js +7 -32
  88. package/MiniMetrics.d.ts +1 -1
  89. package/MiniMetrics.js +5 -7
  90. package/Modal.js +3 -5
  91. package/NameCard.js +6 -8
  92. package/NameCards.js +3 -5
  93. package/NewsHero.d.ts +1 -1
  94. package/NewsHero.js +7 -9
  95. package/PageFilter.js +4 -6
  96. package/PageHeading.js +3 -5
  97. package/Picture.d.ts +7 -0
  98. package/Picture.js +11 -0
  99. package/ProcessOverview.js +3 -5
  100. package/PullQuote.js +2 -4
  101. package/RadioButtonsGroup.d.ts +1 -1
  102. package/RadioButtonsGroup.js +6 -8
  103. package/RadioGroup.d.ts +2 -2
  104. package/RadioGroup.js +6 -8
  105. package/RelatedLinks.js +4 -6
  106. package/RowBlock.js +3 -5
  107. package/RowBlockColumn.js +3 -5
  108. package/SearchInput.js +5 -41
  109. package/SearchResults/_SearchResultsItem.js +6 -8
  110. package/SearchResults.js +7 -32
  111. package/SeenEffect.js +3 -16
  112. package/Selectbox.js +6 -42
  113. package/ShareButtons.js +4 -26
  114. package/Sharpie.js +3 -5
  115. package/SiteSearchAutocomplete.js +5 -41
  116. package/SiteSearchCurtain.js +3 -28
  117. package/SiteSearchInput.d.ts +1 -1
  118. package/SiteSearchInput.js +4 -40
  119. package/Skeleton.js +4 -6
  120. package/SubHeading.js +3 -5
  121. package/Tabs.js +3 -28
  122. package/TagPill.d.ts +1 -1
  123. package/TagPill.js +7 -20
  124. package/TextBlock.js +3 -5
  125. package/TextButton.d.ts +1 -1
  126. package/TextButton.js +4 -6
  127. package/TextInput.js +5 -41
  128. package/VSpacer.js +3 -5
  129. package/VerticalTabsTOC.js +3 -28
  130. package/WizardLayout.js +7 -9
  131. package/WizardLayoutClose.d.ts +1 -1
  132. package/WizardLayoutClose.js +4 -6
  133. package/WizardStepper.js +3 -5
  134. package/_abstract/_AbstractCarousel.js +7 -32
  135. package/_abstract/_Blings.js +3 -5
  136. package/_abstract/_Block.d.ts +2 -2
  137. package/_abstract/_Block.js +7 -9
  138. package/_abstract/{Button.d.ts → _Button.d.ts} +0 -0
  139. package/_abstract/{Button.js → _Button.js} +6 -19
  140. package/{esm/_abstract/CardList.d.ts → _abstract/_CardList.d.ts} +2 -1
  141. package/_abstract/{CardList.js → _CardList.js} +12 -12
  142. package/{esm/_abstract/Image.d.ts → _abstract/_Image.d.ts} +9 -5
  143. package/_abstract/{Image.js → _Image.js} +5 -7
  144. package/_abstract/{Link.d.ts → _Link.d.ts} +0 -0
  145. package/_abstract/{Link.js → _Link.js} +2 -4
  146. package/_abstract/_Quote.js +4 -6
  147. package/{esm/_abstract/TogglerGroup.d.ts → _abstract/_TogglerGroup.d.ts} +1 -1
  148. package/_abstract/{TogglerGroup.js → _TogglerGroup.js} +8 -8
  149. package/{esm/_abstract/TogglerGroupField.d.ts → _abstract/_TogglerGroupField.d.ts} +2 -2
  150. package/_abstract/_TogglerGroupField.js +14 -0
  151. package/_abstract/{TogglerInput.d.ts → _TogglerInput.d.ts} +0 -0
  152. package/_abstract/{TogglerInput.js → _TogglerInput.js} +4 -17
  153. package/_abstract/breakOnNL.js +2 -4
  154. package/package.json +6 -365
  155. package/utils/env.js +2 -4
  156. package/utils/seenEffect.d.ts +2 -2
  157. package/utils/seenEffect.js +1 -1
  158. package/utils/useScrollbarWidthCSSVar.js +2 -4
  159. package/utils.js +3 -16
  160. package/_abstract/CardList.d.ts +0 -29
  161. package/_abstract/Image.d.ts +0 -32
  162. package/_abstract/TogglerGroup.d.ts +0 -31
  163. package/_abstract/TogglerGroupField.d.ts +0 -17
  164. package/_abstract/TogglerGroupField.js +0 -27
  165. package/esm/AccordionList.d.ts +0 -17
  166. package/esm/AccordionList.js +0 -24
  167. package/esm/ActionCards.d.ts +0 -5
  168. package/esm/ActionCards.js +0 -9
  169. package/esm/Alert.d.ts +0 -49
  170. package/esm/Alert.js +0 -92
  171. package/esm/ArticleCarousel/_ArticleCarouselCard.d.ts +0 -27
  172. package/esm/ArticleCarousel/_ArticleCarouselCard.js +0 -24
  173. package/esm/ArticleCarousel.d.ts +0 -12
  174. package/esm/ArticleCarousel.js +0 -8
  175. package/esm/ArticleMeta.d.ts +0 -9
  176. package/esm/ArticleMeta.js +0 -18
  177. package/esm/Attention.d.ts +0 -7
  178. package/esm/Attention.js +0 -4
  179. package/esm/BasicTable.d.ts +0 -12
  180. package/esm/BasicTable.js +0 -29
  181. package/esm/Bling.d.ts +0 -81
  182. package/esm/Bling.js +0 -44
  183. package/esm/BlockBreak.d.ts +0 -2
  184. package/esm/BlockBreak.js +0 -6
  185. package/esm/BlockQuote.d.ts +0 -4
  186. package/esm/BlockQuote.js +0 -4
  187. package/esm/BreadCrumbs.d.ts +0 -11
  188. package/esm/BreadCrumbs.js +0 -28
  189. package/esm/ButtonBack.d.ts +0 -7
  190. package/esm/ButtonBack.js +0 -4
  191. package/esm/ButtonBar.d.ts +0 -16
  192. package/esm/ButtonBar.js +0 -14
  193. package/esm/ButtonPrimary.d.ts +0 -7
  194. package/esm/ButtonPrimary.js +0 -4
  195. package/esm/ButtonSecondary.d.ts +0 -7
  196. package/esm/ButtonSecondary.js +0 -4
  197. package/esm/ButtonTertiary.d.ts +0 -12
  198. package/esm/ButtonTertiary.js +0 -15
  199. package/esm/Carousel.d.ts +0 -4
  200. package/esm/Carousel.js +0 -4
  201. package/esm/CarouselStepper.d.ts +0 -4
  202. package/esm/CarouselStepper.js +0 -4
  203. package/esm/CenterColumn.js +0 -7
  204. package/esm/Checkbox.d.ts +0 -4
  205. package/esm/Checkbox.js +0 -4
  206. package/esm/CheckboxButtonsGroup.d.ts +0 -11
  207. package/esm/CheckboxButtonsGroup.js +0 -14
  208. package/esm/CheckboxGroup.d.ts +0 -9
  209. package/esm/CheckboxGroup.js +0 -7
  210. package/esm/CityBlock.d.ts +0 -23
  211. package/esm/CityBlock.js +0 -18
  212. package/esm/ContactBubble.d.ts +0 -58
  213. package/esm/ContactBubble.js +0 -148
  214. package/esm/ContentArticle.d.ts +0 -15
  215. package/esm/ContentArticle.js +0 -21
  216. package/esm/ContentImage.d.ts +0 -8
  217. package/esm/ContentImage.js +0 -18
  218. package/esm/Datepicker.d.ts +0 -39
  219. package/esm/Datepicker.js +0 -63
  220. package/esm/ExtraLinks.d.ts +0 -18
  221. package/esm/ExtraLinks.js +0 -34
  222. package/esm/FeatureList.d.ts +0 -12
  223. package/esm/FeatureList.js +0 -16
  224. package/esm/FieldGroup.d.ts +0 -9
  225. package/esm/FieldGroup.js +0 -9
  226. package/esm/FileInput.d.ts +0 -17
  227. package/esm/FileInput.js +0 -154
  228. package/esm/Foonote.d.ts +0 -12
  229. package/esm/Foonote.js +0 -7
  230. package/esm/FooterBadges.d.ts +0 -9
  231. package/esm/FooterBadges.js +0 -12
  232. package/esm/FooterInfo.d.ts +0 -18
  233. package/esm/FooterInfo.js +0 -9
  234. package/esm/Footnote.d.ts +0 -6
  235. package/esm/Footnote.js +0 -3
  236. package/esm/Form.d.ts +0 -7
  237. package/esm/Form.js +0 -10
  238. package/esm/FormField.d.ts +0 -65
  239. package/esm/FormField.js +0 -91
  240. package/esm/Gallery/_GalleryItem.d.ts +0 -8
  241. package/esm/Gallery/_GalleryItem.js +0 -30
  242. package/esm/Gallery/_GalleryModal.d.ts +0 -6
  243. package/esm/Gallery/_GalleryModal.js +0 -54
  244. package/esm/Gallery/_GalleryModalContext.d.ts +0 -9
  245. package/esm/Gallery/_GalleryModalContext.js +0 -3
  246. package/esm/Gallery/_GalleryModalItem.d.ts +0 -3
  247. package/esm/Gallery/_GalleryModalItem.js +0 -22
  248. package/esm/Gallery.d.ts +0 -17
  249. package/esm/Gallery.js +0 -27
  250. package/esm/GridBlocks.d.ts +0 -26
  251. package/esm/GridBlocks.js +0 -24
  252. package/esm/Heading.d.ts +0 -16
  253. package/esm/Heading.js +0 -17
  254. package/esm/HeroBlock.d.ts +0 -19
  255. package/esm/HeroBlock.js +0 -21
  256. package/esm/IframeBlock.d.ts +0 -23
  257. package/esm/IframeBlock.js +0 -26
  258. package/esm/Illustration.d.ts +0 -13
  259. package/esm/Illustration.js +0 -8
  260. package/esm/ImageCards.d.ts +0 -8
  261. package/esm/ImageCards.js +0 -22
  262. package/esm/InfoBlock.d.ts +0 -17
  263. package/esm/InfoBlock.js +0 -13
  264. package/esm/InfoHero.d.ts +0 -17
  265. package/esm/InfoHero.js +0 -82
  266. package/esm/IslandBlock.d.ts +0 -25
  267. package/esm/IslandBlock.js +0 -16
  268. package/esm/IslandPageBlock.d.ts +0 -24
  269. package/esm/IslandPageBlock.js +0 -16
  270. package/esm/LabeledTextBlock.d.ts +0 -11
  271. package/esm/LabeledTextBlock.js +0 -14
  272. package/esm/Layout.d.ts +0 -33
  273. package/esm/Layout.js +0 -52
  274. package/esm/MainMenu/_Auxiliary.d.ts +0 -6
  275. package/esm/MainMenu/_Auxiliary.js +0 -13
  276. package/esm/MainMenu/_PrimaryPanel.d.ts +0 -13
  277. package/esm/MainMenu/_PrimaryPanel.js +0 -22
  278. package/esm/MainMenu.d.ts +0 -48
  279. package/esm/MainMenu.js +0 -136
  280. package/esm/MiniMetrics.d.ts +0 -8
  281. package/esm/MiniMetrics.js +0 -12
  282. package/esm/Modal.d.ts +0 -10
  283. package/esm/Modal.js +0 -14
  284. package/esm/NameCard.d.ts +0 -64
  285. package/esm/NameCard.js +0 -82
  286. package/esm/NameCards.d.ts +0 -6
  287. package/esm/NameCards.js +0 -7
  288. package/esm/NewsHero.d.ts +0 -14
  289. package/esm/NewsHero.js +0 -86
  290. package/esm/PageFilter.d.ts +0 -17
  291. package/esm/PageFilter.js +0 -15
  292. package/esm/PageHeading.d.ts +0 -10
  293. package/esm/PageHeading.js +0 -12
  294. package/esm/ProcessOverview.d.ts +0 -13
  295. package/esm/ProcessOverview.js +0 -17
  296. package/esm/PullQuote.d.ts +0 -4
  297. package/esm/PullQuote.js +0 -4
  298. package/esm/RadioButtonsGroup.d.ts +0 -11
  299. package/esm/RadioButtonsGroup.js +0 -14
  300. package/esm/RadioGroup.d.ts +0 -13
  301. package/esm/RadioGroup.js +0 -7
  302. package/esm/RelatedLinks.d.ts +0 -20
  303. package/esm/RelatedLinks.js +0 -26
  304. package/esm/RowBlock.d.ts +0 -12
  305. package/esm/RowBlock.js +0 -9
  306. package/esm/RowBlockColumn.d.ts +0 -8
  307. package/esm/RowBlockColumn.js +0 -11
  308. package/esm/SearchInput.d.ts +0 -18
  309. package/esm/SearchInput.js +0 -33
  310. package/esm/SearchResults/_SearchResultsItem.d.ts +0 -18
  311. package/esm/SearchResults/_SearchResultsItem.js +0 -15
  312. package/esm/SearchResults.d.ts +0 -33
  313. package/esm/SearchResults.js +0 -109
  314. package/esm/SeenEffect.d.ts +0 -4
  315. package/esm/SeenEffect.js +0 -19
  316. package/esm/Selectbox.d.ts +0 -8
  317. package/esm/Selectbox.js +0 -46
  318. package/esm/ShareButtons.d.ts +0 -9
  319. package/esm/ShareButtons.js +0 -51
  320. package/esm/Sharpie.d.ts +0 -23
  321. package/esm/Sharpie.js +0 -22
  322. package/esm/SiteSearchAutocomplete.d.ts +0 -40
  323. package/esm/SiteSearchAutocomplete.js +0 -58
  324. package/esm/SiteSearchCurtain.d.ts +0 -6
  325. package/esm/SiteSearchCurtain.js +0 -33
  326. package/esm/SiteSearchInput.d.ts +0 -24
  327. package/esm/SiteSearchInput.js +0 -40
  328. package/esm/Skeleton.d.ts +0 -25
  329. package/esm/Skeleton.js +0 -30
  330. package/esm/SubHeading.d.ts +0 -10
  331. package/esm/SubHeading.js +0 -13
  332. package/esm/Tabs.d.ts +0 -35
  333. package/esm/Tabs.js +0 -94
  334. package/esm/TagPill.d.ts +0 -27
  335. package/esm/TagPill.js +0 -43
  336. package/esm/TextBlock.d.ts +0 -15
  337. package/esm/TextBlock.js +0 -15
  338. package/esm/TextButton.d.ts +0 -9
  339. package/esm/TextButton.js +0 -9
  340. package/esm/TextInput.d.ts +0 -16
  341. package/esm/TextInput.js +0 -35
  342. package/esm/VSpacer.d.ts +0 -24
  343. package/esm/VSpacer.js +0 -41
  344. package/esm/VerticalTabsTOC.d.ts +0 -14
  345. package/esm/VerticalTabsTOC.js +0 -68
  346. package/esm/WizardLayout.d.ts +0 -15
  347. package/esm/WizardLayout.js +0 -30
  348. package/esm/WizardLayoutClose.d.ts +0 -3
  349. package/esm/WizardLayoutClose.js +0 -4
  350. package/esm/WizardStepper.d.ts +0 -36
  351. package/esm/WizardStepper.js +0 -25
  352. package/esm/_abstract/Button.d.ts +0 -40
  353. package/esm/_abstract/Button.js +0 -47
  354. package/esm/_abstract/CardList.js +0 -36
  355. package/esm/_abstract/Image.js +0 -27
  356. package/esm/_abstract/Link.d.ts +0 -27
  357. package/esm/_abstract/Link.js +0 -24
  358. package/esm/_abstract/TogglerGroup.js +0 -29
  359. package/esm/_abstract/TogglerGroupField.js +0 -22
  360. package/esm/_abstract/TogglerInput.d.ts +0 -22
  361. package/esm/_abstract/TogglerInput.js +0 -33
  362. package/esm/_abstract/_AbstractCarousel.d.ts +0 -25
  363. package/esm/_abstract/_AbstractCarousel.js +0 -130
  364. package/esm/_abstract/_Blings.d.ts +0 -11
  365. package/esm/_abstract/_Blings.js +0 -12
  366. package/esm/_abstract/_Block.d.ts +0 -22
  367. package/esm/_abstract/_Block.js +0 -24
  368. package/esm/_abstract/_Quote.d.ts +0 -9
  369. package/esm/_abstract/_Quote.js +0 -8
  370. package/esm/_abstract/breakOnNL.d.ts +0 -2
  371. package/esm/_abstract/breakOnNL.js +0 -8
  372. package/esm/assets.d.ts +0 -42
  373. package/esm/assets.js +0 -56
  374. package/esm/constants.d.ts +0 -39
  375. package/esm/constants.js +0 -22
  376. package/esm/focus-visible.d.ts +0 -1
  377. package/esm/focus-visible.js +0 -1
  378. package/esm/package.json +0 -1
  379. package/esm/utils/env.d.ts +0 -1
  380. package/esm/utils/env.js +0 -8
  381. package/esm/utils/seenEffect.d.ts +0 -28
  382. package/esm/utils/seenEffect.js +0 -73
  383. package/esm/utils/useFormatMonitor.d.ts +0 -38
  384. package/esm/utils/useFormatMonitor.js +0 -41
  385. package/esm/utils/useGetSVGtext.d.ts +0 -6
  386. package/esm/utils/useGetSVGtext.js +0 -19
  387. package/esm/utils/useMenuToggling.d.ts +0 -8
  388. package/esm/utils/useMenuToggling.js +0 -62
  389. package/esm/utils/useScrollbarWidthCSSVar.d.ts +0 -1
  390. package/esm/utils/useScrollbarWidthCSSVar.js +0 -3
  391. package/esm/utils.d.ts +0 -2
  392. package/esm/utils.js +0 -2
package/esm/GridBlocks.js DELETED
@@ -1,24 +0,0 @@
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';
5
- import { Link } from './_abstract/Link';
6
- import { useSeenEffect } from './utils/seenEffect';
7
- import ButtonTertiary from './ButtonTertiary';
8
- 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;
package/esm/Heading.d.ts DELETED
@@ -1,16 +0,0 @@
1
- import { ReactNode } from 'react';
2
- import { ComponentLayoutProps } from './constants';
3
- declare const sizes: {
4
- readonly small: "small";
5
- /** Default value */
6
- readonly normal: "normal";
7
- readonly large: "large";
8
- };
9
- declare type HeadingSize = keyof typeof sizes;
10
- export declare type HeadingProps = {
11
- Tag?: 'h2' | 'h3';
12
- size?: HeadingSize;
13
- children: ReactNode;
14
- } & ComponentLayoutProps;
15
- declare const Heading: (props: HeadingProps) => JSX.Element;
16
- export default Heading;
package/esm/Heading.js DELETED
@@ -1,17 +0,0 @@
1
- import React from 'react';
2
- import getBemClass from '@hugsmidjan/react/utils/getBemClass';
3
- const sizes = {
4
- small: 'small',
5
- /** Default value */
6
- normal: 'normal',
7
- large: 'large',
8
- };
9
- const Heading = (props) => {
10
- const { size = 'normal', Tag = 'h2', align, wide, children } = props;
11
- return (React.createElement(Tag, { className: getBemClass('Heading', [
12
- sizes[size],
13
- align === 'right' && 'align--' + align,
14
- !align && wide && 'wide',
15
- ]) }, children));
16
- };
17
- export default Heading;
@@ -1,19 +0,0 @@
1
- import { Illustration } from '@reykjavik/hanna-utils/assets';
2
- import { ButtonProps } from './_abstract/Button';
3
- import { ImageProps } from './_abstract/Image';
4
- import { SeenProp } from './utils/seenEffect';
5
- declare type HeroBlockImageProps = {
6
- illustration: Illustration;
7
- image?: undefined;
8
- } | {
9
- image: ImageProps;
10
- illustration?: undefined;
11
- };
12
- export declare type HeroBlockProps = {
13
- title: string;
14
- summary: string | JSX.Element;
15
- primaryButton?: ButtonProps;
16
- secondaryButton?: ButtonProps;
17
- } & HeroBlockImageProps & SeenProp;
18
- declare const HeroBlock: (props: HeroBlockProps) => JSX.Element;
19
- export default HeroBlock;
package/esm/HeroBlock.js DELETED
@@ -1,21 +0,0 @@
1
- import React from 'react';
2
- import { getIllustrationUrl } from '@reykjavik/hanna-utils/assets';
3
- import Image from './_abstract/Image';
4
- import { useSeenEffect } from './utils/seenEffect';
5
- import ButtonPrimary from './ButtonPrimary';
6
- import ButtonTertiary from './ButtonTertiary';
7
- 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;
@@ -1,23 +0,0 @@
1
- export declare type IframeBlockProps = {
2
- src: string;
3
- framed?: boolean;
4
- compact?: boolean;
5
- align?: 'right';
6
- } & ({
7
- /** Default: 'auto' ... which initializes "iframe-resizer" script */
8
- height?: 'auto';
9
- scrolling?: never;
10
- } | {
11
- height: number;
12
- scrolling?: boolean | 'no' | 'yes';
13
- });
14
- /**
15
- * When `height` is undefined or "auto", then Add the following code-snipped to the iframed page:
16
- *
17
- * ```js
18
- * <script> window.iFrameResizer = { targetOrigin: '*' }; </script>
19
- * <script src="https://styles.reykjavik.is/assets/scripts/iframeResizer.contentWindow@4.js"></script>
20
- * ```
21
- */
22
- declare const IframeBlock: (props: IframeBlockProps) => JSX.Element;
23
- export default IframeBlock;
@@ -1,26 +0,0 @@
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
- const IframeBlock = (props) => {
13
- const { src, framed, compact, scrolling, height = 'auto', align } = 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, src: src })) : (React.createElement("iframe", { className: className, 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;
@@ -1,13 +0,0 @@
1
- import { Illustration as IllustrationName } from '@reykjavik/hanna-utils/assets';
2
- import { ImageProps } from './_abstract/Image';
3
- declare type IllustrationProps = {
4
- children?: undefined;
5
- } & ({
6
- type: IllustrationName;
7
- image?: undefined;
8
- } | {
9
- image: ImageProps;
10
- type?: undefined;
11
- });
12
- declare const Illustration: (props: IllustrationProps) => JSX.Element;
13
- export default Illustration;
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- import { getIllustrationUrl, } from '@reykjavik/hanna-utils/assets';
3
- import Image from './_abstract/Image';
4
- 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;
@@ -1,8 +0,0 @@
1
- import { ImageCardListProps, ImageCardProps as ICP } from './_abstract/CardList';
2
- import { SeenProp } from './utils/seenEffect';
3
- export declare type ImageCardProps = ICP;
4
- declare type _ImageCardProps = ImageCardListProps & {
5
- background?: boolean;
6
- } & SeenProp;
7
- declare const ImageCards: (props: _ImageCardProps) => JSX.Element;
8
- export default ImageCards;
package/esm/ImageCards.js DELETED
@@ -1,22 +0,0 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
- import React from 'react';
13
- import getBemClass from '@hugsmidjan/react/utils/getBemClass';
14
- import { CardList, } from './_abstract/CardList';
15
- import { useSeenEffect } from './utils/seenEffect';
16
- const ImageCards = (props) => {
17
- const { background, startSeen } = props, cardListProps = __rest(props, ["background", "startSeen"]);
18
- const [ref] = useSeenEffect(startSeen);
19
- return (React.createElement("div", { className: getBemClass('ImageCards', background && 'background'), ref: ref },
20
- React.createElement(CardList, Object.assign({}, cardListProps, { bemPrefix: "ImageCards", imgPlaceholder: props.imgPlaceholder || true }))));
21
- };
22
- export default ImageCards;
@@ -1,17 +0,0 @@
1
- import { SeenProp } from './utils/seenEffect';
2
- export declare type InfoBlockProps = {
3
- title: string;
4
- subtitle: string | JSX.Element;
5
- items: Array<string | JSX.Element>;
6
- } & ({
7
- attention?: undefined;
8
- extraInfo?: undefined;
9
- } | {
10
- attention: string | JSX.Element;
11
- extraInfo?: undefined;
12
- } | {
13
- extraInfo: string | JSX.Element;
14
- attention?: undefined;
15
- }) & SeenProp;
16
- declare const InfoBlock: (props: InfoBlockProps) => JSX.Element;
17
- export default InfoBlock;
package/esm/InfoBlock.js DELETED
@@ -1,13 +0,0 @@
1
- import React from 'react';
2
- import { useSeenEffect } from './utils/seenEffect';
3
- 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
- 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;
package/esm/InfoHero.d.ts DELETED
@@ -1,17 +0,0 @@
1
- import { ButtonProps } from './_abstract/Button';
2
- import { ImageProps } from './_abstract/Image';
3
- import { Alignment } from './constants';
4
- declare type BlingOptions = 'waves' | 'sunny-waves' | 'triangles' | 'circles';
5
- export declare 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
- align?: Alignment;
13
- image?: ImageProps;
14
- blingType?: BlingOptions;
15
- };
16
- declare const InfoHero: (props: InfoHeroProps) => JSX.Element;
17
- export default InfoHero;
package/esm/InfoHero.js DELETED
@@ -1,82 +0,0 @@
1
- import React from 'react';
2
- import getBemClass from '@hugsmidjan/react/utils/getBemClass';
3
- import Blings from './_abstract/_Blings';
4
- import breakOnNL from './_abstract/breakOnNL';
5
- import Image from './_abstract/Image';
6
- import ButtonTertiary from './ButtonTertiary';
7
- import { aligns } from './constants';
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
- const InfoHero = (props) => {
67
- const { title, titleBlurb, subTitle, blurb, image, buttons = [], 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
- React.createElement(Image, Object.assign({ className: "InfoHero__image", altText: title }, image, { placeholder: true })),
80
- React.createElement(Blings, { blings: blings, mirror: alignment === 'right' })));
81
- };
82
- export default InfoHero;
@@ -1,25 +0,0 @@
1
- import { Formheimur } from '@reykjavik/hanna-utils/assets';
2
- import { BlockItem } from './_abstract/_Block';
3
- import { ImageProps } from './_abstract/Image';
4
- import { SeenProp } from './utils/seenEffect';
5
- import { Alignment } from './constants';
6
- declare type IslandBaseBlockProps = {
7
- align?: Alignment;
8
- };
9
- declare type IslandImageBlock = {
10
- content: BlockItem;
11
- } & ({
12
- shapes: Formheimur;
13
- image?: undefined;
14
- } | {
15
- image: ImageProps;
16
- shapes?: undefined;
17
- });
18
- declare type IslandContentBlocks = {
19
- content: Array<BlockItem>;
20
- shapes?: undefined;
21
- image?: undefined;
22
- };
23
- export declare type IslandBlockProps = IslandBaseBlockProps & (IslandContentBlocks | IslandImageBlock) & SeenProp;
24
- declare const IslandBlock: (props: IslandBlockProps) => JSX.Element;
25
- export default IslandBlock;
@@ -1,16 +0,0 @@
1
- import React from 'react';
2
- import { getFormheimurUrl } from '@reykjavik/hanna-utils/assets';
3
- import Block from './_abstract/_Block';
4
- import { aligns } from './constants';
5
- 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;
@@ -1,24 +0,0 @@
1
- import { Illustration } from '@reykjavik/hanna-utils/assets';
2
- import { BlockItem } from './_abstract/_Block';
3
- import { ImageProps } from './_abstract/Image';
4
- import { SeenProp } from './utils/seenEffect';
5
- import { Alignment } from './constants';
6
- declare const backgrounds: {
7
- none: undefined;
8
- gray: string;
9
- secondary: string;
10
- };
11
- declare type Background = keyof typeof backgrounds;
12
- declare type IslandPageImageProps = {
13
- illustration: Illustration;
14
- image?: undefined;
15
- } | {
16
- illustration?: undefined;
17
- image: ImageProps;
18
- };
19
- export declare type IslandPageBlockProps = BlockItem & IslandPageImageProps & {
20
- align?: Alignment;
21
- background?: Background;
22
- } & SeenProp;
23
- declare const IslandPageBlock: (props: IslandPageBlockProps) => JSX.Element;
24
- export default IslandPageBlock;
@@ -1,16 +0,0 @@
1
- import React from 'react';
2
- import { getIllustrationUrl } from '@reykjavik/hanna-utils/assets';
3
- import Block from './_abstract/_Block';
4
- import { aligns } from './constants';
5
- const backgrounds = {
6
- none: undefined,
7
- gray: 'gray',
8
- secondary: 'secondary',
9
- };
10
- 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;
@@ -1,11 +0,0 @@
1
- import { ReactElement } from 'react';
2
- import { ButtonProps } from './_abstract/Button';
3
- import { SeenProp } from './utils/seenEffect';
4
- export declare type LabeledTextBlockProps = {
5
- label: string;
6
- summary: string | ReactElement;
7
- wide?: boolean;
8
- buttons?: Array<ButtonProps>;
9
- } & SeenProp;
10
- declare const LabeledTextBlock: (props: LabeledTextBlockProps) => JSX.Element;
11
- export default LabeledTextBlock;
@@ -1,14 +0,0 @@
1
- import React from 'react';
2
- import getBemClass from '@hugsmidjan/react/utils/getBemClass';
3
- import { useSeenEffect } from './utils/seenEffect';
4
- import ButtonTertiary from './ButtonTertiary';
5
- 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;
package/esm/Layout.d.ts DELETED
@@ -1,33 +0,0 @@
1
- import { ReactNode } from 'react';
2
- import { SSRSupport } from '@hugsmidjan/react/hooks';
3
- import { BemPropsModifier } from '@hugsmidjan/react/types';
4
- import { HannaColorTheme } from '@reykjavik/hanna-css';
5
- import { DefaultTexts } from '@reykjavik/hanna-utils/i18n';
6
- export declare type LayoutI18n = {
7
- lang?: string;
8
- skipLinkLabel: string;
9
- closeMenuLabel: string;
10
- closeMenuLabelLong?: string;
11
- };
12
- export declare const defaultLayoutTexts: DefaultTexts<LayoutI18n>;
13
- declare type LayoutProps = {
14
- globalAlerts?: ReactNode;
15
- mainChildren?: ReactNode;
16
- navChildren?: ReactNode;
17
- footerChildren?: ReactNode;
18
- colorTheme?: HannaColorTheme;
19
- logoLink?: string;
20
- siteName?: string;
21
- modifier?: BemPropsModifier['modifier'];
22
- ssr?: SSRSupport;
23
- texts?: LayoutI18n;
24
- lang?: string;
25
- } & ({
26
- mainChildren: ReactNode;
27
- children?: never;
28
- } | {
29
- mainChildren?: never;
30
- children: ReactNode;
31
- });
32
- declare const Layout: (props: LayoutProps) => JSX.Element;
33
- export default Layout;
package/esm/Layout.js DELETED
@@ -1,52 +0,0 @@
1
- import React from 'react';
2
- import { useIsBrowserSide } from '@hugsmidjan/react/hooks';
3
- import getBemClass from '@hugsmidjan/react/utils/getBemClass';
4
- import { getAssetUrl } from '@reykjavik/hanna-utils/assets';
5
- import { getTexts } from '@reykjavik/hanna-utils/i18n';
6
- import Image from './_abstract/Image';
7
- import { Link } from './_abstract/Link';
8
- import { useMenuToggling } from './utils/useMenuToggling';
9
- import { useScrollbarWidthCSSVar } from './utils/useScrollbarWidthCSSVar';
10
- export const defaultLayoutTexts = {
11
- is: {
12
- lang: 'is',
13
- skipLinkLabel: 'Valmynd',
14
- closeMenuLabel: 'Loka',
15
- closeMenuLabelLong: 'Loka valmynd',
16
- },
17
- en: {
18
- lang: 'en',
19
- skipLinkLabel: 'Skip to navigation',
20
- closeMenuLabel: 'Close',
21
- closeMenuLabelLong: 'Close menu',
22
- },
23
- };
24
- const Layout = (props) => {
25
- useScrollbarWidthCSSVar();
26
- const { ssr, globalAlerts, mainChildren, navChildren, footerChildren, colorTheme, children, siteName = 'Reykjavík', logoLink = '/', } = props;
27
- const { isMenuActive, closeMenu, toggleMenu } = useMenuToggling(ssr !== 'ssr-only');
28
- const isBrowser = useIsBrowserSide( /* ssr */);
29
- const txt = getTexts(props, defaultLayoutTexts);
30
- return (React.createElement("div", { className: getBemClass('Layout', props.modifier), "data-sprinkled": isBrowser, "data-color-theme": colorTheme },
31
- globalAlerts && (React.createElement("div", { className: "Layout__alerts", role: "alert" }, globalAlerts)),
32
- React.createElement("div", { className: "Layout__content" },
33
- React.createElement("div", { className: "Layout__header", role: "banner" },
34
- React.createElement(Link, { className: "Layout__header__logo", href: logoLink },
35
- ' ',
36
- React.createElement(Image, { inline: true, src: getAssetUrl('reykjavik-logo.svg') }),
37
- " ",
38
- siteName,
39
- ' '),
40
- ' ',
41
- navChildren && (React.createElement(Link, { className: "Layout__header__skiplink", href: "#pagenav", onClick: isMenuActive &&
42
- ((e) => {
43
- e.preventDefault();
44
- toggleMenu();
45
- }), "aria-label": txt.skipLinkLabel }, txt.skipLinkLabel))),
46
- React.createElement("div", { className: "Layout__main", role: "main" }, mainChildren || children),
47
- navChildren && (React.createElement("div", { className: "Layout__nav", id: "pagenav", role: "navigation" },
48
- navChildren,
49
- isMenuActive && (React.createElement("button", { className: "Layout__nav__closebutton", onClick: closeMenu, "aria-label": txt.closeMenuLabelLong, type: "button" }, txt.closeMenuLabel)))),
50
- React.createElement("div", { className: "Layout__footer", role: "complementary" }, footerChildren))));
51
- };
52
- export default Layout;
@@ -1,6 +0,0 @@
1
- import type { MegaMenuPanel } from '../MainMenu';
2
- export declare type AuxilaryPanelIllustration = 'hanna-veitiggi' | 'hanna-vandro' | 'hanna-hugsi' | 'hanna-hissa' | 'hanna-hahaha' | 'hanna-hae' | 'hanna-god_spurning' | 'hanna-gjuggiborg' | 'hanna-benda';
3
- export declare type AuxiliaryPanelProps = MegaMenuPanel & {
4
- image?: AuxilaryPanelIllustration;
5
- };
6
- export declare const AuxiliaryPanel: (props: AuxiliaryPanelProps) => JSX.Element;
@@ -1,13 +0,0 @@
1
- import React from 'react';
2
- import { getIllustrationUrl } from '@reykjavik/hanna-utils/assets';
3
- import { Link } from '../_abstract/Link';
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
- };
@@ -1,13 +0,0 @@
1
- import { RefObject } from 'react';
2
- import { MainMenuI18n, MegaMenuPanel } from '../MainMenu';
3
- declare type PrimaryPanelProps = {
4
- setActivePanel: (panel: MegaMenuPanel | undefined, setFocus?: boolean) => void;
5
- isParent?: boolean;
6
- isActive?: boolean;
7
- panel: MegaMenuPanel;
8
- texts: MainMenuI18n;
9
- activeRef: RefObject<HTMLLIElement>;
10
- isBrowser: true | undefined;
11
- };
12
- export declare const PrimaryPanel: (props: PrimaryPanelProps) => JSX.Element;
13
- export {};
@@ -1,22 +0,0 @@
1
- import React from 'react';
2
- import getBemClass from '@hugsmidjan/react/utils/getBemClass';
3
- import { Link } from '../_abstract/Link';
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
- };