@reykjavik/hanna-react 0.10.56 → 0.10.57

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 (275) hide show
  1. package/{AccordionList.jsx → AccordionList.js} +5 -14
  2. package/{ActionCards.jsx → ActionCards.js} +2 -3
  3. package/{Alert.jsx → Alert.js} +6 -8
  4. package/ArticleCarousel/_ArticleCarouselCard.js +31 -0
  5. package/{ArticleCarousel.jsx → ArticleCarousel.js} +1 -1
  6. package/{ArticleMeta.jsx → ArticleMeta.js} +9 -8
  7. package/{Attention.jsx → Attention.js} +1 -1
  8. package/{BasicTable.jsx → BasicTable.js} +11 -12
  9. package/{Bling.jsx → Bling.js} +2 -2
  10. package/{BlockBreak.jsx → BlockBreak.js} +1 -1
  11. package/{BlockQuote.jsx → BlockQuote.js} +1 -1
  12. package/BreadCrumbs.js +33 -0
  13. package/{ButtonBack.jsx → ButtonBack.js} +1 -1
  14. package/{ButtonBar.jsx → ButtonBar.js} +2 -4
  15. package/{ButtonPrimary.jsx → ButtonPrimary.js} +1 -1
  16. package/{ButtonSecondary.jsx → ButtonSecondary.js} +1 -1
  17. package/{ButtonTertiary.jsx → ButtonTertiary.js} +1 -1
  18. package/CHANGELOG.md +1 -1
  19. package/{Carousel.jsx → Carousel.js} +1 -1
  20. package/{CarouselStepper.jsx → CarouselStepper.js} +1 -1
  21. package/{CenterColumn.jsx → CenterColumn.js} +1 -3
  22. package/{Checkbox.jsx → Checkbox.js} +1 -1
  23. package/{CheckboxButtonsGroup.jsx → CheckboxButtonsGroup.js} +2 -2
  24. package/{CheckboxGroup.jsx → CheckboxGroup.js} +1 -1
  25. package/{CityBlock.jsx → CityBlock.js} +1 -1
  26. package/{ContactBubble.jsx → ContactBubble.js} +12 -26
  27. package/{ContentArticle.jsx → ContentArticle.js} +9 -12
  28. package/ContentImage.js +23 -0
  29. package/{Datepicker.jsx → Datepicker.js} +17 -18
  30. package/{ExtraLinks.jsx → ExtraLinks.js} +9 -17
  31. package/FeatureList.js +21 -0
  32. package/{FieldGroup.jsx → FieldGroup.js} +3 -4
  33. package/{FileInput.jsx → FileInput.js} +22 -25
  34. package/{Foonote.jsx → Foonote.js} +0 -0
  35. package/FooterBadges.js +17 -0
  36. package/FooterInfo.js +14 -0
  37. package/{Footnote.jsx → Footnote.js} +1 -1
  38. package/{Form.jsx → Form.js} +2 -4
  39. package/{FormField.jsx → FormField.js} +20 -22
  40. package/Gallery/{_GalleryItem.jsx → _GalleryItem.js} +8 -9
  41. package/Gallery/{_GalleryModal.jsx → _GalleryModal.js} +11 -15
  42. package/Gallery/{_GalleryModalItem.jsx → _GalleryModalItem.js} +5 -7
  43. package/{Gallery.jsx → Gallery.js} +3 -4
  44. package/GridBlocks.js +29 -0
  45. package/{Heading.jsx → Heading.js} +2 -4
  46. package/{HeroBlock.jsx → HeroBlock.js} +8 -9
  47. package/{IframeBlock.jsx → IframeBlock.js} +6 -6
  48. package/{Illustration.jsx → Illustration.js} +1 -1
  49. package/{ImageCards.jsx → ImageCards.js} +2 -3
  50. package/InfoBlock.js +18 -0
  51. package/{InfoHero.jsx → InfoHero.js} +9 -15
  52. package/{IslandBlock.jsx → IslandBlock.js} +1 -1
  53. package/{IslandPageBlock.jsx → IslandPageBlock.js} +1 -1
  54. package/{LabeledTextBlock.jsx → LabeledTextBlock.js} +5 -7
  55. package/Layout.js +58 -0
  56. package/MainMenu/{_Auxiliary.jsx → _Auxiliary.js} +5 -11
  57. package/MainMenu/_PrimaryPanel.js +29 -0
  58. package/{MainMenu.jsx → MainMenu.js} +27 -40
  59. package/{MiniMetrics.jsx → MiniMetrics.js} +5 -4
  60. package/Modal.js +19 -0
  61. package/{NameCard.jsx → NameCard.js} +18 -23
  62. package/{NameCards.jsx → NameCards.js} +1 -3
  63. package/{NewsHero.jsx → NewsHero.js} +7 -9
  64. package/{PageFilter.jsx → PageFilter.js} +6 -7
  65. package/{PageHeading.jsx → PageHeading.js} +2 -4
  66. package/ProcessOverview.js +22 -0
  67. package/{PullQuote.jsx → PullQuote.js} +1 -1
  68. package/{RadioButtonsGroup.jsx → RadioButtonsGroup.js} +2 -2
  69. package/{RadioGroup.jsx → RadioGroup.js} +2 -2
  70. package/{RelatedLinks.jsx → RelatedLinks.js} +9 -13
  71. package/{RowBlock.jsx → RowBlock.js} +1 -3
  72. package/{RowBlockColumn.jsx → RowBlockColumn.js} +2 -4
  73. package/{SearchInput.jsx → SearchInput.js} +4 -6
  74. package/SearchResults/_SearchResultsItem.js +20 -0
  75. package/{SearchResults.jsx → SearchResults.js} +27 -36
  76. package/{SeenEffect.jsx → SeenEffect.js} +1 -1
  77. package/{Selectbox.jsx → Selectbox.js} +1 -1
  78. package/{ShareButtons.jsx → ShareButtons.js} +6 -12
  79. package/{Sharpie.jsx → Sharpie.js} +1 -1
  80. package/{SiteSearchAutocomplete.jsx → SiteSearchAutocomplete.js} +5 -7
  81. package/{SiteSearchCurtain.jsx → SiteSearchCurtain.js} +1 -5
  82. package/{SiteSearchInput.jsx → SiteSearchInput.js} +10 -12
  83. package/{Skeleton.jsx → Skeleton.js} +5 -5
  84. package/{SubHeading.jsx → SubHeading.js} +2 -4
  85. package/{Tabs.jsx → Tabs.js} +12 -12
  86. package/{TagPill.jsx → TagPill.js} +11 -16
  87. package/{TextBlock.jsx → TextBlock.js} +2 -4
  88. package/{TextButton.jsx → TextButton.js} +1 -1
  89. package/{TextInput.jsx → TextInput.js} +1 -1
  90. package/{VSpacer.jsx → VSpacer.js} +1 -1
  91. package/{VerticalTabsTOC.jsx → VerticalTabsTOC.js} +2 -2
  92. package/WizardLayout.js +35 -0
  93. package/{WizardLayoutClose.jsx → WizardLayoutClose.js} +1 -1
  94. package/WizardStepper.js +30 -0
  95. package/_abstract/{Button.jsx → Button.js} +2 -6
  96. package/_abstract/CardList.js +43 -0
  97. package/_abstract/{Image.jsx → Image.js} +10 -12
  98. package/_abstract/{Link.jsx → Link.js} +0 -0
  99. package/_abstract/TogglerGroup.js +34 -0
  100. package/_abstract/{TogglerGroupField.jsx → TogglerGroupField.js} +3 -3
  101. package/_abstract/{TogglerInput.jsx → TogglerInput.js} +13 -15
  102. package/_abstract/{_AbstractCarousel.jsx → _AbstractCarousel.js} +7 -10
  103. package/_abstract/{_Blings.jsx → _Blings.js} +1 -3
  104. package/_abstract/_Block.js +29 -0
  105. package/_abstract/{_Quote.jsx → _Quote.js} +3 -6
  106. package/_abstract/{breakOnNL.jsx → breakOnNL.js} +1 -1
  107. package/esm/AccordionList.js +24 -0
  108. package/esm/{ActionCards.jsx → ActionCards.js} +2 -3
  109. package/esm/{Alert.jsx → Alert.js} +6 -8
  110. package/esm/ArticleCarousel/_ArticleCarouselCard.js +24 -0
  111. package/esm/{ArticleCarousel.jsx → ArticleCarousel.js} +1 -1
  112. package/esm/ArticleMeta.js +18 -0
  113. package/esm/Attention.js +4 -0
  114. package/esm/{BasicTable.jsx → BasicTable.js} +11 -12
  115. package/esm/{Bling.jsx → Bling.js} +2 -2
  116. package/esm/BlockBreak.js +6 -0
  117. package/esm/BlockQuote.js +4 -0
  118. package/esm/BreadCrumbs.js +28 -0
  119. package/esm/ButtonBack.js +4 -0
  120. package/esm/{ButtonBar.jsx → ButtonBar.js} +2 -4
  121. package/esm/ButtonPrimary.js +4 -0
  122. package/esm/ButtonSecondary.js +4 -0
  123. package/esm/{ButtonTertiary.jsx → ButtonTertiary.js} +1 -1
  124. package/esm/Carousel.js +4 -0
  125. package/esm/CarouselStepper.js +4 -0
  126. package/esm/CenterColumn.js +7 -0
  127. package/esm/Checkbox.js +4 -0
  128. package/esm/{CheckboxButtonsGroup.jsx → CheckboxButtonsGroup.js} +2 -2
  129. package/esm/{CheckboxGroup.jsx → CheckboxGroup.js} +1 -1
  130. package/esm/{CityBlock.jsx → CityBlock.js} +1 -1
  131. package/esm/{ContactBubble.jsx → ContactBubble.js} +12 -26
  132. package/esm/ContentArticle.js +21 -0
  133. package/esm/ContentImage.js +18 -0
  134. package/esm/{Datepicker.jsx → Datepicker.js} +17 -18
  135. package/esm/{ExtraLinks.jsx → ExtraLinks.js} +9 -17
  136. package/esm/FeatureList.js +16 -0
  137. package/esm/FieldGroup.js +9 -0
  138. package/esm/{FileInput.jsx → FileInput.js} +22 -25
  139. package/esm/{Foonote.jsx → Foonote.js} +0 -0
  140. package/esm/FooterBadges.js +12 -0
  141. package/esm/FooterInfo.js +9 -0
  142. package/esm/Footnote.js +3 -0
  143. package/esm/{Form.jsx → Form.js} +2 -4
  144. package/esm/{FormField.jsx → FormField.js} +20 -22
  145. package/esm/Gallery/{_GalleryItem.jsx → _GalleryItem.js} +8 -9
  146. package/esm/Gallery/{_GalleryModal.jsx → _GalleryModal.js} +11 -15
  147. package/esm/Gallery/{_GalleryModalItem.jsx → _GalleryModalItem.js} +5 -7
  148. package/esm/{Gallery.jsx → Gallery.js} +3 -4
  149. package/esm/GridBlocks.js +24 -0
  150. package/esm/{Heading.jsx → Heading.js} +2 -4
  151. package/esm/HeroBlock.js +21 -0
  152. package/esm/{IframeBlock.jsx → IframeBlock.js} +6 -6
  153. package/esm/{Illustration.jsx → Illustration.js} +1 -1
  154. package/esm/{ImageCards.jsx → ImageCards.js} +2 -3
  155. package/esm/InfoBlock.js +13 -0
  156. package/esm/{InfoHero.jsx → InfoHero.js} +9 -15
  157. package/esm/{IslandBlock.jsx → IslandBlock.js} +1 -1
  158. package/esm/{IslandPageBlock.jsx → IslandPageBlock.js} +1 -1
  159. package/esm/LabeledTextBlock.js +14 -0
  160. package/esm/Layout.js +52 -0
  161. package/esm/MainMenu/_Auxiliary.js +13 -0
  162. package/esm/MainMenu/_PrimaryPanel.js +22 -0
  163. package/esm/{MainMenu.jsx → MainMenu.js} +27 -40
  164. package/esm/MiniMetrics.js +12 -0
  165. package/esm/Modal.js +14 -0
  166. package/esm/{NameCard.jsx → NameCard.js} +18 -23
  167. package/esm/NameCards.js +7 -0
  168. package/esm/{NewsHero.jsx → NewsHero.js} +7 -9
  169. package/esm/PageFilter.js +15 -0
  170. package/esm/{PageHeading.jsx → PageHeading.js} +2 -4
  171. package/esm/ProcessOverview.js +17 -0
  172. package/esm/PullQuote.js +4 -0
  173. package/esm/{RadioButtonsGroup.jsx → RadioButtonsGroup.js} +2 -2
  174. package/esm/RadioGroup.js +7 -0
  175. package/esm/RelatedLinks.js +26 -0
  176. package/esm/{RowBlock.jsx → RowBlock.js} +1 -3
  177. package/esm/{RowBlockColumn.jsx → RowBlockColumn.js} +2 -4
  178. package/esm/{SearchInput.jsx → SearchInput.js} +4 -6
  179. package/esm/SearchResults/_SearchResultsItem.js +15 -0
  180. package/esm/{SearchResults.jsx → SearchResults.js} +27 -36
  181. package/esm/{SeenEffect.jsx → SeenEffect.js} +1 -1
  182. package/esm/{Selectbox.jsx → Selectbox.js} +1 -1
  183. package/esm/{ShareButtons.jsx → ShareButtons.js} +6 -12
  184. package/esm/{Sharpie.jsx → Sharpie.js} +1 -1
  185. package/esm/{SiteSearchAutocomplete.jsx → SiteSearchAutocomplete.js} +5 -7
  186. package/esm/{SiteSearchCurtain.jsx → SiteSearchCurtain.js} +1 -5
  187. package/esm/{SiteSearchInput.jsx → SiteSearchInput.js} +10 -12
  188. package/esm/{Skeleton.jsx → Skeleton.js} +5 -5
  189. package/esm/{SubHeading.jsx → SubHeading.js} +2 -4
  190. package/esm/{Tabs.jsx → Tabs.js} +12 -12
  191. package/esm/{TagPill.jsx → TagPill.js} +11 -16
  192. package/esm/{TextBlock.jsx → TextBlock.js} +2 -4
  193. package/esm/{TextButton.jsx → TextButton.js} +1 -1
  194. package/esm/{TextInput.jsx → TextInput.js} +1 -1
  195. package/esm/{VSpacer.jsx → VSpacer.js} +1 -1
  196. package/esm/{VerticalTabsTOC.jsx → VerticalTabsTOC.js} +2 -2
  197. package/esm/WizardLayout.js +30 -0
  198. package/esm/WizardLayoutClose.js +4 -0
  199. package/esm/WizardStepper.js +25 -0
  200. package/esm/_abstract/{Button.jsx → Button.js} +2 -6
  201. package/esm/_abstract/CardList.js +36 -0
  202. package/esm/_abstract/{Image.jsx → Image.js} +10 -12
  203. package/esm/_abstract/{Link.jsx → Link.js} +0 -0
  204. package/esm/_abstract/TogglerGroup.js +29 -0
  205. package/esm/_abstract/{TogglerGroupField.jsx → TogglerGroupField.js} +3 -3
  206. package/esm/_abstract/{TogglerInput.jsx → TogglerInput.js} +13 -15
  207. package/esm/_abstract/{_AbstractCarousel.jsx → _AbstractCarousel.js} +7 -10
  208. package/esm/_abstract/_Blings.js +12 -0
  209. package/esm/_abstract/_Block.js +24 -0
  210. package/esm/_abstract/_Quote.js +8 -0
  211. package/esm/_abstract/{breakOnNL.jsx → breakOnNL.js} +1 -1
  212. package/package.json +91 -91
  213. package/ArticleCarousel/_ArticleCarouselCard.jsx +0 -32
  214. package/BreadCrumbs.jsx +0 -36
  215. package/ContentImage.jsx +0 -18
  216. package/FeatureList.jsx +0 -28
  217. package/FooterBadges.jsx +0 -21
  218. package/FooterInfo.jsx +0 -19
  219. package/GridBlocks.jsx +0 -40
  220. package/InfoBlock.jsx +0 -23
  221. package/Layout.jsx +0 -69
  222. package/MainMenu/_PrimaryPanel.jsx +0 -37
  223. package/Modal.jsx +0 -21
  224. package/ProcessOverview.jsx +0 -25
  225. package/SearchResults/_SearchResultsItem.jsx +0 -24
  226. package/WizardLayout.jsx +0 -44
  227. package/WizardStepper.jsx +0 -34
  228. package/_abstract/CardList.jsx +0 -46
  229. package/_abstract/TogglerGroup.jsx +0 -36
  230. package/_abstract/_Block.jsx +0 -32
  231. package/esm/AccordionList.jsx +0 -33
  232. package/esm/ArticleCarousel/_ArticleCarouselCard.jsx +0 -25
  233. package/esm/ArticleMeta.jsx +0 -17
  234. package/esm/Attention.jsx +0 -4
  235. package/esm/BlockBreak.jsx +0 -6
  236. package/esm/BlockQuote.jsx +0 -4
  237. package/esm/BreadCrumbs.jsx +0 -31
  238. package/esm/ButtonBack.jsx +0 -4
  239. package/esm/ButtonPrimary.jsx +0 -4
  240. package/esm/ButtonSecondary.jsx +0 -4
  241. package/esm/Carousel.jsx +0 -4
  242. package/esm/CarouselStepper.jsx +0 -4
  243. package/esm/CenterColumn.jsx +0 -9
  244. package/esm/Checkbox.jsx +0 -4
  245. package/esm/ContentArticle.jsx +0 -24
  246. package/esm/ContentImage.jsx +0 -13
  247. package/esm/FeatureList.jsx +0 -23
  248. package/esm/FieldGroup.jsx +0 -10
  249. package/esm/FooterBadges.jsx +0 -16
  250. package/esm/FooterInfo.jsx +0 -14
  251. package/esm/Footnote.jsx +0 -3
  252. package/esm/GridBlocks.jsx +0 -35
  253. package/esm/HeroBlock.jsx +0 -22
  254. package/esm/InfoBlock.jsx +0 -18
  255. package/esm/LabeledTextBlock.jsx +0 -16
  256. package/esm/Layout.jsx +0 -63
  257. package/esm/MainMenu/_Auxiliary.jsx +0 -19
  258. package/esm/MainMenu/_PrimaryPanel.jsx +0 -30
  259. package/esm/MiniMetrics.jsx +0 -11
  260. package/esm/Modal.jsx +0 -16
  261. package/esm/NameCards.jsx +0 -9
  262. package/esm/PageFilter.jsx +0 -16
  263. package/esm/ProcessOverview.jsx +0 -20
  264. package/esm/PullQuote.jsx +0 -4
  265. package/esm/RadioGroup.jsx +0 -7
  266. package/esm/RelatedLinks.jsx +0 -30
  267. package/esm/SearchResults/_SearchResultsItem.jsx +0 -19
  268. package/esm/WizardLayout.jsx +0 -39
  269. package/esm/WizardLayoutClose.jsx +0 -4
  270. package/esm/WizardStepper.jsx +0 -29
  271. package/esm/_abstract/CardList.jsx +0 -39
  272. package/esm/_abstract/TogglerGroup.jsx +0 -31
  273. package/esm/_abstract/_Blings.jsx +0 -14
  274. package/esm/_abstract/_Block.jsx +0 -27
  275. package/esm/_abstract/_Quote.jsx +0 -11
@@ -145,17 +145,14 @@ const AbstractCarousel = (props) => {
145
145
  if (!itemCount) {
146
146
  return null;
147
147
  }
148
- return (<div className={(0, getBemClass_1.default)(bem, modifier, props.className)} ref={outerRef} data-sprinkled={isBrowser}>
149
- {title && <h2 className={bem + '__title'}>{title}</h2>}
150
- <div className={bem + '__itemlist'} style={leftOffset
151
- ? { '--Carousel--leftOffset': `${leftOffset}px` }
152
- : undefined} data-scroll-snapping={leftOffset ? 'true' : undefined} onMouseLeave={handleMouseLeave} ref={listRef}>
153
- {children ||
148
+ return (react_1.default.createElement("div", { className: (0, getBemClass_1.default)(bem, modifier, props.className), ref: outerRef, "data-sprinkled": isBrowser },
149
+ title && react_1.default.createElement("h2", { className: bem + '__title' }, title),
150
+ react_1.default.createElement("div", { className: bem + '__itemlist', style: leftOffset
151
+ ? { '--Carousel--leftOffset': `${leftOffset}px` }
152
+ : undefined, "data-scroll-snapping": leftOffset ? 'true' : undefined, onMouseLeave: handleMouseLeave, ref: listRef }, children ||
154
153
  items.map((item, i) => (
155
154
  // @ts-expect-error (Can't be arsed...)
156
- <Component key={i} {...ComponentProps} {...item}/>))}
157
- </div>
158
- {isBrowser && (<CarouselStepper_1.default itemCount={itemCount} setCurrent={scrollToItem} current={activeItem}/>)}
159
- </div>);
155
+ react_1.default.createElement(Component, Object.assign({ key: i }, ComponentProps, item))))),
156
+ isBrowser && (react_1.default.createElement(CarouselStepper_1.default, { itemCount: itemCount, setCurrent: scrollToItem, current: activeItem }))));
160
157
  };
161
158
  exports.default = AbstractCarousel;
@@ -13,7 +13,5 @@ const inverseAlignments = {
13
13
  'right-ish': 'left-ish',
14
14
  right: 'left',
15
15
  };
16
- const Blings = (props) => (<>
17
- {props.blings.map(({ type, align, vertical, color, overlay, parent }, i) => (<Bling_1.default key={type + '-' + i} type={type} align={props.mirror ? inverseAlignments[align || 'left'] : align} vertical={vertical} color={color} overlay={overlay} parent={parent}/>))}
18
- </>);
16
+ const Blings = (props) => (react_1.default.createElement(react_1.default.Fragment, null, props.blings.map(({ type, align, vertical, color, overlay, parent }, i) => (react_1.default.createElement(Bling_1.default, { key: type + '-' + i, type: type, align: props.mirror ? inverseAlignments[align || 'left'] : align, vertical: vertical, color: color, overlay: overlay, parent: parent })))));
19
17
  exports.default = Blings;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const react_1 = __importDefault(require("react"));
7
+ const getBemClass_1 = __importDefault(require("@hugsmidjan/react/utils/getBemClass"));
8
+ const seenEffect_1 = require("../utils/seenEffect");
9
+ const Button_1 = __importDefault(require("./Button"));
10
+ const Image_1 = __importDefault(require("./Image"));
11
+ const Block = (props) => {
12
+ const { image, modifier, bem, content, startSeen } = props;
13
+ const [ref] = (0, seenEffect_1.useSeenEffect)(startSeen);
14
+ const contentItems = Array.isArray(content) ? content : [content];
15
+ return (react_1.default.createElement("div", { className: (0, getBemClass_1.default)(bem, modifier), ref: ref },
16
+ contentItems.map(({ title, summary, buttons = [] }, i) => {
17
+ const hasSummary = summary && (typeof summary !== 'string' || !!summary.trim());
18
+ return (react_1.default.createElement("div", { key: i, className: `${bem}__content` },
19
+ react_1.default.createElement("h2", { className: `${bem}__title` }, title),
20
+ hasSummary && react_1.default.createElement("div", { className: `${bem}__summary` }, summary),
21
+ buttons.length > 0 && (react_1.default.createElement("div", { className: `${bem}__buttons` },
22
+ ' ',
23
+ buttons.map((buttonProps, i) => (react_1.default.createElement(react_1.default.Fragment, null,
24
+ react_1.default.createElement(Button_1.default, Object.assign({ bem: `${bem}__button`, key: i }, buttonProps)),
25
+ ' ')))))));
26
+ }),
27
+ image && react_1.default.createElement(Image_1.default, Object.assign({ className: `${bem}__image` }, image))));
28
+ };
29
+ exports.default = Block;
@@ -8,11 +8,8 @@ const react_1 = __importDefault(require("react"));
8
8
  const Link_1 = require("./Link");
9
9
  const _Quote = (props) => {
10
10
  const { bem, children, by, byHref } = props;
11
- return (<figure className={bem}>
12
- <blockquote className={bem + '__quote'}>{children}</blockquote>
13
- {by && (<figcaption className={bem + '__by'}>
14
- {byHref ? (<Link_1.Link href={byHref}>{by}</Link_1.Link>) : typeof by === 'string' ? (<span>{by}</span>) : (by)}
15
- </figcaption>)}
16
- </figure>);
11
+ return (react_1.default.createElement("figure", { className: bem },
12
+ react_1.default.createElement("blockquote", { className: bem + '__quote' }, children),
13
+ by && (react_1.default.createElement("figcaption", { className: bem + '__by' }, byHref ? (react_1.default.createElement(Link_1.Link, { href: byHref }, by)) : typeof by === 'string' ? (react_1.default.createElement("span", null, by)) : (by)))));
17
14
  };
18
15
  exports._Quote = _Quote;
@@ -9,5 +9,5 @@ const breakOnNL = (text) => text &&
9
9
  .trim()
10
10
  .replace(/(?:\n\s*)+/g, '\n\n')
11
11
  .split(/\n/)
12
- .map((bit) => bit || <br />);
12
+ .map((bit) => bit || react_1.default.createElement("br", null));
13
13
  exports.default = breakOnNL;
@@ -0,0 +1,24 @@
1
+ import React, { useEffect, useState } from 'react';
2
+ import { useDomid, useIsBrowserSide } from '@hugsmidjan/react/hooks';
3
+ import getBemClass from '@hugsmidjan/react/utils/getBemClass';
4
+ import { useSeenEffect } from './utils/seenEffect';
5
+ const AccordionListItem = (props) => {
6
+ const { title, content, id, disabled = false, defaultOpen, ssr } = props;
7
+ const [open, setOpen] = useState(defaultOpen);
8
+ useEffect(() => setOpen(defaultOpen), [defaultOpen]);
9
+ const domid = useDomid();
10
+ const isBrowser = useIsBrowserSide(ssr);
11
+ const itemDisabled = (isBrowser && disabled) || !content;
12
+ return (React.createElement("div", { className: getBemClass('AccordionList__item', [itemDisabled && 'disabled']), id: id, "data-start-open": defaultOpen || undefined, "data-sprinkled": isBrowser },
13
+ React.createElement("h3", { className: "AccordionList__title" }, isBrowser ? (React.createElement("button", { type: "button", className: "AccordionList__button", "aria-controls": domid, "aria-expanded": open || undefined, onClick: () => {
14
+ setOpen(!open);
15
+ }, disabled: itemDisabled }, title)) : (title)),
16
+ React.createElement("div", { id: isBrowser && domid, className: "AccordionList__content", hidden: isBrowser && (!open || itemDisabled) }, content)));
17
+ };
18
+ // ---------------------------------------------------------------------------
19
+ const AccordionList = (props) => {
20
+ const { items, ssr, wide, defaultOpen, startSeen } = props;
21
+ const [ref] = useSeenEffect(startSeen);
22
+ return (React.createElement("div", { className: getBemClass('AccordionList', [wide && 'wide']), ref: ref }, items.map((item, i) => (React.createElement(AccordionListItem, Object.assign({ key: i }, item, { ssr: ssr, defaultOpen: defaultOpen && defaultOpen.includes(i) }))))));
23
+ };
24
+ export default AccordionList;
@@ -3,8 +3,7 @@ import { CardList } from './_abstract/CardList';
3
3
  import { useSeenEffect } from './utils/seenEffect';
4
4
  const ActionCards = (props) => {
5
5
  const [ref] = useSeenEffect(props.startSeen);
6
- return (<div className="ActionCards" ref={ref}>
7
- <CardList {...props} bemPrefix="ActionCards"/>
8
- </div>);
6
+ return (React.createElement("div", { className: "ActionCards", ref: ref },
7
+ React.createElement(CardList, Object.assign({}, props, { bemPrefix: "ActionCards" }))));
9
8
  };
10
9
  export default ActionCards;
@@ -79,16 +79,14 @@ const Alert = (props) => {
79
79
  };
80
80
  }
81
81
  }, [closeAlert, autoClosing, autoClose]);
82
- return (<div className={getBemClass('Alert', [
82
+ return (React.createElement("div", Object.assign({ className: getBemClass('Alert', [
83
83
  !!alertTypes[type] && type,
84
84
  closable && 'closable',
85
- ])} role="alert" hidden={!open || undefined} {...autoClosingProps}>
86
- {childrenHTML ? (<div dangerouslySetInnerHTML={{ __html: childrenHTML }}/>) : (children)}{' '}
87
- {showCloseButton && (<Button bem="Alert__close" {...(closeUrl != null ? { href: closeUrl } : { type: 'button' })} onClick={(e) => {
85
+ ]), role: "alert", hidden: !open || undefined }, autoClosingProps),
86
+ childrenHTML ? (React.createElement("div", { dangerouslySetInnerHTML: { __html: childrenHTML } })) : (children),
87
+ ' ',
88
+ showCloseButton && (React.createElement(Button, Object.assign({ bem: "Alert__close" }, (closeUrl != null ? { href: closeUrl } : { type: 'button' }), { onClick: (e) => {
88
89
  closeAlert(e);
89
- }} aria-label={closeLabelLong} title={closeLabelLong || closeLabel}>
90
- {closeLabel}
91
- </Button>)}
92
- </div>);
90
+ }, "aria-label": closeLabelLong, title: closeLabelLong || closeLabel }), closeLabel))));
93
91
  };
94
92
  export default Alert;
@@ -0,0 +1,24 @@
1
+ import React from 'react';
2
+ import getBemClass from '@hugsmidjan/react/utils/getBemClass';
3
+ import { getIllustrationUrl } from '@reykjavik/hanna-utils/assets';
4
+ import Image from '../_abstract/Image';
5
+ import { Link } from '../_abstract/Link';
6
+ import { colorFamilies, themeOptions } from '../constants';
7
+ export const ArticleCarouselCard = (props) => {
8
+ const { date, title, summary, href, moreLabel, color, theme, illustration, image } = props;
9
+ const photo = image === null || image === void 0 ? void 0 : image.photo;
10
+ const imageProps = illustration ? { src: getIllustrationUrl(illustration) } : image;
11
+ return (React.createElement("div", { className: "ArticleCarouselCard", "data-color": color && colorFamilies[color], "data-color-theme": !color ? theme && themeOptions[theme] : undefined },
12
+ React.createElement(Link, { className: "ArticleCarouselCard__link", href: href },
13
+ ' ',
14
+ React.createElement(Image, Object.assign({ placeholder: true, className: getBemClass('ArticleCarouselCard__illustration', photo && 'photo') }, imageProps)),
15
+ React.createElement("h3", { className: "ArticleCarouselCard__title" }, title),
16
+ ' '),
17
+ ' ',
18
+ date && React.createElement("span", { className: "ArticleCarouselCard__date" }, date),
19
+ React.createElement("div", { className: "ArticleCarouselCard__summary" }, summary),
20
+ moreLabel && (React.createElement(Link, { className: "ArticleCarouselCard__morelink", href: href, "aria-label": title },
21
+ ' ',
22
+ moreLabel,
23
+ ' '))));
24
+ };
@@ -3,6 +3,6 @@ import AbstractCarousel from './_abstract/_AbstractCarousel';
3
3
  import { ArticleCarouselCard, } from './ArticleCarousel/_ArticleCarouselCard';
4
4
  const ArticleCarousel = (props) => {
5
5
  const { title, items, moreLabel, ssr, startSeen } = props;
6
- return (<AbstractCarousel bem="ArticleCarousel" title={title} items={items} Component={ArticleCarouselCard} ComponentProps={{ moreLabel }} ssr={ssr} startSeen={startSeen}/>);
6
+ return (React.createElement(AbstractCarousel, { bem: "ArticleCarousel", title: title, items: items, Component: ArticleCarouselCard, ComponentProps: { moreLabel }, ssr: ssr, startSeen: startSeen }));
7
7
  };
8
8
  export default ArticleCarousel;
@@ -0,0 +1,18 @@
1
+ import React, { Fragment } from 'react';
2
+ import { Link } from './_abstract/Link';
3
+ const ArticleMeta = (props) => {
4
+ const { items } = props;
5
+ if (items.length === 0) {
6
+ return null;
7
+ }
8
+ return (React.createElement("div", { className: "ArticleMeta" }, items.map(({ label, href }, i) => (React.createElement(Fragment, { key: i },
9
+ href == null ? (React.createElement("span", { className: "ArticleMeta__item" },
10
+ " ",
11
+ label,
12
+ " ")) : (React.createElement(Link, { className: "ArticleMeta__item", href: href },
13
+ ' ',
14
+ label,
15
+ ' ')),
16
+ ' ')))));
17
+ };
18
+ export default ArticleMeta;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import getBemClass from '@hugsmidjan/react/utils/getBemClass';
3
+ const Attention = (props) => (React.createElement("div", { className: getBemClass('Attention', props.small && 'small') }, props.children));
4
+ export default Attention;
@@ -10,21 +10,20 @@ const BasicTable = (props) => {
10
10
  : { tbody: props.tbody || [] };
11
11
  const modifier = props.modifier;
12
12
  const [ref] = useSeenEffect(startSeen);
13
- return (<TableWrapper modifier={[
13
+ return (React.createElement(TableWrapper, { modifier: [
14
14
  'BasicTable',
15
15
  modifier && 'BasicTable--' + modifier,
16
16
  fullWidth && 'BasicTable--fullwidth',
17
17
  align === 'right' && !fullWidth && 'BasicTable--align--' + align,
18
- ]} wrapperRef={ref}>
19
- <Table className={getBemClass('BasicTable', [
20
- props.compact && 'compact',
21
- modifier && modifier,
22
- ])} {...{
23
- cols,
24
- caption,
25
- thead,
26
- tfoot,
27
- }} {...tbodyProps}/>
28
- </TableWrapper>);
18
+ ], wrapperRef: ref },
19
+ React.createElement(Table, Object.assign({ className: getBemClass('BasicTable', [
20
+ props.compact && 'compact',
21
+ modifier && modifier,
22
+ ]) }, {
23
+ cols,
24
+ caption,
25
+ thead,
26
+ tfoot,
27
+ }, tbodyProps))));
29
28
  };
30
29
  export default BasicTable;
@@ -33,12 +33,12 @@ const Bling = (props) => {
33
33
  const { align, vertical, color, overlay, type, blingUrl, parent, className } = props;
34
34
  const imageUrl = type ? getBlingUrl(type) : blingUrl;
35
35
  const inlineSvg = useGetSVGtext(imageUrl);
36
- return (<div className={getBemClass('Bling', [
36
+ return (React.createElement("div", { className: getBemClass('Bling', [
37
37
  'align--' + (align && align in aligns ? align : 'left'),
38
38
  vertical && vertical in valigns && 'vertical--' + vertical,
39
39
  color && color in colors && 'color--' + color,
40
40
  parent && parent in parentOffset && 'parent--' + parent,
41
41
  overlay && 'overlay',
42
- ], className)} data-bling-type={type} data-bling-image={!type ? blingUrl : undefined} dangerouslySetInnerHTML={inlineSvg && { __html: inlineSvg.code }}/>);
42
+ ], className), "data-bling-type": type, "data-bling-image": !type ? blingUrl : undefined, dangerouslySetInnerHTML: inlineSvg && { __html: inlineSvg.code } }));
43
43
  };
44
44
  export default Bling;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ /*
3
+ TODO: Add story
4
+ */
5
+ const BlockBreak = () => React.createElement("div", { className: "BlockBreak" });
6
+ export default BlockBreak;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { _Quote } from './_abstract/_Quote';
3
+ const BlockQuote = (props) => React.createElement(_Quote, Object.assign({ bem: "BlockQuote" }, props));
4
+ export default BlockQuote;
@@ -0,0 +1,28 @@
1
+ import React from 'react';
2
+ import { Link } from './_abstract/Link';
3
+ const BreadCrumbs__item = (props) => {
4
+ const { link, current } = props;
5
+ return link.href != null ? (React.createElement(Link, { className: "BreadCrumbs__item", href: link.href, "aria-current": current || undefined }, link.label)) : (React.createElement("span", { className: "BreadCrumbs__item", "aria-current": current || undefined }, link.label));
6
+ };
7
+ const BreadCrumbs = (props) => {
8
+ const { title, trail } = props;
9
+ if (trail.length === 0) {
10
+ return null;
11
+ }
12
+ const ancestors = trail.slice(0, -1);
13
+ const current = trail[trail.length - 1];
14
+ return (React.createElement("nav", { className: "BreadCrumbs", "aria-label": title },
15
+ React.createElement("span", { className: "BreadCrumbs__title" },
16
+ title,
17
+ ":"),
18
+ ' ',
19
+ ancestors.map((link, i) => {
20
+ return (React.createElement(React.Fragment, { key: i },
21
+ React.createElement(BreadCrumbs__item, { link: link }),
22
+ ' ',
23
+ React.createElement("span", { className: "BreadCrumbs__separator", "aria-label": "" }, ">"),
24
+ ' '));
25
+ }),
26
+ React.createElement(BreadCrumbs__item, { link: current, current: true })));
27
+ };
28
+ export default BreadCrumbs;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import Button from './_abstract/Button';
3
+ const ButtonBack = (props) => (React.createElement(Button, Object.assign({ bem: "ButtonBack" }, props)));
4
+ export default ButtonBack;
@@ -2,11 +2,9 @@ import React from 'react';
2
2
  import getBemClass from '@hugsmidjan/react/utils/getBemClass';
3
3
  export const ButtonBar = (props) => {
4
4
  const { align, children } = props;
5
- return (<div className={getBemClass('ButtonBar', align === 'right' && 'align--right')}>
6
- {children}
7
- </div>);
5
+ return (React.createElement("div", { className: getBemClass('ButtonBar', align === 'right' && 'align--right') }, children));
8
6
  };
9
- ButtonBar.Split = () => <span className="ButtonBar__split"/>;
7
+ ButtonBar.Split = () => React.createElement("span", { className: "ButtonBar__split" });
10
8
  /**
11
9
  * @deprecated Prefer using `ButtonBar.Split` instead.
12
10
  *
@@ -0,0 +1,4 @@
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;
@@ -0,0 +1,4 @@
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;
@@ -10,6 +10,6 @@ const icons = {
10
10
  };
11
11
  const ButtonTertiary = (props) => {
12
12
  const { size = 'normal', icon = 'none' } = props;
13
- return <Button bem="ButtonTertiary" {...props} size={sizes[size]} icon={icons[icon]}/>;
13
+ return React.createElement(Button, Object.assign({ bem: "ButtonTertiary" }, props, { size: sizes[size], icon: icons[icon] }));
14
14
  };
15
15
  export default ButtonTertiary;
@@ -0,0 +1,4 @@
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;
@@ -0,0 +1,4 @@
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;
@@ -0,0 +1,7 @@
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;
@@ -0,0 +1,4 @@
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,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import TogglerGroupField from './_abstract/TogglerGroupField';
3
3
  import TogglerInput from './_abstract/TogglerInput';
4
- const CheckboxButton = (props) => (<TogglerInput bem="CheckboxButton" {...props} type="checkbox"/>);
4
+ const CheckboxButton = (props) => (React.createElement(TogglerInput, Object.assign({ bem: "CheckboxButton" }, props, { type: "checkbox" })));
5
5
  const CheckboxButtonsGroup = (props) => {
6
6
  if (props.layout) {
7
7
  console.warn('`CheckboxButtonsGroupProps.layout` is deprecated.');
@@ -9,6 +9,6 @@ const CheckboxButtonsGroup = (props) => {
9
9
  if (props.columns) {
10
10
  console.warn('`CheckboxButtonsGroupProps.columns` is deprecated.');
11
11
  }
12
- return (<TogglerGroupField {...props} bem="CheckboxButtonsGroup" Toggler={CheckboxButton}/>);
12
+ return (React.createElement(TogglerGroupField, Object.assign({}, props, { bem: "CheckboxButtonsGroup", Toggler: CheckboxButton })));
13
13
  };
14
14
  export default CheckboxButtonsGroup;
@@ -2,6 +2,6 @@ import React from 'react';
2
2
  import TogglerGroupField from './_abstract/TogglerGroupField';
3
3
  import Checkbox from './Checkbox';
4
4
  const CheckboxGroup = (props) => {
5
- return (<TogglerGroupField {...props} bem="CheckboxGroup" modifier={props.layout} Toggler={Checkbox}/>);
5
+ return (React.createElement(TogglerGroupField, Object.assign({}, props, { bem: "CheckboxGroup", modifier: props.layout, Toggler: Checkbox })));
6
6
  };
7
7
  export default CheckboxGroup;
@@ -13,6 +13,6 @@ const CityBlock = (props) => {
13
13
  const imageProps = props.illustration != null
14
14
  ? { src: getIllustrationUrl(props.illustration) }
15
15
  : props.image;
16
- return (<Block bem="CityBlock" modifier={modifier} content={props.content} image={imageProps} startSeen={props.startSeen}/>);
16
+ return (React.createElement(Block, { bem: "CityBlock", modifier: modifier, content: props.content, image: imageProps, startSeen: props.startSeen }));
17
17
  };
18
18
  export default CityBlock;
@@ -116,10 +116,9 @@ const ContactBubble = (props) => {
116
116
  if (links.length === 0) {
117
117
  return null;
118
118
  }
119
- const menu = (<div className="ContactBubble" id={isBrowser && domid} hidden={isBrowser && !open} data-always-show={alwaysShow || undefined} data-sprinkled={isBrowser}>
120
- <h2 className="ContactBubble__title">{title || txt.openBtn}</h2>
121
- <ul className="ContactBubble__list">
122
- {links.map((linkInfo, i) => {
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) => {
123
122
  const { href, label, extraLabel, target, onClick } = linkInfo;
124
123
  const icon = ensureIcon(linkInfo.icon);
125
124
  const itemClass = getBemClass('ContactBubble__item', icon && 'type--' + icon);
@@ -134,29 +133,16 @@ const ContactBubble = (props) => {
134
133
  ' ',
135
134
  label,
136
135
  '\n',
137
- extraLabel && <small key="🤡">{extraLabel}</small>,
136
+ extraLabel && React.createElement("small", { key: "\uD83E\uDD21" }, extraLabel),
138
137
  '\n',
139
138
  ];
140
- return (<li key={i} className={itemClass}>
141
- {href && href !== '#' ? (<Link className="ContactBubble__link" href={href} onClick={onClickHandler} target={target}>
142
- {content}
143
- </Link>) : (<button className="ContactBubble__link" onClick={onClickHandler} type="button">
144
- {content}
145
- </button>)}
146
- </li>);
147
- })}
148
- </ul>
149
- {'\n\n'}
150
- {isBrowser && (<button className="ContactBubble__closebtn" aria-controls={domid} aria-label={txt.closeBtnLong} onClick={() => closeBubble()} type="button">
151
- {txt.closeBtn}
152
- </button>)}
153
- </div>);
154
- return isBrowser ? (<div className="ContactBubble__wrapper" ref={wrapperRef}>
155
- <button className="ContactBubble__openbtn" aria-controls={domid} aria-expanded={open} aria-label={txt.openBtnLong} onClick={open ? () => closeBubble() : openBubble} type="button">
156
- {txt.openBtn}
157
- </button>
158
- {'\n\n'}
159
- {menu}
160
- </div>) : (menu);
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);
161
147
  };
162
148
  export default ContactBubble;
@@ -0,0 +1,21 @@
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;
@@ -0,0 +1,18 @@
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;
@@ -38,27 +38,26 @@ const Datepicker = (props) => {
38
38
  const txts = (localeCode && i18n[localeCode]) || {};
39
39
  const filled = !!value;
40
40
  const empty = !filled && !placeholder;
41
- return (<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 (<div className={className.input} ref={inputRef &&
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
43
  ((elm) => {
44
44
  inputRef.current =
45
45
  (elm === null || elm === void 0 ? void 0 : elm.querySelector('input')) || undefined;
46
46
  return elm;
47
- })}>
48
- <ReactDatePicker 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 scrollableYearDropdown yearDropdownItemNumber={15} showMonthDropdown {...inputProps} {...txts} {...addFocusProps(datepickerExtraProps)}/>
61
- </div>);
62
- }}/>);
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
+ } }));
63
62
  };
64
63
  export default Datepicker;
@@ -16,27 +16,19 @@ import { Link } from './_abstract/Link';
16
16
  import { useSeenEffect } from './utils/seenEffect';
17
17
  const ExtraLinks__related = (props) => {
18
18
  const { relatedTitle, relatedLinks } = props;
19
- return (<div className="ExtraLinks__related">
20
- {relatedTitle && <h3 className="ExtraLinks__related__title">{relatedTitle}</h3>}
21
- <ul className="ExtraLinks__related__list">
22
- {relatedLinks &&
23
- relatedLinks.map(({ href, label, blank = false, type }, i) => (<li className="ExtraLinks__related__item" key={i}>
24
- <Link className={getBemClass('ExtraLinks__related__link', type)} href={href} target={blank ? '_blank' : ''} rel={blank ? 'noreferrer noopener' : ''}>
25
- {label}
26
- </Link>
27
- </li>))}
28
- </ul>
29
- </div>);
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)))))));
30
24
  };
31
25
  const ExtraLinks = (props) => {
32
26
  const { relatedTitle, relatedLinks, className, startSeen } = props, cardListProps = __rest(props, ["relatedTitle", "relatedLinks", "className", "startSeen"]);
33
27
  const hasRelated = !!(relatedLinks && relatedLinks.length);
34
28
  const [ref] = useSeenEffect(startSeen);
35
- return (<div className={getBemClass('ExtraLinks', hasRelated && 'related', className)} ref={ref}>
36
- <div className="ExtraLinks__main">
37
- <CardList {...cardListProps} bemPrefix="ExtraLinks"/>
38
- </div>
39
- {hasRelated && (<ExtraLinks__related relatedTitle={relatedTitle} relatedLinks={relatedLinks}/>)}
40
- </div>);
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 }))));
41
33
  };
42
34
  export default ExtraLinks;