@reykjavik/hanna-react 0.10.59 → 0.10.60

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (355) hide show
  1. package/AccordionList.js +3 -28
  2. package/ActionCards.js +2 -4
  3. package/Alert.js +4 -29
  4. package/ArticleCards.js +2 -4
  5. package/ArticleCarousel/_ArticleCarouselCard.js +4 -6
  6. package/ArticleCarousel.js +3 -5
  7. package/ArticleMeta.js +3 -28
  8. package/Attention.js +3 -5
  9. package/BasicTable.js +5 -7
  10. package/BgBox.js +3 -5
  11. package/Bling.js +3 -5
  12. package/BlockBreak.js +2 -4
  13. package/BlockQuote.js +2 -4
  14. package/BreadCrumbs.js +2 -4
  15. package/ButtonBack.js +3 -5
  16. package/ButtonBar.js +3 -5
  17. package/ButtonPrimary.js +3 -5
  18. package/ButtonSecondary.js +3 -5
  19. package/ButtonTertiary.js +3 -5
  20. package/CHANGELOG.md +8 -0
  21. package/Carousel.js +3 -5
  22. package/CarouselStepper.js +3 -5
  23. package/CenterColumn.js +3 -5
  24. package/Checkbox.js +3 -5
  25. package/CheckboxButtonsGroup.js +4 -6
  26. package/CheckboxGroup.js +4 -6
  27. package/CityBlock.js +3 -5
  28. package/ContactBubble.js +4 -29
  29. package/ContentArticle.js +8 -10
  30. package/ContentImage.js +3 -5
  31. package/Datepicker.js +6 -31
  32. package/ExtraLinks.js +4 -17
  33. package/FeatureList.js +3 -5
  34. package/FieldGroup.js +3 -5
  35. package/FileInput.js +5 -41
  36. package/Foonote.js +2 -4
  37. package/FooterBadges.js +2 -4
  38. package/FooterInfo.js +3 -5
  39. package/Footnote.js +2 -4
  40. package/Form.js +3 -5
  41. package/FormField.js +3 -28
  42. package/Gallery/_GalleryItem.js +6 -42
  43. package/Gallery/_GalleryModal.js +6 -31
  44. package/Gallery/_GalleryModalContext.js +2 -4
  45. package/Gallery/_GalleryModalItem.js +4 -17
  46. package/Gallery.js +6 -31
  47. package/GridBlocks.js +5 -7
  48. package/Heading.js +3 -5
  49. package/HeroBlock.js +5 -7
  50. package/IframeBlock.d.ts +5 -1
  51. package/IframeBlock.js +6 -8
  52. package/Illustration.js +3 -5
  53. package/ImageCards.js +4 -17
  54. package/InfoBlock.js +2 -4
  55. package/InfoHero.js +7 -9
  56. package/IslandBlock.js +3 -5
  57. package/IslandPageBlock.js +3 -5
  58. package/LabeledTextBlock.js +4 -6
  59. package/Layout.js +4 -6
  60. package/MainMenu/_Auxiliary.js +2 -4
  61. package/MainMenu/_PrimaryPanel.js +3 -5
  62. package/MainMenu.js +5 -30
  63. package/MiniMetrics.js +4 -6
  64. package/Modal.js +3 -5
  65. package/NameCard.js +5 -7
  66. package/NameCards.js +3 -5
  67. package/NewsHero.js +6 -8
  68. package/PageFilter.js +4 -6
  69. package/PageHeading.js +3 -5
  70. package/Picture.js +4 -6
  71. package/ProcessOverview.js +3 -5
  72. package/PullQuote.js +2 -4
  73. package/RadioButtonsGroup.js +4 -6
  74. package/RadioGroup.js +4 -6
  75. package/RelatedLinks.js +2 -4
  76. package/RowBlock.js +3 -5
  77. package/RowBlockColumn.js +3 -5
  78. package/SearchInput.js +5 -41
  79. package/SearchResults/_SearchResultsItem.js +3 -5
  80. package/SearchResults.js +7 -32
  81. package/SeenEffect.js +3 -16
  82. package/Selectbox.js +6 -42
  83. package/ShareButtons.js +2 -24
  84. package/Sharpie.js +3 -5
  85. package/SiteSearchAutocomplete.js +5 -41
  86. package/SiteSearchCurtain.js +3 -28
  87. package/SiteSearchInput.d.ts +1 -1
  88. package/SiteSearchInput.js +4 -40
  89. package/Skeleton.js +4 -6
  90. package/SubHeading.js +3 -5
  91. package/Tabs.js +3 -28
  92. package/TagPill.js +5 -18
  93. package/TextBlock.js +3 -5
  94. package/TextButton.js +3 -5
  95. package/TextInput.js +5 -41
  96. package/VSpacer.js +3 -5
  97. package/VerticalTabsTOC.js +3 -28
  98. package/WizardLayout.js +3 -5
  99. package/WizardLayoutClose.js +3 -5
  100. package/WizardStepper.js +3 -5
  101. package/_abstract/_AbstractCarousel.js +7 -32
  102. package/_abstract/_Blings.js +3 -5
  103. package/_abstract/_Block.js +5 -7
  104. package/_abstract/_Button.js +4 -17
  105. package/_abstract/_CardList.js +4 -6
  106. package/_abstract/_Image.js +3 -5
  107. package/_abstract/_Link.js +2 -4
  108. package/_abstract/_Quote.js +2 -4
  109. package/_abstract/_TogglerGroup.js +8 -8
  110. package/_abstract/_TogglerGroupField.js +6 -19
  111. package/_abstract/_TogglerInput.js +4 -17
  112. package/_abstract/breakOnNL.js +2 -4
  113. package/package.json +4 -378
  114. package/utils/env.js +2 -4
  115. package/utils/useScrollbarWidthCSSVar.js +2 -4
  116. package/utils.js +3 -16
  117. package/esm/AccordionList.d.ts +0 -17
  118. package/esm/AccordionList.js +0 -24
  119. package/esm/ActionCards.d.ts +0 -5
  120. package/esm/ActionCards.js +0 -9
  121. package/esm/Alert.d.ts +0 -49
  122. package/esm/Alert.js +0 -92
  123. package/esm/ArticleCards.d.ts +0 -6
  124. package/esm/ArticleCards.js +0 -4
  125. package/esm/ArticleCarousel/_ArticleCarouselCard.d.ts +0 -27
  126. package/esm/ArticleCarousel/_ArticleCarouselCard.js +0 -24
  127. package/esm/ArticleCarousel.d.ts +0 -12
  128. package/esm/ArticleCarousel.js +0 -8
  129. package/esm/ArticleMeta.d.ts +0 -10
  130. package/esm/ArticleMeta.js +0 -19
  131. package/esm/Attention.d.ts +0 -7
  132. package/esm/Attention.js +0 -4
  133. package/esm/BasicTable.d.ts +0 -12
  134. package/esm/BasicTable.js +0 -29
  135. package/esm/BgBox.d.ts +0 -8
  136. package/esm/BgBox.js +0 -9
  137. package/esm/Bling.d.ts +0 -81
  138. package/esm/Bling.js +0 -44
  139. package/esm/BlockBreak.d.ts +0 -2
  140. package/esm/BlockBreak.js +0 -6
  141. package/esm/BlockQuote.d.ts +0 -4
  142. package/esm/BlockQuote.js +0 -4
  143. package/esm/BreadCrumbs.d.ts +0 -11
  144. package/esm/BreadCrumbs.js +0 -28
  145. package/esm/ButtonBack.d.ts +0 -7
  146. package/esm/ButtonBack.js +0 -4
  147. package/esm/ButtonBar.d.ts +0 -16
  148. package/esm/ButtonBar.js +0 -14
  149. package/esm/ButtonPrimary.d.ts +0 -7
  150. package/esm/ButtonPrimary.js +0 -4
  151. package/esm/ButtonSecondary.d.ts +0 -7
  152. package/esm/ButtonSecondary.js +0 -4
  153. package/esm/ButtonTertiary.d.ts +0 -12
  154. package/esm/ButtonTertiary.js +0 -15
  155. package/esm/Carousel.d.ts +0 -4
  156. package/esm/Carousel.js +0 -4
  157. package/esm/CarouselStepper.d.ts +0 -4
  158. package/esm/CarouselStepper.js +0 -4
  159. package/esm/CenterColumn.d.ts +0 -7
  160. package/esm/CenterColumn.js +0 -7
  161. package/esm/Checkbox.d.ts +0 -4
  162. package/esm/Checkbox.js +0 -4
  163. package/esm/CheckboxButtonsGroup.d.ts +0 -11
  164. package/esm/CheckboxButtonsGroup.js +0 -14
  165. package/esm/CheckboxGroup.d.ts +0 -9
  166. package/esm/CheckboxGroup.js +0 -7
  167. package/esm/CityBlock.d.ts +0 -23
  168. package/esm/CityBlock.js +0 -18
  169. package/esm/ContactBubble.d.ts +0 -58
  170. package/esm/ContactBubble.js +0 -148
  171. package/esm/ContentArticle.d.ts +0 -15
  172. package/esm/ContentArticle.js +0 -21
  173. package/esm/ContentImage.d.ts +0 -8
  174. package/esm/ContentImage.js +0 -18
  175. package/esm/Datepicker.d.ts +0 -39
  176. package/esm/Datepicker.js +0 -63
  177. package/esm/ExtraLinks.d.ts +0 -18
  178. package/esm/ExtraLinks.js +0 -34
  179. package/esm/FeatureList.d.ts +0 -12
  180. package/esm/FeatureList.js +0 -16
  181. package/esm/FieldGroup.d.ts +0 -9
  182. package/esm/FieldGroup.js +0 -9
  183. package/esm/FileInput.d.ts +0 -17
  184. package/esm/FileInput.js +0 -154
  185. package/esm/Foonote.d.ts +0 -12
  186. package/esm/Foonote.js +0 -7
  187. package/esm/FooterBadges.d.ts +0 -9
  188. package/esm/FooterBadges.js +0 -12
  189. package/esm/FooterInfo.d.ts +0 -18
  190. package/esm/FooterInfo.js +0 -9
  191. package/esm/Footnote.d.ts +0 -6
  192. package/esm/Footnote.js +0 -3
  193. package/esm/Form.d.ts +0 -7
  194. package/esm/Form.js +0 -10
  195. package/esm/FormField.d.ts +0 -65
  196. package/esm/FormField.js +0 -91
  197. package/esm/Gallery/_GalleryItem.d.ts +0 -8
  198. package/esm/Gallery/_GalleryItem.js +0 -30
  199. package/esm/Gallery/_GalleryModal.d.ts +0 -6
  200. package/esm/Gallery/_GalleryModal.js +0 -54
  201. package/esm/Gallery/_GalleryModalContext.d.ts +0 -9
  202. package/esm/Gallery/_GalleryModalContext.js +0 -3
  203. package/esm/Gallery/_GalleryModalItem.d.ts +0 -3
  204. package/esm/Gallery/_GalleryModalItem.js +0 -22
  205. package/esm/Gallery.d.ts +0 -17
  206. package/esm/Gallery.js +0 -27
  207. package/esm/GridBlocks.d.ts +0 -26
  208. package/esm/GridBlocks.js +0 -24
  209. package/esm/Heading.d.ts +0 -16
  210. package/esm/Heading.js +0 -17
  211. package/esm/HeroBlock.d.ts +0 -19
  212. package/esm/HeroBlock.js +0 -21
  213. package/esm/IframeBlock.d.ts +0 -23
  214. package/esm/IframeBlock.js +0 -26
  215. package/esm/Illustration.d.ts +0 -13
  216. package/esm/Illustration.js +0 -8
  217. package/esm/ImageCards.d.ts +0 -8
  218. package/esm/ImageCards.js +0 -22
  219. package/esm/InfoBlock.d.ts +0 -17
  220. package/esm/InfoBlock.js +0 -13
  221. package/esm/InfoHero.d.ts +0 -17
  222. package/esm/InfoHero.js +0 -82
  223. package/esm/IslandBlock.d.ts +0 -25
  224. package/esm/IslandBlock.js +0 -16
  225. package/esm/IslandPageBlock.d.ts +0 -24
  226. package/esm/IslandPageBlock.js +0 -16
  227. package/esm/LabeledTextBlock.d.ts +0 -11
  228. package/esm/LabeledTextBlock.js +0 -14
  229. package/esm/Layout.d.ts +0 -33
  230. package/esm/Layout.js +0 -52
  231. package/esm/MainMenu/_Auxiliary.d.ts +0 -6
  232. package/esm/MainMenu/_Auxiliary.js +0 -13
  233. package/esm/MainMenu/_PrimaryPanel.d.ts +0 -13
  234. package/esm/MainMenu/_PrimaryPanel.js +0 -22
  235. package/esm/MainMenu.d.ts +0 -48
  236. package/esm/MainMenu.js +0 -136
  237. package/esm/MiniMetrics.d.ts +0 -8
  238. package/esm/MiniMetrics.js +0 -12
  239. package/esm/Modal.d.ts +0 -10
  240. package/esm/Modal.js +0 -14
  241. package/esm/NameCard.d.ts +0 -64
  242. package/esm/NameCard.js +0 -82
  243. package/esm/NameCards.d.ts +0 -6
  244. package/esm/NameCards.js +0 -7
  245. package/esm/NewsHero.d.ts +0 -14
  246. package/esm/NewsHero.js +0 -86
  247. package/esm/PageFilter.d.ts +0 -17
  248. package/esm/PageFilter.js +0 -15
  249. package/esm/PageHeading.d.ts +0 -10
  250. package/esm/PageHeading.js +0 -12
  251. package/esm/Picture.d.ts +0 -7
  252. package/esm/Picture.js +0 -8
  253. package/esm/ProcessOverview.d.ts +0 -13
  254. package/esm/ProcessOverview.js +0 -17
  255. package/esm/PullQuote.d.ts +0 -4
  256. package/esm/PullQuote.js +0 -4
  257. package/esm/RadioButtonsGroup.d.ts +0 -11
  258. package/esm/RadioButtonsGroup.js +0 -14
  259. package/esm/RadioGroup.d.ts +0 -13
  260. package/esm/RadioGroup.js +0 -7
  261. package/esm/RelatedLinks.d.ts +0 -20
  262. package/esm/RelatedLinks.js +0 -26
  263. package/esm/RowBlock.d.ts +0 -12
  264. package/esm/RowBlock.js +0 -9
  265. package/esm/RowBlockColumn.d.ts +0 -8
  266. package/esm/RowBlockColumn.js +0 -11
  267. package/esm/SearchInput.d.ts +0 -18
  268. package/esm/SearchInput.js +0 -33
  269. package/esm/SearchResults/_SearchResultsItem.d.ts +0 -18
  270. package/esm/SearchResults/_SearchResultsItem.js +0 -15
  271. package/esm/SearchResults.d.ts +0 -33
  272. package/esm/SearchResults.js +0 -109
  273. package/esm/SeenEffect.d.ts +0 -4
  274. package/esm/SeenEffect.js +0 -19
  275. package/esm/Selectbox.d.ts +0 -8
  276. package/esm/Selectbox.js +0 -46
  277. package/esm/ShareButtons.d.ts +0 -9
  278. package/esm/ShareButtons.js +0 -51
  279. package/esm/Sharpie.d.ts +0 -23
  280. package/esm/Sharpie.js +0 -22
  281. package/esm/SiteSearchAutocomplete.d.ts +0 -40
  282. package/esm/SiteSearchAutocomplete.js +0 -58
  283. package/esm/SiteSearchCurtain.d.ts +0 -6
  284. package/esm/SiteSearchCurtain.js +0 -33
  285. package/esm/SiteSearchInput.d.ts +0 -24
  286. package/esm/SiteSearchInput.js +0 -40
  287. package/esm/Skeleton.d.ts +0 -25
  288. package/esm/Skeleton.js +0 -30
  289. package/esm/SubHeading.d.ts +0 -10
  290. package/esm/SubHeading.js +0 -13
  291. package/esm/Tabs.d.ts +0 -35
  292. package/esm/Tabs.js +0 -94
  293. package/esm/TagPill.d.ts +0 -27
  294. package/esm/TagPill.js +0 -43
  295. package/esm/TextBlock.d.ts +0 -15
  296. package/esm/TextBlock.js +0 -15
  297. package/esm/TextButton.d.ts +0 -9
  298. package/esm/TextButton.js +0 -9
  299. package/esm/TextInput.d.ts +0 -16
  300. package/esm/TextInput.js +0 -35
  301. package/esm/VSpacer.d.ts +0 -24
  302. package/esm/VSpacer.js +0 -41
  303. package/esm/VerticalTabsTOC.d.ts +0 -14
  304. package/esm/VerticalTabsTOC.js +0 -68
  305. package/esm/WizardLayout.d.ts +0 -15
  306. package/esm/WizardLayout.js +0 -30
  307. package/esm/WizardLayoutClose.d.ts +0 -3
  308. package/esm/WizardLayoutClose.js +0 -4
  309. package/esm/WizardStepper.d.ts +0 -36
  310. package/esm/WizardStepper.js +0 -25
  311. package/esm/_abstract/_AbstractCarousel.d.ts +0 -25
  312. package/esm/_abstract/_AbstractCarousel.js +0 -130
  313. package/esm/_abstract/_Blings.d.ts +0 -11
  314. package/esm/_abstract/_Blings.js +0 -12
  315. package/esm/_abstract/_Block.d.ts +0 -22
  316. package/esm/_abstract/_Block.js +0 -24
  317. package/esm/_abstract/_Button.d.ts +0 -40
  318. package/esm/_abstract/_Button.js +0 -47
  319. package/esm/_abstract/_CardList.d.ts +0 -30
  320. package/esm/_abstract/_CardList.js +0 -38
  321. package/esm/_abstract/_Image.d.ts +0 -36
  322. package/esm/_abstract/_Image.js +0 -27
  323. package/esm/_abstract/_Link.d.ts +0 -27
  324. package/esm/_abstract/_Link.js +0 -24
  325. package/esm/_abstract/_Quote.d.ts +0 -9
  326. package/esm/_abstract/_Quote.js +0 -8
  327. package/esm/_abstract/_TogglerGroup.d.ts +0 -31
  328. package/esm/_abstract/_TogglerGroup.js +0 -29
  329. package/esm/_abstract/_TogglerGroupField.d.ts +0 -17
  330. package/esm/_abstract/_TogglerGroupField.js +0 -22
  331. package/esm/_abstract/_TogglerInput.d.ts +0 -22
  332. package/esm/_abstract/_TogglerInput.js +0 -33
  333. package/esm/_abstract/breakOnNL.d.ts +0 -2
  334. package/esm/_abstract/breakOnNL.js +0 -8
  335. package/esm/assets.d.ts +0 -42
  336. package/esm/assets.js +0 -56
  337. package/esm/constants.d.ts +0 -39
  338. package/esm/constants.js +0 -22
  339. package/esm/focus-visible.d.ts +0 -1
  340. package/esm/focus-visible.js +0 -1
  341. package/esm/package.json +0 -1
  342. package/esm/utils/env.d.ts +0 -1
  343. package/esm/utils/env.js +0 -8
  344. package/esm/utils/seenEffect.d.ts +0 -28
  345. package/esm/utils/seenEffect.js +0 -73
  346. package/esm/utils/useFormatMonitor.d.ts +0 -38
  347. package/esm/utils/useFormatMonitor.js +0 -41
  348. package/esm/utils/useGetSVGtext.d.ts +0 -6
  349. package/esm/utils/useGetSVGtext.js +0 -19
  350. package/esm/utils/useMenuToggling.d.ts +0 -8
  351. package/esm/utils/useMenuToggling.js +0 -62
  352. package/esm/utils/useScrollbarWidthCSSVar.d.ts +0 -1
  353. package/esm/utils/useScrollbarWidthCSSVar.js +0 -3
  354. package/esm/utils.d.ts +0 -2
  355. package/esm/utils.js +0 -2
@@ -1,12 +0,0 @@
1
- import { Efnistakn } from '@reykjavik/hanna-utils/assets';
2
- import { SeenProp } from './utils/seenEffect';
3
- export declare type FeatureListProps = {
4
- title: string;
5
- features: Array<{
6
- icon?: Efnistakn;
7
- iconUrl?: string;
8
- name: string;
9
- }>;
10
- } & SeenProp;
11
- declare const FeatureList: (props: FeatureListProps) => JSX.Element;
12
- export default FeatureList;
@@ -1,16 +0,0 @@
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;
@@ -1,9 +0,0 @@
1
- import { ReactNode } from 'react';
2
- export declare type FieldGroupProps = {
3
- legend: string;
4
- disabled?: boolean;
5
- className?: string;
6
- children: ReactNode;
7
- };
8
- declare const FieldGroup: (props: FieldGroupProps) => JSX.Element;
9
- export default FieldGroup;
package/esm/FieldGroup.js DELETED
@@ -1,9 +0,0 @@
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;
@@ -1,17 +0,0 @@
1
- import { FormFieldWrappingProps } from './FormField';
2
- declare type dropzonePropsProps = {
3
- accept?: string;
4
- multiple?: boolean;
5
- };
6
- export declare type FileInputProps = {
7
- dropzoneProps: dropzonePropsProps;
8
- dropzoneText: string | JSX.Element;
9
- showFileSize?: boolean;
10
- showImagePreviews?: boolean;
11
- removeFileText: string;
12
- onFilesUpdated?: (files: Array<File>) => void;
13
- name?: string;
14
- value?: ReadonlyArray<File>;
15
- } & FormFieldWrappingProps;
16
- declare const FileInput: (props: FileInputProps) => JSX.Element;
17
- export default FileInput;
package/esm/FileInput.js DELETED
@@ -1,154 +0,0 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
- import React, { useEffect, useRef, useState } from 'react';
13
- import { useDropzone } from 'react-dropzone'; // https://react-dropzone.js.org/#!/Dropzone
14
- import { useDomid } from '@hugsmidjan/react/hooks';
15
- import getBemClass from '@hugsmidjan/react/utils/getBemClass';
16
- import FormField from './FormField';
17
- /**
18
- * Attaches a `preview` prop to file objects that don't already have a `preview` key defined
19
- *
20
- * The preview's value is either a data URI (for image-type files) or `undefined`
21
- */
22
- const addPreview = (file) => {
23
- if (!('preview' in file)) {
24
- file.preview = file.type.includes('image/') ? URL.createObjectURL(file) : undefined;
25
- }
26
- };
27
- /**
28
- * Revokes `preview` data URIs to avoid memory leaks
29
- *
30
- * (See: https://developer.mozilla.org/en-US/docs/Web/API/URL/revokeObjectURL)
31
- */
32
- const releasePreview = (file) => {
33
- file.preview && URL.revokeObjectURL(file.preview);
34
- delete file.preview;
35
- };
36
- const arrayToFileList = (arr) => {
37
- const fileList = new DataTransfer();
38
- arr.forEach((item) => {
39
- fileList.items.add(item);
40
- });
41
- return fileList.files;
42
- };
43
- const dedupeFilesArray = (files) => {
44
- const newArray = [];
45
- const found = {};
46
- files.forEach((file) => {
47
- if (!(file.name in found)) {
48
- newArray.push(file);
49
- found[file.name] = true;
50
- }
51
- else {
52
- releasePreview(file);
53
- }
54
- });
55
- return newArray;
56
- };
57
- const formatBytes = (bytes, decimals = 2) => {
58
- if (bytes === 0) {
59
- return '0 Bytes';
60
- }
61
- const k = 1024;
62
- const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
63
- const i = Math.floor(Math.log(bytes) / Math.log(k));
64
- return parseFloat((bytes / Math.pow(k, i)).toFixed(decimals)) + ' ' + sizes[i];
65
- };
66
- const FileInput = (props) => {
67
- const { className, id, label, hideLabel, dropzoneProps = { multiple: true }, dropzoneText, removeFileText, assistText, disabled, invalid, errorMessage, required, reqText, onFilesUpdated = () => undefined, showFileSize, showImagePreviews, value = [] } = props, inputElementProps = __rest(props, ["className", "id", "label", "hideLabel", "dropzoneProps", "dropzoneText", "removeFileText", "assistText", "disabled", "invalid", "errorMessage", "required", "reqText", "onFilesUpdated", "showFileSize", "showImagePreviews", "value"]);
68
- const domid = useDomid(id);
69
- const fileInputWrapper = useRef(null);
70
- const fileInput = useRef(null);
71
- const files = value;
72
- const [isHover, setIsHover] = useState(false);
73
- const { getRootProps, getInputProps, isDragReject, inputRef } = useDropzone(Object.assign({ onDrop: (acceptedFiles) => {
74
- acceptedFiles = acceptedFiles.map((file) => {
75
- addPreview(file);
76
- return file;
77
- });
78
- addFiles(acceptedFiles); // eslint-disable-line
79
- setIsHover(false);
80
- }, onDropRejected: (rejectedFiles) => {
81
- window.alert('Error:\n' +
82
- rejectedFiles
83
- .map((elm) => {
84
- return elm.name;
85
- })
86
- .join(', '));
87
- }, onDragEnter: () => {
88
- // 'dragLeave' always fires right after 'dragEnter', use 'dragOver' instead
89
- // console.log('enter');
90
- // setIsHover(true);
91
- }, onDragLeave: () => {
92
- // console.log('leave');
93
- setIsHover(false);
94
- }, onDragOver: () => {
95
- // TODO: add error icon? 'isDragReject' gives unstable results
96
- // console.log(isDragReject);
97
- setIsHover(true);
98
- } }, dropzoneProps));
99
- // Add previews on incoming files
100
- // (NOTE: `addPreview` ignores files that already have preview.)
101
- files.forEach(addPreview);
102
- useEffect(() => () => {
103
- // Make sure to revoke the data uris on unmount to avoid memory leaks
104
- files.forEach(releasePreview);
105
- }, [files]);
106
- const removeFile = (name) => {
107
- if (fileInput.current) {
108
- const newFileList = files.filter((file) => {
109
- if (file.name !== name) {
110
- return true;
111
- }
112
- releasePreview(file);
113
- });
114
- fileInput.current.files = arrayToFileList(newFileList);
115
- onFilesUpdated(newFileList);
116
- }
117
- };
118
- const addFiles = (filelist) => {
119
- if (fileInput.current) {
120
- const newFileList = dropzoneProps.multiple
121
- ? dedupeFilesArray(files.concat(filelist))
122
- : filelist;
123
- fileInput.current.files = arrayToFileList(newFileList);
124
- onFilesUpdated(newFileList);
125
- }
126
- if (inputRef.current) {
127
- // Empty on every add
128
- inputRef.current.files = arrayToFileList([]);
129
- }
130
- };
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
- } }));
153
- };
154
- export default FileInput;
package/esm/Foonote.d.ts DELETED
@@ -1,12 +0,0 @@
1
- import { FootnoteProps as _FootnoteProps } from './Footnote';
2
- /** @deprecated (Will be removed in v0.11)
3
- *
4
- * This module file is a typo. import from `Footnote` instead
5
- */
6
- export declare type FootnoteProps = _FootnoteProps;
7
- /** @deprecated (Will be removed in v0.11)
8
- *
9
- * This module file is a typo. import from `Footnote` instead
10
- */
11
- declare const Footnote: (props: _FootnoteProps) => JSX.Element;
12
- export default Footnote;
package/esm/Foonote.js DELETED
@@ -1,7 +0,0 @@
1
- import _Footnote from './Footnote';
2
- /** @deprecated (Will be removed in v0.11)
3
- *
4
- * This module file is a typo. import from `Footnote` instead
5
- */
6
- const Footnote = _Footnote;
7
- export default Footnote;
@@ -1,9 +0,0 @@
1
- export declare type FooterBadgesProps = {
2
- badges: Array<{
3
- altText: string;
4
- src: string;
5
- href?: string;
6
- }>;
7
- };
8
- declare const FooterBadges: (props: FooterBadgesProps) => JSX.Element | null;
9
- export default FooterBadges;
@@ -1,12 +0,0 @@
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;
@@ -1,18 +0,0 @@
1
- import { BemPropsModifier } from '@hugsmidjan/react/types';
2
- export declare type FooterInfoGroup = {
3
- title: string;
4
- role?: JSX.IntrinsicElements['div']['role'];
5
- modifier?: string;
6
- } & BemPropsModifier & ({
7
- content: JSX.Element;
8
- html?: undefined;
9
- } | {
10
- html: string;
11
- content?: undefined;
12
- });
13
- export declare type FooterInfoBoxes = Array<FooterInfoGroup>;
14
- export declare type FooterInfoProps = {
15
- boxes: FooterInfoBoxes;
16
- };
17
- declare const FooterInfo: (props: FooterInfoProps) => JSX.Element;
18
- export default FooterInfo;
package/esm/FooterInfo.js DELETED
@@ -1,9 +0,0 @@
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;
package/esm/Footnote.d.ts DELETED
@@ -1,6 +0,0 @@
1
- import { ReactNode } from 'react';
2
- export declare type FootnoteProps = {
3
- children: ReactNode;
4
- };
5
- declare const Footnote: (props: FootnoteProps) => JSX.Element;
6
- export default Footnote;
package/esm/Footnote.js DELETED
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- const Footnote = (props) => (React.createElement("div", { className: "Footnote" }, props.children));
3
- export default Footnote;
package/esm/Form.d.ts DELETED
@@ -1,7 +0,0 @@
1
- import React, { ReactNode } from 'react';
2
- import { ComponentLayoutProps } from './constants';
3
- export declare type FormProps = ComponentLayoutProps & React.FormHTMLAttributes<HTMLFormElement> & {
4
- children: ReactNode;
5
- };
6
- declare const Form: (props: FormProps) => JSX.Element;
7
- export default Form;
package/esm/Form.js DELETED
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- import getBemClass from '@hugsmidjan/react/utils/getBemClass';
3
- const Form = (props) => {
4
- const { children, align, wide } = props;
5
- return (React.createElement("form", Object.assign({}, props, { className: getBemClass('Form', [
6
- align === 'right' && 'align--' + align,
7
- !align && wide && 'wide',
8
- ]) }), children));
9
- };
10
- export default Form;
@@ -1,65 +0,0 @@
1
- import { RefObject } from 'react';
2
- import { SSRSupport } from '@hugsmidjan/react/hooks';
3
- declare type InputClassNames = {
4
- /** Basic/raw FormField BEM name */
5
- bem: string;
6
- /** Standard name for "<input/>"-styled controls */
7
- input: string;
8
- /** Standard name for radio/checkbox group conotrols */
9
- options: string;
10
- /** Generic name for unstyled/free-form controls. */
11
- control: string;
12
- };
13
- export declare type FormFieldInputProps = {
14
- id?: string;
15
- required?: boolean;
16
- readOnly?: boolean;
17
- disabled?: boolean;
18
- 'aria-invalid'?: boolean | 'true' | 'false';
19
- 'aria-labelledby'?: string;
20
- 'aria-describedby'?: string;
21
- };
22
- declare type FocusEvents = {
23
- onFocus?: (e: any) => void;
24
- onBlur?: (e: any) => void;
25
- };
26
- declare type FocusPropMaker = <P extends FocusEvents>(ownProps?: P) => P & Required<FocusEvents>;
27
- export declare type FormFieldWrappingProps = {
28
- /** Container className - alongside "FormField" */
29
- className?: string;
30
- label: string | JSX.Element;
31
- assistText?: string | JSX.Element;
32
- hideLabel?: boolean;
33
- disabled?: boolean;
34
- readOnly?: boolean;
35
- invalid?: boolean;
36
- errorMessage?: string | JSX.Element;
37
- required?: boolean;
38
- /** Hidden label prefix text to indicate that the field is required.
39
- *
40
- * If your field is required but should not say so in its label
41
- * then set this prop to `false`
42
- *
43
- * Default: `"Þarf að fylla út"`
44
- * */
45
- reqText?: string | false;
46
- /** Optional pre-determinted id="" for the __input */
47
- id?: string;
48
- /** Ref object pointing to the outermost `.FormField` element */
49
- wrapperRef?: RefObject<HTMLElement>;
50
- ssr?: SSRSupport;
51
- };
52
- export declare type FormFieldGroupWrappingProps = FormFieldWrappingProps & {
53
- LabelTag?: 'h3' | 'h4' | 'h5';
54
- };
55
- export declare type FormFieldProps = FormFieldGroupWrappingProps & {
56
- /** Container className - alongside "FormField" */
57
- className: string;
58
- small?: boolean;
59
- group?: boolean;
60
- empty?: boolean;
61
- filled?: boolean;
62
- renderInput(className: InputClassNames, inputProps: FormFieldInputProps, addFocusProps: FocusPropMaker, isBrowser?: boolean): JSX.Element;
63
- };
64
- declare const FormField: (props: FormFieldProps) => JSX.Element;
65
- export default FormField;
package/esm/FormField.js DELETED
@@ -1,91 +0,0 @@
1
- import React, { useCallback, useState } from 'react';
2
- import { useDomid, useIsBrowserSide } from '@hugsmidjan/react/hooks';
3
- import getBemClass from '@hugsmidjan/react/utils/getBemClass';
4
- import { isPreact } from './utils/env';
5
- const inputClassNames = {
6
- bem: 'FormField',
7
- input: 'FormField__input',
8
- options: 'FormField__options',
9
- control: 'FormField__control',
10
- };
11
- // ---------------------------------------------------------------------------
12
- // eslint-disable-next-line complexity
13
- const FormField = (props) => {
14
- const { className, small, group, LabelTag = group ? 'h4' : undefined, label, assistText, hideLabel, empty, filled, readOnly, disabled, invalid, errorMessage, required, reqText, // i18n
15
- renderInput, id, ssr, } = props;
16
- const isBrowser = useIsBrowserSide(ssr);
17
- const isInvalid = invalid || !!errorMessage || undefined;
18
- const domid = useDomid(id);
19
- const [focused, setFocused] = useState(false);
20
- // @ts-expect-error (Duck knows why this errors?!)
21
- const addFocusProps = useCallback((ownProps) => {
22
- const { onFocus, onBlur } = ownProps || {};
23
- const focusHandler = (e) => {
24
- if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {
25
- setFocused(true);
26
- }
27
- onFocus && onFocus(e);
28
- };
29
- const blurHandler = (e) => {
30
- if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {
31
- setFocused(false);
32
- }
33
- onBlur && onBlur(e);
34
- };
35
- const focusProps = Object.assign(Object.assign({}, ownProps), { onFocus: focusHandler, onBlur: blurHandler });
36
- if (isPreact) {
37
- const focusinHandler = (e) => {
38
- e.currentTarget !== e.target && focusHandler(e);
39
- };
40
- const focusoutHandler = (e) => {
41
- e.currentTarget !== e.target && blurHandler(e);
42
- };
43
- // @ts-expect-error (Sneak this in as Preact does not bubble `FocusEvent`s)
44
- focusProps.onfocusin = focusinHandler;
45
- // @ts-expect-error (Sneak this in as Preact does not bubble `FocusEvent`s)
46
- focusProps.onfocusout = focusoutHandler;
47
- }
48
- return focusProps;
49
- }, []);
50
- const errorId = errorMessage ? 'error:' + domid : undefined;
51
- const assistTextId = assistText ? 'assist:' + domid : undefined;
52
- const labelId = LabelTag ? 'label:' + domid : undefined;
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') + ': ' }, "*"));
56
- const inputProps = {
57
- id: domid,
58
- disabled: disabled,
59
- required: required,
60
- readOnly: readOnly,
61
- 'aria-invalid': isInvalid,
62
- 'aria-describedby': assistTextId && errorId ? assistTextId + ' ' + errorId : assistTextId || errorId,
63
- 'aria-labelledby': labelId, // undefined if normalLabel
64
- };
65
- return (React.createElement("div", { className: getBemClass('FormField', [
66
- small && 'small',
67
- hideLabel && 'nolabel',
68
- isInvalid && 'invalid',
69
- disabled && 'disabled',
70
- readOnly && 'readonly',
71
- isBrowser && empty && 'empty',
72
- isBrowser && filled && 'filled',
73
- isBrowser && focused && 'focused',
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))));
90
- };
91
- export default FormField;
@@ -1,8 +0,0 @@
1
- import { ImageProps } from '../_abstract/_Image';
2
- export declare type GalleryItemProps = {
3
- caption?: string;
4
- description?: string;
5
- largeImageSrc?: string;
6
- } & ImageProps;
7
- declare const GalleryItem: (props: GalleryItemProps) => JSX.Element;
8
- export default GalleryItem;
@@ -1,30 +0,0 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
- import React, { useContext } from 'react';
13
- import Button from '../_abstract/_Button';
14
- import Image from '../_abstract/_Image';
15
- import GalleryModalContext from './_GalleryModalContext';
16
- const GalleryItem = (props) => {
17
- const { caption, description, largeImageSrc } = props, image = __rest(props, ["caption", "description", "largeImageSrc"]);
18
- const { setCurrentImage } = useContext(GalleryModalContext);
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
- e.preventDefault();
23
- setCurrentImage(Object.assign(Object.assign({}, image), { caption, description, largeImageSrc }));
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)));
29
- };
30
- export default GalleryItem;
@@ -1,6 +0,0 @@
1
- import { GalleryI18n } from '../Gallery';
2
- declare type GalleryModalProps = {
3
- texts: Readonly<GalleryI18n>;
4
- };
5
- declare const GalleryModal: (props: GalleryModalProps) => JSX.Element | null;
6
- export default GalleryModal;
@@ -1,54 +0,0 @@
1
- import React, { useContext, useEffect, useState } from 'react';
2
- import { CSSTransition } from 'react-transition-group';
3
- import { objectClean, objectIsSame } from '@hugsmidjan/qj/object';
4
- import CarouselPaging from '@hugsmidjan/react/CarouselPaging';
5
- import Modal from '@hugsmidjan/react/Modal';
6
- import GalleryModalContext from './_GalleryModalContext';
7
- import GalleryModalItem from './_GalleryModalItem';
8
- const GalleryModal = (props) => {
9
- const { texts } = props;
10
- const { currentImage, items, setCurrentImage } = useContext(GalleryModalContext);
11
- const [image, setImage] = useState(currentImage);
12
- const [animated, setAnimated] = useState(false);
13
- const updateImage = (index) => {
14
- setAnimated(!animated);
15
- setTimeout(() => {
16
- setCurrentImage(items[index]);
17
- }, 200);
18
- };
19
- useEffect(() => {
20
- if (image !== currentImage) {
21
- const imgSource = (currentImage === null || currentImage === void 0 ? void 0 : currentImage.largeImageSrc) || (currentImage === null || currentImage === void 0 ? void 0 : currentImage.src);
22
- if (imgSource) {
23
- const imageToLoad = new window.Image();
24
- imageToLoad.src = imgSource;
25
- imageToLoad.onload = () => {
26
- setImage(currentImage);
27
- };
28
- }
29
- else {
30
- setImage(undefined);
31
- }
32
- }
33
- }, [image, currentImage]);
34
- if (!image) {
35
- return null;
36
- }
37
- const imageIndex = items.findIndex((item) =>
38
- // FIXME: This if weirdly inefficient. Either memoize,
39
- // or do a simpler single-property comparison.
40
- objectIsSame(objectClean(image), objectClean(item)));
41
- return (React.createElement(Modal, { open: true, onClosed: () => {
42
- setCurrentImage(undefined);
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
- } }))));
53
- };
54
- export default GalleryModal;
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- import { GalleryProps } from '../Gallery';
3
- import { GalleryItemProps } from './_GalleryItem';
4
- declare type ModalContextProps = {
5
- setCurrentImage: (item: GalleryItemProps | undefined) => void;
6
- currentImage: GalleryItemProps | undefined;
7
- } & GalleryProps;
8
- declare const GalleryModalContext: React.Context<ModalContextProps>;
9
- export default GalleryModalContext;
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- const GalleryModalContext = React.createContext({});
3
- export default GalleryModalContext;
@@ -1,3 +0,0 @@
1
- import { GalleryItemProps } from './_GalleryItem';
2
- declare const GalleryModalItem: (props: GalleryItemProps) => JSX.Element;
3
- export default GalleryModalItem;
@@ -1,22 +0,0 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
- import React from 'react';
13
- import Image from '../_abstract/_Image';
14
- const GalleryModalItem = (props) => {
15
- const { caption, description } = props, image = __rest(props, ["caption", "description"]);
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 })));
21
- };
22
- export default GalleryModalItem;