@hitachivantara/uikit-react-core 5.3.0 → 5.5.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 (122) hide show
  1. package/dist/cjs/components/Dialog/Dialog.cjs +1 -1
  2. package/dist/cjs/components/Dialog/Dialog.cjs.map +1 -1
  3. package/dist/cjs/components/Dialog/Dialog.styles.cjs +3 -3
  4. package/dist/cjs/components/Dialog/Dialog.styles.cjs.map +1 -1
  5. package/dist/cjs/components/Forms/Suggestions/Suggestions.styles.cjs +4 -4
  6. package/dist/cjs/components/Forms/Suggestions/Suggestions.styles.cjs.map +1 -1
  7. package/dist/cjs/components/InlineEditor/InlineEditor.cjs +122 -0
  8. package/dist/cjs/components/InlineEditor/InlineEditor.cjs.map +1 -0
  9. package/dist/cjs/components/InlineEditor/InlineEditor.styles.cjs +74 -0
  10. package/dist/cjs/components/InlineEditor/InlineEditor.styles.cjs.map +1 -0
  11. package/dist/cjs/components/InlineEditor/inlineEditorClasses.cjs +8 -0
  12. package/dist/cjs/components/InlineEditor/inlineEditorClasses.cjs.map +1 -0
  13. package/dist/cjs/components/ScrollTo/Horizontal/HorizontalScrollListItem/HorizontalScrollListItem.cjs +51 -0
  14. package/dist/cjs/components/ScrollTo/Horizontal/HorizontalScrollListItem/HorizontalScrollListItem.cjs.map +1 -0
  15. package/dist/cjs/components/ScrollTo/Horizontal/HorizontalScrollListItem/HorizontalScrollListItem.styles.cjs +54 -0
  16. package/dist/cjs/components/ScrollTo/Horizontal/HorizontalScrollListItem/HorizontalScrollListItem.styles.cjs.map +1 -0
  17. package/dist/cjs/components/ScrollTo/Horizontal/HorizontalScrollListItem/horizontalScrollListItemClasses.cjs +8 -0
  18. package/dist/cjs/components/ScrollTo/Horizontal/HorizontalScrollListItem/horizontalScrollListItemClasses.cjs.map +1 -0
  19. package/dist/cjs/components/ScrollTo/Horizontal/ScrollToHorizontal.cjs +126 -0
  20. package/dist/cjs/components/ScrollTo/Horizontal/ScrollToHorizontal.cjs.map +1 -0
  21. package/dist/cjs/components/ScrollTo/Horizontal/ScrollToHorizontal.styles.cjs +46 -0
  22. package/dist/cjs/components/ScrollTo/Horizontal/ScrollToHorizontal.styles.cjs.map +1 -0
  23. package/dist/cjs/components/ScrollTo/Horizontal/scrollToHorizontalClasses.cjs +8 -0
  24. package/dist/cjs/components/ScrollTo/Horizontal/scrollToHorizontalClasses.cjs.map +1 -0
  25. package/dist/cjs/components/ScrollTo/Vertical/ScrollToVertical.cjs +90 -0
  26. package/dist/cjs/components/ScrollTo/Vertical/ScrollToVertical.cjs.map +1 -0
  27. package/dist/cjs/components/ScrollTo/Vertical/ScrollToVertical.styles.cjs +43 -0
  28. package/dist/cjs/components/ScrollTo/Vertical/ScrollToVertical.styles.cjs.map +1 -0
  29. package/dist/cjs/components/ScrollTo/Vertical/VerticalScrollListItem/VerticalScrollListItem.cjs +71 -0
  30. package/dist/cjs/components/ScrollTo/Vertical/VerticalScrollListItem/VerticalScrollListItem.cjs.map +1 -0
  31. package/dist/cjs/components/ScrollTo/Vertical/VerticalScrollListItem/VerticalScrollListItem.styles.cjs +54 -0
  32. package/dist/cjs/components/ScrollTo/Vertical/VerticalScrollListItem/VerticalScrollListItem.styles.cjs.map +1 -0
  33. package/dist/cjs/components/ScrollTo/Vertical/VerticalScrollListItem/verticalScrollListItemClasses.cjs +8 -0
  34. package/dist/cjs/components/ScrollTo/Vertical/VerticalScrollListItem/verticalScrollListItemClasses.cjs.map +1 -0
  35. package/dist/cjs/components/ScrollTo/Vertical/scrollToVerticalClasses.cjs +8 -0
  36. package/dist/cjs/components/ScrollTo/Vertical/scrollToVerticalClasses.cjs.map +1 -0
  37. package/dist/cjs/components/ScrollTo/useScrollTo.cjs +103 -0
  38. package/dist/cjs/components/ScrollTo/useScrollTo.cjs.map +1 -0
  39. package/dist/cjs/components/ScrollTo/utils.cjs +76 -0
  40. package/dist/cjs/components/ScrollTo/utils.cjs.map +1 -0
  41. package/dist/cjs/components/ScrollTo/withTooltip.cjs +20 -0
  42. package/dist/cjs/components/ScrollTo/withTooltip.cjs.map +1 -0
  43. package/dist/cjs/components/TimeAgo/TimeAgo.cjs +39 -0
  44. package/dist/cjs/components/TimeAgo/TimeAgo.cjs.map +1 -0
  45. package/dist/cjs/components/TimeAgo/formatUtils.cjs +134 -0
  46. package/dist/cjs/components/TimeAgo/formatUtils.cjs.map +1 -0
  47. package/dist/cjs/components/TimeAgo/timeAgoClasses.cjs +8 -0
  48. package/dist/cjs/components/TimeAgo/timeAgoClasses.cjs.map +1 -0
  49. package/dist/cjs/components/TimeAgo/useTimeAgo.cjs +29 -0
  50. package/dist/cjs/components/TimeAgo/useTimeAgo.cjs.map +1 -0
  51. package/dist/cjs/components/TimeAgo/useTimeout.cjs +17 -0
  52. package/dist/cjs/components/TimeAgo/useTimeout.cjs.map +1 -0
  53. package/dist/cjs/hocs/withTooltip.cjs +4 -4
  54. package/dist/cjs/hocs/withTooltip.cjs.map +1 -1
  55. package/dist/cjs/index.cjs +23 -0
  56. package/dist/cjs/index.cjs.map +1 -1
  57. package/dist/cjs/utils/theme.cjs +9 -0
  58. package/dist/cjs/utils/theme.cjs.map +1 -1
  59. package/dist/cjs/utils/wrapperTooltip.cjs +1 -1
  60. package/dist/cjs/utils/wrapperTooltip.cjs.map +1 -1
  61. package/dist/esm/components/Dialog/Dialog.js +2 -2
  62. package/dist/esm/components/Dialog/Dialog.js.map +1 -1
  63. package/dist/esm/components/Dialog/Dialog.styles.js +3 -3
  64. package/dist/esm/components/Dialog/Dialog.styles.js.map +1 -1
  65. package/dist/esm/components/Forms/Suggestions/Suggestions.styles.js +5 -5
  66. package/dist/esm/components/Forms/Suggestions/Suggestions.styles.js.map +1 -1
  67. package/dist/esm/components/InlineEditor/InlineEditor.js +122 -0
  68. package/dist/esm/components/InlineEditor/InlineEditor.js.map +1 -0
  69. package/dist/esm/components/InlineEditor/InlineEditor.styles.js +74 -0
  70. package/dist/esm/components/InlineEditor/InlineEditor.styles.js.map +1 -0
  71. package/dist/esm/components/InlineEditor/inlineEditorClasses.js +8 -0
  72. package/dist/esm/components/InlineEditor/inlineEditorClasses.js.map +1 -0
  73. package/dist/esm/components/ScrollTo/Horizontal/HorizontalScrollListItem/HorizontalScrollListItem.js +51 -0
  74. package/dist/esm/components/ScrollTo/Horizontal/HorizontalScrollListItem/HorizontalScrollListItem.js.map +1 -0
  75. package/dist/esm/components/ScrollTo/Horizontal/HorizontalScrollListItem/HorizontalScrollListItem.styles.js +54 -0
  76. package/dist/esm/components/ScrollTo/Horizontal/HorizontalScrollListItem/HorizontalScrollListItem.styles.js.map +1 -0
  77. package/dist/esm/components/ScrollTo/Horizontal/HorizontalScrollListItem/horizontalScrollListItemClasses.js +8 -0
  78. package/dist/esm/components/ScrollTo/Horizontal/HorizontalScrollListItem/horizontalScrollListItemClasses.js.map +1 -0
  79. package/dist/esm/components/ScrollTo/Horizontal/ScrollToHorizontal.js +126 -0
  80. package/dist/esm/components/ScrollTo/Horizontal/ScrollToHorizontal.js.map +1 -0
  81. package/dist/esm/components/ScrollTo/Horizontal/ScrollToHorizontal.styles.js +46 -0
  82. package/dist/esm/components/ScrollTo/Horizontal/ScrollToHorizontal.styles.js.map +1 -0
  83. package/dist/esm/components/ScrollTo/Horizontal/scrollToHorizontalClasses.js +8 -0
  84. package/dist/esm/components/ScrollTo/Horizontal/scrollToHorizontalClasses.js.map +1 -0
  85. package/dist/esm/components/ScrollTo/Vertical/ScrollToVertical.js +90 -0
  86. package/dist/esm/components/ScrollTo/Vertical/ScrollToVertical.js.map +1 -0
  87. package/dist/esm/components/ScrollTo/Vertical/ScrollToVertical.styles.js +43 -0
  88. package/dist/esm/components/ScrollTo/Vertical/ScrollToVertical.styles.js.map +1 -0
  89. package/dist/esm/components/ScrollTo/Vertical/VerticalScrollListItem/VerticalScrollListItem.js +71 -0
  90. package/dist/esm/components/ScrollTo/Vertical/VerticalScrollListItem/VerticalScrollListItem.js.map +1 -0
  91. package/dist/esm/components/ScrollTo/Vertical/VerticalScrollListItem/VerticalScrollListItem.styles.js +54 -0
  92. package/dist/esm/components/ScrollTo/Vertical/VerticalScrollListItem/VerticalScrollListItem.styles.js.map +1 -0
  93. package/dist/esm/components/ScrollTo/Vertical/VerticalScrollListItem/verticalScrollListItemClasses.js +8 -0
  94. package/dist/esm/components/ScrollTo/Vertical/VerticalScrollListItem/verticalScrollListItemClasses.js.map +1 -0
  95. package/dist/esm/components/ScrollTo/Vertical/scrollToVerticalClasses.js +8 -0
  96. package/dist/esm/components/ScrollTo/Vertical/scrollToVerticalClasses.js.map +1 -0
  97. package/dist/esm/components/ScrollTo/useScrollTo.js +103 -0
  98. package/dist/esm/components/ScrollTo/useScrollTo.js.map +1 -0
  99. package/dist/esm/components/ScrollTo/utils.js +76 -0
  100. package/dist/esm/components/ScrollTo/utils.js.map +1 -0
  101. package/dist/esm/components/ScrollTo/withTooltip.js +20 -0
  102. package/dist/esm/components/ScrollTo/withTooltip.js.map +1 -0
  103. package/dist/esm/components/TimeAgo/TimeAgo.js +37 -0
  104. package/dist/esm/components/TimeAgo/TimeAgo.js.map +1 -0
  105. package/dist/esm/components/TimeAgo/formatUtils.js +126 -0
  106. package/dist/esm/components/TimeAgo/formatUtils.js.map +1 -0
  107. package/dist/esm/components/TimeAgo/timeAgoClasses.js +8 -0
  108. package/dist/esm/components/TimeAgo/timeAgoClasses.js.map +1 -0
  109. package/dist/esm/components/TimeAgo/useTimeAgo.js +29 -0
  110. package/dist/esm/components/TimeAgo/useTimeAgo.js.map +1 -0
  111. package/dist/esm/components/TimeAgo/useTimeout.js +17 -0
  112. package/dist/esm/components/TimeAgo/useTimeout.js.map +1 -0
  113. package/dist/esm/hocs/withTooltip.js +4 -4
  114. package/dist/esm/hocs/withTooltip.js.map +1 -1
  115. package/dist/esm/index.js +42 -19
  116. package/dist/esm/index.js.map +1 -1
  117. package/dist/esm/utils/theme.js +9 -0
  118. package/dist/esm/utils/theme.js.map +1 -1
  119. package/dist/esm/utils/wrapperTooltip.js +2 -2
  120. package/dist/esm/utils/wrapperTooltip.js.map +1 -1
  121. package/dist/types/index.d.ts +244 -1
  122. package/package.json +6 -6
package/dist/esm/index.js CHANGED
@@ -231,8 +231,19 @@ import { HvSlider } from "./components/Slider/Slider.js";
231
231
  import { default as default120 } from "./components/FilterGroup/filterGroupClasses.js";
232
232
  import { HvFilterGroup } from "./components/FilterGroup/FilterGroup.js";
233
233
  import { HvDatePicker } from "./components/DatePicker/DatePicker.js";
234
- import { default as default121 } from "./hooks/useUniqueId.js";
235
- import { default as default122 } from "./hooks/useIsMounted.js";
234
+ import { default as default121 } from "./components/ScrollTo/Vertical/scrollToVerticalClasses.js";
235
+ import { default as default122 } from "./components/ScrollTo/Vertical/VerticalScrollListItem/verticalScrollListItemClasses.js";
236
+ import { HvScrollToVertical } from "./components/ScrollTo/Vertical/ScrollToVertical.js";
237
+ import { default as default123 } from "./components/ScrollTo/Horizontal/scrollToHorizontalClasses.js";
238
+ import { default as default124 } from "./components/ScrollTo/Horizontal/HorizontalScrollListItem/horizontalScrollListItemClasses.js";
239
+ import { HvScrollToHorizontal } from "./components/ScrollTo/Horizontal/ScrollToHorizontal.js";
240
+ import { useScrollTo } from "./components/ScrollTo/useScrollTo.js";
241
+ import { default as default125 } from "./components/InlineEditor/inlineEditorClasses.js";
242
+ import { HvInlineEditor } from "./components/InlineEditor/InlineEditor.js";
243
+ import { default as default126 } from "./components/TimeAgo/timeAgoClasses.js";
244
+ import { HvTimeAgo } from "./components/TimeAgo/TimeAgo.js";
245
+ import { default as default127 } from "./hooks/useUniqueId.js";
246
+ import { default as default128 } from "./hooks/useIsMounted.js";
236
247
  import { useClickOutside } from "./hooks/useClickOutside.js";
237
248
  import { useControlled } from "./hooks/useControlled.js";
238
249
  import { useImageLoaded } from "./hooks/useImageLoaded.js";
@@ -244,23 +255,23 @@ import { useEnhancedEffect } from "./hooks/useEnhancedEffect.js";
244
255
  import { HvProvider } from "./providers/Provider.js";
245
256
  import { HvThemeContext } from "@hitachivantara/uikit-react-shared";
246
257
  import { HvThemeProvider } from "./providers/ThemeProvider.js";
247
- import { default as default123 } from "./utils/iconVariant.js";
248
- import { default as default124 } from "./utils/hexToRgbA.js";
249
- import { default as default125 } from "./utils/browser.js";
250
- import { default as default126 } from "./utils/multiSelectionEventHandler.js";
251
- import { default as default127 } from "./utils/getComponentName.js";
258
+ import { default as default129 } from "./utils/iconVariant.js";
259
+ import { default as default130 } from "./utils/hexToRgbA.js";
260
+ import { default as default131 } from "./utils/browser.js";
261
+ import { default as default132 } from "./utils/multiSelectionEventHandler.js";
262
+ import { default as default133 } from "./utils/getComponentName.js";
252
263
  import { outlineStyles } from "./utils/focusUtils.js";
253
264
  import { keyboardCodes } from "./utils/keyboardUtils/keyboardCodes.js";
254
265
  import { getKeyCodeFromEvent, isKeycode, isKeypress } from "./utils/keyboardUtils/keyCheck.js";
255
266
  import { decreaseSize, increaseSize } from "./utils/sizes.js";
256
- import { createTheme, processThemes, setElementAttrs } from "./utils/theme.js";
267
+ import { createTheme, getVarValue, processThemes, setElementAttrs } from "./utils/theme.js";
257
268
  import { setId, setUid } from "./utils/setId.js";
258
269
  import { getClasses } from "./utils/classes.js";
259
270
  import { getFirstAndLastFocus, getFocusableList, getPrevNextFocus } from "./utils/focusableElementFinder.js";
260
271
  import { wrapperTooltip } from "./utils/wrapperTooltip.js";
261
272
  import { useSavedState } from "./utils/useSavedState.js";
262
- import { default as default128 } from "./hocs/withTooltip.js";
263
- import { default as default129 } from "./hocs/withId.js";
273
+ import { default as default134 } from "./hocs/withTooltip.js";
274
+ import { default as default135 } from "./hocs/withId.js";
264
275
  export {
265
276
  CellWithCheckBox,
266
277
  CellWithExpandButton,
@@ -330,6 +341,7 @@ export {
330
341
  HvMenuItem as HvHeaderMenuItem,
331
342
  HvHeaderNavigation,
332
343
  HvInfoMessage,
344
+ HvInlineEditor,
333
345
  HvInput,
334
346
  HvKpi,
335
347
  HvLabel,
@@ -350,6 +362,8 @@ export {
350
362
  HvRadio,
351
363
  HvRadioGroup,
352
364
  HvRightControl,
365
+ HvScrollToHorizontal,
366
+ HvScrollToVertical,
353
367
  HvSelectionList,
354
368
  HvSimpleGrid,
355
369
  HvSlider,
@@ -375,6 +389,7 @@ export {
375
389
  HvTextArea,
376
390
  HvThemeContext,
377
391
  HvThemeProvider,
392
+ HvTimeAgo,
378
393
  HvToggleButton,
379
394
  HvTooltip,
380
395
  HvTypography,
@@ -447,7 +462,7 @@ export {
447
462
  default36 as footerClasses,
448
463
  default13 as formElementClasses,
449
464
  getClasses,
450
- default127 as getComponentName,
465
+ default133 as getComponentName,
451
466
  getFirstAndLastFocus,
452
467
  getFocusableList,
453
468
  getHeaderFooterPropsHook,
@@ -458,13 +473,15 @@ export {
458
473
  getPrevNextFocus,
459
474
  getSelectorIcons,
460
475
  getTableHeadPropsHook,
476
+ getVarValue,
461
477
  default83 as globalActionsClasses,
462
478
  default37 as gridClasses,
463
479
  default39 as headerActionsClasses,
464
480
  default40 as headerBrandClasses,
465
481
  default38 as headerClasses,
466
482
  default41 as headerNavigationClasses,
467
- default124 as hexToRgbA,
483
+ default130 as hexToRgbA,
484
+ default124 as horizontalScrollListItemClasses,
468
485
  hvDateColumn,
469
486
  hvDropdownColumn,
470
487
  hvExpandColumn,
@@ -476,11 +493,12 @@ export {
476
493
  hvSwitchColumn,
477
494
  hvTagColumn,
478
495
  hvTextColumn,
479
- default123 as iconVariant,
496
+ default129 as iconVariant,
480
497
  increaseSize,
481
498
  default15 as infoMessageClasses,
499
+ default125 as inlineEditorClasses,
482
500
  default60 as inputClasses,
483
- default125 as isBrowser,
501
+ default131 as isBrowser,
484
502
  isInvalid,
485
503
  isKeycode,
486
504
  isKeypress,
@@ -496,7 +514,7 @@ export {
496
514
  default44 as loadingClasses,
497
515
  default105 as loginClasses,
498
516
  default45 as multiButtonClasses,
499
- default126 as multiSelectionEventHandler,
517
+ default132 as multiSelectionEventHandler,
500
518
  normalizeProgressBar,
501
519
  outlineStyles,
502
520
  default53 as overflowTooltipClasses,
@@ -509,6 +527,8 @@ export {
509
527
  default67 as radioGroupClasses,
510
528
  reducer,
511
529
  default108 as rightControlClasses,
530
+ default123 as scrollToHorizontalClasses,
531
+ default121 as scrollToVerticalClasses,
512
532
  default17 as selectionListClasses,
513
533
  setElementAttrs,
514
534
  setId,
@@ -533,6 +553,7 @@ export {
533
553
  default63 as textAreaClasses,
534
554
  theme,
535
555
  themes,
556
+ default126 as timeAgoClasses,
536
557
  default52 as tooltipClasses,
537
558
  default117 as treeViewClasses,
538
559
  default118 as treeViewItemClasses,
@@ -558,20 +579,22 @@ export {
558
579
  default92 as useHvTableStyles,
559
580
  useImageLoaded,
560
581
  useInstance,
561
- default122 as useIsMounted,
582
+ default128 as useIsMounted,
562
583
  useLabels,
563
584
  useSavedState,
585
+ useScrollTo,
564
586
  useSelectionPath,
565
587
  useTheme,
566
- default121 as useUniqueId,
588
+ default127 as useUniqueId,
567
589
  useWidth,
568
590
  default111 as verticalNavigationClasses,
569
591
  default112 as verticalNavigationHeaderClasses,
570
592
  default116 as verticalNavigationSliderClasses,
571
593
  default115 as verticalNavigationTreeClasses,
594
+ default122 as verticalScrollListItemClasses,
572
595
  default16 as warningTextClasses,
573
- default129 as withId,
574
- default128 as withTooltip,
596
+ default135 as withId,
597
+ default134 as withTooltip,
575
598
  wrapperTooltip
576
599
  };
577
600
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -89,8 +89,17 @@ const processThemes = (themesList) => {
89
89
  return [themes.ds5];
90
90
  }
91
91
  };
92
+ const getVarValue = (cssVar) => {
93
+ const tempEl = document.createElement("div");
94
+ tempEl.style.setProperty("--temp", cssVar);
95
+ document.body.appendChild(tempEl);
96
+ const computedValue = getComputedStyle(tempEl).getPropertyValue("--temp").trim();
97
+ document.body.removeChild(tempEl);
98
+ return computedValue;
99
+ };
92
100
  export {
93
101
  createTheme,
102
+ getVarValue,
94
103
  processThemes,
95
104
  setElementAttrs
96
105
  };
@@ -1 +1 @@
1
- {"version":3,"file":"theme.js","sources":["../../../src/utils/theme.ts"],"sourcesContent":["/*eslint import/namespace: [2, { allowComputed: true }]*/\nimport { CSSProperties } from \"react\";\nimport {\n themes,\n HvThemeColorModeStructure,\n HvThemeStructure,\n theme,\n} from \"@hitachivantara/uikit-styles\";\nimport { HvTheme, HvCreateThemeProps } from \"@core/types\";\n\n/**\n * Sets the element style properties.\n */\nconst setElementStyle = (element: HTMLElement, style: CSSProperties) => {\n for (const property in style) {\n element.style[property] = style[property];\n }\n};\n\n/**\n * Sets the element attributes and style for a theme and color mode.\n */\nexport const setElementAttrs = (\n themeName: string,\n modeName: string,\n colorScheme: string,\n themeRootId?: string\n) => {\n const element = themeRootId\n ? document.getElementById(themeRootId)\n : document.body;\n\n if (element) {\n element.setAttribute(`data-theme`, themeName);\n element.setAttribute(`data-color-mode`, modeName);\n\n // Set default properties for all components to inherit\n setElementStyle(element, {\n colorScheme: colorScheme,\n backgroundColor: theme.colors.backgroundColor,\n accentColor: theme.colors.secondary,\n color: theme.colors.secondary,\n fontSize: theme.typography.body.fontSize,\n fontWeight: theme.typography.body.fontWeight,\n lineHeight: theme.typography.body.lineHeight,\n letterSpacing: theme.typography.body.letterSpacing,\n fontFamily: theme.fontFamily.body,\n });\n }\n};\n\n/**\n * Applies customizations to a theme.\n */\nconst applyThemeCustomizations = (obj: object, customizations: object) => {\n const isObject = (val: any) =>\n val && typeof val === \"object\" && !Array.isArray(val);\n\n // Customized theme\n const customizedTheme = { ...obj };\n\n // Add new values to the theme or replace values\n Object.keys(customizations).forEach((key) => {\n if (customizedTheme[key]) {\n if (isObject(customizedTheme[key]) && isObject(customizations[key])) {\n customizedTheme[key] = applyThemeCustomizations(\n customizedTheme[key],\n customizations[key]\n );\n } else if (typeof customizedTheme[key] == typeof customizations[key]) {\n customizedTheme[key] = customizations[key];\n }\n } else {\n customizedTheme[key] = customizations[key];\n }\n });\n\n return customizedTheme;\n};\n\n/**\n * Creates a customized theme based on the base theme and customizations given.\n * For the color modes, the colors that are not defined will be replaced by the values from the dawn mode of the base theme.\n */\nexport const createTheme = (\n props: HvCreateThemeProps\n): HvTheme | HvThemeStructure => {\n const {\n name,\n base = \"ds5\",\n inheritColorModes = true,\n ...customizations\n } = props;\n\n // Apply customizations to the base theme\n const customizedTheme: HvTheme | HvThemeStructure = customizations\n ? (applyThemeCustomizations(themes[base], customizations) as HvTheme)\n : { ...themes[base] };\n\n // Set theme name\n customizedTheme.name = name.trim();\n\n // Fill new color modes with missing colors\n if (customizations) {\n Object.keys(customizedTheme.colors.modes).forEach((mode) => {\n if (!themes[base].colors.modes[mode]) {\n customizedTheme.colors.modes[mode] = {\n ...themes[base].colors.modes.dawn,\n ...(customizedTheme.colors.modes[mode] as Partial<\n HvThemeColorModeStructure & { [key: string]: string }\n >),\n };\n }\n });\n }\n\n // If the flag `inheritColorModes` is false and customizations were given for the color modes,\n // we're removing any color modes that might have been inherited\n if (!inheritColorModes && customizations.colors?.modes) {\n Object.keys(customizedTheme.colors.modes).forEach((mode) => {\n if (!Object.keys(customizations.colors?.modes || {}).includes(mode)) {\n delete customizedTheme.colors.modes[mode];\n }\n });\n }\n\n // Created theme\n return customizedTheme;\n};\n\n/**\n * Process the themes provided to the HvProvider:\n * - Cleans themes with the same name\n * - Returns the default if the list is empty (ds5)\n */\nexport const processThemes = (\n themesList?: (HvTheme | HvThemeStructure)[]\n): (HvTheme | HvThemeStructure)[] => {\n if (themesList && Array.isArray(themesList) && themesList.length > 0) {\n const list: (HvTheme | HvThemeStructure)[] = [];\n\n themesList.map((thm) => {\n const i: number = list.findIndex(\n (t) => t.name.trim() === thm.name.trim()\n );\n\n if (i !== -1) {\n list.splice(i, 1);\n list.push(thm);\n } else {\n list.push(thm);\n }\n });\n\n // Cleaned themes\n return list;\n } else {\n // DS5\n return [themes.ds5];\n }\n};\n"],"names":["setElementStyle","element","style","property","setElementAttrs","themeName","modeName","colorScheme","themeRootId","document","getElementById","body","setAttribute","backgroundColor","theme","colors","accentColor","secondary","color","fontSize","typography","fontWeight","lineHeight","letterSpacing","fontFamily","applyThemeCustomizations","obj","customizations","isObject","val","Array","isArray","customizedTheme","Object","keys","forEach","key","createTheme","props","name","base","inheritColorModes","themes","trim","modes","mode","dawn","includes","processThemes","themesList","length","list","map","thm","i","findIndex","t","splice","push","ds5"],"mappings":";AAaA,MAAMA,kBAAkBA,CAACC,SAAsBC,UAAyB;AACtE,aAAWC,YAAYD,OAAO;AAC5BD,YAAQC,MAAMC,QAAQ,IAAID,MAAMC,QAAQ;AAAA,EAC1C;AACF;AAKO,MAAMC,kBAAkBA,CAC7BC,WACAC,UACAC,aACAC,gBACG;AACH,QAAMP,UAAUO,cACZC,SAASC,eAAeF,WAAW,IACnCC,SAASE;AAEb,MAAIV,SAAS;AACHW,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AACPG,aAAAA,OAAOH,GAAG,CAAC;AAChBH,aAAKO,KAAKL,GAAG;AAAA,MAAA,OACR;AACLF,aAAKO,KAAKL,GAAG;AAAA,MACf;AAAA,IAAA,CACD;AAGMF,WAAAA;AAAAA,EAAAA,OACF;AAEE,WAAA,CAACT,OAAOiB,GAAG;AAAA,EACpB;AACF;"}
1
+ {"version":3,"file":"theme.js","sources":["../../../src/utils/theme.ts"],"sourcesContent":["/*eslint import/namespace: [2, { allowComputed: true }]*/\nimport { CSSProperties } from \"react\";\nimport {\n themes,\n HvThemeColorModeStructure,\n HvThemeStructure,\n theme,\n} from \"@hitachivantara/uikit-styles\";\nimport { HvTheme, HvCreateThemeProps } from \"@core/types\";\n\n/**\n * Sets the element style properties.\n */\nconst setElementStyle = (element: HTMLElement, style: CSSProperties) => {\n for (const property in style) {\n element.style[property] = style[property];\n }\n};\n\n/**\n * Sets the element attributes and style for a theme and color mode.\n */\nexport const setElementAttrs = (\n themeName: string,\n modeName: string,\n colorScheme: string,\n themeRootId?: string\n) => {\n const element = themeRootId\n ? document.getElementById(themeRootId)\n : document.body;\n\n if (element) {\n element.setAttribute(`data-theme`, themeName);\n element.setAttribute(`data-color-mode`, modeName);\n\n // Set default properties for all components to inherit\n setElementStyle(element, {\n colorScheme: colorScheme,\n backgroundColor: theme.colors.backgroundColor,\n accentColor: theme.colors.secondary,\n color: theme.colors.secondary,\n fontSize: theme.typography.body.fontSize,\n fontWeight: theme.typography.body.fontWeight,\n lineHeight: theme.typography.body.lineHeight,\n letterSpacing: theme.typography.body.letterSpacing,\n fontFamily: theme.fontFamily.body,\n });\n }\n};\n\n/**\n * Applies customizations to a theme.\n */\nconst applyThemeCustomizations = (obj: object, customizations: object) => {\n const isObject = (val: any) =>\n val && typeof val === \"object\" && !Array.isArray(val);\n\n // Customized theme\n const customizedTheme = { ...obj };\n\n // Add new values to the theme or replace values\n Object.keys(customizations).forEach((key) => {\n if (customizedTheme[key]) {\n if (isObject(customizedTheme[key]) && isObject(customizations[key])) {\n customizedTheme[key] = applyThemeCustomizations(\n customizedTheme[key],\n customizations[key]\n );\n } else if (typeof customizedTheme[key] == typeof customizations[key]) {\n customizedTheme[key] = customizations[key];\n }\n } else {\n customizedTheme[key] = customizations[key];\n }\n });\n\n return customizedTheme;\n};\n\n/**\n * Creates a customized theme based on the base theme and customizations given.\n * For the color modes, the colors that are not defined will be replaced by the values from the dawn mode of the base theme.\n */\nexport const createTheme = (\n props: HvCreateThemeProps\n): HvTheme | HvThemeStructure => {\n const {\n name,\n base = \"ds5\",\n inheritColorModes = true,\n ...customizations\n } = props;\n\n // Apply customizations to the base theme\n const customizedTheme: HvTheme | HvThemeStructure = customizations\n ? (applyThemeCustomizations(themes[base], customizations) as HvTheme)\n : { ...themes[base] };\n\n // Set theme name\n customizedTheme.name = name.trim();\n\n // Fill new color modes with missing colors\n if (customizations) {\n Object.keys(customizedTheme.colors.modes).forEach((mode) => {\n if (!themes[base].colors.modes[mode]) {\n customizedTheme.colors.modes[mode] = {\n ...themes[base].colors.modes.dawn,\n ...(customizedTheme.colors.modes[mode] as Partial<\n HvThemeColorModeStructure & { [key: string]: string }\n >),\n };\n }\n });\n }\n\n // If the flag `inheritColorModes` is false and customizations were given for the color modes,\n // we're removing any color modes that might have been inherited\n if (!inheritColorModes && customizations.colors?.modes) {\n Object.keys(customizedTheme.colors.modes).forEach((mode) => {\n if (!Object.keys(customizations.colors?.modes || {}).includes(mode)) {\n delete customizedTheme.colors.modes[mode];\n }\n });\n }\n\n // Created theme\n return customizedTheme;\n};\n\n/**\n * Process the themes provided to the HvProvider:\n * - Cleans themes with the same name\n * - Returns the default if the list is empty (ds5)\n */\nexport const processThemes = (\n themesList?: (HvTheme | HvThemeStructure)[]\n): (HvTheme | HvThemeStructure)[] => {\n if (themesList && Array.isArray(themesList) && themesList.length > 0) {\n const list: (HvTheme | HvThemeStructure)[] = [];\n\n themesList.map((thm) => {\n const i: number = list.findIndex(\n (t) => t.name.trim() === thm.name.trim()\n );\n\n if (i !== -1) {\n list.splice(i, 1);\n list.push(thm);\n } else {\n list.push(thm);\n }\n });\n\n // Cleaned themes\n return list;\n } else {\n // DS5\n return [themes.ds5];\n }\n};\n\n/**\n * Returns the computed value of a theme CSS var\n */\nexport const getVarValue = (cssVar: string): string => {\n const tempEl = document.createElement(\"div\");\n tempEl.style.setProperty(\"--temp\", cssVar);\n document.body.appendChild(tempEl);\n const computedValue = getComputedStyle(tempEl)\n .getPropertyValue(\"--temp\")\n .trim();\n document.body.removeChild(tempEl);\n return computedValue;\n};\n"],"names":["setElementStyle","element","style","property","setElementAttrs","themeName","modeName","colorScheme","themeRootId","document","getElementById","body","setAttribute","backgroundColor","theme","colors","accentColor","secondary","color","fontSize","typography","fontWeight","lineHeight","letterSpacing","fontFamily","applyThemeCustomizations","obj","customizations","isObject","val","Array","isArray","customizedTheme","Object","keys","forEach","key","createTheme","props","name","base","inheritColorModes","themes","trim","modes","mode","dawn","includes","processThemes","themesList","length","list","map","thm","i","findIndex","t","splice","push","ds5","getVarValue","cssVar","tempEl","createElement","setProperty","appendChild","computedValue","getComputedStyle","getPropertyValue","removeChild"],"mappings":";AAaA,MAAMA,kBAAkBA,CAACC,SAAsBC,UAAyB;AACtE,aAAWC,YAAYD,OAAO;AAC5BD,YAAQC,MAAMC,QAAQ,IAAID,MAAMC,QAAQ;AAAA,EAC1C;AACF;AAKO,MAAMC,kBAAkBA,CAC7BC,WACAC,UACAC,aACAC,gBACG;AACH,QAAMP,UAAUO,cACZC,SAASC,eAAeF,WAAW,IACnCC,SAASE;AAEb,MAAIV,SAAS;AACHW,YAAAA,aAAc,cAAaP,SAAS;AACpCO,YAAAA,aAAc,mBAAkBN,QAAQ;AAGhDN,oBAAgBC,SAAS;AAAA,MACvBM;AAAAA,MACAM,iBAAiBC,MAAMC,OAAOF;AAAAA,MAC9BG,aAAaF,MAAMC,OAAOE;AAAAA,MAC1BC,OAAOJ,MAAMC,OAAOE;AAAAA,MACpBE,UAAUL,MAAMM,WAAW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;AAC/CC,QAAAA,SAASrD,SAASsD,cAAc,KAAK;AACpC7D,SAAAA,MAAM8D,YAAY,UAAUH,MAAM;AAChClD,WAAAA,KAAKsD,YAAYH,MAAM;AAChC,QAAMI,gBAAgBC,iBAAiBL,MAAM,EAC1CM,iBAAiB,QAAQ,EACzBzB;AACMhC,WAAAA,KAAK0D,YAAYP,MAAM;AACzBI,SAAAA;AACT;"}
@@ -1,11 +1,11 @@
1
- import withTooltip from "../hocs/withTooltip.js";
1
+ import withTooltipUtil from "../hocs/withTooltip.js";
2
2
  const hideTooltip = (evt) => {
3
3
  const isOverFlow = evt.target.children.length > 1 ? Array.of(...evt.target.children).some((child) => child.scrollWidth > child.clientWidth) : evt.target.scrollWidth > evt.target.clientWidth;
4
4
  return !isOverFlow;
5
5
  };
6
6
  const wrapperTooltip = (hasTooltips, Component, label) => {
7
7
  const ComponentFunction = () => Component;
8
- return hasTooltips ? withTooltip(ComponentFunction, label, "top", hideTooltip, {}, {}) : ComponentFunction;
8
+ return hasTooltips ? withTooltipUtil(ComponentFunction, label, "top", hideTooltip) : ComponentFunction;
9
9
  };
10
10
  export {
11
11
  wrapperTooltip
@@ -1 +1 @@
1
- {"version":3,"file":"wrapperTooltip.js","sources":["../../../src/utils/wrapperTooltip.tsx"],"sourcesContent":["import { withTooltip } from \"@core/hocs\";\n\nconst hideTooltip = (evt) => {\n const isOverFlow =\n evt.target.children.length > 1\n ? Array.of(...evt.target.children).some(\n (child) => child.scrollWidth > child.clientWidth\n )\n : evt.target.scrollWidth > evt.target.clientWidth;\n\n return !isOverFlow;\n};\n\nexport const wrapperTooltip = (hasTooltips, Component, label) => {\n const ComponentFunction = () => Component;\n return hasTooltips\n ? withTooltip(ComponentFunction, label, \"top\", hideTooltip, {}, {})\n : ComponentFunction;\n};\n"],"names":["hideTooltip","evt","isOverFlow","target","children","length","Array","of","some","child","scrollWidth","clientWidth","wrapperTooltip","hasTooltips","Component","label","ComponentFunction","withTooltip"],"mappings":";AAEA,MAAMA,cAAeC,CAAQ,QAAA;AACrBC,QAAAA,aACJD,IAAIE,OAAOC,SAASC,SAAS,IACzBC,MAAMC,GAAG,GAAGN,IAAIE,OAAOC,QAAQ,EAAEI,KAC9BC,CAAAA,UAAUA,MAAMC,cAAcD,MAAME,WAAW,IAElDV,IAAIE,OAAOO,cAAcT,IAAIE,OAAOQ;AAE1C,SAAO,CAACT;AACV;AAEO,MAAMU,iBAAiBA,CAACC,aAAaC,WAAWC,UAAU;AAC/D,QAAMC,oBAAoBA,MAAMF;AACzBD,SAAAA,cACHI,YAAYD,mBAAmBD,OAAO,OAAOf,aAAa,CAAC,GAAG,EAAE,IAChEgB;AACN;"}
1
+ {"version":3,"file":"wrapperTooltip.js","sources":["../../../src/utils/wrapperTooltip.tsx"],"sourcesContent":["import { withTooltip } from \"@core/hocs\";\n\nconst hideTooltip = (evt) => {\n const isOverFlow =\n evt.target.children.length > 1\n ? Array.of(...evt.target.children).some(\n (child) => child.scrollWidth > child.clientWidth\n )\n : evt.target.scrollWidth > evt.target.clientWidth;\n\n return !isOverFlow;\n};\n\nexport const wrapperTooltip = (hasTooltips, Component, label) => {\n const ComponentFunction = () => Component;\n return hasTooltips\n ? withTooltip(ComponentFunction, label, \"top\", hideTooltip)\n : ComponentFunction;\n};\n"],"names":["hideTooltip","evt","isOverFlow","target","children","length","Array","of","some","child","scrollWidth","clientWidth","wrapperTooltip","hasTooltips","Component","label","ComponentFunction","withTooltip"],"mappings":";AAEA,MAAMA,cAAeC,CAAQ,QAAA;AACrBC,QAAAA,aACJD,IAAIE,OAAOC,SAASC,SAAS,IACzBC,MAAMC,GAAG,GAAGN,IAAIE,OAAOC,QAAQ,EAAEI,KAC9BC,CAAAA,UAAUA,MAAMC,cAAcD,MAAME,WAAW,IAElDV,IAAIE,OAAOO,cAAcT,IAAIE,OAAOQ;AAE1C,SAAO,CAACT;AACV;AAEO,MAAMU,iBAAiBA,CAACC,aAAaC,WAAWC,UAAU;AAC/D,QAAMC,oBAAoBA,MAAMF;AAChC,SAAOD,cACHI,gBAAYD,mBAAmBD,OAAO,OAAOf,WAAW,IACxDgB;AACN;"}
@@ -394,6 +394,11 @@ export declare const getTableHeadPropsHook: (props: any, { instance }: {
394
394
  instance: any;
395
395
  }) => any[];
396
396
 
397
+ /**
398
+ * Returns the computed value of a theme CSS var
399
+ */
400
+ export declare const getVarValue: (cssVar: string) => string;
401
+
397
402
  export declare const globalActionsClasses: HvGlobalActionsClasses;
398
403
 
399
404
  export declare const gridClasses: HvGridClasses;
@@ -408,6 +413,8 @@ export declare const headerNavigationClasses: HvHeaderNavigationClasses;
408
413
 
409
414
  export declare const hexToRgbA: (hex: any, factor?: number) => string;
410
415
 
416
+ export declare const horizontalScrollListItemClasses: HvHorizontalScrollListItemClasses;
417
+
411
418
  export declare type HvAccentColorKeys = "primary" | "primary_80" | "primary_20" | "brand" | "secondary" | "secondary_60" | "secondary_80";
412
419
 
413
420
  export declare type HvAccentColors = Record<HvAccentColorKeys, string>;
@@ -3672,6 +3679,13 @@ export declare interface HvHooks<D extends object = Record<string, unknown>, H e
3672
3679
  useFinalInstance: Array<(instance: HvTableInstance<D, H>) => void>;
3673
3680
  }
3674
3681
 
3682
+ export declare interface HvHorizontalScrollListItemClasses {
3683
+ root?: string;
3684
+ selected?: string;
3685
+ button?: string;
3686
+ text?: string;
3687
+ }
3688
+
3675
3689
  /**
3676
3690
  * Provides the user with additional descriptive text for the form element.
3677
3691
  */
@@ -3692,6 +3706,46 @@ export declare interface HvInfoMessageProps extends HvBaseProps {
3692
3706
  classes?: HvInfoMessageClasses;
3693
3707
  }
3694
3708
 
3709
+ /**
3710
+ * An Inline Editor allows the user to edit a record without making a major switch
3711
+ * between viewing and editing, making it an efficient method of updating a record.
3712
+ */
3713
+ export declare const HvInlineEditor: ({ className, classes, value: valueProp, defaultValue, showIcon, component: InputComponent, variant, placeholder, onBlur, onChange, onKeyDown, buttonProps, typographyProps, ...others }: HvInlineEditorProps) => JSX_2.Element;
3714
+
3715
+ export declare interface HvInlineEditorClasses {
3716
+ root?: string;
3717
+ button?: string;
3718
+ largeText?: string;
3719
+ text?: string;
3720
+ textEmpty?: string;
3721
+ icon?: string;
3722
+ iconVisible?: string;
3723
+ inputRoot?: string;
3724
+ input?: string;
3725
+ inputBorderContainer?: string;
3726
+ }
3727
+
3728
+ export declare interface HvInlineEditorProps extends Omit<HvBaseProps<HTMLDivElement>, "onBlur" | "onChange"> {
3729
+ /** The value of the form element. */
3730
+ value?: string;
3731
+ /** Whether the Edit icon should always be visible */
3732
+ showIcon?: boolean;
3733
+ /** Component to use as the input. The component "inherit" from `HvBaseInput` (such as `HvInput` or `HvTextArea`) */
3734
+ component?: React_2.ElementType;
3735
+ /** Variant of the HvTypography to display */
3736
+ variant?: HvTypographyVariants;
3737
+ /** Called when the input is blurred. */
3738
+ onBlur?: (event: React_2.FocusEvent<HTMLTextAreaElement | HTMLInputElement>, value: string) => void;
3739
+ /** Called when the input value changes. */
3740
+ onChange?: (event: React_2.SyntheticEvent, value: string) => void;
3741
+ /** Props passed to the HvButton component */
3742
+ buttonProps?: HvButtonProps;
3743
+ /** Props passed to the HvTypography text component */
3744
+ typographyProps?: HvTypographyProps;
3745
+ /** A Jss Object used to override or extend the styles applied to the empty state component. */
3746
+ classes?: HvInlineEditorClasses;
3747
+ }
3748
+
3695
3749
  /**
3696
3750
  * A text input box is a graphical control element intended to enable the user to input text information to be used by the software.
3697
3751
  */
@@ -4857,6 +4911,127 @@ declare type HvRowPropGetter<D extends object = Record<string, unknown>, H exten
4857
4911
  row: HvRowInstance<D, H>;
4858
4912
  }>;
4859
4913
 
4914
+ /**
4915
+ * The horizontal scroll to element can be used to quickly navigate in a page.
4916
+ */
4917
+ export declare const HvScrollToHorizontal: ({ id, defaultSelectedIndex, scrollElementId, href, onChange, onClick, onEnter, className, classes, options, offset, position, tooltipPosition, ...others }: HvScrollToHorizontalProps) => JSX_2.Element;
4918
+
4919
+ export declare interface HvScrollToHorizontalClasses {
4920
+ root?: string;
4921
+ positionSticky?: string;
4922
+ positionFixed?: string;
4923
+ notSelectedRoot?: string;
4924
+ notSelected?: string;
4925
+ selected?: string;
4926
+ }
4927
+
4928
+ export declare interface HvScrollToHorizontalOption {
4929
+ key?: string;
4930
+ label: string;
4931
+ value: string;
4932
+ offset?: number;
4933
+ }
4934
+
4935
+ export declare type HvScrollToHorizontalPositions = "sticky" | "fixed" | "relative";
4936
+
4937
+ export declare interface HvScrollToHorizontalProps extends HvBaseProps<HTMLOListElement, {
4938
+ onChange: any;
4939
+ onClick: any;
4940
+ }> {
4941
+ /** An Array of Objects with Label and Value. Label is the displayed Element and Value is the local navigation location applied */
4942
+ options: HvScrollToHorizontalOption[];
4943
+ /** True if the href location link should be applied. It will create an a element around every list item */
4944
+ href?: boolean;
4945
+ /** Default selected index passed from the parent. */
4946
+ defaultSelectedIndex?: number;
4947
+ /**
4948
+ * The Id of the scrollable container containing displayed elements.
4949
+ *
4950
+ * Defaults to `window` if unspecified.
4951
+ */
4952
+ scrollElementId?: string;
4953
+ /**
4954
+ * Defines the offset from the top of each element for getting an optimal viewing region in the container.
4955
+ * This allows to exclude regions of the container that are obscured by other content (such as fixed-positioned toolbars or titles)
4956
+ * or to put more breathing room between the targeted element and the edges of the container.
4957
+ *
4958
+ * Each element can also have a specific offset via the options property.
4959
+ */
4960
+ offset?: number;
4961
+ /** Position of the Horizontal scroll to. */
4962
+ position?: HvScrollToHorizontalPositions;
4963
+ /** Position of tooltip identifying the current item. */
4964
+ tooltipPosition?: HvScrollToTooltipPositions;
4965
+ /** A function called each time the selected index changes. */
4966
+ onChange?: (event: Event | React.MouseEvent<HTMLDivElement> | React.KeyboardEvent<HTMLDivElement>, index: number) => void;
4967
+ /** A function called each time an user clicks on a tab element. */
4968
+ onClick?: (event: React.MouseEvent<HTMLDivElement>, index: number) => void;
4969
+ /** A function called each time an user press enter on a tab element. */
4970
+ onEnter?: (event: React.KeyboardEvent<HTMLDivElement>, index: number) => void;
4971
+ /** A Jss Object used to override or extend the styles applied. */
4972
+ classes?: HvScrollToHorizontalClasses;
4973
+ }
4974
+
4975
+ export declare type HvScrollToTooltipPositions = "left" | "right" | "top" | "bottom";
4976
+
4977
+ /**
4978
+ * The vertical scroll to element can be used to quickly navigate in a page.
4979
+ */
4980
+ export declare const HvScrollToVertical: ({ id, defaultSelectedIndex, scrollElementId, href, onChange, onClick, onEnter, className, classes, options, offset, position, tooltipPosition, ...others }: HvScrollToVerticalProps) => JSX_2.Element;
4981
+
4982
+ export declare interface HvScrollToVerticalClasses {
4983
+ root?: string;
4984
+ positionAbsolute?: string;
4985
+ positionFixed?: string;
4986
+ }
4987
+
4988
+ export declare interface HvScrollToVerticalOption {
4989
+ key?: string;
4990
+ label: string;
4991
+ value: string;
4992
+ offset?: number;
4993
+ }
4994
+
4995
+ export declare type HvScrollToVerticalPositions = "absolute" | "fixed" | "relative";
4996
+
4997
+ export declare interface HvScrollToVerticalProps extends HvBaseProps<HTMLOListElement, {
4998
+ onChange: any;
4999
+ onClick: any;
5000
+ }> {
5001
+ /** An Array of Objects with Label and Value. Label is the displayed Element and Value is the local navigation location applied */
5002
+ options: HvScrollToVerticalOption[];
5003
+ /** True if the href location link should be applied. It will create an a element around every list item */
5004
+ href?: boolean;
5005
+ /** Default selected index passed from the parent. */
5006
+ defaultSelectedIndex?: number;
5007
+ /**
5008
+ * The Id of the scrollable container containing displayed elements.
5009
+ *
5010
+ * Defaults to `window` if unspecified.
5011
+ */
5012
+ scrollElementId?: string;
5013
+ /**
5014
+ * Defines the offset from the top of each element for getting an optimal viewing region in the container.
5015
+ * This allows to exclude regions of the container that are obscured by other content (such as fixed-positioned toolbars or titles)
5016
+ * or to put more breathing room between the targeted element and the edges of the container.
5017
+ *
5018
+ * Each element can also have a specific offset via the options property.
5019
+ */
5020
+ offset?: number;
5021
+ /** Position of the Vertical scroll to. */
5022
+ position?: HvScrollToVerticalPositions;
5023
+ /** Position of tooltip identifying the current item. */
5024
+ tooltipPosition?: HvScrollToTooltipPositions;
5025
+ /** A function called each time the selected index changes. */
5026
+ onChange?: (event: Event | React.MouseEvent<HTMLDivElement> | React.KeyboardEvent<HTMLDivElement>, index: number) => void;
5027
+ /** A function called each time an user clicks on a tab element. */
5028
+ onClick?: (event: React.MouseEvent<HTMLDivElement>, index: number) => void;
5029
+ /** A function called each time an user press enter on a tab element. */
5030
+ onEnter?: (event: React.KeyboardEvent<HTMLDivElement>, index: number) => void;
5031
+ /** A Jss Object used to override or extend the styles applied. */
5032
+ classes?: HvScrollToVerticalClasses;
5033
+ }
5034
+
4860
5035
  /**
4861
5036
  * Allows the user to select one or more items from a list of choices.
4862
5037
  *
@@ -6324,6 +6499,55 @@ declare interface HvThemeProviderProps {
6324
6499
  themeRootId?: string;
6325
6500
  }
6326
6501
 
6502
+ /**
6503
+ * The HvTimeAgo component implements the Design System relative time format guidelines.
6504
+ */
6505
+ export declare const HvTimeAgo: ({ classes, timestamp, locale: localeProp, component: Component, emptyElement, disableRefresh, showSeconds, justText, ...others }: HvTimeAgoProps) => JSX_2.Element;
6506
+
6507
+ export declare interface HvTimeAgoClasses {
6508
+ root?: string;
6509
+ }
6510
+
6511
+ export declare interface HvTimeAgoProps extends HvBaseProps<HTMLElement, {
6512
+ children: any;
6513
+ }> {
6514
+ /**
6515
+ * The timestamp to format, in seconds or milliseconds.
6516
+ * Defaults to `emptyElement` if value is null or 0
6517
+ */
6518
+ timestamp?: number;
6519
+ /**
6520
+ * The locale to be used. Should be on of the dayjs supported locales and explicitly imported
6521
+ * @see https://day.js.org/docs/en/i18n/i18n
6522
+ */
6523
+ locale?: string;
6524
+ /**
6525
+ * The component used for the root node. Either a string to use a HTML element or a component.
6526
+ * Defaults to `HvTypography`.
6527
+ */
6528
+ component?: React.ElementType<React.HTMLAttributes<HTMLElement>>;
6529
+ /**
6530
+ * The element to render when the timestamp is null or 0
6531
+ * Defaults to `—` (Em Dash)
6532
+ */
6533
+ emptyElement?: React.ReactNode;
6534
+ /**
6535
+ * Disables periodic date refreshes
6536
+ */
6537
+ disableRefresh?: boolean;
6538
+ /**
6539
+ * Whether to show seconds in the rendered time
6540
+ */
6541
+ showSeconds?: boolean;
6542
+ /**
6543
+ * Whether the component should render just the string
6544
+ * Consider using `useTimeAgo` instead
6545
+ */
6546
+ justText?: boolean;
6547
+ /** A Jss Object used to override or extend the styles applied to the component. */
6548
+ classes?: HvTimeAgoClasses;
6549
+ }
6550
+
6327
6551
  export declare const HvToggleButton: ForwardRefExoticComponent<HvToggleButtonProps & RefAttributes<HTMLButtonElement>>;
6328
6552
 
6329
6553
  export declare interface HvToggleButtonProps extends HvBaseProps<HTMLButtonElement, {
@@ -7008,6 +7232,13 @@ export declare interface HvVerticalNavigationTreeViewProps {
7008
7232
  children?: React.ReactNode;
7009
7233
  }
7010
7234
 
7235
+ export declare interface HvVerticalScrollListItemClasses {
7236
+ root?: string;
7237
+ notSelected?: string;
7238
+ button?: string;
7239
+ text?: string;
7240
+ }
7241
+
7011
7242
  /**
7012
7243
  * Provides the user with a descriptive text, signaling an error, for when the form element is in an invalid state.
7013
7244
  */
@@ -7050,6 +7281,8 @@ export declare const increaseSize: (size: string) => "S" | "M" | "L" | "XL";
7050
7281
 
7051
7282
  export declare const infoMessageClasses: HvInfoMessageClasses;
7052
7283
 
7284
+ export declare const inlineEditorClasses: HvInlineEditorClasses;
7285
+
7053
7286
  export declare const inputClasses: HvInputClasses;
7054
7287
 
7055
7288
  export declare const isBrowser: (browsers: any) => boolean | null;
@@ -7304,6 +7537,10 @@ export declare function reducer(state: any, action: any, previousState: any, ins
7304
7537
 
7305
7538
  export declare const rightControlClasses: HvRightControlClasses;
7306
7539
 
7540
+ export declare const scrollToHorizontalClasses: HvScrollToHorizontalClasses;
7541
+
7542
+ export declare const scrollToVerticalClasses: HvScrollToVerticalClasses;
7543
+
7307
7544
  export declare const selectionListClasses: HvSelectionListClasses;
7308
7545
 
7309
7546
  /**
@@ -7361,6 +7598,8 @@ export { theme }
7361
7598
 
7362
7599
  export { themes }
7363
7600
 
7601
+ export declare const timeAgoClasses: HvTimeAgoClasses;
7602
+
7364
7603
  export declare const tooltipClasses: HvTooltipClasses;
7365
7604
 
7366
7605
  export declare const treeViewClasses: HvVerticalNavigationTreeViewClasses;
@@ -7668,6 +7907,8 @@ export declare type UseRowSelectionProps = (<D extends object = Record<string, u
7668
7907
 
7669
7908
  export declare function useSavedState<T>(defaultState: T): [T | undefined, (v?: T, s?: boolean) => void, () => void, T | undefined, T];
7670
7909
 
7910
+ export declare const useScrollTo: (selectedIndexProp?: number, scrollElementId?: string | undefined, href?: boolean, offset?: number, options?: HvScrollToVerticalOption[], onChange?: ((event: Event | React.MouseEvent<HTMLDivElement> | React.KeyboardEvent<HTMLDivElement>, index: number) => void) | undefined, direction?: "column" | "row") => [number, (event: React.MouseEvent<HTMLDivElement> | React.KeyboardEvent<HTMLDivElement>, id: string, index: number, wrappedOnChange?: ((index: number) => void) | undefined) => void];
7911
+
7671
7912
  export declare const useSelectionPath: (data: any, selectedId: any) => string[];
7672
7913
 
7673
7914
  export declare type UseTableStylesProps = (<D extends object = Record<string, unknown>>(hooks: Hooks<D>) => void) & {
@@ -7709,6 +7950,8 @@ export declare const verticalNavigationSliderClasses: HvVerticalNavigationSlider
7709
7950
 
7710
7951
  export declare const verticalNavigationTreeClasses: HvVerticalNavigationTreeClasses;
7711
7952
 
7953
+ export declare const verticalScrollListItemClasses: HvVerticalScrollListItemClasses;
7954
+
7712
7955
  export declare type VisibilitySelectorActions = "previous_month" | "next_month" | "previous_year" | "next_year" | "month" | "month_year";
7713
7956
 
7714
7957
  export declare const warningTextClasses: HvWarningTextClasses;
@@ -7722,7 +7965,7 @@ declare interface WithIdProps extends HvExtraProps {
7722
7965
  id?: string;
7723
7966
  }
7724
7967
 
7725
- export declare const withTooltip: (Component: any, label: string | undefined, placement: any, hideTooltip: any, tooltipProps: any, tooltipContainerProps: any) => (props: any) => JSX_2.Element;
7968
+ export declare const withTooltip: (Component: React.FunctionComponent, label: string | undefined, placement: HvTooltipPlacementType, hideTooltip?: ((event: React.MouseEvent<HTMLDivElement>) => boolean) | undefined, tooltipProps?: HvTooltipProps, tooltipContainerProps?: HvBaseProps) => (props: any) => JSX_2.Element;
7726
7969
 
7727
7970
  export declare const wrapperTooltip: (hasTooltips: any, Component: any, label: any) => ((props: any) => JSX_2.Element) | (() => any);
7728
7971
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hitachivantara/uikit-react-core",
3
- "version": "5.3.0",
3
+ "version": "5.5.0",
4
4
  "private": false,
5
5
  "author": "Hitachi Vantara UI Kit Team",
6
6
  "description": "Core React components for the NEXT Design System.",
@@ -24,15 +24,15 @@
24
24
  "peerDependencies": {
25
25
  "@emotion/react": "^11.10.5",
26
26
  "@emotion/styled": "^11.10.5",
27
- "@mui/material": "^5.11.0",
27
+ "@mui/material": "^5.12.2",
28
28
  "react": "^17.0.0 || ^18.0.0",
29
29
  "react-dom": "^17.0.0 || ^18.0.0"
30
30
  },
31
31
  "dependencies": {
32
32
  "@emotion/cache": "^11.10.5",
33
- "@hitachivantara/uikit-react-icons": "^5.1.2",
34
- "@hitachivantara/uikit-react-shared": "^5.0.6",
35
- "@hitachivantara/uikit-styles": "^5.3.0",
33
+ "@hitachivantara/uikit-react-icons": "^5.1.3",
34
+ "@hitachivantara/uikit-react-shared": "^5.0.7",
35
+ "@hitachivantara/uikit-styles": "^5.4.0",
36
36
  "@popperjs/core": "^2.11.6",
37
37
  "@types/react-table": "^7.7.14",
38
38
  "attr-accept": "^2.2.2",
@@ -56,7 +56,7 @@
56
56
  "access": "public",
57
57
  "directory": "package"
58
58
  },
59
- "gitHead": "316624f40b96d6dcc8b40ed71b50cbc3c4371335",
59
+ "gitHead": "844a033f2b8388c2ae25bfcc0be710db5ed24b27",
60
60
  "main": "dist/cjs/index.cjs",
61
61
  "exports": {
62
62
  ".": {