@hitachivantara/uikit-react-core 5.87.3 → 5.89.0

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 (165) hide show
  1. package/dist/cjs/ActionsGeneric/ActionsGeneric.cjs +2 -3
  2. package/dist/cjs/AppSwitcher/Action/Action.styles.cjs +2 -2
  3. package/dist/cjs/Banner/Banner.cjs +5 -5
  4. package/dist/cjs/Banner/BannerContent/BannerContent.cjs +59 -97
  5. package/dist/cjs/Banner/BannerContent/BannerContent.styles.cjs +18 -46
  6. package/dist/cjs/BaseDropdown/BaseDropdown.styles.cjs +1 -2
  7. package/dist/cjs/BaseInput/BaseInput.styles.cjs +1 -1
  8. package/dist/cjs/BaseInput/validations.cjs +2 -1
  9. package/dist/cjs/Button/Button.cjs +1 -2
  10. package/dist/cjs/Button/Button.styles.cjs +0 -6
  11. package/dist/cjs/ColorPicker/ColorPicker.cjs +1 -1
  12. package/dist/cjs/DatePicker/DatePicker.cjs +12 -12
  13. package/dist/cjs/DotPagination/DotPagination.styles.cjs +3 -0
  14. package/dist/cjs/FilterGroup/FilterContent/FilterContent.cjs +1 -1
  15. package/dist/cjs/FormElement/Adornment/Adornment.cjs +15 -36
  16. package/dist/cjs/FormElement/Adornment/Adornment.styles.cjs +12 -21
  17. package/dist/cjs/IconContainer/IconContainer.cjs +81 -0
  18. package/dist/cjs/Input/Input.cjs +29 -51
  19. package/dist/cjs/Input/Input.styles.cjs +1 -0
  20. package/dist/cjs/List/List.cjs +1 -1
  21. package/dist/cjs/ListContainer/ListItem/ListItem.styles.cjs +0 -6
  22. package/dist/cjs/Loading/Loading.cjs +1 -2
  23. package/dist/cjs/Loading/Loading.styles.cjs +3 -1
  24. package/dist/cjs/Pagination/Pagination.styles.cjs +2 -2
  25. package/dist/cjs/Pagination/Select.cjs +1 -1
  26. package/dist/cjs/Snackbar/Snackbar.cjs +6 -5
  27. package/dist/cjs/Snackbar/SnackbarContent/SnackbarContent.cjs +20 -28
  28. package/dist/cjs/Snackbar/SnackbarContent/SnackbarContent.styles.cjs +26 -56
  29. package/dist/cjs/Table/TableBody/TableBody.cjs +16 -17
  30. package/dist/cjs/{TableSection → Table/TableSection}/TableSection.cjs +2 -2
  31. package/dist/cjs/{TableSection → Table/TableSection}/TableSection.styles.cjs +12 -12
  32. package/dist/cjs/Table/hooks/useHvRowExpand.cjs +3 -3
  33. package/dist/cjs/Tabs/Tab/Tab.styles.cjs +0 -3
  34. package/dist/cjs/Tag/Tag.cjs +1 -1
  35. package/dist/cjs/TagsInput/TagsInput.cjs +103 -169
  36. package/dist/cjs/TagsInput/TagsInput.styles.cjs +45 -106
  37. package/dist/cjs/TextArea/TextArea.cjs +1 -3
  38. package/dist/cjs/TimePicker/TimePicker.cjs +5 -4
  39. package/dist/cjs/Typography/Typography.styles.cjs +2 -1
  40. package/dist/cjs/VerticalNavigation/NavigationSlider/NavigationSlider.styles.cjs +0 -3
  41. package/dist/cjs/VerticalNavigation/TreeView/TreeViewItem.styles.cjs +0 -4
  42. package/dist/cjs/hooks/useFocus.cjs +38 -0
  43. package/dist/cjs/index.cjs +9 -4
  44. package/dist/cjs/utils/Callout.cjs +134 -0
  45. package/dist/cjs/utils/focusUtils.cjs +0 -4
  46. package/dist/esm/ActionsGeneric/ActionsGeneric.js +2 -3
  47. package/dist/esm/ActionsGeneric/ActionsGeneric.js.map +1 -1
  48. package/dist/esm/AppSwitcher/Action/Action.styles.js +2 -2
  49. package/dist/esm/AppSwitcher/Action/Action.styles.js.map +1 -1
  50. package/dist/esm/AvatarGroup/AvatarGroupContext.js +1 -1
  51. package/dist/esm/Banner/Banner.js +5 -5
  52. package/dist/esm/Banner/Banner.js.map +1 -1
  53. package/dist/esm/Banner/BannerContent/BannerContent.js +60 -96
  54. package/dist/esm/Banner/BannerContent/BannerContent.js.map +1 -1
  55. package/dist/esm/Banner/BannerContent/BannerContent.styles.js +18 -46
  56. package/dist/esm/Banner/BannerContent/BannerContent.styles.js.map +1 -1
  57. package/dist/esm/BaseCheckBox/BaseCheckBox.js +1 -1
  58. package/dist/esm/BaseDropdown/BaseDropdown.js +3 -3
  59. package/dist/esm/BaseDropdown/BaseDropdown.styles.js +1 -2
  60. package/dist/esm/BaseDropdown/BaseDropdown.styles.js.map +1 -1
  61. package/dist/esm/BaseInput/BaseInput.js.map +1 -1
  62. package/dist/esm/BaseInput/BaseInput.styles.js +1 -1
  63. package/dist/esm/BaseInput/BaseInput.styles.js.map +1 -1
  64. package/dist/esm/BaseInput/validations.js +2 -1
  65. package/dist/esm/BaseInput/validations.js.map +1 -1
  66. package/dist/esm/BaseRadio/BaseRadio.js +1 -1
  67. package/dist/esm/Button/Button.js +3 -4
  68. package/dist/esm/Button/Button.js.map +1 -1
  69. package/dist/esm/Button/Button.styles.js +0 -6
  70. package/dist/esm/Button/Button.styles.js.map +1 -1
  71. package/dist/esm/Calendar/CalendarHeader/CalendarHeader.js +1 -1
  72. package/dist/esm/CheckBoxGroup/CheckBoxGroup.js.map +1 -1
  73. package/dist/esm/ColorPicker/ColorPicker.js +1 -1
  74. package/dist/esm/ColorPicker/ColorPicker.js.map +1 -1
  75. package/dist/esm/ColorPicker/Fields/Fields.js.map +1 -1
  76. package/dist/esm/DatePicker/DatePicker.js.map +1 -1
  77. package/dist/esm/DatePicker/utils.js +1 -1
  78. package/dist/esm/Dialog/context.js +1 -1
  79. package/dist/esm/DotPagination/DotPagination.js +1 -1
  80. package/dist/esm/DotPagination/DotPagination.styles.js +3 -0
  81. package/dist/esm/DotPagination/DotPagination.styles.js.map +1 -1
  82. package/dist/esm/Dropdown/Dropdown.js.map +1 -1
  83. package/dist/esm/DropdownButton/DropdownButton.js.map +1 -1
  84. package/dist/esm/FilterGroup/FilterContent/FilterContent.js +1 -1
  85. package/dist/esm/FilterGroup/FilterContent/FilterContent.js.map +1 -1
  86. package/dist/esm/FilterGroup/FilterGroupContext.js +1 -1
  87. package/dist/esm/Focus/Focus.js +1 -1
  88. package/dist/esm/FormElement/Adornment/Adornment.js +15 -36
  89. package/dist/esm/FormElement/Adornment/Adornment.js.map +1 -1
  90. package/dist/esm/FormElement/Adornment/Adornment.styles.js +12 -21
  91. package/dist/esm/FormElement/Adornment/Adornment.styles.js.map +1 -1
  92. package/dist/esm/Header/Navigation/useSelectionPath.js.map +1 -1
  93. package/dist/esm/IconContainer/IconContainer.js +81 -0
  94. package/dist/esm/IconContainer/IconContainer.js.map +1 -0
  95. package/dist/esm/Input/Input.js +30 -52
  96. package/dist/esm/Input/Input.js.map +1 -1
  97. package/dist/esm/Input/Input.styles.js +1 -0
  98. package/dist/esm/Input/Input.styles.js.map +1 -1
  99. package/dist/esm/List/List.js +1 -1
  100. package/dist/esm/ListContainer/ListItem/ListItem.styles.js +0 -6
  101. package/dist/esm/ListContainer/ListItem/ListItem.styles.js.map +1 -1
  102. package/dist/esm/Loading/Loading.js +1 -2
  103. package/dist/esm/Loading/Loading.js.map +1 -1
  104. package/dist/esm/Loading/Loading.styles.js +3 -1
  105. package/dist/esm/Loading/Loading.styles.js.map +1 -1
  106. package/dist/esm/Pagination/Pagination.styles.js +5 -5
  107. package/dist/esm/Pagination/Select.js +1 -1
  108. package/dist/esm/QueryBuilder/Context.js +1 -1
  109. package/dist/esm/QueryBuilder/QueryBuilder.js +1 -1
  110. package/dist/esm/QueryBuilder/utils/index.js +1 -1
  111. package/dist/esm/RadioGroup/RadioGroup.js.map +1 -1
  112. package/dist/esm/SelectionList/SelectionList.js.map +1 -1
  113. package/dist/esm/Slider/Slider.js +1 -1
  114. package/dist/esm/Slider/Slider.js.map +1 -1
  115. package/dist/esm/Snackbar/Snackbar.js +6 -5
  116. package/dist/esm/Snackbar/Snackbar.js.map +1 -1
  117. package/dist/esm/Snackbar/SnackbarContent/SnackbarContent.js +23 -29
  118. package/dist/esm/Snackbar/SnackbarContent/SnackbarContent.js.map +1 -1
  119. package/dist/esm/Snackbar/SnackbarContent/SnackbarContent.styles.js +26 -56
  120. package/dist/esm/Snackbar/SnackbarContent/SnackbarContent.styles.js.map +1 -1
  121. package/dist/esm/SnackbarProvider/SnackbarProvider.js +2 -2
  122. package/dist/esm/Table/Table.js.map +1 -1
  123. package/dist/esm/Table/TableBody/TableBody.js +16 -17
  124. package/dist/esm/Table/TableBody/TableBody.js.map +1 -1
  125. package/dist/esm/{TableSection → Table/TableSection}/TableSection.js +2 -2
  126. package/dist/esm/Table/TableSection/TableSection.js.map +1 -0
  127. package/dist/esm/{TableSection → Table/TableSection}/TableSection.styles.js +25 -25
  128. package/dist/esm/Table/TableSection/TableSection.styles.js.map +1 -0
  129. package/dist/esm/Table/hooks/useHvRowExpand.js +3 -3
  130. package/dist/esm/Table/hooks/useHvRowExpand.js.map +1 -1
  131. package/dist/esm/Tabs/Tab/Tab.styles.js +0 -3
  132. package/dist/esm/Tabs/Tab/Tab.styles.js.map +1 -1
  133. package/dist/esm/Tag/Tag.js +1 -1
  134. package/dist/esm/Tag/Tag.js.map +1 -1
  135. package/dist/esm/TagsInput/TagsInput.js +103 -169
  136. package/dist/esm/TagsInput/TagsInput.js.map +1 -1
  137. package/dist/esm/TagsInput/TagsInput.styles.js +45 -106
  138. package/dist/esm/TagsInput/TagsInput.styles.js.map +1 -1
  139. package/dist/esm/TextArea/TextArea.js +1 -3
  140. package/dist/esm/TextArea/TextArea.js.map +1 -1
  141. package/dist/esm/TimePicker/TimePicker.js +1 -0
  142. package/dist/esm/TimePicker/TimePicker.js.map +1 -1
  143. package/dist/esm/TreeView/internals/TreeViewProvider.js +1 -1
  144. package/dist/esm/TreeView/internals/hooks/plugins/useTreeViewKeyboardNavigation.js +1 -1
  145. package/dist/esm/Typography/Typography.styles.js +2 -1
  146. package/dist/esm/Typography/Typography.styles.js.map +1 -1
  147. package/dist/esm/VerticalNavigation/NavigationSlider/NavigationSlider.js.map +1 -1
  148. package/dist/esm/VerticalNavigation/NavigationSlider/NavigationSlider.styles.js +0 -3
  149. package/dist/esm/VerticalNavigation/NavigationSlider/NavigationSlider.styles.js.map +1 -1
  150. package/dist/esm/VerticalNavigation/TreeView/TreeViewItem.styles.js +0 -4
  151. package/dist/esm/VerticalNavigation/TreeView/TreeViewItem.styles.js.map +1 -1
  152. package/dist/esm/hooks/useFocus.js +38 -0
  153. package/dist/esm/hooks/useFocus.js.map +1 -0
  154. package/dist/esm/hooks/useScrollTo.js.map +1 -1
  155. package/dist/esm/index.js +56 -51
  156. package/dist/esm/index.js.map +1 -1
  157. package/dist/esm/utils/Callout.js +132 -0
  158. package/dist/esm/utils/Callout.js.map +1 -0
  159. package/dist/esm/utils/document.js.map +1 -1
  160. package/dist/esm/utils/focusUtils.js +0 -4
  161. package/dist/esm/utils/focusUtils.js.map +1 -1
  162. package/dist/types/index.d.ts +677 -670
  163. package/package.json +8 -8
  164. package/dist/esm/TableSection/TableSection.js.map +0 -1
  165. package/dist/esm/TableSection/TableSection.styles.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
- import { useRef, useState, useMemo, useCallback, isValidElement, cloneElement, useEffect } from "react";
2
+ import { useRef, useState, useMemo, useCallback, cloneElement, isValidElement, useEffect } from "react";
3
3
  import { useForkRef } from "@mui/material/utils";
4
4
  import { CloseXS, Search, PreviewOff, Preview, Success } from "@hitachivantara/uikit-react-icons";
5
5
  import { useDefaultProps } from "@hitachivantara/uikit-react-utils";
@@ -53,7 +53,7 @@ const HvInput = fixedForwardRef(function HvInput2(props, ref) {
53
53
  id,
54
54
  name,
55
55
  value: valueProp,
56
- defaultValue = "",
56
+ defaultValue,
57
57
  required,
58
58
  readOnly,
59
59
  disabled,
@@ -98,8 +98,7 @@ const HvInput = fixedForwardRef(function HvInput2(props, ref) {
98
98
  const suggestionsRef = useRef(null);
99
99
  const [focused, setFocused] = useState(false);
100
100
  const isDirty = useRef(false);
101
- const [value, setValue] = useControlled(valueProp, defaultValue);
102
- const isEmptyValue = value == null || value === "";
101
+ const isEmptyValue = !inputRef.current?.value;
103
102
  const [validationState, setValidationState] = useControlled(
104
103
  status,
105
104
  validationStates.standBy
@@ -123,7 +122,6 @@ const HvInput = fixedForwardRef(function HvInput2(props, ref) {
123
122
  const performValidation = useCallback(() => {
124
123
  const inputValidity = validateInput(
125
124
  inputRef.current,
126
- String(value),
127
125
  required,
128
126
  minCharQuantity,
129
127
  maxCharQuantity,
@@ -144,8 +142,7 @@ const HvInput = fixedForwardRef(function HvInput2(props, ref) {
144
142
  setValidationMessage,
145
143
  setValidationState,
146
144
  validation,
147
- validationType,
148
- value
145
+ validationType
149
146
  ]);
150
147
  const canShowError = ariaErrorMessage == null && (status !== void 0 && statusMessage !== void 0 || status === void 0 && hasBuiltInValidations(
151
148
  required,
@@ -199,7 +196,6 @@ const HvInput = fixedForwardRef(function HvInput2(props, ref) {
199
196
  };
200
197
  const onChangeHandler = (event, newValue) => {
201
198
  isDirty.current = true;
202
- setValue(newValue);
203
199
  onChange?.(event, newValue);
204
200
  if (canShowSuggestions) {
205
201
  suggestionHandler(newValue);
@@ -209,12 +205,12 @@ const HvInput = fixedForwardRef(function HvInput2(props, ref) {
209
205
  if (eventTargetIsInsideContainer(suggestionsRef.current, event)) return;
210
206
  setFocused(false);
211
207
  const inputValidity = performValidation();
212
- onBlur?.(event, String(value), inputValidity);
208
+ onBlur?.(event, event.target.value, inputValidity);
213
209
  };
214
210
  const onFocusHandler = (event) => {
215
211
  setFocused(true);
216
212
  setValidationState(validationStates.standBy);
217
- onFocus?.(event, String(value));
213
+ onFocus?.(event, event.target.value);
218
214
  };
219
215
  const getSuggestions = (li) => {
220
216
  const listEl = document.getElementById(
@@ -231,13 +227,14 @@ const HvInput = fixedForwardRef(function HvInput2(props, ref) {
231
227
  }
232
228
  };
233
229
  const onKeyDownHandler = (event) => {
230
+ const { value } = event.currentTarget;
234
231
  if (isKey(event, "ArrowDown") && hasSuggestions) {
235
232
  const li = getSuggestions(0);
236
233
  li?.focus();
237
234
  } else if (isKey(event, "Enter")) {
238
- onEnter?.(event, String(value));
235
+ onEnter?.(event, value);
239
236
  }
240
- onKeyDown?.(event, String(value));
237
+ onKeyDown?.(event, value);
241
238
  };
242
239
  const onContainerBlurHandler = (event) => {
243
240
  if (event.relatedTarget) {
@@ -247,8 +244,7 @@ const HvInput = fixedForwardRef(function HvInput2(props, ref) {
247
244
  }, 10);
248
245
  }
249
246
  };
250
- const hasOnEnter = onEnter != null;
251
- const showClear = !disabled && !readOnly && !disableClear && !isEmptyValue && (!hasOnEnter || type !== "search" || disableSearchButton || validationState !== validationStates.standBy);
247
+ const showClear = !disabled && !readOnly && !disableClear && !isEmptyValue && (!onEnter || type !== "search" || disableSearchButton || validationState !== validationStates.standBy);
252
248
  const showSearchIcon = type === "search" && !disableSearchButton;
253
249
  const showRevealPasswordButton = type === "password" && !disableRevealPassword;
254
250
  const handleClear = useCallback(
@@ -288,42 +284,27 @@ const HvInput = fixedForwardRef(function HvInput2(props, ref) {
288
284
  elementId,
289
285
  cx
290
286
  ]);
291
- const handleSearch = useCallback(
292
- (event) => {
293
- onEnter?.(event, String(value));
294
- },
295
- [onEnter, value]
296
- );
297
287
  const searchButton = useMemo(() => {
298
- const reallyShowIt = showSearchIcon && (isEmptyValue || hasOnEnter && validationState === validationStates.standBy);
299
- if (!reallyShowIt) {
300
- return null;
301
- }
288
+ const reallyShowIt = showSearchIcon && (isEmptyValue || onEnter && validationState === validationStates.standBy);
289
+ if (!reallyShowIt) return null;
302
290
  return /* @__PURE__ */ jsx(
303
291
  HvAdornment,
304
292
  {
305
293
  className: classes.adornmentButton,
306
- onClick: hasOnEnter ? handleSearch : void 0,
307
- "aria-label": labels?.searchButtonLabel,
308
- icon: /* @__PURE__ */ jsx(Search, {})
294
+ onClick: onEnter && ((evt) => onEnter?.(evt, inputRef.current?.value ?? "")),
295
+ icon: /* @__PURE__ */ jsx(Search, { title: labels.searchButtonLabel })
309
296
  }
310
297
  );
311
298
  }, [
312
299
  showSearchIcon,
313
300
  isEmptyValue,
314
- hasOnEnter,
301
+ onEnter,
315
302
  validationState,
316
303
  classes.adornmentButton,
317
- handleSearch,
318
- labels?.searchButtonLabel
304
+ labels.searchButtonLabel
319
305
  ]);
320
- const handleRevealPassword = useCallback(() => {
321
- setRevealPassword(!revealPassword);
322
- }, [revealPassword]);
323
306
  const revealPasswordButton = useMemo(() => {
324
- if (!showRevealPasswordButton) {
325
- return null;
326
- }
307
+ if (!showRevealPasswordButton) return null;
327
308
  return /* @__PURE__ */ jsx(
328
309
  HvTooltip,
329
310
  {
@@ -334,10 +315,12 @@ const HvInput = fixedForwardRef(function HvInput2(props, ref) {
334
315
  HvAdornment,
335
316
  {
336
317
  className: classes.adornmentButton,
337
- onClick: handleRevealPassword,
318
+ onClick: () => setRevealPassword((s) => !s),
338
319
  "aria-label": labels?.revealPasswordButtonLabel,
339
320
  "aria-controls": setId(elementId, "input"),
340
- icon: revealPassword ? /* @__PURE__ */ jsx(PreviewOff, {}) : /* @__PURE__ */ jsx(Preview, {})
321
+ icon: revealPassword ? /* @__PURE__ */ jsx(PreviewOff, {}) : /* @__PURE__ */ jsx(Preview, {}),
322
+ tabIndex: 0,
323
+ ...{ selected: revealPassword }
341
324
  }
342
325
  )
343
326
  }
@@ -349,28 +332,23 @@ const HvInput = fixedForwardRef(function HvInput2(props, ref) {
349
332
  labels?.revealPasswordButtonClickToShowTooltip,
350
333
  labels?.revealPasswordButtonLabel,
351
334
  classes.adornmentButton,
352
- handleRevealPassword,
353
335
  elementId
354
336
  ]);
355
337
  const validationIcon = useMemo(() => {
356
- if (!showValidationIcon) {
357
- return null;
358
- }
359
- if (!isValid(validationState)) {
360
- return null;
361
- }
338
+ if (!showValidationIcon) return null;
339
+ if (!isValid(validationState)) return null;
362
340
  return /* @__PURE__ */ jsx(Success, { color: "positive", className: classes.icon });
363
341
  }, [showValidationIcon, validationState, classes.icon]);
364
342
  const customIconEl = useMemo(
365
- () => isValidElement(endAdornment) && cloneElement(endAdornment, {
343
+ () => isValidElement(endAdornment) ? cloneElement(endAdornment, {
366
344
  className: cx(endAdornment.props.className, classes.icon)
367
- }),
345
+ }) : endAdornment,
368
346
  [classes.icon, endAdornment, cx]
369
347
  );
370
348
  const adornments = useMemo(() => {
371
349
  if (!clearButton && !revealPasswordButton && !searchButton && !validationIcon && !customIconEl)
372
350
  return null;
373
- return /* @__PURE__ */ jsxs("div", { className: classes.adornmentsBox, "aria-hidden": "true", children: [
351
+ return /* @__PURE__ */ jsxs("div", { className: classes.adornmentsBox, children: [
374
352
  clearButton,
375
353
  revealPasswordButton,
376
354
  searchButton,
@@ -434,7 +412,8 @@ const HvInput = fixedForwardRef(function HvInput2(props, ref) {
434
412
  {
435
413
  id: hasLabel || showClear || showRevealPasswordButton ? setId(elementId, "input") : setId(id, "input"),
436
414
  name,
437
- value,
415
+ value: valueProp,
416
+ defaultValue,
438
417
  required,
439
418
  readOnly,
440
419
  disabled,
@@ -460,13 +439,12 @@ const HvInput = fixedForwardRef(function HvInput2(props, ref) {
460
439
  "aria-errormessage": errorMessageId,
461
440
  "aria-describedby": ariaDescribedBy != null ? ariaDescribedBy : description ? setId(elementId, "description") : void 0,
462
441
  "aria-controls": canShowSuggestions ? setId(elementId, "suggestions") : void 0,
463
- ref: inputRef,
464
442
  // prevent browsers auto-fill/suggestions when we have our own
465
443
  autoComplete: canShowSuggestions ? "off" : void 0,
466
444
  onFocus: (event) => {
467
445
  inputProps.onFocus?.(event);
468
446
  if (canShowSuggestions && suggestOnFocus) {
469
- suggestionHandler(String(value));
447
+ suggestionHandler(event.currentTarget.value);
470
448
  }
471
449
  },
472
450
  onClick: (event) => {
@@ -475,7 +453,7 @@ const HvInput = fixedForwardRef(function HvInput2(props, ref) {
475
453
  },
476
454
  ...inputProps
477
455
  },
478
- inputRef: forkedRef,
456
+ ref: forkedRef,
479
457
  endAdornment: adornments,
480
458
  ...others
481
459
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Input.js","sources":["../../../src/Input/Input.tsx"],"sourcesContent":["import {\n cloneElement,\n isValidElement,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { useForkRef } from \"@mui/material/utils\";\nimport {\n CloseXS,\n Preview,\n PreviewOff,\n Search,\n Success,\n} from \"@hitachivantara/uikit-react-icons\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvBaseInput, HvBaseInputProps } from \"../BaseInput\";\nimport {\n computeValidationMessage,\n computeValidationState,\n computeValidationType,\n DEFAULT_ERROR_MESSAGES,\n hasBuiltInValidations,\n HvInputValidity,\n validateInput,\n} from \"../BaseInput/validations\";\nimport {\n HvAdornment,\n HvAdornmentProps,\n HvFormElement,\n HvFormElementProps,\n HvFormStatus,\n HvInfoMessage,\n HvLabel,\n HvWarningText,\n isInvalid,\n isValid,\n validationStates,\n} from \"../FormElement\";\nimport {\n HvSuggestion,\n HvSuggestions,\n HvSuggestionsProps,\n} from \"../FormElement/Suggestions/Suggestions\";\nimport { useControlled } from \"../hooks/useControlled\";\nimport { useIsMounted } from \"../hooks/useIsMounted\";\nimport { useLabels } from \"../hooks/useLabels\";\nimport { useUniqueId } from \"../hooks/useUniqueId\";\nimport { HvTooltip } from \"../Tooltip\";\nimport { fixedForwardRef } from \"../types/generic\";\nimport { isKey } from \"../utils/keyboardUtils\";\nimport { setId } from \"../utils/setId\";\nimport { staticClasses, useClasses } from \"./Input.styles\";\n\nexport { staticClasses as inputClasses };\n\nexport type HvInputClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvValidationMessages {\n /** The value when a validation fails. */\n error?: string;\n /** The message that appears when there are too many characters. */\n maxCharError?: string;\n /** The message that appears when there are too few characters. */\n minCharError?: string;\n /** The message that appears when the input is empty and required. */\n requiredError?: string;\n /** The message that appears when the input is value is incompatible with the expected type. */\n typeMismatchError?: string;\n}\n\nexport interface HvInputSuggestion {\n id: string;\n label: string;\n value?: string;\n}\n\nexport interface HvInputProps<\n InputElement extends HTMLElement = HTMLInputElement | HTMLTextAreaElement,\n> extends Omit<\n HvBaseInputProps,\n \"onChange\" | \"onBlur\" | \"onFocus\" | \"onKeyDown\"\n > {\n /** The form element name. */\n name?: string;\n /** The value of the form element. */\n value?: React.InputHTMLAttributes<InputElement>[\"value\"];\n /** When uncontrolled, defines the initial input value. */\n defaultValue?: React.InputHTMLAttributes<InputElement>[\"value\"];\n /**\n * The label of the form element.\n *\n * The form element must be labeled for accessibility reasons.\n * If not provided, an aria-label or aria-labelledby must be inputted via inputProps.\n */\n label?: React.ReactNode;\n /** Provide additional descriptive text for the form element. */\n description?: React.ReactNode;\n /** Indicates that the form element is disabled. */\n disabled?: boolean;\n /** Indicates that the form element is not editable. */\n readOnly?: boolean;\n /** Indicates that user input is required on the form element. */\n required?: boolean;\n /**\n * The status of the form element.\n *\n * Valid is correct, invalid is incorrect and standBy means no validations have run.\n *\n * When uncontrolled and unspecified it will default to \"standBy\" and change to either \"valid\"\n * or \"invalid\" after any change to `checked`, depending of the values of both `required` and `checked`.\n */\n status?: HvFormStatus;\n /** The error message to show when `status` is \"invalid\". */\n statusMessage?: string;\n /**\n * Callback called when the user submits the value by pressing Enter/Return.\n *\n * Also called when the search button is clicked (when type is \"search\").\n */\n /**\n * The function that will be executed onChange, allows modification of the input,\n * it receives the value. If a new value should be presented it must returned it.\n */\n onChange?: (event: React.ChangeEvent<InputElement>, value: string) => void;\n // onEnter?: (event: React.KeyboardEvent<InputElement>, value: string) => void;\n onEnter?: (\n event: React.KeyboardEvent<InputElement> | React.MouseEvent,\n value: string,\n ) => void;\n /**\n * The function that will be executed onBlur, allows checking the validation state,\n * it receives the value and the validation state.\n */\n onBlur?: (\n event: React.FocusEvent<InputElement>,\n value: string,\n validationState: HvInputValidity,\n ) => void;\n /**\n * The function that will be executed onBlur, allows checking the value state,\n * it receives the value.\n */\n onFocus?: (event: React.FocusEvent<InputElement>, value: string) => void;\n /**\n * The function that will be executed onKeyDown, allows checking the value state,\n * it receives the event and value.\n */\n onKeyDown?: (event: React.KeyboardEvent<InputElement>, value: string) => void;\n /** The input type. */\n type?: React.HTMLInputTypeAttribute;\n /** The placeholder value of the input. */\n placeholder?: string;\n /** Internal labels?. */\n labels?: HvInputLabels & Record<string, any>;\n /** An Object containing the various texts associated with the input. */\n validationMessages?: HvValidationMessages;\n /** The function that will be executed to received an array of objects that has a label and id to create list of suggestion */\n suggestionListCallback?: (value: string) => HvInputSuggestion[] | null;\n /**\n * If enabled, the suggestions list will be rendered using a portal.\n * If disabled, it will be under the DOM hierarchy of the parent component.\n * @default false\n * */\n enablePortal?: boolean;\n /**\n * Whether the suggestions should be triggered once the input is focused and not only when typing.\n * @default false\n * */\n suggestOnFocus?: boolean;\n /**\n * The custom validation function, it receives the value and must return\n * either `true` for valid or `false` for invalid, default validations would only\n * occur if this function is null or undefined\n */\n validation?: (value: string) => boolean;\n /** If `true` it should autofocus. */\n autoFocus?: boolean;\n /** If `true` the clear button is disabled. */\n disableClear?: boolean; // TODO - rename in v6 since it doesn't disable but hides the button\n /** If `true` the reveal password button is disabled. Valid only when type is \"password\". */\n disableRevealPassword?: boolean; // TODO - rename in v6 since it doesn't disable but hides the button\n /** If `true` the search button is disabled. Valid only when type is \"search\". */\n disableSearchButton?: boolean; // TODO - rename in v6 since it doesn't disable but hides the button\n /**\n * If `true` the validation icon adornment is visible. Defaults to `false`.\n *\n * Currently, DS specifications define only a positive feedback icon;\n * errors are signaled through the border style and by displaying the error message.\n */\n showValidationIcon?: boolean;\n /** A custom icon to be added into the input. */\n endAdornment?: React.ReactNode;\n /** The maximum allowed length of the characters, if this value is null no check will be performed. */\n maxCharQuantity?: number;\n /** The minimum allowed length of the characters, if this value is null no check will be perform. */\n minCharQuantity?: number;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvInputClasses;\n}\n\nconst DEFAULT_LABELS = {\n /** The label of the clear button. */\n clearButtonLabel: \"Clear the text\",\n /** The label of the reveal password button. */\n revealPasswordButtonLabel: \"Reveal password\",\n /** The tooltip of the reveal password button when the password is hidden. */\n revealPasswordButtonClickToShowTooltip: \"Click to show password.\",\n /** The tooltip of the reveal password button when the password is revealed. */\n revealPasswordButtonClickToHideTooltip: \"Click to hide password.\",\n /** The label of the search button. */\n searchButtonLabel: \"Search\",\n};\n\nexport type HvInputLabels = Partial<typeof DEFAULT_LABELS>;\n\nfunction eventTargetIsInsideContainer(\n container: HTMLElement | null,\n event: React.FocusEvent<any>,\n) {\n return !!container?.contains(event.relatedTarget);\n}\n\n/** Changes a given `input`'s `value`, triggering its `onChange` */\nconst changeInputValue = (input: HTMLInputElement | null, value = \"\") => {\n const event = new Event(\"input\", { bubbles: true });\n\n /** Original `input.value` setter (React overrides it). */\n const setInputValue = Object.getOwnPropertyDescriptor(\n window.HTMLInputElement.prototype,\n \"value\",\n )?.set;\n\n setInputValue?.call(input, value);\n input?.dispatchEvent(event);\n};\n\n/**\n * A text input box is a graphical control element intended to enable the user to input text information to be used by the software.\n */\nexport const HvInput = fixedForwardRef(function HvInput<\n InputElement extends HTMLElement = HTMLInputElement | HTMLTextAreaElement,\n>(props: HvInputProps<InputElement>, ref: React.Ref<InputElement>) {\n const {\n classes: classesProp,\n className,\n id,\n name,\n value: valueProp,\n defaultValue = \"\",\n required,\n readOnly,\n disabled,\n enablePortal = false,\n suggestOnFocus = false,\n label,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n description,\n \"aria-describedby\": ariaDescribedBy,\n onChange,\n onEnter,\n status,\n statusMessage,\n \"aria-errormessage\": ariaErrorMessage,\n type = \"text\",\n placeholder,\n autoFocus = false,\n labels: labelsProp,\n validationMessages,\n disableClear = false,\n disableRevealPassword = false,\n disableSearchButton = false,\n endAdornment,\n maxCharQuantity,\n minCharQuantity,\n validation,\n showValidationIcon = false,\n suggestionListCallback,\n inputRef: inputRefProp,\n onBlur,\n onFocus,\n onKeyDown,\n inputProps = {},\n ...others\n } = useDefaultProps(\"HvInput\", props);\n const { classes, cx } = useClasses(classesProp);\n const labels = useLabels(DEFAULT_LABELS, labelsProp);\n const elementId = useUniqueId(id);\n\n const inputRef = useRef<HTMLInputElement>(null);\n const forkedRef = useForkRef(ref, inputRef, inputRefProp);\n const suggestionsRef = useRef<HTMLDivElement>(null);\n\n const [focused, setFocused] = useState(false);\n\n // Signals that the user has manually edited the input value\n const isDirty = useRef(false);\n\n // Value related state\n const [value, setValue] = useControlled(valueProp, defaultValue);\n\n const isEmptyValue = value == null || value === \"\";\n\n // Validation related state\n const [validationState, setValidationState] = useControlled(\n status,\n validationStates.standBy,\n );\n\n const [validationMessage, setValidationMessage] = useControlled(\n statusMessage,\n \"\",\n );\n\n // validationMessages reference tends to change, as users will not memoize/useState for it;\n // dependencies must be more explicit so we set\n const errorMessages = useMemo(\n () => ({ ...DEFAULT_ERROR_MESSAGES, ...validationMessages }),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [\n validationMessages?.error,\n validationMessages?.requiredError,\n validationMessages?.minCharError,\n validationMessages?.maxCharError,\n validationMessages?.typeMismatchError,\n ],\n );\n\n const validationType = useMemo(() => computeValidationType(type), [type]);\n\n // Validates the input, sets the status and the statusMessage accordingly (if uncontrolled)\n // and returns the validity state of the input.\n const performValidation = useCallback(() => {\n const inputValidity = validateInput(\n inputRef.current,\n String(value),\n required,\n minCharQuantity,\n maxCharQuantity,\n validationType,\n validation,\n );\n\n // This will only run if status is uncontrolled\n setValidationState(computeValidationState(inputValidity, isEmptyValue));\n\n // This will only run if statusMessage is uncontrolled\n setValidationMessage(\n computeValidationMessage(inputValidity, errorMessages),\n );\n\n return inputValidity;\n }, [\n errorMessages,\n isEmptyValue,\n maxCharQuantity,\n minCharQuantity,\n required,\n setValidationMessage,\n setValidationState,\n validation,\n validationType,\n value,\n ]);\n\n // The error message area will only be created if:\n // - an external element that provides an error message isn't identified via aria-errormessage AND\n // - both status and statusMessage properties are being controlled OR\n // - status is uncontrolled and any of the built-in validations are active\n const canShowError =\n ariaErrorMessage == null &&\n ((status !== undefined && statusMessage !== undefined) ||\n (status === undefined &&\n hasBuiltInValidations(\n required,\n validationType,\n minCharQuantity,\n maxCharQuantity,\n validation,\n inputProps,\n )));\n\n const isStateInvalid = isInvalid(validationState);\n\n // Input type related state\n const [revealPassword, setRevealPassword] = useState(false);\n\n const realType = useMemo(() => {\n if (type === \"password\") {\n return revealPassword ? \"text\" : \"password\";\n }\n\n if (type === \"search\") {\n return \"search\";\n }\n\n return \"text\";\n }, [revealPassword, type]);\n\n // Suggestions related state\n const [suggestionValues, setSuggestionValues] = useState<\n HvSuggestion[] | null\n >(null);\n\n const canShowSuggestions = suggestionListCallback != null;\n const hasSuggestions = !!suggestionValues;\n\n // Miscellaneous state\n const hasLabel = label != null;\n const hasDescription = description != null;\n\n /**\n * Looks for the node that represent the input inside the material tree and focus it.\n */\n const focusInput = () => {\n inputRef.current?.focus();\n };\n\n const isMounted = useIsMounted();\n\n /**\n * Clears the suggestion array.\n */\n const suggestionClearHandler = () => {\n if (isMounted.current) {\n setSuggestionValues(null);\n }\n };\n\n /**\n * Fills of the suggestion array.\n */\n const suggestionHandler = (val: string) => {\n const suggestionsArray = suggestionListCallback?.(val);\n if (suggestionsArray?.[0]?.label) {\n setSuggestionValues(suggestionsArray);\n } else {\n suggestionClearHandler();\n }\n };\n\n /**\n * Executes the user callback adds the selection to the state and clears the suggestions.\n */\n const suggestionSelectedHandler: HvSuggestionsProps[\"onSuggestionSelected\"] =\n (event, item) => {\n const newValue = item.value || (item.label as any);\n\n changeInputValue(inputRef.current, newValue);\n\n focusInput();\n suggestionClearHandler();\n\n if (type === \"search\") {\n // trigger the onEnter callback when the user selects an option in a search box\n onEnter?.(event, newValue);\n }\n };\n\n const onChangeHandler: HvBaseInputProps[\"onChange\"] = (event, newValue) => {\n isDirty.current = true;\n\n // set the input value (only when value is uncontrolled)\n setValue(newValue);\n\n onChange?.(event as any, newValue);\n\n if (canShowSuggestions) {\n // an edge case might be a controlled input whose onChange callback\n // doesn't change the value (or sets another): the suggestionListCallback\n // callback will still receive the original rejected value.\n // a refactor is needed so the suggestionListCallback might be called only\n // when the input is uncontrolled, providing a way to externally control\n // the suggestion values.\n suggestionHandler(newValue);\n }\n };\n\n /**\n * Validates the input updating the state and modifying the info text, also executes\n * the user provided onBlur passing the current validation status and value.\n */\n const onInputBlurHandler: HvBaseInputProps[\"onBlur\"] = (event) => {\n // If the blur is executed when choosing an suggestion it should be ignored.\n if (eventTargetIsInsideContainer(suggestionsRef.current, event)) return;\n\n setFocused(false);\n\n const inputValidity = performValidation();\n\n onBlur?.(event as any, String(value), inputValidity);\n };\n\n /**\n * Updates the state putting again the value from the state because the input value is\n * not automatically manage, it also executes the onFocus function from the user passing the value\n */\n const onFocusHandler: HvBaseInputProps[\"onFocus\"] = (event) => {\n setFocused(true);\n\n // reset validation status to standBy (only when status is uncontrolled)\n setValidationState(validationStates.standBy);\n\n onFocus?.(event as any, String(value));\n };\n\n const getSuggestions = (li: number | null) => {\n // TODO Replace with ref\n const listEl = document.getElementById(\n setId(elementId, \"suggestions-list\") || \"\",\n );\n return li != null ? listEl?.getElementsByTagName(\"li\")?.[li] : listEl;\n };\n\n const onSuggestionKeyDown: HvSuggestionsProps[\"onKeyDown\"] = (event) => {\n if (isKey(event, \"Esc\")) {\n suggestionClearHandler();\n focusInput();\n } else if (isKey(event, \"Tab\")) {\n suggestionClearHandler();\n }\n };\n\n /** Focus the suggestion list when the arrow down is pressed. */\n const onKeyDownHandler: HvBaseInputProps[\"onKeyDown\"] = (event) => {\n if (isKey(event, \"ArrowDown\") && hasSuggestions) {\n const li = getSuggestions(0);\n li?.focus();\n } else if (isKey(event, \"Enter\")) {\n onEnter?.(event as any, String(value));\n }\n\n onKeyDown?.(event as any, String(value));\n };\n\n /** Clears the suggestion list on blur. */\n const onContainerBlurHandler: HvFormElementProps[\"onBlur\"] = (event) => {\n if (event.relatedTarget) {\n setTimeout(() => {\n const list = getSuggestions(null);\n if (!list?.contains(document.activeElement)) suggestionClearHandler();\n }, 10);\n }\n };\n\n const hasOnEnter = onEnter != null;\n\n // show the clear button only if the input is enabled, not read-only, disableClear is false and the input is not empty\n // also, don't show it when the input type is \"search\" and the input is active (standBy)\n const showClear =\n !disabled &&\n !readOnly &&\n !disableClear &&\n !isEmptyValue &&\n (!hasOnEnter ||\n type !== \"search\" ||\n disableSearchButton ||\n validationState !== validationStates.standBy);\n\n const showSearchIcon = type === \"search\" && !disableSearchButton;\n\n const showRevealPasswordButton =\n type === \"password\" && !disableRevealPassword;\n\n /**\n * Clears the input value from the state and refocus the input.\n */\n const handleClear = useCallback(\n (event: React.MouseEvent<HTMLButtonElement>) => {\n // reset validation status to standBy (only when status is uncontrolled)\n setValidationState(validationStates.standBy);\n\n changeInputValue(inputRef.current, \"\");\n\n // prevent triggering the suggestions when clicking on the clear button when suggestOnFocus is true\n if (canShowSuggestions && suggestOnFocus) event.stopPropagation();\n else {\n // we want to focus the input when clicked and not active\n setTimeout(focusInput);\n }\n },\n [canShowSuggestions, setValidationState, suggestOnFocus],\n );\n\n const clearButton = useMemo(() => {\n if (!showClear) {\n return null;\n }\n\n return (\n <HvAdornment\n // Don't control visibility when the search icon is enabled\n className={cx(classes.adornmentButton, {\n [classes.iconClear]: !showSearchIcon,\n })}\n onClick={handleClear}\n aria-label={labels?.clearButtonLabel}\n aria-controls={setId(elementId, \"input\")}\n icon={<CloseXS />}\n />\n );\n }, [\n showClear,\n classes.adornmentButton,\n classes.iconClear,\n showSearchIcon,\n handleClear,\n labels?.clearButtonLabel,\n elementId,\n cx,\n ]);\n\n /**\n * Calls the onEnter callback and refocus the input.\n */\n const handleSearch = useCallback<NonNullable<HvAdornmentProps[\"onClick\"]>>(\n (event) => {\n onEnter?.(event, String(value));\n },\n [onEnter, value],\n );\n\n const searchButton = useMemo(() => {\n // If the search icon is not actionable, only show it when the input is empty or active\n const reallyShowIt =\n showSearchIcon &&\n (isEmptyValue ||\n (hasOnEnter && validationState === validationStates.standBy));\n\n if (!reallyShowIt) {\n return null;\n }\n\n return (\n <HvAdornment\n className={classes.adornmentButton}\n onClick={hasOnEnter ? handleSearch : undefined}\n aria-label={labels?.searchButtonLabel}\n icon={<Search />}\n />\n );\n }, [\n showSearchIcon,\n isEmptyValue,\n hasOnEnter,\n validationState,\n classes.adornmentButton,\n handleSearch,\n labels?.searchButtonLabel,\n ]);\n\n /**\n * Changes input type and refocus the input.\n */\n const handleRevealPassword = useCallback(() => {\n setRevealPassword(!revealPassword);\n }, [revealPassword]);\n\n const revealPasswordButton = useMemo(() => {\n if (!showRevealPasswordButton) {\n return null;\n }\n\n return (\n <HvTooltip\n disableFocusListener\n disableTouchListener\n title={\n revealPassword\n ? labels?.revealPasswordButtonClickToHideTooltip\n : labels?.revealPasswordButtonClickToShowTooltip\n }\n >\n <HvAdornment\n className={classes.adornmentButton}\n onClick={handleRevealPassword}\n aria-label={labels?.revealPasswordButtonLabel}\n aria-controls={setId(elementId, \"input\")}\n icon={revealPassword ? <PreviewOff /> : <Preview />}\n />\n </HvTooltip>\n );\n }, [\n showRevealPasswordButton,\n revealPassword,\n labels?.revealPasswordButtonClickToHideTooltip,\n labels?.revealPasswordButtonClickToShowTooltip,\n labels?.revealPasswordButtonLabel,\n classes.adornmentButton,\n handleRevealPassword,\n elementId,\n ]);\n\n const validationIcon = useMemo(() => {\n if (!showValidationIcon) {\n return null;\n }\n\n if (!isValid(validationState)) {\n return null;\n }\n\n return <Success color=\"positive\" className={classes.icon} />;\n }, [showValidationIcon, validationState, classes.icon]);\n\n // useMemo to avoid repetitive cloning of the custom icon\n const customIconEl = useMemo(\n () =>\n isValidElement(endAdornment) &&\n cloneElement(endAdornment as React.ReactElement, {\n className: cx(endAdornment.props.className, classes.icon),\n }),\n [classes.icon, endAdornment, cx],\n );\n\n const adornments = useMemo(() => {\n if (\n !clearButton &&\n !revealPasswordButton &&\n !searchButton &&\n !validationIcon &&\n !customIconEl\n )\n return null;\n\n // note: specification implies that the custom icon should be hidden when\n // a validation feedback icon is being shown.\n return (\n <div className={classes.adornmentsBox} aria-hidden=\"true\">\n {clearButton}\n {revealPasswordButton}\n {searchButton}\n {validationIcon || customIconEl}\n </div>\n );\n }, [\n classes.adornmentsBox,\n clearButton,\n customIconEl,\n revealPasswordButton,\n searchButton,\n validationIcon,\n ]);\n\n // run initial validation after first render\n // and also when any validation condition changes\n useEffect(() => {\n if (focused || (!isDirty.current && isEmptyValue)) {\n // skip validation if currently focused or if empty and\n // the user never manually edited the input value\n return;\n }\n\n performValidation();\n }, [focused, isEmptyValue, performValidation]);\n\n const errorMessageId = isStateInvalid\n ? canShowError\n ? setId(elementId, \"error\")\n : ariaErrorMessage\n : undefined;\n\n return (\n <HvFormElement\n id={id}\n name={name}\n status={validationState}\n disabled={disabled}\n required={required}\n readOnly={readOnly}\n className={cx(\n classes.root,\n {\n [classes.hasSuggestions]: hasSuggestions,\n },\n className,\n )}\n onBlur={onContainerBlurHandler}\n >\n {(hasLabel || hasDescription) && (\n <div className={classes.labelContainer}>\n {hasLabel && (\n <HvLabel\n showGutter\n id={setId(elementId, \"label\")}\n className={classes.label}\n htmlFor={setId(elementId, \"input\")}\n label={label}\n />\n )}\n\n {hasDescription && (\n <HvInfoMessage\n id={setId(elementId, \"description\")}\n className={classes.description}\n >\n {description}\n </HvInfoMessage>\n )}\n </div>\n )}\n <HvBaseInput\n id={\n hasLabel || showClear || showRevealPasswordButton\n ? setId(elementId, \"input\")\n : setId(id, \"input\")\n }\n name={name}\n value={value}\n required={required}\n readOnly={readOnly}\n disabled={disabled}\n onChange={onChangeHandler}\n autoFocus={autoFocus}\n onKeyDown={onKeyDownHandler}\n onBlur={onInputBlurHandler}\n onFocus={onFocusHandler}\n placeholder={placeholder}\n type={realType}\n classes={{\n input: classes.input,\n root: classes.inputRoot,\n focused: classes.inputRootFocused,\n disabled: classes.inputRootDisabled,\n multiline: classes.inputRootMultiline,\n }}\n invalid={isStateInvalid}\n inputProps={{\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-invalid\": isStateInvalid ? true : undefined,\n \"aria-errormessage\": errorMessageId,\n \"aria-describedby\":\n ariaDescribedBy != null\n ? ariaDescribedBy\n : description\n ? setId(elementId, \"description\")\n : undefined,\n \"aria-controls\": canShowSuggestions\n ? setId(elementId, \"suggestions\")\n : undefined,\n\n ref: inputRef,\n\n // prevent browsers auto-fill/suggestions when we have our own\n autoComplete: canShowSuggestions ? \"off\" : undefined,\n\n onFocus: (event) => {\n inputProps.onFocus?.(event);\n\n // trigger suggestions when focusing the input\n if (canShowSuggestions && suggestOnFocus) {\n suggestionHandler(String(value));\n }\n },\n\n onClick: (event) => {\n inputProps.onClick?.(event);\n\n // prevent closing the suggestions when clicking on the input when suggestOnFocus is true\n if (canShowSuggestions && suggestOnFocus) event.stopPropagation();\n },\n\n ...inputProps,\n }}\n inputRef={forkedRef}\n endAdornment={adornments}\n {...others}\n />\n {canShowSuggestions && (\n <>\n {hasSuggestions && (\n <div role=\"presentation\" className={classes.inputExtension} />\n )}\n <HvSuggestions\n id={setId(elementId, \"suggestions\")}\n classes={{\n root: classes.suggestionsContainer,\n list: classes.suggestionList,\n }}\n expanded={hasSuggestions}\n anchorEl={inputRef.current?.parentElement}\n onClose={suggestionClearHandler}\n onKeyDown={onSuggestionKeyDown}\n onSuggestionSelected={suggestionSelectedHandler}\n suggestionValues={suggestionValues}\n enablePortal={enablePortal}\n popperProps={{ ref: suggestionsRef }}\n />\n </>\n )}\n {canShowError && (\n <HvWarningText\n id={setId(elementId, \"error\")}\n disableBorder\n className={classes.error}\n >\n {validationMessage}\n </HvWarningText>\n )}\n </HvFormElement>\n );\n});\n"],"names":["HvInput"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA+MA,MAAM,iBAAiB;AAAA;AAAA,EAErB,kBAAkB;AAAA;AAAA,EAElB,2BAA2B;AAAA;AAAA,EAE3B,wCAAwC;AAAA;AAAA,EAExC,wCAAwC;AAAA;AAAA,EAExC,mBAAmB;AACrB;AAIA,SAAS,6BACP,WACA,OACA;AACA,SAAO,CAAC,CAAC,WAAW,SAAS,MAAM,aAAa;AAClD;AAGA,MAAM,mBAAm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IAAI,MAAM,WAAW,aAAa;AAAA,cAClC,SAAS;AAAA,gBACP,MAAM,QAAQ;AAAA,gBACd,MAAM,QAAQ;AAAA,cAChB;AAAA,cACA,UAAU;AAAA,cACV,UAAU,SAAS,SAAS;AAAA,cAC5B,SAAS;AAAA,cACT,WAAW;AAAA,cACX,sBAAsB;AAAA,cACtB;AAAA,cACA;AAAA,cACA,aAAa,EAAE,KAAK,eAAe;AAAA,YAAA;AAAA,UAAA;AAAA,QACrC,GACF;AAAA,QAED,gBACC;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,IAAI,MAAM,WAAW,OAAO;AAAA,YAC5B,eAAa;AAAA,YACb,WAAW,QAAQ;AAAA,YAElB,UAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAAA;AAAA,EAEJ;AAEJ,CAAC;"}
1
+ {"version":3,"file":"Input.js","sources":["../../../src/Input/Input.tsx"],"sourcesContent":["import {\n cloneElement,\n isValidElement,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { useForkRef } from \"@mui/material/utils\";\nimport {\n CloseXS,\n Preview,\n PreviewOff,\n Search,\n Success,\n} from \"@hitachivantara/uikit-react-icons\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvBaseInput, HvBaseInputProps } from \"../BaseInput\";\nimport {\n computeValidationMessage,\n computeValidationState,\n computeValidationType,\n DEFAULT_ERROR_MESSAGES,\n hasBuiltInValidations,\n HvInputValidity,\n validateInput,\n} from \"../BaseInput/validations\";\nimport type { HvButtonBaseProps } from \"../ButtonBase\";\nimport {\n HvAdornment,\n HvFormElement,\n HvFormElementProps,\n HvFormStatus,\n HvInfoMessage,\n HvLabel,\n HvWarningText,\n isInvalid,\n isValid,\n validationStates,\n} from \"../FormElement\";\nimport {\n HvSuggestion,\n HvSuggestions,\n HvSuggestionsProps,\n} from \"../FormElement/Suggestions/Suggestions\";\nimport { useControlled } from \"../hooks/useControlled\";\nimport { useIsMounted } from \"../hooks/useIsMounted\";\nimport { useLabels } from \"../hooks/useLabels\";\nimport { useUniqueId } from \"../hooks/useUniqueId\";\nimport { HvTooltip } from \"../Tooltip\";\nimport { fixedForwardRef } from \"../types/generic\";\nimport { isKey } from \"../utils/keyboardUtils\";\nimport { setId } from \"../utils/setId\";\nimport { staticClasses, useClasses } from \"./Input.styles\";\n\nexport { staticClasses as inputClasses };\n\nexport type HvInputClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvValidationMessages {\n /** The value when a validation fails. */\n error?: string;\n /** The message that appears when there are too many characters. */\n maxCharError?: string;\n /** The message that appears when there are too few characters. */\n minCharError?: string;\n /** The message that appears when the input is empty and required. */\n requiredError?: string;\n /** The message that appears when the input is value is incompatible with the expected type. */\n typeMismatchError?: string;\n}\n\nexport interface HvInputSuggestion {\n id: string;\n label: string;\n value?: string;\n}\n\nexport interface HvInputProps<\n InputElement extends HTMLElement = HTMLInputElement | HTMLTextAreaElement,\n> extends Omit<\n HvBaseInputProps,\n \"onChange\" | \"onBlur\" | \"onFocus\" | \"onKeyDown\"\n > {\n /** @inheritdoc */\n name?: string;\n /** @inheritdoc */\n value?: React.InputHTMLAttributes<InputElement>[\"value\"];\n /** @inheritdoc */\n defaultValue?: React.InputHTMLAttributes<InputElement>[\"value\"];\n /**\n * The label of the form element.\n *\n * The form element must be labeled for accessibility reasons.\n * If not provided, an aria-label or aria-labelledby must be inputted via inputProps.\n */\n label?: React.ReactNode;\n /** Provide additional descriptive text for the form element. */\n description?: React.ReactNode;\n /** @inheritdoc */\n disabled?: boolean;\n /** @inheritdoc */\n readOnly?: boolean;\n /** @inheritdoc */\n required?: boolean;\n /**\n * The status of the form element.\n *\n * Valid is correct, invalid is incorrect and standBy means no validations have run.\n *\n * When uncontrolled and unspecified it will default to \"standBy\" and change to either \"valid\"\n * or \"invalid\" after any change to `checked`, depending of the values of both `required` and `checked`.\n */\n status?: HvFormStatus;\n /** The error message to show when `status` is \"invalid\". */\n statusMessage?: string;\n /** @inheritdoc */\n onChange?: (event: React.ChangeEvent<InputElement>, value: string) => void;\n /**\n * Callback called when the user submits the value by pressing Enter/Return.\n *\n * Also called when the search button is clicked (when `type=\"search\"`).\n */\n onEnter?: (event: React.KeyboardEvent<InputElement>, value: string) => void;\n /**\n * The function that will be executed onBlur, allows checking the validation state,\n * it receives the value and the validation state.\n */\n onBlur?: (\n event: React.FocusEvent<InputElement>,\n value: string,\n validationState: HvInputValidity,\n ) => void;\n /**\n * The function that will be executed onBlur, allows checking the value state,\n * it receives the value.\n */\n onFocus?: (event: React.FocusEvent<InputElement>, value: string) => void;\n /**\n * The function that will be executed onKeyDown, allows checking the value state,\n * it receives the event and value.\n */\n onKeyDown?: (event: React.KeyboardEvent<InputElement>, value: string) => void;\n /** The input type. */\n type?: React.HTMLInputTypeAttribute;\n /** The placeholder value of the input. */\n placeholder?: string;\n /** Internal labels?. */\n labels?: HvInputLabels & Record<string, any>;\n /** An Object containing the various texts associated with the input. */\n validationMessages?: HvValidationMessages;\n /** The function that will be executed to received an array of objects that has a label and id to create list of suggestion */\n suggestionListCallback?: (value: string) => HvInputSuggestion[] | null;\n /**\n * If enabled, the suggestions list will be rendered using a portal.\n * If disabled, it will be under the DOM hierarchy of the parent component.\n * @default false\n * */\n enablePortal?: boolean;\n /**\n * Whether the suggestions should be triggered once the input is focused and not only when typing.\n * @default false\n * */\n suggestOnFocus?: boolean;\n /**\n * The custom validation function, it receives the value and must return\n * either `true` for valid or `false` for invalid, default validations would only\n * occur if this function is null or undefined\n */\n validation?: (value: string) => boolean;\n /** If `true` it should autofocus. */\n autoFocus?: boolean;\n /** If `true` the clear button is disabled. */\n disableClear?: boolean; // TODO - rename in v6 since it doesn't disable but hides the button\n /** If `true` the reveal password button is disabled. Valid only when type is \"password\". */\n disableRevealPassword?: boolean; // TODO - rename in v6 since it doesn't disable but hides the button\n /** If `true` the search button is disabled. Valid only when type is \"search\". */\n disableSearchButton?: boolean; // TODO - rename in v6 since it doesn't disable but hides the button\n /**\n * If `true` the validation icon adornment is visible. Defaults to `false`.\n *\n * Currently, DS specifications define only a positive feedback icon;\n * errors are signaled through the border style and by displaying the error message.\n */\n showValidationIcon?: boolean;\n /** A custom icon to be added into the input. */\n endAdornment?: React.ReactNode;\n /** The maximum allowed length of the characters, if this value is null no check will be performed. */\n maxCharQuantity?: number;\n /** The minimum allowed length of the characters, if this value is null no check will be perform. */\n minCharQuantity?: number;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvInputClasses;\n}\n\nconst DEFAULT_LABELS = {\n /** The label of the clear button. */\n clearButtonLabel: \"Clear the text\",\n /** The label of the reveal password button. */\n revealPasswordButtonLabel: \"Reveal password\",\n /** The tooltip of the reveal password button when the password is hidden. */\n revealPasswordButtonClickToShowTooltip: \"Click to show password.\",\n /** The tooltip of the reveal password button when the password is revealed. */\n revealPasswordButtonClickToHideTooltip: \"Click to hide password.\",\n /** The label of the search button. */\n searchButtonLabel: \"Search\",\n};\n\nexport type HvInputLabels = Partial<typeof DEFAULT_LABELS>;\n\nfunction eventTargetIsInsideContainer(\n container: HTMLElement | null,\n event: React.FocusEvent<any>,\n) {\n return !!container?.contains(event.relatedTarget);\n}\n\n/** Changes a given `input`'s `value`, triggering its `onChange` */\nconst changeInputValue = (input: HTMLInputElement | null, value = \"\") => {\n const event = new Event(\"input\", { bubbles: true });\n\n /** Original `input.value` setter (React overrides it). */\n const setInputValue = Object.getOwnPropertyDescriptor(\n window.HTMLInputElement.prototype,\n \"value\",\n )?.set;\n\n setInputValue?.call(input, value);\n input?.dispatchEvent(event);\n};\n\n/**\n * A text input box is a graphical control element intended to enable the user to input text information to be used by the software.\n */\nexport const HvInput = fixedForwardRef(function HvInput<\n InputElement extends HTMLElement = HTMLInputElement | HTMLTextAreaElement,\n>(props: HvInputProps<InputElement>, ref: React.Ref<InputElement>) {\n const {\n classes: classesProp,\n className,\n id,\n name,\n value: valueProp,\n defaultValue,\n required,\n readOnly,\n disabled,\n enablePortal = false,\n suggestOnFocus = false,\n label,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n description,\n \"aria-describedby\": ariaDescribedBy,\n onChange,\n onEnter,\n status,\n statusMessage,\n \"aria-errormessage\": ariaErrorMessage,\n type = \"text\",\n placeholder,\n autoFocus = false,\n labels: labelsProp,\n validationMessages,\n disableClear = false,\n disableRevealPassword = false,\n disableSearchButton = false,\n endAdornment,\n maxCharQuantity,\n minCharQuantity,\n validation,\n showValidationIcon = false,\n suggestionListCallback,\n inputRef: inputRefProp,\n onBlur,\n onFocus,\n onKeyDown,\n inputProps = {},\n ...others\n } = useDefaultProps(\"HvInput\", props);\n const { classes, cx } = useClasses(classesProp);\n const labels = useLabels(DEFAULT_LABELS, labelsProp);\n const elementId = useUniqueId(id);\n\n const inputRef = useRef<HTMLInputElement>(null);\n const forkedRef = useForkRef(ref, inputRef, inputRefProp);\n const suggestionsRef = useRef<HTMLDivElement>(null);\n\n const [focused, setFocused] = useState(false);\n\n // Signals that the user has manually edited the input value\n const isDirty = useRef(false);\n\n const isEmptyValue = !inputRef.current?.value;\n\n // Validation related state\n const [validationState, setValidationState] = useControlled(\n status,\n validationStates.standBy,\n );\n\n const [validationMessage, setValidationMessage] = useControlled(\n statusMessage,\n \"\",\n );\n\n // validationMessages reference tends to change, as users will not memoize/useState for it;\n // dependencies must be more explicit so we set\n const errorMessages = useMemo(\n () => ({ ...DEFAULT_ERROR_MESSAGES, ...validationMessages }),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [\n validationMessages?.error,\n validationMessages?.requiredError,\n validationMessages?.minCharError,\n validationMessages?.maxCharError,\n validationMessages?.typeMismatchError,\n ],\n );\n\n const validationType = useMemo(() => computeValidationType(type), [type]);\n\n // Validates the input, sets the status and the statusMessage accordingly (if uncontrolled)\n // and returns the validity state of the input.\n const performValidation = useCallback(() => {\n const inputValidity = validateInput(\n inputRef.current,\n required,\n minCharQuantity,\n maxCharQuantity,\n validationType,\n validation,\n );\n\n // This will only run if status is uncontrolled\n setValidationState(computeValidationState(inputValidity, isEmptyValue));\n\n // This will only run if statusMessage is uncontrolled\n setValidationMessage(\n computeValidationMessage(inputValidity, errorMessages),\n );\n\n return inputValidity;\n }, [\n errorMessages,\n isEmptyValue,\n maxCharQuantity,\n minCharQuantity,\n required,\n setValidationMessage,\n setValidationState,\n validation,\n validationType,\n ]);\n\n // The error message area will only be created if:\n // - an external element that provides an error message isn't identified via aria-errormessage AND\n // - both status and statusMessage properties are being controlled OR\n // - status is uncontrolled and any of the built-in validations are active\n const canShowError =\n ariaErrorMessage == null &&\n ((status !== undefined && statusMessage !== undefined) ||\n (status === undefined &&\n hasBuiltInValidations(\n required,\n validationType,\n minCharQuantity,\n maxCharQuantity,\n validation,\n inputProps,\n )));\n\n const isStateInvalid = isInvalid(validationState);\n\n // Input type related state\n const [revealPassword, setRevealPassword] = useState(false);\n\n const realType = useMemo(() => {\n if (type === \"password\") {\n return revealPassword ? \"text\" : \"password\";\n }\n\n if (type === \"search\") {\n return \"search\";\n }\n\n return \"text\";\n }, [revealPassword, type]);\n\n // Suggestions related state\n const [suggestionValues, setSuggestionValues] = useState<\n HvSuggestion[] | null\n >(null);\n\n const canShowSuggestions = suggestionListCallback != null;\n const hasSuggestions = !!suggestionValues;\n\n // Miscellaneous state\n const hasLabel = label != null;\n const hasDescription = description != null;\n\n /**\n * Looks for the node that represent the input inside the material tree and focus it.\n */\n const focusInput = () => {\n inputRef.current?.focus();\n };\n\n const isMounted = useIsMounted();\n\n /**\n * Clears the suggestion array.\n */\n const suggestionClearHandler = () => {\n if (isMounted.current) {\n setSuggestionValues(null);\n }\n };\n\n /**\n * Fills of the suggestion array.\n */\n const suggestionHandler = (val: string) => {\n const suggestionsArray = suggestionListCallback?.(val);\n if (suggestionsArray?.[0]?.label) {\n setSuggestionValues(suggestionsArray);\n } else {\n suggestionClearHandler();\n }\n };\n\n /**\n * Executes the user callback adds the selection to the state and clears the suggestions.\n */\n const suggestionSelectedHandler: HvSuggestionsProps[\"onSuggestionSelected\"] =\n (event, item) => {\n const newValue = item.value || (item.label as any);\n\n changeInputValue(inputRef.current, newValue);\n\n focusInput();\n suggestionClearHandler();\n\n if (type === \"search\") {\n // trigger the onEnter callback when the user selects an option in a search box\n onEnter?.(event as any, newValue);\n }\n };\n\n const onChangeHandler: HvBaseInputProps[\"onChange\"] = (event, newValue) => {\n isDirty.current = true;\n\n onChange?.(event as any, newValue);\n\n if (canShowSuggestions) {\n // an edge case might be a controlled input whose onChange callback\n // doesn't change the value (or sets another): the suggestionListCallback\n // callback will still receive the original rejected value.\n // a refactor is needed so the suggestionListCallback might be called only\n // when the input is uncontrolled, providing a way to externally control\n // the suggestion values.\n suggestionHandler(newValue);\n }\n };\n\n /**\n * Validates the input updating the state and modifying the info text, also executes\n * the user provided onBlur passing the current validation status and value.\n */\n const onInputBlurHandler: HvBaseInputProps[\"onBlur\"] = (event) => {\n // If the blur is executed when choosing an suggestion it should be ignored.\n if (eventTargetIsInsideContainer(suggestionsRef.current, event)) return;\n\n setFocused(false);\n\n const inputValidity = performValidation();\n\n onBlur?.(event as any, event.target.value, inputValidity);\n };\n\n /**\n * Updates the state putting again the value from the state because the input value is\n * not automatically manage, it also executes the onFocus function from the user passing the value\n */\n const onFocusHandler: HvBaseInputProps[\"onFocus\"] = (event) => {\n setFocused(true);\n\n // reset validation status to standBy (only when status is uncontrolled)\n setValidationState(validationStates.standBy);\n\n onFocus?.(event as any, event.target.value);\n };\n\n const getSuggestions = (li: number | null) => {\n // TODO Replace with ref\n const listEl = document.getElementById(\n setId(elementId, \"suggestions-list\") || \"\",\n );\n return li != null ? listEl?.getElementsByTagName(\"li\")?.[li] : listEl;\n };\n\n const onSuggestionKeyDown: HvSuggestionsProps[\"onKeyDown\"] = (event) => {\n if (isKey(event, \"Esc\")) {\n suggestionClearHandler();\n focusInput();\n } else if (isKey(event, \"Tab\")) {\n suggestionClearHandler();\n }\n };\n\n /** Focus the suggestion list when the arrow down is pressed. */\n const onKeyDownHandler: HvBaseInputProps[\"onKeyDown\"] = (event) => {\n const { value } = event.currentTarget;\n\n if (isKey(event, \"ArrowDown\") && hasSuggestions) {\n const li = getSuggestions(0);\n li?.focus();\n } else if (isKey(event, \"Enter\")) {\n onEnter?.(event as any, value);\n }\n\n onKeyDown?.(event as any, value);\n };\n\n /** Clears the suggestion list on blur. */\n const onContainerBlurHandler: HvFormElementProps[\"onBlur\"] = (event) => {\n if (event.relatedTarget) {\n setTimeout(() => {\n const list = getSuggestions(null);\n if (!list?.contains(document.activeElement)) suggestionClearHandler();\n }, 10);\n }\n };\n\n // show the clear button only if the input is enabled, not read-only, disableClear is false and the input is not empty\n // also, don't show it when the input type is \"search\" and the input is active (standBy)\n const showClear =\n !disabled &&\n !readOnly &&\n !disableClear &&\n !isEmptyValue &&\n (!onEnter ||\n type !== \"search\" ||\n disableSearchButton ||\n validationState !== validationStates.standBy);\n\n const showSearchIcon = type === \"search\" && !disableSearchButton;\n\n const showRevealPasswordButton =\n type === \"password\" && !disableRevealPassword;\n\n /**\n * Clears the input value from the state and refocus the input.\n */\n const handleClear = useCallback(\n (event: React.MouseEvent<HTMLButtonElement>) => {\n // reset validation status to standBy (only when status is uncontrolled)\n setValidationState(validationStates.standBy);\n\n changeInputValue(inputRef.current, \"\");\n\n // prevent triggering the suggestions when clicking on the clear button when suggestOnFocus is true\n if (canShowSuggestions && suggestOnFocus) event.stopPropagation();\n else {\n // we want to focus the input when clicked and not active\n setTimeout(focusInput);\n }\n },\n [canShowSuggestions, setValidationState, suggestOnFocus],\n );\n\n const clearButton = useMemo(() => {\n if (!showClear) {\n return null;\n }\n\n return (\n <HvAdornment\n // Don't control visibility when the search icon is enabled\n className={cx(classes.adornmentButton, {\n [classes.iconClear]: !showSearchIcon,\n })}\n onClick={handleClear}\n aria-label={labels?.clearButtonLabel}\n aria-controls={setId(elementId, \"input\")}\n icon={<CloseXS />}\n />\n );\n }, [\n showClear,\n classes.adornmentButton,\n classes.iconClear,\n showSearchIcon,\n handleClear,\n labels?.clearButtonLabel,\n elementId,\n cx,\n ]);\n\n const searchButton = useMemo(() => {\n // If the search icon is not actionable, only show it when the input is empty or active\n const reallyShowIt =\n showSearchIcon &&\n (isEmptyValue ||\n (onEnter && validationState === validationStates.standBy));\n\n if (!reallyShowIt) return null;\n\n return (\n <HvAdornment\n className={classes.adornmentButton}\n onClick={\n onEnter &&\n ((evt) => onEnter?.(evt as any, inputRef.current?.value ?? \"\"))\n }\n icon={<Search title={labels.searchButtonLabel} />}\n />\n );\n }, [\n showSearchIcon,\n isEmptyValue,\n onEnter,\n validationState,\n classes.adornmentButton,\n labels.searchButtonLabel,\n ]);\n\n const revealPasswordButton = useMemo(() => {\n if (!showRevealPasswordButton) return null;\n\n return (\n <HvTooltip\n disableFocusListener\n disableTouchListener\n title={\n revealPassword\n ? labels?.revealPasswordButtonClickToHideTooltip\n : labels?.revealPasswordButtonClickToShowTooltip\n }\n >\n <HvAdornment\n className={classes.adornmentButton}\n onClick={() => setRevealPassword((s) => !s)}\n aria-label={labels?.revealPasswordButtonLabel}\n aria-controls={setId(elementId, \"input\")}\n icon={revealPassword ? <PreviewOff /> : <Preview />}\n tabIndex={0}\n {...({ selected: revealPassword } satisfies HvButtonBaseProps)}\n />\n </HvTooltip>\n );\n }, [\n showRevealPasswordButton,\n revealPassword,\n labels?.revealPasswordButtonClickToHideTooltip,\n labels?.revealPasswordButtonClickToShowTooltip,\n labels?.revealPasswordButtonLabel,\n classes.adornmentButton,\n elementId,\n ]);\n\n const validationIcon = useMemo(() => {\n if (!showValidationIcon) return null;\n if (!isValid(validationState)) return null;\n\n return <Success color=\"positive\" className={classes.icon} />;\n }, [showValidationIcon, validationState, classes.icon]);\n\n // useMemo to avoid repetitive cloning of the custom icon\n const customIconEl = useMemo(\n () =>\n isValidElement(endAdornment)\n ? cloneElement(endAdornment as React.ReactElement, {\n className: cx(endAdornment.props.className, classes.icon),\n })\n : endAdornment,\n [classes.icon, endAdornment, cx],\n );\n\n const adornments = useMemo(() => {\n if (\n !clearButton &&\n !revealPasswordButton &&\n !searchButton &&\n !validationIcon &&\n !customIconEl\n )\n return null;\n\n return (\n <div className={classes.adornmentsBox}>\n {clearButton}\n {revealPasswordButton}\n {searchButton}\n {validationIcon || customIconEl}\n </div>\n );\n }, [\n classes.adornmentsBox,\n clearButton,\n customIconEl,\n revealPasswordButton,\n searchButton,\n validationIcon,\n ]);\n\n // run initial validation after first render\n // and also when any validation condition changes\n useEffect(() => {\n if (focused || (!isDirty.current && isEmptyValue)) {\n // skip validation if currently focused or if empty and\n // the user never manually edited the input value\n return;\n }\n\n performValidation();\n }, [focused, isEmptyValue, performValidation]);\n\n const errorMessageId = isStateInvalid\n ? canShowError\n ? setId(elementId, \"error\")\n : ariaErrorMessage\n : undefined;\n\n return (\n <HvFormElement\n id={id}\n name={name}\n status={validationState}\n disabled={disabled}\n required={required}\n readOnly={readOnly}\n className={cx(\n classes.root,\n {\n [classes.hasSuggestions]: hasSuggestions,\n },\n className,\n )}\n onBlur={onContainerBlurHandler}\n >\n {(hasLabel || hasDescription) && (\n <div className={classes.labelContainer}>\n {hasLabel && (\n <HvLabel\n showGutter\n id={setId(elementId, \"label\")}\n className={classes.label}\n htmlFor={setId(elementId, \"input\")}\n label={label}\n />\n )}\n\n {hasDescription && (\n <HvInfoMessage\n id={setId(elementId, \"description\")}\n className={classes.description}\n >\n {description}\n </HvInfoMessage>\n )}\n </div>\n )}\n <HvBaseInput\n id={\n hasLabel || showClear || showRevealPasswordButton\n ? setId(elementId, \"input\")\n : setId(id, \"input\")\n }\n name={name}\n value={valueProp}\n defaultValue={defaultValue}\n required={required}\n readOnly={readOnly}\n disabled={disabled}\n onChange={onChangeHandler}\n autoFocus={autoFocus}\n onKeyDown={onKeyDownHandler}\n onBlur={onInputBlurHandler}\n onFocus={onFocusHandler}\n placeholder={placeholder}\n type={realType}\n classes={{\n input: classes.input,\n root: classes.inputRoot,\n focused: classes.inputRootFocused,\n disabled: classes.inputRootDisabled,\n multiline: classes.inputRootMultiline,\n }}\n invalid={isStateInvalid}\n inputProps={{\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-invalid\": isStateInvalid ? true : undefined,\n \"aria-errormessage\": errorMessageId,\n \"aria-describedby\":\n ariaDescribedBy != null\n ? ariaDescribedBy\n : description\n ? setId(elementId, \"description\")\n : undefined,\n \"aria-controls\": canShowSuggestions\n ? setId(elementId, \"suggestions\")\n : undefined,\n\n // prevent browsers auto-fill/suggestions when we have our own\n autoComplete: canShowSuggestions ? \"off\" : undefined,\n\n onFocus: (event) => {\n inputProps.onFocus?.(event);\n\n // trigger suggestions when focusing the input\n if (canShowSuggestions && suggestOnFocus) {\n suggestionHandler(event.currentTarget.value);\n }\n },\n\n onClick: (event) => {\n inputProps.onClick?.(event);\n\n // prevent closing the suggestions when clicking on the input when suggestOnFocus is true\n if (canShowSuggestions && suggestOnFocus) event.stopPropagation();\n },\n\n ...inputProps,\n }}\n ref={forkedRef}\n endAdornment={adornments}\n {...others}\n />\n {canShowSuggestions && (\n <>\n {hasSuggestions && (\n <div role=\"presentation\" className={classes.inputExtension} />\n )}\n <HvSuggestions\n id={setId(elementId, \"suggestions\")}\n classes={{\n root: classes.suggestionsContainer,\n list: classes.suggestionList,\n }}\n expanded={hasSuggestions}\n anchorEl={inputRef.current?.parentElement}\n onClose={suggestionClearHandler}\n onKeyDown={onSuggestionKeyDown}\n onSuggestionSelected={suggestionSelectedHandler}\n suggestionValues={suggestionValues}\n enablePortal={enablePortal}\n popperProps={{ ref: suggestionsRef }}\n />\n </>\n )}\n {canShowError && (\n <HvWarningText\n id={setId(elementId, \"error\")}\n disableBorder\n className={classes.error}\n >\n {validationMessage}\n </HvWarningText>\n )}\n </HvFormElement>\n );\n});\n"],"names":["HvInput"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAwMA,MAAM,iBAAiB;AAAA;AAAA,EAErB,kBAAkB;AAAA;AAAA,EAElB,2BAA2B;AAAA;A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AAS;AAAA,cAC5B,SAAS;AAAA,cACT,WAAW;AAAA,cACX,sBAAsB;AAAA,cACtB;AAAA,cACA;AAAA,cACA,aAAa,EAAE,KAAK,eAAe;AAAA,YAAA;AAAA,UAAA;AAAA,QACrC,GACF;AAAA,QAED,gBACC;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,IAAI,MAAM,WAAW,OAAO;AAAA,YAC5B,eAAa;AAAA,YACb,WAAW,QAAQ;AAAA,YAElB,UAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAAA;AAAA,EAEJ;AAEJ,CAAC;"}
@@ -11,6 +11,7 @@ const { staticClasses, useClasses } = createClasses("HvInput", {
11
11
  display: "flex",
12
12
  flexDirection: "row",
13
13
  height: "30px",
14
+ alignItems: "center",
14
15
  justifyContent: "center",
15
16
  marginRight: 1
16
17
  },
@@ -1 +1 @@
1
- {"version":3,"file":"Input.styles.js","sources":["../../../src/Input/Input.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { suggestionsClasses } from \"../FormElement/Suggestions\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvInput\", {\n root: { display: \"block\" },\n labelContainer: { display: \"flex\", alignItems: \"flex-start\" },\n label: {},\n description: {},\n adornmentsBox: {\n display: \"flex\",\n flexDirection: \"row\",\n height: \"30px\",\n justifyContent: \"center\",\n marginRight: 1,\n },\n icon: { width: \"30px\", height: \"30px\" },\n adornmentButton: {\n \":focus-visible,:hover\": {\n backgroundColor: \"transparent\",\n },\n },\n iconClear: { display: \"none\" },\n hasSuggestions: {},\n suggestionsContainer: { width: \"100%\", position: \"relative\" },\n suggestionList: {\n [`& .${suggestionsClasses.root} .${suggestionsClasses.list} &`]: {\n width: \"100%\",\n },\n },\n inputExtension: {\n height: theme.space.xs,\n backgroundColor: theme.colors.atmo1,\n boxShadow: `0px 8px 0px ${theme.colors.atmo1}, 0px 0px 9px 0px rgba(65,65,65,.12)`,\n },\n input: {},\n inputRoot: {\n \":is(:hover,:focus-within) $iconClear\": {\n display: \"block\",\n },\n },\n inputRootFocused: {\n \"& $iconClear\": {\n display: \"block\",\n },\n },\n inputRootDisabled: {},\n inputRootMultiline: { padding: 0 },\n /** @deprecated unused. use `::after` instead */\n inputBorderContainer: {},\n error: {},\n});\n"],"names":["suggestionsClasses"],"mappings":";;;;AAKO,MAAM,EAAE,eAAe,eAAe,cAAc,WAAW;AAAA,EACpE,MAAM,EAAE,SAAS,QAAQ;AAAA,EACzB,gBAAgB,EAAE,SAAS,QAAQ,YAAY,aAAa;AAAA,EAC5D,OAAO,CAAC;AAAA,EACR,aAAa,CAAC;AAAA,EACd,eAAe;AAAA,IACb,SAAS;AAAA,IACT,eAAe;AAAA,IACf,QAAQ;AAAA,IACR,gBAAgB;AAAA,IAChB,aAAa;AAAA,EACf;AAAA,EACA,MAAM,EAAE,OAAO,QAAQ,QAAQ,OAAO;AAAA,EACtC,iBAAiB;AAAA,IACf,yBAAyB;AAAA,MACvB,iBAAiB;AAAA,IAAA;AAAA,EAErB;AAAA,EACA,WAAW,EAAE,SAAS,OAAO;AAAA,EAC7B,gBAAgB,CAAC;AAAA,EACjB,sBAAsB,EAAE,OAAO,QAAQ,UAAU,WAAW;AAAA,EAC5D,gBAAgB;AAAA,IACd,CAAC,MAAMA,gBAAmB,IAAI,KAAKA,gBAAmB,IAAI,IAAI,GAAG;AAAA,MAC/D,OAAO;AAAA,IAAA;AAAA,EAEX;AAAA,EACA,gBAAgB;AAAA,IACd,QAAQ,MAAM,MAAM;AAAA,IACpB,iBAAiB,MAAM,OAAO;AAAA,IAC9B,WAAW,eAAe,MAAM,OAAO,KAAK;AAAA,EAC9C;AAAA,EACA,OAAO,CAAC;AAAA,EACR,WAAW;AAAA,IACT,wCAAwC;AAAA,MACtC,SAAS;AAAA,IAAA;AAAA,EAEb;AAAA,EACA,kBAAkB;AAAA,IAChB,gBAAgB;AAAA,MACd,SAAS;AAAA,IAAA;AAAA,EAEb;AAAA,EACA,mBAAmB,CAAC;AAAA,EACpB,oBAAoB,EAAE,SAAS,EAAE;AAAA;AAAA,EAEjC,sBAAsB,CAAC;AAAA,EACvB,OAAO,CAAA;AACT,CAAC;"}
1
+ {"version":3,"file":"Input.styles.js","sources":["../../../src/Input/Input.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { suggestionsClasses } from \"../FormElement/Suggestions\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvInput\", {\n root: { display: \"block\" },\n labelContainer: { display: \"flex\", alignItems: \"flex-start\" },\n label: {},\n description: {},\n adornmentsBox: {\n display: \"flex\",\n flexDirection: \"row\",\n height: \"30px\",\n alignItems: \"center\",\n justifyContent: \"center\",\n marginRight: 1,\n },\n icon: { width: \"30px\", height: \"30px\" },\n adornmentButton: {\n \":focus-visible,:hover\": {\n backgroundColor: \"transparent\",\n },\n },\n iconClear: { display: \"none\" },\n hasSuggestions: {},\n suggestionsContainer: { width: \"100%\", position: \"relative\" },\n suggestionList: {\n [`& .${suggestionsClasses.root} .${suggestionsClasses.list} &`]: {\n width: \"100%\",\n },\n },\n inputExtension: {\n height: theme.space.xs,\n backgroundColor: theme.colors.atmo1,\n boxShadow: `0px 8px 0px ${theme.colors.atmo1}, 0px 0px 9px 0px rgba(65,65,65,.12)`,\n },\n input: {},\n inputRoot: {\n \":is(:hover,:focus-within) $iconClear\": {\n display: \"block\",\n },\n },\n inputRootFocused: {\n \"& $iconClear\": {\n display: \"block\",\n },\n },\n inputRootDisabled: {},\n inputRootMultiline: { padding: 0 },\n /** @deprecated unused. use `::after` instead */\n inputBorderContainer: {},\n error: {},\n});\n"],"names":["suggestionsClasses"],"mappings":";;;;AAKO,MAAM,EAAE,eAAe,eAAe,cAAc,WAAW;AAAA,EACpE,MAAM,EAAE,SAAS,QAAQ;AAAA,EACzB,gBAAgB,EAAE,SAAS,QAAQ,YAAY,aAAa;AAAA,EAC5D,OAAO,CAAC;AAAA,EACR,aAAa,CAAC;AAAA,EACd,eAAe;AAAA,IACb,SAAS;AAAA,IACT,eAAe;AAAA,IACf,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,aAAa;AAAA,EACf;AAAA,EACA,MAAM,EAAE,OAAO,QAAQ,QAAQ,OAAO;AAAA,EACtC,iBAAiB;AAAA,IACf,yBAAyB;AAAA,MACvB,iBAAiB;AAAA,IAAA;AAAA,EAErB;AAAA,EACA,WAAW,EAAE,SAAS,OAAO;AAAA,EAC7B,gBAAgB,CAAC;AAAA,EACjB,sBAAsB,EAAE,OAAO,QAAQ,UAAU,WAAW;AAAA,EAC5D,gBAAgB;AAAA,IACd,CAAC,MAAMA,gBAAmB,IAAI,KAAKA,gBAAmB,IAAI,IAAI,GAAG;AAAA,MAC/D,OAAO;AAAA,IAAA;AAAA,EAEX;AAAA,EACA,gBAAgB;AAAA,IACd,QAAQ,MAAM,MAAM;AAAA,IACpB,iBAAiB,MAAM,OAAO;AAAA,IAC9B,WAAW,eAAe,MAAM,OAAO,KAAK;AAAA,EAC9C;AAAA,EACA,OAAO,CAAC;AAAA,EACR,WAAW;AAAA,IACT,wCAAwC;AAAA,MACtC,SAAS;AAAA,IAAA;AAAA,EAEb;AAAA,EACA,kBAAkB;AAAA,IAChB,gBAAgB;AAAA,MACd,SAAS;AAAA,IAAA;AAAA,EAEb;AAAA,EACA,mBAAmB,CAAC;AAAA,EACpB,oBAAoB,EAAE,SAAS,EAAE;AAAA;AAAA,EAEjC,sBAAsB,CAAC;AAAA,EACvB,OAAO,CAAA;AACT,CAAC;"}
@@ -10,9 +10,9 @@ import { staticClasses } from "./List.styles.js";
10
10
  import { useSelectableList } from "./useSelectableList.js";
11
11
  import { parseList } from "./utils.js";
12
12
  import { HvCheckBox } from "../CheckBox/CheckBox.js";
13
+ import { HvRadio } from "../Radio/Radio.js";
13
14
  import { HvOverflowTooltip } from "../OverflowTooltip/OverflowTooltip.js";
14
15
  import { HvLink } from "../Link/Link.js";
15
- import { HvRadio } from "../Radio/Radio.js";
16
16
  import { HvListContainer } from "../ListContainer/ListContainer.js";
17
17
  import { HvListItem } from "../ListContainer/ListItem/ListItem.js";
18
18
  const DEFAULT_LABELS = {
@@ -60,9 +60,6 @@ const { staticClasses, useClasses } = createClasses("HvListItem", {
60
60
  "& svg": {
61
61
  boxShadow: "none !important",
62
62
  outline: "none !important"
63
- },
64
- "$disabled > svg *.color0": {
65
- fill: theme.colors.secondary_60
66
63
  }
67
64
  },
68
65
  withEndAdornment: {
@@ -70,9 +67,6 @@ const { staticClasses, useClasses } = createClasses("HvListItem", {
70
67
  "& svg": {
71
68
  boxShadow: "none !important",
72
69
  outline: "none !important"
73
- },
74
- "$disabled > svg *.color0": {
75
- fill: theme.colors.secondary_60
76
70
  }
77
71
  }
78
72
  });
@@ -1 +1 @@
1
- {"version":3,"file":"ListItem.styles.js","sources":["../../../../src/ListContainer/ListItem/ListItem.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { outlineStyles } from \"../../utils/focusUtils\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvListItem\", {\n root: {\n ...theme.typography.body,\n padding: 0,\n display: \"block\",\n height: \"32px\",\n lineHeight: \"32px\",\n listStyleType: \"none\",\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n position: \"relative\",\n alignContent: \"center\",\n\n \"&:not(:last-child)\": {\n marginBottom: \"8px\",\n },\n\n \"&$condensed\": {\n marginBottom: 0,\n },\n\n \"&.HvIsFocused\": {\n ...outlineStyles,\n backgroundColor: theme.colors.atmo3,\n zIndex: 2,\n },\n },\n focus: { backgroundColor: theme.colors.atmo3, zIndex: 2 },\n startAdornment: {},\n endAdornment: {},\n gutters: {\n padding: `0 ${theme.space.xs}`,\n\n \"&$withStartAdornment\": {\n paddingLeft: 0,\n },\n \"&$withEndAdornment\": {\n paddingRight: 0,\n },\n },\n condensed: {},\n interactive: {\n cursor: \"pointer\",\n \"&:not($disabled):not($selected):hover\": {\n backgroundColor: theme.colors.containerBackgroundHover,\n },\n \"&$disabled\": {\n cursor: \"not-allowed\",\n },\n },\n selected: { backgroundColor: theme.colors.containerBackgroundHover },\n disabled: {\n color: theme.colors.secondary_60,\n backgroundColor: theme.colors.atmo3,\n },\n withStartAdornment: {\n \"& > div\": {\n float: \"left\",\n },\n\n \"& svg\": {\n boxShadow: \"none !important\",\n outline: \"none !important\",\n },\n \"$disabled > svg *.color0\": {\n fill: theme.colors.secondary_60,\n },\n },\n withEndAdornment: {\n \"& > div\": { float: \"right\" },\n\n \"& svg\": {\n boxShadow: \"none !important\",\n outline: \"none !important\",\n },\n \"$disabled > svg *.color0\": {\n fill: theme.colors.secondary_60,\n },\n },\n});\n"],"names":[],"mappings":";;;AAKO,MAAM,EAAE,eAAe,eAAe,cAAc,cAAc;AAAA,EACvE,MAAM;AAAA,IACJ,GAAG,MAAM,WAAW;AAAA,IACpB,SAAS;AAAA,IACT,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,eAAe;AAAA,IACf,UAAU;AAAA,IACV,cAAc;AAAA,IACd,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,cAAc;AAAA,IAEd,sBAAsB;AAAA,MACpB,cAAc;AAAA,IAChB;AAAA,IAEA,eAAe;AAAA,MACb,cAAc;AAAA,IAChB;AAAA,IAEA,iBAAiB;AAAA,MACf,GAAG;AAAA,MACH,iBAAiB,MAAM,OAAO;AAAA,MAC9B,QAAQ;AAAA,IAAA;AAAA,EAEZ;AAAA,EACA,OAAO,EAAE,iBAAiB,MAAM,OAAO,OAAO,QAAQ,EAAE;AAAA,EACxD,gBAAgB,CAAC;AAAA,EACjB,cAAc,CAAC;AAAA,EACf,SAAS;AAAA,IACP,SAAS,KAAK,MAAM,MAAM,EAAE;AAAA,IAE5B,wBAAwB;AAAA,MACtB,aAAa;AAAA,IACf;AAAA,IACA,sBAAsB;AAAA,MACpB,cAAc;AAAA,IAAA;AAAA,EAElB;AAAA,EACA,WAAW,CAAC;AAAA,EACZ,aAAa;AAAA,IACX,QAAQ;AAAA,IACR,yCAAyC;AAAA,MACvC,iBAAiB,MAAM,OAAO;AAAA,IAChC;AAAA,IACA,cAAc;AAAA,MACZ,QAAQ;AAAA,IAAA;AAAA,EAEZ;AAAA,EACA,UAAU,EAAE,iBAAiB,MAAM,OAAO,yBAAyB;AAAA,EACnE,UAAU;AAAA,IACR,OAAO,MAAM,OAAO;AAAA,IACpB,iBAAiB,MAAM,OAAO;AAAA,EAChC;AAAA,EACA,oBAAoB;AAAA,IAClB,WAAW;AAAA,MACT,OAAO;AAAA,IACT;AAAA,IAEA,SAAS;AAAA,MACP,WAAW;AAAA,MACX,SAAS;AAAA,IACX;AAAA,IACA,4BAA4B;AAAA,MAC1B,MAAM,MAAM,OAAO;AAAA,IAAA;AAAA,EAEvB;AAAA,EACA,kBAAkB;AAAA,IAChB,WAAW,EAAE,OAAO,QAAQ;AAAA,IAE5B,SAAS;AAAA,MACP,WAAW;AAAA,MACX,SAAS;AAAA,IACX;AAAA,IACA,4BAA4B;AAAA,MAC1B,MAAM,MAAM,OAAO;AAAA,IAAA;AAAA,EACrB;AAEJ,CAAC;"}
1
+ {"version":3,"file":"ListItem.styles.js","sources":["../../../../src/ListContainer/ListItem/ListItem.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { outlineStyles } from \"../../utils/focusUtils\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvListItem\", {\n root: {\n ...theme.typography.body,\n padding: 0,\n display: \"block\",\n height: \"32px\",\n lineHeight: \"32px\",\n listStyleType: \"none\",\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n position: \"relative\",\n alignContent: \"center\",\n\n \"&:not(:last-child)\": {\n marginBottom: \"8px\",\n },\n\n \"&$condensed\": {\n marginBottom: 0,\n },\n\n \"&.HvIsFocused\": {\n ...outlineStyles,\n backgroundColor: theme.colors.atmo3,\n zIndex: 2,\n },\n },\n focus: { backgroundColor: theme.colors.atmo3, zIndex: 2 },\n startAdornment: {},\n endAdornment: {},\n gutters: {\n padding: `0 ${theme.space.xs}`,\n\n \"&$withStartAdornment\": {\n paddingLeft: 0,\n },\n \"&$withEndAdornment\": {\n paddingRight: 0,\n },\n },\n condensed: {},\n interactive: {\n cursor: \"pointer\",\n \"&:not($disabled):not($selected):hover\": {\n backgroundColor: theme.colors.containerBackgroundHover,\n },\n \"&$disabled\": {\n cursor: \"not-allowed\",\n },\n },\n selected: { backgroundColor: theme.colors.containerBackgroundHover },\n disabled: {\n color: theme.colors.secondary_60,\n backgroundColor: theme.colors.atmo3,\n },\n withStartAdornment: {\n \"& > div\": {\n float: \"left\",\n },\n\n \"& svg\": {\n boxShadow: \"none !important\",\n outline: \"none !important\",\n },\n },\n withEndAdornment: {\n \"& > div\": { float: \"right\" },\n\n \"& svg\": {\n boxShadow: \"none !important\",\n outline: \"none !important\",\n },\n },\n});\n"],"names":[],"mappings":";;;AAKO,MAAM,EAAE,eAAe,eAAe,cAAc,cAAc;AAAA,EACvE,MAAM;AAAA,IACJ,GAAG,MAAM,WAAW;AAAA,IACpB,SAAS;AAAA,IACT,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,eAAe;AAAA,IACf,UAAU;AAAA,IACV,cAAc;AAAA,IACd,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,cAAc;AAAA,IAEd,sBAAsB;AAAA,MACpB,cAAc;AAAA,IAChB;AAAA,IAEA,eAAe;AAAA,MACb,cAAc;AAAA,IAChB;AAAA,IAEA,iBAAiB;AAAA,MACf,GAAG;AAAA,MACH,iBAAiB,MAAM,OAAO;AAAA,MAC9B,QAAQ;AAAA,IAAA;AAAA,EAEZ;AAAA,EACA,OAAO,EAAE,iBAAiB,MAAM,OAAO,OAAO,QAAQ,EAAE;AAAA,EACxD,gBAAgB,CAAC;AAAA,EACjB,cAAc,CAAC;AAAA,EACf,SAAS;AAAA,IACP,SAAS,KAAK,MAAM,MAAM,EAAE;AAAA,IAE5B,wBAAwB;AAAA,MACtB,aAAa;AAAA,IACf;AAAA,IACA,sBAAsB;AAAA,MACpB,cAAc;AAAA,IAAA;AAAA,EAElB;AAAA,EACA,WAAW,CAAC;AAAA,EACZ,aAAa;AAAA,IACX,QAAQ;AAAA,IACR,yCAAyC;AAAA,MACvC,iBAAiB,MAAM,OAAO;AAAA,IAChC;AAAA,IACA,cAAc;AAAA,MACZ,QAAQ;AAAA,IAAA;AAAA,EAEZ;AAAA,EACA,UAAU,EAAE,iBAAiB,MAAM,OAAO,yBAAyB;AAAA,EACnE,UAAU;AAAA,IACR,OAAO,MAAM,OAAO;AAAA,IACpB,iBAAiB,MAAM,OAAO;AAAA,EAChC;AAAA,EACA,oBAAoB;AAAA,IAClB,WAAW;AAAA,MACT,OAAO;AAAA,IACT;AAAA,IAEA,SAAS;AAAA,MACP,WAAW;AAAA,MACX,SAAS;AAAA,IAAA;AAAA,EAEb;AAAA,EACA,kBAAkB;AAAA,IAChB,WAAW,EAAE,OAAO,QAAQ;AAAA,IAE5B,SAAS;AAAA,MACP,WAAW;AAAA,MACX,SAAS;AAAA,IAAA;AAAA,EACX;AAEJ,CAAC;"}
@@ -5,7 +5,6 @@ import { getColor } from "@hitachivantara/uikit-styles";
5
5
  import { range } from "../utils/helpers.js";
6
6
  import { useClasses } from "./Loading.styles.js";
7
7
  import { staticClasses } from "./Loading.styles.js";
8
- import { HvTypography } from "../Typography/Typography.js";
9
8
  const HvLoading = forwardRef(function HvLoading2(props, ref) {
10
9
  const {
11
10
  color,
@@ -50,7 +49,7 @@ const HvLoading = forwardRef(function HvLoading2(props, ref) {
50
49
  },
51
50
  e
52
51
  )) }),
53
- label && /* @__PURE__ */ jsx(HvTypography, { variant: "caption1", className: classes.label, children: label })
52
+ label && /* @__PURE__ */ jsx("div", { className: classes.label, children: label })
54
53
  ]
55
54
  }
56
55
  );
@@ -1 +1 @@
1
- {"version":3,"file":"Loading.js","sources":["../../../src/Loading/Loading.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport {\n mergeStyles,\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\nimport { getColor, HvColorAny } from \"@hitachivantara/uikit-styles\";\n\nimport { HvBaseProps } from \"../types/generic\";\nimport { HvTypography } from \"../Typography\";\nimport { range } from \"../utils/helpers\";\nimport { staticClasses, useClasses } from \"./Loading.styles\";\n\nexport { staticClasses as loadingClasses };\n\nexport type HvLoadingClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvLoadingProps extends HvBaseProps {\n /** Indicates if the component should be render in a small size. */\n small?: boolean;\n /** The label to be displayed. */\n label?: React.ReactNode;\n /** Whether the loading animation is hidden. */\n hidden?: boolean;\n /** Color applied to the bars. */\n color?: HvColorAny;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvLoadingClasses;\n}\n\n/**\n * Loading provides feedback about a process that is taking place in the application.\n */\nexport const HvLoading = forwardRef<\n // no-indent\n React.ComponentRef<\"div\">,\n HvLoadingProps\n>(function HvLoading(props, ref) {\n const {\n color,\n hidden,\n small,\n label,\n classes: classesProp,\n style,\n className,\n ...others\n } = useDefaultProps(\"HvLoading\", props);\n\n const { classes, cx } = useClasses(classesProp);\n\n const size = small ? \"small\" : \"regular\";\n const colorVariant = color && (`${size}Color` as const);\n\n return (\n <div\n ref={ref}\n hidden={!!hidden}\n style={mergeStyles(style, {\n color: getColor(color, small ? \"secondary\" : \"brand\"),\n \"--customColor\": getColor(color),\n })}\n className={cx(\n classes.root,\n {\n [classes.hidden]: hidden,\n },\n className,\n )}\n {...others}\n >\n <div className={classes.barContainer}>\n {range(3).map((e) => (\n <div\n key={e}\n className={cx(\n classes.loadingBar,\n // TODO: hoist to parent & remove unused `colorVariant` in v6\n classes[size],\n classes[colorVariant!],\n )}\n />\n ))}\n </div>\n {label && (\n <HvTypography variant=\"caption1\" className={classes.label}>\n {label}\n </HvTypography>\n )}\n </div>\n );\n});\n"],"names":["HvLoading"],"mappings":";;;;;;;;AAiCO,MAAM,YAAY,WAIvB,SAASA,WAAU,OAAO,KAAK;AACzB,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,IACD,gBAAgB,aAAa,KAAK;AAEtC,QAAM,EAAE,SAAS,OAAO,WAAW,WAAW;AAExC,QAAA,OAAO,QAAQ,UAAU;AACzB,QAAA,eAAe,SAAU,GAAG,IAAI;AAGpC,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA,QAAQ,CAAC,CAAC;AAAA,MACV,OAAO,YAAY,OAAO;AAAA,QACxB,OAAO,SAAS,OAAO,QAAQ,cAAc,OAAO;AAAA,QACpD,iBAAiB,SAAS,KAAK;AAAA,MAAA,CAChC;AAAA,MACD,WAAW;AAAA,QACT,QAAQ;AAAA,QACR;AAAA,UACE,CAAC,QAAQ,MAAM,GAAG;AAAA,QACpB;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEJ,UAAA;AAAA,QAAC,oBAAA,OAAA,EAAI,WAAW,QAAQ,cACrB,gBAAM,CAAC,EAAE,IAAI,CAAC,MACb;AAAA,UAAC;AAAA,UAAA;AAAA,YAEC,WAAW;AAAA,cACT,QAAQ;AAAA;AAAA,cAER,QAAQ,IAAI;AAAA,cACZ,QAAQ,YAAa;AAAA,YAAA;AAAA,UACvB;AAAA,UANK;AAAA,QAQR,CAAA,GACH;AAAA,QACC,6BACE,cAAa,EAAA,SAAQ,YAAW,WAAW,QAAQ,OACjD,UACH,MAAA,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAEJ;AAEJ,CAAC;"}
1
+ {"version":3,"file":"Loading.js","sources":["../../../src/Loading/Loading.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport {\n mergeStyles,\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\nimport { getColor, HvColorAny } from \"@hitachivantara/uikit-styles\";\n\nimport { HvBaseProps } from \"../types/generic\";\nimport { range } from \"../utils/helpers\";\nimport { staticClasses, useClasses } from \"./Loading.styles\";\n\nexport { staticClasses as loadingClasses };\n\nexport type HvLoadingClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvLoadingProps extends HvBaseProps {\n /** Indicates if the component should be render in a small size. */\n small?: boolean;\n /** The label to be displayed. */\n label?: React.ReactNode;\n /** Whether the loading animation is hidden. */\n hidden?: boolean;\n /** Color applied to the bars. */\n color?: HvColorAny;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvLoadingClasses;\n}\n\n/**\n * Loading provides feedback about a process that is taking place in the application.\n */\nexport const HvLoading = forwardRef<\n // no-indent\n React.ComponentRef<\"div\">,\n HvLoadingProps\n>(function HvLoading(props, ref) {\n const {\n color,\n hidden,\n small,\n label,\n classes: classesProp,\n style,\n className,\n ...others\n } = useDefaultProps(\"HvLoading\", props);\n\n const { classes, cx } = useClasses(classesProp);\n\n const size = small ? \"small\" : \"regular\";\n const colorVariant = color && (`${size}Color` as const);\n\n return (\n <div\n ref={ref}\n hidden={!!hidden}\n style={mergeStyles(style, {\n color: getColor(color, small ? \"secondary\" : \"brand\"),\n \"--customColor\": getColor(color),\n })}\n className={cx(\n classes.root,\n {\n [classes.hidden]: hidden,\n },\n className,\n )}\n {...others}\n >\n <div className={classes.barContainer}>\n {range(3).map((e) => (\n <div\n key={e}\n className={cx(\n classes.loadingBar,\n // TODO: hoist to parent & remove unused `colorVariant` in v6\n classes[size],\n classes[colorVariant!],\n )}\n />\n ))}\n </div>\n {label && <div className={classes.label}>{label}</div>}\n </div>\n );\n});\n"],"names":["HvLoading"],"mappings":";;;;;;;AAgCO,MAAM,YAAY,WAIvB,SAASA,WAAU,OAAO,KAAK;AACzB,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,IACD,gBAAgB,aAAa,KAAK;AAEtC,QAAM,EAAE,SAAS,OAAO,WAAW,WAAW;AAExC,QAAA,OAAO,QAAQ,UAAU;AACzB,QAAA,eAAe,SAAU,GAAG,IAAI;AAGpC,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA,QAAQ,CAAC,CAAC;AAAA,MACV,OAAO,YAAY,OAAO;AAAA,QACxB,OAAO,SAAS,OAAO,QAAQ,cAAc,OAAO;AAAA,QACpD,iBAAiB,SAAS,KAAK;AAAA,MAAA,CAChC;AAAA,MACD,WAAW;AAAA,QACT,QAAQ;AAAA,QACR;AAAA,UACE,CAAC,QAAQ,MAAM,GAAG;AAAA,QACpB;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEJ,UAAA;AAAA,QAAC,oBAAA,OAAA,EAAI,WAAW,QAAQ,cACrB,gBAAM,CAAC,EAAE,IAAI,CAAC,MACb;AAAA,UAAC;AAAA,UAAA;AAAA,YAEC,WAAW;AAAA,cACT,QAAQ;AAAA;AAAA,cAER,QAAQ,IAAI;AAAA,cACZ,QAAQ,YAAa;AAAA,YAAA;AAAA,UACvB;AAAA,UANK;AAAA,QAQR,CAAA,GACH;AAAA,QACC,SAAU,oBAAA,OAAA,EAAI,WAAW,QAAQ,OAAQ,UAAM,MAAA,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAClD;AAEJ,CAAC;"}
@@ -38,7 +38,9 @@ const { staticClasses, useClasses } = createClasses("HvLoading", {
38
38
  ":nth-of-type(2)": { animationDelay: "0.22s" },
39
39
  ":nth-of-type(3)": { animationDelay: "0.44s" }
40
40
  },
41
- label: {},
41
+ label: {
42
+ ...theme.typography.caption1
43
+ },
42
44
  overlay: {},
43
45
  blur: {},
44
46
  hidden: { display: "none" },
@@ -1 +1 @@
1
- {"version":3,"file":"Loading.styles.js","sources":["../../../src/Loading/Loading.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvLoading\", {\n root: {\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n justifyContent: \"center\",\n gap: theme.space.xs,\n },\n barContainer: {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-around\",\n\n \":has($regular)\": {\n width: 30,\n height: 30,\n },\n\n \":has($small)\": {\n \"--height\": \"40%\",\n width: 18,\n height: 18,\n },\n },\n loadingBar: {\n backgroundColor: \"currentcolor\",\n display: \"inline-block\",\n animation: \"loading 1s ease-in-out infinite\",\n // TODO: make this the default when it has better support\n width: \"round(up, 0.11em, 2px)\",\n height: \"100%\",\n\n \"@keyframes loading\": {\n \"50%\": {\n height: \"var(--height, 60%)\",\n backgroundColor: `var(--customColor, ${theme.colors.secondary})`,\n },\n },\n\n \":nth-of-type(2)\": { animationDelay: \"0.22s\" },\n \":nth-of-type(3)\": { animationDelay: \"0.44s\" },\n },\n label: {},\n overlay: {},\n blur: {},\n hidden: { display: \"none\" },\n small: {\n width: 2,\n },\n regular: {\n width: 4,\n },\n smallColor: {},\n regularColor: {},\n});\n"],"names":[],"mappings":";;AAGO,MAAM,EAAE,eAAe,eAAe,cAAc,aAAa;AAAA,EACtE,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,eAAe;AAAA,IACf,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,KAAK,MAAM,MAAM;AAAA,EACnB;AAAA,EACA,cAAc;AAAA,IACZ,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAEhB,kBAAkB;AAAA,MAChB,OAAO;AAAA,MACP,QAAQ;AAAA,IACV;AAAA,IAEA,gBAAgB;AAAA,MACd,YAAY;AAAA,MACZ,OAAO;AAAA,MACP,QAAQ;AAAA,IAAA;AAAA,EAEZ;AAAA,EACA,YAAY;AAAA,IACV,iBAAiB;AAAA,IACjB,SAAS;AAAA,IACT,WAAW;AAAA;AAAA,IAEX,OAAO;AAAA,IACP,QAAQ;AAAA,IAER,sBAAsB;AAAA,MACpB,OAAO;AAAA,QACL,QAAQ;AAAA,QACR,iBAAiB,sBAAsB,MAAM,OAAO,SAAS;AAAA,MAAA;AAAA,IAEjE;AAAA,IAEA,mBAAmB,EAAE,gBAAgB,QAAQ;AAAA,IAC7C,mBAAmB,EAAE,gBAAgB,QAAQ;AAAA,EAC/C;AAAA,EACA,OAAO,CAAC;AAAA,EACR,SAAS,CAAC;AAAA,EACV,MAAM,CAAC;AAAA,EACP,QAAQ,EAAE,SAAS,OAAO;AAAA,EAC1B,OAAO;AAAA,IACL,OAAO;AAAA,EACT;AAAA,EACA,SAAS;AAAA,IACP,OAAO;AAAA,EACT;AAAA,EACA,YAAY,CAAC;AAAA,EACb,cAAc,CAAA;AAChB,CAAC;"}
1
+ {"version":3,"file":"Loading.styles.js","sources":["../../../src/Loading/Loading.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvLoading\", {\n root: {\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n justifyContent: \"center\",\n gap: theme.space.xs,\n },\n barContainer: {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-around\",\n\n \":has($regular)\": {\n width: 30,\n height: 30,\n },\n\n \":has($small)\": {\n \"--height\": \"40%\",\n width: 18,\n height: 18,\n },\n },\n loadingBar: {\n backgroundColor: \"currentcolor\",\n display: \"inline-block\",\n animation: \"loading 1s ease-in-out infinite\",\n // TODO: make this the default when it has better support\n width: \"round(up, 0.11em, 2px)\",\n height: \"100%\",\n\n \"@keyframes loading\": {\n \"50%\": {\n height: \"var(--height, 60%)\",\n backgroundColor: `var(--customColor, ${theme.colors.secondary})`,\n },\n },\n\n \":nth-of-type(2)\": { animationDelay: \"0.22s\" },\n \":nth-of-type(3)\": { animationDelay: \"0.44s\" },\n },\n label: {\n ...theme.typography.caption1,\n },\n overlay: {},\n blur: {},\n hidden: { display: \"none\" },\n small: {\n width: 2,\n },\n regular: {\n width: 4,\n },\n smallColor: {},\n regularColor: {},\n});\n"],"names":[],"mappings":";;AAGO,MAAM,EAAE,eAAe,eAAe,cAAc,aAAa;AAAA,EACtE,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,eAAe;AAAA,IACf,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,KAAK,MAAM,MAAM;AAAA,EACnB;AAAA,EACA,cAAc;AAAA,IACZ,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAEhB,kBAAkB;AAAA,MAChB,OAAO;AAAA,MACP,QAAQ;AAAA,IACV;AAAA,IAEA,gBAAgB;AAAA,MACd,YAAY;AAAA,MACZ,OAAO;AAAA,MACP,QAAQ;AAAA,IAAA;AAAA,EAEZ;AAAA,EACA,YAAY;AAAA,IACV,iBAAiB;AAAA,IACjB,SAAS;AAAA,IACT,WAAW;AAAA;AAAA,IAEX,OAAO;AAAA,IACP,QAAQ;AAAA,IAER,sBAAsB;AAAA,MACpB,OAAO;AAAA,QACL,QAAQ;AAAA,QACR,iBAAiB,sBAAsB,MAAM,OAAO,SAAS;AAAA,MAAA;AAAA,IAEjE;AAAA,IAEA,mBAAmB,EAAE,gBAAgB,QAAQ;AAAA,IAC7C,mBAAmB,EAAE,gBAAgB,QAAQ;AAAA,EAC/C;AAAA,EACA,OAAO;AAAA,IACL,GAAG,MAAM,WAAW;AAAA,EACtB;AAAA,EACA,SAAS,CAAC;AAAA,EACV,MAAM,CAAC;AAAA,EACP,QAAQ,EAAE,SAAS,OAAO;AAAA,EAC1B,OAAO;AAAA,IACL,OAAO;AAAA,EACT;AAAA,EACA,SAAS;AAAA,IACP,OAAO;AAAA,EACT;AAAA,EACA,YAAY,CAAC;AAAA,EACb,cAAc,CAAA;AAChB,CAAC;"}
@@ -1,9 +1,9 @@
1
1
  import { createClasses } from "@hitachivantara/uikit-react-utils";
2
2
  import { theme } from "@hitachivantara/uikit-styles";
3
- import { staticClasses as staticClasses$1 } from "../BaseDropdown/BaseDropdown.styles.js";
4
- import "../BaseDropdown/BaseDropdown.js";
5
- import { staticClasses as staticClasses$2 } from "../Input/Input.styles.js";
3
+ import { staticClasses as staticClasses$1 } from "../Input/Input.styles.js";
6
4
  import "../Input/Input.js";
5
+ import { staticClasses as staticClasses$2 } from "../BaseDropdown/BaseDropdown.styles.js";
6
+ import "../BaseDropdown/BaseDropdown.js";
7
7
  const hoverColor = theme.colors.atmo3;
8
8
  const { staticClasses, useClasses } = createClasses("HvPagination", {
9
9
  /** Styles applied to the component root class. */
@@ -48,7 +48,7 @@ const { staticClasses, useClasses } = createClasses("HvPagination", {
48
48
  height: 24,
49
49
  display: "flex",
50
50
  alignItems: "center",
51
- [`& .${staticClasses$1.arrowContainer}`]: {
51
+ [`& .${staticClasses$2.arrowContainer}`]: {
52
52
  marginTop: -2
53
53
  }
54
54
  },
@@ -97,7 +97,7 @@ const { staticClasses, useClasses } = createClasses("HvPagination", {
97
97
  pageJump: {
98
98
  display: "inline-block",
99
99
  marginRight: `4px`,
100
- [`& .${staticClasses$2.inputRoot}`]: {
100
+ [`& .${staticClasses$1.inputRoot}`]: {
101
101
  [`& $pageSizeInput`]: {
102
102
  paddingLeft: `4px`,
103
103
  paddingRight: `4px`,
@@ -2,10 +2,10 @@ import { jsx } from "react/jsx-runtime";
2
2
  import { useState } from "react";
3
3
  import { useDefaultProps } from "@hitachivantara/uikit-react-utils";
4
4
  import { useClasses } from "./Select.styles.js";
5
- import { HvListItem } from "../ListContainer/ListItem/ListItem.js";
6
5
  import { HvBaseDropdown } from "../BaseDropdown/BaseDropdown.js";
7
6
  import { HvPanel } from "../Panel/Panel.js";
8
7
  import { HvSelectionList } from "../SelectionList/SelectionList.js";
8
+ import { HvListItem } from "../ListContainer/ListItem/ListItem.js";
9
9
  const Option = ({ ...props }) => /* @__PURE__ */ jsx(HvListItem, { ...props });
10
10
  const HvSelect = (props) => {
11
11
  const {
@@ -1,5 +1,5 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { createContext, useContext } from "react";
2
+ import { useContext, createContext } from "react";
3
3
  const defaultOperators = {
4
4
  numeric: [
5
5
  {
@@ -4,7 +4,7 @@ import { useDefaultProps } from "@hitachivantara/uikit-react-utils";
4
4
  import { useControlled } from "../hooks/useControlled.js";
5
5
  import { useLabels } from "../hooks/useLabels.js";
6
6
  import { isEqual } from "../utils/helpers.js";
7
- import { defaultLabels, HvQueryBuilderProvider, defaultOperators, defaultCombinators } from "./Context.js";
7
+ import { defaultOperators, defaultCombinators, HvQueryBuilderProvider, defaultLabels } from "./Context.js";
8
8
  import { useClasses } from "./QueryBuilder.styles.js";
9
9
  import { staticClasses } from "./QueryBuilder.styles.js";
10
10
  import { emptyGroup, setNodeIds, clearNodeIds } from "./utils/index.js";