@reykjavik/hanna-react 0.10.75 → 0.10.77

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 (145) hide show
  1. package/AccordionList.d.ts +3 -3
  2. package/AccordionList.js +1 -1
  3. package/ActionCards.d.ts +2 -2
  4. package/Alert.d.ts +4 -4
  5. package/Alert.js +4 -4
  6. package/ArticleCards.d.ts +3 -3
  7. package/ArticleCarousel/_ArticleCarouselCard.d.ts +2 -2
  8. package/ArticleCarousel.d.ts +2 -2
  9. package/ArticleMeta.d.ts +2 -2
  10. package/Attention.d.ts +1 -1
  11. package/BasicTable.d.ts +1 -1
  12. package/BgBox.d.ts +1 -1
  13. package/Bling.d.ts +5 -5
  14. package/BlockQuote.d.ts +1 -1
  15. package/BreadCrumbs.d.ts +3 -3
  16. package/ButtonBack.d.ts +1 -1
  17. package/ButtonBar.d.ts +1 -1
  18. package/ButtonPrimary.d.ts +1 -1
  19. package/ButtonSecondary.d.ts +1 -1
  20. package/ButtonTertiary.d.ts +3 -3
  21. package/CHANGELOG.md +19 -2
  22. package/CarouselStepper.d.ts +1 -1
  23. package/CenterColumn.d.ts +1 -1
  24. package/Checkbox.d.ts +1 -1
  25. package/CheckboxButton.d.ts +4 -0
  26. package/CheckboxButton.js +9 -0
  27. package/CheckboxButtonsGroup.d.ts +3 -2
  28. package/CheckboxButtonsGroup.js +2 -3
  29. package/CheckboxGroup.d.ts +4 -3
  30. package/CityBlock.d.ts +1 -1
  31. package/ContactBubble.d.ts +5 -5
  32. package/ContactBubble.js +2 -1
  33. package/ContentArticle.d.ts +1 -1
  34. package/ContentArticle.js +4 -2
  35. package/ContentImage.d.ts +1 -1
  36. package/Datepicker.d.ts +2 -2
  37. package/Datepicker.js +5 -5
  38. package/ExtraLinks.d.ts +4 -4
  39. package/FeatureList.d.ts +1 -1
  40. package/FieldGroup.d.ts +1 -1
  41. package/FileInput/_FileInput.utils.d.ts +1 -1
  42. package/FileInput/_FileInputFileList.d.ts +1 -1
  43. package/FileInput.d.ts +1 -1
  44. package/Foonote.d.ts +1 -1
  45. package/FooterBadges.d.ts +1 -1
  46. package/FooterInfo.d.ts +3 -3
  47. package/Footnote.d.ts +1 -1
  48. package/Form.d.ts +1 -1
  49. package/FormField.d.ts +8 -8
  50. package/FormField.js +7 -6
  51. package/Gallery/_GalleryItem.d.ts +1 -1
  52. package/Gallery/_GalleryModal.d.ts +1 -1
  53. package/Gallery/_GalleryModalContext.d.ts +1 -1
  54. package/Gallery.d.ts +3 -3
  55. package/GridBlocks.d.ts +3 -3
  56. package/Heading.d.ts +2 -2
  57. package/Heading.js +1 -1
  58. package/HeroBlock.d.ts +2 -2
  59. package/IframeBlock.d.ts +1 -1
  60. package/Illustration.d.ts +1 -1
  61. package/ImageCards.d.ts +3 -3
  62. package/InfoBlock.d.ts +1 -1
  63. package/InfoHero.d.ts +2 -2
  64. package/IslandBlock.d.ts +4 -4
  65. package/IslandPageBlock.d.ts +3 -3
  66. package/LabeledTextBlock.d.ts +1 -1
  67. package/Layout.d.ts +3 -3
  68. package/Layout.js +2 -2
  69. package/MainMenu/_Auxiliary.d.ts +2 -2
  70. package/MainMenu/_PrimaryPanel.d.ts +1 -1
  71. package/MainMenu.d.ts +8 -8
  72. package/MainMenu.js +2 -2
  73. package/MiniMetrics.d.ts +1 -1
  74. package/Modal.d.ts +1 -1
  75. package/NameCard.d.ts +4 -4
  76. package/NameCards.d.ts +1 -1
  77. package/NewsHero.d.ts +2 -2
  78. package/PageFilter.d.ts +1 -1
  79. package/PageHeading.d.ts +1 -1
  80. package/Picture.d.ts +1 -1
  81. package/ProcessOverview.d.ts +2 -2
  82. package/PullQuote.d.ts +1 -1
  83. package/README.md +1 -1
  84. package/RadioButtonsGroup.d.ts +3 -2
  85. package/RadioButtonsGroup.js +2 -2
  86. package/RadioGroup.d.ts +5 -4
  87. package/RadioGroup.js +1 -1
  88. package/RelatedLinks.d.ts +3 -3
  89. package/RowBlock.d.ts +1 -1
  90. package/RowBlockColumn.d.ts +1 -1
  91. package/SearchInput.d.ts +3 -3
  92. package/SearchResults/_SearchResultsItem.d.ts +2 -2
  93. package/SearchResults.d.ts +4 -4
  94. package/SeenEffect.d.ts +1 -1
  95. package/Selectbox.d.ts +2 -2
  96. package/ShareButtons.d.ts +2 -2
  97. package/Sharpie.d.ts +3 -3
  98. package/SiteSearchAutocomplete.d.ts +2 -2
  99. package/SiteSearchCurtain.d.ts +2 -2
  100. package/SiteSearchCurtain.js +7 -12
  101. package/SiteSearchInput.d.ts +5 -5
  102. package/Skeleton.d.ts +3 -3
  103. package/SubHeading.d.ts +1 -1
  104. package/Tabs.d.ts +6 -6
  105. package/Tabs.js +2 -2
  106. package/TagPill.d.ts +2 -2
  107. package/TextBlock.d.ts +1 -1
  108. package/TextButton.d.ts +1 -1
  109. package/TextInput.d.ts +3 -3
  110. package/VSpacer.d.ts +3 -3
  111. package/VerticalTabsTOC.d.ts +3 -3
  112. package/WizardLayout.d.ts +2 -2
  113. package/WizardLayout.js +2 -2
  114. package/WizardStepper.d.ts +2 -2
  115. package/_abstract/_AbstractCarousel.d.ts +3 -3
  116. package/_abstract/_AbstractCarousel.js +2 -2
  117. package/_abstract/_Blings.d.ts +2 -2
  118. package/_abstract/_Block.d.ts +4 -4
  119. package/_abstract/_Button.d.ts +9 -9
  120. package/_abstract/_CardList.d.ts +8 -8
  121. package/_abstract/_Image.d.ts +5 -5
  122. package/_abstract/_Link.d.ts +42 -9
  123. package/_abstract/_Link.js +44 -4
  124. package/_abstract/_Quote.d.ts +1 -1
  125. package/_abstract/_TogglerGroup.d.ts +7 -5
  126. package/_abstract/_TogglerGroup.js +14 -16
  127. package/_abstract/_TogglerGroupField.d.ts +6 -4
  128. package/_abstract/_TogglerGroupField.js +9 -3
  129. package/_abstract/_TogglerInput.d.ts +3 -2
  130. package/_abstract/_TogglerInput.js +9 -7
  131. package/assets.d.ts +4 -4
  132. package/constants.d.ts +2 -2
  133. package/index.d.ts +1 -0
  134. package/package.json +6 -6
  135. package/utils/browserSide.d.ts +1 -0
  136. package/utils/browserSide.js +6 -0
  137. package/utils/config.d.ts +2 -0
  138. package/utils/config.js +3 -4
  139. package/utils/seenEffect.d.ts +3 -3
  140. package/utils/useFormatMonitor.js +1 -1
  141. package/utils/useGetSVGtext.d.ts +1 -1
  142. package/utils/useMenuToggling.d.ts +1 -1
  143. package/utils/useMixedControlState.d.ts +5 -5
  144. package/utils.d.ts +1 -0
  145. package/utils.js +1 -0
@@ -1,12 +1,12 @@
1
- import { SSRSupport } from '@hugsmidjan/react/hooks';
2
1
  import { SeenProp } from './utils/seenEffect';
3
- export declare type AccordionListItemProps = {
2
+ import { SSRSupport } from './utils';
3
+ export type AccordionListItemProps = {
4
4
  title: string | JSX.Element;
5
5
  content: string | JSX.Element | undefined;
6
6
  id?: string;
7
7
  disabled?: boolean;
8
8
  };
9
- export declare type AccordionListProps = {
9
+ export type AccordionListProps = {
10
10
  items: Array<AccordionListItemProps>;
11
11
  /** Index of the currently open items (controlled use) */
12
12
  open?: Array<number>;
package/AccordionList.js CHANGED
@@ -11,7 +11,7 @@ const AccordionListItem = (props) => {
11
11
  const { title, content, id, disabled = false, ssr, open, onToggle } = props;
12
12
  const defaultOpen = (0, react_1.useRef)(props.defaultOpen);
13
13
  const domid = (0, hooks_1.useDomid)();
14
- const isBrowser = (0, hooks_1.useIsBrowserSide)(ssr);
14
+ const isBrowser = (0, utils_1.useIsBrowserSide)(ssr);
15
15
  const itemDisabled = (isBrowser && disabled) || !content;
16
16
  return (react_1.default.createElement("div", { className: (0, getBemClass_1.default)('AccordionList__item', [itemDisabled && 'disabled']), id: id, "data-start-open": defaultOpen.current, "data-sprinkled": isBrowser },
17
17
  react_1.default.createElement("h3", { className: "AccordionList__title" }, isBrowser ? (react_1.default.createElement("button", { type: "button", className: "AccordionList__button", "aria-controls": domid, "aria-expanded": open || undefined, onClick: onToggle, disabled: itemDisabled }, title)) : (title)),
package/ActionCards.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { CardListSummaryProps, TextCardListProps, TextCardProps } from './_abstract/_CardList';
2
2
  import { SeenProp } from './utils/seenEffect';
3
- export declare type ActionCardsProps = TextCardListProps & CardListSummaryProps & SeenProp;
4
- export declare type ActionCardsItemProps = TextCardProps;
3
+ export type ActionCardsProps = TextCardListProps & CardListSummaryProps & SeenProp;
4
+ export type ActionCardsItemProps = TextCardProps;
5
5
  export declare const ActionCards: (props: ActionCardsProps) => JSX.Element;
6
6
  export default ActionCards;
package/Alert.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { MouseEvent, ReactNode } from 'react';
2
- import { SSRSupport } from '@hugsmidjan/react/hooks';
3
2
  import { EitherObj } from '@reykjavik/hanna-utils';
4
3
  import { DefaultTexts } from '@reykjavik/hanna-utils/i18n';
5
- export declare type AlertI18n = {
4
+ import { SSRSupport } from './utils';
5
+ export type AlertI18n = {
6
6
  closeLabel: string;
7
7
  closeLabelLong?: string;
8
8
  };
@@ -14,8 +14,8 @@ export declare const alertTypes: {
14
14
  error: number;
15
15
  critical: number;
16
16
  };
17
- declare type AlertType = keyof typeof alertTypes;
18
- export declare type AlertProps = {
17
+ type AlertType = keyof typeof alertTypes;
18
+ export type AlertProps = {
19
19
  type: AlertType;
20
20
  closable?: boolean;
21
21
  children?: ReactNode;
package/Alert.js CHANGED
@@ -3,11 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Alert = exports.alertTypes = exports.defaultAlertTexts = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const react_1 = tslib_1.__importStar(require("react"));
6
- const hooks_1 = require("@hugsmidjan/react/hooks");
7
6
  const getBemClass_1 = tslib_1.__importDefault(require("@hugsmidjan/react/utils/getBemClass"));
8
7
  const i18n_1 = require("@reykjavik/hanna-utils/i18n");
9
8
  const _Button_1 = require("./_abstract/_Button");
10
9
  const env_1 = require("./utils/env");
10
+ const utils_1 = require("./utils");
11
11
  // FIXME: Eventually import from @reykjavik/hanna-css
12
12
  const AlertCloseTransitionDuration = 400;
13
13
  const useAutoClosing = (autoClose) => {
@@ -41,12 +41,12 @@ const Alert = (props) => {
41
41
  const autoClose = Math.max(props.autoClose || 0, 0);
42
42
  const closing = (0, react_1.useRef)();
43
43
  const [open, setOpen] = (0, react_1.useState)(!!ssr);
44
- const isBrowser = (0, hooks_1.useIsBrowserSide)(ssr);
44
+ const isBrowser = (0, utils_1.useIsBrowserSide)(ssr);
45
45
  const showCloseButton = closable && (isBrowser || closeUrl != null);
46
46
  const { closeLabel, closeLabelLong } = (0, i18n_1.getTexts)(props, exports.defaultAlertTexts);
47
- (0, hooks_1.useOnMount)(() => {
47
+ (0, react_1.useEffect)(() => {
48
48
  setOpen(true);
49
- });
49
+ }, []);
50
50
  const closeAlert = (0, react_1.useCallback)((event) => {
51
51
  const ret = onClose &&
52
52
  // @ts-expect-error (@deprecated `event` parameter will be removed in v0.11)
package/ArticleCards.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import type { Cleanup } from '@reykjavik/hanna-utils';
2
2
  import { ImageCardListProps, ImageCardProps } from './_abstract/_CardList';
3
- export declare type ArticleCardsItemProps = ImageCardProps;
3
+ export type ArticleCardsItemProps = ImageCardProps;
4
4
  /** @deprecated Use `ArticleCardsItemProps` instead (Remove in v0.11) */
5
- export declare type ArticleCardProps = ArticleCardsItemProps;
6
- export declare type ArticleCardsProps = Cleanup<Pick<ImageCardListProps, 'cards' | 'imgPlaceholder'>>;
5
+ export type ArticleCardProps = ArticleCardsItemProps;
6
+ export type ArticleCardsProps = Cleanup<Pick<ImageCardListProps, 'cards' | 'imgPlaceholder'>>;
7
7
  export declare const ArticleCards: (props: ArticleCardsProps) => JSX.Element;
8
8
  export default ArticleCards;
@@ -2,10 +2,10 @@ import type { HannaColorTheme } from '@reykjavik/hanna-css';
2
2
  import { Illustration } from '@reykjavik/hanna-utils/assets';
3
3
  import { ImageProps } from '../_abstract/_Image';
4
4
  import { ColorFamily } from '../constants';
5
- export declare type ArticleCarouselImageProps = ImageProps & {
5
+ export type ArticleCarouselImageProps = ImageProps & {
6
6
  photo?: boolean;
7
7
  };
8
- export declare type ArticleCarouselCardProps = {
8
+ export type ArticleCarouselCardProps = {
9
9
  date?: string;
10
10
  title: string;
11
11
  summary: string;
@@ -1,7 +1,7 @@
1
- import { SSRSupport } from '@hugsmidjan/react/hooks';
2
1
  import { ArticleCarouselCardProps, ArticleCarouselImageProps } from './ArticleCarousel/_ArticleCarouselCard';
3
2
  import { SeenProp } from './utils/seenEffect';
4
- export declare type ArticleCarouselProps = {
3
+ import { SSRSupport } from './utils';
4
+ export type ArticleCarouselProps = {
5
5
  items: Array<ArticleCarouselCardProps>;
6
6
  title?: string;
7
7
  moreLabel?: string;
package/ArticleMeta.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- export declare type ArticleMetaItem = {
1
+ export type ArticleMetaItem = {
2
2
  label: string;
3
3
  href?: string;
4
4
  };
5
- export declare type ArticleMetaProps = {
5
+ export type ArticleMetaProps = {
6
6
  items: Array<ArticleMetaItem>;
7
7
  small?: boolean;
8
8
  };
package/Attention.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
- export declare type AttentionProps = {
2
+ export type AttentionProps = {
3
3
  small?: boolean;
4
4
  children: ReactNode;
5
5
  };
package/BasicTable.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { TableProps } from '@hugsmidjan/react/Table';
2
2
  import { EitherObj } from '@reykjavik/hanna-utils';
3
3
  import { SeenProp } from './utils/seenEffect';
4
- export declare type BasicTableProps = {
4
+ export type BasicTableProps = {
5
5
  compact?: boolean;
6
6
  type?: 'text' | 'number';
7
7
  modifier?: string;
package/BgBox.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { EffectProp, SeenProp } from './utils/seenEffect';
3
- export declare type BgBoxProps = {
3
+ export type BgBoxProps = {
4
4
  className?: string;
5
5
  children: ReactNode;
6
6
  } & SeenProp & EffectProp;
package/Bling.d.ts CHANGED
@@ -4,7 +4,7 @@ declare const colors: {
4
4
  secondary: boolean;
5
5
  primary: boolean;
6
6
  };
7
- export declare type BlingColor = keyof typeof colors;
7
+ export type BlingColor = keyof typeof colors;
8
8
  declare const aligns: {
9
9
  left: boolean;
10
10
  'left-ish': boolean;
@@ -13,7 +13,7 @@ declare const aligns: {
13
13
  'right-ish': boolean;
14
14
  right: boolean;
15
15
  };
16
- export declare type BlingAlignment = keyof typeof aligns;
16
+ export type BlingAlignment = keyof typeof aligns;
17
17
  declare const valigns: {
18
18
  up: boolean;
19
19
  'up-ish': boolean;
@@ -21,7 +21,7 @@ declare const valigns: {
21
21
  'down-ish': boolean;
22
22
  down: boolean;
23
23
  };
24
- export declare type BlingVAlignment = keyof typeof valigns;
24
+ export type BlingVAlignment = keyof typeof valigns;
25
25
  declare const parentOffset: {
26
26
  top: boolean;
27
27
  'top-ish': boolean;
@@ -29,8 +29,8 @@ declare const parentOffset: {
29
29
  'bottom-ish': boolean;
30
30
  bottom: boolean;
31
31
  };
32
- export declare type BlingParentOffset = keyof typeof parentOffset;
33
- export declare type BlingProps = {
32
+ export type BlingParentOffset = keyof typeof parentOffset;
33
+ export type BlingProps = {
34
34
  /**
35
35
  * Horizontal alignment relative to the bling container's
36
36
  * full width
package/BlockQuote.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  import { QuoteProps } from './_abstract/_Quote';
2
- export declare type BlockQuoteProps = QuoteProps;
2
+ export type BlockQuoteProps = QuoteProps;
3
3
  export declare const BlockQuote: (props: BlockQuoteProps) => JSX.Element;
4
4
  export default BlockQuote;
package/BreadCrumbs.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- export declare type BreadCrumb = {
1
+ export type BreadCrumb = {
2
2
  href?: string;
3
3
  label: string;
4
4
  };
5
- export declare type BreadCrumbTrail = Array<BreadCrumb>;
6
- export declare type BreadCrumbsProps = {
5
+ export type BreadCrumbTrail = Array<BreadCrumb>;
6
+ export type BreadCrumbsProps = {
7
7
  title: string;
8
8
  trail: BreadCrumbTrail;
9
9
  };
package/ButtonBack.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { ButtonProps } from './_abstract/_Button';
3
- export declare type ButtonBackProps = ButtonProps;
3
+ export type ButtonBackProps = ButtonProps;
4
4
  export declare const ButtonBack: (props: ButtonBackProps & {
5
5
  children?: ReactNode;
6
6
  }) => JSX.Element;
package/ButtonBar.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
- export declare type ButtonBarProps = {
2
+ export type ButtonBarProps = {
3
3
  align?: 'right';
4
4
  children: ReactNode;
5
5
  };
@@ -1,6 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { ButtonProps, ButtonVariantProps } from './_abstract/_Button';
3
- export declare type ButtonPrimaryProps = ButtonProps & ButtonVariantProps;
3
+ export type ButtonPrimaryProps = ButtonProps & ButtonVariantProps;
4
4
  export declare const ButtonPrimary: (props: ButtonPrimaryProps & {
5
5
  children?: ReactNode;
6
6
  }) => JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { ButtonProps, ButtonVariantProps } from './_abstract/_Button';
3
- export declare type ButtonSecondaryProps = ButtonProps & ButtonVariantProps;
3
+ export type ButtonSecondaryProps = ButtonProps & ButtonVariantProps;
4
4
  export declare const ButtonSecondary: (props: ButtonSecondaryProps & {
5
5
  children?: ReactNode;
6
6
  }) => JSX.Element;
@@ -1,8 +1,8 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { ButtonProps, ButtonVariantProps } from './_abstract/_Button';
3
- declare type TertiarySize = Extract<ButtonVariantProps['size'], 'normal' | 'small'>;
4
- declare type TertiaryIcon = Extract<ButtonVariantProps['icon'], 'none' | 'go-back'>;
5
- export declare type ButtonTertiaryProps = ButtonProps & Omit<ButtonVariantProps, 'icon' | 'size'> & {
3
+ type TertiarySize = Extract<ButtonVariantProps['size'], 'normal' | 'small'>;
4
+ type TertiaryIcon = Extract<ButtonVariantProps['icon'], 'none' | 'go-back'>;
5
+ export type ButtonTertiaryProps = ButtonProps & Omit<ButtonVariantProps, 'icon' | 'size'> & {
6
6
  size?: TertiarySize;
7
7
  icon?: TertiaryIcon;
8
8
  };
package/CHANGELOG.md CHANGED
@@ -4,12 +4,29 @@
4
4
 
5
5
  - ... <!-- Add new lines here. -->
6
6
 
7
- ## 0.10.75
7
+ ## 0.10.77
8
+
9
+ _2022-12-18_
10
+
11
+ - feat: Add standalone component `.CheckboxButton`
12
+ - feat: Add `.CheckboxButton__label__wrap` and `.RadioButton__label__wrap`
13
+ - feat: Add `utils` hooks `useIsBrowserSide`, `useIsServerSide` — for
14
+ progressive enhancement
15
+ - feat: Add `utils` helper `setDefaultSSR()`
16
+ - feat: `ContentArticle` emits `__header` wrapper
17
+ - fix: Support "uncontrolled" use of all `Checkbox` and `Radio` groups
18
+ - fix: Edge-case bugs in `SiteSearchCurtain` focus-detection
19
+ - fix: Typo in `Datpicker`'s default `dateFormat`, broke typed input parsing
20
+
21
+ ## 0.10.75 – 0.10.76
8
22
 
9
23
  _2022-12-15_
10
24
 
25
+ - feat: Add `setLinkRenderer.pop()` to unset the last custom renderer
11
26
  - feat: Add `setLinkRenderer`, exported from `/utils` — to allow hooking
12
27
  `hanna-react` into custom routing components
28
+ - fix: Suppress react warning about mixed-case `data-*` attributes
29
+ - fix: Update props type of `LinkRenderer` to use "modern" `ref`
13
30
 
14
31
  ## 0.10.74
15
32
 
@@ -149,7 +166,7 @@ _2022-08-11_
149
166
  _2022-06-24_
150
167
 
151
168
  - fix: Add missing prop `checkOrigin` on `IframeBlock` (default: `false`)
152
- - fix: Suppot "uncontrolled" use of `CheckboxGroup`, `RadioGroup`, et al.
169
+ - fix: Support "uncontrolled" use of `CheckboxGroup`, `RadioGroup`, et al.
153
170
  - fix: Change build to only export CommonJS
154
171
 
155
172
  ## 0.10.59
@@ -1,4 +1,4 @@
1
1
  import { Props } from '@hugsmidjan/react/CarouselStepper';
2
- declare type CarouselStepperProps = Omit<Props, 'bem' | 'modifier'>;
2
+ type CarouselStepperProps = Omit<Props, 'bem' | 'modifier'>;
3
3
  export declare const CarouselStepper: (props: CarouselStepperProps) => JSX.Element;
4
4
  export default CarouselStepper;
package/CenterColumn.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { EffectProp, SeenProp } from './utils/seenEffect';
3
- export declare type CenterColumnProps = {
3
+ export type CenterColumnProps = {
4
4
  children: ReactNode;
5
5
  } & SeenProp & EffectProp;
6
6
  export declare const CenterColumn: (props: CenterColumnProps) => JSX.Element;
package/Checkbox.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  import { TogglerInputProps } from './_abstract/_TogglerInput';
2
- export declare type CheckboxProps = TogglerInputProps;
2
+ export type CheckboxProps = TogglerInputProps;
3
3
  export declare const Checkbox: (props: CheckboxProps) => JSX.Element;
4
4
  export default Checkbox;
@@ -0,0 +1,4 @@
1
+ import { TogglerInputProps } from './_abstract/_TogglerInput';
2
+ export type CheckboxProps = TogglerInputProps;
3
+ export declare const CheckboxButton: (props: CheckboxProps) => JSX.Element;
4
+ export default CheckboxButton;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CheckboxButton = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const react_1 = tslib_1.__importDefault(require("react"));
6
+ const _TogglerInput_1 = require("./_abstract/_TogglerInput");
7
+ const CheckboxButton = (props) => (react_1.default.createElement(_TogglerInput_1.TogglerInput, Object.assign({ bem: "CheckboxButton" }, props, { type: "checkbox", innerWrap: true })));
8
+ exports.CheckboxButton = CheckboxButton;
9
+ exports.default = exports.CheckboxButton;
@@ -1,11 +1,12 @@
1
1
  import { TogglerGroupFieldOptions, TogglerGroupFieldProps } from './_abstract/_TogglerGroupField';
2
- export declare type CheckboxButtonsGroupProps = TogglerGroupFieldProps & {
2
+ export type CheckboxButtonsGroupProps = TogglerGroupFieldProps & {
3
3
  value?: Array<string>;
4
+ defaultValue?: Array<string>;
4
5
  /** @deprecated (Will be removed in v0.11) */
5
6
  columns?: '2col' | '3col';
6
7
  /** @deprecated (Will be removed in v0.11) */
7
8
  layout?: 'slim';
8
9
  };
9
- export declare type CheckboxButtonsGroupOptions = TogglerGroupFieldOptions;
10
+ export type CheckboxButtonsGroupOptions = TogglerGroupFieldOptions;
10
11
  export declare const CheckboxButtonsGroup: (props: CheckboxButtonsGroupProps) => JSX.Element;
11
12
  export default CheckboxButtonsGroup;
@@ -4,8 +4,7 @@ exports.CheckboxButtonsGroup = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const react_1 = tslib_1.__importDefault(require("react"));
6
6
  const _TogglerGroupField_1 = require("./_abstract/_TogglerGroupField");
7
- const _TogglerInput_1 = require("./_abstract/_TogglerInput");
8
- const CheckboxButton = (props) => (react_1.default.createElement(_TogglerInput_1.TogglerInput, Object.assign({ bem: "CheckboxButton" }, props, { type: "checkbox" })));
7
+ const CheckboxButton_1 = tslib_1.__importDefault(require("./CheckboxButton"));
9
8
  const CheckboxButtonsGroup = (props) => {
10
9
  if (props.layout) {
11
10
  console.warn('`CheckboxButtonsGroupProps.layout` is deprecated.');
@@ -13,7 +12,7 @@ const CheckboxButtonsGroup = (props) => {
13
12
  if (props.columns) {
14
13
  console.warn('`CheckboxButtonsGroupProps.columns` is deprecated.');
15
14
  }
16
- return (react_1.default.createElement(_TogglerGroupField_1.TogglerGroupField, Object.assign({}, props, { bem: "CheckboxButtonsGroup", Toggler: CheckboxButton })));
15
+ return (react_1.default.createElement(_TogglerGroupField_1.TogglerGroupField, Object.assign({}, props, { bem: "CheckboxButtonsGroup", Toggler: CheckboxButton_1.default })));
17
16
  };
18
17
  exports.CheckboxButtonsGroup = CheckboxButtonsGroup;
19
18
  exports.default = exports.CheckboxButtonsGroup;
@@ -1,9 +1,10 @@
1
1
  import { TogglerGroupFieldOption, TogglerGroupFieldOptions, TogglerGroupFieldProps } from './_abstract/_TogglerGroupField';
2
- export declare type CheckboxGroupProps = TogglerGroupFieldProps & {
2
+ export type CheckboxGroupProps = TogglerGroupFieldProps & {
3
3
  layout?: 'inline';
4
4
  value?: Array<string>;
5
+ defaultValue?: Array<string>;
5
6
  };
6
- export declare type CheckboxGroupOption = TogglerGroupFieldOption;
7
- export declare type CheckboxGroupOptions = TogglerGroupFieldOptions;
7
+ export type CheckboxGroupOption = TogglerGroupFieldOption;
8
+ export type CheckboxGroupOptions = TogglerGroupFieldOptions;
8
9
  export declare const CheckboxGroup: (props: CheckboxGroupProps) => JSX.Element;
9
10
  export default CheckboxGroup;
package/CityBlock.d.ts CHANGED
@@ -8,7 +8,7 @@ declare const types: {
8
8
  largebox: boolean;
9
9
  largeimage: boolean;
10
10
  };
11
- export declare type CityBlockProps = {
11
+ export type CityBlockProps = {
12
12
  align?: Alignment;
13
13
  type?: keyof typeof types;
14
14
  content: BlockItem;
@@ -1,6 +1,6 @@
1
- import { SSRSupport } from '@hugsmidjan/react/hooks';
2
1
  import { DefaultTexts } from '@reykjavik/hanna-utils/i18n';
3
- export declare type ContactBubbleI18n = {
2
+ import { SSRSupport } from './utils';
3
+ export type ContactBubbleI18n = {
4
4
  lang?: string;
5
5
  openBtn: string;
6
6
  openBtnLong?: string;
@@ -15,9 +15,9 @@ declare const icons: {
15
15
  readonly livechat: 1;
16
16
  readonly other: 0;
17
17
  };
18
- export declare type ContactBubbleIcon = keyof typeof icons;
18
+ export type ContactBubbleIcon = keyof typeof icons;
19
19
  export declare const ensureIcon: (maybeIcon: string | undefined) => ContactBubbleIcon | undefined;
20
- export declare type ContactBubbleItem = {
20
+ export type ContactBubbleItem = {
21
21
  label: string;
22
22
  extraLabel?: string;
23
23
  icon?: ContactBubbleIcon;
@@ -31,7 +31,7 @@ export declare type ContactBubbleItem = {
31
31
  href?: undefined;
32
32
  target?: undefined;
33
33
  });
34
- export declare type ContactBubbleProps = {
34
+ export type ContactBubbleProps = {
35
35
  title?: string;
36
36
  links: Array<ContactBubbleItem>;
37
37
  /** By default the ContactBubble's toggler is hidden if the page
package/ContactBubble.js CHANGED
@@ -9,6 +9,7 @@ const getBemClass_1 = tslib_1.__importDefault(require("@hugsmidjan/react/utils/g
9
9
  const hanna_utils_1 = require("@reykjavik/hanna-utils");
10
10
  const i18n_1 = require("@reykjavik/hanna-utils/i18n");
11
11
  const _Link_1 = require("./_abstract/_Link");
12
+ const utils_1 = require("./utils");
12
13
  exports.defaultTexts = {
13
14
  is: {
14
15
  lang: 'is',
@@ -41,7 +42,7 @@ const ContactBubble = (props) => {
41
42
  const useLocalState = props.open == null;
42
43
  const [localOpen, setLocalOpen] = (0, react_1.useState)(false);
43
44
  const open = useLocalState ? localOpen : props.open;
44
- const isBrowser = (0, hooks_1.useIsBrowserSide)(props.ssr);
45
+ const isBrowser = (0, utils_1.useIsBrowserSide)(props.ssr);
45
46
  const domid = (0, hooks_1.useDomid)();
46
47
  const wrapperRef = (0, react_1.useRef)(null);
47
48
  const { openBubble, closeBubble } = (0, react_1.useMemo)(() => ({
@@ -3,7 +3,7 @@ import { SeenProp } from './utils/seenEffect';
3
3
  import { ArticleMetaProps } from './ArticleMeta';
4
4
  import { ContentImageProps } from './ContentImage';
5
5
  import { RelatedLinksProps } from './RelatedLinks';
6
- export declare type ContentArticleProps = {
6
+ export type ContentArticleProps = {
7
7
  /** Date, author, etc. */
8
8
  meta?: ArticleMetaProps['items'];
9
9
  headline: string;
package/ContentArticle.js CHANGED
@@ -13,9 +13,11 @@ const VSpacer_1 = tslib_1.__importDefault(require("./VSpacer"));
13
13
  const ContentArticle = (props) => {
14
14
  const { relatedLinks } = props;
15
15
  const [ref] = (0, seenEffect_1.useSeenEffect)(props.startSeen);
16
+ const headingElm = (react_1.default.createElement(Heading_1.default, { forceH1: props.headlineTag === 'h1' }, props.headline));
16
17
  return (react_1.default.createElement("div", { className: "ContentArticle", ref: ref },
17
- props.meta && react_1.default.createElement(ArticleMeta_1.default, { items: props.meta }),
18
- react_1.default.createElement(Heading_1.default, { forceH1: props.headlineTag === 'h1' }, props.headline),
18
+ props.meta ? (react_1.default.createElement("div", { className: "ContentArticle__header" },
19
+ headingElm,
20
+ react_1.default.createElement(ArticleMeta_1.default, { items: props.meta }))) : (headingElm),
19
21
  react_1.default.createElement(TextBlock_1.default, { startSeen: true },
20
22
  props.topImage && react_1.default.createElement(ContentImage_1.default, Object.assign({}, props.topImage)),
21
23
  props.body),
package/ContentImage.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ImageProps } from './_abstract/_Image';
2
- export declare type ContentImageProps = {
2
+ export type ContentImageProps = {
3
3
  image?: ImageProps;
4
4
  caption?: string | JSX.Element;
5
5
  credit?: string | JSX.Element;
package/Datepicker.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { RefObject } from 'react';
2
2
  import { FormFieldWrappingProps } from './FormField';
3
- export declare type DatepickerProps = {
3
+ export type DatepickerProps = {
4
4
  small?: boolean;
5
5
  placeholder?: string;
6
6
  value?: Date;
@@ -20,7 +20,7 @@ export declare type DatepickerProps = {
20
20
  initialDate?: Date;
21
21
  } & FormFieldWrappingProps;
22
22
  export declare const getDateDiff: (date: Date, diff: number) => Date;
23
- export declare type DatepickerLocaleProps = {
23
+ export type DatepickerLocaleProps = {
24
24
  nextMonthAriaLabel: string;
25
25
  nextMonthButtonLabel: string;
26
26
  nextYearAriaLabel: string;
package/Datepicker.js CHANGED
@@ -54,7 +54,7 @@ const i18n = {
54
54
  },
55
55
  };
56
56
  const Datepicker = (props) => {
57
- const { className, id, label, hideLabel, assistText, disabled, readOnly, invalid, errorMessage, required, reqText, placeholder, small, localeCode = 'is', dateFormat = 'd.M.yyy', initialDate, value = initialDate, name, startDate, endDate, minDate, maxDate, isStartDate = false, isEndDate = false, onChange, datepickerExtraProps, ssr, inputRef, } = props;
57
+ const { className, id, label, hideLabel, assistText, disabled, readOnly, invalid, errorMessage, required, reqText, placeholder, small, localeCode = 'is', dateFormat = 'd.M.yyyy', initialDate, value = initialDate, name, startDate, endDate, minDate, maxDate, isStartDate = false, isEndDate = false, onChange, datepickerExtraProps, ssr, inputRef, } = props;
58
58
  const domid = (0, hooks_1.useDomid)(id);
59
59
  const txts = (localeCode && i18n[localeCode]) || {};
60
60
  const filled = !!value;
@@ -72,13 +72,13 @@ const Datepicker = (props) => {
72
72
  if (inputElm) {
73
73
  inputElm.dispatchEvent(new Event('change', { bubbles: true }));
74
74
  }
75
+ }, onChangeRaw: (e) => {
76
+ const { value } = e.currentTarget;
77
+ console.log({ value });
75
78
  }, placeholderText: placeholder,
76
79
  // TODO: Implement this
77
80
  // selectsRange
78
- minDate: minDate, maxDate: maxDate, startDate: startDate, endDate: endDate, selectsStart: isStartDate, selectsEnd: isEndDate, formatWeekDay: (weekday) => {
79
- // TODO: if we use costom locale we don't need this
80
- return weekday.charAt(0).toUpperCase();
81
- }, showYearDropdown: true, scrollableYearDropdown: true, yearDropdownItemNumber: 15, showMonthDropdown: true }, inputProps, txts, datepickerExtraProps))));
81
+ minDate: minDate, maxDate: maxDate, startDate: startDate, endDate: endDate, selectsStart: isStartDate, selectsEnd: isEndDate, formatWeekDay: (weekday) => weekday.charAt(0).toUpperCase(), showYearDropdown: true, scrollableYearDropdown: true, yearDropdownItemNumber: 15, showMonthDropdown: true }, inputProps, txts, datepickerExtraProps))));
82
82
  } }));
83
83
  };
84
84
  exports.Datepicker = Datepicker;
package/ExtraLinks.d.ts CHANGED
@@ -1,17 +1,17 @@
1
1
  import { TextCardListProps } from './_abstract/_CardList';
2
2
  import { SeenProp } from './utils/seenEffect';
3
- export declare type RelatedLink = {
3
+ export type RelatedLink = {
4
4
  href: string;
5
5
  label: string;
6
6
  blank?: boolean;
7
7
  type?: 'link' | 'pdf' | 'text';
8
8
  };
9
- declare type RelatedProps = {
9
+ type RelatedProps = {
10
10
  relatedTitle?: string;
11
11
  relatedLinks?: Array<RelatedLink>;
12
12
  };
13
- export declare type ExtraLinksCardProps = TextCardListProps['cards'][number];
14
- export declare type ExtraLinksProps = TextCardListProps & RelatedProps & {
13
+ export type ExtraLinksCardProps = TextCardListProps['cards'][number];
14
+ export type ExtraLinksProps = TextCardListProps & RelatedProps & {
15
15
  className?: string;
16
16
  } & SeenProp;
17
17
  export declare const ExtraLinks: (props: ExtraLinksProps) => JSX.Element;
package/FeatureList.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Efnistakn } from '@reykjavik/hanna-utils/assets';
2
2
  import { SeenProp } from './utils/seenEffect';
3
- export declare type FeatureListProps = {
3
+ export type FeatureListProps = {
4
4
  title: string;
5
5
  features: Array<{
6
6
  icon?: Efnistakn;
package/FieldGroup.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
- export declare type FieldGroupProps = {
2
+ export type FieldGroupProps = {
3
3
  legend: string;
4
4
  disabled?: boolean;
5
5
  className?: string;
@@ -1,4 +1,4 @@
1
- export declare type CustomFile = {
1
+ export type CustomFile = {
2
2
  preview?: string;
3
3
  } & File;
4
4
  /**
@@ -1,6 +1,6 @@
1
1
  import type { formatBytes } from './_FileInput.utils';
2
2
  import { CustomFile } from './_FileInput.utils';
3
- export declare type FileListProps = {
3
+ export type FileListProps = {
4
4
  files: Array<CustomFile>;
5
5
  showFileSize?: boolean;
6
6
  showImagePreviews?: boolean;
package/FileInput.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { FileListProps } from './FileInput/_FileInputFileList';
2
2
  import { FormFieldWrappingProps } from './FormField';
3
- export declare type FileInputProps = {
3
+ export type FileInputProps = {
4
4
  /**
5
5
  * Flags if the input should accept multiple, or just a single file at a time.
6
6
  *
package/Foonote.d.ts CHANGED
@@ -3,7 +3,7 @@ import { FootnoteProps as _FootnoteProps } from './Footnote';
3
3
  *
4
4
  * This module file is a typo. import from `Footnote` instead
5
5
  */
6
- export declare type FootnoteProps = _FootnoteProps;
6
+ export type FootnoteProps = _FootnoteProps;
7
7
  /** @deprecated (Will be removed in v0.11)
8
8
  *
9
9
  * This module file is a typo. import from `Footnote` instead
package/FooterBadges.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare type FooterBadgesProps = {
1
+ export type FooterBadgesProps = {
2
2
  badges: Array<{
3
3
  altText: string;
4
4
  src: string;