@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
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import { useSeenEffect } from './utils/seenEffect';
3
+ import Bling from './Bling';
4
+ const FeatureList = (props) => {
5
+ const { title, features, startSeen } = props;
6
+ const [ref] = useSeenEffect(startSeen);
7
+ const _features = features.length ? features : [{ name: '...' }];
8
+ return (React.createElement(React.Fragment, null,
9
+ React.createElement(Bling, { type: "snake-large", align: "left", vertical: "down-ish" }),
10
+ React.createElement("div", { className: "FeatureList", ref: ref },
11
+ React.createElement("h2", { className: "FeatureList__title" }, title),
12
+ React.createElement("ul", { className: "FeatureList__list" }, _features.map(({ name, icon, iconUrl }, i) => (React.createElement("li", { key: i, className: "FeatureList__feature", style: iconUrl
13
+ ? { '--efnistakn': `url("${iconUrl}")` }
14
+ : undefined, "data-efnistakn": !iconUrl ? icon : undefined }, name)))))));
15
+ };
16
+ export default FeatureList;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import getBemClass from '@hugsmidjan/react/utils/getBemClass';
3
+ const FieldGroup = (props) => {
4
+ const { legend, children, className, disabled } = props;
5
+ return (React.createElement("fieldset", { className: getBemClass('FieldGroup', null, className), role: "group", disabled: disabled },
6
+ React.createElement("legend", { className: "FieldGroup__legend" }, legend),
7
+ children));
8
+ };
9
+ export default FieldGroup;
@@ -128,30 +128,27 @@ const FileInput = (props) => {
128
128
  inputRef.current.files = arrayToFileList([]);
129
129
  }
130
130
  };
131
- const filesList = files.map((file) => (<li key={file.name} className="FileInput__file">
132
- <button className="FileInput__file-remove" type="button" onClick={() => removeFile(file.name)} aria-label={removeFileText}>
133
- {removeFileText}
134
- </button>
135
- <span className="FileInput__fileinfo">
136
- {showImagePreviews && file.preview && (<>
137
- <span className="FileInput__preview">
138
- <img src={file.preview}/>
139
- </span>{' '}
140
- </>)}
141
- <span className="FileInput__filename">{file.name}</span>
142
- {showFileSize && (<small className="FileInput__filesize"> - ({formatBytes(file.size)})</small>)}
143
- </span>
144
- </li>));
145
- return (<FormField className={getBemClass('FileInput', [dropzoneProps.multiple && 'multi'], className)} label={label} id={domid + '-fake'} LabelTag="h4" assistText={assistText} hideLabel={hideLabel} disabled={disabled} invalid={invalid} errorMessage={errorMessage} required={required} reqText={reqText} renderInput={(className, inputProps /* , addFocusProps */) => {
146
- return (<div className={className.control} ref={fileInputWrapper}>
147
- <input className="FileInput__input" name={inputElementProps.name} id={domid} ref={fileInput} type="file" style={{ display: 'none' }} multiple={dropzoneProps.multiple || undefined} required={inputProps.required} // ??? Bad idea ?? Scream test!!
148
- />{' '}
149
- <input className="FileInput__input--fake" {...getInputProps()} tabIndex={undefined} style={undefined} multiple={dropzoneProps.multiple || undefined} {...inputProps} required={undefined}/>{' '}
150
- <div className={getBemClass('FileInput__dropzone', [isHover && 'highlight'])} {...getRootProps({ isDragReject })} tabIndex={undefined}>
151
- <p className="FileInput__droptext">{dropzoneText}</p>
152
- </div>
153
- {filesList.length ? <ul className="FileInput__filelist">{filesList}</ul> : ''}
154
- </div>);
155
- }}/>);
131
+ const filesList = files.map((file) => (React.createElement("li", { key: file.name, className: "FileInput__file" },
132
+ React.createElement("button", { className: "FileInput__file-remove", type: "button", onClick: () => removeFile(file.name), "aria-label": removeFileText }, removeFileText),
133
+ React.createElement("span", { className: "FileInput__fileinfo" },
134
+ showImagePreviews && file.preview && (React.createElement(React.Fragment, null,
135
+ React.createElement("span", { className: "FileInput__preview" },
136
+ React.createElement("img", { src: file.preview })),
137
+ ' ')),
138
+ React.createElement("span", { className: "FileInput__filename" }, file.name),
139
+ showFileSize && (React.createElement("small", { className: "FileInput__filesize" },
140
+ " - (",
141
+ formatBytes(file.size),
142
+ ")"))))));
143
+ return (React.createElement(FormField, { className: getBemClass('FileInput', [dropzoneProps.multiple && 'multi'], className), label: label, id: domid + '-fake', LabelTag: "h4", assistText: assistText, hideLabel: hideLabel, disabled: disabled, invalid: invalid, errorMessage: errorMessage, required: required, reqText: reqText, renderInput: (className, inputProps /* , addFocusProps */) => {
144
+ return (React.createElement("div", { className: className.control, ref: fileInputWrapper },
145
+ React.createElement("input", { className: "FileInput__input", name: inputElementProps.name, id: domid, ref: fileInput, type: "file", style: { display: 'none' }, multiple: dropzoneProps.multiple || undefined, required: inputProps.required }),
146
+ ' ',
147
+ React.createElement("input", Object.assign({ className: "FileInput__input--fake" }, getInputProps(), { tabIndex: undefined, style: undefined, multiple: dropzoneProps.multiple || undefined }, inputProps, { required: undefined })),
148
+ ' ',
149
+ React.createElement("div", Object.assign({ className: getBemClass('FileInput__dropzone', [isHover && 'highlight']) }, getRootProps({ isDragReject }), { tabIndex: undefined }),
150
+ React.createElement("p", { className: "FileInput__droptext" }, dropzoneText)),
151
+ filesList.length ? React.createElement("ul", { className: "FileInput__filelist" }, filesList) : ''));
152
+ } }));
156
153
  };
157
154
  export default FileInput;
File without changes
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { Link } from './_abstract/Link';
3
+ const FooterBadges = (props) => {
4
+ if (!props.badges.length) {
5
+ return null;
6
+ }
7
+ return (React.createElement("ul", { className: "FooterBadges" }, props.badges.map(({ altText, src, href }, i) => (React.createElement("li", { key: i, className: "FooterBadges__badge" }, href ? (React.createElement(Link, { href: href },
8
+ ' ',
9
+ React.createElement("img", { src: src, alt: altText }),
10
+ ' ')) : (React.createElement("img", { src: src, alt: altText })))))));
11
+ };
12
+ export default FooterBadges;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import getBemClass from '@hugsmidjan/react/utils/getBemClass';
3
+ const FooterInfo = (props) => {
4
+ const { boxes } = props;
5
+ return (React.createElement("div", { className: "FooterInfo" }, boxes.map((group, i) => (React.createElement("div", { className: getBemClass('FooterInfo__group', group.modifier), role: group.role, key: i },
6
+ React.createElement("h3", { className: "FooterInfo__grouptitle" }, group.title),
7
+ group.content ? (React.createElement("div", { className: getBemClass('FooterInfo__groupcontent', group.modifier) }, group.content)) : (React.createElement("div", { className: getBemClass('FooterInfo__groupcontent', group.modifier), dangerouslySetInnerHTML: { __html: group.html } })))))));
8
+ };
9
+ export default FooterInfo;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ const Footnote = (props) => (React.createElement("div", { className: "Footnote" }, props.children));
3
+ export default Footnote;
@@ -2,11 +2,9 @@ import React from 'react';
2
2
  import getBemClass from '@hugsmidjan/react/utils/getBemClass';
3
3
  const Form = (props) => {
4
4
  const { children, align, wide } = props;
5
- return (<form {...props} className={getBemClass('Form', [
5
+ return (React.createElement("form", Object.assign({}, props, { className: getBemClass('Form', [
6
6
  align === 'right' && 'align--' + align,
7
7
  !align && wide && 'wide',
8
- ])}>
9
- {children}
10
- </form>);
8
+ ]) }), children));
11
9
  };
12
10
  export default Form;
@@ -50,11 +50,9 @@ const FormField = (props) => {
50
50
  const errorId = errorMessage ? 'error:' + domid : undefined;
51
51
  const assistTextId = assistText ? 'assist:' + domid : undefined;
52
52
  const labelId = LabelTag ? 'label:' + domid : undefined;
53
- const reqStar = required && reqText !== false && (<abbr className={'FormField__label__reqstar'}
54
- // TODO: add mo-better i18n thinking
55
- title={(reqText || 'Þarf að fylla út') + ': '}>
56
- *
57
- </abbr>);
53
+ const reqStar = required && reqText !== false && (React.createElement("abbr", { className: 'FormField__label__reqstar',
54
+ // TODO: add mo-better i18n thinking
55
+ title: (reqText || 'Þarf að fylla út') + ': ' }, "*"));
58
56
  const inputProps = {
59
57
  id: domid,
60
58
  disabled: disabled,
@@ -64,7 +62,7 @@ const FormField = (props) => {
64
62
  'aria-describedby': assistTextId && errorId ? assistTextId + ' ' + errorId : assistTextId || errorId,
65
63
  'aria-labelledby': labelId, // undefined if normalLabel
66
64
  };
67
- return (<div className={getBemClass('FormField', [
65
+ return (React.createElement("div", { className: getBemClass('FormField', [
68
66
  small && 'small',
69
67
  hideLabel && 'nolabel',
70
68
  isInvalid && 'invalid',
@@ -73,21 +71,21 @@ const FormField = (props) => {
73
71
  isBrowser && empty && 'empty',
74
72
  isBrowser && filled && 'filled',
75
73
  isBrowser && focused && 'focused',
76
- ], className)} role={group ? 'group' : undefined} ref={props.wrapperRef}>
77
- {LabelTag ? (<LabelTag className={'FormField__label'} id={labelId}>
78
- {' '}
79
- {reqStar} {label}{' '}
80
- </LabelTag>) : (<label className={'FormField__label'} htmlFor={domid}>
81
- {' '}
82
- {reqStar} {label}{' '}
83
- </label>)}{' '}
84
- {renderInput(inputClassNames, inputProps, addFocusProps, isBrowser)}
85
- {assistText && (<div id={assistTextId} className={'FormField__assist'}>
86
- {assistText}
87
- </div>)}
88
- {errorMessage && (<div id={errorId} className={'FormField__error'}>
89
- {errorMessage}
90
- </div>)}
91
- </div>);
74
+ ], className), role: group ? 'group' : undefined, ref: props.wrapperRef },
75
+ LabelTag ? (React.createElement(LabelTag, { className: 'FormField__label', id: labelId },
76
+ ' ',
77
+ reqStar,
78
+ " ",
79
+ label,
80
+ ' ')) : (React.createElement("label", { className: 'FormField__label', htmlFor: domid },
81
+ ' ',
82
+ reqStar,
83
+ " ",
84
+ label,
85
+ ' ')),
86
+ ' ',
87
+ renderInput(inputClassNames, inputProps, addFocusProps, isBrowser),
88
+ assistText && (React.createElement("div", { id: assistTextId, className: 'FormField__assist' }, assistText)),
89
+ errorMessage && (React.createElement("div", { id: errorId, className: 'FormField__error' }, errorMessage))));
92
90
  };
93
91
  export default FormField;
@@ -16,16 +16,15 @@ import GalleryModalContext from './_GalleryModalContext';
16
16
  const GalleryItem = (props) => {
17
17
  const { caption, description, largeImageSrc } = props, image = __rest(props, ["caption", "description", "largeImageSrc"]);
18
18
  const { setCurrentImage } = useContext(GalleryModalContext);
19
- return (<figure className="GalleryItem">
20
- <figcaption className="GalleryItem__caption">{caption}</figcaption>
21
- {largeImageSrc ? (<Button bem="GalleryItem__button" href={largeImageSrc} onClick={(e) => {
19
+ return (React.createElement("figure", { className: "GalleryItem" },
20
+ React.createElement("figcaption", { className: "GalleryItem__caption" }, caption),
21
+ largeImageSrc ? (React.createElement(Button, { bem: "GalleryItem__button", href: largeImageSrc, onClick: (e) => {
22
22
  e.preventDefault();
23
23
  setCurrentImage(Object.assign(Object.assign({}, image), { caption, description, largeImageSrc }));
24
- }}>
25
- {' '}
26
- <Image className="GalleryItem__image" {...image}/>{' '}
27
- </Button>) : (<Image className="GalleryItem__image" {...image}/>)}
28
- {description && <div className="GalleryItem__description">{description}</div>}
29
- </figure>);
24
+ } },
25
+ ' ',
26
+ React.createElement(Image, Object.assign({ className: "GalleryItem__image" }, image)),
27
+ ' ')) : (React.createElement(Image, Object.assign({ className: "GalleryItem__image" }, image))),
28
+ description && React.createElement("div", { className: "GalleryItem__description" }, description)));
30
29
  };
31
30
  export default GalleryItem;
@@ -38,21 +38,17 @@ const GalleryModal = (props) => {
38
38
  // FIXME: This if weirdly inefficient. Either memoize,
39
39
  // or do a simpler single-property comparison.
40
40
  objectIsSame(objectClean(image), objectClean(item)));
41
- return (<Modal open={true} onClosed={() => {
41
+ return (React.createElement(Modal, { open: true, onClosed: () => {
42
42
  setCurrentImage(undefined);
43
- }} startOpen={false} bem="GalleryModal" texts={{ closeButton: texts.modalCloseLabel }}>
44
- <>
45
- <CSSTransition in={animated} timeout={200} onEntered={() => {
46
- setAnimated(!animated);
47
- }} classNames="GalleryModalItem--">
48
- <GalleryModalItem {...image}/>
49
- </CSSTransition>
50
-
51
- <CarouselPaging bem="GalleryModalPager" itemCount={items.length} current={imageIndex} setCurrent={updateImage} texts={{
52
- next: texts.modalNextLabel,
53
- prev: texts.modalPrevLabel,
54
- }}/>
55
- </>
56
- </Modal>);
43
+ }, startOpen: false, bem: "GalleryModal", texts: { closeButton: texts.modalCloseLabel } },
44
+ React.createElement(React.Fragment, null,
45
+ React.createElement(CSSTransition, { in: animated, timeout: 200, onEntered: () => {
46
+ setAnimated(!animated);
47
+ }, classNames: "GalleryModalItem--" },
48
+ React.createElement(GalleryModalItem, Object.assign({}, image))),
49
+ React.createElement(CarouselPaging, { bem: "GalleryModalPager", itemCount: items.length, current: imageIndex, setCurrent: updateImage, texts: {
50
+ next: texts.modalNextLabel,
51
+ prev: texts.modalPrevLabel,
52
+ } }))));
57
53
  };
58
54
  export default GalleryModal;
@@ -13,12 +13,10 @@ import React from 'react';
13
13
  import Image from '../_abstract/Image';
14
14
  const GalleryModalItem = (props) => {
15
15
  const { caption, description } = props, image = __rest(props, ["caption", "description"]);
16
- return (<div className="GalleryModalItem">
17
- {(caption || description) && (<div className="GalleryModalItem__text">
18
- <div className="GalleryModalItem__caption">{caption}</div>
19
- <div className="GalleryModalItem__description">{description}</div>
20
- </div>)}
21
- <Image className="GalleryModalItem__image" src={image.largeImageSrc || image.src}/>
22
- </div>);
16
+ return (React.createElement("div", { className: "GalleryModalItem" },
17
+ (caption || description) && (React.createElement("div", { className: "GalleryModalItem__text" },
18
+ React.createElement("div", { className: "GalleryModalItem__caption" }, caption),
19
+ React.createElement("div", { className: "GalleryModalItem__description" }, description))),
20
+ React.createElement(Image, { className: "GalleryModalItem__image", src: image.largeImageSrc || image.src })));
23
21
  };
24
22
  export default GalleryModalItem;
@@ -20,9 +20,8 @@ const Gallery = (props) => {
20
20
  const { items, ssr, startSeen } = props;
21
21
  const texts = getTexts(props, defaultTexts);
22
22
  const [modalImage, setModalImage] = useState(undefined);
23
- return (<GalleryModalContext.Provider value={{ items, setCurrentImage: setModalImage, currentImage: modalImage }}>
24
- <AbstractCarousel bem="Gallery" items={items} Component={GalleryItem} ssr={ssr} startSeen={startSeen}/>
25
- <GalleryModal {...modalImage} texts={texts}/>
26
- </GalleryModalContext.Provider>);
23
+ return (React.createElement(GalleryModalContext.Provider, { value: { items, setCurrentImage: setModalImage, currentImage: modalImage } },
24
+ React.createElement(AbstractCarousel, { bem: "Gallery", items: items, Component: GalleryItem, ssr: ssr, startSeen: startSeen }),
25
+ React.createElement(GalleryModal, Object.assign({}, modalImage, { texts: texts }))));
27
26
  };
28
27
  export default Gallery;
@@ -0,0 +1,24 @@
1
+ import React from 'react';
2
+ import getBemClass from '@hugsmidjan/react/utils/getBemClass';
3
+ import { getEfnistaknUrl } from '@reykjavik/hanna-utils/assets';
4
+ import Image from './_abstract/Image';
5
+ import { Link } from './_abstract/Link';
6
+ import { useSeenEffect } from './utils/seenEffect';
7
+ import ButtonTertiary from './ButtonTertiary';
8
+ const GridBlocks = (props) => {
9
+ const { blocks, twocol, startSeen } = props;
10
+ const [ref] = useSeenEffect(startSeen);
11
+ return (React.createElement("div", { className: getBemClass('GridBlocks', [twocol && 'twocol']), ref: ref }, blocks.map(({ title, summary, href, links = [], icon, image }, i) => {
12
+ const imageProps = icon ? { src: getEfnistaknUrl(icon) } : image;
13
+ return (React.createElement("div", { key: i, className: "GridBlocks__item" },
14
+ imageProps && React.createElement(Image, Object.assign({ className: "GridBlocks__illustration" }, imageProps)),
15
+ React.createElement("div", { className: "GridBlocks__textwrap" },
16
+ React.createElement("h3", { className: "GridBlocks__item__title" }, href != null ? (React.createElement(Link, { className: "GridBlocks__item__titlelink", href: href }, title)) : (title)),
17
+ React.createElement("div", { className: "GridBlocks__item__summary" }, summary),
18
+ React.createElement("ul", { className: "GridBlocks__links" }, links.map((link, i) => {
19
+ return (React.createElement("li", { key: i, className: "GridBlocks__link" },
20
+ React.createElement(ButtonTertiary, Object.assign({}, link))));
21
+ })))));
22
+ })));
23
+ };
24
+ export default GridBlocks;
@@ -8,12 +8,10 @@ const sizes = {
8
8
  };
9
9
  const Heading = (props) => {
10
10
  const { size = 'normal', Tag = 'h2', align, wide, children } = props;
11
- return (<Tag className={getBemClass('Heading', [
11
+ return (React.createElement(Tag, { className: getBemClass('Heading', [
12
12
  sizes[size],
13
13
  align === 'right' && 'align--' + align,
14
14
  !align && wide && 'wide',
15
- ])}>
16
- {children}
17
- </Tag>);
15
+ ]) }, children));
18
16
  };
19
17
  export default Heading;
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import { getIllustrationUrl } from '@reykjavik/hanna-utils/assets';
3
+ import Image from './_abstract/Image';
4
+ import { useSeenEffect } from './utils/seenEffect';
5
+ import ButtonPrimary from './ButtonPrimary';
6
+ import ButtonTertiary from './ButtonTertiary';
7
+ const HeroBlock = (props) => {
8
+ const { title, summary, illustration, image, primaryButton, secondaryButton, startSeen, } = props;
9
+ const hasButtons = Boolean(primaryButton || secondaryButton);
10
+ const imgProps = illustration ? { src: getIllustrationUrl(illustration) } : image;
11
+ const [ref] = useSeenEffect(startSeen);
12
+ return (React.createElement("div", { className: "HeroBlock", ref: ref },
13
+ React.createElement("h1", { className: "HeroBlock__title" }, title),
14
+ React.createElement(Image, Object.assign({ className: "HeroBlock__image" }, imgProps)),
15
+ React.createElement("div", { className: "HeroBlock__summary" }, summary),
16
+ hasButtons && (React.createElement("div", { className: "HeroBlock__buttons" },
17
+ primaryButton && React.createElement(ButtonPrimary, Object.assign({}, primaryButton)),
18
+ ' ',
19
+ secondaryButton && React.createElement(ButtonTertiary, Object.assign({}, secondaryButton))))));
20
+ };
21
+ export default HeroBlock;
@@ -16,11 +16,11 @@ const IframeBlock = (props) => {
16
16
  compact && 'compact',
17
17
  align === 'right' && 'align--' + align,
18
18
  ]);
19
- return height === 'auto' ? (<IframeResizer className={className} src={src}/>) : (<iframe className={className} src={src}
20
- // hidden tiger: pass negative height to disable iframe-resizer but not set height explicitly
21
- // (Silly hack, don't rely on this)
22
- height={height < 0 ? undefined : height}
23
- // allow undefined to suppress scrolling attribute
24
- scrolling={scrolling === true ? 'yes' : scrolling === false ? 'no' : scrolling}/>);
19
+ return height === 'auto' ? (React.createElement(IframeResizer, { className: className, src: src })) : (React.createElement("iframe", { className: className, src: src,
20
+ // hidden tiger: pass negative height to disable iframe-resizer but not set height explicitly
21
+ // (Silly hack, don't rely on this)
22
+ height: height < 0 ? undefined : height,
23
+ // allow undefined to suppress scrolling attribute
24
+ scrolling: scrolling === true ? 'yes' : scrolling === false ? 'no' : scrolling }));
25
25
  };
26
26
  export default IframeBlock;
@@ -3,6 +3,6 @@ import { getIllustrationUrl, } from '@reykjavik/hanna-utils/assets';
3
3
  import Image from './_abstract/Image';
4
4
  const Illustration = (props) => {
5
5
  const imgProps = props.type ? { src: getIllustrationUrl(props.type) } : props.image;
6
- return <Image className="Illustration" {...imgProps}/>;
6
+ return React.createElement(Image, Object.assign({ className: "Illustration" }, imgProps));
7
7
  };
8
8
  export default Illustration;
@@ -16,8 +16,7 @@ import { useSeenEffect } from './utils/seenEffect';
16
16
  const ImageCards = (props) => {
17
17
  const { background, startSeen } = props, cardListProps = __rest(props, ["background", "startSeen"]);
18
18
  const [ref] = useSeenEffect(startSeen);
19
- return (<div className={getBemClass('ImageCards', background && 'background')} ref={ref}>
20
- <CardList {...cardListProps} bemPrefix="ImageCards" imgPlaceholder={props.imgPlaceholder || true}/>
21
- </div>);
19
+ return (React.createElement("div", { className: getBemClass('ImageCards', background && 'background'), ref: ref },
20
+ React.createElement(CardList, Object.assign({}, cardListProps, { bemPrefix: "ImageCards", imgPlaceholder: props.imgPlaceholder || true }))));
22
21
  };
23
22
  export default ImageCards;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { useSeenEffect } from './utils/seenEffect';
3
+ const InfoBlock = (props) => {
4
+ const { title, subtitle, items, startSeen } = props;
5
+ const [ref] = useSeenEffect(startSeen);
6
+ return (React.createElement("div", { className: "InfoBlock", ref: ref },
7
+ React.createElement("h2", { className: "InfoBlock__title" }, title),
8
+ React.createElement("div", { className: "InfoBlock__subtitle" }, subtitle),
9
+ React.createElement("ul", { className: "InfoBlock__items" }, items.map((item, i) => (React.createElement("li", { key: i, className: "InfoBlock__item" }, item)))),
10
+ 'extraInfo' in props && (React.createElement("div", { className: "InfoBlock__extrainfo" }, props.extraInfo)),
11
+ 'attention' in props && (React.createElement("div", { className: "InfoBlock__attention" }, props.attention))));
12
+ };
13
+ export default InfoBlock;
@@ -69,20 +69,14 @@ const InfoHero = (props) => {
69
69
  const alignment = align && aligns[align] ? align : 'right';
70
70
  const blings = (blingType && blingOptions[blingType]) ||
71
71
  blingOptions.waves; // default to `waves`
72
- return (<div className={getBemClass('InfoHero', 'align--' + alignment)}>
73
- <div className="InfoHero__content">
74
- <h1 className="InfoHero__title">{title}</h1>
75
- {titleBlurb && <div className="InfoHero__titleblurb">{titleBlurb}</div>}
76
-
77
- {subTitle && <div className="InfoHero__subtitle">{breakOnNL(subTitle)}</div>}
78
- {blurb && <div className="InfoHero__blurb">{blurb}</div>}
79
-
80
- {showButtons && (<div className="InfoHero__buttons">
81
- {buttons.map((buttonProps, i) => (<ButtonTertiary key={i} {...buttonProps}/>))}
82
- </div>)}
83
- </div>
84
- <Image className="InfoHero__image" altText={title} {...image} placeholder/>
85
- <Blings blings={blings} mirror={alignment === 'right'}/>
86
- </div>);
72
+ return (React.createElement("div", { className: getBemClass('InfoHero', 'align--' + alignment) },
73
+ React.createElement("div", { className: "InfoHero__content" },
74
+ React.createElement("h1", { className: "InfoHero__title" }, title),
75
+ titleBlurb && React.createElement("div", { className: "InfoHero__titleblurb" }, titleBlurb),
76
+ subTitle && React.createElement("div", { className: "InfoHero__subtitle" }, breakOnNL(subTitle)),
77
+ blurb && React.createElement("div", { className: "InfoHero__blurb" }, blurb),
78
+ showButtons && (React.createElement("div", { className: "InfoHero__buttons" }, buttons.map((buttonProps, i) => (React.createElement(ButtonTertiary, Object.assign({ key: i }, buttonProps))))))),
79
+ React.createElement(Image, Object.assign({ className: "InfoHero__image", altText: title }, image, { placeholder: true })),
80
+ React.createElement(Blings, { blings: blings, mirror: alignment === 'right' })));
87
81
  };
88
82
  export default InfoHero;
@@ -11,6 +11,6 @@ const IslandBlock = (props) => {
11
11
  content,
12
12
  image: shapes ? { src: getFormheimurUrl(shapes), inline: true } : image || {},
13
13
  };
14
- return (<Block bem="IslandBlock" modifier={'align--' + alignment} {...blockProps} startSeen={startSeen}/>);
14
+ return (React.createElement(Block, Object.assign({ bem: "IslandBlock", modifier: 'align--' + alignment }, blockProps, { startSeen: startSeen })));
15
15
  };
16
16
  export default IslandBlock;
@@ -11,6 +11,6 @@ const IslandPageBlock = (props) => {
11
11
  const { title, summary, buttons, illustration, image, align, background, startSeen } = props;
12
12
  const alignment = align && aligns[align] ? align : 'right';
13
13
  const bg = backgrounds[background || 'none'];
14
- return (<Block bem="IslandPageBlock" modifier={['align--' + alignment, bg && 'background--' + bg]} content={{ title, summary, buttons }} image={illustration ? { src: getIllustrationUrl(illustration) } : image || {}} startSeen={startSeen}/>);
14
+ return (React.createElement(Block, { bem: "IslandPageBlock", modifier: ['align--' + alignment, bg && 'background--' + bg], content: { title, summary, buttons }, image: illustration ? { src: getIllustrationUrl(illustration) } : image || {}, startSeen: startSeen }));
15
15
  };
16
16
  export default IslandPageBlock;
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import getBemClass from '@hugsmidjan/react/utils/getBemClass';
3
+ import { useSeenEffect } from './utils/seenEffect';
4
+ import ButtonTertiary from './ButtonTertiary';
5
+ const LabeledTextBlock = (props) => {
6
+ const { label, summary, wide, buttons = [], startSeen } = props;
7
+ const [ref] = useSeenEffect(startSeen);
8
+ return (React.createElement("div", { className: getBemClass('LabeledTextBlock', wide && 'wide'), ref: ref },
9
+ React.createElement("h2", { className: "LabeledTextBlock__label" }, label),
10
+ React.createElement("div", { className: "LabeledTextBlock__summary" },
11
+ summary,
12
+ buttons.map((button, i) => (React.createElement(ButtonTertiary, Object.assign({ key: i }, button)))))));
13
+ };
14
+ export default LabeledTextBlock;
package/esm/Layout.js ADDED
@@ -0,0 +1,52 @@
1
+ import React from 'react';
2
+ import { useIsBrowserSide } from '@hugsmidjan/react/hooks';
3
+ import getBemClass from '@hugsmidjan/react/utils/getBemClass';
4
+ import { getAssetUrl } from '@reykjavik/hanna-utils/assets';
5
+ import { getTexts } from '@reykjavik/hanna-utils/i18n';
6
+ import Image from './_abstract/Image';
7
+ import { Link } from './_abstract/Link';
8
+ import { useMenuToggling } from './utils/useMenuToggling';
9
+ import { useScrollbarWidthCSSVar } from './utils/useScrollbarWidthCSSVar';
10
+ export const defaultLayoutTexts = {
11
+ is: {
12
+ lang: 'is',
13
+ skipLinkLabel: 'Valmynd',
14
+ closeMenuLabel: 'Loka',
15
+ closeMenuLabelLong: 'Loka valmynd',
16
+ },
17
+ en: {
18
+ lang: 'en',
19
+ skipLinkLabel: 'Skip to navigation',
20
+ closeMenuLabel: 'Close',
21
+ closeMenuLabelLong: 'Close menu',
22
+ },
23
+ };
24
+ const Layout = (props) => {
25
+ useScrollbarWidthCSSVar();
26
+ const { ssr, globalAlerts, mainChildren, navChildren, footerChildren, colorTheme, children, siteName = 'Reykjavík', logoLink = '/', } = props;
27
+ const { isMenuActive, closeMenu, toggleMenu } = useMenuToggling(ssr !== 'ssr-only');
28
+ const isBrowser = useIsBrowserSide( /* ssr */);
29
+ const txt = getTexts(props, defaultLayoutTexts);
30
+ return (React.createElement("div", { className: getBemClass('Layout', props.modifier), "data-sprinkled": isBrowser, "data-color-theme": colorTheme },
31
+ globalAlerts && (React.createElement("div", { className: "Layout__alerts", role: "alert" }, globalAlerts)),
32
+ React.createElement("div", { className: "Layout__content" },
33
+ React.createElement("div", { className: "Layout__header", role: "banner" },
34
+ React.createElement(Link, { className: "Layout__header__logo", href: logoLink },
35
+ ' ',
36
+ React.createElement(Image, { inline: true, src: getAssetUrl('reykjavik-logo.svg') }),
37
+ " ",
38
+ siteName,
39
+ ' '),
40
+ ' ',
41
+ navChildren && (React.createElement(Link, { className: "Layout__header__skiplink", href: "#pagenav", onClick: isMenuActive &&
42
+ ((e) => {
43
+ e.preventDefault();
44
+ toggleMenu();
45
+ }), "aria-label": txt.skipLinkLabel }, txt.skipLinkLabel))),
46
+ React.createElement("div", { className: "Layout__main", role: "main" }, mainChildren || children),
47
+ navChildren && (React.createElement("div", { className: "Layout__nav", id: "pagenav", role: "navigation" },
48
+ navChildren,
49
+ isMenuActive && (React.createElement("button", { className: "Layout__nav__closebutton", onClick: closeMenu, "aria-label": txt.closeMenuLabelLong, type: "button" }, txt.closeMenuLabel)))),
50
+ React.createElement("div", { className: "Layout__footer", role: "complementary" }, footerChildren))));
51
+ };
52
+ export default Layout;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { getIllustrationUrl } from '@reykjavik/hanna-utils/assets';
3
+ import { Link } from '../_abstract/Link';
4
+ export const AuxiliaryPanel = (props) => {
5
+ const { title, id, items, image } = props;
6
+ const imageUrl = image ? getIllustrationUrl(image) : image;
7
+ return (React.createElement("li", { className: "AuxiliaryPanel", id: id, style: imageUrl
8
+ ? { '--menu-auxiliary-image': `url(${imageUrl})` }
9
+ : undefined },
10
+ React.createElement("h3", { className: "AuxiliaryPanel__title" }, title),
11
+ React.createElement("ul", { className: "AuxiliaryPanel__items" }, items.map((item, i) => (React.createElement("li", { key: i, className: "AuxiliaryPanel__item", "aria-current": item.current || undefined },
12
+ React.createElement(Link, { className: "AuxiliaryPanel__link", href: item.href, target: item.target, lang: item.lang }, item.label)))))));
13
+ };
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+ import getBemClass from '@hugsmidjan/react/utils/getBemClass';
3
+ import { Link } from '../_abstract/Link';
4
+ export const PrimaryPanel = (props) => {
5
+ const { setActivePanel, panel, isParent, isActive, isBrowser, texts } = props;
6
+ const { items } = panel;
7
+ return (React.createElement("li", { ref: isActive ? props.activeRef : undefined, className: getBemClass('PrimaryPanel', [
8
+ isParent && 'parent',
9
+ isActive && 'active',
10
+ items.length > 5 && 'twocol', // TODO: allow setting twocol manually?
11
+ ]), id: panel.id },
12
+ React.createElement("h3", { className: "PrimaryPanel__title" },
13
+ ' ',
14
+ isBrowser && !isActive ? (React.createElement("button", { className: "MainMenu__mega__title-toggler", "aria-controls": panel.id, onClick: () => setActivePanel(panel, false), "aria-pressed": isActive, type: "button" }, panel.title)) : (panel.title)),
15
+ React.createElement("ul", { className: "PrimaryPanel__items" }, items.map((item, i) => (React.createElement("li", { key: i, className: "PrimaryPanel__item", "aria-current": item.current || undefined },
16
+ React.createElement(Link, { className: "PrimaryPanel__link", href: item.href, target: item.target, lang: item.lang },
17
+ React.createElement("span", { className: "PrimaryPanel__linkTitle" }, item.label),
18
+ ' ',
19
+ React.createElement("small", { className: "PrimaryPanel__summary" }, item.summary),
20
+ ' '))))),
21
+ isBrowser && isActive && (React.createElement("button", { className: "MainMenu__megapanel__backtomenu", "aria-controls": panel.id, "aria-label": texts.backToMenuLong, onClick: () => setActivePanel(undefined), type: "button" }, texts.backToMenu))));
22
+ };