@hitachivantara/uikit-react-core 5.82.2 → 5.82.4

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 (231) hide show
  1. package/dist/cjs/BaseDropdown/BaseDropdown.cjs +1 -1
  2. package/dist/cjs/BaseInput/BaseInput.cjs +11 -12
  3. package/dist/cjs/BaseInput/validations.cjs +3 -3
  4. package/dist/cjs/Calendar/Calendar.cjs +14 -15
  5. package/dist/cjs/Calendar/CalendarHeader/CalendarHeader.cjs +8 -10
  6. package/dist/cjs/Card/Card.cjs +1 -1
  7. package/dist/cjs/CheckBox/CheckBox.cjs +10 -10
  8. package/dist/cjs/CheckBoxGroup/CheckBoxGroup.cjs +8 -8
  9. package/dist/cjs/ColorPicker/ColorPicker.cjs +6 -9
  10. package/dist/cjs/ColorPicker/Fields/Fields.cjs +4 -4
  11. package/dist/cjs/ColorPicker/Picker/Picker.cjs +11 -3
  12. package/dist/cjs/ColorPicker/Picker/Picker.styles.cjs +6 -1
  13. package/dist/cjs/Controls/context/ControlsContext.cjs +1 -3
  14. package/dist/cjs/DatePicker/DatePicker.cjs +15 -15
  15. package/dist/cjs/DropDownMenu/DropDownMenu.cjs +1 -1
  16. package/dist/cjs/Dropdown/Dropdown.cjs +9 -9
  17. package/dist/cjs/FileUploader/DropZone/DropZone.cjs +2 -2
  18. package/dist/cjs/FilterGroup/FilterGroup.cjs +6 -6
  19. package/dist/cjs/{Forms → FormElement}/Adornment/Adornment.cjs +10 -11
  20. package/dist/cjs/{Forms → FormElement}/CharCounter/CharCounter.cjs +15 -15
  21. package/dist/cjs/FormElement/FormElement.cjs +35 -0
  22. package/dist/cjs/{Forms → FormElement}/InfoMessage/InfoMessage.cjs +8 -8
  23. package/dist/cjs/{Forms → FormElement}/Label/Label.cjs +13 -13
  24. package/dist/cjs/{Forms → FormElement}/Suggestions/Suggestions.cjs +7 -7
  25. package/dist/cjs/{Forms → FormElement}/WarningText/WarningText.cjs +5 -5
  26. package/dist/cjs/FormElement/context.cjs +11 -0
  27. package/dist/cjs/{Forms/FormElement/utils/FormUtils.cjs → FormElement/utils.cjs} +19 -11
  28. package/dist/cjs/Grid/Grid.cjs +1 -1
  29. package/dist/cjs/Input/Input.cjs +17 -17
  30. package/dist/cjs/Input/Input.styles.cjs +2 -2
  31. package/dist/cjs/ListContainer/ListContext/ListContext.cjs +1 -3
  32. package/dist/cjs/QueryBuilder/Rule/Value/DateTimeValue/DateTimeValue.cjs +1 -1
  33. package/dist/cjs/Radio/Radio.cjs +10 -13
  34. package/dist/cjs/RadioGroup/RadioGroup.cjs +7 -7
  35. package/dist/cjs/Select/Select.cjs +5 -7
  36. package/dist/cjs/SelectionList/SelectionList.cjs +7 -7
  37. package/dist/cjs/Slider/Slider.cjs +12 -12
  38. package/dist/cjs/Slider/utils.cjs +7 -7
  39. package/dist/cjs/Snackbar/SnackbarContent/SnackbarContent.cjs +1 -1
  40. package/dist/cjs/SnackbarProvider/SnackbarProvider.cjs +1 -1
  41. package/dist/cjs/Switch/Switch.cjs +9 -12
  42. package/dist/cjs/Table/TableBody/TableBody.cjs +10 -8
  43. package/dist/cjs/Table/TableCell/TableCell.cjs +2 -2
  44. package/dist/cjs/Table/TableContainer/TableContainer.cjs +9 -2
  45. package/dist/cjs/Table/TableHead/TableHead.cjs +10 -2
  46. package/dist/cjs/Table/TableHeader/TableHeader.cjs +2 -2
  47. package/dist/cjs/Table/TableRow/TableRow.cjs +2 -2
  48. package/dist/cjs/TableSection/TableSection.styles.cjs +6 -2
  49. package/dist/cjs/TagsInput/TagsInput.cjs +17 -17
  50. package/dist/cjs/TagsInput/TagsInput.styles.cjs +1 -1
  51. package/dist/cjs/TextArea/TextArea.cjs +17 -17
  52. package/dist/cjs/TimePicker/TimePicker.cjs +7 -7
  53. package/dist/cjs/VerticalNavigation/TreeView/TreeViewItem.cjs +1 -1
  54. package/dist/cjs/hocs/withTooltip.cjs +40 -37
  55. package/dist/cjs/hooks/useIsMounted.cjs +2 -4
  56. package/dist/cjs/index.cjs +15 -36
  57. package/dist/esm/BaseDropdown/BaseDropdown.js +1 -1
  58. package/dist/esm/BaseDropdown/BaseDropdown.js.map +1 -1
  59. package/dist/esm/BaseInput/BaseInput.js +5 -6
  60. package/dist/esm/BaseInput/BaseInput.js.map +1 -1
  61. package/dist/esm/BaseInput/validations.js +3 -3
  62. package/dist/esm/BaseInput/validations.js.map +1 -1
  63. package/dist/esm/Calendar/Calendar.js +13 -14
  64. package/dist/esm/Calendar/Calendar.js.map +1 -1
  65. package/dist/esm/Calendar/CalendarHeader/CalendarHeader.js +6 -8
  66. package/dist/esm/Calendar/CalendarHeader/CalendarHeader.js.map +1 -1
  67. package/dist/esm/Card/Card.js +1 -1
  68. package/dist/esm/Card/Card.js.map +1 -1
  69. package/dist/esm/CheckBox/CheckBox.js +9 -9
  70. package/dist/esm/CheckBox/CheckBox.js.map +1 -1
  71. package/dist/esm/CheckBoxGroup/CheckBoxGroup.js +8 -8
  72. package/dist/esm/CheckBoxGroup/CheckBoxGroup.js.map +1 -1
  73. package/dist/esm/ColorPicker/ColorPicker.js +6 -9
  74. package/dist/esm/ColorPicker/ColorPicker.js.map +1 -1
  75. package/dist/esm/ColorPicker/Fields/Fields.js +4 -4
  76. package/dist/esm/ColorPicker/Fields/Fields.js.map +1 -1
  77. package/dist/esm/ColorPicker/Picker/Picker.js +11 -3
  78. package/dist/esm/ColorPicker/Picker/Picker.js.map +1 -1
  79. package/dist/esm/ColorPicker/Picker/Picker.styles.js +6 -1
  80. package/dist/esm/ColorPicker/Picker/Picker.styles.js.map +1 -1
  81. package/dist/esm/Controls/context/ControlsContext.js +2 -2
  82. package/dist/esm/Controls/context/ControlsContext.js.map +1 -1
  83. package/dist/esm/DatePicker/DatePicker.js +9 -9
  84. package/dist/esm/DatePicker/DatePicker.js.map +1 -1
  85. package/dist/esm/Dialog/Dialog.js.map +1 -1
  86. package/dist/esm/DropDownMenu/DropDownMenu.js +1 -1
  87. package/dist/esm/DropDownMenu/DropDownMenu.js.map +1 -1
  88. package/dist/esm/Dropdown/Dropdown.js +8 -8
  89. package/dist/esm/Dropdown/Dropdown.js.map +1 -1
  90. package/dist/esm/EmptyState/EmptyState.js.map +1 -1
  91. package/dist/esm/FileUploader/DropZone/DropZone.js +2 -2
  92. package/dist/esm/FileUploader/DropZone/DropZone.js.map +1 -1
  93. package/dist/esm/FilterGroup/FilterContent/FilterContent.js.map +1 -1
  94. package/dist/esm/FilterGroup/FilterGroup.js +6 -6
  95. package/dist/esm/FilterGroup/FilterGroup.js.map +1 -1
  96. package/dist/esm/{Forms → FormElement}/Adornment/Adornment.js +9 -10
  97. package/dist/esm/FormElement/Adornment/Adornment.js.map +1 -0
  98. package/dist/esm/FormElement/Adornment/Adornment.styles.js.map +1 -0
  99. package/dist/esm/{Forms → FormElement}/CharCounter/CharCounter.js +15 -15
  100. package/dist/esm/FormElement/CharCounter/CharCounter.js.map +1 -0
  101. package/dist/esm/FormElement/CharCounter/CharCounter.styles.js.map +1 -0
  102. package/dist/esm/FormElement/FormElement.js +36 -0
  103. package/dist/esm/FormElement/FormElement.js.map +1 -0
  104. package/dist/esm/FormElement/FormElement.styles.js.map +1 -0
  105. package/dist/esm/{Forms → FormElement}/InfoMessage/InfoMessage.js +8 -8
  106. package/dist/esm/FormElement/InfoMessage/InfoMessage.js.map +1 -0
  107. package/dist/esm/FormElement/InfoMessage/InfoMessage.styles.js.map +1 -0
  108. package/dist/esm/{Forms → FormElement}/Label/Label.js +12 -12
  109. package/dist/esm/FormElement/Label/Label.js.map +1 -0
  110. package/dist/esm/FormElement/Label/Label.styles.js.map +1 -0
  111. package/dist/esm/{Forms → FormElement}/Suggestions/Suggestions.js +7 -7
  112. package/dist/esm/FormElement/Suggestions/Suggestions.js.map +1 -0
  113. package/dist/esm/FormElement/Suggestions/Suggestions.styles.js.map +1 -0
  114. package/dist/esm/{Forms → FormElement}/WarningText/WarningText.js +5 -5
  115. package/dist/esm/FormElement/WarningText/WarningText.js.map +1 -0
  116. package/dist/esm/FormElement/WarningText/WarningText.styles.js.map +1 -0
  117. package/dist/esm/FormElement/context.js +11 -0
  118. package/dist/esm/FormElement/context.js.map +1 -0
  119. package/dist/esm/{Forms/FormElement/utils/FormUtils.js → FormElement/utils.js} +21 -11
  120. package/dist/esm/FormElement/utils.js.map +1 -0
  121. package/dist/esm/GlobalActions/GlobalActions.js.map +1 -1
  122. package/dist/esm/Grid/Grid.js +1 -1
  123. package/dist/esm/Grid/Grid.js.map +1 -1
  124. package/dist/esm/InlineEditor/InlineEditor.js.map +1 -1
  125. package/dist/esm/Input/Input.js +21 -21
  126. package/dist/esm/Input/Input.js.map +1 -1
  127. package/dist/esm/Input/Input.styles.js +2 -2
  128. package/dist/esm/Input/Input.styles.js.map +1 -1
  129. package/dist/esm/List/List.js.map +1 -1
  130. package/dist/esm/ListContainer/ListContext/ListContext.js +2 -2
  131. package/dist/esm/ListContainer/ListContext/ListContext.js.map +1 -1
  132. package/dist/esm/Pagination/Pagination.js.map +1 -1
  133. package/dist/esm/QueryBuilder/Rule/Value/DateTimeValue/DateTimeValue.js +1 -1
  134. package/dist/esm/QueryBuilder/Rule/Value/DateTimeValue/DateTimeValue.js.map +1 -1
  135. package/dist/esm/QueryBuilder/Rule/Value/TextValue/TextValue.js.map +1 -1
  136. package/dist/esm/Radio/Radio.js +9 -12
  137. package/dist/esm/Radio/Radio.js.map +1 -1
  138. package/dist/esm/RadioGroup/RadioGroup.js +7 -7
  139. package/dist/esm/RadioGroup/RadioGroup.js.map +1 -1
  140. package/dist/esm/Select/Select.js +5 -5
  141. package/dist/esm/Select/Select.js.map +1 -1
  142. package/dist/esm/SelectionList/SelectionList.js +7 -7
  143. package/dist/esm/SelectionList/SelectionList.js.map +1 -1
  144. package/dist/esm/Slider/Slider.js +12 -12
  145. package/dist/esm/Slider/Slider.js.map +1 -1
  146. package/dist/esm/Slider/SliderInput/SliderInput.js.map +1 -1
  147. package/dist/esm/Slider/utils.js +7 -7
  148. package/dist/esm/Slider/utils.js.map +1 -1
  149. package/dist/esm/Snackbar/SnackbarContent/SnackbarContent.js +1 -1
  150. package/dist/esm/Snackbar/SnackbarContent/SnackbarContent.js.map +1 -1
  151. package/dist/esm/SnackbarProvider/SnackbarProvider.js +1 -1
  152. package/dist/esm/SnackbarProvider/SnackbarProvider.js.map +1 -1
  153. package/dist/esm/Switch/Switch.js +8 -11
  154. package/dist/esm/Switch/Switch.js.map +1 -1
  155. package/dist/esm/Table/TableBody/TableBody.js +10 -8
  156. package/dist/esm/Table/TableBody/TableBody.js.map +1 -1
  157. package/dist/esm/Table/TableCell/TableCell.js +2 -2
  158. package/dist/esm/Table/TableCell/TableCell.js.map +1 -1
  159. package/dist/esm/Table/TableContainer/TableContainer.js +9 -2
  160. package/dist/esm/Table/TableContainer/TableContainer.js.map +1 -1
  161. package/dist/esm/Table/TableHead/TableHead.js +10 -2
  162. package/dist/esm/Table/TableHead/TableHead.js.map +1 -1
  163. package/dist/esm/Table/TableHeader/TableHeader.js +2 -2
  164. package/dist/esm/Table/TableHeader/TableHeader.js.map +1 -1
  165. package/dist/esm/Table/TableRow/TableRow.js +2 -2
  166. package/dist/esm/Table/TableRow/TableRow.js.map +1 -1
  167. package/dist/esm/TableSection/TableSection.styles.js +6 -2
  168. package/dist/esm/TableSection/TableSection.styles.js.map +1 -1
  169. package/dist/esm/TagsInput/TagsInput.js +19 -19
  170. package/dist/esm/TagsInput/TagsInput.js.map +1 -1
  171. package/dist/esm/TagsInput/TagsInput.styles.js +1 -1
  172. package/dist/esm/TagsInput/TagsInput.styles.js.map +1 -1
  173. package/dist/esm/TextArea/TextArea.js +19 -19
  174. package/dist/esm/TextArea/TextArea.js.map +1 -1
  175. package/dist/esm/TimePicker/TimePicker.js +7 -7
  176. package/dist/esm/TimePicker/TimePicker.js.map +1 -1
  177. package/dist/esm/TreeView/internals/utils/EventManager.js.map +1 -1
  178. package/dist/esm/VerticalNavigation/TreeView/TreeViewItem.js +1 -1
  179. package/dist/esm/VerticalNavigation/TreeView/TreeViewItem.js.map +1 -1
  180. package/dist/esm/hocs/withTooltip.js +40 -37
  181. package/dist/esm/hocs/withTooltip.js.map +1 -1
  182. package/dist/esm/hooks/useIsMounted.js +3 -3
  183. package/dist/esm/hooks/useIsMounted.js.map +1 -1
  184. package/dist/esm/index.js +14 -35
  185. package/dist/esm/index.js.map +1 -1
  186. package/dist/esm/utils/deepMerge.js.map +1 -1
  187. package/dist/types/index.d.ts +66 -143
  188. package/package.json +6 -6
  189. package/dist/cjs/Forms/FormElement/FormElement.cjs +0 -44
  190. package/dist/cjs/Forms/FormElement/context/FormElementContext.cjs +0 -12
  191. package/dist/cjs/Forms/FormElement/context/FormElementDescriptorsContext.cjs +0 -12
  192. package/dist/cjs/Forms/FormElement/context/FormElementValueContext.cjs +0 -12
  193. package/dist/cjs/Forms/FormElement/validationStates.cjs +0 -12
  194. package/dist/esm/Forms/Adornment/Adornment.js.map +0 -1
  195. package/dist/esm/Forms/Adornment/Adornment.styles.js.map +0 -1
  196. package/dist/esm/Forms/CharCounter/CharCounter.js.map +0 -1
  197. package/dist/esm/Forms/CharCounter/CharCounter.styles.js.map +0 -1
  198. package/dist/esm/Forms/FormElement/FormElement.js +0 -45
  199. package/dist/esm/Forms/FormElement/FormElement.js.map +0 -1
  200. package/dist/esm/Forms/FormElement/FormElement.styles.js.map +0 -1
  201. package/dist/esm/Forms/FormElement/context/FormElementContext.js +0 -10
  202. package/dist/esm/Forms/FormElement/context/FormElementContext.js.map +0 -1
  203. package/dist/esm/Forms/FormElement/context/FormElementDescriptorsContext.js +0 -10
  204. package/dist/esm/Forms/FormElement/context/FormElementDescriptorsContext.js.map +0 -1
  205. package/dist/esm/Forms/FormElement/context/FormElementValueContext.js +0 -10
  206. package/dist/esm/Forms/FormElement/context/FormElementValueContext.js.map +0 -1
  207. package/dist/esm/Forms/FormElement/utils/FormUtils.js.map +0 -1
  208. package/dist/esm/Forms/FormElement/validationStates.js +0 -12
  209. package/dist/esm/Forms/FormElement/validationStates.js.map +0 -1
  210. package/dist/esm/Forms/InfoMessage/InfoMessage.js.map +0 -1
  211. package/dist/esm/Forms/InfoMessage/InfoMessage.styles.js.map +0 -1
  212. package/dist/esm/Forms/Label/Label.js.map +0 -1
  213. package/dist/esm/Forms/Label/Label.styles.js.map +0 -1
  214. package/dist/esm/Forms/Suggestions/Suggestions.js.map +0 -1
  215. package/dist/esm/Forms/Suggestions/Suggestions.styles.js.map +0 -1
  216. package/dist/esm/Forms/WarningText/WarningText.js.map +0 -1
  217. package/dist/esm/Forms/WarningText/WarningText.styles.js.map +0 -1
  218. /package/dist/cjs/{Forms → FormElement}/Adornment/Adornment.styles.cjs +0 -0
  219. /package/dist/cjs/{Forms → FormElement}/CharCounter/CharCounter.styles.cjs +0 -0
  220. /package/dist/cjs/{Forms/FormElement → FormElement}/FormElement.styles.cjs +0 -0
  221. /package/dist/cjs/{Forms → FormElement}/InfoMessage/InfoMessage.styles.cjs +0 -0
  222. /package/dist/cjs/{Forms → FormElement}/Label/Label.styles.cjs +0 -0
  223. /package/dist/cjs/{Forms → FormElement}/Suggestions/Suggestions.styles.cjs +0 -0
  224. /package/dist/cjs/{Forms → FormElement}/WarningText/WarningText.styles.cjs +0 -0
  225. /package/dist/esm/{Forms → FormElement}/Adornment/Adornment.styles.js +0 -0
  226. /package/dist/esm/{Forms → FormElement}/CharCounter/CharCounter.styles.js +0 -0
  227. /package/dist/esm/{Forms/FormElement → FormElement}/FormElement.styles.js +0 -0
  228. /package/dist/esm/{Forms → FormElement}/InfoMessage/InfoMessage.styles.js +0 -0
  229. /package/dist/esm/{Forms → FormElement}/Label/Label.styles.js +0 -0
  230. /package/dist/esm/{Forms → FormElement}/Suggestions/Suggestions.styles.js +0 -0
  231. /package/dist/esm/{Forms → FormElement}/WarningText/WarningText.styles.js +0 -0
@@ -17,8 +17,7 @@ import { ContainerProps } from '@mui/material/Container';
17
17
  import { Context } from 'react';
18
18
  import { createClasses } from '@hitachivantara/uikit-react-utils';
19
19
  import { CSSProperties } from 'react';
20
- import { default as default_2 } from 'react';
21
- import { default as default_3 } from 'embla-carousel-react';
20
+ import { default as default_2 } from 'embla-carousel-react';
22
21
  import { defaultCacheKey } from '@hitachivantara/uikit-react-shared';
23
22
  import { defaultEmotionCache } from '@hitachivantara/uikit-react-shared';
24
23
  import { DialogActionsProps } from '@mui/material/DialogActions';
@@ -67,6 +66,7 @@ import { InputProps } from '@mui/material/Input';
67
66
  import { JSX as JSX_2 } from 'react';
68
67
  import { JSX as JSX_3 } from 'react/jsx-runtime';
69
68
  import { JSXElementConstructor } from 'react';
69
+ import { MutableRefObject } from 'react';
70
70
  import { OptionGroupProps } from '@mui/base/OptionGroup';
71
71
  import { OptionOwnProps } from '@mui/base/Option';
72
72
  import { OptionsObject } from 'notistack';
@@ -412,16 +412,6 @@ export declare interface Breakpoint {
412
412
  spacing?: HvBreakpoints;
413
413
  }
414
414
 
415
- export declare const buildAriaPropsFromContext: (props: InputBaseComponentProps, context: HvFormElementDescriptorsContextValue, isInvalid: boolean, inputId?: string) => default_2.AriaAttributes;
416
-
417
- export declare const buildFormElementPropsFromContext: (name?: string, disabled?: boolean, readOnly?: boolean, required?: boolean, context?: HvFormElementContextValue) => {
418
- name: string | undefined;
419
- disabled: boolean | undefined;
420
- readOnly: boolean | undefined;
421
- required: boolean | undefined;
422
- status: string | undefined;
423
- };
424
-
425
415
  export declare const bulkActionsClasses: {
426
416
  root: string;
427
417
  semantic: string;
@@ -781,11 +771,6 @@ export declare const defaultGetToggleRowSelectedProps: (props: any, meta: any) =
781
771
  declare interface DefaultTreeViewPluginParameters<Multiple extends boolean | undefined> extends UseTreeViewNodesParameters, UseTreeViewExpansionParameters, UseTreeViewFocusParameters, UseTreeViewSelectionParameters<Multiple>, UseTreeViewContextValueBuilderParameters {
782
772
  }
783
773
 
784
- declare interface Descriptor {
785
- id?: string;
786
- htmlFor?: string;
787
- }
788
-
789
774
  export declare const dialogActionClasses: {
790
775
  root: string;
791
776
  fullscreen: string;
@@ -915,31 +900,6 @@ export declare const filterGroupClasses: {
915
900
  error: string;
916
901
  };
917
902
 
918
- /**
919
- * Scans the element's children looking for the children IDs that match the different form element types.
920
- * This function will produce an object that has a key for each provided name
921
- * Inside each key there will be an array with each id of the found descriptor.
922
- *
923
- * @param {Array} children - The children inside the form element to scan.
924
- * @param {Object} descriptors - Initial descriptors map (used for recursion).
925
- *
926
- */
927
- export declare const findDescriptors: (children: default_2.ReactNode, descriptors?: {
928
- input: Descriptor[];
929
- label: Descriptor[];
930
- description: Descriptor[];
931
- controlled: Descriptor[];
932
- errormessage: Descriptor[];
933
- HvCalendarHeader?: Descriptor[];
934
- }) => {
935
- input: Descriptor[];
936
- label: Descriptor[];
937
- description: Descriptor[];
938
- controlled: Descriptor[];
939
- errormessage: Descriptor[];
940
- HvCalendarHeader?: Descriptor[] | undefined;
941
- };
942
-
943
903
  declare type FixComponentProps<T> = T extends any ? T : never;
944
904
 
945
905
  /** React.forwardRef with fixed type declarations */
@@ -999,10 +959,6 @@ export declare const getHeaderFooterPropsHook: (props: any, { column }: any) =>
999
959
 
1000
960
  export declare const getHeaderGroupPropsHook: (props: any, { instance }: any) => any[];
1001
961
 
1002
- export declare const getIdReferenceFor: (formElementType: string, descriptors: any, filterFor?: null) => any;
1003
-
1004
- export declare const getIdReferenceListFor: (formElementType: string, descriptors: any, filterFor?: string | null) => any;
1005
-
1006
962
  /** Auxiliary function to find adjacent nodes to focus. */
1007
963
  export declare const getPrevNextFocus: (nodeId?: string) => {
1008
964
  nextFocus: any;
@@ -2398,7 +2354,7 @@ export declare interface HvCarouselProps extends HvBaseProps<HTMLDivElement, "ti
2398
2354
  /** Thumbnails position. */
2399
2355
  thumbnailsPosition?: "top" | "bottom";
2400
2356
  /** Carousel configuration options. @see https://www.embla-carousel.com/api/options/ */
2401
- carouselOptions?: Parameters<typeof default_3>[0];
2357
+ carouselOptions?: Parameters<typeof default_2>[0];
2402
2358
  /** Function that renders the thumbnail. */
2403
2359
  renderThumbnail?: (index: number) => React.ReactNode;
2404
2360
  /** The callback fired when the active slide changes. */
@@ -2978,7 +2934,7 @@ export declare interface HvDialogProps extends Omit<DialogProps, "fullScreen" |
2978
2934
  /** Current state of the Dialog. */
2979
2935
  open?: boolean;
2980
2936
  /** Callback fired when the component requests to be closed. */
2981
- onClose?: (event: default_2.MouseEvent<HTMLButtonElement> | {}, reason?: "escapeKeyDown" | "backdropClick") => void;
2937
+ onClose?: (event: React.MouseEvent<HTMLButtonElement> | {}, reason?: "escapeKeyDown" | "backdropClick") => void;
2982
2938
  /** @inheritdoc */
2983
2939
  maxWidth?: DialogProps["maxWidth"];
2984
2940
  /** @inheritdoc */
@@ -3419,19 +3375,19 @@ declare interface HvDropZoneLabels {
3419
3375
  /**
3420
3376
  * Empty states communicate that there’s no information, data or values to display in a given context.
3421
3377
  */
3422
- export declare const HvEmptyState: default_2.ForwardRefExoticComponent<HvEmptyStateProps & default_2.RefAttributes<HTMLDivElement>>;
3378
+ export declare const HvEmptyState: ForwardRefExoticComponent<HvEmptyStateProps & RefAttributes<HTMLDivElement>>;
3423
3379
 
3424
3380
  export declare type HvEmptyStateClasses = ExtractNames<typeof useClasses_68>;
3425
3381
 
3426
3382
  export declare interface HvEmptyStateProps extends HvBaseProps<HTMLDivElement, "title"> {
3427
3383
  /** Icon to be presented. */
3428
- icon: default_2.ReactNode;
3384
+ icon: React.ReactNode;
3429
3385
  /** The title to be shown. */
3430
- title?: default_2.ReactNode;
3386
+ title?: React.ReactNode;
3431
3387
  /** The message to be shown. */
3432
- message?: default_2.ReactNode;
3388
+ message?: React.ReactNode;
3433
3389
  /** The action message to be shown. */
3434
- action?: default_2.ReactNode;
3390
+ action?: React.ReactNode;
3435
3391
  /** A Jss Object used to override or extend the styles applied to the empty state component. */
3436
3392
  classes?: HvEmptyStateClasses;
3437
3393
  }
@@ -3761,6 +3717,12 @@ declare type HvFooterProps_2<D extends object = Record<string, unknown>> = HvTab
3761
3717
  column: HvColumnInstance<D>;
3762
3718
  };
3763
3719
 
3720
+ /**
3721
+ * Provides form-related context (ie. required/disabled/readOnly) for building form components,
3722
+ * analogous to MUI's [`FormControl`](https://mui.com/material-ui/api/form-control/) component.
3723
+ *
3724
+ * It is used internally to build UI Kit's form components (eg. `HvInput`, `HvDatePicker`), and can be used to build custom form components.
3725
+ */
3764
3726
  export declare const HvFormElement: {
3765
3727
  (props: HvFormElementProps): JSX_3.Element;
3766
3728
  formElementType: string;
@@ -3768,40 +3730,33 @@ export declare const HvFormElement: {
3768
3730
 
3769
3731
  export declare type HvFormElementClasses = ExtractNames<typeof useClasses_8>;
3770
3732
 
3771
- export declare const HvFormElementContext: default_2.Context<HvFormElementContextValue>;
3772
-
3773
- export declare const HvFormElementContextConsumer: default_2.Consumer<HvFormElementContextValue>;
3774
-
3775
- export declare const HvFormElementContextProvider: default_2.Provider<HvFormElementContextValue>;
3776
-
3777
- export declare interface HvFormElementContextValue {
3778
- elementId?: string;
3779
- elementDisabled?: boolean;
3780
- elementRequired?: boolean;
3781
- elementStatus?: string;
3782
- elementReadOnly?: boolean;
3783
- elementName?: string;
3784
- }
3785
-
3786
- export declare const HvFormElementDescriptorsContext: default_2.Context<HvFormElementDescriptorsContextValue>;
3787
-
3788
- export declare const HvFormElementDescriptorsContextConsumer: default_2.Consumer<HvFormElementDescriptorsContextValue>;
3789
-
3790
- export declare const HvFormElementDescriptorsContextProvider: default_2.Provider<HvFormElementDescriptorsContextValue>;
3791
-
3792
- export declare interface HvFormElementDescriptorsContextValue {
3793
- input?: any;
3794
- label?: any;
3795
- descriptors?: any;
3796
- }
3797
-
3798
- export declare interface HvFormElementProps extends HvBaseProps<HTMLDivElement, "onChange" | "onToggle"> {
3733
+ declare interface HvFormElementContextValue {
3734
+ /** id to be applied to the form element root node. */
3735
+ id?: string;
3799
3736
  /**
3800
3737
  * Name of the form element.
3801
3738
  *
3802
3739
  * Part of a name/value pair, should be the name property of the underling native input.
3803
3740
  */
3804
3741
  name?: string;
3742
+ /**
3743
+ * The status of the form element.
3744
+ *
3745
+ * Valid is correct, invalid is incorrect and standBy means no validations have run.
3746
+ *
3747
+ * When uncontrolled and unspecified it will default to "standBy" and change to either "valid"
3748
+ * or "invalid" after any change to the state.
3749
+ */
3750
+ status?: HvFormStatus;
3751
+ /** Whether the form element is disabled. */
3752
+ disabled?: boolean;
3753
+ /** Indicates that user input is required on the form element. */
3754
+ required?: boolean;
3755
+ /** Indicates that the form element is not editable. */
3756
+ readOnly?: boolean;
3757
+ }
3758
+
3759
+ export declare interface HvFormElementProps extends HvFormElementContextValue, HvBaseProps<HTMLDivElement, "onChange" | "onToggle"> {
3805
3760
  /**
3806
3761
  * Current value of the form element.
3807
3762
  *
@@ -3817,21 +3772,6 @@ export declare interface HvFormElementProps extends HvBaseProps<HTMLDivElement,
3817
3772
  label?: React.ReactNode;
3818
3773
  /** Provide additional descriptive text for the form element. */
3819
3774
  description?: React.ReactNode;
3820
- /** Whether the form element is disabled. */
3821
- disabled?: boolean;
3822
- /** Indicates that the form element is not editable. */
3823
- readOnly?: boolean;
3824
- /** Indicates that user input is required on the form element. */
3825
- required?: boolean;
3826
- /**
3827
- * The status of the form element.
3828
- *
3829
- * Valid is correct, invalid is incorrect and standBy means no validations have run.
3830
- *
3831
- * When uncontrolled and unspecified it will default to "standBy" and change to either "valid"
3832
- * or "invalid" after any change to the state.
3833
- */
3834
- status?: HvFormStatus;
3835
3775
  /** The error message to show when `status` is "invalid". */
3836
3776
  statusMessage?: string;
3837
3777
  /** The callback fired when the value changes. */
@@ -3840,19 +3780,13 @@ export declare interface HvFormElementProps extends HvBaseProps<HTMLDivElement,
3840
3780
  classes?: HvFormElementClasses;
3841
3781
  }
3842
3782
 
3843
- export declare const HvFormElementValueContext: default_2.Context<undefined>;
3844
-
3845
- export declare const HvFormElementValueContextConsumer: default_2.Consumer<undefined>;
3846
-
3847
- export declare const HvFormElementValueContextProvider: default_2.Provider<undefined>;
3848
-
3849
3783
  export declare type HvFormStatus = "standBy" | "valid" | "invalid" | "empty";
3850
3784
 
3851
3785
  /**
3852
3786
  * Global Actions are actions that affect the entire page they live in.
3853
3787
  * They should persist while scrolling down the screen.
3854
3788
  */
3855
- export declare const HvGlobalActions: default_2.ForwardRefExoticComponent<HvGlobalActionsProps & default_2.RefAttributes<HTMLDivElement>>;
3789
+ export declare const HvGlobalActions: ForwardRefExoticComponent<HvGlobalActionsProps & RefAttributes<HTMLDivElement>>;
3856
3790
 
3857
3791
  export declare type HvGlobalActionsClasses = ExtractNames<typeof useClasses_74>;
3858
3792
 
@@ -3862,11 +3796,11 @@ export declare type HvGlobalActionsPosition = "sticky" | "fixed" | "relative";
3862
3796
 
3863
3797
  export declare interface HvGlobalActionsProps extends HvBaseProps<HTMLDivElement, "title"> {
3864
3798
  /** Text to display in the component. */
3865
- title?: default_2.ReactNode;
3799
+ title?: React.ReactNode;
3866
3800
  /** Denotes if this is a global or section component. */
3867
3801
  variant?: HvGlobalActionsVariant;
3868
3802
  /** User can pass in a fully customized button or false for when the back button should not be rendered. */
3869
- backButton?: default_2.ReactNode;
3803
+ backButton?: React.ReactNode;
3870
3804
  /** Heading Level to apply to Title Area. */
3871
3805
  headingLevel?: HvGlobalActionsHeadingLevel;
3872
3806
  /**
@@ -4173,7 +4107,7 @@ export declare interface HvInfoMessageProps extends HvTypographyProps<"label"> {
4173
4107
  * An Inline Editor allows the user to edit a record without making a major switch
4174
4108
  * between viewing and editing, making it an efficient method of updating a record.
4175
4109
  */
4176
- export declare const HvInlineEditor: <C extends default_2.ElementType<any, keyof default_2.JSX.IntrinsicElements> = default_2.ForwardRefExoticComponent<HvInputProps & default_2.RefAttributes<HTMLInputElement | HTMLTextAreaElement>>>(props: {
4110
+ export declare const HvInlineEditor: <C extends ElementType<any, keyof JSX_2.IntrinsicElements> = ForwardRefExoticComponent<HvInputProps & RefAttributes<HTMLInputElement | HTMLTextAreaElement>>>(props: {
4177
4111
  /** The value of the form element. */
4178
4112
  value?: string | undefined;
4179
4113
  /** The default value of the form element. */
@@ -4183,11 +4117,11 @@ export declare const HvInlineEditor: <C extends default_2.ElementType<any, keyof
4183
4117
  /** Variant of the HvTypography to display */
4184
4118
  variant?: "display" | "title1" | "title2" | "title3" | "title4" | "label" | "body" | "captionLabel" | "caption1" | "caption2" | undefined;
4185
4119
  /** Called when the input is blurred. */
4186
- onBlur?: ((event: default_2.FocusEvent<HTMLTextAreaElement | HTMLInputElement>, value: string) => void) | undefined;
4120
+ onBlur?: ((event: React.FocusEvent<HTMLTextAreaElement | HTMLInputElement>, value: string) => void) | undefined;
4187
4121
  /** Called when the input value changes. */
4188
- onChange?: ((event: default_2.SyntheticEvent, value: string) => void) | undefined;
4122
+ onChange?: ((event: React.SyntheticEvent, value: string) => void) | undefined;
4189
4123
  /** Called when there's a keydown event on the input. */
4190
- onKeyDown?: ((event: default_2.KeyboardEvent<HTMLTextAreaElement | HTMLInputElement> | default_2.MouseEvent, value: string) => void) | undefined;
4124
+ onKeyDown?: ((event: React.KeyboardEvent<HTMLTextAreaElement | HTMLInputElement> | React.MouseEvent, value: string) => void) | undefined;
4191
4125
  /** Props passed to the HvButton component */
4192
4126
  buttonProps?: HvButtonProps | undefined;
4193
4127
  /** Props passed to the HvTypography text component */
@@ -4212,14 +4146,14 @@ export declare const HvInlineEditor: <C extends default_2.ElementType<any, keyof
4212
4146
  } & {
4213
4147
  component?: C | undefined;
4214
4148
  } & {
4215
- children?: default_2.ReactNode;
4216
- } & (Omit<default_2.PropsWithoutRef<default_2.ComponentProps<C>>, "value" | "classes" | "placeholder" | "disabled" | "variant" | "component" | "onBlur" | "onChange" | "onKeyDown" | "defaultValue" | "showIcon" | "buttonProps" | "typographyProps"> extends infer T ? T extends Omit<default_2.PropsWithoutRef<default_2.ComponentProps<C>>, "value" | "classes" | "placeholder" | "disabled" | "variant" | "component" | "onBlur" | "onChange" | "onKeyDown" | "defaultValue" | "showIcon" | "buttonProps" | "typographyProps"> ? T extends any ? T : never : never : never) & {
4149
+ children?: ReactNode;
4150
+ } & (Omit<PropsWithoutRef<ComponentProps<C>>, "value" | "classes" | "placeholder" | "disabled" | "variant" | "component" | "onBlur" | "onChange" | "onKeyDown" | "defaultValue" | "showIcon" | "buttonProps" | "typographyProps"> extends infer T ? T extends Omit<PropsWithoutRef<ComponentProps<C>>, "value" | "classes" | "placeholder" | "disabled" | "variant" | "component" | "onBlur" | "onChange" | "onKeyDown" | "defaultValue" | "showIcon" | "buttonProps" | "typographyProps"> ? T extends any ? T : never : never : never) & {
4217
4151
  ref?: PolymorphicRef<C> | undefined;
4218
- } & default_2.RefAttributes<unknown>) => default_2.ReactElement<any, string | default_2.JSXElementConstructor<any>> | null;
4152
+ } & RefAttributes<unknown>) => ReactElement<any, string | JSXElementConstructor<any>> | null;
4219
4153
 
4220
4154
  export declare type HvInlineEditorClasses = ExtractNames<typeof useClasses_82>;
4221
4155
 
4222
- export declare type HvInlineEditorProps<C extends default_2.ElementType = typeof HvInput> = PolymorphicComponentRef<C, {
4156
+ export declare type HvInlineEditorProps<C extends React.ElementType = typeof HvInput> = PolymorphicComponentRef<C, {
4223
4157
  /** The value of the form element. */
4224
4158
  value?: string;
4225
4159
  /** The default value of the form element. */
@@ -4229,11 +4163,11 @@ export declare type HvInlineEditorProps<C extends default_2.ElementType = typeof
4229
4163
  /** Variant of the HvTypography to display */
4230
4164
  variant?: HvTypographyVariants;
4231
4165
  /** Called when the input is blurred. */
4232
- onBlur?: (event: default_2.FocusEvent<HTMLTextAreaElement | HTMLInputElement>, value: string) => void;
4166
+ onBlur?: (event: React.FocusEvent<HTMLTextAreaElement | HTMLInputElement>, value: string) => void;
4233
4167
  /** Called when the input value changes. */
4234
- onChange?: (event: default_2.SyntheticEvent, value: string) => void;
4168
+ onChange?: (event: React.SyntheticEvent, value: string) => void;
4235
4169
  /** Called when there's a keydown event on the input. */
4236
- onKeyDown?: (event: default_2.KeyboardEvent<HTMLTextAreaElement | HTMLInputElement> | default_2.MouseEvent, value: string) => void;
4170
+ onKeyDown?: (event: React.KeyboardEvent<HTMLTextAreaElement | HTMLInputElement> | React.MouseEvent, value: string) => void;
4237
4171
  /** Props passed to the HvButton component */
4238
4172
  buttonProps?: HvButtonProps;
4239
4173
  /** Props passed to the HvTypography text component */
@@ -4374,19 +4308,8 @@ export declare interface HvInputSuggestion {
4374
4308
  value?: string;
4375
4309
  }
4376
4310
 
4377
- declare type HvInputValidity = {
4378
- valid?: boolean;
4379
- badInput?: boolean;
4380
- customError?: boolean;
4381
- patternMismatch?: boolean;
4382
- rangeOverflow?: boolean;
4383
- rangeUnderflow?: boolean;
4384
- stepMismatch?: boolean;
4385
- tooLong?: boolean;
4386
- tooShort?: boolean;
4387
- typeMismatch?: boolean;
4388
- valueMissing?: boolean;
4389
- };
4311
+ declare interface HvInputValidity extends Partial<Mutable<ValidityState>> {
4312
+ }
4390
4313
 
4391
4314
  export declare interface HvKnobProperty {
4392
4315
  color?: string;
@@ -4811,7 +4734,7 @@ export declare interface HvOverflowTooltipProps extends HvBaseProps {
4811
4734
  * Pagination is the process of dividing a document into discrete pages. It relates to how users interact
4812
4735
  * with structured content on a website or application.
4813
4736
  */
4814
- export declare const HvPagination: default_2.ForwardRefExoticComponent<HvPaginationProps & default_2.RefAttributes<HTMLDivElement>>;
4737
+ export declare const HvPagination: ForwardRefExoticComponent<HvPaginationProps & RefAttributes<HTMLDivElement>>;
4815
4738
 
4816
4739
  export declare type HvPaginationClasses = ExtractNames<typeof useClasses_47>;
4817
4740
 
@@ -4843,9 +4766,9 @@ export declare interface HvPaginationProps extends HvBaseProps {
4843
4766
  /** An object containing all the labels for the component. */
4844
4767
  labels?: HvPaginationLabels;
4845
4768
  /** Other props to show page component. */
4846
- showPageProps?: default_2.HTMLAttributes<HTMLDivElement>;
4769
+ showPageProps?: React.HTMLAttributes<HTMLDivElement>;
4847
4770
  /** Other props to pagination component. */
4848
- navigationProps?: default_2.HTMLAttributes<HTMLDivElement>;
4771
+ navigationProps?: React.HTMLAttributes<HTMLDivElement>;
4849
4772
  /** Extra properties passed to the input component representing the current pages. */
4850
4773
  currentPageInputProps?: HvInputProps;
4851
4774
  /** A Jss Object used to override or extend the styles applied to the component. */
@@ -6626,7 +6549,7 @@ export declare interface HvTagProps extends Omit<ChipProps, "color" | "classes"
6626
6549
  /**
6627
6550
  * A tags input is a single or multiline control that allows the input of tags.
6628
6551
  */
6629
- export declare const HvTagsInput: default_2.ForwardRefExoticComponent<HvTagsInputProps & default_2.RefAttributes<HTMLUListElement>>;
6552
+ export declare const HvTagsInput: ForwardRefExoticComponent<HvTagsInputProps & RefAttributes<HTMLUListElement>>;
6630
6553
 
6631
6554
  export declare type HvTagsInputClasses = ExtractNames<typeof useClasses_114>;
6632
6555
 
@@ -6636,15 +6559,15 @@ export declare interface HvTagsInputProps extends Omit<HvInputProps, "onChange"
6636
6559
  /** When uncontrolled, defines the initial input value. */
6637
6560
  defaultValue?: string[] | HvTagProps[];
6638
6561
  /** The function that will be executed onChange. */
6639
- onChange?: (event: default_2.KeyboardEvent<HTMLInputElement | HTMLTextAreaElement> | default_2.MouseEvent | default_2.KeyboardEvent<HTMLUListElement> | default_2.FocusEvent<HTMLDivElement>, value: HvTagProps[]) => void;
6562
+ onChange?: (event: React.KeyboardEvent<HTMLInputElement | HTMLTextAreaElement> | React.MouseEvent | React.KeyboardEvent<HTMLUListElement> | React.FocusEvent<HTMLDivElement>, value: HvTagProps[]) => void;
6640
6563
  /** The function that will be executed when the element is focused. */
6641
- onFocus?: (event: default_2.FocusEvent<HTMLDivElement>, value: string) => void;
6564
+ onFocus?: (event: React.FocusEvent<HTMLDivElement>, value: string) => void;
6642
6565
  /** The function that will be executed when the element is blurred. */
6643
- onBlur?: (event: default_2.FocusEvent<HTMLDivElement>, value: string) => void;
6566
+ onBlur?: (event: React.FocusEvent<HTMLDivElement>, value: string) => void;
6644
6567
  /** The function that will be executed when a tag is deleted. */
6645
- onDelete?: (event: default_2.KeyboardEvent<HTMLUListElement> | default_2.MouseEvent<HTMLElement>, value: HvTagProps, index: number) => void;
6568
+ onDelete?: (event: React.KeyboardEvent<HTMLUListElement> | React.MouseEvent<HTMLElement>, value: HvTagProps, index: number) => void;
6646
6569
  /** The function that will be executed when a tag is added. */
6647
- onAdd?: (event: default_2.KeyboardEvent<HTMLInputElement | HTMLTextAreaElement> | default_2.MouseEvent | default_2.KeyboardEvent<HTMLUListElement> | default_2.FocusEvent<HTMLDivElement>, value: HvTagProps, index: number) => void;
6570
+ onAdd?: (event: React.KeyboardEvent<HTMLInputElement | HTMLTextAreaElement> | React.MouseEvent | React.KeyboardEvent<HTMLUListElement> | React.FocusEvent<HTMLDivElement>, value: HvTagProps, index: number) => void;
6648
6571
  /** If `true` the character counter isn't shown even if maxTagsQuantity is set. */
6649
6572
  hideCounter?: boolean;
6650
6573
  /** Text between the current char counter and max value. */
@@ -7583,15 +7506,11 @@ declare type InputElement = HTMLInputElement | HTMLTextAreaElement;
7583
7506
 
7584
7507
  export declare const isBrowser: (browsers: string | string[]) => boolean | null;
7585
7508
 
7586
- export declare const isInvalid: (compareState: HvFormStatus) => boolean;
7587
-
7588
7509
  /** Check whether a keyboard `event` is pressing the `keyCode` key. */
7589
7510
  export declare const isKey: (event: any, keyCode: Key) => boolean;
7590
7511
 
7591
7512
  export declare const isOneOfKeys: (event: any, keys: Key[]) => boolean;
7592
7513
 
7593
- export declare const isValid: (compareState: HvFormStatus) => boolean;
7594
-
7595
7514
  declare type Key = keyof typeof keyboardCodes;
7596
7515
 
7597
7516
  /** Map of keys to key `code` @see https://mdn.io/event/code */
@@ -7717,6 +7636,10 @@ export declare const multiButtonClasses: {
7717
7636
 
7718
7637
  export declare const multiSelectionEventHandler: (evt: any, index: number, selectionAnchor: any, allValues: any[], selectedState: boolean[], selectionCheck: any) => any[];
7719
7638
 
7639
+ declare type Mutable<T> = {
7640
+ -readonly [P in keyof T]: T[P];
7641
+ };
7642
+
7720
7643
  export declare type NavigationData<T extends React.ElementType = "a"> = React.ComponentProps<T> & Record<string, any> & {
7721
7644
  /** The id to be applied to the root element. */
7722
7645
  id: string;
@@ -10641,7 +10564,7 @@ export declare const useImageLoaded: (src?: string, srcSet?: string) => string |
10641
10564
 
10642
10565
  export declare function useInstance(instance: any): void;
10643
10566
 
10644
- export declare const useIsMounted: () => default_2.MutableRefObject<boolean>;
10567
+ export declare const useIsMounted: () => MutableRefObject<boolean>;
10645
10568
 
10646
10569
  export declare function useLabels<T>(defaultLabels: T, labels?: DeepPartial<T>): T;
10647
10570
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hitachivantara/uikit-react-core",
3
- "version": "5.82.2",
3
+ "version": "5.82.4",
4
4
  "private": false,
5
5
  "author": "Hitachi Vantara UI Kit Team",
6
6
  "description": "Core React components for the NEXT Design System.",
@@ -32,10 +32,10 @@
32
32
  "dependencies": {
33
33
  "@emotion/cache": "^11.11.0",
34
34
  "@emotion/serialize": "^1.1.2",
35
- "@hitachivantara/uikit-react-icons": "^5.13.0",
36
- "@hitachivantara/uikit-react-shared": "^5.3.16",
37
- "@hitachivantara/uikit-react-utils": "^0.2.17",
38
- "@hitachivantara/uikit-styles": "^5.40.2",
35
+ "@hitachivantara/uikit-react-icons": "^5.13.1",
36
+ "@hitachivantara/uikit-react-shared": "^5.3.17",
37
+ "@hitachivantara/uikit-react-utils": "^0.2.18",
38
+ "@hitachivantara/uikit-styles": "^5.40.3",
39
39
  "@internationalized/date": "^3.2.0",
40
40
  "@mui/base": "^5.0.0-beta.40",
41
41
  "@popperjs/core": "^2.11.8",
@@ -62,7 +62,7 @@
62
62
  "access": "public",
63
63
  "directory": "package"
64
64
  },
65
- "gitHead": "f1db991219c602f6970de5b2ca3bec1b0a395694",
65
+ "gitHead": "6a098fbf98283ef8dc3d57e8cf167e0499af837c",
66
66
  "exports": {
67
67
  ".": {
68
68
  "types": "./dist/types/index.d.ts",
@@ -1,44 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const jsxRuntime = require("react/jsx-runtime");
4
- const React = require("react");
5
- const uikitReactUtils = require("@hitachivantara/uikit-react-utils");
6
- const useUniqueId = require("../../hooks/useUniqueId.cjs");
7
- const FormElementContext = require("./context/FormElementContext.cjs");
8
- const FormElementDescriptorsContext = require("./context/FormElementDescriptorsContext.cjs");
9
- const FormElementValueContext = require("./context/FormElementValueContext.cjs");
10
- const FormElement_styles = require("./FormElement.styles.cjs");
11
- const FormUtils = require("./utils/FormUtils.cjs");
12
- const HvFormElement = (props) => {
13
- const {
14
- classes: classesProp,
15
- className,
16
- children,
17
- id,
18
- name,
19
- value,
20
- disabled = false,
21
- required = false,
22
- readOnly = false,
23
- status = "standBy",
24
- ...others
25
- } = uikitReactUtils.useDefaultProps("HvFormElement", props);
26
- const { classes, cx } = FormElement_styles.useClasses(classesProp);
27
- const elementId = useUniqueId.useUniqueId(id);
28
- const contextValue = React.useMemo(
29
- () => ({
30
- elementId,
31
- elementName: name,
32
- elementStatus: status,
33
- elementDisabled: disabled,
34
- elementRequired: required,
35
- elementReadOnly: readOnly
36
- }),
37
- [disabled, elementId, name, readOnly, required, status]
38
- );
39
- const descriptors = React.useMemo(() => FormUtils.findDescriptors(children), [children]);
40
- return /* @__PURE__ */ jsxRuntime.jsx("div", { id, className: cx(classes.root, className), ...others, children: /* @__PURE__ */ jsxRuntime.jsx(FormElementContext.HvFormElementContextProvider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsx(FormElementValueContext.HvFormElementValueContextProvider, { value, children: /* @__PURE__ */ jsxRuntime.jsx(FormElementDescriptorsContext.HvFormElementDescriptorsContextProvider, { value: descriptors, children }) }) }) });
41
- };
42
- HvFormElement.formElementType = "formelement";
43
- exports.formElementClasses = FormElement_styles.staticClasses;
44
- exports.HvFormElement = HvFormElement;
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
- const React = require("react");
4
- const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
5
- const React__default = /* @__PURE__ */ _interopDefault(React);
6
- const HvFormElementContext = React__default.default.createContext({});
7
- const HvFormElementContextProvider = HvFormElementContext.Provider;
8
- const HvFormElementContextConsumer = HvFormElementContext.Consumer;
9
- exports.HvFormElementContext = HvFormElementContext;
10
- exports.HvFormElementContextConsumer = HvFormElementContextConsumer;
11
- exports.HvFormElementContextProvider = HvFormElementContextProvider;
12
- exports.default = HvFormElementContext;
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
- const React = require("react");
4
- const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
5
- const React__default = /* @__PURE__ */ _interopDefault(React);
6
- const HvFormElementDescriptorsContext = React__default.default.createContext({});
7
- const HvFormElementDescriptorsContextProvider = HvFormElementDescriptorsContext.Provider;
8
- const HvFormElementDescriptorsContextConsumer = HvFormElementDescriptorsContext.Consumer;
9
- exports.HvFormElementDescriptorsContext = HvFormElementDescriptorsContext;
10
- exports.HvFormElementDescriptorsContextConsumer = HvFormElementDescriptorsContextConsumer;
11
- exports.HvFormElementDescriptorsContextProvider = HvFormElementDescriptorsContextProvider;
12
- exports.default = HvFormElementDescriptorsContext;
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
- const React = require("react");
4
- const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
5
- const React__default = /* @__PURE__ */ _interopDefault(React);
6
- const HvFormElementValueContext = React__default.default.createContext(void 0);
7
- const HvFormElementValueContextProvider = HvFormElementValueContext.Provider;
8
- const HvFormElementValueContextConsumer = HvFormElementValueContext.Consumer;
9
- exports.HvFormElementValueContext = HvFormElementValueContext;
10
- exports.HvFormElementValueContextConsumer = HvFormElementValueContextConsumer;
11
- exports.HvFormElementValueContextProvider = HvFormElementValueContextProvider;
12
- exports.default = HvFormElementValueContext;
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
- const validationState = Object.freeze({
4
- standBy: "standBy",
5
- valid: "valid",
6
- invalid: "invalid"
7
- });
8
- const isValid = (compareState) => compareState === validationState.valid;
9
- const isInvalid = (compareState) => compareState === validationState.invalid;
10
- exports.default = validationState;
11
- exports.isInvalid = isInvalid;
12
- exports.isValid = isValid;
@@ -1 +0,0 @@
1
- {"version":3,"file":"Adornment.js","sources":["../../../../src/Forms/Adornment/Adornment.tsx"],"sourcesContent":["import { forwardRef, useContext } from \"react\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvButtonBase } from \"../../ButtonBase\";\nimport { HvBaseProps } from \"../../types/generic\";\nimport {\n HvFormElementContext,\n HvFormElementDescriptorsContext,\n HvFormStatus,\n} from \"../FormElement\";\nimport { staticClasses, useClasses } from \"./Adornment.styles\";\n\nconst noop = () => {};\n\nexport { staticClasses as adornmentClasses };\n\nexport type HvAdornmentClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvAdornmentProps\n extends HvBaseProps<\n HTMLDivElement | HTMLButtonElement,\n \"onMouseDown\" | \"onKeyDown\"\n > {\n /** The icon to be added into the input. */\n icon: React.ReactNode;\n /** When the adornment should be displayed. */\n showWhen?: HvFormStatus;\n /** Function to be executed when this element is clicked. */\n onClick?: React.MouseEventHandler<HTMLButtonElement>;\n /** If this property is defined the adornment visibility will be exclusively controlled by this value. */\n isVisible?: boolean;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvAdornmentClasses;\n}\n\n/**\n * Allows to add a decorative icon or an action to a form element, usually on the right side of an input.\n * E.g., the reveal password button.\n *\n * In addition to the showWhen feature, which uses the form element's context validation state to determine\n * its visibility, this component also ensures that it does not steal focus from the input and that it is\n * not accessible using the keyboard.\n *\n * As such, its functionality, if any, for accessibility purposes must be provided through an alternative mean,\n * or by using a regular icon button or toggle button instead.\n */\nexport const HvAdornment = forwardRef<\n HTMLDivElement | HTMLButtonElement,\n HvAdornmentProps\n>((props, ref) => {\n const {\n id,\n classes: classesProp,\n className,\n icon,\n showWhen = undefined,\n onClick,\n isVisible = undefined,\n ...others\n } = useDefaultProps(\"HvAdornment\", props);\n const { classes, cx } = useClasses(classesProp);\n\n const { elementStatus = \"\", elementDisabled } =\n useContext(HvFormElementContext);\n\n const { input } = useContext(HvFormElementDescriptorsContext);\n\n const displayIcon =\n isVisible ?? (showWhen === undefined || elementStatus === showWhen);\n\n const isClickable = !!onClick;\n\n return isClickable ? (\n <HvButtonBase\n id={id}\n focusableWhenDisabled\n ref={ref as React.ForwardedRef<HTMLButtonElement>}\n type=\"button\"\n tabIndex={-1}\n aria-controls={input?.[0]?.id}\n className={cx(\n classes.root,\n classes.adornment,\n classes.adornmentButton,\n {\n [classes.hideIcon]: !displayIcon,\n [classes.disabled]: elementDisabled,\n },\n className,\n )}\n onClick={onClick}\n onMouseDown={(event) => event.preventDefault()}\n onKeyDown={noop}\n disabled={elementDisabled}\n {...others}\n >\n <div className={classes.icon}>{icon}</div>\n </HvButtonBase>\n ) : (\n <div\n id={id}\n ref={ref as React.ForwardedRef<HTMLDivElement>}\n className={cx(\n classes.root,\n classes.adornment,\n classes.adornmentIcon,\n {\n [classes.hideIcon]: !displayIcon,\n [classes.disabled]: elementDisabled,\n },\n className,\n )}\n role=\"presentation\"\n {...others}\n >\n <div className={classes.icon}>{icon}</div>\n </div>\n );\n});\n"],"names":[],"mappings":";;;;;;;;AAeA,MAAM,OAAO,MAAM;AAAC;AAkCb,MAAM,cAAc,WAGzB,CAAC,OAAO,QAAQ;AACV,QAAA;AAAA,IACJ;AAAA,IACA,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX;AAAA,IACA,YAAY;AAAA,IACZ,GAAG;AAAA,EAAA,IACD,gBAAgB,eAAe,KAAK;AACxC,QAAM,EAAE,SAAS,OAAO,WAAW,WAAW;AAE9C,QAAM,EAAE,gBAAgB,IAAI,gBAAgB,IAC1C,WAAW,oBAAoB;AAEjC,QAAM,EAAE,MAAA,IAAU,WAAW,+BAA+B;AAE5D,QAAM,cACJ,cAAc,aAAa,UAAa,kBAAkB;AAEtD,QAAA,cAAc,CAAC,CAAC;AAEtB,SAAO,cACL;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA,uBAAqB;AAAA,MACrB;AAAA,MACA,MAAK;AAAA,MACL,UAAU;AAAA,MACV,iBAAe,QAAQ,CAAC,GAAG;AAAA,MAC3B,WAAW;AAAA,QACT,QAAQ;AAAA,QACR,QAAQ;AAAA,QACR,QAAQ;AAAA,QACR;AAAA,UACE,CAAC,QAAQ,QAAQ,GAAG,CAAC;AAAA,UACrB,CAAC,QAAQ,QAAQ,GAAG;AAAA,QACtB;AAAA,QACA;AAAA,MACF;AAAA,MACA;AAAA,MACA,aAAa,CAAC,UAAU,MAAM,eAAe;AAAA,MAC7C,WAAW;AAAA,MACX,UAAU;AAAA,MACT,GAAG;AAAA,MAEJ,UAAC,oBAAA,OAAA,EAAI,WAAW,QAAQ,MAAO,UAAK,KAAA,CAAA;AAAA,IAAA;AAAA,EAAA,IAGtC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,WAAW;AAAA,QACT,QAAQ;AAAA,QACR,QAAQ;AAAA,QACR,QAAQ;AAAA,QACR;AAAA,UACE,CAAC,QAAQ,QAAQ,GAAG,CAAC;AAAA,UACrB,CAAC,QAAQ,QAAQ,GAAG;AAAA,QACtB;AAAA,QACA;AAAA,MACF;AAAA,MACA,MAAK;AAAA,MACJ,GAAG;AAAA,MAEJ,UAAC,oBAAA,OAAA,EAAI,WAAW,QAAQ,MAAO,UAAK,KAAA,CAAA;AAAA,IAAA;AAAA,EACtC;AAEJ,CAAC;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Adornment.styles.js","sources":["../../../../src/Forms/Adornment/Adornment.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(\"HvAdornment\", {\n root: {},\n icon: { width: 32, height: 32 },\n adornment: {\n backgroundColor: \"transparent\",\n border: \"none\",\n padding: 0,\n margin: 0,\n },\n adornmentIcon: { cursor: \"default\", pointerEvents: \"none\" },\n hideIcon: { display: \"none\" },\n adornmentButton: {\n cursor: \"pointer\",\n \"&:focus\": {\n ...outlineStyles,\n },\n },\n disabled: {\n \"&$adornmentButton\": { cursor: \"not-allowed\" },\n \"&$adornmentIcon\": { cursor: \"not-allowed\" },\n \"& svg *.color0\": { fill: theme.colors.secondary_60 },\n },\n});\n"],"names":[],"mappings":";;;AAKO,MAAM,EAAE,eAAe,eAAe,cAAc,eAAe;AAAA,EACxE,MAAM,CAAC;AAAA,EACP,MAAM,EAAE,OAAO,IAAI,QAAQ,GAAG;AAAA,EAC9B,WAAW;AAAA,IACT,iBAAiB;AAAA,IACjB,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,QAAQ;AAAA,EACV;AAAA,EACA,eAAe,EAAE,QAAQ,WAAW,eAAe,OAAO;AAAA,EAC1D,UAAU,EAAE,SAAS,OAAO;AAAA,EAC5B,iBAAiB;AAAA,IACf,QAAQ;AAAA,IACR,WAAW;AAAA,MACT,GAAG;AAAA,IAAA;AAAA,EAEP;AAAA,EACA,UAAU;AAAA,IACR,qBAAqB,EAAE,QAAQ,cAAc;AAAA,IAC7C,mBAAmB,EAAE,QAAQ,cAAc;AAAA,IAC3C,kBAAkB,EAAE,MAAM,MAAM,OAAO,aAAa;AAAA,EAAA;AAExD,CAAC;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"CharCounter.js","sources":["../../../../src/Forms/CharCounter/CharCounter.tsx"],"sourcesContent":["import { useContext } from \"react\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvBaseProps } from \"../../types/generic\";\nimport { HvTypography } from \"../../Typography\";\nimport { setId } from \"../../utils/setId\";\nimport { HvFormElementContext } from \"../FormElement\";\nimport { staticClasses, useClasses } from \"./CharCounter.styles\";\n\nexport { staticClasses as charCounterClasses };\n\nexport type HvCharCounterClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvCharCounterProps extends HvBaseProps {\n /** The string that separates the current char quantity from the max quantity. */\n separator?: string;\n /** The maximum allowed length of the characters. */\n maxCharQuantity: number;\n /** The current char quantity to be rendered. */\n currentCharQuantity?: number;\n /** If `true` the counter is disabled. */\n disabled?: boolean;\n /** If `true` the info message won't have margins. */\n disableGutter?: boolean;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvCharCounterClasses;\n}\n\n/**\n * Displays the capacity and current usage of a text input box (character count by default).\n *\n * Use the character counter when there is a character or word limit.\n * By itself it doesn't block the user from going above the limit.\n */\nexport const HvCharCounter = (props: HvCharCounterProps) => {\n const {\n separator = \"/\",\n maxCharQuantity,\n currentCharQuantity = 0,\n classes: classesProp,\n className,\n id,\n disabled,\n disableGutter = false,\n ...others\n } = useDefaultProps(\"HvCharCounter\", props);\n\n const { classes, cx } = useClasses(classesProp);\n\n const { elementId, elementDisabled } = useContext(HvFormElementContext);\n const localDisabled = disabled || elementDisabled;\n const localId = id ?? setId(elementId, \"counter\");\n const currentId = setId(localId, \"currentQuantity\");\n const maxQuantityId = setId(localId, \"maxQuantity\");\n const isOverloaded = currentCharQuantity > maxCharQuantity;\n\n return (\n <div\n id={localId}\n className={cx(\n classes.root,\n {\n [classes.counterDisabled]: !!localDisabled,\n [classes.gutter]: !disableGutter,\n },\n className,\n )}\n aria-live=\"polite\"\n aria-disabled={localDisabled}\n {...others}\n >\n <HvTypography\n id={currentId}\n className={cx({\n [classes.overloaded]: isOverloaded && !localDisabled,\n [classes.counterDisabled]: !!localDisabled,\n })}\n variant=\"label\"\n component=\"label\"\n >\n {currentCharQuantity}\n </HvTypography>\n <HvTypography\n id={maxQuantityId}\n className={cx({\n [classes.overloaded]: isOverloaded && !localDisabled,\n [classes.counterDisabled]: !!localDisabled,\n })}\n variant=\"body\"\n component=\"label\"\n >\n {` ${separator} ${maxCharQuantity}`}\n </HvTypography>\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;;AAqCa,MAAA,gBAAgB,CAAC,UAA8B;AACpD,QAAA;AAAA,IACJ,YAAY;AAAA,IACZ;AAAA,IACA,sBAAsB;AAAA,IACtB,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,IACA,gBAAgB;AAAA,IAChB,GAAG;AAAA,EAAA,IACD,gBAAgB,iBAAiB,KAAK;AAE1C,QAAM,EAAE,SAAS,OAAO,WAAW,WAAW;AAE9C,QAAM,EAAE,WAAW,oBAAoB,WAAW,oBAAoB;AACtE,QAAM,gBAAgB,YAAY;AAClC,QAAM,UAAU,MAAM,MAAM,WAAW,SAAS;AAC1C,QAAA,YAAY,MAAM,SAAS,iBAAiB;AAC5C,QAAA,gBAAgB,MAAM,SAAS,aAAa;AAClD,QAAM,eAAe,sBAAsB;AAGzC,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,IAAI;AAAA,MACJ,WAAW;AAAA,QACT,QAAQ;AAAA,QACR;AAAA,UACE,CAAC,QAAQ,eAAe,GAAG,CAAC,CAAC;AAAA,UAC7B,CAAC,QAAQ,MAAM,GAAG,CAAC;AAAA,QACrB;AAAA,QACA;AAAA,MACF;AAAA,MACA,aAAU;AAAA,MACV,iBAAe;AAAA,MACd,GAAG;AAAA,MAEJ,UAAA;AAAA,QAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,IAAI;AAAA,YACJ,WAAW,GAAG;AAAA,cACZ,CAAC,QAAQ,UAAU,GAAG,gBAAgB,CAAC;AAAA,cACvC,CAAC,QAAQ,eAAe,GAAG,CAAC,CAAC;AAAA,YAAA,CAC9B;AAAA,YACD,SAAQ;AAAA,YACR,WAAU;AAAA,YAET,UAAA;AAAA,UAAA;AAAA,QACH;AAAA,QACA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,IAAI;AAAA,YACJ,WAAW,GAAG;AAAA,cACZ,CAAC,QAAQ,UAAU,GAAG,gBAAgB,CAAC;AAAA,cACvC,CAAC,QAAQ,eAAe,GAAG,CAAC,CAAC;AAAA,YAAA,CAC9B;AAAA,YACD,SAAQ;AAAA,YACR,WAAU;AAAA,YAET,UAAA,IAAI,SAAS,IAAI,eAAe;AAAA,UAAA;AAAA,QAAA;AAAA,MACnC;AAAA,IAAA;AAAA,EACF;AAEJ;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"CharCounter.styles.js","sources":["../../../../src/Forms/CharCounter/CharCounter.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvCharCounter\", {\n root: { display: \"inline-block\", float: \"right\" },\n counterDisabled: { color: theme.colors.secondary_60 },\n gutter: { paddingLeft: \"6px\" },\n overloaded: { color: theme.colors.negative },\n});\n"],"names":[],"mappings":";;AAGO,MAAM,EAAE,eAAe,eAAe,cAAc,iBAAiB;AAAA,EAC1E,MAAM,EAAE,SAAS,gBAAgB,OAAO,QAAQ;AAAA,EAChD,iBAAiB,EAAE,OAAO,MAAM,OAAO,aAAa;AAAA,EACpD,QAAQ,EAAE,aAAa,MAAM;AAAA,EAC7B,YAAY,EAAE,OAAO,MAAM,OAAO,SAAS;AAC7C,CAAC;"}
@@ -1,45 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { useMemo } from "react";
3
- import { useDefaultProps } from "@hitachivantara/uikit-react-utils";
4
- import { useUniqueId } from "../../hooks/useUniqueId.js";
5
- import { HvFormElementContextProvider } from "./context/FormElementContext.js";
6
- import { HvFormElementDescriptorsContextProvider } from "./context/FormElementDescriptorsContext.js";
7
- import { HvFormElementValueContextProvider } from "./context/FormElementValueContext.js";
8
- import { useClasses } from "./FormElement.styles.js";
9
- import { staticClasses } from "./FormElement.styles.js";
10
- import { findDescriptors } from "./utils/FormUtils.js";
11
- const HvFormElement = (props) => {
12
- const {
13
- classes: classesProp,
14
- className,
15
- children,
16
- id,
17
- name,
18
- value,
19
- disabled = false,
20
- required = false,
21
- readOnly = false,
22
- status = "standBy",
23
- ...others
24
- } = useDefaultProps("HvFormElement", props);
25
- const { classes, cx } = useClasses(classesProp);
26
- const elementId = useUniqueId(id);
27
- const contextValue = useMemo(
28
- () => ({
29
- elementId,
30
- elementName: name,
31
- elementStatus: status,
32
- elementDisabled: disabled,
33
- elementRequired: required,
34
- elementReadOnly: readOnly
35
- }),
36
- [disabled, elementId, name, readOnly, required, status]
37
- );
38
- const descriptors = useMemo(() => findDescriptors(children), [children]);
39
- return /* @__PURE__ */ jsx("div", { id, className: cx(classes.root, className), ...others, children: /* @__PURE__ */ jsx(HvFormElementContextProvider, { value: contextValue, children: /* @__PURE__ */ jsx(HvFormElementValueContextProvider, { value, children: /* @__PURE__ */ jsx(HvFormElementDescriptorsContextProvider, { value: descriptors, children }) }) }) });
40
- };
41
- HvFormElement.formElementType = "formelement";
42
- export {
43
- HvFormElement,
44
- staticClasses as formElementClasses
45
- };