@hitachivantara/uikit-react-core 6.8.2 → 6.9.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 (441) hide show
  1. package/dist/Accordion/Accordion.js +69 -80
  2. package/dist/Accordion/Accordion.styles.js +21 -16
  3. package/dist/ActionBar/ActionBar.js +18 -17
  4. package/dist/ActionBar/ActionBar.styles.js +12 -15
  5. package/dist/ActionsGeneric/ActionsGeneric.js +72 -98
  6. package/dist/ActionsGeneric/ActionsGeneric.styles.js +17 -14
  7. package/dist/AppSwitcher/Action/Action.js +96 -111
  8. package/dist/AppSwitcher/Action/Action.styles.js +44 -48
  9. package/dist/AppSwitcher/AppSwitcher.js +70 -98
  10. package/dist/AppSwitcher/AppSwitcher.styles.js +50 -53
  11. package/dist/Avatar/Avatar.js +66 -111
  12. package/dist/Avatar/Avatar.styles.js +62 -52
  13. package/dist/AvatarGroup/AvatarGroup.js +49 -78
  14. package/dist/AvatarGroup/AvatarGroup.styles.js +40 -60
  15. package/dist/AvatarGroup/AvatarGroupContext.js +13 -16
  16. package/dist/Badge/Badge.js +40 -49
  17. package/dist/Badge/Badge.styles.js +50 -50
  18. package/dist/Banner/Banner.js +51 -83
  19. package/dist/Banner/Banner.styles.js +13 -22
  20. package/dist/Banner/BannerContent/BannerContent.js +35 -56
  21. package/dist/Banner/BannerContent/BannerContent.styles.js +31 -36
  22. package/dist/BaseCheckBox/BaseCheckBox.js +71 -88
  23. package/dist/BaseCheckBox/BaseCheckBox.styles.js +24 -31
  24. package/dist/BaseCheckBox/CheckBoxIcon.js +57 -73
  25. package/dist/BaseDropdown/BaseDropdown.js +147 -189
  26. package/dist/BaseDropdown/BaseDropdown.styles.js +72 -84
  27. package/dist/BaseDropdown/BaseDropdownPanel.js +69 -86
  28. package/dist/BaseDropdown/utils.js +77 -76
  29. package/dist/BaseInput/BaseInput.js +53 -89
  30. package/dist/BaseInput/BaseInput.styles.js +85 -105
  31. package/dist/BaseInput/validations.js +72 -69
  32. package/dist/BaseRadio/BaseRadio.js +61 -85
  33. package/dist/BaseRadio/BaseRadio.styles.js +26 -31
  34. package/dist/BaseRadio/RadioIcon.js +43 -48
  35. package/dist/BaseSwitch/BaseSwitch.js +70 -108
  36. package/dist/BaseSwitch/BaseSwitch.styles.js +94 -113
  37. package/dist/BreadCrumb/BreadCrumb.js +84 -106
  38. package/dist/BreadCrumb/BreadCrumb.styles.js +20 -17
  39. package/dist/BreadCrumb/Page/Page.js +24 -34
  40. package/dist/BreadCrumb/Page/Page.styles.js +20 -25
  41. package/dist/BreadCrumb/PathElement/PathElement.js +17 -17
  42. package/dist/BreadCrumb/PathElement/PathElement.styles.js +9 -7
  43. package/dist/BreadCrumb/utils.js +19 -27
  44. package/dist/BulkActions/BulkActions.js +57 -96
  45. package/dist/BulkActions/BulkActions.styles.js +37 -45
  46. package/dist/Button/Button.js +67 -95
  47. package/dist/Button/Button.styles.js +107 -124
  48. package/dist/ButtonBase/ButtonBase.js +32 -51
  49. package/dist/ButtonBase/ButtonBase.styles.js +21 -30
  50. package/dist/Calendar/Calendar.js +73 -101
  51. package/dist/Calendar/Calendar.styles.js +14 -32
  52. package/dist/Calendar/CalendarHeader/CalendarHeader.js +91 -118
  53. package/dist/Calendar/CalendarHeader/CalendarHeader.styles.js +11 -16
  54. package/dist/Calendar/CalendarNavigation/ComposedNavigation/ComposedNavigation.js +36 -50
  55. package/dist/Calendar/CalendarNavigation/ComposedNavigation/ComposedNavigation.styles.js +12 -18
  56. package/dist/Calendar/CalendarNavigation/MonthSelector/MonthSelector.js +23 -43
  57. package/dist/Calendar/CalendarNavigation/MonthSelector/MonthSelector.styles.js +21 -24
  58. package/dist/Calendar/CalendarNavigation/Navigation/Navigation.js +43 -59
  59. package/dist/Calendar/CalendarNavigation/Navigation/Navigation.styles.js +21 -24
  60. package/dist/Calendar/SingleCalendar/CalendarCell.js +60 -84
  61. package/dist/Calendar/SingleCalendar/CalendarCell.styles.js +39 -56
  62. package/dist/Calendar/SingleCalendar/SingleCalendar.js +121 -154
  63. package/dist/Calendar/SingleCalendar/SingleCalendar.styles.js +53 -68
  64. package/dist/Calendar/model.js +45 -62
  65. package/dist/Calendar/utils.js +233 -128
  66. package/dist/Card/Card.js +35 -53
  67. package/dist/Card/Card.styles.js +37 -50
  68. package/dist/Card/Content/Content.js +15 -27
  69. package/dist/Card/Content/Content.styles.js +5 -10
  70. package/dist/Card/Header/Header.js +22 -35
  71. package/dist/Card/Header/Header.styles.js +22 -25
  72. package/dist/Card/Media/Media.js +16 -26
  73. package/dist/Card/Media/Media.styles.js +6 -7
  74. package/dist/Carousel/Carousel.js +179 -207
  75. package/dist/Carousel/Carousel.styles.js +141 -166
  76. package/dist/Carousel/CarouselControls.js +48 -62
  77. package/dist/Carousel/CarouselSlide/CarouselSlide.js +19 -25
  78. package/dist/Carousel/CarouselSlide/CarouselSlide.styles.js +10 -11
  79. package/dist/Carousel/CarouselThumbnails.js +29 -36
  80. package/dist/CheckBox/CheckBox.js +112 -182
  81. package/dist/CheckBox/CheckBox.styles.js +48 -57
  82. package/dist/CheckBoxGroup/CheckBoxGroup.js +154 -245
  83. package/dist/CheckBoxGroup/CheckBoxGroup.styles.js +29 -35
  84. package/dist/ColorPicker/ColorPicker.js +146 -222
  85. package/dist/ColorPicker/ColorPicker.styles.js +40 -45
  86. package/dist/ColorPicker/Picker/Fields.js +125 -141
  87. package/dist/ColorPicker/Picker/Picker.js +51 -50
  88. package/dist/ColorPicker/Picker/Picker.styles.js +42 -42
  89. package/dist/ColorPicker/PresetColors/PresetColors.js +25 -28
  90. package/dist/ColorPicker/PresetColors/PresetColors.styles.js +17 -17
  91. package/dist/ColorPicker/SavedColors/SavedColors.js +37 -41
  92. package/dist/ColorPicker/SavedColors/SavedColors.styles.js +27 -29
  93. package/dist/ColorPicker/Swatch.js +22 -37
  94. package/dist/Container/Container.js +37 -58
  95. package/dist/Container/Container.styles.js +12 -13
  96. package/dist/Controls/Controls.js +50 -74
  97. package/dist/Controls/Controls.styles.js +16 -13
  98. package/dist/Controls/LeftControl/LeftControl.js +25 -38
  99. package/dist/Controls/LeftControl/LeftControl.styles.js +7 -7
  100. package/dist/Controls/RightControl/RightControl.js +31 -46
  101. package/dist/Controls/RightControl/RightControl.styles.js +9 -7
  102. package/dist/Controls/context/ControlsContext.js +5 -6
  103. package/dist/DatePicker/DatePicker.js +286 -339
  104. package/dist/DatePicker/DatePicker.styles.js +25 -40
  105. package/dist/DatePicker/useVisibleDate.js +142 -126
  106. package/dist/DatePicker/utils.js +17 -26
  107. package/dist/Dialog/Actions/Actions.js +19 -29
  108. package/dist/Dialog/Actions/Actions.styles.js +20 -20
  109. package/dist/Dialog/Content/Content.js +29 -46
  110. package/dist/Dialog/Content/Content.styles.js +14 -15
  111. package/dist/Dialog/Dialog.js +49 -69
  112. package/dist/Dialog/Dialog.styles.js +33 -46
  113. package/dist/Dialog/Title/Title.js +20 -42
  114. package/dist/Dialog/Title/Title.styles.js +14 -16
  115. package/dist/Dialog/context.js +5 -6
  116. package/dist/DotPagination/DotPagination.js +44 -59
  117. package/dist/DotPagination/DotPagination.styles.js +44 -47
  118. package/dist/Drawer/Drawer.js +37 -64
  119. package/dist/Drawer/Drawer.styles.js +18 -21
  120. package/dist/DropDownMenu/DropDownMenu.js +88 -124
  121. package/dist/DropDownMenu/DropDownMenu.styles.js +12 -21
  122. package/dist/Dropdown/Dropdown.js +221 -310
  123. package/dist/Dropdown/Dropdown.styles.js +39 -48
  124. package/dist/Dropdown/List/List.js +194 -176
  125. package/dist/Dropdown/List/List.styles.js +23 -24
  126. package/dist/Dropdown/utils.js +15 -16
  127. package/dist/DropdownButton/DropdownButton.js +42 -46
  128. package/dist/DropdownButton/DropdownButton.styles.js +37 -47
  129. package/dist/EmptyState/EmptyState.js +48 -61
  130. package/dist/EmptyState/EmptyState.styles.js +31 -31
  131. package/dist/FileUploader/DropZone/DropZone.js +141 -179
  132. package/dist/FileUploader/DropZone/DropZone.styles.js +55 -68
  133. package/dist/FileUploader/File/File.js +85 -75
  134. package/dist/FileUploader/File/File.styles.js +55 -60
  135. package/dist/FileUploader/FileList/FileList.js +19 -28
  136. package/dist/FileUploader/FileList/FileList.styles.js +15 -16
  137. package/dist/FileUploader/FileUploader.js +35 -55
  138. package/dist/FileUploader/FileUploader.styles.js +4 -7
  139. package/dist/FileUploader/Preview/Preview.js +37 -52
  140. package/dist/FileUploader/Preview/Preview.styles.js +22 -28
  141. package/dist/FileUploader/utils.js +24 -11
  142. package/dist/FilterGroup/Counter/Counter.js +31 -43
  143. package/dist/FilterGroup/Counter/Counter.styles.js +12 -15
  144. package/dist/FilterGroup/FilterContent/FilterContent.js +138 -177
  145. package/dist/FilterGroup/FilterContent/FilterContent.styles.js +46 -53
  146. package/dist/FilterGroup/FilterContent/HeaderButton.js +77 -100
  147. package/dist/FilterGroup/FilterGroup.js +87 -136
  148. package/dist/FilterGroup/FilterGroup.styles.js +9 -10
  149. package/dist/FilterGroup/FilterGroupContext.js +68 -73
  150. package/dist/FilterGroup/LeftPanel/LeftPanel.js +28 -31
  151. package/dist/FilterGroup/LeftPanel/LeftPanel.styles.js +6 -11
  152. package/dist/FilterGroup/RightPanel/RightPanel.js +118 -151
  153. package/dist/FilterGroup/RightPanel/RightPanel.styles.js +17 -27
  154. package/dist/Focus/Focus.js +248 -344
  155. package/dist/Focus/Focus.styles.js +28 -39
  156. package/dist/Focus/utils.js +14 -20
  157. package/dist/Footer/Footer.js +36 -38
  158. package/dist/Footer/Footer.styles.js +40 -43
  159. package/dist/FormElement/Adornment/Adornment.js +38 -49
  160. package/dist/FormElement/Adornment/Adornment.styles.js +14 -15
  161. package/dist/FormElement/CharCounter/CharCounter.js +51 -73
  162. package/dist/FormElement/CharCounter/CharCounter.styles.js +12 -10
  163. package/dist/FormElement/FormElement.js +53 -31
  164. package/dist/FormElement/FormElement.styles.js +4 -7
  165. package/dist/FormElement/InfoMessage/InfoMessage.js +26 -41
  166. package/dist/FormElement/InfoMessage/InfoMessage.styles.js +11 -9
  167. package/dist/FormElement/Label/Label.js +33 -56
  168. package/dist/FormElement/Label/Label.styles.js +11 -9
  169. package/dist/FormElement/LabelContainer.js +46 -55
  170. package/dist/FormElement/Suggestions/Suggestions.js +46 -71
  171. package/dist/FormElement/Suggestions/Suggestions.styles.js +9 -16
  172. package/dist/FormElement/WarningText/WarningText.js +41 -62
  173. package/dist/FormElement/WarningText/WarningText.styles.js +25 -28
  174. package/dist/FormElement/context.js +6 -10
  175. package/dist/FormElement/utils.js +54 -58
  176. package/dist/GlobalActions/GlobalActions.js +53 -59
  177. package/dist/GlobalActions/GlobalActions.styles.js +67 -76
  178. package/dist/Grid/Grid.js +82 -112
  179. package/dist/Grid/Grid.styles.js +37 -38
  180. package/dist/Header/Actions/Actions.js +15 -17
  181. package/dist/Header/Actions/Actions.styles.js +12 -15
  182. package/dist/Header/Brand/Brand.js +27 -23
  183. package/dist/Header/Brand/Brand.styles.js +16 -14
  184. package/dist/Header/Header.js +22 -31
  185. package/dist/Header/Header.styles.js +32 -30
  186. package/dist/Header/Navigation/MenuBar/Bar.js +23 -36
  187. package/dist/Header/Navigation/MenuBar/Bar.styles.js +54 -61
  188. package/dist/Header/Navigation/MenuBar/MenuBar.js +20 -26
  189. package/dist/Header/Navigation/MenuItem/MenuItem.js +104 -120
  190. package/dist/Header/Navigation/MenuItem/MenuItem.styles.js +48 -63
  191. package/dist/Header/Navigation/Navigation.js +32 -37
  192. package/dist/Header/Navigation/Navigation.styles.js +11 -17
  193. package/dist/Header/Navigation/useSelectionPath.js +17 -20
  194. package/dist/Header/Navigation/utils/FocusContext.js +23 -20
  195. package/dist/Header/Navigation/utils/SelectionContext.js +4 -4
  196. package/dist/IconButton/IconButton.js +25 -32
  197. package/dist/IconContainer/IconContainer.js +55 -76
  198. package/dist/InlineEditor/InlineEditor.js +105 -131
  199. package/dist/InlineEditor/InlineEditor.styles.js +44 -53
  200. package/dist/Input/Input.js +385 -461
  201. package/dist/Input/Input.styles.js +34 -47
  202. package/dist/Input/icons.js +16 -21
  203. package/dist/Input/utils.js +8 -11
  204. package/dist/List/List.js +196 -247
  205. package/dist/List/List.styles.js +44 -49
  206. package/dist/List/useSelectableList.js +11 -8
  207. package/dist/List/utils.js +24 -33
  208. package/dist/ListContainer/ListContainer.js +52 -65
  209. package/dist/ListContainer/ListContainer.styles.js +7 -10
  210. package/dist/ListContainer/ListContext/ListContext.js +4 -4
  211. package/dist/ListContainer/ListItem/ListItem.js +79 -117
  212. package/dist/ListContainer/ListItem/ListItem.styles.js +57 -78
  213. package/dist/Loading/Loading.js +31 -46
  214. package/dist/Loading/Loading.styles.js +41 -48
  215. package/dist/LoadingContainer/LoadingContainer.js +34 -40
  216. package/dist/LoadingContainer/LoadingContainer.styles.js +17 -18
  217. package/dist/Login/Login.js +22 -29
  218. package/dist/Login/Login.styles.js +20 -21
  219. package/dist/MultiButton/MultiButton.js +41 -59
  220. package/dist/MultiButton/MultiButton.styles.js +117 -137
  221. package/dist/NumberInput/NumberInput.js +51 -50
  222. package/dist/NumberInput/NumberInput.styles.js +5 -10
  223. package/dist/OverflowTooltip/OverflowTooltip.js +55 -75
  224. package/dist/OverflowTooltip/OverflowTooltip.styles.js +19 -23
  225. package/dist/Pagination/Pagination.js +176 -164
  226. package/dist/Pagination/Pagination.styles.js +86 -90
  227. package/dist/Pagination/Select.js +51 -60
  228. package/dist/Pagination/Select.styles.js +13 -19
  229. package/dist/Panel/Panel.js +19 -20
  230. package/dist/Panel/Panel.styles.js +12 -15
  231. package/dist/ProgressBar/ProgressBar.js +40 -53
  232. package/dist/ProgressBar/ProgressBar.styles.js +28 -40
  233. package/dist/QueryBuilder/ConfirmationDialog.js +35 -28
  234. package/dist/QueryBuilder/Context.js +308 -322
  235. package/dist/QueryBuilder/QueryBuilder.js +108 -137
  236. package/dist/QueryBuilder/QueryBuilder.styles.js +117 -108
  237. package/dist/QueryBuilder/Rule/Attribute.js +56 -63
  238. package/dist/QueryBuilder/Rule/Operator.js +53 -58
  239. package/dist/QueryBuilder/Rule/Rule.js +70 -88
  240. package/dist/QueryBuilder/Rule/Rule.styles.js +49 -56
  241. package/dist/QueryBuilder/RuleGroup.js +160 -206
  242. package/dist/QueryBuilder/Value/BooleanValue.js +38 -37
  243. package/dist/QueryBuilder/Value/DateTimeValue.js +233 -299
  244. package/dist/QueryBuilder/Value/EmptyValue.js +14 -14
  245. package/dist/QueryBuilder/Value/NumericValue.js +152 -204
  246. package/dist/QueryBuilder/Value/TextValue.js +38 -54
  247. package/dist/QueryBuilder/Value/Value.js +42 -67
  248. package/dist/QueryBuilder/types.js +4 -4
  249. package/dist/QueryBuilder/utils/index.js +40 -74
  250. package/dist/QueryBuilder/utils/reducer.js +86 -92
  251. package/dist/Radio/Radio.js +96 -145
  252. package/dist/Radio/Radio.styles.js +47 -55
  253. package/dist/RadioGroup/RadioGroup.js +98 -159
  254. package/dist/RadioGroup/RadioGroup.styles.js +28 -34
  255. package/dist/ScrollToHorizontal/HorizontalScrollListItem/HorizontalScrollListItem.js +34 -51
  256. package/dist/ScrollToHorizontal/HorizontalScrollListItem/HorizontalScrollListItem.styles.js +39 -48
  257. package/dist/ScrollToHorizontal/ScrollToHorizontal.js +56 -91
  258. package/dist/ScrollToHorizontal/ScrollToHorizontal.styles.js +28 -32
  259. package/dist/ScrollToVertical/ScrollToVertical.js +45 -77
  260. package/dist/ScrollToVertical/ScrollToVertical.styles.js +31 -38
  261. package/dist/ScrollToVertical/VerticalScrollListItem/VerticalScrollListItem.js +30 -39
  262. package/dist/ScrollToVertical/VerticalScrollListItem/VerticalScrollListItem.styles.js +44 -51
  263. package/dist/SearchInput/SearchInput.js +27 -25
  264. package/dist/SearchInput/SearchInput.styles.js +6 -7
  265. package/dist/Section/Section.js +69 -104
  266. package/dist/Section/Section.styles.js +53 -57
  267. package/dist/Select/Option.js +29 -46
  268. package/dist/Select/OptionGroup.js +18 -30
  269. package/dist/Select/Select.js +163 -219
  270. package/dist/Select/Select.styles.js +26 -32
  271. package/dist/SelectionList/SelectionList.js +162 -216
  272. package/dist/SelectionList/SelectionList.styles.js +36 -36
  273. package/dist/SimpleGrid/SimpleGrid.js +16 -27
  274. package/dist/SimpleGrid/SimpleGrid.styles.js +28 -39
  275. package/dist/Skeleton/Skeleton.js +26 -44
  276. package/dist/Skeleton/Skeleton.styles.js +43 -66
  277. package/dist/Slider/Slider.js +316 -431
  278. package/dist/Slider/Slider.styles.js +183 -216
  279. package/dist/Slider/SliderInput/SliderInput.js +38 -57
  280. package/dist/Slider/SliderInput/SliderInput.styles.js +13 -14
  281. package/dist/Slider/base.js +221 -243
  282. package/dist/Slider/utils.js +247 -233
  283. package/dist/Snackbar/Snackbar.js +59 -88
  284. package/dist/Snackbar/Snackbar.styles.js +25 -42
  285. package/dist/Snackbar/SnackbarContent/SnackbarContent.js +31 -50
  286. package/dist/Snackbar/SnackbarContent/SnackbarContent.styles.js +27 -30
  287. package/dist/SnackbarProvider/SnackbarProvider.js +73 -105
  288. package/dist/SnackbarProvider/SnackbarProvider.styles.js +20 -26
  289. package/dist/Stack/Stack.js +74 -84
  290. package/dist/Stack/Stack.styles.js +14 -33
  291. package/dist/StatusIcon/StatusIcon.js +78 -102
  292. package/dist/StatusIcon/StatusIcon.styles.js +42 -52
  293. package/dist/Switch/Switch.js +91 -138
  294. package/dist/Switch/Switch.styles.js +49 -60
  295. package/dist/Table/Table.js +62 -66
  296. package/dist/Table/Table.styles.js +23 -28
  297. package/dist/Table/TableBody/TableBody.js +45 -56
  298. package/dist/Table/TableBody/TableBody.styles.js +8 -7
  299. package/dist/Table/TableCell/TableCell.js +37 -66
  300. package/dist/Table/TableCell/TableCell.styles.js +125 -162
  301. package/dist/Table/TableContainer/TableContainer.js +18 -28
  302. package/dist/Table/TableContainer/TableContainer.styles.js +8 -12
  303. package/dist/Table/TableContext.js +4 -4
  304. package/dist/Table/TableHead/TableHead.js +27 -39
  305. package/dist/Table/TableHead/TableHead.styles.js +10 -7
  306. package/dist/Table/TableHeader/TableHeader.js +73 -124
  307. package/dist/Table/TableHeader/TableHeader.styles.js +135 -150
  308. package/dist/Table/TableHeader/utils.js +11 -15
  309. package/dist/Table/TableRow/TableRow.js +32 -51
  310. package/dist/Table/TableRow/TableRow.styles.js +64 -84
  311. package/dist/Table/TableSection/TableSection.js +21 -20
  312. package/dist/Table/TableSection/TableSection.styles.js +63 -96
  313. package/dist/Table/TableSectionContext.js +4 -4
  314. package/dist/Table/hooks/useHvBulkActions.js +54 -89
  315. package/dist/Table/hooks/useHvFilters.js +4 -4
  316. package/dist/Table/hooks/useHvGlobalFilter.js +4 -4
  317. package/dist/Table/hooks/useHvHeaderGroups.js +73 -82
  318. package/dist/Table/hooks/useHvPagination.js +31 -51
  319. package/dist/Table/hooks/useHvResizeColumns.js +25 -31
  320. package/dist/Table/hooks/useHvRowExpand.js +54 -69
  321. package/dist/Table/hooks/useHvRowSelection.js +294 -420
  322. package/dist/Table/hooks/useHvRowState.js +4 -4
  323. package/dist/Table/hooks/useHvSortBy.js +23 -30
  324. package/dist/Table/hooks/useHvSticky.js +114 -154
  325. package/dist/Table/hooks/useHvTable.js +40 -64
  326. package/dist/Table/hooks/useHvTableStyles.js +51 -82
  327. package/dist/Table/renderers/DateColumnCell.js +12 -13
  328. package/dist/Table/renderers/DefaultCell.js +13 -20
  329. package/dist/Table/renderers/DropdownColumnCell.js +4 -4
  330. package/dist/Table/renderers/ProgressColumnCell.js +43 -47
  331. package/dist/Table/renderers/SwitchColumnCell.js +37 -50
  332. package/dist/Table/renderers/renderers.js +146 -183
  333. package/dist/Tabs/Tab/Tab.js +21 -31
  334. package/dist/Tabs/Tab/Tab.styles.js +44 -54
  335. package/dist/Tabs/Tabs.js +23 -28
  336. package/dist/Tabs/Tabs.styles.js +9 -14
  337. package/dist/Tag/Tag.js +86 -129
  338. package/dist/Tag/Tag.styles.js +63 -88
  339. package/dist/TagsInput/TagsInput.js +349 -417
  340. package/dist/TagsInput/TagsInput.styles.js +77 -90
  341. package/dist/TextArea/TextArea.js +207 -274
  342. package/dist/TextArea/TextArea.styles.js +25 -20
  343. package/dist/TimeAgo/TimeAgo.js +24 -30
  344. package/dist/TimeAgo/TimeAgo.styles.js +4 -7
  345. package/dist/TimeAgo/formatUtils.js +57 -65
  346. package/dist/TimeAgo/useTimeAgo.js +18 -18
  347. package/dist/TimeAgo/useTimeout.js +14 -14
  348. package/dist/TimePicker/Placeholder.js +46 -52
  349. package/dist/TimePicker/TimePicker.js +164 -214
  350. package/dist/TimePicker/TimePicker.styles.js +30 -39
  351. package/dist/TimePicker/Unit/Unit.js +63 -49
  352. package/dist/TimePicker/Unit/Unit.styles.js +41 -46
  353. package/dist/ToggleButton/ToggleButton.js +25 -34
  354. package/dist/Tooltip/Tooltip.js +41 -51
  355. package/dist/Tooltip/Tooltip.styles.js +25 -26
  356. package/dist/TreeView/TreeItem/DefaultContent.js +51 -72
  357. package/dist/TreeView/TreeItem/TreeItem.js +102 -140
  358. package/dist/TreeView/TreeItem/TreeItem.styles.js +56 -70
  359. package/dist/TreeView/TreeItem/useHvTreeItem.js +38 -53
  360. package/dist/TreeView/TreeView.js +65 -62
  361. package/dist/TreeView/TreeView.styles.js +11 -13
  362. package/dist/TreeView/internals/DescendantProvider.js +120 -120
  363. package/dist/TreeView/internals/TreeViewProvider.js +32 -26
  364. package/dist/TreeView/internals/corePlugins.js +8 -4
  365. package/dist/TreeView/internals/hooks/plugins/defaultPlugins.js +10 -10
  366. package/dist/TreeView/internals/hooks/plugins/useTreeViewContextValueBuilder.js +20 -22
  367. package/dist/TreeView/internals/hooks/plugins/useTreeViewExpansion.js +39 -61
  368. package/dist/TreeView/internals/hooks/plugins/useTreeViewFocus.js +56 -80
  369. package/dist/TreeView/internals/hooks/plugins/useTreeViewKeyboardNavigation.js +149 -211
  370. package/dist/TreeView/internals/hooks/plugins/useTreeViewNodes.js +42 -68
  371. package/dist/TreeView/internals/hooks/plugins/useTreeViewSelection.js +162 -195
  372. package/dist/TreeView/internals/hooks/useInstanceEventHandler.js +52 -74
  373. package/dist/TreeView/internals/hooks/useTreeView.js +54 -69
  374. package/dist/TreeView/internals/hooks/useTreeViewInstanceEvents.js +28 -33
  375. package/dist/TreeView/internals/hooks/useTreeViewModels.js +34 -43
  376. package/dist/TreeView/internals/hooks/utils.js +28 -42
  377. package/dist/TreeView/internals/utils/EventManager.js +49 -58
  378. package/dist/TreeView/internals/utils/FinalizationRegistryBasedCleanupTracking.js +14 -18
  379. package/dist/TreeView/internals/utils/TimerBasedCleanupTracking.js +33 -37
  380. package/dist/TreeView/internals/utils/publishTreeViewEvent.js +5 -5
  381. package/dist/Typography/Typography.js +34 -51
  382. package/dist/Typography/Typography.styles.js +20 -23
  383. package/dist/VerticalNavigation/Actions/Action.js +23 -42
  384. package/dist/VerticalNavigation/Actions/Action.styles.js +21 -28
  385. package/dist/VerticalNavigation/Actions/Actions.js +15 -31
  386. package/dist/VerticalNavigation/Actions/Actions.styles.js +13 -19
  387. package/dist/VerticalNavigation/Header/Header.js +51 -91
  388. package/dist/VerticalNavigation/Header/Header.styles.js +22 -32
  389. package/dist/VerticalNavigation/Navigation/Navigation.js +183 -267
  390. package/dist/VerticalNavigation/Navigation/Navigation.styles.js +14 -24
  391. package/dist/VerticalNavigation/NavigationPopup/NavigationPopup.styles.js +9 -17
  392. package/dist/VerticalNavigation/NavigationPopup/NavigationPopupContainer.js +30 -32
  393. package/dist/VerticalNavigation/NavigationSlider/NavigationSlider.js +45 -63
  394. package/dist/VerticalNavigation/NavigationSlider/NavigationSlider.styles.js +23 -33
  395. package/dist/VerticalNavigation/NavigationSlider/utils.js +56 -39
  396. package/dist/VerticalNavigation/TreeView/TreeView.js +515 -664
  397. package/dist/VerticalNavigation/TreeView/TreeView.styles.js +10 -16
  398. package/dist/VerticalNavigation/TreeView/TreeViewContext.js +5 -6
  399. package/dist/VerticalNavigation/TreeView/TreeViewItem.js +319 -414
  400. package/dist/VerticalNavigation/TreeView/TreeViewItem.styles.js +91 -143
  401. package/dist/VerticalNavigation/VerticalNavigation.js +70 -97
  402. package/dist/VerticalNavigation/VerticalNavigation.styles.js +31 -45
  403. package/dist/VerticalNavigation/VerticalNavigationContext.js +8 -10
  404. package/dist/hooks/useClickOutside.js +21 -23
  405. package/dist/hooks/useComputation.js +13 -13
  406. package/dist/hooks/useControlled.js +10 -17
  407. package/dist/hooks/useEnhancedEffect.js +5 -5
  408. package/dist/hooks/useExpandable.js +24 -31
  409. package/dist/hooks/useFocus.js +31 -34
  410. package/dist/hooks/useForkRef.js +19 -19
  411. package/dist/hooks/useImageLoaded.js +26 -26
  412. package/dist/hooks/useIsMounted.js +13 -13
  413. package/dist/hooks/useLabels.js +7 -7
  414. package/dist/hooks/useScrollTo.js +101 -130
  415. package/dist/hooks/useUniqueId.js +6 -6
  416. package/dist/hooks/useWidth.js +10 -13
  417. package/dist/icons.js +77 -88
  418. package/dist/index.d.ts +8 -8
  419. package/dist/index.js +226 -554
  420. package/dist/providers/Provider.js +44 -75
  421. package/dist/providers/ThemeProvider.js +79 -71
  422. package/dist/providers/utils.js +40 -47
  423. package/dist/themes/index.js +6 -5
  424. package/dist/themes/next.js +132 -271
  425. package/dist/themes/pentaho.js +832 -1173
  426. package/dist/types/generic.js +5 -4
  427. package/dist/utils/Callout.js +123 -171
  428. package/dist/utils/CounterLabel.js +14 -15
  429. package/dist/utils/deepMerge.js +13 -15
  430. package/dist/utils/document.js +8 -8
  431. package/dist/utils/focusUtils.js +6 -7
  432. package/dist/utils/focusableElementFinder.js +23 -26
  433. package/dist/utils/helpers.js +15 -23
  434. package/dist/utils/iconVariant.js +15 -12
  435. package/dist/utils/keyboardUtils.js +28 -28
  436. package/dist/utils/multiSelectionEventHandler.js +37 -52
  437. package/dist/utils/scroll.js +50 -76
  438. package/dist/utils/setId.js +4 -4
  439. package/dist/utils/theme.js +11 -8
  440. package/dist/utils/useSavedState.js +19 -16
  441. package/package.json +5 -5
@@ -1,139 +1,119 @@
1
- import { createClasses } from "@hitachivantara/uikit-react-utils";
2
- import { theme } from "@hitachivantara/uikit-styles";
3
1
  import { staticClasses as staticClasses$1 } from "../DropDownMenu/DropDownMenu.styles.js";
4
- import "../DropDownMenu/DropDownMenu.js";
5
- const { staticClasses, useClasses } = createClasses("HvMultiButton", {
6
- root: {
7
- display: "flex",
8
- alignItems: "center",
9
- position: "relative"
10
- },
11
- multiple: {
12
- backgroundColor: theme.colors.bgPage,
13
- borderWidth: 0,
14
- borderColor: `${theme.colors.border} transparent`,
15
- borderRadius: theme.radii.base,
16
- "& $button": {
17
- minWidth: 32,
18
- maxWidth: 200,
19
- padding: 0,
20
- flex: "1 1 0%",
21
- borderColor: "inherit",
22
- borderRadius: 0,
23
- fontWeight: theme.typography.body.fontWeight,
24
- "&:disabled": {
25
- color: theme.colors.textDisabled,
26
- borderColor: "inherit"
27
- },
28
- "&:hover": {
29
- borderColor: "inherit"
30
- },
31
- "&$firstButton": {
32
- borderLeftColor: theme.colors.border,
33
- borderTopLeftRadius: "inherit",
34
- borderBottomLeftRadius: "inherit",
35
- "&:disabled": {
36
- borderLeftColor: theme.colors.border
37
- }
38
- },
39
- "&$lastButton": {
40
- borderRightColor: theme.colors.border,
41
- borderTopRightRadius: "inherit",
42
- borderBottomRightRadius: "inherit",
43
- "&:disabled": {
44
- borderRightColor: theme.colors.border
45
- }
46
- },
47
- "&:not($firstButton)": {
48
- marginLeft: "-1px"
49
- },
50
- "&$selected": {
51
- backgroundColor: theme.colors.bgContainer,
52
- fontWeight: theme.typography.label.fontWeight,
53
- borderColor: "currentcolor",
54
- zIndex: 2,
55
- "&:hover:not(:disabled),&:focus-visible": {
56
- backgroundColor: theme.colors.bgHover
57
- },
58
- "&:disabled": {
59
- zIndex: 1,
60
- borderColor: theme.colors.border
61
- }
62
- }
63
- }
64
- },
65
- splitGroup: {
66
- width: "fit-content",
67
- "& $button:not($firstButton)": {
68
- borderTopLeftRadius: 0,
69
- borderBottomLeftRadius: 0,
70
- "&:not([aria-controls])": {
71
- borderLeftWidth: 0
72
- }
73
- },
74
- "& $button:not($lastButton)": {
75
- borderTopRightRadius: 0,
76
- borderBottomRightRadius: 0,
77
- "&:not([aria-controls])": {
78
- borderRightWidth: 0
79
- },
80
- "&::after": {
81
- content: "''",
82
- position: "absolute",
83
- inset: "4px -1px 4px auto",
84
- width: 1,
85
- zIndex: 1,
86
- height: "auto",
87
- backgroundColor: "currentcolor"
88
- }
89
- }
90
- },
91
- splitGroupDisabled: {},
92
- button: {
93
- position: "relative",
94
- // prevent the focus ring to be hidden by sibling hover background
95
- [`&:focus-visible, &.${staticClasses$1.open}`]: {
96
- zIndex: 5
97
- }
98
- },
99
- selected: {},
100
- vertical: {
101
- flexDirection: "column",
102
- alignItems: "stretch",
103
- height: "auto",
104
- borderColor: `transparent ${theme.colors.border}`,
105
- "& $button": {
106
- minWidth: 32,
107
- flex: "1 1 32px",
108
- "&$firstButton": {
109
- borderTopColor: theme.colors.border,
110
- borderTopLeftRadius: "inherit",
111
- borderTopRightRadius: "inherit",
112
- borderBottomLeftRadius: 0,
113
- borderBottomRightRadius: 0
114
- },
115
- "&$lastButton": {
116
- borderBottomColor: theme.colors.border,
117
- borderBottomLeftRadius: "inherit",
118
- borderBottomRightRadius: "inherit",
119
- borderTopLeftRadius: 0,
120
- borderTopRightRadius: 0
121
- },
122
- "&:not($firstButton)": {
123
- marginLeft: 0,
124
- marginTop: -1
125
- },
126
- "&$selected": {
127
- height: 32,
128
- borderColor: "currentcolor"
129
- }
130
- }
131
- },
132
- // TODO - review the need for these classes in v6 (use :first-child and :last-child instead)
133
- firstButton: {},
134
- lastButton: {}
2
+ import { theme } from "@hitachivantara/uikit-styles";
3
+ import { createClasses } from "@hitachivantara/uikit-react-utils";
4
+ //#region src/MultiButton/MultiButton.styles.tsx
5
+ var { staticClasses, useClasses } = createClasses("HvMultiButton", {
6
+ root: {
7
+ display: "flex",
8
+ alignItems: "center",
9
+ position: "relative"
10
+ },
11
+ multiple: {
12
+ backgroundColor: theme.colors.bgPage,
13
+ borderWidth: 0,
14
+ borderColor: `${theme.colors.border} transparent`,
15
+ borderRadius: theme.radii.base,
16
+ "& $button": {
17
+ minWidth: 32,
18
+ maxWidth: 200,
19
+ padding: 0,
20
+ flex: "1 1 0%",
21
+ borderColor: "inherit",
22
+ borderRadius: 0,
23
+ fontWeight: theme.typography.body.fontWeight,
24
+ "&:disabled": {
25
+ color: theme.colors.textDisabled,
26
+ borderColor: "inherit"
27
+ },
28
+ "&:hover": { borderColor: "inherit" },
29
+ "&$firstButton": {
30
+ borderLeftColor: theme.colors.border,
31
+ borderTopLeftRadius: "inherit",
32
+ borderBottomLeftRadius: "inherit",
33
+ "&:disabled": { borderLeftColor: theme.colors.border }
34
+ },
35
+ "&$lastButton": {
36
+ borderRightColor: theme.colors.border,
37
+ borderTopRightRadius: "inherit",
38
+ borderBottomRightRadius: "inherit",
39
+ "&:disabled": { borderRightColor: theme.colors.border }
40
+ },
41
+ "&:not($firstButton)": { marginLeft: "-1px" },
42
+ "&$selected": {
43
+ backgroundColor: theme.colors.bgContainer,
44
+ fontWeight: theme.typography.label.fontWeight,
45
+ borderColor: "currentcolor",
46
+ zIndex: 2,
47
+ "&:hover:not(:disabled),&:focus-visible": { backgroundColor: theme.colors.bgHover },
48
+ "&:disabled": {
49
+ zIndex: 1,
50
+ borderColor: theme.colors.border
51
+ }
52
+ }
53
+ }
54
+ },
55
+ splitGroup: {
56
+ width: "fit-content",
57
+ "& $button:not($firstButton)": {
58
+ borderTopLeftRadius: 0,
59
+ borderBottomLeftRadius: 0,
60
+ "&:not([aria-controls])": { borderLeftWidth: 0 }
61
+ },
62
+ "& $button:not($lastButton)": {
63
+ borderTopRightRadius: 0,
64
+ borderBottomRightRadius: 0,
65
+ "&:not([aria-controls])": { borderRightWidth: 0 },
66
+ "&::after": {
67
+ content: "''",
68
+ position: "absolute",
69
+ inset: "4px -1px 4px auto",
70
+ width: 1,
71
+ zIndex: 1,
72
+ height: "auto",
73
+ backgroundColor: "currentcolor"
74
+ }
75
+ }
76
+ },
77
+ splitGroupDisabled: {},
78
+ button: {
79
+ position: "relative",
80
+ [`&:focus-visible, &.${staticClasses$1.open}`]: { zIndex: 5 }
81
+ },
82
+ selected: {},
83
+ vertical: {
84
+ flexDirection: "column",
85
+ alignItems: "stretch",
86
+ height: "auto",
87
+ borderColor: `transparent ${theme.colors.border}`,
88
+ "& $button": {
89
+ minWidth: 32,
90
+ flex: "1 1 32px",
91
+ "&$firstButton": {
92
+ borderTopColor: theme.colors.border,
93
+ borderTopLeftRadius: "inherit",
94
+ borderTopRightRadius: "inherit",
95
+ borderBottomLeftRadius: 0,
96
+ borderBottomRightRadius: 0
97
+ },
98
+ "&$lastButton": {
99
+ borderBottomColor: theme.colors.border,
100
+ borderBottomLeftRadius: "inherit",
101
+ borderBottomRightRadius: "inherit",
102
+ borderTopLeftRadius: 0,
103
+ borderTopRightRadius: 0
104
+ },
105
+ "&:not($firstButton)": {
106
+ marginLeft: 0,
107
+ marginTop: -1
108
+ },
109
+ "&$selected": {
110
+ height: 32,
111
+ borderColor: "currentcolor"
112
+ }
113
+ }
114
+ },
115
+ firstButton: {},
116
+ lastButton: {}
135
117
  });
136
- export {
137
- staticClasses,
138
- useClasses
139
- };
118
+ //#endregion
119
+ export { staticClasses, useClasses };
@@ -1,54 +1,55 @@
1
- import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
- import { forwardRef, useRef, useMemo } from "react";
3
- import { useForkRef } from "@mui/material/utils";
4
- import { useDefaultProps } from "@hitachivantara/uikit-react-utils";
1
+ import { HvAdornment } from "../FormElement/Adornment/Adornment.js";
5
2
  import { HvIcon } from "../icons.js";
6
3
  import { changeInputValue } from "../Input/utils.js";
7
- import { useClasses } from "./NumberInput.styles.js";
8
4
  import { HvInput } from "../Input/Input.js";
9
- import { HvAdornment } from "../FormElement/Adornment/Adornment.js";
10
- const HvNumberInput = forwardRef(function HvNumberInput2(props, ref) {
11
- const {
12
- classes: classesProp,
13
- className,
14
- readOnly,
15
- ...others
16
- } = useDefaultProps("HvNumberInput", props);
17
- const { classes, cx } = useClasses(classesProp);
18
- const inputRef = useRef(null);
19
- const forkedRef = useForkRef(ref, inputRef);
20
- const buttons = useMemo(() => {
21
- const handleIncrease = () => {
22
- if (inputRef.current) {
23
- inputRef.current.stepUp();
24
- changeInputValue(inputRef.current, inputRef.current.value);
25
- }
26
- };
27
- const handleDecrease = () => {
28
- if (inputRef.current) {
29
- inputRef.current.stepDown();
30
- changeInputValue(inputRef.current, inputRef.current.value);
31
- }
32
- };
33
- return /* @__PURE__ */ jsxs(Fragment, { children: [
34
- /* @__PURE__ */ jsx(HvAdornment, { icon: /* @__PURE__ */ jsx(HvIcon, { name: "Remove" }), onClick: handleDecrease }),
35
- /* @__PURE__ */ jsx(HvAdornment, { icon: /* @__PURE__ */ jsx(HvIcon, { name: "Add" }), onClick: handleIncrease })
36
- ] });
37
- }, []);
38
- return /* @__PURE__ */ jsx(
39
- HvInput,
40
- {
41
- ref: forkedRef,
42
- type: "number",
43
- className: cx(classes.root, className),
44
- endAdornment: !readOnly && buttons,
45
- classes,
46
- readOnly,
47
- disableClear: true,
48
- ...others
49
- }
50
- );
5
+ import { useClasses } from "./NumberInput.styles.js";
6
+ import { useDefaultProps } from "@hitachivantara/uikit-react-utils";
7
+ import { forwardRef, useMemo, useRef } from "react";
8
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
9
+ import { useForkRef } from "@mui/material/utils";
10
+ //#region src/NumberInput/NumberInput.tsx
11
+ /**
12
+ * A Number Input lets users enter numeric values and provides buttons to increment or decrement the value.
13
+ * It extends the HvInput component—refer to its documentation for additional available props.
14
+ *
15
+ * @extends HvInput
16
+ */
17
+ var HvNumberInput = forwardRef(function HvNumberInput(props, ref) {
18
+ const { classes: classesProp, className, readOnly, ...others } = useDefaultProps("HvNumberInput", props);
19
+ const { classes, cx } = useClasses(classesProp);
20
+ const inputRef = useRef(null);
21
+ const forkedRef = useForkRef(ref, inputRef);
22
+ const buttons = useMemo(() => {
23
+ const handleIncrease = () => {
24
+ if (inputRef.current) {
25
+ inputRef.current.stepUp();
26
+ changeInputValue(inputRef.current, inputRef.current.value);
27
+ }
28
+ };
29
+ const handleDecrease = () => {
30
+ if (inputRef.current) {
31
+ inputRef.current.stepDown();
32
+ changeInputValue(inputRef.current, inputRef.current.value);
33
+ }
34
+ };
35
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(HvAdornment, {
36
+ icon: /* @__PURE__ */ jsx(HvIcon, { name: "Remove" }),
37
+ onClick: handleDecrease
38
+ }), /* @__PURE__ */ jsx(HvAdornment, {
39
+ icon: /* @__PURE__ */ jsx(HvIcon, { name: "Add" }),
40
+ onClick: handleIncrease
41
+ })] });
42
+ }, []);
43
+ return /* @__PURE__ */ jsx(HvInput, {
44
+ ref: forkedRef,
45
+ type: "number",
46
+ className: cx(classes.root, className),
47
+ endAdornment: !readOnly && buttons,
48
+ classes,
49
+ readOnly,
50
+ disableClear: true,
51
+ ...others
52
+ });
51
53
  });
52
- export {
53
- HvNumberInput
54
- };
54
+ //#endregion
55
+ export { HvNumberInput };
@@ -1,11 +1,6 @@
1
- import { createClasses } from "@hitachivantara/uikit-react-utils";
2
1
  import { staticClasses as staticClasses$1 } from "../Input/Input.styles.js";
3
- import "../Input/Input.js";
4
- const { staticClasses, useClasses } = createClasses(
5
- "HvNumberInput",
6
- staticClasses$1
7
- );
8
- export {
9
- staticClasses,
10
- useClasses
11
- };
2
+ import { createClasses } from "@hitachivantara/uikit-react-utils";
3
+ //#region src/NumberInput/NumberInput.styles.ts
4
+ var { staticClasses, useClasses } = createClasses("HvNumberInput", staticClasses$1);
5
+ //#endregion
6
+ export { useClasses };
@@ -1,78 +1,58 @@
1
+ import { HvTooltip } from "../Tooltip/Tooltip.js";
2
+ import { useClasses } from "./OverflowTooltip.styles.js";
3
+ import { useDefaultProps } from "@hitachivantara/uikit-react-utils";
4
+ import { useMemo, useState } from "react";
1
5
  import { jsx } from "react/jsx-runtime";
2
- import { useState, useMemo } from "react";
3
6
  import { useResizeDetector } from "react-resize-detector";
4
- import { useDefaultProps } from "@hitachivantara/uikit-react-utils";
5
- import { useClasses } from "./OverflowTooltip.styles.js";
6
- import { staticClasses } from "./OverflowTooltip.styles.js";
7
- import { HvTooltip } from "../Tooltip/Tooltip.js";
8
- const isParagraph = (children = "") => /\s/.test(children);
9
- const HvOverflowTooltip = (props) => {
10
- const {
11
- classes: classesProp,
12
- className,
13
- data,
14
- paragraphOverflow,
15
- tooltipsProps,
16
- ...others
17
- } = useDefaultProps("HvOverflowTooltip", props);
18
- const { classes, cx } = useClasses(classesProp);
19
- const [isOverflowing, setIsOverflowing] = useState(false);
20
- const isParag = useMemo(
21
- () => paragraphOverflow && isParagraph(data?.toString()),
22
- [data, paragraphOverflow]
23
- );
24
- const { ref } = useResizeDetector({
25
- refreshMode: "throttle",
26
- disableRerender: true,
27
- refreshRate: 100,
28
- refreshOptions: { trailing: true, leading: true },
29
- onResize({ width, height, entry }) {
30
- const { scrollHeight = 0, scrollWidth = 0 } = entry?.target || {};
31
- setIsOverflowing(
32
- isParag ? scrollHeight - (height || 0) >= 1 : scrollWidth - (width || 0) >= 1
33
- );
34
- }
35
- });
36
- const content = useMemo(
37
- () => /* @__PURE__ */ jsx(
38
- "div",
39
- {
40
- ref,
41
- className: cx(
42
- {
43
- [classes.tooltipAnchor]: !isParag,
44
- [classes.tooltipAnchorParagraph]: isParag
45
- },
46
- className
47
- ),
48
- children: data
49
- }
50
- ),
51
- [
52
- className,
53
- classes.tooltipAnchor,
54
- classes.tooltipAnchorParagraph,
55
- cx,
56
- data,
57
- isParag,
58
- ref
59
- ]
60
- );
61
- return /* @__PURE__ */ jsx(
62
- HvTooltip,
63
- {
64
- disableHoverListener: !isOverflowing,
65
- classes: { tooltip: classes.tooltipData },
66
- title: data,
67
- "aria-label": null,
68
- "aria-labelledby": null,
69
- ...tooltipsProps,
70
- ...others,
71
- children: content
72
- }
73
- );
74
- };
75
- export {
76
- HvOverflowTooltip,
77
- staticClasses as overflowTooltipClasses
7
+ //#region src/OverflowTooltip/OverflowTooltip.tsx
8
+ var isParagraph = (children = "") => /\s/.test(children);
9
+ /**
10
+ * Displays a tooltip automatically when the text content overflows its container.
11
+ */
12
+ var HvOverflowTooltip = (props) => {
13
+ const { classes: classesProp, className, data, paragraphOverflow, tooltipsProps, ...others } = useDefaultProps("HvOverflowTooltip", props);
14
+ const { classes, cx } = useClasses(classesProp);
15
+ const [isOverflowing, setIsOverflowing] = useState(false);
16
+ const isParag = useMemo(() => paragraphOverflow && isParagraph(data?.toString()), [data, paragraphOverflow]);
17
+ const { ref } = useResizeDetector({
18
+ refreshMode: "throttle",
19
+ disableRerender: true,
20
+ refreshRate: 100,
21
+ refreshOptions: {
22
+ trailing: true,
23
+ leading: true
24
+ },
25
+ onResize({ width, height, entry }) {
26
+ const { scrollHeight = 0, scrollWidth = 0 } = entry?.target || {};
27
+ setIsOverflowing(isParag ? scrollHeight - (height || 0) >= 1 : scrollWidth - (width || 0) >= 1);
28
+ }
29
+ });
30
+ const content = useMemo(() => /* @__PURE__ */ jsx("div", {
31
+ ref,
32
+ className: cx({
33
+ [classes.tooltipAnchor]: !isParag,
34
+ [classes.tooltipAnchorParagraph]: isParag
35
+ }, className),
36
+ children: data
37
+ }), [
38
+ className,
39
+ classes.tooltipAnchor,
40
+ classes.tooltipAnchorParagraph,
41
+ cx,
42
+ data,
43
+ isParag,
44
+ ref
45
+ ]);
46
+ return /* @__PURE__ */ jsx(HvTooltip, {
47
+ disableHoverListener: !isOverflowing,
48
+ classes: { tooltip: classes.tooltipData },
49
+ title: data,
50
+ "aria-label": null,
51
+ "aria-labelledby": null,
52
+ ...tooltipsProps,
53
+ ...others,
54
+ children: content
55
+ });
78
56
  };
57
+ //#endregion
58
+ export { HvOverflowTooltip };
@@ -1,24 +1,20 @@
1
1
  import { createClasses } from "@hitachivantara/uikit-react-utils";
2
- const { staticClasses, useClasses } = createClasses(
3
- "HvOverflowTooltip",
4
- {
5
- tooltipData: {},
6
- tooltipAnchor: {
7
- whiteSpace: "nowrap",
8
- overflow: "hidden",
9
- textOverflow: "ellipsis",
10
- maxWidth: "100%",
11
- width: "fit-content"
12
- },
13
- tooltipAnchorParagraph: {
14
- overflow: "hidden",
15
- display: "-webkit-box",
16
- WebkitLineClamp: 3,
17
- WebkitBoxOrient: "vertical"
18
- }
19
- }
20
- );
21
- export {
22
- staticClasses,
23
- useClasses
24
- };
2
+ //#region src/OverflowTooltip/OverflowTooltip.styles.tsx
3
+ var { staticClasses, useClasses } = createClasses("HvOverflowTooltip", {
4
+ tooltipData: {},
5
+ tooltipAnchor: {
6
+ whiteSpace: "nowrap",
7
+ overflow: "hidden",
8
+ textOverflow: "ellipsis",
9
+ maxWidth: "100%",
10
+ width: "fit-content"
11
+ },
12
+ tooltipAnchorParagraph: {
13
+ overflow: "hidden",
14
+ display: "-webkit-box",
15
+ WebkitLineClamp: 3,
16
+ WebkitBoxOrient: "vertical"
17
+ }
18
+ });
19
+ //#endregion
20
+ export { staticClasses, useClasses };