@reykjavik/hanna-react 0.10.70 → 0.10.72

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 (216) hide show
  1. package/AccordionList.d.ts +1 -1
  2. package/AccordionList.js +3 -1
  3. package/ActionCards.d.ts +1 -1
  4. package/ActionCards.js +3 -1
  5. package/Alert.d.ts +2 -3
  6. package/Alert.js +5 -4
  7. package/ArticleCards.d.ts +4 -2
  8. package/ArticleCards.js +3 -1
  9. package/ArticleCarousel/_ArticleCarouselCard.d.ts +1 -1
  10. package/ArticleCarousel/_ArticleCarouselCard.js +2 -2
  11. package/ArticleCarousel.d.ts +1 -1
  12. package/ArticleCarousel.js +5 -3
  13. package/ArticleMeta.d.ts +1 -1
  14. package/ArticleMeta.js +3 -1
  15. package/Attention.d.ts +1 -1
  16. package/Attention.js +3 -1
  17. package/BasicTable.d.ts +5 -3
  18. package/BasicTable.js +3 -1
  19. package/BgBox.d.ts +1 -1
  20. package/BgBox.js +3 -1
  21. package/Bling.d.ts +1 -1
  22. package/Bling.js +3 -1
  23. package/BlockBreak.d.ts +1 -1
  24. package/BlockBreak.js +3 -1
  25. package/BlockQuote.d.ts +1 -1
  26. package/BlockQuote.js +4 -2
  27. package/BreadCrumbs.d.ts +1 -1
  28. package/BreadCrumbs.js +3 -1
  29. package/ButtonBack.d.ts +1 -1
  30. package/ButtonBack.js +5 -3
  31. package/ButtonPrimary.d.ts +1 -1
  32. package/ButtonPrimary.js +5 -3
  33. package/ButtonSecondary.d.ts +1 -1
  34. package/ButtonSecondary.js +5 -3
  35. package/ButtonTertiary.d.ts +1 -1
  36. package/ButtonTertiary.js +5 -3
  37. package/CHANGELOG.md +41 -0
  38. package/Carousel.d.ts +1 -1
  39. package/Carousel.js +5 -3
  40. package/CarouselStepper.d.ts +1 -1
  41. package/CarouselStepper.js +3 -1
  42. package/CenterColumn.d.ts +1 -1
  43. package/CenterColumn.js +3 -1
  44. package/Checkbox.d.ts +1 -1
  45. package/Checkbox.js +5 -3
  46. package/CheckboxButtonsGroup.d.ts +3 -3
  47. package/CheckboxButtonsGroup.js +7 -5
  48. package/CheckboxGroup.d.ts +1 -1
  49. package/CheckboxGroup.js +5 -3
  50. package/CityBlock.d.ts +1 -1
  51. package/CityBlock.js +5 -3
  52. package/ContactBubble.d.ts +1 -1
  53. package/ContactBubble.js +3 -2
  54. package/ContentArticle.d.ts +2 -2
  55. package/ContentArticle.js +8 -5
  56. package/ContentImage.d.ts +1 -1
  57. package/ContentImage.js +5 -3
  58. package/Datepicker.d.ts +2 -1
  59. package/Datepicker.js +8 -7
  60. package/ExtraLinks.d.ts +1 -1
  61. package/ExtraLinks.js +3 -1
  62. package/FeatureList.d.ts +1 -1
  63. package/FeatureList.js +3 -1
  64. package/FieldGroup.d.ts +1 -1
  65. package/FieldGroup.js +3 -1
  66. package/FileInput/_FileInput.utils.d.ts +1 -1
  67. package/FileInput/_FileInput.utils.js +12 -5
  68. package/FileInput/_FileInputFileList.js +2 -2
  69. package/FileInput.d.ts +5 -5
  70. package/FileInput.js +19 -10
  71. package/Foonote.d.ts +1 -1
  72. package/Foonote.js +3 -2
  73. package/FooterBadges.d.ts +1 -1
  74. package/FooterBadges.js +3 -1
  75. package/FooterInfo.d.ts +4 -2
  76. package/FooterInfo.js +7 -2
  77. package/Footnote.d.ts +1 -1
  78. package/Footnote.js +3 -1
  79. package/Form.d.ts +1 -1
  80. package/Form.js +3 -1
  81. package/FormField.d.ts +1 -1
  82. package/FormField.js +3 -1
  83. package/Gallery/_GalleryItem.d.ts +1 -2
  84. package/Gallery/_GalleryItem.js +9 -8
  85. package/Gallery/_GalleryModal.d.ts +2 -2
  86. package/Gallery/_GalleryModal.js +6 -5
  87. package/Gallery/_GalleryModalContext.d.ts +2 -2
  88. package/Gallery/_GalleryModalContext.js +2 -2
  89. package/Gallery/_GalleryModalItem.d.ts +1 -2
  90. package/Gallery/_GalleryModalItem.js +4 -3
  91. package/Gallery.d.ts +1 -1
  92. package/Gallery.js +10 -8
  93. package/GridBlocks.d.ts +1 -1
  94. package/GridBlocks.js +5 -3
  95. package/Heading.d.ts +3 -2
  96. package/Heading.js +5 -2
  97. package/HeroBlock.d.ts +1 -1
  98. package/HeroBlock.js +5 -3
  99. package/IframeBlock.d.ts +3 -1
  100. package/IframeBlock.js +5 -3
  101. package/Illustration.d.ts +5 -8
  102. package/Illustration.js +5 -3
  103. package/ImageCards.d.ts +3 -3
  104. package/ImageCards.js +3 -1
  105. package/InfoBlock.d.ts +8 -12
  106. package/InfoBlock.js +4 -2
  107. package/InfoHero.d.ts +1 -1
  108. package/InfoHero.js +9 -7
  109. package/IslandBlock.d.ts +1 -1
  110. package/IslandBlock.js +5 -3
  111. package/IslandPageBlock.d.ts +1 -1
  112. package/IslandPageBlock.js +5 -3
  113. package/LabeledTextBlock.d.ts +1 -1
  114. package/LabeledTextBlock.js +3 -1
  115. package/Layout.d.ts +2 -2
  116. package/Layout.js +5 -4
  117. package/MainMenu.d.ts +1 -1
  118. package/MainMenu.js +10 -6
  119. package/MiniMetrics.d.ts +1 -1
  120. package/MiniMetrics.js +5 -3
  121. package/Modal.d.ts +2 -4
  122. package/Modal.js +3 -1
  123. package/NameCard.d.ts +1 -1
  124. package/NameCard.js +7 -5
  125. package/NameCards.d.ts +1 -1
  126. package/NameCards.js +3 -1
  127. package/NewsHero.d.ts +1 -1
  128. package/NewsHero.js +6 -4
  129. package/PageFilter.d.ts +1 -1
  130. package/PageFilter.js +3 -1
  131. package/PageHeading.d.ts +1 -1
  132. package/PageHeading.js +3 -1
  133. package/Picture.d.ts +1 -1
  134. package/Picture.js +5 -3
  135. package/ProcessOverview.d.ts +1 -1
  136. package/ProcessOverview.js +3 -1
  137. package/PullQuote.d.ts +1 -1
  138. package/PullQuote.js +3 -1
  139. package/README.md +6 -1
  140. package/RadioButtonsGroup.d.ts +3 -3
  141. package/RadioButtonsGroup.js +7 -5
  142. package/RadioGroup.d.ts +4 -2
  143. package/RadioGroup.js +9 -6
  144. package/RelatedLinks.d.ts +1 -1
  145. package/RelatedLinks.js +3 -1
  146. package/RowBlock.d.ts +1 -1
  147. package/RowBlock.js +3 -1
  148. package/RowBlockColumn.d.ts +1 -1
  149. package/RowBlockColumn.js +3 -1
  150. package/SearchInput.d.ts +2 -2
  151. package/SearchInput.js +4 -2
  152. package/SearchResults/_SearchResultsItem.d.ts +2 -2
  153. package/SearchResults/_SearchResultsItem.js +4 -3
  154. package/SearchResults.d.ts +1 -1
  155. package/SearchResults.js +7 -6
  156. package/SeenEffect.d.ts +1 -1
  157. package/SeenEffect.js +3 -1
  158. package/Selectbox.d.ts +1 -1
  159. package/Selectbox.js +15 -9
  160. package/ShareButtons.d.ts +2 -2
  161. package/ShareButtons.js +15 -8
  162. package/Sharpie.d.ts +1 -1
  163. package/Sharpie.js +3 -1
  164. package/SiteSearchAutocomplete.d.ts +2 -2
  165. package/SiteSearchAutocomplete.js +4 -3
  166. package/SiteSearchCurtain.d.ts +1 -1
  167. package/SiteSearchCurtain.js +3 -1
  168. package/SiteSearchInput.d.ts +2 -2
  169. package/SiteSearchInput.js +3 -2
  170. package/Skeleton.d.ts +1 -1
  171. package/Skeleton.js +5 -3
  172. package/SubHeading.d.ts +1 -1
  173. package/SubHeading.js +3 -1
  174. package/Tabs.d.ts +1 -1
  175. package/Tabs.js +4 -2
  176. package/TagPill.d.ts +1 -1
  177. package/TagPill.js +6 -4
  178. package/TextBlock.d.ts +1 -1
  179. package/TextBlock.js +3 -1
  180. package/TextButton.d.ts +1 -1
  181. package/TextButton.js +5 -3
  182. package/TextInput.d.ts +2 -2
  183. package/TextInput.js +3 -1
  184. package/VSpacer.d.ts +1 -1
  185. package/VSpacer.js +3 -1
  186. package/VerticalTabsTOC.d.ts +1 -1
  187. package/VerticalTabsTOC.js +3 -1
  188. package/WizardLayout.d.ts +4 -4
  189. package/WizardLayout.js +5 -3
  190. package/WizardLayoutClose.d.ts +1 -1
  191. package/WizardLayoutClose.js +5 -3
  192. package/WizardStepper.d.ts +2 -2
  193. package/WizardStepper.js +5 -2
  194. package/_abstract/_AbstractCarousel.d.ts +12 -5
  195. package/_abstract/_AbstractCarousel.js +8 -3
  196. package/_abstract/_Blings.d.ts +2 -2
  197. package/_abstract/_Blings.js +2 -1
  198. package/_abstract/_Block.d.ts +1 -2
  199. package/_abstract/_Block.js +6 -5
  200. package/_abstract/_Button.d.ts +2 -2
  201. package/_abstract/_Button.js +2 -1
  202. package/_abstract/_CardList.js +4 -4
  203. package/_abstract/_Image.d.ts +2 -2
  204. package/_abstract/_Image.js +2 -1
  205. package/_abstract/_TogglerGroup.d.ts +2 -3
  206. package/_abstract/_TogglerGroup.js +2 -1
  207. package/_abstract/_TogglerGroupField.d.ts +2 -2
  208. package/_abstract/_TogglerGroupField.js +4 -3
  209. package/_abstract/_TogglerInput.d.ts +3 -3
  210. package/_abstract/_TogglerInput.js +2 -1
  211. package/_abstract/breakOnNL.d.ts +1 -2
  212. package/_abstract/breakOnNL.js +2 -1
  213. package/assets.js +1 -1
  214. package/constants.d.ts +8 -28
  215. package/focus-visible.js +2 -0
  216. package/package.json +4 -4
package/WizardLayout.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { SSRSupport } from '@hugsmidjan/react/hooks';
3
- import { HannaColorTheme } from '@reykjavik/hanna-css';
3
+ import type { HannaColorTheme } from '@reykjavik/hanna-css';
4
4
  declare type WizardLayoutProps = {
5
- wizardStepper?: ReactNode;
6
- wizardFooter?: ReactNode;
5
+ wizardStepper?: ReactNode | false;
6
+ wizardFooter?: ReactNode | false;
7
7
  colorTheme?: HannaColorTheme;
8
8
  siteName?: string;
9
9
  logoLink?: string;
@@ -11,5 +11,5 @@ declare type WizardLayoutProps = {
11
11
  ssr?: SSRSupport;
12
12
  children?: ReactNode;
13
13
  };
14
- declare const WizardLayout: (props: WizardLayoutProps) => JSX.Element;
14
+ export declare const WizardLayout: (props: WizardLayoutProps) => JSX.Element;
15
15
  export default WizardLayout;
package/WizardLayout.js CHANGED
@@ -1,10 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WizardLayout = void 0;
3
4
  const tslib_1 = require("tslib");
4
5
  const react_1 = tslib_1.__importDefault(require("react"));
5
6
  const hooks_1 = require("@hugsmidjan/react/hooks");
6
7
  const assets_1 = require("@reykjavik/hanna-utils/assets");
7
- const _Image_1 = tslib_1.__importDefault(require("./_abstract/_Image"));
8
+ const _Image_1 = require("./_abstract/_Image");
8
9
  const _Link_1 = require("./_abstract/_Link");
9
10
  const useScrollbarWidthCSSVar_1 = require("./utils/useScrollbarWidthCSSVar");
10
11
  const WizardLayout = (props) => {
@@ -19,7 +20,7 @@ const WizardLayout = (props) => {
19
20
  react_1.default.createElement("div", { className: "WizardLayout__header", role: "banner" },
20
21
  react_1.default.createElement(_Link_1.Link, { className: "WizardLayout__header__logo", href: logoLink },
21
22
  ' ',
22
- react_1.default.createElement(_Image_1.default, { className: undefined, inline: true, src: (0, assets_1.getAssetUrl)('reykjavik-logo.svg') }),
23
+ react_1.default.createElement(_Image_1.Image, { className: undefined, inline: true, src: (0, assets_1.getAssetUrl)('reykjavik-logo.svg') }),
23
24
  ' ',
24
25
  siteName,
25
26
  ' '),
@@ -30,4 +31,5 @@ const WizardLayout = (props) => {
30
31
  react_1.default.createElement("div", { className: "WizardLayout__deco WizardLayout__deco--geometry" })),
31
32
  react_1.default.createElement("div", { className: "WizardLayout__footer", role: "complementary" }, wizardFooter))));
32
33
  };
33
- exports.default = WizardLayout;
34
+ exports.WizardLayout = WizardLayout;
35
+ exports.default = exports.WizardLayout;
@@ -1,3 +1,3 @@
1
1
  import { ButtonProps } from './_abstract/_Button';
2
- declare const WizardLayoutClose: (props: ButtonProps) => JSX.Element;
2
+ export declare const WizardLayoutClose: (props: ButtonProps) => JSX.Element;
3
3
  export default WizardLayoutClose;
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WizardLayoutClose = void 0;
3
4
  const tslib_1 = require("tslib");
4
5
  const react_1 = tslib_1.__importDefault(require("react"));
5
- const _Button_1 = tslib_1.__importDefault(require("./_abstract/_Button"));
6
- const WizardLayoutClose = (props) => (react_1.default.createElement(_Button_1.default, Object.assign({ bem: "WizardLayoutClose" }, props)));
7
- exports.default = WizardLayoutClose;
6
+ const _Button_1 = require("./_abstract/_Button");
7
+ const WizardLayoutClose = (props) => (react_1.default.createElement(_Button_1.Button, Object.assign({ bem: "WizardLayoutClose" }, props)));
8
+ exports.WizardLayoutClose = WizardLayoutClose;
9
+ exports.default = exports.WizardLayoutClose;
@@ -26,11 +26,11 @@ export declare type WizardStepperProps = {
26
26
  steps: ReadonlyArray<WizardStepperStep>;
27
27
  /** Zero-based index of the active (current) step */
28
28
  activeStep?: number;
29
- /** By default, clickable "done" steps remain clickable */
29
+ /** By default, clickable steps remain clickable once "done" */
30
30
  disableBacktrack?: boolean;
31
31
  /** By default, clickable steps after the active step are not immediately clickable */
32
32
  allowForwardSkip?: boolean;
33
33
  onClick: (clickedIndex: number) => void;
34
34
  };
35
- declare const WizardStepper: (props: WizardStepperProps) => JSX.Element;
35
+ export declare const WizardStepper: (props: WizardStepperProps) => JSX.Element;
36
36
  export default WizardStepper;
package/WizardStepper.js CHANGED
@@ -1,12 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WizardStepper = void 0;
3
4
  const tslib_1 = require("tslib");
4
5
  const react_1 = tslib_1.__importDefault(require("react"));
5
6
  const getBemClass_1 = tslib_1.__importDefault(require("@hugsmidjan/react/utils/getBemClass"));
6
7
  const WizardStepper = (props) => {
7
8
  const { steps, activeStep = -1, allowForwardSkip, disableBacktrack, onClick } = props;
8
9
  return (react_1.default.createElement("div", { className: (0, getBemClass_1.default)('WizardStepper', activeStep === -1 && 'preview') }, steps.map((step, i) => {
9
- const { label, clickable, done, neutral } = step;
10
+ const { clickable, done, neutral } = step;
11
+ const label = step.label || '…';
10
12
  const stepClass = (0, getBemClass_1.default)('WizardStepper__step', [
11
13
  (done || (done == null && i < activeStep)) && 'done',
12
14
  neutral && 'neutral',
@@ -25,4 +27,5 @@ const WizardStepper = (props) => {
25
27
  ' '));
26
28
  })));
27
29
  };
28
- exports.default = WizardStepper;
30
+ exports.WizardStepper = WizardStepper;
31
+ exports.default = exports.WizardStepper;
@@ -1,4 +1,4 @@
1
- import { ReactElement } from 'react';
1
+ import { ReactElement, ReactNode } from 'react';
2
2
  import { SSRSupport } from '@hugsmidjan/react/hooks';
3
3
  import { BemProps } from '@hugsmidjan/react/types';
4
4
  import { EitherObj } from '@reykjavik/hanna-utils';
@@ -13,10 +13,17 @@ export declare type CarouselProps<I extends Record<string, unknown> = {}, P exte
13
13
  Component: (props: P extends undefined ? I : I & P) => ReactElement | null;
14
14
  ComponentProps?: P;
15
15
  }, {
16
- children: Array<ReactElement>;
16
+ children: ReactNode;
17
+ /**
18
+ * Explicit number of items contained by the `children` prop
19
+ *
20
+ * Use this when your returned child elements are wrapped in a
21
+ * `<Fragment />` or some such.
22
+ */
23
+ itemCount?: number;
17
24
  }> & SeenProp;
18
- declare type AbstractCarouselProps<I extends Record<string, unknown> = {}, P extends Record<string, unknown> | undefined = {}> = CarouselProps<I, P> & BemProps & {
25
+ declare type AbstractCarouselProps<I extends Record<string, unknown> = Record<string, unknown>, P extends Record<string, unknown> | undefined = Record<string, unknown>> = CarouselProps<I, P> & BemProps & {
19
26
  title?: string;
20
27
  };
21
- declare const AbstractCarousel: <I extends Record<string, unknown> = {}, P extends Record<string, unknown> | undefined = {}>(props: AbstractCarouselProps<I, P>) => JSX.Element | null;
22
- export default AbstractCarousel;
28
+ export declare const AbstractCarousel: <I extends Record<string, unknown> = Record<string, unknown>, P extends Record<string, unknown> | undefined = Record<string, unknown>>(props: AbstractCarouselProps<I, P>) => JSX.Element | null;
29
+ export {};
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AbstractCarousel = void 0;
3
4
  const tslib_1 = require("tslib");
4
5
  const react_1 = tslib_1.__importStar(require("react"));
5
6
  const A_1 = tslib_1.__importDefault(require("@hugsmidjan/qj/A"));
@@ -24,9 +25,13 @@ const scrollXBy = (elm, deltaX) => {
24
25
  };
25
26
  const AbstractCarousel = (props) => {
26
27
  const { title, items = [], Component, ComponentProps, bem = 'Carousel', modifier, ssr, startSeen, } = props;
27
- const children = props.children && props.children.filter(hanna_utils_1.notNully);
28
+ const children = !props.children
29
+ ? undefined
30
+ : Array.isArray(props.children)
31
+ ? props.children.filter(hanna_utils_1.notNully)
32
+ : [props.children];
28
33
  const [leftOffset, setLeftOffset] = (0, react_1.useState)();
29
- const itemCount = (children || items).length;
34
+ const itemCount = props.itemCount || (children || items).length;
30
35
  const listRef = (0, react_1.useRef)(null);
31
36
  const [activeItem, setActiveItem] = (0, react_1.useState)(0);
32
37
  const isBrowser = (0, hooks_1.useIsBrowserSide)(ssr);
@@ -105,4 +110,4 @@ const AbstractCarousel = (props) => {
105
110
  }, onMouseOver: () => delayedScrollRight(activeItem), onMouseOut: () => delayedScrollRight.cancel() })))) : (itemList),
106
111
  isBrowser && (react_1.default.createElement(CarouselStepper_1.default, { itemCount: itemCount, setCurrent: scrollToItem, current: activeItem }))));
107
112
  };
108
- exports.default = AbstractCarousel;
113
+ exports.AbstractCarousel = AbstractCarousel;
@@ -7,5 +7,5 @@ declare type BlingsProps = {
7
7
  blings: BlingComboProps;
8
8
  mirror?: boolean;
9
9
  };
10
- declare const Blings: (props: BlingsProps) => JSX.Element;
11
- export default Blings;
10
+ export declare const Blings: (props: BlingsProps) => JSX.Element;
11
+ export {};
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Blings = void 0;
3
4
  const tslib_1 = require("tslib");
4
5
  const react_1 = tslib_1.__importDefault(require("react"));
5
6
  const Bling_1 = tslib_1.__importDefault(require("../Bling"));
@@ -12,4 +13,4 @@ const inverseAlignments = {
12
13
  right: 'left',
13
14
  };
14
15
  const Blings = (props) => (react_1.default.createElement(react_1.default.Fragment, null, props.blings.map(({ type, align, vertical, color, overlay, parent }, i) => (react_1.default.createElement(Bling_1.default, { key: type + '-' + i, type: type, align: props.mirror ? inverseAlignments[align || 'left'] : align, vertical: vertical, color: color, overlay: overlay, parent: parent })))));
15
- exports.default = Blings;
16
+ exports.Blings = Blings;
@@ -16,7 +16,6 @@ export declare type ContentBlock = {
16
16
  image?: undefined;
17
17
  } & SeenProp;
18
18
  export declare type BlockProps = BemPropsModifier & (ContentBlock | ContentImageBlock);
19
- declare const Block: (props: BlockProps & {
19
+ export declare const Block: (props: BlockProps & {
20
20
  bem: string;
21
21
  }) => JSX.Element;
22
- export default Block;
@@ -1,11 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Block = void 0;
3
4
  const tslib_1 = require("tslib");
4
5
  const react_1 = tslib_1.__importDefault(require("react"));
5
6
  const getBemClass_1 = tslib_1.__importDefault(require("@hugsmidjan/react/utils/getBemClass"));
6
7
  const seenEffect_1 = require("../utils/seenEffect");
7
- const _Button_1 = tslib_1.__importDefault(require("./_Button"));
8
- const _Image_1 = tslib_1.__importDefault(require("./_Image"));
8
+ const _Button_1 = require("./_Button");
9
+ const _Image_1 = require("./_Image");
9
10
  const Block = (props) => {
10
11
  const { image, modifier, bem, content, startSeen } = props;
11
12
  const [ref] = (0, seenEffect_1.useSeenEffect)(startSeen);
@@ -19,9 +20,9 @@ const Block = (props) => {
19
20
  buttons.length > 0 && (react_1.default.createElement("div", { className: `${bem}__buttons` },
20
21
  ' ',
21
22
  buttons.map((buttonProps, i) => (react_1.default.createElement(react_1.default.Fragment, null,
22
- react_1.default.createElement(_Button_1.default, Object.assign({ bem: `${bem}__button`, key: i }, buttonProps)),
23
+ react_1.default.createElement(_Button_1.Button, Object.assign({ bem: `${bem}__button`, key: i }, buttonProps)),
23
24
  ' ')))))));
24
25
  }),
25
- image && react_1.default.createElement(_Image_1.default, Object.assign({ className: `${bem}__image` }, image))));
26
+ image && react_1.default.createElement(_Image_1.Image, Object.assign({ className: `${bem}__image` }, image))));
26
27
  };
27
- exports.default = Block;
28
+ exports.Block = Block;
@@ -36,5 +36,5 @@ export declare type ButtonVariantProps = {
36
36
  declare type _ButtonProps = ButtonProps & ButtonVariantProps & BemProps & {
37
37
  children?: ReactNode;
38
38
  };
39
- declare const Button: (props: _ButtonProps) => JSX.Element;
40
- export default Button;
39
+ export declare const Button: (props: _ButtonProps) => JSX.Element;
40
+ export {};
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Button = void 0;
3
4
  const tslib_1 = require("tslib");
4
5
  const react_1 = tslib_1.__importDefault(require("react"));
5
6
  const getBemClass_1 = tslib_1.__importDefault(require("@hugsmidjan/react/utils/getBemClass"));
@@ -36,4 +37,4 @@ const Button = (props) => {
36
37
  return (react_1.default.createElement("button", Object.assign({ className: className, type: "button" }, buttonProps, { style: undefined }, iconProp), label));
37
38
  }
38
39
  };
39
- exports.default = Button;
40
+ exports.Button = Button;
@@ -3,15 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CardList = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const react_1 = tslib_1.__importDefault(require("react"));
6
- const _Button_1 = tslib_1.__importDefault(require("./_Button"));
7
- const _Image_1 = tslib_1.__importDefault(require("./_Image"));
6
+ const _Button_1 = require("./_Button");
7
+ const _Image_1 = require("./_Image");
8
8
  const Card = (props) => {
9
9
  const { bem, href, title, imgPlaceholder, image, meta, summary } = props;
10
10
  const cardClass = `${bem}__card`;
11
11
  return (react_1.default.createElement(react_1.default.Fragment, null,
12
- react_1.default.createElement(_Button_1.default, { bem: cardClass, href: href },
12
+ react_1.default.createElement(_Button_1.Button, { bem: cardClass, href: href },
13
13
  ' ',
14
- react_1.default.createElement(_Image_1.default, Object.assign({ className: `${bem}__image` }, image, { placeholder: imgPlaceholder })),
14
+ react_1.default.createElement(_Image_1.Image, Object.assign({ className: `${bem}__image` }, image, { placeholder: imgPlaceholder })),
15
15
  react_1.default.createElement("span", { className: `${cardClass}__title` }, title),
16
16
  ' ',
17
17
  meta && react_1.default.createElement("span", { className: `${cardClass}__meta` }, meta),
@@ -32,5 +32,5 @@ declare type _ImageProps = {
32
32
  */
33
33
  placeholder?: boolean | (() => JSX.Element);
34
34
  };
35
- declare const Image: (props: ImageProps & _ImageProps) => JSX.Element | null;
36
- export default Image;
35
+ export declare const Image: (props: ImageProps & _ImageProps) => JSX.Element | null;
36
+ export {};
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Image = void 0;
3
4
  const tslib_1 = require("tslib");
4
5
  const react_1 = tslib_1.__importDefault(require("react"));
5
6
  const getBemClass_1 = tslib_1.__importDefault(require("@hugsmidjan/react/utils/getBemClass"));
@@ -27,4 +28,4 @@ const Image = (props) => {
27
28
  react_1.default.createElement("img", { src: imageSrc, alt: altText, loading: imgLoading }),
28
29
  ' '));
29
30
  };
30
- exports.default = Image;
31
+ exports.Image = Image;
@@ -12,7 +12,6 @@ export declare type TogglerGroupProps = {
12
12
  options: TogglerGroupOptions;
13
13
  className?: string;
14
14
  name: string;
15
- children?: undefined;
16
15
  disabled?: boolean | ReadonlyArray<number>;
17
16
  inputProps?: RestrictedInputProps;
18
17
  onSelected?: (payload: {
@@ -27,5 +26,5 @@ declare type _TogglerGroupProps = {
27
26
  Toggler: (props: TogglerInputProps) => JSX.Element;
28
27
  value?: ReadonlyArray<string>;
29
28
  };
30
- declare const TogglerGroup: (props: TogglerGroupProps & _TogglerGroupProps) => JSX.Element;
31
- export default TogglerGroup;
29
+ export declare const TogglerGroup: (props: TogglerGroupProps & _TogglerGroupProps) => JSX.Element;
30
+ export {};
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TogglerGroup = void 0;
3
4
  const tslib_1 = require("tslib");
4
5
  const react_1 = tslib_1.__importDefault(require("react"));
5
6
  const getBemClass_1 = tslib_1.__importDefault(require("@hugsmidjan/react/utils/getBemClass"));
@@ -31,4 +32,4 @@ const TogglerGroup = (props) => {
31
32
  : inputProps.onChange, disabled: isDisabled, "aria-invalid": props['aria-invalid'], checked: isChecked })));
32
33
  })));
33
34
  };
34
- exports.default = TogglerGroup;
35
+ exports.TogglerGroup = TogglerGroup;
@@ -13,5 +13,5 @@ declare type _TogglerGroupFieldProps = {
13
13
  } & BemPropsModifier;
14
14
  export declare type TogglerGroupFieldOption = TogglerGroupOption;
15
15
  export declare type TogglerGroupFieldOptions = TogglerGroupOptions;
16
- declare const TogglerGroupField: (props: TogglerGroupFieldProps & _TogglerGroupFieldProps) => JSX.Element;
17
- export default TogglerGroupField;
16
+ export declare const TogglerGroupField: (props: TogglerGroupFieldProps & _TogglerGroupFieldProps) => JSX.Element;
17
+ export {};
@@ -1,14 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TogglerGroupField = void 0;
3
4
  const tslib_1 = require("tslib");
4
5
  const react_1 = tslib_1.__importDefault(require("react"));
5
6
  const getBemClass_1 = tslib_1.__importDefault(require("@hugsmidjan/react/utils/getBemClass"));
6
7
  const FormField_1 = tslib_1.__importDefault(require("../FormField"));
7
- const _TogglerGroup_1 = tslib_1.__importDefault(require("./_TogglerGroup"));
8
+ const _TogglerGroup_1 = require("./_TogglerGroup");
8
9
  const TogglerGroupField = (props) => {
9
10
  const { bem, Toggler, className, modifier, label, LabelTag, assistText, hideLabel, disabled, readOnly, invalid, errorMessage, required, reqText, id, value } = props, togglerGroupProps = tslib_1.__rest(props, ["bem", "Toggler", "className", "modifier", "label", "LabelTag", "assistText", "hideLabel", "disabled", "readOnly", "invalid", "errorMessage", "required", "reqText", "id", "value"]);
10
11
  return (react_1.default.createElement(FormField_1.default, { className: (0, getBemClass_1.default)(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) => {
11
- return (react_1.default.createElement(_TogglerGroup_1.default, Object.assign({ bem: className.options }, inputProps, togglerGroupProps, { value: Array.isArray(value) ? value : value != null ? [value] : undefined, Toggler: Toggler })));
12
+ return (react_1.default.createElement(_TogglerGroup_1.TogglerGroup, Object.assign({ bem: className.options }, inputProps, togglerGroupProps, { value: Array.isArray(value) ? value : value != null ? [value] : undefined, Toggler: Toggler })));
12
13
  } }));
13
14
  };
14
- exports.default = TogglerGroupField;
15
+ exports.TogglerGroupField = TogglerGroupField;
@@ -1,7 +1,7 @@
1
1
  import { BemPropsModifier } from '@hugsmidjan/react/types';
2
2
  export declare type TogglerInputProps = {
3
3
  label: string | JSX.Element;
4
- children?: undefined;
4
+ children?: never;
5
5
  Wrapper?: 'div' | 'li';
6
6
  invalid?: boolean;
7
7
  /** Hidden label prefix text to indicate that the field is required.
@@ -18,5 +18,5 @@ declare type _TogglerInputProps = {
18
18
  bem: string;
19
19
  type: 'radio' | 'checkbox';
20
20
  };
21
- declare const TogglerInput: (props: TogglerInputProps & _TogglerInputProps) => JSX.Element;
22
- export default TogglerInput;
21
+ export declare const TogglerInput: (props: TogglerInputProps & _TogglerInputProps) => JSX.Element;
22
+ export {};
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TogglerInput = void 0;
3
4
  const tslib_1 = require("tslib");
4
5
  const react_1 = tslib_1.__importDefault(require("react"));
5
6
  const hooks_1 = require("@hugsmidjan/react/hooks");
@@ -22,4 +23,4 @@ const TogglerInput = (props) => {
22
23
  ' '),
23
24
  errorMessage && (react_1.default.createElement("div", { className: bem + '__error', id: errorId }, errorMessage))));
24
25
  };
25
- exports.default = TogglerInput;
26
+ exports.TogglerInput = TogglerInput;
@@ -1,2 +1 @@
1
- declare const breakOnNL: (text: string | undefined) => "" | (string | JSX.Element)[] | undefined;
2
- export default breakOnNL;
1
+ export declare const breakOnNL: (text: string | undefined) => "" | (string | JSX.Element)[] | undefined;
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.breakOnNL = void 0;
3
4
  const tslib_1 = require("tslib");
4
5
  const react_1 = tslib_1.__importDefault(require("react"));
5
6
  const breakOnNL = (text) => text &&
@@ -8,4 +9,4 @@ const breakOnNL = (text) => text &&
8
9
  .replace(/(?:\n\s*)+/g, '\n\n')
9
10
  .split(/\n/)
10
11
  .map((bit) => bit || react_1.default.createElement("br", null));
11
- exports.default = breakOnNL;
12
+ exports.breakOnNL = breakOnNL;
package/assets.js CHANGED
@@ -14,7 +14,7 @@ Object.defineProperty(exports, "illustrations", { enumerable: true, get: functio
14
14
  /** @deprecated Use `getCssBundleUrl` from '@reykjavik/hanna-css' instead (Will be reomved in v0.11) */
15
15
  const getCssBundleUrl = (cssTokens,
16
16
  /** If you want to pin your CSS files to a specific version */
17
- version) => (0, hanna_css_1.getCssBundleUrl)(cssTokens, { version });
17
+ version) => (0, hanna_css_1.getCssBundleUrl)(cssTokens, { version: version });
18
18
  exports.getCssBundleUrl = getCssBundleUrl;
19
19
  // ---------------------------------------------------------------------------
20
20
  // Based on "https://styles.reykjavik.is/assets/efnistakn/menu/files.json"
package/constants.d.ts CHANGED
@@ -1,39 +1,19 @@
1
+ import { EitherObj } from '@reykjavik/hanna-utils';
1
2
  /** @depcrecated import `colorFamilies` from `@reykjavik/hanna-css` instead (Will be removed in v0.11) */
2
- export declare const colorFamilies: readonly ["esja", "faxafloi", "nautholsvik", "heidmork", "ellidaardalur", "blafjoll", "sund", "rokkur", "suld"] & {
3
- readonly esja: "esja";
4
- readonly faxafloi: "faxafloi";
5
- readonly nautholsvik: "nautholsvik";
6
- readonly heidmork: "heidmork";
7
- readonly ellidaardalur: "ellidaardalur";
8
- readonly blafjoll: "blafjoll";
9
- readonly sund: "sund";
10
- readonly rokkur: "rokkur";
11
- readonly suld: "suld";
12
- } & {
3
+ export declare const colorFamilies: readonly ["esja", "faxafloi", "nautholsvik", "heidmork", "ellidaardalur", "blafjoll", "sund", "rokkur", "suld"] & Readonly<Record<import("@reykjavik/hanna-css").ColorFamily, import("@reykjavik/hanna-css").ColorFamily>> & {
13
4
  /** @deprecated This is a typo (Will be removed in v0.11) */
14
5
  ellidarardalur: string;
15
6
  };
16
7
  /** @depcrecated import type `ColorFamily` from `@reykjavik/hanna-css` instead (Will be removed in v0.11) */
17
8
  export type { ColorFamily } from '@reykjavik/hanna-css';
18
9
  /** @depcrecated import `colorThemes` from `@reykjavik/hanna-css` instead (Will be removed in v0.11) */
19
- export declare const themeOptions: readonly ["trustworthy", "dependable", "friendly", "lively", "colorful"] & {
20
- readonly trustworthy: "trustworthy";
21
- readonly dependable: "dependable";
22
- readonly friendly: "friendly";
23
- readonly lively: "lively";
24
- readonly colorful: "colorful";
25
- };
10
+ export declare const themeOptions: readonly ["trustworthy", "dependable", "friendly", "lively", "colorful"] & Readonly<Record<import("@reykjavik/hanna-css").HannaColorTheme, import("@reykjavik/hanna-css").HannaColorTheme>>;
26
11
  /** @depcrecated import type `HannaColorTheme` from `@reykjavik/hanna-css` instead (Will be removed in v0.11) */
27
12
  export type { HannaColorTheme as ThemeOption } from '@reykjavik/hanna-css';
28
13
  export declare type Alignment = 'right' | 'left';
29
14
  export declare const aligns: Record<string, true | undefined>;
30
- export declare type ComponentLayoutProps<Align extends string = 'right'> = {
31
- wide?: undefined;
32
- align?: undefined;
33
- } | {
34
- wide: boolean;
35
- align?: undefined;
36
- } | {
37
- wide?: undefined;
38
- align: Align;
39
- };
15
+ export declare type ComponentLayoutProps<Align extends string = 'right'> = EitherObj<{
16
+ wide?: boolean;
17
+ }, {
18
+ align?: Align;
19
+ }>;
package/focus-visible.js CHANGED
@@ -1,3 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ // expose `focus-visible` to consumers of `@reykjavik/hanna-react`
4
+ // without requiring them to install it as a dependency in their project.
3
5
  require("@reykjavik/hanna-utils/focus-visible");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reykjavik/hanna-react",
3
- "version": "0.10.70",
3
+ "version": "0.10.72",
4
4
  "author": "Reykjavík (http://www.reykjavik.is)",
5
5
  "contributors": [
6
6
  "Hugsmiðjan ehf (http://www.hugsmidjan.is)",
@@ -14,9 +14,9 @@
14
14
  "license": "MIT",
15
15
  "dependencies": {
16
16
  "@hugsmidjan/qj": "^4.10.2",
17
- "@hugsmidjan/react": "^0.4.17",
18
- "@reykjavik/hanna-css": "^0.3.7",
19
- "@reykjavik/hanna-utils": "^0.1.14",
17
+ "@hugsmidjan/react": "^0.4.20",
18
+ "@reykjavik/hanna-css": "^0.3.10",
19
+ "@reykjavik/hanna-utils": "^0.1.17",
20
20
  "@types/react": "^17.0.24",
21
21
  "@types/react-autosuggest": "^10.1.0",
22
22
  "@types/react-datepicker": "^3.0.2",