@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
@@ -28,10 +28,6 @@ const SiteSearchCurtain = (props) => {
28
28
  }, 100);
29
29
  }
30
30
  };
31
- return (<div className={getBemClass('SiteSearchCurtain', [focused && 'focused'])} onFocus={focusHandler} onBlur={blurHandler}
32
- // (Sneak this in as Preact does not bubble `FocusEvent`s)
33
- {...(isPreact && { onfocusin: focusHandler, onfocusout: blurHandler })}>
34
- {props.children}
35
- </div>);
31
+ return (React.createElement("div", Object.assign({ className: getBemClass('SiteSearchCurtain', [focused && 'focused']), onFocus: focusHandler, onBlur: blurHandler }, (isPreact && { onfocusin: focusHandler, onfocusout: blurHandler })), props.children));
36
32
  };
37
33
  export default SiteSearchCurtain;
@@ -25,18 +25,16 @@ const SiteSearchInput = React.forwardRef((props, ref) => {
25
25
  setHasValue(!!e.target.value);
26
26
  onChange && onChange(e);
27
27
  };
28
- return (<FormField className="SiteSearchInput" ssr={ssr} label={label} empty={empty} filled={filled} id={id} renderInput={(className, inputProps, addFocusProps) => (<div className={className.input} {...addFocusProps()}>
29
- <input className="SiteSearchInput__input" onChange={_onChange} {...inputProps} placeholder={placeholder} onKeyDown={onSubmit
30
- ? (e) => {
31
- if (e.key === 'Enter' && onSubmit() !== true) {
32
- e.preventDefault();
28
+ return (React.createElement(FormField, { className: "SiteSearchInput", ssr: ssr, label: label, empty: empty, filled: filled, id: id, renderInput: (className, inputProps, addFocusProps) => (React.createElement("div", Object.assign({ className: className.input }, addFocusProps()),
29
+ React.createElement("input", Object.assign({ className: "SiteSearchInput__input", onChange: _onChange }, inputProps, { placeholder: placeholder, onKeyDown: onSubmit
30
+ ? (e) => {
31
+ if (e.key === 'Enter' && onSubmit() !== true) {
32
+ e.preventDefault();
33
+ }
34
+ onKeyDown && onKeyDown(e);
33
35
  }
34
- onKeyDown && onKeyDown(e);
35
- }
36
- : onKeyDown} {...inputElementProps} ref={ref}/>{' '}
37
- <button className="SiteSearchInput__button" type="submit" onClick={onButtonClick && ((e) => !onButtonClick() && e.preventDefault())} title={buttonText}>
38
- {buttonText}
39
- </button>
40
- </div>)}/>);
36
+ : onKeyDown }, inputElementProps, { ref: ref })),
37
+ ' ',
38
+ React.createElement("button", { className: "SiteSearchInput__button", type: "submit", onClick: onButtonClick && ((e) => !onButtonClick() && e.preventDefault()), title: buttonText }, buttonText))) }));
41
39
  });
42
40
  export default SiteSearchInput;
@@ -1,11 +1,11 @@
1
1
  import React from 'react';
2
2
  import range from '@hugsmidjan/qj/range';
3
3
  import getBemClass from '@hugsmidjan/react/utils/getBemClass';
4
- const makeRenderSkeleton = (props) => (key) => (<span key={key} className={getBemClass('Skeleton', [
4
+ const makeRenderSkeleton = (props) => (key) => (React.createElement("span", { key: key, className: getBemClass('Skeleton', [
5
5
  props.text && 'text',
6
6
  props.height && 'height--' + props.height,
7
7
  props.gap && 'gap--' + props.gap,
8
- ])}/>);
8
+ ]) }));
9
9
  const minmax = (num = 0, max = 100, min = 1) => {
10
10
  num = Math.min(Math.max(Math.round(num), min), max);
11
11
  return num > min ? num : undefined;
@@ -19,12 +19,12 @@ const Skeleton = (props) => {
19
19
  });
20
20
  const items = minmax(props.items, 20) || 1;
21
21
  if (items > 1) {
22
- return <>{range(1, items).map(renderSkeleton)}</>;
22
+ return React.createElement(React.Fragment, null, range(1, items).map(renderSkeleton));
23
23
  }
24
24
  return renderSkeleton();
25
25
  };
26
26
  export default Skeleton;
27
27
  /** Returns a single `<Skeleton height={X}/>` element of branded type `SkeletonBlock` */
28
- Skeleton.block = (height) => (<Skeleton height={height}/>);
28
+ Skeleton.block = (height) => (React.createElement(Skeleton, { height: height }));
29
29
  /** Returns a single `<Skeleton text height={X}/>` element of branded type `SkeletonText` */
30
- Skeleton.text = (height) => (<Skeleton text height={height}/>);
30
+ Skeleton.text = (height) => (React.createElement(Skeleton, { text: true, height: height }));
@@ -4,12 +4,10 @@ import { useSeenEffect } from './utils/seenEffect';
4
4
  const SubHeading = (props) => {
5
5
  const { small, Tag = 'h2', children, align, wide, startSeen } = props;
6
6
  const [ref] = useSeenEffect(startSeen);
7
- return (<Tag className={getBemClass('SubHeading', [
7
+ return (React.createElement(Tag, { className: getBemClass('SubHeading', [
8
8
  small && 'small',
9
9
  align === 'right' && 'align--' + align,
10
10
  !align && wide && 'wide',
11
- ])} ref={ref}>
12
- {children}
13
- </Tag>);
11
+ ]), ref: ref }, children));
14
12
  };
15
13
  export default SubHeading;
@@ -32,10 +32,13 @@ const renderTab = (tabProps, index, listProps) => {
32
32
  }
33
33
  : { href };
34
34
  return [
35
- <Tag key={index} className="Tabs__tab" data-active={isActive} {...tagProps} onClick={handleClick} onFocus={handleFocus} aria-label={longLabel} title={longLabel} // make custom aria-labels visible
36
- >
37
- {label} {badge != null && <small className="Tabs__tab__badge">({badge})</small>}
38
- </Tag>,
35
+ React.createElement(Tag, Object.assign({ key: index, className: "Tabs__tab", "data-active": isActive }, tagProps, { onClick: handleClick, onFocus: handleFocus, "aria-label": longLabel, title: longLabel }),
36
+ label,
37
+ " ",
38
+ badge != null && React.createElement("small", { className: "Tabs__tab__badge" },
39
+ "(",
40
+ badge,
41
+ ")")),
39
42
  ' ',
40
43
  ];
41
44
  };
@@ -82,13 +85,10 @@ const Tabs = (props) => {
82
85
  listAriaControls,
83
86
  isBrowser,
84
87
  };
85
- return (<div className={getBemClass('Tabs', vertical && 'vertical')} role={tabRole && role} id={id}
86
- // aria-owns={tabIdList.join(' ')}
87
- aria-label={ariaLabel} aria-labelledby={ariaLabelledBy} onKeyDown={handleKeydown} data-sprinkled={isBrowser} ref={ref}>
88
- {tabs.map((tabProps, index) => renderTab(tabProps, index, listProps))}
89
- {subTabs && (<Tabs {...subTabs} role={'role' in subTabs ? subTabs.role : role} activateOnFocus={(_a = subTabs.activateOnFocus) !== null && _a !== void 0 ? _a : activateOnFocus} ssr={(_b = subTabs.ssr) !== null && _b !== void 0 ? _b : ssr} startSeen
90
- // just to be sure
91
- vertical={undefined} subTabs={undefined}/>)}
92
- </div>);
88
+ return (React.createElement("div", { className: getBemClass('Tabs', vertical && 'vertical'), role: tabRole && role, id: id, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, onKeyDown: handleKeydown, "data-sprinkled": isBrowser, ref: ref },
89
+ tabs.map((tabProps, index) => renderTab(tabProps, index, listProps)),
90
+ subTabs && (React.createElement(Tabs, Object.assign({}, subTabs, { role: 'role' in subTabs ? subTabs.role : role, activateOnFocus: (_a = subTabs.activateOnFocus) !== null && _a !== void 0 ? _a : activateOnFocus, ssr: (_b = subTabs.ssr) !== null && _b !== void 0 ? _b : ssr, startSeen: true,
91
+ // just to be sure
92
+ vertical: undefined, subTabs: undefined })))));
93
93
  };
94
94
  export default Tabs;
@@ -28,21 +28,16 @@ const TagPill = (props) => {
28
28
  !onRemove &&
29
29
  console.warn('static (non-button) `TagPill`s must not be removable');
30
30
  const modifiers = [modifier, large && 'large', colors[color]];
31
- const removeBtn = removable && (<button className="TagPill__remove" onClick={onRemove && (() => onRemove())} aria-label={removeLabelLong} type="button">
32
- {removeLabel}
33
- </button>);
34
- return isStatic ? (<span className={getBemClass('TagPill', modifiers)}>
35
- {label} {removeBtn}
36
- </span>) : onRemove ? (<span className={getBemClass('TagPill', modifiers)}>
37
- <Button bem="TagPill__button" {...buttonProps}>
38
- {label}
39
- </Button>{' '}
40
- {removeBtn}
41
- </span>) : (<Button bem="TagPill" {...buttonProps} modifier={modifiers}>
42
- {label}{' '}
43
- {removable && (<span className="TagPill__remove" aria-label={removeLabelLong}>
44
- {removeLabel}
45
- </span>)}
46
- </Button>);
31
+ const removeBtn = removable && (React.createElement("button", { className: "TagPill__remove", onClick: onRemove && (() => onRemove()), "aria-label": removeLabelLong, type: "button" }, removeLabel));
32
+ return isStatic ? (React.createElement("span", { className: getBemClass('TagPill', modifiers) },
33
+ label,
34
+ " ",
35
+ removeBtn)) : onRemove ? (React.createElement("span", { className: getBemClass('TagPill', modifiers) },
36
+ React.createElement(Button, Object.assign({ bem: "TagPill__button" }, buttonProps), label),
37
+ ' ',
38
+ removeBtn)) : (React.createElement(Button, Object.assign({ bem: "TagPill" }, buttonProps, { modifier: modifiers }),
39
+ label,
40
+ ' ',
41
+ removable && (React.createElement("span", { className: "TagPill__remove", "aria-label": removeLabelLong }, removeLabel))));
47
42
  };
48
43
  export default TagPill;
@@ -5,13 +5,11 @@ const TextBlock = (props) => {
5
5
  const { children, align, labelled, wide, small, startSeen } = props;
6
6
  const rightAligned = align === 'right' || labelled;
7
7
  const [ref] = useSeenEffect(startSeen);
8
- return (<div className={getBemClass('TextBlock', [
8
+ return (React.createElement("div", { className: getBemClass('TextBlock', [
9
9
  labelled && 'labelled',
10
10
  rightAligned && 'align--right',
11
11
  wide && !rightAligned && 'wide',
12
12
  small && !labelled && 'small',
13
- ])} ref={ref}>
14
- {children}
15
- </div>);
13
+ ]), ref: ref }, children));
16
14
  };
17
15
  export default TextBlock;
@@ -4,6 +4,6 @@ const TextButton = (props) => {
4
4
  if ('disabled' in props) {
5
5
  props = Object.assign(Object.assign({}, props), { disabled: undefined });
6
6
  }
7
- return <Button bem="TextButton" {...props}/>;
7
+ return React.createElement(Button, Object.assign({ bem: "TextButton" }, props));
8
8
  };
9
9
  export default TextButton;
@@ -30,6 +30,6 @@ const TextInput = (props) => {
30
30
  // TypeScript is silly sometimes.
31
31
  e);
32
32
  };
33
- return (<FormField className={getBemClass('TextInput', modifiers, className)} ssr={ssr} small={small} label={label} empty={empty} filled={filled} assistText={assistText} hideLabel={hideLabel} disabled={disabled} readOnly={readOnly} invalid={invalid} errorMessage={errorMessage} required={required} reqText={reqText} id={id} renderInput={(className, inputProps, addFocusProps) => multiline ? (<textarea className={className.input} onChange={_onChange} {...inputProps} {...addFocusProps(inputElementProps)} ref={inputRef}/>) : (<input className={className.input} onChange={_onChange} type={type} {...inputProps} {...addFocusProps(inputElementProps)} ref={inputRef}/>)}/>);
33
+ return (React.createElement(FormField, { className: getBemClass('TextInput', modifiers, className), ssr: ssr, small: small, label: label, empty: empty, filled: filled, assistText: assistText, hideLabel: hideLabel, disabled: disabled, readOnly: readOnly, invalid: invalid, errorMessage: errorMessage, required: required, reqText: reqText, id: id, renderInput: (className, inputProps, addFocusProps) => multiline ? (React.createElement("textarea", Object.assign({ className: className.input, onChange: _onChange }, inputProps, addFocusProps(inputElementProps), { ref: inputRef }))) : (React.createElement("input", Object.assign({ className: className.input, onChange: _onChange, type: type }, inputProps, addFocusProps(inputElementProps), { ref: inputRef }))) }));
34
34
  };
35
35
  export default TextInput;
@@ -36,6 +36,6 @@ const VSpacer = (props) => {
36
36
  topVal && 'top--' + topVal,
37
37
  bottomVal && 'bottom--' + bottomVal,
38
38
  ]);
39
- return isWrapper ? (<div className={className}>{children}</div>) : (<hr className={className}/>);
39
+ return isWrapper ? (React.createElement("div", { className: className }, children)) : (React.createElement("hr", { className: className }));
40
40
  };
41
41
  export default VSpacer;
@@ -58,11 +58,11 @@ const VerticalTabsTOC = (props) => {
58
58
  window.addEventListener('hashchange', handleHash);
59
59
  return () => window.removeEventListener('hashchange', handleHash);
60
60
  }, [itemsById, onItemSelect]);
61
- return (<Tabs id={domid} vertical aria-label={props['aria-label']} onSetActive={(_, item) => {
61
+ return (React.createElement(Tabs, { id: domid, vertical: true, "aria-label": props['aria-label'], onSetActive: (_, item) => {
62
62
  var _a;
63
63
  const itemId = getItemId(item);
64
64
  const newId = itemId || getItemId((_a = itemsById[itemId].subTabs) === null || _a === void 0 ? void 0 : _a.tabs[0]);
65
65
  setFrag(newId);
66
- }} tabs={updatedItems} role="tablist" activeIdx={state.activeIdx} subTabs={state.subTabs}/>);
66
+ }, tabs: updatedItems, role: "tablist", activeIdx: state.activeIdx, subTabs: state.subTabs }));
67
67
  };
68
68
  export default VerticalTabsTOC;
@@ -0,0 +1,30 @@
1
+ import React from 'react';
2
+ import { useIsBrowserSide } from '@hugsmidjan/react/hooks';
3
+ import { getAssetUrl } from '@reykjavik/hanna-utils/assets';
4
+ import Image from './_abstract/Image';
5
+ import { Link } from './_abstract/Link';
6
+ import { useScrollbarWidthCSSVar } from './utils/useScrollbarWidthCSSVar';
7
+ const WizardLayout = (props) => {
8
+ useScrollbarWidthCSSVar();
9
+ const {
10
+ // ssr,
11
+ wizardStepper, wizardFooter, children, colorTheme, logoLink = '/', siteName = 'Reykjavík', globalAlerts, } = props;
12
+ const isBrowser = useIsBrowserSide( /* ssr */);
13
+ return (React.createElement("div", { className: "WizardLayout", "data-sprinkled": isBrowser, "data-color-theme": colorTheme },
14
+ globalAlerts && (React.createElement("div", { className: "WizardLayout__alerts", role: "alert" }, globalAlerts)),
15
+ React.createElement("div", { className: "WizardLayout__content" },
16
+ React.createElement("div", { className: "WizardLayout__header", role: "banner" },
17
+ React.createElement(Link, { className: "WizardLayout__header__logo", href: logoLink },
18
+ ' ',
19
+ React.createElement(Image, { inline: true, src: getAssetUrl('reykjavik-logo.svg') }),
20
+ " ",
21
+ siteName,
22
+ ' '),
23
+ ' '),
24
+ React.createElement("div", { className: "WizardLayout__wrap" },
25
+ wizardStepper && (React.createElement("div", { className: "WizardLayout__stepper", role: "navigation" }, wizardStepper)),
26
+ React.createElement("div", { className: "WizardLayout__main", role: "main" }, children),
27
+ React.createElement("div", { className: "WizardLayout__deco WizardLayout__deco--geometry" })),
28
+ React.createElement("div", { className: "WizardLayout__footer", role: "complementary" }, wizardFooter))));
29
+ };
30
+ export default WizardLayout;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import Button from './_abstract/Button';
3
+ const WizardLayoutClose = (props) => (React.createElement(Button, Object.assign({ bem: "WizardLayoutClose" }, props)));
4
+ export default WizardLayoutClose;
@@ -0,0 +1,25 @@
1
+ import React from 'react';
2
+ import getBemClass from '@hugsmidjan/react/utils/getBemClass';
3
+ const WizardStepper = (props) => {
4
+ const { steps, activeStep = -1, allowForwardSkip, disableBacktrack, onClick } = props;
5
+ return (React.createElement("div", { className: getBemClass('WizardStepper', activeStep === -1 && 'preview') }, steps.map((step, i) => {
6
+ const { label, clickable, done, neutral } = step;
7
+ const stepClass = getBemClass('WizardStepper__step', [
8
+ (done || (done == null && i < activeStep)) && 'done',
9
+ neutral && 'neutral',
10
+ ]);
11
+ const isClickable = clickable === 'always' ||
12
+ (clickable &&
13
+ (activeStep === i ||
14
+ (i > activeStep && allowForwardSkip) ||
15
+ (i < activeStep && !disableBacktrack)));
16
+ const ariaCurrent = activeStep === i ? 'step' : undefined;
17
+ return (React.createElement(React.Fragment, { key: i },
18
+ isClickable ? (React.createElement("button", { type: "button", className: stepClass, onClick: () => onClick(i), "aria-current": ariaCurrent }, label)) : (React.createElement("span", { className: stepClass, "aria-current": ariaCurrent },
19
+ ' ',
20
+ label,
21
+ ' ')),
22
+ ' '));
23
+ })));
24
+ };
25
+ export default WizardStepper;
@@ -38,14 +38,10 @@ const Button = (props) => {
38
38
  getBemClass(bem, [modifier, variants[variant], sizes[size], navigationFlags[icon]]);
39
39
  const iconProp = icons[icon] && { 'data-icon': icons[icon] };
40
40
  if (buttonProps.href != null) {
41
- return (<Link className={className} {...buttonProps} style={undefined} {...iconProp}>
42
- {label}
43
- </Link>);
41
+ return (React.createElement(Link, Object.assign({ className: className }, buttonProps, { style: undefined }, iconProp), label));
44
42
  }
45
43
  else {
46
- return (<button className={className} type="button" {...buttonProps} style={undefined} {...iconProp}>
47
- {label}
48
- </button>);
44
+ return (React.createElement("button", Object.assign({ className: className, type: "button" }, buttonProps, { style: undefined }, iconProp), label));
49
45
  }
50
46
  };
51
47
  export default Button;
@@ -0,0 +1,36 @@
1
+ import React from 'react';
2
+ import Button from './Button';
3
+ import Image from './Image';
4
+ const Card = (props) => {
5
+ const { bem, href, title, imgPlaceholder } = props;
6
+ const cardClass = `${bem}__card`;
7
+ const image = 'image' in props && props.image;
8
+ const meta = 'meta' in props && props.meta;
9
+ const summary = 'summary' in props && props.summary;
10
+ return (React.createElement(React.Fragment, null,
11
+ React.createElement(Button, { bem: cardClass, href: href },
12
+ ' ',
13
+ React.createElement(Image, Object.assign({ className: `${bem}__image` }, image, { placeholder: imgPlaceholder })),
14
+ React.createElement("span", { className: `${cardClass}__title` }, title),
15
+ ' ',
16
+ meta && React.createElement("span", { className: `${cardClass}__meta` }, meta),
17
+ ' ',
18
+ summary && React.createElement("span", { className: `${cardClass}__summary` }, summary),
19
+ ' '),
20
+ ' '));
21
+ };
22
+ export const CardList = (props) => {
23
+ const { bemPrefix, title, summaryElement, cards, titleTag = 'h2', children, imgPlaceholder, } = props;
24
+ const TitleTag = titleTag;
25
+ const fallbackImage = (imgPlaceholder !== true && imgPlaceholder) || undefined;
26
+ const fallbackImageStyle = fallbackImage
27
+ ? { '--ImageCards--fallback': `url("${fallbackImage}")` }
28
+ : undefined;
29
+ return (React.createElement(React.Fragment, null,
30
+ summaryElement ? (React.createElement("div", { className: bemPrefix + '__summary' },
31
+ title && React.createElement(TitleTag, { className: bemPrefix + '__title' }, title),
32
+ summaryElement)) : (title && React.createElement(TitleTag, { className: bemPrefix + '__title' }, title)),
33
+ React.createElement("ul", { className: bemPrefix + '__list', style: fallbackImageStyle }, cards.map((card, i) => (React.createElement("li", { key: i, className: bemPrefix + '__item' },
34
+ React.createElement(Card, Object.assign({}, card, { bem: bemPrefix, imgPlaceholder: !!imgPlaceholder })))))),
35
+ children));
36
+ };
@@ -9,21 +9,19 @@ const Image = (props) => {
9
9
  const imgLoading = preloadSrc ? 'eager' : 'lazy';
10
10
  const inlineSvg = useGetSVGtext(inline ? imageSrc : undefined);
11
11
  if (!imageSrc) {
12
- return placeholder ? (<span className={className && getBemClass(className, 'missing')}>
13
- {placeholder !== true && placeholder()}
14
- </span>) : null;
12
+ return placeholder ? (React.createElement("span", { className: className && getBemClass(className, 'missing') }, placeholder !== true && placeholder())) : null;
15
13
  }
16
14
  if (inline && inlineSvg) {
17
15
  const __html = inlineSvg.imageSrc === imageSrc ? inlineSvg.code : '';
18
- return <span className={className} dangerouslySetInnerHTML={{ __html }}/>;
16
+ return React.createElement("span", { className: className, dangerouslySetInnerHTML: { __html } });
19
17
  }
20
- return (<picture className={className}>
21
- {' '}
22
- {sources.map((source, i) => (<>
23
- <source key={i} srcSet={source.srcset} media={source.media}/>{' '}
24
- </>))}{' '}
25
- <img src={imageSrc} alt={altText} loading={imgLoading}/>
26
- {' '}
27
- </picture>);
18
+ return (React.createElement("picture", { className: className },
19
+ ' ',
20
+ sources.map((source, i) => (React.createElement(React.Fragment, null,
21
+ React.createElement("source", { key: i, srcSet: source.srcset, media: source.media }),
22
+ ' '))),
23
+ ' ',
24
+ React.createElement("img", { src: imageSrc, alt: altText, loading: imgLoading }),
25
+ ' '));
28
26
  };
29
27
  export default Image;
File without changes
@@ -0,0 +1,29 @@
1
+ import React from 'react';
2
+ import getBemClass from '@hugsmidjan/react/utils/getBemClass';
3
+ const TogglerGroup = (props) => {
4
+ const {
5
+ // id,
6
+ className, bem, name, disabled, Toggler, onSelected, options, inputProps = {}, } = props;
7
+ const values = props.value || [];
8
+ return (React.createElement("ul", { className: getBemClass(bem, null, className), role: "group", "aria-labelledby": props['aria-labelledby'], "aria-describedby": props['aria-describedby'], "aria-required": props.required }, options.map((option, i) => {
9
+ const isDisabled = option.disabled != null
10
+ ? option.disabled
11
+ : disabled && typeof disabled !== 'boolean'
12
+ ? disabled.includes(i)
13
+ : disabled;
14
+ const isChecked = values.includes(option.value);
15
+ return (React.createElement(Toggler, Object.assign({ key: i }, inputProps, { className: bem + '__item', name: name, Wrapper: "li" }, option, { label: option.label || option.value, onChange: onSelected
16
+ ? (e) => {
17
+ const { value } = option;
18
+ const checked = e.currentTarget.checked;
19
+ inputProps.onChange && inputProps.onChange(e);
20
+ const selectedValues = values.filter((val) => val !== value);
21
+ if (checked) {
22
+ selectedValues.push(value);
23
+ }
24
+ onSelected({ value, checked, option, selectedValues });
25
+ }
26
+ : inputProps.onChange, disabled: isDisabled, "aria-invalid": props['aria-invalid'], checked: isChecked })));
27
+ })));
28
+ };
29
+ export default TogglerGroup;
@@ -15,8 +15,8 @@ import FormField from '../FormField';
15
15
  import TogglerGroup from './TogglerGroup';
16
16
  const TogglerGroupField = (props) => {
17
17
  const { bem, Toggler, className, modifier, label, LabelTag, assistText, hideLabel, disabled, readOnly, invalid, errorMessage, required, reqText, id, value } = props, togglerGroupProps = __rest(props, ["bem", "Toggler", "className", "modifier", "label", "LabelTag", "assistText", "hideLabel", "disabled", "readOnly", "invalid", "errorMessage", "required", "reqText", "id", "value"]);
18
- return (<FormField className={getBemClass(bem, modifier, className)} group label={label} LabelTag={LabelTag} assistText={assistText} hideLabel={hideLabel} disabled={disabled} readOnly={readOnly} invalid={invalid} errorMessage={errorMessage} required={required} reqText={reqText} id={id} renderInput={(className, inputProps) => {
19
- return (<TogglerGroup bem={className.options} {...inputProps} {...togglerGroupProps} value={Array.isArray(value) ? value : value != null ? [value] : undefined} Toggler={Toggler}/>);
20
- }}/>);
18
+ return (React.createElement(FormField, { className: getBemClass(bem, modifier, className), group: true, label: label, LabelTag: LabelTag, assistText: assistText, hideLabel: hideLabel, disabled: disabled, readOnly: readOnly, invalid: invalid, errorMessage: errorMessage, required: required, reqText: reqText, id: id, renderInput: (className, inputProps) => {
19
+ return (React.createElement(TogglerGroup, Object.assign({ bem: className.options }, inputProps, togglerGroupProps, { value: Array.isArray(value) ? value : value != null ? [value] : undefined, Toggler: Toggler })));
20
+ } }));
21
21
  };
22
22
  export default TogglerGroupField;
@@ -16,20 +16,18 @@ const TogglerInput = (props) => {
16
16
  const { bem, modifier, className, label, invalid, errorMessage, Wrapper = 'div', required, reqText, type, id } = props, inputProps = __rest(props, ["bem", "modifier", "className", "label", "invalid", "errorMessage", "Wrapper", "required", "reqText", "type", "id"]);
17
17
  const domid = useDomid(id);
18
18
  const errorId = errorMessage && 'error' + domid;
19
- const reqStar = required && reqText !== false && (<abbr className={bem + '__label__reqstar'}
20
- // TODO: add mo-better i18n thinking
21
- title={(reqText || 'Þarf að haka í') + ': '}>
22
- *
23
- </abbr>);
24
- return (<Wrapper className={getBemClass(bem, modifier, className)}>
25
- <input className={bem + '__input'} type={type} id={domid} aria-invalid={invalid || !!errorMessage || undefined} aria-describedby={errorId} {...inputProps}/>{' '}
26
- <label className={bem + '__label'} htmlFor={domid}>
27
- {' '}
28
- {reqStar} {label}{' '}
29
- </label>
30
- {errorMessage && (<div className={bem + '__error'} id={errorId}>
31
- {errorMessage}
32
- </div>)}
33
- </Wrapper>);
19
+ const reqStar = required && reqText !== false && (React.createElement("abbr", { className: bem + '__label__reqstar',
20
+ // TODO: add mo-better i18n thinking
21
+ title: (reqText || 'Þarf að haka í') + ': ' }, "*"));
22
+ return (React.createElement(Wrapper, { className: getBemClass(bem, modifier, className) },
23
+ React.createElement("input", Object.assign({ className: bem + '__input', type: type, id: domid, "aria-invalid": invalid || !!errorMessage || undefined, "aria-describedby": errorId }, inputProps)),
24
+ ' ',
25
+ React.createElement("label", { className: bem + '__label', htmlFor: domid },
26
+ ' ',
27
+ reqStar,
28
+ " ",
29
+ label,
30
+ ' '),
31
+ errorMessage && (React.createElement("div", { className: bem + '__error', id: errorId }, errorMessage))));
34
32
  };
35
33
  export default TogglerInput;
@@ -117,17 +117,14 @@ const AbstractCarousel = (props) => {
117
117
  if (!itemCount) {
118
118
  return null;
119
119
  }
120
- return (<div className={getBemClass(bem, modifier, props.className)} ref={outerRef} data-sprinkled={isBrowser}>
121
- {title && <h2 className={bem + '__title'}>{title}</h2>}
122
- <div className={bem + '__itemlist'} style={leftOffset
123
- ? { '--Carousel--leftOffset': `${leftOffset}px` }
124
- : undefined} data-scroll-snapping={leftOffset ? 'true' : undefined} onMouseLeave={handleMouseLeave} ref={listRef}>
125
- {children ||
120
+ return (React.createElement("div", { className: getBemClass(bem, modifier, props.className), ref: outerRef, "data-sprinkled": isBrowser },
121
+ title && React.createElement("h2", { className: bem + '__title' }, title),
122
+ React.createElement("div", { className: bem + '__itemlist', style: leftOffset
123
+ ? { '--Carousel--leftOffset': `${leftOffset}px` }
124
+ : undefined, "data-scroll-snapping": leftOffset ? 'true' : undefined, onMouseLeave: handleMouseLeave, ref: listRef }, children ||
126
125
  items.map((item, i) => (
127
126
  // @ts-expect-error (Can't be arsed...)
128
- <Component key={i} {...ComponentProps} {...item}/>))}
129
- </div>
130
- {isBrowser && (<CarouselStepper itemCount={itemCount} setCurrent={scrollToItem} current={activeItem}/>)}
131
- </div>);
127
+ React.createElement(Component, Object.assign({ key: i }, ComponentProps, item))))),
128
+ isBrowser && (React.createElement(CarouselStepper, { itemCount: itemCount, setCurrent: scrollToItem, current: activeItem }))));
132
129
  };
133
130
  export default AbstractCarousel;
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import Bling from '../Bling';
3
+ const inverseAlignments = {
4
+ left: 'right',
5
+ 'left-ish': 'right-ish',
6
+ 'left-center': 'right-center',
7
+ 'right-center': 'left-center',
8
+ 'right-ish': 'left-ish',
9
+ right: 'left',
10
+ };
11
+ const Blings = (props) => (React.createElement(React.Fragment, null, props.blings.map(({ type, align, vertical, color, overlay, parent }, i) => (React.createElement(Bling, { key: type + '-' + i, type: type, align: props.mirror ? inverseAlignments[align || 'left'] : align, vertical: vertical, color: color, overlay: overlay, parent: parent })))));
12
+ export default Blings;
@@ -0,0 +1,24 @@
1
+ import React from 'react';
2
+ import getBemClass from '@hugsmidjan/react/utils/getBemClass';
3
+ import { useSeenEffect } from '../utils/seenEffect';
4
+ import Button from './Button';
5
+ import Image from './Image';
6
+ const Block = (props) => {
7
+ const { image, modifier, bem, content, startSeen } = props;
8
+ const [ref] = useSeenEffect(startSeen);
9
+ const contentItems = Array.isArray(content) ? content : [content];
10
+ return (React.createElement("div", { className: getBemClass(bem, modifier), ref: ref },
11
+ contentItems.map(({ title, summary, buttons = [] }, i) => {
12
+ const hasSummary = summary && (typeof summary !== 'string' || !!summary.trim());
13
+ return (React.createElement("div", { key: i, className: `${bem}__content` },
14
+ React.createElement("h2", { className: `${bem}__title` }, title),
15
+ hasSummary && React.createElement("div", { className: `${bem}__summary` }, summary),
16
+ buttons.length > 0 && (React.createElement("div", { className: `${bem}__buttons` },
17
+ ' ',
18
+ buttons.map((buttonProps, i) => (React.createElement(React.Fragment, null,
19
+ React.createElement(Button, Object.assign({ bem: `${bem}__button`, key: i }, buttonProps)),
20
+ ' ')))))));
21
+ }),
22
+ image && React.createElement(Image, Object.assign({ className: `${bem}__image` }, image))));
23
+ };
24
+ export default Block;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { Link } from './Link';
3
+ export const _Quote = (props) => {
4
+ const { bem, children, by, byHref } = props;
5
+ return (React.createElement("figure", { className: bem },
6
+ React.createElement("blockquote", { className: bem + '__quote' }, children),
7
+ by && (React.createElement("figcaption", { className: bem + '__by' }, byHref ? (React.createElement(Link, { href: byHref }, by)) : typeof by === 'string' ? (React.createElement("span", null, by)) : (by)))));
8
+ };
@@ -4,5 +4,5 @@ const breakOnNL = (text) => text &&
4
4
  .trim()
5
5
  .replace(/(?:\n\s*)+/g, '\n\n')
6
6
  .split(/\n/)
7
- .map((bit) => bit || <br />);
7
+ .map((bit) => bit || React.createElement("br", null));
8
8
  export default breakOnNL;