@reykjavik/hanna-react 0.10.92 → 0.10.94

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 (66) hide show
  1. package/ArticleCarousel/_ArticleCarouselCard.d.ts +2 -1
  2. package/CHANGELOG.md +17 -0
  3. package/ContactBubble.d.ts +2 -1
  4. package/ContactBubble.js +4 -6
  5. package/Datepicker.d.ts +31 -3
  6. package/Datepicker.js +25 -6
  7. package/FormField.d.ts +11 -2
  8. package/FormField.js +5 -5
  9. package/MainMenu/_PrimaryPanel.d.ts +2 -2
  10. package/MainMenu.d.ts +2 -1
  11. package/MainMenu.js +5 -6
  12. package/Multiselect/_Multiselect.search.d.ts +19 -0
  13. package/Multiselect/_Multiselect.search.js +80 -0
  14. package/Multiselect.d.ts +64 -0
  15. package/Multiselect.js +236 -0
  16. package/RelatedLinks.d.ts +2 -1
  17. package/Selectbox.d.ts +3 -3
  18. package/TextInput.d.ts +0 -1
  19. package/_abstract/_CardList.d.ts +2 -1
  20. package/_abstract/_CardList.js +2 -2
  21. package/_abstract/_FocusTrap.d.ts +14 -0
  22. package/_abstract/_FocusTrap.js +24 -0
  23. package/_abstract/_TogglerGroup.d.ts +11 -7
  24. package/_abstract/_TogglerGroup.js +11 -3
  25. package/_abstract/_TogglerGroupField.d.ts +4 -4
  26. package/_abstract/_TogglerGroupField.js +2 -2
  27. package/_abstract/_TogglerInput.d.ts +3 -1
  28. package/_abstract/_TogglerInput.js +7 -4
  29. package/_mixed_export_resolution_/ReactDropzone.d.ts +3 -3
  30. package/_mixed_export_resolution_/ReactDropzone.js +3 -3
  31. package/esm/ArticleCarousel/_ArticleCarouselCard.d.ts +2 -1
  32. package/esm/ContactBubble.d.ts +2 -1
  33. package/esm/ContactBubble.js +4 -6
  34. package/esm/Datepicker.d.ts +31 -3
  35. package/esm/Datepicker.js +25 -6
  36. package/esm/FormField.d.ts +11 -2
  37. package/esm/FormField.js +5 -5
  38. package/esm/MainMenu/_PrimaryPanel.d.ts +2 -2
  39. package/esm/MainMenu.d.ts +2 -1
  40. package/esm/MainMenu.js +5 -6
  41. package/esm/Multiselect/_Multiselect.search.d.ts +19 -0
  42. package/esm/Multiselect/_Multiselect.search.js +75 -0
  43. package/esm/Multiselect.d.ts +64 -0
  44. package/esm/Multiselect.js +231 -0
  45. package/esm/RelatedLinks.d.ts +2 -1
  46. package/esm/Selectbox.d.ts +3 -3
  47. package/esm/TextInput.d.ts +0 -1
  48. package/esm/_abstract/_CardList.d.ts +2 -1
  49. package/esm/_abstract/_CardList.js +2 -2
  50. package/esm/_abstract/_FocusTrap.d.ts +14 -0
  51. package/esm/_abstract/_FocusTrap.js +19 -0
  52. package/esm/_abstract/_TogglerGroup.d.ts +11 -7
  53. package/esm/_abstract/_TogglerGroup.js +11 -3
  54. package/esm/_abstract/_TogglerGroupField.d.ts +4 -4
  55. package/esm/_abstract/_TogglerGroupField.js +2 -2
  56. package/esm/_abstract/_TogglerInput.d.ts +3 -1
  57. package/esm/_abstract/_TogglerInput.js +7 -4
  58. package/esm/_mixed_export_resolution_/ReactDropzone.d.ts +3 -3
  59. package/esm/_mixed_export_resolution_/ReactDropzone.js +3 -3
  60. package/esm/index.d.ts +1 -0
  61. package/esm/utils/useFormatMonitor.d.ts +4 -2
  62. package/esm/utils/useFormatMonitor.js +4 -2
  63. package/index.d.ts +1 -0
  64. package/package.json +7 -3
  65. package/utils/useFormatMonitor.d.ts +4 -2
  66. package/utils/useFormatMonitor.js +4 -2
@@ -1,8 +1,8 @@
1
- import type { OptionOrValue, SelectboxProps as _SelectboxProps } from '@hugsmidjan/react/Selectbox';
1
+ import type { OptionOrValue, SelectboxOptions as _SelectboxOptions, SelectboxProps as _SelectboxProps } from '@hugsmidjan/react/Selectbox';
2
2
  import { FormFieldWrappingProps } from './FormField.js';
3
- export { type SelectboxOption, type SelectboxOptions as SelectboxOptionList,
3
+ export { type SelectboxOption, type SelectboxOptions as SelectboxOptionList, } from '@hugsmidjan/react/Selectbox';
4
4
  /** @deprecated Use `SelectboxOptionList` instead (Will be removed in v0.11) */
5
- type SelectboxOptions, } from '@hugsmidjan/react/Selectbox';
5
+ export type SelectboxOptions = _SelectboxOptions;
6
6
  export type SelectboxProps<O extends OptionOrValue = OptionOrValue> = FormFieldWrappingProps & Omit<_SelectboxProps<O>, 'bem'> & {
7
7
  small?: boolean;
8
8
  };
@@ -4,7 +4,6 @@ type InputElmProps = JSX.IntrinsicElements['input'];
4
4
  type TextareaElmProps = JSX.IntrinsicElements['textarea'];
5
5
  export type TextInputProps = {
6
6
  small?: boolean;
7
- children?: never;
8
7
  } & FormFieldWrappingProps & (({
9
8
  type?: 'text' | 'email' | 'tel' | 'number' | 'date' | 'url' | 'password' | 'search';
10
9
  inputRef?: RefObject<HTMLInputElement>;
@@ -1,4 +1,4 @@
1
- import { ReactElement, ReactNode } from 'react';
1
+ import React, { ReactElement, ReactNode } from 'react';
2
2
  import { EitherObj } from '@reykjavik/hanna-utils';
3
3
  import { ImageProps } from './_Image.js';
4
4
  type BaseCardProps = {
@@ -12,6 +12,7 @@ export type ImageCardProps = BaseCardProps & {
12
12
  };
13
13
  export type TextCardProps = BaseCardProps & {
14
14
  summary?: string;
15
+ target?: React.HTMLAttributeAnchorTarget;
15
16
  };
16
17
  export type CardListProps<T> = {
17
18
  cards: Array<T>;
@@ -2,10 +2,10 @@ import React from 'react';
2
2
  import { Button } from './_Button.js';
3
3
  import { Image } from './_Image.js';
4
4
  const Card = (props) => {
5
- const { bem, href, title, imgPlaceholder, image, meta, summary } = props;
5
+ const { bem, href, title, imgPlaceholder, image, meta, summary, target } = props;
6
6
  const cardClass = `${bem}__card`;
7
7
  return (React.createElement(React.Fragment, null,
8
- React.createElement(Button, { bem: cardClass, href: href },
8
+ React.createElement(Button, { bem: cardClass, href: href, target: target },
9
9
  ' ',
10
10
  React.createElement(Image, Object.assign({ className: `${bem}__image` }, image, { placeholder: imgPlaceholder })),
11
11
  React.createElement("span", { className: `${cardClass}__title` }, title),
@@ -0,0 +1,14 @@
1
+ export type FocusTrapProps = {
2
+ /** The HTML tag to use for the trap element. (Default `<span />`) */
3
+ Tag?: `span` | `li`;
4
+ /** Set to `true` for focus traps positioned at the top of a container. */
5
+ atTop?: boolean;
6
+ /**
7
+ * How deep the trap is placed in the DOM tree beneath its container element.
8
+ *
9
+ * Default: `1`
10
+ */
11
+ depth?: number;
12
+ };
13
+ /** A focus trap element that can be used to keep keyboard focus within a container block. */
14
+ export declare const FocusTrap: (props: FocusTrapProps) => JSX.Element;
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ /** A focus trap element that can be used to keep keyboard focus within a container block. */
3
+ export const FocusTrap = (props) => {
4
+ const Tag = props.Tag || 'span';
5
+ return (React.createElement(Tag, { tabIndex: 0, onFocus: (e) => {
6
+ var _a;
7
+ let container = e.currentTarget;
8
+ let depth = Math.max(props.depth || 0, 1);
9
+ while (depth-- && container) {
10
+ container = container.parentElement;
11
+ }
12
+ if (!container) {
13
+ return;
14
+ }
15
+ const focusables = container.querySelectorAll('a,input, select, textarea,button, [tabindex]');
16
+ const targetIdx = props.atTop ? focusables.length - 1 : 0;
17
+ (_a = focusables[targetIdx]) === null || _a === void 0 ? void 0 : _a.focus();
18
+ } }));
19
+ };
@@ -1,24 +1,28 @@
1
1
  import { FormFieldInputProps } from '../FormField.js';
2
2
  import { HTMLProps } from '../utils.js';
3
3
  import { TogglerInputProps } from './_TogglerInput.js';
4
- export type TogglerGroupOption = {
4
+ export type TogglerGroupOption<T = 'default'> = {
5
5
  value: string;
6
- label?: string | JSX.Element;
6
+ label?: T extends 'default' ? string | JSX.Element : T;
7
7
  disabled?: boolean;
8
8
  id?: string;
9
9
  };
10
- export type TogglerGroupOptions = Array<TogglerGroupOption>;
10
+ export type TogglerGroupOptions<T = 'default'> = Array<TogglerGroupOption<T>>;
11
11
  type RestrictedInputProps = Omit<HTMLProps<'input'>, 'type' | 'value' | 'defaultValue' | 'checked' | 'defaultChecked' | 'className' | 'id' | 'name' | 'children'>;
12
- export type TogglerGroupProps = {
13
- options: TogglerGroupOptions;
12
+ export type TogglerGroupProps<T = 'default'> = {
13
+ options: Array<string> | TogglerGroupOptions<T>;
14
14
  className?: string;
15
- name: string;
15
+ name?: string;
16
16
  disabled?: boolean | ReadonlyArray<number>;
17
17
  inputProps?: RestrictedInputProps;
18
18
  onSelected?: (payload: {
19
+ /** The value of being selected/updated */
19
20
  value: string;
21
+ /** The new checked state of the selected value */
20
22
  checked: boolean;
21
- option: TogglerGroupOption;
23
+ /** The option object being selected */
24
+ option: TogglerGroupOption<T>;
25
+ /** The updated value array */
22
26
  selectedValues: Array<string>;
23
27
  }) => void;
24
28
  } & Omit<FormFieldInputProps, 'disabled'>;
@@ -1,11 +1,19 @@
1
- import React from 'react';
1
+ import React, { useMemo } from 'react';
2
+ import { useDomid } from '@hugsmidjan/react/hooks';
2
3
  import getBemClass from '@hugsmidjan/react/utils/getBemClass';
3
4
  import { useMixedControlState } from '../utils.js';
4
5
  export const TogglerGroup = (props) => {
5
6
  const {
6
7
  // id,
7
- className, bem, name, disabled, Toggler, onSelected, options, isRadio, inputProps = {}, } = props;
8
+ className, bem, disabled, readOnly, Toggler, onSelected, isRadio, inputProps = {}, } = props;
8
9
  const [values, setValues] = useMixedControlState(props, 'value', []);
10
+ const name = useDomid(props.name);
11
+ const options = useMemo(() => {
12
+ const _options = props.options;
13
+ return typeof _options[0] === 'string'
14
+ ? _options.map((option) => ({ value: option }))
15
+ : _options;
16
+ }, [props.options]);
9
17
  return (React.createElement("ul", { className: getBemClass(bem, null, className), role: "group", "aria-labelledby": props['aria-labelledby'], "aria-describedby": props['aria-describedby'], "aria-required": props.required }, options.map((option, i) => {
10
18
  const isDisabled = option.disabled != null
11
19
  ? option.disabled
@@ -23,6 +31,6 @@ export const TogglerGroup = (props) => {
23
31
  }
24
32
  setValues(selectedValues);
25
33
  onSelected && onSelected({ value, checked, option, selectedValues });
26
- }, disabled: isDisabled, "aria-invalid": props['aria-invalid'], checked: isChecked })));
34
+ }, disabled: isDisabled, readOnly: readOnly, "aria-invalid": props['aria-invalid'], checked: isChecked })));
27
35
  })));
28
36
  };
@@ -3,9 +3,9 @@ import { BemPropsModifier } from '@hugsmidjan/react/types';
3
3
  import { FormFieldGroupWrappingProps } from '../FormField.js';
4
4
  import { TogglerGroupOption, TogglerGroupOptions, TogglerGroupProps } from './_TogglerGroup.js';
5
5
  import { TogglerInputProps } from './_TogglerInput.js';
6
- export type TogglerGroupFieldProps = {
6
+ export type TogglerGroupFieldProps<T = 'default'> = {
7
7
  className?: string;
8
- } & FormFieldGroupWrappingProps & TogglerGroupProps;
8
+ } & Omit<FormFieldGroupWrappingProps, 'disabled'> & TogglerGroupProps<T>;
9
9
  type _TogglerGroupFieldProps = {
10
10
  Toggler: (props: TogglerInputProps) => ReactElement;
11
11
  isRadio?: true;
@@ -13,7 +13,7 @@ type _TogglerGroupFieldProps = {
13
13
  defaultValue?: string | ReadonlyArray<string>;
14
14
  bem: string;
15
15
  } & BemPropsModifier;
16
- export type TogglerGroupFieldOption = TogglerGroupOption;
17
- export type TogglerGroupFieldOptions = TogglerGroupOptions;
16
+ export type TogglerGroupFieldOption<T = 'default'> = TogglerGroupOption<T>;
17
+ export type TogglerGroupFieldOptions<T = 'default'> = TogglerGroupOptions<T>;
18
18
  export declare const TogglerGroupField: (props: TogglerGroupFieldProps & _TogglerGroupFieldProps) => JSX.Element;
19
19
  export {};
@@ -11,7 +11,7 @@ export const TogglerGroupField = (props) => {
11
11
  : typeof defaultValue === 'string'
12
12
  ? [defaultValue]
13
13
  : defaultValue, [defaultValue]);
14
- return (React.createElement(FormField, { className: getBemClass(bem, modifier, className), group: true, label: label, LabelTag: LabelTag, assistText: assistText, hideLabel: hideLabel, disabled: disabled, readOnly: readOnly, invalid: invalid, errorMessage: errorMessage, required: required, reqText: reqText, id: id, renderInput: (className, inputProps) => {
15
- return (React.createElement(TogglerGroup, Object.assign({ bem: className.options }, inputProps, togglerGroupProps, { value: _value, defaultValue: _defaultValue, Toggler: Toggler })));
14
+ return (React.createElement(FormField, { className: getBemClass(bem, modifier, className), group: true, label: label, LabelTag: LabelTag, assistText: assistText, hideLabel: hideLabel, disabled: !!disabled, readOnly: readOnly, invalid: invalid, errorMessage: errorMessage, required: required, reqText: reqText, id: id, renderInput: (className, inputProps) => {
15
+ return (React.createElement(TogglerGroup, Object.assign({ bem: className.options }, inputProps, togglerGroupProps, { disabled: disabled, value: _value, defaultValue: _defaultValue, Toggler: Toggler })));
16
16
  } }));
17
17
  };
@@ -2,7 +2,6 @@ import { BemPropsModifier } from '@hugsmidjan/react/types';
2
2
  export type TogglerInputProps = {
3
3
  label: string | JSX.Element;
4
4
  children?: never;
5
- Wrapper?: 'div' | 'li';
6
5
  invalid?: boolean;
7
6
  /** Hidden label prefix text to indicate that the field is required.
8
7
  *
@@ -13,6 +12,9 @@ export type TogglerInputProps = {
13
12
  * */
14
13
  reqText?: string | false;
15
14
  errorMessage?: string | JSX.Element;
15
+ Wrapper?: 'div' | 'li';
16
+ wrapperProps?: JSX.IntrinsicElements['div'];
17
+ inputProps?: JSX.IntrinsicElements['input'];
16
18
  } & BemPropsModifier & Omit<JSX.IntrinsicElements['input'], 'type'>;
17
19
  type _TogglerInputProps = {
18
20
  bem: string;
@@ -3,21 +3,24 @@ import React from 'react';
3
3
  import { useDomid } from '@hugsmidjan/react/hooks';
4
4
  import getBemClass from '@hugsmidjan/react/utils/getBemClass';
5
5
  export const TogglerInput = (props) => {
6
- const { bem, modifier, className, label, invalid, errorMessage, Wrapper = 'div', required, reqText, type, id, innerWrap } = props, inputProps = __rest(props, ["bem", "modifier", "className", "label", "invalid", "errorMessage", "Wrapper", "required", "reqText", "type", "id", "innerWrap"]);
6
+ const { bem, modifier, className, label, invalid, errorMessage, Wrapper = 'div', required, reqText, type, id, innerWrap, wrapperProps, inputProps } = props, restInputProps = __rest(props, ["bem", "modifier", "className", "label", "invalid", "errorMessage", "Wrapper", "required", "reqText", "type", "id", "innerWrap", "wrapperProps", "inputProps"]);
7
7
  const domid = useDomid(id);
8
8
  const errorId = errorMessage && 'error' + domid;
9
9
  const reqStar = required && reqText !== false && (React.createElement("abbr", { className: bem + '__label__reqstar',
10
10
  // TODO: add mo-better i18n thinking
11
11
  title: (reqText || 'Þarf að haka í') + ': ' }, "*"));
12
+ const readOnly = restInputProps.readOnly || (inputProps || {}).readOnly;
12
13
  const labelContent = (React.createElement(React.Fragment, null,
13
14
  ' ',
14
15
  reqStar,
15
16
  " ",
16
17
  label,
17
18
  ' '));
18
- return (React.createElement(Wrapper, { className: getBemClass(bem, modifier, className) },
19
- React.createElement("input", Object.assign({ className: bem + '__input', type: type, id: domid, "aria-invalid": invalid || !!errorMessage || undefined, "aria-describedby": errorId }, inputProps)),
19
+ return (React.createElement(Wrapper, Object.assign({}, wrapperProps, { className: getBemClass(bem, modifier, className) }),
20
+ React.createElement("input", Object.assign({ className: bem + '__input', type: type, id: domid, "aria-invalid": invalid || !!errorMessage || undefined, "aria-describedby": errorId }, restInputProps, inputProps, (readOnly && { disabled: true }))),
20
21
  ' ',
21
- React.createElement("label", { className: bem + '__label', htmlFor: domid }, innerWrap ? (React.createElement("span", { className: bem + '__label__wrap' }, labelContent)) : (labelContent)),
22
+ React.createElement("label", { className: bem + '__label', htmlFor: domid },
23
+ innerWrap ? (React.createElement("span", { className: bem + '__label__wrap' }, labelContent)) : (labelContent),
24
+ readOnly && (React.createElement("input", { type: "hidden", name: restInputProps.name, value: restInputProps.value }))),
22
25
  errorMessage && (React.createElement("div", { className: bem + '__error', id: errorId }, errorMessage))));
23
26
  };
@@ -1,3 +1,3 @@
1
- import * as reactDropzonePkg from 'react-dropzone';
2
- export declare const ReactDropzone: typeof reactDropzonePkg.default;
3
- export declare const useDropzone: typeof reactDropzonePkg.useDropzone;
1
+ import * as _pkg from 'react-dropzone';
2
+ export declare const ReactDropzone: typeof _pkg.default;
3
+ export declare const useDropzone: typeof _pkg.useDropzone;
@@ -1,10 +1,10 @@
1
1
  // See <file://./_WAT.md> for info on why this file exists
2
- import * as reactDropzonePkg from 'react-dropzone';
3
- const _default = reactDropzonePkg.default;
2
+ import * as _pkg from 'react-dropzone';
4
3
  // This defensive code is required to get around the fact that react-dropzone
5
4
  // mixes default and named exports.
6
5
  // Depending whether this module is run as ESM or CJS, then `_default` may be
7
6
  // either the actual default export or an object with a default property.
8
7
  // Rejoice in the woeful borderlands of modern ESM and legacy CJS interop.
9
- export const ReactDropzone = 'default' in _default ? _default.default : _default;
8
+ const reactDropzonePkg = 'default' in _pkg.default ? _pkg.default : _pkg;
9
+ export const ReactDropzone = reactDropzonePkg.default;
10
10
  export const useDropzone = reactDropzonePkg.useDropzone;
package/esm/index.d.ts CHANGED
@@ -38,6 +38,7 @@
38
38
  /// <reference path="./NewsHero.d.tsx" />
39
39
  /// <reference path="./NameCards.d.tsx" />
40
40
  /// <reference path="./NameCard.d.tsx" />
41
+ /// <reference path="./Multiselect.d.tsx" />
41
42
  /// <reference path="./Modal.d.tsx" />
42
43
  /// <reference path="./MiniMetrics.d.tsx" />
43
44
  /// <reference path="./MainMenu.d.tsx" />
@@ -5,6 +5,8 @@
5
5
  * Exmple use:
6
6
  *
7
7
  * ```ts
8
+ * import { useFormatMonitor } from '@reykjavik/hanna-react/utils';
9
+ *
8
10
  * useFormatMonitor((media) => {
9
11
  * if (media.is === 'phone') {
10
12
  * // do something clever because the window
@@ -21,8 +23,8 @@
21
23
  *
22
24
  * ```ts
23
25
  * // type Formats = 'phone' | 'phablet' | 'tablet' | 'netbook' | 'wide'
24
- * media.is //: Format
25
- * media.was //?: Format
26
+ * media.is // : Format
27
+ * media.was // ?: Format
26
28
  * // Category/mode boolean flags
27
29
  * // (Hamburger refers to the "mobile menu" mode)
28
30
  * media.isTopmenu
@@ -8,6 +8,8 @@ import { makeFormatMonitorHook } from 'formatchange/react';
8
8
  * Exmple use:
9
9
  *
10
10
  * ```ts
11
+ * import { useFormatMonitor } from '@reykjavik/hanna-react/utils';
12
+ *
11
13
  * useFormatMonitor((media) => {
12
14
  * if (media.is === 'phone') {
13
15
  * // do something clever because the window
@@ -24,8 +26,8 @@ import { makeFormatMonitorHook } from 'formatchange/react';
24
26
  *
25
27
  * ```ts
26
28
  * // type Formats = 'phone' | 'phablet' | 'tablet' | 'netbook' | 'wide'
27
- * media.is //: Format
28
- * media.was //?: Format
29
+ * media.is // : Format
30
+ * media.was // ?: Format
29
31
  * // Category/mode boolean flags
30
32
  * // (Hamburger refers to the "mobile menu" mode)
31
33
  * media.isTopmenu
package/index.d.ts CHANGED
@@ -38,6 +38,7 @@
38
38
  /// <reference path="./NewsHero.d.tsx" />
39
39
  /// <reference path="./NameCards.d.tsx" />
40
40
  /// <reference path="./NameCard.d.tsx" />
41
+ /// <reference path="./Multiselect.d.tsx" />
41
42
  /// <reference path="./Modal.d.tsx" />
42
43
  /// <reference path="./MiniMetrics.d.tsx" />
43
44
  /// <reference path="./MainMenu.d.tsx" />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reykjavik/hanna-react",
3
- "version": "0.10.92",
3
+ "version": "0.10.94",
4
4
  "author": "Reykjavík (http://www.reykjavik.is)",
5
5
  "contributors": [
6
6
  "Hugsmiðjan ehf (http://www.hugsmidjan.is)",
@@ -16,8 +16,8 @@
16
16
  "@floating-ui/react": "^0.19.2",
17
17
  "@hugsmidjan/qj": "^4.20.0",
18
18
  "@hugsmidjan/react": "^0.4.32",
19
- "@reykjavik/hanna-css": "^0.4.2",
20
- "@reykjavik/hanna-utils": "^0.2.6",
19
+ "@reykjavik/hanna-css": "^0.4.3",
20
+ "@reykjavik/hanna-utils": "^0.2.7",
21
21
  "@types/react": "^17.0.24",
22
22
  "@types/react-autosuggest": "^10.1.0",
23
23
  "@types/react-datepicker": "^4.8.0",
@@ -205,6 +205,10 @@
205
205
  "import": "./esm/NameCard.js",
206
206
  "require": "./NameCard.js"
207
207
  },
208
+ "./Multiselect": {
209
+ "import": "./esm/Multiselect.js",
210
+ "require": "./Multiselect.js"
211
+ },
208
212
  "./Modal": {
209
213
  "import": "./esm/Modal.js",
210
214
  "require": "./Modal.js"
@@ -5,6 +5,8 @@
5
5
  * Exmple use:
6
6
  *
7
7
  * ```ts
8
+ * import { useFormatMonitor } from '@reykjavik/hanna-react/utils';
9
+ *
8
10
  * useFormatMonitor((media) => {
9
11
  * if (media.is === 'phone') {
10
12
  * // do something clever because the window
@@ -21,8 +23,8 @@
21
23
  *
22
24
  * ```ts
23
25
  * // type Formats = 'phone' | 'phablet' | 'tablet' | 'netbook' | 'wide'
24
- * media.is //: Format
25
- * media.was //?: Format
26
+ * media.is // : Format
27
+ * media.was // ?: Format
26
28
  * // Category/mode boolean flags
27
29
  * // (Hamburger refers to the "mobile menu" mode)
28
30
  * media.isTopmenu
@@ -11,6 +11,8 @@ const react_1 = require("formatchange/react");
11
11
  * Exmple use:
12
12
  *
13
13
  * ```ts
14
+ * import { useFormatMonitor } from '@reykjavik/hanna-react/utils';
15
+ *
14
16
  * useFormatMonitor((media) => {
15
17
  * if (media.is === 'phone') {
16
18
  * // do something clever because the window
@@ -27,8 +29,8 @@ const react_1 = require("formatchange/react");
27
29
  *
28
30
  * ```ts
29
31
  * // type Formats = 'phone' | 'phablet' | 'tablet' | 'netbook' | 'wide'
30
- * media.is //: Format
31
- * media.was //?: Format
32
+ * media.is // : Format
33
+ * media.was // ?: Format
32
34
  * // Category/mode boolean flags
33
35
  * // (Hamburger refers to the "mobile menu" mode)
34
36
  * media.isTopmenu