@reykjavik/hanna-react 0.10.113 → 0.10.114

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 (121) hide show
  1. package/AccordionList.js +1 -1
  2. package/AutosuggestSearch.d.ts +6 -0
  3. package/AutosuggestSearch.js +19 -3
  4. package/BasicTable.js +4 -4
  5. package/BgBox.d.ts +5 -2
  6. package/BgBox.js +1 -1
  7. package/Bling.js +4 -4
  8. package/CHANGELOG.md +9 -0
  9. package/Carousel.d.ts +1 -1
  10. package/CarouselStepper.js +2 -2
  11. package/CheckboxButton.d.ts +1 -1
  12. package/CityBlock.js +1 -1
  13. package/ContactBubble.js +5 -3
  14. package/Datepicker.js +2 -1
  15. package/FileInput/_FileInput.utils.js +1 -1
  16. package/FileInput.js +6 -7
  17. package/Form.js +1 -1
  18. package/FormField.d.ts +2 -2
  19. package/FormField.js +1 -1
  20. package/Heading.js +1 -1
  21. package/IframeBlock.js +1 -1
  22. package/InfoHero.js +1 -1
  23. package/IslandBlock.js +1 -1
  24. package/IslandPageBlock.js +1 -1
  25. package/MainMenu.js +3 -1
  26. package/MainMenu2.js +0 -1
  27. package/MobileMenuToggler/_useMobileMenuToggling.js +1 -1
  28. package/Multiselect/_Multiselect.search.d.ts +1 -1
  29. package/Multiselect.js +0 -1
  30. package/NameCard.js +1 -1
  31. package/PageHeading.js +1 -1
  32. package/Pagination.js +2 -2
  33. package/Radio.d.ts +3 -0
  34. package/Radio.js +8 -0
  35. package/RadioGroup.d.ts +1 -7
  36. package/RadioGroup.js +2 -5
  37. package/SearchResults/_SearchResultsItem.js +5 -5
  38. package/SearchResults.js +1 -3
  39. package/ShareButtons.js +3 -3
  40. package/SiteSearchAutocomplete.js +6 -6
  41. package/Skeleton.js +1 -1
  42. package/SubHeading.js +1 -1
  43. package/TextInput.js +2 -1
  44. package/VSpacer.js +1 -1
  45. package/VerticalTabsTOC.js +1 -1
  46. package/_abstract/_AbstractCarousel.d.ts +2 -2
  47. package/_abstract/_AbstractCarousel.js +5 -5
  48. package/_abstract/_AbstractModal.js +1 -0
  49. package/_abstract/_Blings.js +1 -1
  50. package/_abstract/_CardList.js +5 -5
  51. package/_abstract/_Quote.js +2 -2
  52. package/_abstract/_Table.js +2 -2
  53. package/_abstract/_TogglerGroup.js +1 -1
  54. package/_abstract/_TogglerInput.d.ts +1 -0
  55. package/_abstract/_TogglerInput.js +10 -9
  56. package/esm/AccordionList.js +1 -1
  57. package/esm/AutosuggestSearch.d.ts +6 -0
  58. package/esm/AutosuggestSearch.js +19 -3
  59. package/esm/BasicTable.js +4 -4
  60. package/esm/BgBox.d.ts +5 -2
  61. package/esm/BgBox.js +1 -1
  62. package/esm/Bling.js +4 -4
  63. package/esm/Carousel.d.ts +1 -1
  64. package/esm/CarouselStepper.js +2 -2
  65. package/esm/CheckboxButton.d.ts +1 -1
  66. package/esm/CityBlock.js +1 -1
  67. package/esm/ContactBubble.js +5 -3
  68. package/esm/Datepicker.js +2 -1
  69. package/esm/FileInput/_FileInput.utils.js +1 -1
  70. package/esm/FileInput.js +6 -7
  71. package/esm/Form.js +1 -1
  72. package/esm/FormField.d.ts +2 -2
  73. package/esm/FormField.js +1 -1
  74. package/esm/Heading.js +1 -1
  75. package/esm/IframeBlock.js +1 -1
  76. package/esm/InfoHero.js +1 -1
  77. package/esm/IslandBlock.js +1 -1
  78. package/esm/IslandPageBlock.js +1 -1
  79. package/esm/MainMenu.js +3 -1
  80. package/esm/MainMenu2.js +0 -1
  81. package/esm/MobileMenuToggler/_useMobileMenuToggling.js +1 -1
  82. package/esm/Multiselect/_Multiselect.search.d.ts +1 -1
  83. package/esm/Multiselect.js +0 -1
  84. package/esm/NameCard.js +1 -1
  85. package/esm/PageHeading.js +1 -1
  86. package/esm/Pagination.js +2 -2
  87. package/esm/Radio.d.ts +3 -0
  88. package/esm/Radio.js +3 -0
  89. package/esm/RadioGroup.d.ts +1 -7
  90. package/esm/RadioGroup.js +1 -4
  91. package/esm/SearchResults/_SearchResultsItem.js +5 -5
  92. package/esm/SearchResults.js +1 -3
  93. package/esm/ShareButtons.js +3 -3
  94. package/esm/SiteSearchAutocomplete.js +6 -6
  95. package/esm/Skeleton.js +1 -1
  96. package/esm/SubHeading.js +1 -1
  97. package/esm/TextInput.js +2 -1
  98. package/esm/VSpacer.js +1 -1
  99. package/esm/VerticalTabsTOC.js +1 -1
  100. package/esm/_abstract/_AbstractCarousel.d.ts +2 -2
  101. package/esm/_abstract/_AbstractCarousel.js +5 -5
  102. package/esm/_abstract/_AbstractModal.js +1 -0
  103. package/esm/_abstract/_Blings.js +1 -1
  104. package/esm/_abstract/_CardList.js +5 -5
  105. package/esm/_abstract/_Quote.js +2 -2
  106. package/esm/_abstract/_Table.js +2 -2
  107. package/esm/_abstract/_TogglerGroup.js +1 -1
  108. package/esm/_abstract/_TogglerInput.d.ts +1 -0
  109. package/esm/_abstract/_TogglerInput.js +10 -9
  110. package/esm/index.d.ts +1 -0
  111. package/esm/utils/browserSide.js +2 -6
  112. package/esm/utils/seenEffect.js +2 -2
  113. package/esm/utils/useLaggedState.js +1 -1
  114. package/esm/utils/useMixedControlState.js +9 -15
  115. package/esm/utils/useShortState.js +4 -1
  116. package/index.d.ts +1 -0
  117. package/package.json +7 -3
  118. package/utils/browserSide.js +2 -6
  119. package/utils/seenEffect.js +2 -2
  120. package/utils/useMixedControlState.js +9 -15
  121. package/utils/useShortState.js +4 -1
package/AccordionList.js CHANGED
@@ -18,7 +18,7 @@ const AccordionListItem = (props) => {
18
18
  };
19
19
  const AccordionList = (props) => {
20
20
  const { items, ssr, wide, defaultOpen, wrapperProps } = props;
21
- const [open, setOpenArray, mode] = (0, utils_js_1.useMixedControlState)(props, 'open', []);
21
+ const [open, setOpenArray /*, mode */] = (0, utils_js_1.useMixedControlState)(props, 'open', []);
22
22
  const onToggle = (index) => {
23
23
  setOpenArray((prevOpen) => {
24
24
  const opened = !prevOpen.includes(index);
@@ -18,8 +18,13 @@ export type AutosuggestSearchI18n = {
18
18
  lang?: string;
19
19
  };
20
20
  export declare const defaultAutosuggestSearchTexts: DefaultTexts<AutosuggestSearchI18n>;
21
+ type EmptyMessage = {
22
+ message: string | JSX.Element;
23
+ type: 'empty' | 'loading';
24
+ };
21
25
  export type AutosuggestSearchProps<T extends string | object> = {
22
26
  options: Array<T>;
27
+ emptyMessage?: EmptyMessage | EmptyMessage['message'];
23
28
  onInput: (value: string) => void;
24
29
  onSelected: (payload: {
25
30
  value: string;
@@ -38,3 +43,4 @@ export type AutosuggestSearchProps<T extends string | object> = {
38
43
  lang?: HannaLang;
39
44
  } & Pick<SearchInputProps, 'onSubmit' | 'onButtonClick' | 'button'> & WrapperElmProps;
40
45
  export declare const AutosuggestSearch: <T extends string | object>(props: AutosuggestSearchProps<T>) => JSX.Element;
46
+ export {};
@@ -31,7 +31,7 @@ exports.defaultAutosuggestSearchTexts = {
31
31
  },
32
32
  };
33
33
  const AutosuggestSearch = (props) => {
34
- const { options, itemActionIcon, onInput, onSelected, onClearOptions, onSubmit, onButtonClick = onSubmit, button, getOptionValue = (opt) => typeof opt !== 'object' || !('value' in opt)
34
+ const { options, emptyMessage, itemActionIcon, onInput, onSelected, onClearOptions, onSubmit, onButtonClick = onSubmit, button, getOptionValue = (opt) => typeof opt !== 'object' || !('value' in opt)
35
35
  ? opt.toString()
36
36
  : opt.value != null
37
37
  ? opt.value.toString()
@@ -41,6 +41,7 @@ const AutosuggestSearch = (props) => {
41
41
  const [value, setValue] = (0, react_1.useState)('');
42
42
  const inputRef = (0, react_1.useRef)(null);
43
43
  const txt = (0, i18n_1.getTexts)(props, exports.defaultAutosuggestSearchTexts);
44
+ const showEmptyMessage = !options.length && emptyMessage;
44
45
  return (react_1.default.createElement(react_autosuggest_1.default, { theme: {
45
46
  container: 'AutosuggestSearch',
46
47
  containerOpen: 'AutosuggestSearch--open',
@@ -49,11 +50,26 @@ const AutosuggestSearch = (props) => {
49
50
  suggestionsList: (0, classUtils_1.modifiedClass)('AutosuggestSearch__list', itemActionIcon && `action--${itemActionIcon}`),
50
51
  suggestion: 'AutosuggestSearch__item',
51
52
  suggestionHighlighted: 'AutosuggestSearch__item--highlighted',
52
- }, focusInputOnSuggestionClick: true, suggestions: options, onSuggestionsClearRequested: onClearOptions, onSuggestionsFetchRequested: ({ value }) => onInput(value), getSuggestionValue: getOptionValue, onSuggestionSelected: (_event, data) => {
53
+ }, focusInputOnSuggestionClick: true, suggestions: showEmptyMessage ? [true] : options, onSuggestionsClearRequested: onClearOptions, onSuggestionsFetchRequested: ({ value }) => onInput(value), getSuggestionValue: showEmptyMessage
54
+ ? () => value // Return the input value in case the user uses the up/down keys to select the hidden empty message
55
+ : getOptionValue, onSuggestionSelected: (event, data) => {
56
+ if (showEmptyMessage) {
57
+ event.preventDefault();
58
+ return;
59
+ }
53
60
  onSelected({ value: data.suggestionValue, option: data.suggestion });
54
61
  },
55
62
  // onSuggestionHighlighted={onSuggestionHighlighted}
56
- renderSuggestion: renderSuggestion, containerProps: Object.assign(Object.assign({}, wrapperProps), { 'aria-label': txt.label }), renderSuggestionsContainer: ({ containerProps, children }) => (react_1.default.createElement("div", Object.assign({}, containerProps, { "aria-label": options.length ? txt.suggestionsLabel : undefined }), children)), inputProps: {
63
+ renderSuggestion: showEmptyMessage ? () => '' : renderSuggestion, containerProps: Object.assign(Object.assign({}, wrapperProps), { 'aria-label': txt.label }), renderSuggestionsContainer: ({ containerProps, children }) => {
64
+ let contents = children;
65
+ if (showEmptyMessage) {
66
+ const { message, type } = typeof emptyMessage === 'string' || !('message' in emptyMessage)
67
+ ? { message: emptyMessage, type: 'empty' }
68
+ : emptyMessage;
69
+ contents = (react_1.default.createElement("div", { className: (0, classUtils_1.modifiedClass)('AutosuggestSearch__emptyMessage', type !== 'empty' && type) }, message));
70
+ }
71
+ return (react_1.default.createElement("div", Object.assign({}, containerProps, { "aria-label": options.length ? txt.suggestionsLabel : undefined }), contents));
72
+ }, inputProps: {
57
73
  ref: inputRef,
58
74
  value: value,
59
75
  onChange: (_, { newValue }) => {
package/BasicTable.js CHANGED
@@ -11,15 +11,15 @@ const tableTypes = {
11
11
  number: 'data--number',
12
12
  };
13
13
  const BasicTable = (props) => {
14
- // eslint-disable-next-line deprecation/deprecation
15
- const { align, fullWidth, type, tbody, tbodies, modifier, thead, tfoot, tableProps, caption, rowProps, compact, cols, wrapperProps, } = props;
14
+ const { align, fullWidth, type, tbody, tbodies, modifier, // eslint-disable-line deprecation/deprecation
15
+ thead, tfoot, tableProps, caption, rowProps, compact, cols, wrapperProps, } = props;
16
16
  return (react_1.default.createElement(_ScrollWrapper_js_1.ScrollWrapper, { bem: "TableWrapper", modifier: [
17
17
  'BasicTable',
18
- modifier && 'BasicTable--' + modifier,
18
+ modifier && `BasicTable--${modifier}`,
19
19
  fullWidth
20
20
  ? 'BasicTable--fullwidth'
21
21
  : align === 'right'
22
- ? 'BasicTable--align--' + align
22
+ ? `BasicTable--align--${align}`
23
23
  : undefined,
24
24
  ], wrapperProps: wrapperProps },
25
25
  react_1.default.createElement(_Table_js_1.Table, Object.assign({ className: (0, classUtils_1.modifiedClass)('BasicTable', [
package/BgBox.d.ts CHANGED
@@ -1,9 +1,12 @@
1
1
  import { ReactNode } from 'react';
2
- import { DeprecatedSeenProp, EffectProp } from './utils/seenEffect.js';
2
+ import { DeprecatedSeenProp } from './utils/seenEffect.js';
3
3
  import { WrapperElmProps } from './utils.js';
4
4
  export type BgBoxProps = {
5
5
  className?: string;
6
6
  children: ReactNode;
7
- } & WrapperElmProps & DeprecatedSeenProp & EffectProp;
7
+ } & WrapperElmProps & DeprecatedSeenProp & {
8
+ /** @deprecated This prop does nothing nowadays (Will be removed in v0.11) */
9
+ effectType?: string;
10
+ };
8
11
  export declare const BgBox: (props: BgBoxProps) => JSX.Element;
9
12
  export default BgBox;
package/BgBox.js CHANGED
@@ -5,7 +5,7 @@ const tslib_1 = require("tslib");
5
5
  const react_1 = tslib_1.__importDefault(require("react"));
6
6
  const classUtils_1 = require("@hugsmidjan/qj/classUtils");
7
7
  const BgBox = (props) => {
8
- const { className, children, effectType, wrapperProps } = props;
8
+ const { className, children, wrapperProps } = props;
9
9
  return (react_1.default.createElement("div", Object.assign({}, wrapperProps, { className: (0, classUtils_1.modifiedClass)('BgBox', undefined,
10
10
  // Prefer `className` over `wrapperProps.className`
11
11
  className || (wrapperProps || {}).className) }), children));
package/Bling.js CHANGED
@@ -38,10 +38,10 @@ const Bling = (props) => {
38
38
  const imageUrl = type ? (0, assets_1.getBlingUrl)(type) : blingUrl;
39
39
  const inlineSvg = (0, useGetSVGtext_js_1.useGetSVGtext)(imageUrl);
40
40
  return (react_1.default.createElement("div", Object.assign({}, wrapperProps, { className: (0, classUtils_1.modifiedClass)('Bling', [
41
- 'align--' + (align && align in aligns ? align : 'left'),
42
- vertical && vertical in valigns && 'vertical--' + vertical,
43
- color && color in colors && 'color--' + color,
44
- parent && parent in parentOffset && 'parent--' + parent,
41
+ `align--${align && align in aligns ? align : 'left'}`,
42
+ vertical && vertical in valigns && `vertical--${vertical}`,
43
+ color && color in colors && `color--${color}`,
44
+ parent && parent in parentOffset && `parent--${parent}`,
45
45
  overlay && 'overlay',
46
46
  ],
47
47
  // Prefer `className` over `wrapperProps.className`
package/CHANGELOG.md CHANGED
@@ -4,6 +4,15 @@
4
4
 
5
5
  - ... <!-- Add new lines here. -->
6
6
 
7
+ ## 0.10.114
8
+
9
+ _2023-12-13_
10
+
11
+ - feat: Add prop `emptyMessage` to `AutosuggestSearch`
12
+ - feat: Add component `Radio` as a standalone atomic widget
13
+ - feat: Add prop `hideLabel` to `Checkbox` for minimal/atomic use
14
+ - fix: Regression in `Checkbox`- and `Radio`-related option typing
15
+
7
16
  ## 0.10.113
8
17
 
9
18
  _2023-12-08_
package/Carousel.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  import { CarouselProps } from './_abstract/_AbstractCarousel.js';
2
2
  export type { CarouselProps } from './_abstract/_AbstractCarousel.js';
3
- export declare const Carousel: <I extends Record<string, unknown> = {}, P extends Record<string, unknown> | undefined = {}>(props: CarouselProps<I, P>) => JSX.Element;
3
+ export declare const Carousel: <I extends Record<string, unknown> = Record<string, never>, P extends Record<string, unknown> | undefined = Record<string, never>>(props: CarouselProps<I, P>) => JSX.Element;
4
4
  export default Carousel;
@@ -10,11 +10,11 @@ const defaultTexts = {
10
10
  const array = new Array(50).join(' ').split('');
11
11
  const CarouselStepper = (props) => {
12
12
  const { current, itemCount, setCurrent, texts = defaultTexts, wrapperProps } = props;
13
- const labelPrefix = texts.prefix ? texts.prefix + ' ' : '';
13
+ const labelPrefix = texts.prefix ? `${texts.prefix} ` : '';
14
14
  return (react_1.default.createElement("div", Object.assign({}, wrapperProps, { className: (0, classUtils_1.modifiedClass)('CarouselStepper', null, (wrapperProps || {}).className) }), array.slice(0, itemCount).map((_, i) => {
15
15
  const isCurrent = current === i || undefined;
16
16
  const label = labelPrefix + (i + 1);
17
- return (react_1.default.createElement("button", { key: i, className: 'CarouselStepper__button', type: "button", disabled: isCurrent, "aria-pressed": isCurrent, "aria-controls": props['aria-controls'], onClick: () => setCurrent(i), "aria-label": label, title: label }, label));
17
+ return (react_1.default.createElement("button", { key: i, className: "CarouselStepper__button", type: "button", disabled: isCurrent, "aria-pressed": isCurrent, "aria-controls": props['aria-controls'], onClick: () => setCurrent(i), "aria-label": label, title: label }, label));
18
18
  })));
19
19
  };
20
20
  exports.CarouselStepper = CarouselStepper;
@@ -1,6 +1,6 @@
1
1
  import { TogglerInputProps } from './_abstract/_TogglerInput.js';
2
2
  /** @deprecated Use `CheckboxButtonProps` instead (Will be removed in v0.11) */
3
3
  export type CheckboxProps = CheckboxButtonProps;
4
- export type CheckboxButtonProps = TogglerInputProps;
4
+ export type CheckboxButtonProps = Omit<TogglerInputProps, 'hideLabel'>;
5
5
  export declare const CheckboxButton: (props: CheckboxButtonProps) => JSX.Element;
6
6
  export default CheckboxButton;
package/CityBlock.js CHANGED
@@ -13,7 +13,7 @@ const types = {
13
13
  const CityBlock = (props) => {
14
14
  const align = props.align || 'right';
15
15
  const type = !props.illustration && props.type; // The presence of illustration prop suppresses type
16
- const modifier = [constants_js_1.aligns[align] && 'align--' + align, type && types[type] && type];
16
+ const modifier = [constants_js_1.aligns[align] && `align--${align}`, type && types[type] && type];
17
17
  const imageProps = props.illustration != null
18
18
  ? { src: (0, assets_1.getIllustrationUrl)(props.illustration) }
19
19
  : props.image;
package/ContactBubble.js CHANGED
@@ -103,7 +103,7 @@ const ContactBubble = (props) => {
103
103
  };
104
104
  },
105
105
  // eslint-disable-next-line react-hooks/exhaustive-deps
106
- [isBrowser, alwaysShow, closeBubble]);
106
+ [isBrowser, alwaysShow, closeBubble /* , wrapperRef */]);
107
107
  (0, react_1.useEffect)(() => {
108
108
  const escHandler = (e) => e.key === 'Escape' && closeBubble();
109
109
  const outsideClickHandler = (e) => {
@@ -126,7 +126,9 @@ const ContactBubble = (props) => {
126
126
  document.removeEventListener('keydown', escHandler);
127
127
  document.removeEventListener('click', outsideClickHandler, true);
128
128
  };
129
- }, [open, closeBubble]);
129
+ },
130
+ // eslint-disable-next-line react-hooks/exhaustive-deps
131
+ [open, closeBubble /* , wrapperRef */]);
130
132
  if (links.length === 0) {
131
133
  return null;
132
134
  }
@@ -135,7 +137,7 @@ const ContactBubble = (props) => {
135
137
  react_1.default.createElement("ul", { className: "ContactBubble__list" }, links.map((linkInfo, i) => {
136
138
  const { href, label, extraLabel, target, onClick } = linkInfo;
137
139
  const icon = (0, exports.ensureIcon)(linkInfo.icon);
138
- const itemClass = (0, classUtils_1.modifiedClass)('ContactBubble__item', icon && 'type--' + icon);
140
+ const itemClass = (0, classUtils_1.modifiedClass)('ContactBubble__item', icon && `type--${icon}`);
139
141
  const onClickHandler = (e) => {
140
142
  if (onClick) {
141
143
  const doPreventDefault = onClick() !== true;
package/Datepicker.js CHANGED
@@ -114,7 +114,8 @@ const defaultDatepickerTexts = {
114
114
  * Internally, this component uses the [`react-datepicker`](https://reactdatepicker.com/) component.
115
115
  */
116
116
  const Datepicker = (props) => {
117
- const { placeholder, dateFormat, name, startDate, endDate, minDate, maxDate, isStartDate = false, isEndDate = false, onChange, datepickerExtraProps, inputRef, isoMode, texts, lang = props.localeCode, fieldWrapperProps, } = (0, FormField_js_1.groupFormFieldWrapperProps)(props);
117
+ const { placeholder, dateFormat, name, startDate, endDate, minDate, maxDate, isStartDate = false, isEndDate = false, onChange, datepickerExtraProps, inputRef, isoMode, texts, lang = props.localeCode, // eslint-disable-line deprecation/deprecation
118
+ fieldWrapperProps, } = (0, FormField_js_1.groupFormFieldWrapperProps)(props);
118
119
  const [value, setValue] = utils_js_1.useMixedControlState.raw(props.value || props.initialDate, // eslint-disable-line deprecation/deprecation
119
120
  props.defaultValue, 'value');
120
121
  /*
@@ -36,7 +36,7 @@ const formatBytes = (bytes, lang = 'is', decimals = 2) => {
36
36
  }
37
37
  const i = Math.min(Math.floor(Math.log(Math.abs(bytes) / kThreshold) / Math.log(k)), units.length - 1);
38
38
  const scaled = bytes / Math.pow(k, i);
39
- const formatted = (parseFloat(scaled.toFixed(decimals)) + '').replace('.',
39
+ const formatted = `${parseFloat(scaled.toFixed(decimals))}`.replace('.',
40
40
  // NOTE: As of 2022-11 Chrome still doesn't support Icelandic
41
41
  decimalSymbols[lang] || (1.1).toLocaleString(lang)[1]);
42
42
  return `${formatted} ${units[i]}`;
package/FileInput.js CHANGED
@@ -16,12 +16,11 @@ const defaultRemoveFileText = {
16
16
  pl: 'Usuń',
17
17
  };
18
18
  const defaultOnFilesRejected = (rejectedFiles) => {
19
- window.alert('Error:\n' +
20
- rejectedFiles
21
- .map((elm) => {
22
- return elm.name;
23
- })
24
- .join(', '));
19
+ window.alert(`Error:\n${rejectedFiles
20
+ .map((elm) => {
21
+ return elm.name;
22
+ })
23
+ .join(', ')}`);
25
24
  };
26
25
  const arrayToFileList = (arr) => {
27
26
  const fileList = new DataTransfer();
@@ -109,7 +108,7 @@ const FileInput = (props) => {
109
108
  }
110
109
  onFilesUpdated(fileList, diff);
111
110
  };
112
- return (react_1.default.createElement(FormField_js_1.default, Object.assign({ extraClassName: (0, classUtils_1.modifiedClass)('FileInput', [multiple && 'multi']) }, fieldWrapperProps, { id: domid + '-fake', LabelTag: "h4", renderInput: (className, inputProps /* , addFocusProps */) => {
111
+ return (react_1.default.createElement(FormField_js_1.default, Object.assign({ extraClassName: (0, classUtils_1.modifiedClass)('FileInput', [multiple && 'multi']) }, fieldWrapperProps, { id: `${domid}-fake`, LabelTag: "h4", renderInput: (className, inputProps /* , addFocusProps */) => {
113
112
  return (react_1.default.createElement("div", { className: className.control, ref: fileInputWrapper },
114
113
  // Explicitly skip rendering of input element if no
115
114
  // name prop is provided. This is implicitly what the
package/Form.js CHANGED
@@ -8,7 +8,7 @@ const classUtils_1 = require("@hugsmidjan/qj/classUtils");
8
8
  // it makes little sense to add support for `wrapperProps` on top.
9
9
  const Form = (props) => {
10
10
  const { children, align, wide, className } = props, formProps = tslib_1.__rest(props, ["children", "align", "wide", "className"]);
11
- return (react_1.default.createElement("form", Object.assign({}, formProps, { className: (0, classUtils_1.modifiedClass)('Form', [align === 'right' && 'align--' + align, !align && wide && 'wide'], className) }), children));
11
+ return (react_1.default.createElement("form", Object.assign({}, formProps, { className: (0, classUtils_1.modifiedClass)('Form', [align === 'right' && `align--${align}`, !align && wide && 'wide'], className) }), children));
12
12
  };
13
13
  exports.Form = Form;
14
14
  exports.default = exports.Form;
package/FormField.d.ts CHANGED
@@ -86,8 +86,8 @@ export declare const getFormFieldWrapperProps: (props: (FormFieldGroupWrappingPr
86
86
  }) => RequireExplicitUndefined<FormFieldGroupWrappingProps> & {
87
87
  small: boolean | undefined;
88
88
  };
89
- export declare const groupFormFieldWrapperProps: <T extends (FormFieldGroupWrappingProps | Pick<TogglerGroupFieldProps<"default", {}>, "label" | "className" | "id" | "wrapperProps" | "disabled" | "ssr" | "invalid" | "readOnly" | "required" | "errorMessage" | "reqText" | "assistText" | "hideLabel" | "wrapperRef" | "LabelTag">) & {
89
+ export declare const groupFormFieldWrapperProps: <T extends (FormFieldGroupWrappingProps | Pick<TogglerGroupFieldProps<"default", {}>, "label" | "className" | "id" | "wrapperProps" | "disabled" | "ssr" | "invalid" | "readOnly" | "required" | "hideLabel" | "errorMessage" | "reqText" | "assistText" | "wrapperRef" | "LabelTag">) & {
90
90
  small?: boolean | undefined;
91
- }>(props: T) => Omit<T, "label" | "small" | "className" | "id" | "wrapperProps" | "disabled" | "ssr" | "invalid" | "readOnly" | "required" | "errorMessage" | "reqText" | "assistText" | "hideLabel" | "wrapperRef" | "LabelTag"> & {
91
+ }>(props: T) => Omit<T, "label" | "small" | "className" | "id" | "wrapperProps" | "disabled" | "ssr" | "invalid" | "readOnly" | "required" | "hideLabel" | "errorMessage" | "reqText" | "assistText" | "wrapperRef" | "LabelTag"> & {
92
92
  fieldWrapperProps: ReturnType<typeof getFormFieldWrapperProps>;
93
93
  };
package/FormField.js CHANGED
@@ -64,7 +64,7 @@ const FormField = (props) => {
64
64
  required: required,
65
65
  readOnly: readOnly,
66
66
  'aria-invalid': isInvalid,
67
- 'aria-describedby': assistTextId && errorId ? assistTextId + ' ' + errorId : assistTextId || errorId,
67
+ 'aria-describedby': assistTextId && errorId ? `${assistTextId} ${errorId}` : assistTextId || errorId,
68
68
  'aria-labelledby': labelId, // undefined if normalLabel
69
69
  };
70
70
  return (react_1.default.createElement("div", Object.assign({ ref: props.wrapperRef }, wrapperProps, { className: (0, classUtils_1.modifiedClass)('FormField', [
package/Heading.js CHANGED
@@ -16,7 +16,7 @@ const Heading = (props) => {
16
16
  const suppressWarning = process.env.NODE_ENV !== 'production' && Tag === 'h1' ? true : undefined;
17
17
  return (react_1.default.createElement(Tag, Object.assign({}, wrapperProps, { "data-dev-forcedh1": suppressWarning, className: (0, classUtils_1.modifiedClass)('Heading', [
18
18
  sizes[size],
19
- align === 'right' && 'align--' + align,
19
+ align === 'right' && `align--${align}`,
20
20
  !align && wide && 'wide',
21
21
  (wrapperProps || {}).className,
22
22
  ]) }), children));
package/IframeBlock.js CHANGED
@@ -15,7 +15,7 @@ const iframe_resizer_react_1 = tslib_1.__importDefault(require("iframe-resizer-r
15
15
  */
16
16
  const IframeBlock = (props) => {
17
17
  const { title, src, framed, compact, align } = props;
18
- const className = (0, classUtils_1.modifiedClass)('IframeBlock', [framed && 'framed', compact && 'compact', align === 'right' && 'align--' + align], (props.wrapperProps || {}).className);
18
+ const className = (0, classUtils_1.modifiedClass)('IframeBlock', [framed && 'framed', compact && 'compact', align === 'right' && `align--${align}`], (props.wrapperProps || {}).className);
19
19
  if (typeof props.height === 'number') {
20
20
  const { wrapperProps, scrolling, height } = props;
21
21
  return (react_1.default.createElement("iframe", Object.assign({}, wrapperProps, { className: className, title: title, src: src,
package/InfoHero.js CHANGED
@@ -74,7 +74,7 @@ const InfoHero = (props) => {
74
74
  const blings = typeof blingType === 'object'
75
75
  ? blingType
76
76
  : (blingType && blingOptions[blingType]) || blingOptions.waves; // default to `waves`
77
- return (react_1.default.createElement("div", Object.assign({}, wrapperProps, { className: (0, classUtils_1.modifiedClass)('InfoHero', 'align--' + alignment, (wrapperProps || {}).className) }),
77
+ return (react_1.default.createElement("div", Object.assign({}, wrapperProps, { className: (0, classUtils_1.modifiedClass)('InfoHero', `align--${alignment}`, (wrapperProps || {}).className) }),
78
78
  react_1.default.createElement("div", { className: "InfoHero__content" },
79
79
  react_1.default.createElement("h1", { className: "InfoHero__title" }, title),
80
80
  titleBlurb && react_1.default.createElement("div", { className: "InfoHero__titleblurb" }, titleBlurb),
package/IslandBlock.js CHANGED
@@ -15,7 +15,7 @@ const IslandBlock = (props) => {
15
15
  content,
16
16
  image: shapes ? { src: (0, assets_1.getFormheimurUrl)(shapes), inline: true } : image || {},
17
17
  };
18
- return (react_1.default.createElement(_Block_js_1.Block, Object.assign({ wrapperProps: wrapperProps, bem: "IslandBlock", modifier: 'align--' + alignment }, blockProps)));
18
+ return (react_1.default.createElement(_Block_js_1.Block, Object.assign({ wrapperProps: wrapperProps, bem: "IslandBlock", modifier: `align--${alignment}` }, blockProps)));
19
19
  };
20
20
  exports.IslandBlock = IslandBlock;
21
21
  exports.default = exports.IslandBlock;
@@ -15,7 +15,7 @@ const IslandPageBlock = (props) => {
15
15
  const { title, summary, buttons, illustration, image, align, background, wrapperProps, } = props;
16
16
  const alignment = align && constants_js_1.aligns[align] ? align : 'right';
17
17
  const bg = backgrounds[background || 'none'];
18
- return (react_1.default.createElement(_Block_js_1.Block, { wrapperProps: wrapperProps, bem: "IslandPageBlock", modifier: ['align--' + alignment, bg && 'background--' + bg], content: { title, summary, buttons }, image: illustration ? { src: (0, assets_1.getIllustrationUrl)(illustration) } : image || {} }));
18
+ return (react_1.default.createElement(_Block_js_1.Block, { wrapperProps: wrapperProps, bem: "IslandPageBlock", modifier: [`align--${alignment}`, bg && `background--${bg}`], content: { title, summary, buttons }, image: illustration ? { src: (0, assets_1.getIllustrationUrl)(illustration) } : image }));
19
19
  };
20
20
  exports.IslandPageBlock = IslandPageBlock;
21
21
  exports.default = exports.IslandPageBlock;
package/MainMenu.js CHANGED
@@ -173,7 +173,9 @@ const _MainMenu = (props) => {
173
173
  document.removeEventListener('keydown', escHandler);
174
174
  document.removeEventListener('click', clickHandler, true);
175
175
  };
176
- }, [hasActivePanel, setActivePanel, isBrowser]);
176
+ },
177
+ // eslint-disable-next-line react-hooks/exhaustive-deps
178
+ [hasActivePanel, setActivePanel, isBrowser /* , menuElmRef */]);
177
179
  if (menuItems.length === 0) {
178
180
  return null;
179
181
  }
package/MainMenu2.js CHANGED
@@ -71,7 +71,6 @@ const iconMap = {
71
71
  */
72
72
  const getRenderers = (props) => {
73
73
  const { onItemClick, closeMenu, isBrowser } = props;
74
- // eslint-disable-next-line complexity
75
74
  const renderItem = (classPrefix, item, opts = {}) => {
76
75
  const { key, Tag = 'li', button } = opts;
77
76
  if (typeof item === 'function') {
@@ -48,7 +48,7 @@ const useMobileMenuToggling = (opts) => {
48
48
  const toggler = typeof togglerElm === 'string' ? document.querySelector(togglerElm) : togglerElm;
49
49
  const menuElmId = toggler === null || toggler === void 0 ? void 0 : toggler.getAttribute('aria-controls');
50
50
  if (menuElmId) {
51
- (0, hanna_utils_1.focusElement)('#' + menuElmId);
51
+ (0, hanna_utils_1.focusElement)(`#${menuElmId}`);
52
52
  }
53
53
  }
54
54
  };
@@ -16,4 +16,4 @@ queryWords: Array<string>,
16
16
  rawQuery: string) => number;
17
17
  export declare const defaultSearchScoring: SearchScoringfn;
18
18
  /** Returns a normalized, filtered list of options */
19
- export declare const filterItems: <Extras = {}>(options: TogglerGroupOptions<string, Extras>, searchQuery: string, searchScoringFn?: SearchScoringfn) => TogglerGroupOptions<string, Extras>;
19
+ export declare const filterItems: <Extras = Record<string, never>>(options: TogglerGroupOptions<string, Extras>, searchQuery: string, searchScoringFn?: SearchScoringfn) => TogglerGroupOptions<string, Extras>;
package/Multiselect.js CHANGED
@@ -224,7 +224,6 @@ const Multiselect = (props) => {
224
224
  removable: true,
225
225
  onRemove: () => {
226
226
  handleCheckboxSelection(item);
227
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
228
227
  inputWrapperRef
229
228
  .current.querySelector('.Multiselect__choices')
230
229
  .focus();
package/NameCard.js CHANGED
@@ -18,7 +18,7 @@ const _telToContactInfo = (tel) => {
18
18
  }
19
19
  tel = typeof tel === 'string' ? [tel] : tel;
20
20
  return tel.map((tel) => ({
21
- href: 'tel:' + tel,
21
+ href: `tel:${tel}`,
22
22
  value: tel,
23
23
  }));
24
24
  };
package/PageHeading.js CHANGED
@@ -6,7 +6,7 @@ const react_1 = tslib_1.__importDefault(require("react"));
6
6
  const classUtils_1 = require("@hugsmidjan/qj/classUtils");
7
7
  const PageHeading = (props) => {
8
8
  const { Tag = 'h1', align, small, children, wrapperProps } = props;
9
- return (react_1.default.createElement(Tag, Object.assign({}, wrapperProps, { className: (0, classUtils_1.modifiedClass)('PageHeading', [small && 'small', align === 'right' && 'align--' + align], (wrapperProps || {}).className) }), children));
9
+ return (react_1.default.createElement(Tag, Object.assign({}, wrapperProps, { className: (0, classUtils_1.modifiedClass)('PageHeading', [small && 'small', align === 'right' && `align--${align}`], (wrapperProps || {}).className) }), children));
10
10
  };
11
11
  exports.PageHeading = PageHeading;
12
12
  exports.default = exports.PageHeading;
package/Pagination.js CHANGED
@@ -10,8 +10,8 @@ const Pagination_privates_js_1 = require("./utils/Pagination.privates.js");
10
10
  const utils_js_1 = require("./utils.js");
11
11
  const PaginationButton = (props) => {
12
12
  const { page, label, modifier, disabled, onChange, href } = props;
13
- const labelLong = props.labelLong.replace(/\$\{page\}/, page + '');
14
- const labelShort = label ? label.replace(/\$\{page\}/, page + '') : page + '';
13
+ const labelLong = props.labelLong.replace(/\$\{page\}/, `${page}`);
14
+ const labelShort = label ? label.replace(/\$\{page\}/, `${page}`) : `${page}`;
15
15
  const btnProps = {
16
16
  key: props.key,
17
17
  className: (0, classUtils_1.modifiedClass)('Pagination__button', modifier),
package/Radio.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import { TogglerInputProps } from './_abstract/_TogglerInput.js';
2
+ export type RadioProps = Omit<TogglerInputProps, 'reqText'>;
3
+ export declare const Radio: (props: RadioProps) => JSX.Element;
package/Radio.js ADDED
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Radio = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const react_1 = tslib_1.__importDefault(require("react"));
6
+ const _TogglerInput_js_1 = require("./_abstract/_TogglerInput.js");
7
+ const Radio = (props) => (react_1.default.createElement(_TogglerInput_js_1.TogglerInput, Object.assign({ bem: "Radio" }, props, { type: "radio", reqText: false })));
8
+ exports.Radio = Radio;
package/RadioGroup.d.ts CHANGED
@@ -1,6 +1,4 @@
1
1
  import { TogglerGroupFieldOption, TogglerGroupFieldOptions, TogglerGroupFieldProps } from './_abstract/_TogglerGroupField.js';
2
- import { TogglerInputProps } from './_abstract/_TogglerInput.js';
3
- type RadioProps = Omit<TogglerInputProps, 'reqText'>;
4
2
  export type RadioGroupProps = TogglerGroupFieldProps & {
5
3
  layout?: 'inline';
6
4
  value?: string;
@@ -8,9 +6,5 @@ export type RadioGroupProps = TogglerGroupFieldProps & {
8
6
  };
9
7
  export type RadioGroupOption = TogglerGroupFieldOption;
10
8
  export type RadioGroupOptions = TogglerGroupFieldOptions;
11
- export declare const RadioGroup: {
12
- (props: RadioGroupProps): JSX.Element;
13
- /** @deprecated Exposed for testing purposes only. This may disappear at any time. */
14
- __Radio: (props: RadioProps) => JSX.Element;
15
- };
9
+ export declare const RadioGroup: (props: RadioGroupProps) => JSX.Element;
16
10
  export default RadioGroup;
package/RadioGroup.js CHANGED
@@ -4,10 +4,7 @@ exports.RadioGroup = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const react_1 = tslib_1.__importDefault(require("react"));
6
6
  const _TogglerGroupField_js_1 = require("./_abstract/_TogglerGroupField.js");
7
- const _TogglerInput_js_1 = require("./_abstract/_TogglerInput.js");
8
- const Radio = (props) => react_1.default.createElement(_TogglerInput_js_1.TogglerInput, Object.assign({}, props, { bem: "Radio", type: "radio" }));
9
- const RadioGroup = (props) => (react_1.default.createElement(_TogglerGroupField_js_1.TogglerGroupField, Object.assign({}, props, { bem: "RadioGroup", modifier: props.layout, isRadio: true, Toggler: Radio })));
7
+ const Radio_js_1 = require("./Radio.js");
8
+ const RadioGroup = (props) => (react_1.default.createElement(_TogglerGroupField_js_1.TogglerGroupField, Object.assign({}, props, { bem: "RadioGroup", modifier: props.layout, isRadio: true, Toggler: Radio_js_1.Radio })));
10
9
  exports.RadioGroup = RadioGroup;
11
- /** @deprecated Exposed for testing purposes only. This may disappear at any time. */
12
- exports.RadioGroup.__Radio = Radio; // eslint-disable-line deprecation/deprecation
13
10
  exports.default = exports.RadioGroup;
@@ -10,10 +10,10 @@ const SearchResultsItem = (props) => {
10
10
  const bem = highlight ? 'SearchResultsHighlightItem' : 'SearchResultsItem';
11
11
  const metaArr = (Array.isArray(meta) ? meta : [meta]);
12
12
  return (react_1.default.createElement("li", { className: bem },
13
- react_1.default.createElement(_Link_js_1.Link, { className: bem + '__link', href: href },
14
- react_1.default.createElement("h3", { className: bem + '__title' }, title),
15
- metaArr.length > 0 && (react_1.default.createElement("span", { className: bem + '__meta' }, metaArr.map((item, i) => typeof item === 'function' ? item() : item && react_1.default.createElement("span", { key: i }, item)))),
16
- highlight && image && react_1.default.createElement(_Image_js_1.Image, { bem: bem + '__image', src: image }),
17
- react_1.default.createElement("div", { className: bem + '__summary', dangerouslySetInnerHTML: { __html: summary } }))));
13
+ react_1.default.createElement(_Link_js_1.Link, { className: `${bem}__link`, href: href },
14
+ react_1.default.createElement("h3", { className: `${bem}__title` }, title),
15
+ metaArr.length > 0 && (react_1.default.createElement("span", { className: `${bem}__meta` }, metaArr.map((item, i) => typeof item === 'function' ? item() : item && react_1.default.createElement("span", { key: i }, item)))),
16
+ highlight && image && react_1.default.createElement(_Image_js_1.Image, { bem: `${bem}__image`, src: image }),
17
+ react_1.default.createElement("div", { className: `${bem}__summary`, dangerouslySetInnerHTML: { __html: summary } }))));
18
18
  };
19
19
  exports.SearchResultsItem = SearchResultsItem;
package/SearchResults.js CHANGED
@@ -85,9 +85,7 @@ const renderTitle = (props, texts) => {
85
85
  status === 'loadingquery'
86
86
  ? texts.loadQueryTitle
87
87
  : totalHits
88
- ? (0, prettyNum_1.prettyNum)(totalHits, { lang: texts.lang }) +
89
- ' ' +
90
- texts.resultsTitle
88
+ ? `${(0, prettyNum_1.prettyNum)(totalHits, { lang: texts.lang })} ${texts.resultsTitle}`
91
89
  : texts.noResultsTitle,
92
90
  react_1.default.createElement("span", { className: "SearchResults__query" }, query)));
93
91
  };
package/ShareButtons.js CHANGED
@@ -22,7 +22,7 @@ const ShareButtons__item = (props) => {
22
22
  const buttonText = (0, shareButtonsUtils_1.getShareButtonLabel)(type, label);
23
23
  const popup = type !== 'email';
24
24
  return (react_1.default.createElement("li", { className: "ShareButtons__item" },
25
- react_1.default.createElement(_Link_js_1.Link, { className: 'ShareButtons__link ShareButtons__link--' + type, href: href, title: buttonText, rel: "noopener noreferrer", target: popup ? '_blank' : undefined, onClick: popup ? shareButtonsUtils_1.openInPopup : undefined }, buttonText)));
25
+ react_1.default.createElement(_Link_js_1.Link, { className: `ShareButtons__link ShareButtons__link--${type}`, href: href, title: buttonText, rel: "noopener noreferrer", target: popup ? '_blank' : undefined, onClick: popup ? shareButtonsUtils_1.openInPopup : undefined }, buttonText)));
26
26
  };
27
27
  const ShareButtons = (props) => {
28
28
  const { texts, lang, ssr, facebook = true, twitter = true, linkedin, email, wrapperProps, } = props;
@@ -41,8 +41,8 @@ const ShareButtons = (props) => {
41
41
  return null;
42
42
  }
43
43
  const txt = texts ||
44
- (docMeta && (shareButtonsUtils_1.shareButtonTexts[docMeta.lang] || shareButtonsUtils_1.shareButtonTexts[i18n_1.DEFAULT_LANG])) ||
45
- {};
44
+ (docMeta && shareButtonsUtils_1.shareButtonTexts[docMeta.lang]) ||
45
+ shareButtonsUtils_1.shareButtonTexts[i18n_1.DEFAULT_LANG];
46
46
  const { label, buttonLabel, emailSubject } = txt;
47
47
  const className = (0, classUtils_1.modifiedClass)('ShareButtons', null, (wrapperProps || {}).className);
48
48
  if (!docMeta || ssr === 'ssr-only') {
@@ -42,12 +42,12 @@ const SiteSearchAutocomplete = (props) => {
42
42
  }
43
43
  return (react_1.default.createElement(react_autosuggest_1.default, { theme: {
44
44
  container: bem,
45
- containerOpen: bem + '--open',
46
- suggestionsContainer: bem + '__container',
47
- suggestionsContainerOpen: bem + '__container--open',
48
- suggestionsList: bem + '__list',
49
- suggestion: bem + '__item',
50
- suggestionHighlighted: bem + '__item--highlighted',
45
+ containerOpen: `${bem}--open`,
46
+ suggestionsContainer: `${bem}__container`,
47
+ suggestionsContainerOpen: `${bem}__container--open`,
48
+ suggestionsList: `${bem}__list`,
49
+ suggestion: `${bem}__item`,
50
+ suggestionHighlighted: `${bem}__item--highlighted`,
51
51
  }, focusInputOnSuggestionClick: true, suggestions: suggestions, onSuggestionsClearRequested: () => setSuggestions([]), onSuggestionsFetchRequested: onSuggestionsFetchRequested, getSuggestionValue: getSuggestionValue, onSuggestionSelected: onSuggestionSelected, onSuggestionHighlighted: onSuggestionHighlighted, renderSuggestion: renderSuggestion || ((s) => String(s)), containerProps: Object.assign(Object.assign({}, wrapperProps), { 'aria-label': txt.label }), renderSuggestionsContainer: ({ containerProps, children }) => (react_1.default.createElement("div", Object.assign({}, containerProps, { "aria-label": suggestions.length ? txt.suggestionsLabel : undefined }), children)), inputProps: {
52
52
  ref: inputRef,
53
53
  value: value,
package/Skeleton.js CHANGED
@@ -24,7 +24,7 @@ const Skeleton = (props) => {
24
24
  const gap = minmax(props.gap, 5, 1);
25
25
  const items = minmax(props.items, 20, 2) || 1;
26
26
  const { wrapperProps } = props;
27
- const className = (0, classUtils_1.modifiedClass)('Skeleton', [props.text && 'text', height && 'height--' + height, gap && 'gap--' + gap], (wrapperProps || {}).className);
27
+ const className = (0, classUtils_1.modifiedClass)('Skeleton', [props.text && 'text', height && `height--${height}`, gap && `gap--${gap}`], (wrapperProps || {}).className);
28
28
  if (items) {
29
29
  return (react_1.default.createElement(react_1.default.Fragment, null, (0, range_1.default)(1, items).map((key) => (react_1.default.createElement("span", { key: key, className: className })))));
30
30
  }
package/SubHeading.js CHANGED
@@ -8,7 +8,7 @@ const SubHeading = (props) => {
8
8
  const { small, Tag = 'h2', children, align, wide, wrapperProps } = props;
9
9
  return (react_1.default.createElement(Tag, Object.assign({}, wrapperProps, { className: (0, classUtils_1.modifiedClass)('SubHeading', [
10
10
  small && 'small',
11
- align === 'right' && 'align--' + align,
11
+ align === 'right' && `align--${align}`,
12
12
  !align && wide && 'wide',
13
13
  ], (wrapperProps || {}).className) }), children));
14
14
  };
package/TextInput.js CHANGED
@@ -28,7 +28,8 @@ const TextInput = (props) => {
28
28
  if ((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.value) {
29
29
  setHasValue(true);
30
30
  }
31
- }, []);
31
+ }, [] // eslint-disable-line react-hooks/exhaustive-deps
32
+ );
32
33
  return (react_1.default.createElement(FormField_js_1.default, Object.assign({ extraClassName: (0, classUtils_1.modifiedClass)('TextInput', [multiline && 'multiline']), empty: empty, filled: filled }, fieldWrapperProps, { renderInput: (className, inputProps, addFocusProps) => multiline ? (react_1.default.createElement("textarea", Object.assign({ className: className.input, onChange: _onChange }, inputProps, addFocusProps(inputElementProps), { ref: inputRef }))) : (react_1.default.createElement("input", Object.assign({ className: className.input, onChange: _onChange, type: type }, inputProps, addFocusProps(inputElementProps), { ref: inputRef }))) })));
33
34
  };
34
35
  exports.TextInput = TextInput;