@reykjavik/hanna-react 0.10.59 → 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 (355) hide show
  1. package/AccordionList.js +3 -28
  2. package/ActionCards.js +2 -4
  3. package/Alert.js +4 -29
  4. package/ArticleCards.js +2 -4
  5. package/ArticleCarousel/_ArticleCarouselCard.js +4 -6
  6. package/ArticleCarousel.js +3 -5
  7. package/ArticleMeta.js +3 -28
  8. package/Attention.js +3 -5
  9. package/BasicTable.js +5 -7
  10. package/BgBox.js +3 -5
  11. package/Bling.js +3 -5
  12. package/BlockBreak.js +2 -4
  13. package/BlockQuote.js +2 -4
  14. package/BreadCrumbs.js +2 -4
  15. package/ButtonBack.js +3 -5
  16. package/ButtonBar.js +3 -5
  17. package/ButtonPrimary.js +3 -5
  18. package/ButtonSecondary.js +3 -5
  19. package/ButtonTertiary.js +3 -5
  20. package/CHANGELOG.md +8 -0
  21. package/Carousel.js +3 -5
  22. package/CarouselStepper.js +3 -5
  23. package/CenterColumn.js +3 -5
  24. package/Checkbox.js +3 -5
  25. package/CheckboxButtonsGroup.js +4 -6
  26. package/CheckboxGroup.js +4 -6
  27. package/CityBlock.js +3 -5
  28. package/ContactBubble.js +4 -29
  29. package/ContentArticle.js +8 -10
  30. package/ContentImage.js +3 -5
  31. package/Datepicker.js +6 -31
  32. package/ExtraLinks.js +4 -17
  33. package/FeatureList.js +3 -5
  34. package/FieldGroup.js +3 -5
  35. package/FileInput.js +5 -41
  36. package/Foonote.js +2 -4
  37. package/FooterBadges.js +2 -4
  38. package/FooterInfo.js +3 -5
  39. package/Footnote.js +2 -4
  40. package/Form.js +3 -5
  41. package/FormField.js +3 -28
  42. package/Gallery/_GalleryItem.js +6 -42
  43. package/Gallery/_GalleryModal.js +6 -31
  44. package/Gallery/_GalleryModalContext.js +2 -4
  45. package/Gallery/_GalleryModalItem.js +4 -17
  46. package/Gallery.js +6 -31
  47. package/GridBlocks.js +5 -7
  48. package/Heading.js +3 -5
  49. package/HeroBlock.js +5 -7
  50. package/IframeBlock.d.ts +5 -1
  51. package/IframeBlock.js +6 -8
  52. package/Illustration.js +3 -5
  53. package/ImageCards.js +4 -17
  54. package/InfoBlock.js +2 -4
  55. package/InfoHero.js +7 -9
  56. package/IslandBlock.js +3 -5
  57. package/IslandPageBlock.js +3 -5
  58. package/LabeledTextBlock.js +4 -6
  59. package/Layout.js +4 -6
  60. package/MainMenu/_Auxiliary.js +2 -4
  61. package/MainMenu/_PrimaryPanel.js +3 -5
  62. package/MainMenu.js +5 -30
  63. package/MiniMetrics.js +4 -6
  64. package/Modal.js +3 -5
  65. package/NameCard.js +5 -7
  66. package/NameCards.js +3 -5
  67. package/NewsHero.js +6 -8
  68. package/PageFilter.js +4 -6
  69. package/PageHeading.js +3 -5
  70. package/Picture.js +4 -6
  71. package/ProcessOverview.js +3 -5
  72. package/PullQuote.js +2 -4
  73. package/RadioButtonsGroup.js +4 -6
  74. package/RadioGroup.js +4 -6
  75. package/RelatedLinks.js +2 -4
  76. package/RowBlock.js +3 -5
  77. package/RowBlockColumn.js +3 -5
  78. package/SearchInput.js +5 -41
  79. package/SearchResults/_SearchResultsItem.js +3 -5
  80. package/SearchResults.js +7 -32
  81. package/SeenEffect.js +3 -16
  82. package/Selectbox.js +6 -42
  83. package/ShareButtons.js +2 -24
  84. package/Sharpie.js +3 -5
  85. package/SiteSearchAutocomplete.js +5 -41
  86. package/SiteSearchCurtain.js +3 -28
  87. package/SiteSearchInput.d.ts +1 -1
  88. package/SiteSearchInput.js +4 -40
  89. package/Skeleton.js +4 -6
  90. package/SubHeading.js +3 -5
  91. package/Tabs.js +3 -28
  92. package/TagPill.js +5 -18
  93. package/TextBlock.js +3 -5
  94. package/TextButton.js +3 -5
  95. package/TextInput.js +5 -41
  96. package/VSpacer.js +3 -5
  97. package/VerticalTabsTOC.js +3 -28
  98. package/WizardLayout.js +3 -5
  99. package/WizardLayoutClose.js +3 -5
  100. package/WizardStepper.js +3 -5
  101. package/_abstract/_AbstractCarousel.js +7 -32
  102. package/_abstract/_Blings.js +3 -5
  103. package/_abstract/_Block.js +5 -7
  104. package/_abstract/_Button.js +4 -17
  105. package/_abstract/_CardList.js +4 -6
  106. package/_abstract/_Image.js +3 -5
  107. package/_abstract/_Link.js +2 -4
  108. package/_abstract/_Quote.js +2 -4
  109. package/_abstract/_TogglerGroup.js +8 -8
  110. package/_abstract/_TogglerGroupField.js +6 -19
  111. package/_abstract/_TogglerInput.js +4 -17
  112. package/_abstract/breakOnNL.js +2 -4
  113. package/package.json +4 -378
  114. package/utils/env.js +2 -4
  115. package/utils/useScrollbarWidthCSSVar.js +2 -4
  116. package/utils.js +3 -16
  117. package/esm/AccordionList.d.ts +0 -17
  118. package/esm/AccordionList.js +0 -24
  119. package/esm/ActionCards.d.ts +0 -5
  120. package/esm/ActionCards.js +0 -9
  121. package/esm/Alert.d.ts +0 -49
  122. package/esm/Alert.js +0 -92
  123. package/esm/ArticleCards.d.ts +0 -6
  124. package/esm/ArticleCards.js +0 -4
  125. package/esm/ArticleCarousel/_ArticleCarouselCard.d.ts +0 -27
  126. package/esm/ArticleCarousel/_ArticleCarouselCard.js +0 -24
  127. package/esm/ArticleCarousel.d.ts +0 -12
  128. package/esm/ArticleCarousel.js +0 -8
  129. package/esm/ArticleMeta.d.ts +0 -10
  130. package/esm/ArticleMeta.js +0 -19
  131. package/esm/Attention.d.ts +0 -7
  132. package/esm/Attention.js +0 -4
  133. package/esm/BasicTable.d.ts +0 -12
  134. package/esm/BasicTable.js +0 -29
  135. package/esm/BgBox.d.ts +0 -8
  136. package/esm/BgBox.js +0 -9
  137. package/esm/Bling.d.ts +0 -81
  138. package/esm/Bling.js +0 -44
  139. package/esm/BlockBreak.d.ts +0 -2
  140. package/esm/BlockBreak.js +0 -6
  141. package/esm/BlockQuote.d.ts +0 -4
  142. package/esm/BlockQuote.js +0 -4
  143. package/esm/BreadCrumbs.d.ts +0 -11
  144. package/esm/BreadCrumbs.js +0 -28
  145. package/esm/ButtonBack.d.ts +0 -7
  146. package/esm/ButtonBack.js +0 -4
  147. package/esm/ButtonBar.d.ts +0 -16
  148. package/esm/ButtonBar.js +0 -14
  149. package/esm/ButtonPrimary.d.ts +0 -7
  150. package/esm/ButtonPrimary.js +0 -4
  151. package/esm/ButtonSecondary.d.ts +0 -7
  152. package/esm/ButtonSecondary.js +0 -4
  153. package/esm/ButtonTertiary.d.ts +0 -12
  154. package/esm/ButtonTertiary.js +0 -15
  155. package/esm/Carousel.d.ts +0 -4
  156. package/esm/Carousel.js +0 -4
  157. package/esm/CarouselStepper.d.ts +0 -4
  158. package/esm/CarouselStepper.js +0 -4
  159. package/esm/CenterColumn.d.ts +0 -7
  160. package/esm/CenterColumn.js +0 -7
  161. package/esm/Checkbox.d.ts +0 -4
  162. package/esm/Checkbox.js +0 -4
  163. package/esm/CheckboxButtonsGroup.d.ts +0 -11
  164. package/esm/CheckboxButtonsGroup.js +0 -14
  165. package/esm/CheckboxGroup.d.ts +0 -9
  166. package/esm/CheckboxGroup.js +0 -7
  167. package/esm/CityBlock.d.ts +0 -23
  168. package/esm/CityBlock.js +0 -18
  169. package/esm/ContactBubble.d.ts +0 -58
  170. package/esm/ContactBubble.js +0 -148
  171. package/esm/ContentArticle.d.ts +0 -15
  172. package/esm/ContentArticle.js +0 -21
  173. package/esm/ContentImage.d.ts +0 -8
  174. package/esm/ContentImage.js +0 -18
  175. package/esm/Datepicker.d.ts +0 -39
  176. package/esm/Datepicker.js +0 -63
  177. package/esm/ExtraLinks.d.ts +0 -18
  178. package/esm/ExtraLinks.js +0 -34
  179. package/esm/FeatureList.d.ts +0 -12
  180. package/esm/FeatureList.js +0 -16
  181. package/esm/FieldGroup.d.ts +0 -9
  182. package/esm/FieldGroup.js +0 -9
  183. package/esm/FileInput.d.ts +0 -17
  184. package/esm/FileInput.js +0 -154
  185. package/esm/Foonote.d.ts +0 -12
  186. package/esm/Foonote.js +0 -7
  187. package/esm/FooterBadges.d.ts +0 -9
  188. package/esm/FooterBadges.js +0 -12
  189. package/esm/FooterInfo.d.ts +0 -18
  190. package/esm/FooterInfo.js +0 -9
  191. package/esm/Footnote.d.ts +0 -6
  192. package/esm/Footnote.js +0 -3
  193. package/esm/Form.d.ts +0 -7
  194. package/esm/Form.js +0 -10
  195. package/esm/FormField.d.ts +0 -65
  196. package/esm/FormField.js +0 -91
  197. package/esm/Gallery/_GalleryItem.d.ts +0 -8
  198. package/esm/Gallery/_GalleryItem.js +0 -30
  199. package/esm/Gallery/_GalleryModal.d.ts +0 -6
  200. package/esm/Gallery/_GalleryModal.js +0 -54
  201. package/esm/Gallery/_GalleryModalContext.d.ts +0 -9
  202. package/esm/Gallery/_GalleryModalContext.js +0 -3
  203. package/esm/Gallery/_GalleryModalItem.d.ts +0 -3
  204. package/esm/Gallery/_GalleryModalItem.js +0 -22
  205. package/esm/Gallery.d.ts +0 -17
  206. package/esm/Gallery.js +0 -27
  207. package/esm/GridBlocks.d.ts +0 -26
  208. package/esm/GridBlocks.js +0 -24
  209. package/esm/Heading.d.ts +0 -16
  210. package/esm/Heading.js +0 -17
  211. package/esm/HeroBlock.d.ts +0 -19
  212. package/esm/HeroBlock.js +0 -21
  213. package/esm/IframeBlock.d.ts +0 -23
  214. package/esm/IframeBlock.js +0 -26
  215. package/esm/Illustration.d.ts +0 -13
  216. package/esm/Illustration.js +0 -8
  217. package/esm/ImageCards.d.ts +0 -8
  218. package/esm/ImageCards.js +0 -22
  219. package/esm/InfoBlock.d.ts +0 -17
  220. package/esm/InfoBlock.js +0 -13
  221. package/esm/InfoHero.d.ts +0 -17
  222. package/esm/InfoHero.js +0 -82
  223. package/esm/IslandBlock.d.ts +0 -25
  224. package/esm/IslandBlock.js +0 -16
  225. package/esm/IslandPageBlock.d.ts +0 -24
  226. package/esm/IslandPageBlock.js +0 -16
  227. package/esm/LabeledTextBlock.d.ts +0 -11
  228. package/esm/LabeledTextBlock.js +0 -14
  229. package/esm/Layout.d.ts +0 -33
  230. package/esm/Layout.js +0 -52
  231. package/esm/MainMenu/_Auxiliary.d.ts +0 -6
  232. package/esm/MainMenu/_Auxiliary.js +0 -13
  233. package/esm/MainMenu/_PrimaryPanel.d.ts +0 -13
  234. package/esm/MainMenu/_PrimaryPanel.js +0 -22
  235. package/esm/MainMenu.d.ts +0 -48
  236. package/esm/MainMenu.js +0 -136
  237. package/esm/MiniMetrics.d.ts +0 -8
  238. package/esm/MiniMetrics.js +0 -12
  239. package/esm/Modal.d.ts +0 -10
  240. package/esm/Modal.js +0 -14
  241. package/esm/NameCard.d.ts +0 -64
  242. package/esm/NameCard.js +0 -82
  243. package/esm/NameCards.d.ts +0 -6
  244. package/esm/NameCards.js +0 -7
  245. package/esm/NewsHero.d.ts +0 -14
  246. package/esm/NewsHero.js +0 -86
  247. package/esm/PageFilter.d.ts +0 -17
  248. package/esm/PageFilter.js +0 -15
  249. package/esm/PageHeading.d.ts +0 -10
  250. package/esm/PageHeading.js +0 -12
  251. package/esm/Picture.d.ts +0 -7
  252. package/esm/Picture.js +0 -8
  253. package/esm/ProcessOverview.d.ts +0 -13
  254. package/esm/ProcessOverview.js +0 -17
  255. package/esm/PullQuote.d.ts +0 -4
  256. package/esm/PullQuote.js +0 -4
  257. package/esm/RadioButtonsGroup.d.ts +0 -11
  258. package/esm/RadioButtonsGroup.js +0 -14
  259. package/esm/RadioGroup.d.ts +0 -13
  260. package/esm/RadioGroup.js +0 -7
  261. package/esm/RelatedLinks.d.ts +0 -20
  262. package/esm/RelatedLinks.js +0 -26
  263. package/esm/RowBlock.d.ts +0 -12
  264. package/esm/RowBlock.js +0 -9
  265. package/esm/RowBlockColumn.d.ts +0 -8
  266. package/esm/RowBlockColumn.js +0 -11
  267. package/esm/SearchInput.d.ts +0 -18
  268. package/esm/SearchInput.js +0 -33
  269. package/esm/SearchResults/_SearchResultsItem.d.ts +0 -18
  270. package/esm/SearchResults/_SearchResultsItem.js +0 -15
  271. package/esm/SearchResults.d.ts +0 -33
  272. package/esm/SearchResults.js +0 -109
  273. package/esm/SeenEffect.d.ts +0 -4
  274. package/esm/SeenEffect.js +0 -19
  275. package/esm/Selectbox.d.ts +0 -8
  276. package/esm/Selectbox.js +0 -46
  277. package/esm/ShareButtons.d.ts +0 -9
  278. package/esm/ShareButtons.js +0 -51
  279. package/esm/Sharpie.d.ts +0 -23
  280. package/esm/Sharpie.js +0 -22
  281. package/esm/SiteSearchAutocomplete.d.ts +0 -40
  282. package/esm/SiteSearchAutocomplete.js +0 -58
  283. package/esm/SiteSearchCurtain.d.ts +0 -6
  284. package/esm/SiteSearchCurtain.js +0 -33
  285. package/esm/SiteSearchInput.d.ts +0 -24
  286. package/esm/SiteSearchInput.js +0 -40
  287. package/esm/Skeleton.d.ts +0 -25
  288. package/esm/Skeleton.js +0 -30
  289. package/esm/SubHeading.d.ts +0 -10
  290. package/esm/SubHeading.js +0 -13
  291. package/esm/Tabs.d.ts +0 -35
  292. package/esm/Tabs.js +0 -94
  293. package/esm/TagPill.d.ts +0 -27
  294. package/esm/TagPill.js +0 -43
  295. package/esm/TextBlock.d.ts +0 -15
  296. package/esm/TextBlock.js +0 -15
  297. package/esm/TextButton.d.ts +0 -9
  298. package/esm/TextButton.js +0 -9
  299. package/esm/TextInput.d.ts +0 -16
  300. package/esm/TextInput.js +0 -35
  301. package/esm/VSpacer.d.ts +0 -24
  302. package/esm/VSpacer.js +0 -41
  303. package/esm/VerticalTabsTOC.d.ts +0 -14
  304. package/esm/VerticalTabsTOC.js +0 -68
  305. package/esm/WizardLayout.d.ts +0 -15
  306. package/esm/WizardLayout.js +0 -30
  307. package/esm/WizardLayoutClose.d.ts +0 -3
  308. package/esm/WizardLayoutClose.js +0 -4
  309. package/esm/WizardStepper.d.ts +0 -36
  310. package/esm/WizardStepper.js +0 -25
  311. package/esm/_abstract/_AbstractCarousel.d.ts +0 -25
  312. package/esm/_abstract/_AbstractCarousel.js +0 -130
  313. package/esm/_abstract/_Blings.d.ts +0 -11
  314. package/esm/_abstract/_Blings.js +0 -12
  315. package/esm/_abstract/_Block.d.ts +0 -22
  316. package/esm/_abstract/_Block.js +0 -24
  317. package/esm/_abstract/_Button.d.ts +0 -40
  318. package/esm/_abstract/_Button.js +0 -47
  319. package/esm/_abstract/_CardList.d.ts +0 -30
  320. package/esm/_abstract/_CardList.js +0 -38
  321. package/esm/_abstract/_Image.d.ts +0 -36
  322. package/esm/_abstract/_Image.js +0 -27
  323. package/esm/_abstract/_Link.d.ts +0 -27
  324. package/esm/_abstract/_Link.js +0 -24
  325. package/esm/_abstract/_Quote.d.ts +0 -9
  326. package/esm/_abstract/_Quote.js +0 -8
  327. package/esm/_abstract/_TogglerGroup.d.ts +0 -31
  328. package/esm/_abstract/_TogglerGroup.js +0 -29
  329. package/esm/_abstract/_TogglerGroupField.d.ts +0 -17
  330. package/esm/_abstract/_TogglerGroupField.js +0 -22
  331. package/esm/_abstract/_TogglerInput.d.ts +0 -22
  332. package/esm/_abstract/_TogglerInput.js +0 -33
  333. package/esm/_abstract/breakOnNL.d.ts +0 -2
  334. package/esm/_abstract/breakOnNL.js +0 -8
  335. package/esm/assets.d.ts +0 -42
  336. package/esm/assets.js +0 -56
  337. package/esm/constants.d.ts +0 -39
  338. package/esm/constants.js +0 -22
  339. package/esm/focus-visible.d.ts +0 -1
  340. package/esm/focus-visible.js +0 -1
  341. package/esm/package.json +0 -1
  342. package/esm/utils/env.d.ts +0 -1
  343. package/esm/utils/env.js +0 -8
  344. package/esm/utils/seenEffect.d.ts +0 -28
  345. package/esm/utils/seenEffect.js +0 -73
  346. package/esm/utils/useFormatMonitor.d.ts +0 -38
  347. package/esm/utils/useFormatMonitor.js +0 -41
  348. package/esm/utils/useGetSVGtext.d.ts +0 -6
  349. package/esm/utils/useGetSVGtext.js +0 -19
  350. package/esm/utils/useMenuToggling.d.ts +0 -8
  351. package/esm/utils/useMenuToggling.js +0 -62
  352. package/esm/utils/useScrollbarWidthCSSVar.d.ts +0 -1
  353. package/esm/utils/useScrollbarWidthCSSVar.js +0 -3
  354. package/esm/utils.d.ts +0 -2
  355. package/esm/utils.js +0 -2
@@ -1,7 +0,0 @@
1
- import { ReactNode } from 'react';
2
- import { ButtonProps, ButtonVariantProps } from './_abstract/_Button';
3
- export declare type ButtonPrimaryProps = ButtonProps & ButtonVariantProps;
4
- declare const ButtonPrimary: (props: ButtonPrimaryProps & {
5
- children?: ReactNode;
6
- }) => JSX.Element;
7
- export default ButtonPrimary;
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import Button from './_abstract/_Button';
3
- const ButtonPrimary = (props) => (React.createElement(Button, Object.assign({ bem: "ButtonPrimary" }, props)));
4
- export default ButtonPrimary;
@@ -1,7 +0,0 @@
1
- import { ReactNode } from 'react';
2
- import { ButtonProps, ButtonVariantProps } from './_abstract/_Button';
3
- export declare type ButtonSecondaryProps = ButtonProps & ButtonVariantProps;
4
- declare const ButtonSecondary: (props: ButtonSecondaryProps & {
5
- children?: ReactNode;
6
- }) => JSX.Element;
7
- export default ButtonSecondary;
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import Button from './_abstract/_Button';
3
- const ButtonSecondary = (props) => (React.createElement(Button, Object.assign({ bem: "ButtonSecondary" }, props)));
4
- export default ButtonSecondary;
@@ -1,12 +0,0 @@
1
- import { ReactNode } from 'react';
2
- import { ButtonProps, ButtonVariantProps } from './_abstract/_Button';
3
- declare type TertiarySize = Extract<ButtonVariantProps['size'], 'normal' | 'small'>;
4
- declare type TertiaryIcon = Extract<ButtonVariantProps['icon'], 'none' | 'go-back'>;
5
- export declare type ButtonTertiaryProps = ButtonProps & Omit<ButtonVariantProps, 'icon' | 'size'> & {
6
- size?: TertiarySize;
7
- icon?: TertiaryIcon;
8
- };
9
- declare const ButtonTertiary: (props: ButtonTertiaryProps & {
10
- children?: ReactNode;
11
- }) => JSX.Element;
12
- export default ButtonTertiary;
@@ -1,15 +0,0 @@
1
- import React from 'react';
2
- import Button from './_abstract/_Button';
3
- const sizes = {
4
- normal: 'normal',
5
- small: 'small',
6
- };
7
- const icons = {
8
- none: 'none',
9
- 'go-back': 'go-back',
10
- };
11
- const ButtonTertiary = (props) => {
12
- const { size = 'normal', icon = 'none' } = props;
13
- return React.createElement(Button, Object.assign({ bem: "ButtonTertiary" }, props, { size: sizes[size], icon: icons[icon] }));
14
- };
15
- export default ButtonTertiary;
package/esm/Carousel.d.ts DELETED
@@ -1,4 +0,0 @@
1
- import { CarouselProps } from './_abstract/_AbstractCarousel';
2
- export type { CarouselProps } from './_abstract/_AbstractCarousel';
3
- declare const Carousel: <I extends Record<string, unknown> = {}, P extends Record<string, unknown> | undefined = {}>(props: CarouselProps<I, P>) => JSX.Element;
4
- export default Carousel;
package/esm/Carousel.js DELETED
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import AbstractCarousel from './_abstract/_AbstractCarousel';
3
- const Carousel = (props) => (React.createElement(AbstractCarousel, Object.assign({}, props, { bem: undefined, modifier: undefined, title: undefined })));
4
- export default Carousel;
@@ -1,4 +0,0 @@
1
- import { Props } from '@hugsmidjan/react/CarouselStepper';
2
- declare type CarouselStepperProps = Omit<Props, 'bem' | 'modifier'>;
3
- declare const CarouselStepper: (props: CarouselStepperProps) => JSX.Element;
4
- export default CarouselStepper;
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import _CarouselStepper from '@hugsmidjan/react/CarouselStepper';
3
- const CarouselStepper = (props) => (React.createElement(_CarouselStepper, Object.assign({}, props, { bem: undefined, modifier: undefined })));
4
- export default CarouselStepper;
@@ -1,7 +0,0 @@
1
- import { ReactNode } from 'react';
2
- import { EffectProp, SeenProp } from './utils/seenEffect';
3
- export declare type CenterColumnProps = {
4
- children: ReactNode;
5
- } & SeenProp & EffectProp;
6
- declare const CenterColumn: (props: CenterColumnProps) => JSX.Element;
7
- export default CenterColumn;
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- import SeenEffect from './SeenEffect';
3
- const CenterColumn = (props) => {
4
- const { children, startSeen, effectType } = props;
5
- return startSeen == null ? (React.createElement("div", { className: "CenterColumn" }, children)) : (React.createElement(SeenEffect, { className: "CenterColumn", startSeen: startSeen, effectType: effectType }, children));
6
- };
7
- export default CenterColumn;
package/esm/Checkbox.d.ts DELETED
@@ -1,4 +0,0 @@
1
- import { TogglerInputProps } from './_abstract/_TogglerInput';
2
- export declare type CheckboxProps = TogglerInputProps;
3
- declare const Checkbox: (props: CheckboxProps) => JSX.Element;
4
- export default Checkbox;
package/esm/Checkbox.js DELETED
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import TogglerInput from './_abstract/_TogglerInput';
3
- const Checkbox = (props) => (React.createElement(TogglerInput, Object.assign({ bem: "Checkbox" }, props, { type: "checkbox" })));
4
- export default Checkbox;
@@ -1,11 +0,0 @@
1
- import { TogglerGroupFieldOptions, TogglerGroupFieldProps } from './_abstract/_TogglerGroupField';
2
- export declare type CheckboxButtonsGroupProps = TogglerGroupFieldProps & {
3
- value?: Array<string>;
4
- /** @deprecated (Will be removed in v0.9) */
5
- columns?: '2col' | '3col';
6
- /** @deprecated (Will be removed in v0.9) */
7
- layout?: 'slim';
8
- };
9
- export declare type CheckboxButtonsGroupOptions = TogglerGroupFieldOptions;
10
- declare const CheckboxButtonsGroup: (props: CheckboxButtonsGroupProps) => JSX.Element;
11
- export default CheckboxButtonsGroup;
@@ -1,14 +0,0 @@
1
- import React from 'react';
2
- import TogglerGroupField from './_abstract/_TogglerGroupField';
3
- import TogglerInput from './_abstract/_TogglerInput';
4
- const CheckboxButton = (props) => (React.createElement(TogglerInput, Object.assign({ bem: "CheckboxButton" }, props, { type: "checkbox" })));
5
- const CheckboxButtonsGroup = (props) => {
6
- if (props.layout) {
7
- console.warn('`CheckboxButtonsGroupProps.layout` is deprecated.');
8
- }
9
- if (props.columns) {
10
- console.warn('`CheckboxButtonsGroupProps.columns` is deprecated.');
11
- }
12
- return (React.createElement(TogglerGroupField, Object.assign({}, props, { bem: "CheckboxButtonsGroup", Toggler: CheckboxButton })));
13
- };
14
- export default CheckboxButtonsGroup;
@@ -1,9 +0,0 @@
1
- import { TogglerGroupFieldOption, TogglerGroupFieldOptions, TogglerGroupFieldProps } from './_abstract/_TogglerGroupField';
2
- export declare type CheckboxGroupProps = TogglerGroupFieldProps & {
3
- layout?: 'inline';
4
- value?: Array<string>;
5
- };
6
- export declare type CheckboxGroupOption = TogglerGroupFieldOption;
7
- export declare type CheckboxGroupOptions = TogglerGroupFieldOptions;
8
- declare const CheckboxGroup: (props: CheckboxGroupProps) => JSX.Element;
9
- export default CheckboxGroup;
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- import TogglerGroupField from './_abstract/_TogglerGroupField';
3
- import Checkbox from './Checkbox';
4
- const CheckboxGroup = (props) => {
5
- return (React.createElement(TogglerGroupField, Object.assign({}, props, { bem: "CheckboxGroup", modifier: props.layout, Toggler: Checkbox })));
6
- };
7
- export default CheckboxGroup;
@@ -1,23 +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 types: {
7
- largebox: boolean;
8
- largeimage: boolean;
9
- };
10
- declare type CityBlockImageProps = {
11
- illustration: Illustration;
12
- image?: never;
13
- } | {
14
- image: ImageProps;
15
- illustration?: never;
16
- };
17
- export declare type CityBlockProps = {
18
- align?: Alignment;
19
- type?: keyof typeof types;
20
- content: BlockItem;
21
- } & CityBlockImageProps & SeenProp;
22
- declare const CityBlock: (props: CityBlockProps) => JSX.Element;
23
- export default CityBlock;
package/esm/CityBlock.js DELETED
@@ -1,18 +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 types = {
6
- largebox: true,
7
- largeimage: true,
8
- };
9
- const CityBlock = (props) => {
10
- const align = props.align || 'right';
11
- const type = !props.illustration && props.type; // The presence of illustration prop suppresses type
12
- const modifier = [aligns[align] && 'align--' + align, type && types[type] && type];
13
- const imageProps = props.illustration != null
14
- ? { src: getIllustrationUrl(props.illustration) }
15
- : props.image;
16
- return (React.createElement(Block, { bem: "CityBlock", modifier: modifier, content: props.content, image: imageProps, startSeen: props.startSeen }));
17
- };
18
- export default CityBlock;
@@ -1,58 +0,0 @@
1
- import { SSRSupport } from '@hugsmidjan/react/hooks';
2
- import { DefaultTexts } from '@reykjavik/hanna-utils/i18n';
3
- export declare type ContactBubbleI18n = {
4
- lang?: string;
5
- openBtn: string;
6
- openBtnLong?: string;
7
- closeBtn: string;
8
- closeBtnLong?: string;
9
- };
10
- export declare const defaultTexts: DefaultTexts<ContactBubbleI18n>;
11
- declare const icons: {
12
- readonly suggestions: 1;
13
- readonly phone: 1;
14
- readonly faq: 1;
15
- readonly livechat: 1;
16
- readonly other: 0;
17
- };
18
- export declare type ContactBubbleIcon = keyof typeof icons;
19
- export declare const ensureIcon: (maybeIcon: string | undefined) => ContactBubbleIcon | undefined;
20
- export declare type ContactBubbleItem = {
21
- label: string;
22
- extraLabel?: string;
23
- icon?: ContactBubbleIcon;
24
- } & ({
25
- href: string;
26
- /** Prevents default link behavior unless the handler function returns `true` */
27
- onClick?: () => void | boolean;
28
- target?: string;
29
- } | {
30
- onClick: () => void | boolean;
31
- href?: undefined;
32
- target?: undefined;
33
- });
34
- export declare type ContactBubbleProps = {
35
- title?: string;
36
- links: Array<ContactBubbleItem>;
37
- /** By default the ContactBubble's toggler is hidden if the page
38
- * is scrolled to near the top or the bottom.
39
- *
40
- * This means that on short pages (with hardly any scrolling)
41
- * the ContactBubble **always** hidden.
42
- *
43
- * Set this prop to `true` if you want to disable this
44
- * magic and always show the bubble toggler
45
- */
46
- alwaysShow?: boolean;
47
- texts?: ContactBubbleI18n;
48
- lang?: string;
49
- ssr?: SSRSupport;
50
- } & ({
51
- open?: boolean;
52
- onToggle: (isOpen: boolean) => void;
53
- } | {
54
- open?: undefined;
55
- onToggle?: (isOpen: boolean) => void;
56
- });
57
- declare const ContactBubble: (props: ContactBubbleProps) => JSX.Element | null;
58
- export default ContactBubble;
@@ -1,148 +0,0 @@
1
- import React, { useEffect, useMemo, useRef, useState } from 'react';
2
- import focusElm from '@hugsmidjan/qj/focusElm';
3
- import { useDomid, useIsBrowserSide } from '@hugsmidjan/react/hooks';
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';
8
- export const defaultTexts = {
9
- is: {
10
- lang: 'is',
11
- openBtn: 'Hafa samband',
12
- closeBtn: 'Loka',
13
- closeBtnLong: 'Loka valmynd',
14
- },
15
- en: {
16
- lang: 'en',
17
- openBtn: 'Contact us',
18
- closeBtn: 'Close',
19
- closeBtnLong: 'Close bubble',
20
- },
21
- };
22
- // ---------------------------------------------------------------------------
23
- const icons = {
24
- suggestions: 1,
25
- phone: 1,
26
- faq: 1,
27
- livechat: 1,
28
- other: 0,
29
- };
30
- export const ensureIcon = (maybeIcon) => maybeIcon && icons[maybeIcon]
31
- ? maybeIcon
32
- : undefined;
33
- const ContactBubble = (props) => {
34
- const { title, links, onToggle, alwaysShow } = props;
35
- const txt = getTexts(props, defaultTexts);
36
- const useLocalState = props.open == null;
37
- const [localOpen, setLocalOpen] = useState(false);
38
- const open = useLocalState ? localOpen : props.open;
39
- const isBrowser = useIsBrowserSide(props.ssr);
40
- const domid = useDomid();
41
- const wrapperRef = useRef(null);
42
- const { openBubble, closeBubble } = useMemo(() => ({
43
- openBubble: () => {
44
- useLocalState && setLocalOpen(true);
45
- onToggle && onToggle(true);
46
- },
47
- closeBubble: (setFocus) => {
48
- useLocalState && setLocalOpen(false);
49
- onToggle && onToggle(false);
50
- setFocus !== false && focusElm(wrapperRef.current);
51
- },
52
- }), [useLocalState, onToggle]);
53
- useEffect(() => {
54
- const wrapperElm = wrapperRef.current;
55
- if (!wrapperElm) {
56
- return;
57
- }
58
- if (alwaysShow) {
59
- wrapperElm.dataset.show = 'true';
60
- return;
61
- }
62
- const scrollElm = getPageScrollElm();
63
- let pending = 0;
64
- const checkScroll = () => {
65
- if (!pending) {
66
- pending = requestAnimationFrame(() => {
67
- const { scrollTop, scrollHeight, clientHeight } = scrollElm;
68
- const scrollLength = scrollHeight - clientHeight;
69
- // const f = scrollLength > 600 ? 1 : (scrollLength - 200) / 600;
70
- const f = 1;
71
- const show = scrollTop > f * 150 && scrollLength - scrollTop > f * 250;
72
- wrapperElm.dataset.show = String(show);
73
- !show && closeBubble(false);
74
- pending = 0;
75
- });
76
- }
77
- };
78
- checkScroll();
79
- // Set scroll-listeners on both the ´document` and the `scrollElm`
80
- // because mobile browsers seem to handle CSS height and overflow
81
- // rules on <html> and <body> differently from desktop browsers.
82
- // Only one of these two handlers seems to trigger though,
83
- // (as Element scroll events don't bubble)
84
- // and even if they did, the rAF throttling prevents that from
85
- // becoming a problem.
86
- document.addEventListener('scroll', checkScroll);
87
- scrollElm.addEventListener('scroll', checkScroll);
88
- return () => {
89
- document.removeEventListener('scroll', checkScroll);
90
- scrollElm.removeEventListener('scroll', checkScroll);
91
- };
92
- }, [isBrowser, alwaysShow, closeBubble]);
93
- useEffect(() => {
94
- const escHandler = (e) => e.key === 'Escape' && closeBubble();
95
- const outsideClickHandler = (e) => {
96
- var _a;
97
- if (open && !((_a = wrapperRef.current) === null || _a === void 0 ? void 0 : _a.contains(e.target))) {
98
- closeBubble(false);
99
- }
100
- };
101
- document.addEventListener('keydown', escHandler);
102
- document.addEventListener('click', outsideClickHandler, true);
103
- const htmlDataset = document.documentElement.dataset;
104
- if (open) {
105
- htmlDataset.contactBubble = 'true';
106
- }
107
- else {
108
- delete htmlDataset.contactBubble;
109
- }
110
- return () => {
111
- delete htmlDataset.contactBubble;
112
- document.removeEventListener('keydown', escHandler);
113
- document.removeEventListener('click', outsideClickHandler, true);
114
- };
115
- }, [open, closeBubble]);
116
- if (links.length === 0) {
117
- return null;
118
- }
119
- const menu = (React.createElement("div", { className: "ContactBubble", id: isBrowser && domid, hidden: isBrowser && !open, "data-always-show": alwaysShow || undefined, "data-sprinkled": isBrowser },
120
- React.createElement("h2", { className: "ContactBubble__title" }, title || txt.openBtn),
121
- React.createElement("ul", { className: "ContactBubble__list" }, links.map((linkInfo, i) => {
122
- const { href, label, extraLabel, target, onClick } = linkInfo;
123
- const icon = ensureIcon(linkInfo.icon);
124
- const itemClass = getBemClass('ContactBubble__item', icon && 'type--' + icon);
125
- const onClickHandler = onClick &&
126
- ((e) => {
127
- if (!onClick()) {
128
- e.preventDefault();
129
- closeBubble(false);
130
- }
131
- });
132
- const content = [
133
- ' ',
134
- label,
135
- '\n',
136
- extraLabel && React.createElement("small", { key: "\uD83E\uDD21" }, extraLabel),
137
- '\n',
138
- ];
139
- return (React.createElement("li", { key: i, className: itemClass }, href && href !== '#' ? (React.createElement(Link, { className: "ContactBubble__link", href: href, onClick: onClickHandler, target: target }, content)) : (React.createElement("button", { className: "ContactBubble__link", onClick: onClickHandler, type: "button" }, content))));
140
- })),
141
- '\n\n',
142
- isBrowser && (React.createElement("button", { className: "ContactBubble__closebtn", "aria-controls": domid, "aria-label": txt.closeBtnLong, onClick: () => closeBubble(), type: "button" }, txt.closeBtn))));
143
- return isBrowser ? (React.createElement("div", { className: "ContactBubble__wrapper", ref: wrapperRef },
144
- React.createElement("button", { className: "ContactBubble__openbtn", "aria-controls": domid, "aria-expanded": open, "aria-label": txt.openBtnLong, onClick: open ? () => closeBubble() : openBubble, type: "button" }, txt.openBtn),
145
- '\n\n',
146
- menu)) : (menu);
147
- };
148
- export default ContactBubble;
@@ -1,15 +0,0 @@
1
- import { ReactNode } from 'react';
2
- import { SeenProp } from './utils/seenEffect';
3
- import { ArticleMetaProps } from './ArticleMeta';
4
- import { ContentImageProps } from './ContentImage';
5
- import { RelatedLinksProps } from './RelatedLinks';
6
- export declare type ContentArticleProps = {
7
- /** Date, author, etc. */
8
- meta: ArticleMetaProps['items'];
9
- headline: string;
10
- topImage?: ContentImageProps;
11
- body: ReactNode;
12
- relatedLinks?: RelatedLinksProps;
13
- } & SeenProp;
14
- declare const ContentArticle: (props: ContentArticleProps) => JSX.Element;
15
- export default ContentArticle;
@@ -1,21 +0,0 @@
1
- import React from 'react';
2
- import { useSeenEffect } from './utils/seenEffect';
3
- import ArticleMeta from './ArticleMeta';
4
- import ContentImage from './ContentImage';
5
- import Heading from './Heading';
6
- import RelatedLinks from './RelatedLinks';
7
- import TextBlock from './TextBlock';
8
- import VSpacer from './VSpacer';
9
- const ContentArticle = (props) => {
10
- const [ref] = useSeenEffect(props.startSeen);
11
- return (React.createElement("div", { className: "ContentArticle", ref: ref },
12
- React.createElement(ArticleMeta, { items: props.meta }),
13
- React.createElement(Heading, null, props.headline),
14
- React.createElement(TextBlock, { startSeen: true },
15
- props.topImage && React.createElement(ContentImage, Object.assign({}, props.topImage)),
16
- props.body),
17
- React.createElement(VSpacer, { size: "small" },
18
- React.createElement("hr", null)),
19
- props.relatedLinks && React.createElement(RelatedLinks, Object.assign({}, props.relatedLinks))));
20
- };
21
- export default ContentArticle;
@@ -1,8 +0,0 @@
1
- import { ImageProps } from './_abstract/_Image';
2
- export declare type ContentImageProps = {
3
- image?: ImageProps;
4
- caption?: string | JSX.Element;
5
- credit?: string | JSX.Element;
6
- };
7
- declare const ContentImage: (props: ContentImageProps) => JSX.Element;
8
- export default ContentImage;
@@ -1,18 +0,0 @@
1
- import React from 'react';
2
- import Image from './_abstract/_Image';
3
- const ContentImage = (props) => {
4
- const { image, caption, credit } = props;
5
- return (React.createElement("figure", { className: "ContentImage" },
6
- (caption || credit) && (React.createElement("figcaption", { className: "ContentImage__caption" },
7
- caption && React.createElement("span", { className: "ContentImage__text" },
8
- " ",
9
- caption,
10
- " "),
11
- ' ',
12
- credit && React.createElement("small", { className: "ContentImage__credit" },
13
- " ",
14
- credit,
15
- " "))),
16
- React.createElement(Image, Object.assign({ className: "ContentImage__image" }, image))));
17
- };
18
- export default ContentImage;
@@ -1,39 +0,0 @@
1
- import { RefObject } from 'react';
2
- import { FormFieldWrappingProps } from './FormField';
3
- export declare type DatepickerProps = {
4
- small?: boolean;
5
- placeholder?: string;
6
- value?: Date;
7
- startDate?: Date;
8
- endDate?: Date;
9
- minDate?: Date;
10
- maxDate?: Date;
11
- localeCode?: 'is' | 'en';
12
- dateFormat?: string;
13
- isStartDate?: boolean;
14
- isEndDate?: boolean;
15
- inputRef?: RefObject<HTMLInputElement>;
16
- onChange: (date?: Date) => void;
17
- datepickerExtraProps?: Record<string, unknown>;
18
- /** @deprecated use value instead. (Will be removed in v0.11) */
19
- initialDate?: Date;
20
- } & FormFieldWrappingProps;
21
- export declare const getDateDiff: (date: Date, diff: number) => Date;
22
- export declare type DatepickerLocaleProps = {
23
- nextMonthAriaLabel: string;
24
- nextMonthButtonLabel: string;
25
- nextYearAriaLabel: string;
26
- nextYearButtonLabel: string;
27
- previousMonthAriaLabel: string;
28
- previousMonthButtonLabel: string;
29
- previousYearAriaLabel: string;
30
- previousYearButtonLabel: string;
31
- timeInputLabel: string;
32
- weekAriaLabelPrefix: string;
33
- weekLabel: string;
34
- ariaLabelPrefix: string;
35
- chooseDayAriaLabelPrefix: string;
36
- disabledDayAriaLabelPrefix: string;
37
- };
38
- declare const Datepicker: (props: DatepickerProps) => JSX.Element;
39
- export default Datepicker;
package/esm/Datepicker.js DELETED
@@ -1,63 +0,0 @@
1
- import React from 'react';
2
- // Documentation: https://reactdatepicker.com/
3
- import ReactDatePicker, { registerLocale,
4
- // setDefaultLocale,
5
- } from 'react-datepicker';
6
- import { useDomid } from '@hugsmidjan/react/hooks';
7
- import getBemClass from '@hugsmidjan/react/utils/getBemClass';
8
- // For more info on localization see: https://stackoverflow.com/questions/54399084/change-locale-in-react-datepicker/58306958#58306958
9
- import is from 'date-fns/locale/is';
10
- import FormField from './FormField';
11
- registerLocale('is', is);
12
- export const getDateDiff = (date, diff) => {
13
- const newDate = new Date(date);
14
- newDate.setDate(newDate.getDate() + diff);
15
- return newDate;
16
- };
17
- const i18n = {
18
- is: {
19
- nextMonthAriaLabel: 'Næsti mánuður',
20
- nextMonthButtonLabel: 'Næsti mánuður',
21
- nextYearAriaLabel: 'Næsta ár',
22
- nextYearButtonLabel: 'Næsta ár',
23
- previousMonthAriaLabel: 'Fyrri mánuður',
24
- previousMonthButtonLabel: 'Fyrri mánuður',
25
- previousYearAriaLabel: 'Fyrra ár',
26
- previousYearButtonLabel: 'Fyrra ár',
27
- timeInputLabel: 'Tími: ',
28
- weekAriaLabelPrefix: 'Vika: ',
29
- weekLabel: 'Vika',
30
- ariaLabelPrefix: 'Mánuður:',
31
- chooseDayAriaLabelPrefix: 'Veldu:',
32
- disabledDayAriaLabelPrefix: 'Dagsetning ekki í boði',
33
- },
34
- };
35
- const Datepicker = (props) => {
36
- const { className, id, label, hideLabel, assistText, disabled, readOnly, invalid, errorMessage, required, reqText, placeholder, small, localeCode, dateFormat = 'd.M.yyy', initialDate, value = initialDate, startDate, endDate, minDate, maxDate, isStartDate = false, isEndDate = false, onChange, datepickerExtraProps, ssr, inputRef, } = props;
37
- const domid = useDomid(id);
38
- const txts = (localeCode && i18n[localeCode]) || {};
39
- const filled = !!value;
40
- const empty = !filled && !placeholder;
41
- return (React.createElement(FormField, { className: getBemClass('Datepicker', [], className), ssr: ssr, label: label, small: small, assistText: assistText, hideLabel: hideLabel, invalid: invalid, required: required, reqText: reqText, disabled: disabled, readOnly: readOnly, filled: filled, empty: empty, errorMessage: errorMessage, renderInput: (className, inputProps, addFocusProps) => {
42
- return (React.createElement("div", { className: className.input, ref: inputRef &&
43
- ((elm) => {
44
- inputRef.current =
45
- (elm === null || elm === void 0 ? void 0 : elm.querySelector('input')) || undefined;
46
- return elm;
47
- }) },
48
- React.createElement(ReactDatePicker, Object.assign({ id: domid, required: inputProps.required, disabled: inputProps.disabled, readOnly: inputProps.readOnly, selected: value, locale: localeCode, dateFormat: dateFormat, onChange: (date) => {
49
- onChange(date || undefined);
50
- const inputElm = inputRef === null || inputRef === void 0 ? void 0 : inputRef.current;
51
- if (inputElm) {
52
- inputElm.dispatchEvent(new Event('change', { bubbles: true }));
53
- }
54
- }, placeholderText: placeholder,
55
- // TODO: Implement this
56
- // selectsRange
57
- minDate: minDate, maxDate: maxDate, startDate: startDate, endDate: endDate, selectsStart: isStartDate, selectsEnd: isEndDate, formatWeekDay: (weekday) => {
58
- // TODO: if we use costom locale we don't need this
59
- return weekday.charAt(0).toUpperCase();
60
- }, showYearDropdown: true, scrollableYearDropdown: true, yearDropdownItemNumber: 15, showMonthDropdown: true }, inputProps, txts, addFocusProps(datepickerExtraProps)))));
61
- } }));
62
- };
63
- export default Datepicker;
@@ -1,18 +0,0 @@
1
- import { TextCardListProps } from './_abstract/_CardList';
2
- import { SeenProp } from './utils/seenEffect';
3
- export declare type RelatedLink = {
4
- href: string;
5
- label: string;
6
- blank?: boolean;
7
- type?: 'link' | 'pdf' | 'text';
8
- };
9
- declare type RelatedProps = {
10
- relatedTitle?: string;
11
- relatedLinks?: Array<RelatedLink>;
12
- };
13
- export declare type ExtraLinksCardProps = TextCardListProps['cards'][number];
14
- export declare type ExtraLinksProps = TextCardListProps & RelatedProps & {
15
- className?: string;
16
- } & SeenProp;
17
- declare const ExtraLinks: (props: ExtraLinksProps) => JSX.Element;
18
- export default ExtraLinks;
package/esm/ExtraLinks.js DELETED
@@ -1,34 +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 { Link } from './_abstract/_Link';
16
- import { useSeenEffect } from './utils/seenEffect';
17
- const ExtraLinks__related = (props) => {
18
- const { relatedTitle, relatedLinks } = props;
19
- return (React.createElement("div", { className: "ExtraLinks__related" },
20
- relatedTitle && React.createElement("h3", { className: "ExtraLinks__related__title" }, relatedTitle),
21
- React.createElement("ul", { className: "ExtraLinks__related__list" }, relatedLinks &&
22
- relatedLinks.map(({ href, label, blank = false, type }, i) => (React.createElement("li", { className: "ExtraLinks__related__item", key: i },
23
- React.createElement(Link, { className: getBemClass('ExtraLinks__related__link', type), href: href, target: blank ? '_blank' : '', rel: blank ? 'noreferrer noopener' : '' }, label)))))));
24
- };
25
- const ExtraLinks = (props) => {
26
- const { relatedTitle, relatedLinks, className, startSeen } = props, cardListProps = __rest(props, ["relatedTitle", "relatedLinks", "className", "startSeen"]);
27
- const hasRelated = !!(relatedLinks && relatedLinks.length);
28
- const [ref] = useSeenEffect(startSeen);
29
- return (React.createElement("div", { className: getBemClass('ExtraLinks', hasRelated && 'related', className), ref: ref },
30
- React.createElement("div", { className: "ExtraLinks__main" },
31
- React.createElement(CardList, Object.assign({}, cardListProps, { bemPrefix: "ExtraLinks" }))),
32
- hasRelated && (React.createElement(ExtraLinks__related, { relatedTitle: relatedTitle, relatedLinks: relatedLinks }))));
33
- };
34
- export default ExtraLinks;