@hitachivantara/uikit-react-core 5.66.9 → 5.66.11

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 (462) hide show
  1. package/dist/cjs/Accordion/Accordion.cjs +1 -1
  2. package/dist/cjs/ActionBar/ActionBar.cjs +1 -1
  3. package/dist/cjs/ActionsGeneric/ActionsGeneric.cjs +1 -1
  4. package/dist/cjs/AppSwitcher/Action/Action.cjs +1 -1
  5. package/dist/cjs/AppSwitcher/AppSwitcher.cjs +2 -2
  6. package/dist/cjs/Avatar/Avatar.cjs +1 -1
  7. package/dist/cjs/AvatarGroup/AvatarGroup.cjs +1 -1
  8. package/dist/cjs/AvatarGroup/AvatarGroupContext.cjs +1 -1
  9. package/dist/cjs/Badge/Badge.cjs +1 -1
  10. package/dist/cjs/Banner/Banner.cjs +1 -1
  11. package/dist/cjs/Banner/BannerContent/ActionContainer/ActionContainer.cjs +1 -1
  12. package/dist/cjs/Banner/BannerContent/BannerContent.cjs +1 -1
  13. package/dist/cjs/Banner/BannerContent/MessageContainer/MessageContainer.cjs +1 -1
  14. package/dist/cjs/BaseCheckBox/BaseCheckBox.cjs +1 -1
  15. package/dist/cjs/BaseCheckBox/icons.cjs +1 -1
  16. package/dist/cjs/BaseDropdown/BaseDropdown.cjs +1 -1
  17. package/dist/cjs/BaseInput/BaseInput.cjs +1 -1
  18. package/dist/cjs/BaseRadio/BaseRadio.cjs +1 -1
  19. package/dist/cjs/BaseRadio/icons.cjs +1 -1
  20. package/dist/cjs/BaseSwitch/BaseSwitch.cjs +1 -1
  21. package/dist/cjs/Box/Box.cjs +1 -1
  22. package/dist/cjs/BreadCrumb/BreadCrumb.cjs +1 -1
  23. package/dist/cjs/BreadCrumb/Page/Page.cjs +1 -1
  24. package/dist/cjs/BreadCrumb/PathElement/PathElement.cjs +1 -1
  25. package/dist/cjs/BreadCrumb/utils.cjs +1 -1
  26. package/dist/cjs/BulkActions/BulkActions.cjs +1 -1
  27. package/dist/cjs/BulkActions/BulkActions.styles.cjs +1 -1
  28. package/dist/cjs/Button/Button.cjs +1 -1
  29. package/dist/cjs/Calendar/Calendar.cjs +10 -4
  30. package/dist/cjs/Calendar/CalendarHeader/CalendarHeader.cjs +1 -1
  31. package/dist/cjs/Calendar/CalendarNavigation/ComposedNavigation/ComposedNavigation.cjs +1 -1
  32. package/dist/cjs/Calendar/CalendarNavigation/MonthSelector/MonthSelector.cjs +1 -1
  33. package/dist/cjs/Calendar/CalendarNavigation/Navigation/Navigation.cjs +1 -1
  34. package/dist/cjs/Calendar/SingleCalendar/CalendarCell.cjs +2 -2
  35. package/dist/cjs/Calendar/SingleCalendar/SingleCalendar.cjs +1 -1
  36. package/dist/cjs/Card/Card.cjs +1 -1
  37. package/dist/cjs/Card/Content/Content.cjs +1 -1
  38. package/dist/cjs/Card/Header/Header.cjs +1 -1
  39. package/dist/cjs/Card/Media/Media.cjs +1 -7
  40. package/dist/cjs/Carousel/Carousel.cjs +1 -1
  41. package/dist/cjs/Carousel/CarouselControls.cjs +1 -1
  42. package/dist/cjs/Carousel/CarouselSlide/CarouselSlide.cjs +1 -1
  43. package/dist/cjs/Carousel/CarouselThumbnails.cjs +1 -1
  44. package/dist/cjs/CheckBox/CheckBox.cjs +1 -1
  45. package/dist/cjs/CheckBoxGroup/CheckBoxGroup.cjs +1 -1
  46. package/dist/cjs/ColorPicker/ColorPicker.cjs +1 -1
  47. package/dist/cjs/ColorPicker/Fields/Fields.cjs +1 -1
  48. package/dist/cjs/ColorPicker/Picker/Picker.cjs +1 -1
  49. package/dist/cjs/ColorPicker/PresetColors/PresetColors.cjs +1 -1
  50. package/dist/cjs/ColorPicker/SavedColors/SavedColors.cjs +1 -1
  51. package/dist/cjs/Container/Container.cjs +1 -1
  52. package/dist/cjs/Controls/Controls.cjs +1 -1
  53. package/dist/cjs/Controls/LeftControl/LeftControl.cjs +1 -1
  54. package/dist/cjs/Controls/RightControl/RightControl.cjs +1 -1
  55. package/dist/cjs/DatePicker/DatePicker.cjs +1 -1
  56. package/dist/cjs/Dialog/Actions/Actions.cjs +1 -1
  57. package/dist/cjs/Dialog/Content/Content.cjs +1 -1
  58. package/dist/cjs/Dialog/Dialog.cjs +1 -1
  59. package/dist/cjs/Dialog/Title/Title.cjs +1 -1
  60. package/dist/cjs/DotPagination/DotPagination.cjs +1 -1
  61. package/dist/cjs/Drawer/Drawer.cjs +1 -1
  62. package/dist/cjs/DropDownMenu/DropDownMenu.cjs +1 -1
  63. package/dist/cjs/Dropdown/Dropdown.cjs +1 -1
  64. package/dist/cjs/Dropdown/List/List.cjs +1 -1
  65. package/dist/cjs/DropdownButton/DropdownButton.cjs +1 -1
  66. package/dist/cjs/EmptyState/EmptyState.cjs +1 -1
  67. package/dist/cjs/FileUploader/DropZone/DropZone.cjs +1 -1
  68. package/dist/cjs/FileUploader/File/File.cjs +1 -1
  69. package/dist/cjs/FileUploader/FileList/FileList.cjs +1 -1
  70. package/dist/cjs/FileUploader/FileUploader.cjs +1 -1
  71. package/dist/cjs/FileUploader/Preview/Preview.cjs +1 -1
  72. package/dist/cjs/FilterGroup/Counter/Counter.cjs +1 -1
  73. package/dist/cjs/FilterGroup/FilterContent/FilterContent.cjs +1 -1
  74. package/dist/cjs/FilterGroup/FilterGroup.cjs +1 -1
  75. package/dist/cjs/FilterGroup/FilterGroupContext.cjs +1 -1
  76. package/dist/cjs/FilterGroup/LeftPanel/LeftPanel.cjs +1 -1
  77. package/dist/cjs/FilterGroup/RightPanel/RightPanel.cjs +1 -1
  78. package/dist/cjs/Focus/Focus.cjs +2 -3
  79. package/dist/cjs/Footer/Footer.cjs +1 -1
  80. package/dist/cjs/Forms/Adornment/Adornment.cjs +1 -1
  81. package/dist/cjs/Forms/CharCounter/CharCounter.cjs +1 -1
  82. package/dist/cjs/Forms/FormElement/FormElement.cjs +1 -1
  83. package/dist/cjs/Forms/InfoMessage/InfoMessage.cjs +1 -1
  84. package/dist/cjs/Forms/Label/Label.cjs +1 -1
  85. package/dist/cjs/Forms/Suggestions/Suggestions.cjs +1 -1
  86. package/dist/cjs/Forms/WarningText/WarningText.cjs +1 -1
  87. package/dist/cjs/GlobalActions/GlobalActions.cjs +1 -1
  88. package/dist/cjs/Grid/Grid.cjs +5 -8
  89. package/dist/cjs/Header/Actions/Actions.cjs +1 -1
  90. package/dist/cjs/Header/Brand/Brand.cjs +1 -1
  91. package/dist/cjs/Header/Header.cjs +1 -1
  92. package/dist/cjs/Header/Navigation/MenuBar/Bar.cjs +1 -1
  93. package/dist/cjs/Header/Navigation/MenuBar/MenuBar.cjs +1 -1
  94. package/dist/cjs/Header/Navigation/MenuItem/MenuItem.cjs +2 -2
  95. package/dist/cjs/Header/Navigation/Navigation.cjs +1 -1
  96. package/dist/cjs/Header/Navigation/useSelectionPath.cjs +1 -1
  97. package/dist/cjs/Header/Navigation/utils/FocusContext.cjs +1 -1
  98. package/dist/cjs/IconButton/IconButton.cjs +1 -1
  99. package/dist/cjs/InlineEditor/InlineEditor.cjs +1 -1
  100. package/dist/cjs/Input/Input.cjs +1 -1
  101. package/dist/cjs/Kpi/Kpi.cjs +1 -1
  102. package/dist/cjs/Link/Link.cjs +1 -1
  103. package/dist/cjs/List/List.cjs +1 -1
  104. package/dist/cjs/List/utils.cjs +1 -1
  105. package/dist/cjs/ListContainer/ListContainer.cjs +1 -1
  106. package/dist/cjs/ListContainer/ListItem/ListItem.cjs +1 -1
  107. package/dist/cjs/Loading/Loading.cjs +1 -1
  108. package/dist/cjs/LoadingContainer/LoadingContainer.cjs +1 -1
  109. package/dist/cjs/Login/Login.cjs +1 -1
  110. package/dist/cjs/MultiButton/MultiButton.cjs +1 -1
  111. package/dist/cjs/OverflowTooltip/OverflowTooltip.cjs +1 -1
  112. package/dist/cjs/Pagination/Pagination.cjs +1 -1
  113. package/dist/cjs/Pagination/Select.cjs +1 -1
  114. package/dist/cjs/Panel/Panel.cjs +1 -1
  115. package/dist/cjs/ProgressBar/ProgressBar.cjs +1 -1
  116. package/dist/cjs/QueryBuilder/ConfirmationDialog/ConfirmationDialog.cjs +1 -1
  117. package/dist/cjs/QueryBuilder/Context.cjs +1 -1
  118. package/dist/cjs/QueryBuilder/QueryBuilder.cjs +1 -1
  119. package/dist/cjs/QueryBuilder/Rule/Attribute/Attribute.cjs +1 -1
  120. package/dist/cjs/QueryBuilder/Rule/Operator/Operator.cjs +1 -1
  121. package/dist/cjs/QueryBuilder/Rule/Rule.cjs +1 -1
  122. package/dist/cjs/QueryBuilder/Rule/Value/BooleanValue/BooleanValue.cjs +1 -1
  123. package/dist/cjs/QueryBuilder/Rule/Value/DateTimeValue/DateTimeValue.cjs +1 -1
  124. package/dist/cjs/QueryBuilder/Rule/Value/NumericValue/NumericValue.cjs +1 -1
  125. package/dist/cjs/QueryBuilder/Rule/Value/TextValue/TextValue.cjs +1 -1
  126. package/dist/cjs/QueryBuilder/Rule/Value/Value.cjs +1 -1
  127. package/dist/cjs/QueryBuilder/RuleGroup/RuleGroup.cjs +1 -1
  128. package/dist/cjs/QueryBuilder/utils/index.cjs +1 -1
  129. package/dist/cjs/Radio/Radio.cjs +1 -1
  130. package/dist/cjs/RadioGroup/RadioGroup.cjs +1 -1
  131. package/dist/cjs/ScrollTo/Horizontal/HorizontalScrollListItem/HorizontalScrollListItem.cjs +1 -1
  132. package/dist/cjs/ScrollTo/Horizontal/ScrollToHorizontal.cjs +1 -1
  133. package/dist/cjs/ScrollTo/Vertical/ScrollToVertical.cjs +1 -1
  134. package/dist/cjs/ScrollTo/Vertical/VerticalScrollListItem/VerticalScrollListItem.cjs +1 -1
  135. package/dist/cjs/ScrollTo/utils.cjs +2 -2
  136. package/dist/cjs/Section/Section.cjs +1 -1
  137. package/dist/cjs/Select/Option.cjs +1 -1
  138. package/dist/cjs/Select/OptionGroup.cjs +1 -1
  139. package/dist/cjs/Select/Select.cjs +3 -2
  140. package/dist/cjs/SelectionList/SelectionList.cjs +1 -1
  141. package/dist/cjs/SimpleGrid/SimpleGrid.cjs +1 -1
  142. package/dist/cjs/Skeleton/Skeleton.cjs +1 -1
  143. package/dist/cjs/Slider/Slider.cjs +3 -2
  144. package/dist/cjs/Slider/SliderInput/SliderInput.cjs +1 -1
  145. package/dist/cjs/Snackbar/Snackbar.cjs +1 -1
  146. package/dist/cjs/Snackbar/SnackbarContent/SnackbarContent.cjs +1 -1
  147. package/dist/cjs/SnackbarProvider/SnackbarProvider.cjs +1 -1
  148. package/dist/cjs/Stack/Stack.cjs +10 -11
  149. package/dist/cjs/Switch/Switch.cjs +1 -1
  150. package/dist/cjs/Tab/Tab.cjs +1 -1
  151. package/dist/cjs/Table/Table.cjs +1 -1
  152. package/dist/cjs/Table/TableBody/TableBody.cjs +1 -1
  153. package/dist/cjs/Table/TableCell/TableCell.cjs +1 -1
  154. package/dist/cjs/Table/TableContainer/TableContainer.cjs +1 -1
  155. package/dist/cjs/Table/TableHead/TableHead.cjs +1 -1
  156. package/dist/cjs/Table/TableHeader/TableHeader.cjs +1 -1
  157. package/dist/cjs/Table/TableRow/TableRow.cjs +1 -1
  158. package/dist/cjs/Table/hooks/useRowExpand.cjs +1 -1
  159. package/dist/cjs/Table/hooks/useRowSelection.cjs +7 -7
  160. package/dist/cjs/Table/renderers/DateColumnCell/DateColumnCell.cjs +1 -1
  161. package/dist/cjs/Table/renderers/DropdownColumnCell/DropdownColumnCell.cjs +1 -1
  162. package/dist/cjs/Table/renderers/ProgressColumnCell/ProgressColumnCell.cjs +1 -1
  163. package/dist/cjs/Table/renderers/SwitchColumnCell/SwitchColumnCell.cjs +1 -1
  164. package/dist/cjs/Table/renderers/renderers.cjs +1 -1
  165. package/dist/cjs/TableSection/TableSection.cjs +1 -1
  166. package/dist/cjs/TableSection/TableSection.styles.cjs +1 -1
  167. package/dist/cjs/Tabs/Tabs.cjs +1 -1
  168. package/dist/cjs/Tag/Tag.cjs +1 -1
  169. package/dist/cjs/TagsInput/TagsInput.cjs +2 -2
  170. package/dist/cjs/TextArea/TextArea.cjs +1 -1
  171. package/dist/cjs/TimeAgo/TimeAgo.cjs +1 -1
  172. package/dist/cjs/TimePicker/Placeholder.cjs +1 -1
  173. package/dist/cjs/TimePicker/TimePicker.cjs +1 -1
  174. package/dist/cjs/TimePicker/Unit/Unit.cjs +1 -1
  175. package/dist/cjs/ToggleButton/ToggleButton.cjs +1 -1
  176. package/dist/cjs/Tooltip/Tooltip.cjs +9 -5
  177. package/dist/cjs/TreeView/TreeItem/DefaultContent.cjs +1 -1
  178. package/dist/cjs/TreeView/TreeItem/TreeItem.cjs +1 -1
  179. package/dist/cjs/TreeView/TreeView.cjs +1 -1
  180. package/dist/cjs/TreeView/internals/DescendantProvider.cjs +2 -2
  181. package/dist/cjs/TreeView/internals/TreeViewProvider.cjs +1 -1
  182. package/dist/cjs/Typography/Typography.cjs +1 -1
  183. package/dist/cjs/VerticalNavigation/Actions/Action.cjs +13 -11
  184. package/dist/cjs/VerticalNavigation/Actions/Action.styles.cjs +4 -4
  185. package/dist/cjs/VerticalNavigation/Actions/Actions.cjs +9 -9
  186. package/dist/cjs/VerticalNavigation/Header/Header.cjs +46 -26
  187. package/dist/cjs/VerticalNavigation/Header/Header.styles.cjs +3 -1
  188. package/dist/cjs/VerticalNavigation/Navigation/Navigation.cjs +23 -29
  189. package/dist/cjs/VerticalNavigation/NavigationPopup/NavigationPopup.styles.cjs +0 -8
  190. package/dist/cjs/VerticalNavigation/NavigationPopup/NavigationPopupContainer.cjs +20 -6
  191. package/dist/cjs/VerticalNavigation/NavigationSlider/NavigationSlider.cjs +41 -30
  192. package/dist/cjs/VerticalNavigation/NavigationSlider/NavigationSlider.styles.cjs +6 -9
  193. package/dist/cjs/VerticalNavigation/TreeView/IconWrapper/IconWrapper.cjs +7 -18
  194. package/dist/cjs/VerticalNavigation/TreeView/TreeView.cjs +614 -631
  195. package/dist/cjs/VerticalNavigation/TreeView/TreeViewItem.cjs +39 -26
  196. package/dist/cjs/VerticalNavigation/TreeView/TreeViewItem.styles.cjs +25 -13
  197. package/dist/cjs/VerticalNavigation/VerticalNavigation.cjs +1 -1
  198. package/dist/cjs/hocs/withTooltip.cjs +1 -1
  199. package/dist/cjs/hooks/useEmotionCache.cjs +1 -1
  200. package/dist/cjs/hooks/useTheme.cjs +1 -1
  201. package/dist/cjs/providers/Provider.cjs +1 -1
  202. package/dist/cjs/providers/ThemeProvider.cjs +34 -41
  203. package/dist/cjs/utils/document.cjs +4 -0
  204. package/dist/cjs/utils/focusableElementFinder.cjs +1 -1
  205. package/dist/cjs/utils/iconVariant.cjs +1 -1
  206. package/dist/cjs/utils/theme.cjs +3 -3
  207. package/dist/esm/Accordion/Accordion.js +1 -1
  208. package/dist/esm/ActionBar/ActionBar.js +1 -1
  209. package/dist/esm/ActionsGeneric/ActionsGeneric.js +1 -1
  210. package/dist/esm/AppSwitcher/Action/Action.js +1 -1
  211. package/dist/esm/AppSwitcher/AppSwitcher.js +2 -2
  212. package/dist/esm/AppSwitcher/AppSwitcher.js.map +1 -1
  213. package/dist/esm/Avatar/Avatar.js +1 -1
  214. package/dist/esm/AvatarGroup/AvatarGroup.js +1 -1
  215. package/dist/esm/AvatarGroup/AvatarGroupContext.js +1 -1
  216. package/dist/esm/Badge/Badge.js +1 -1
  217. package/dist/esm/Banner/Banner.js +1 -1
  218. package/dist/esm/Banner/BannerContent/ActionContainer/ActionContainer.js +1 -1
  219. package/dist/esm/Banner/BannerContent/BannerContent.js +1 -1
  220. package/dist/esm/Banner/BannerContent/MessageContainer/MessageContainer.js +1 -1
  221. package/dist/esm/BaseCheckBox/BaseCheckBox.js +1 -1
  222. package/dist/esm/BaseCheckBox/icons.js +1 -1
  223. package/dist/esm/BaseDropdown/BaseDropdown.js +1 -1
  224. package/dist/esm/BaseInput/BaseInput.js +1 -1
  225. package/dist/esm/BaseRadio/BaseRadio.js +1 -1
  226. package/dist/esm/BaseRadio/icons.js +1 -1
  227. package/dist/esm/BaseSwitch/BaseSwitch.js +1 -1
  228. package/dist/esm/Box/Box.js +1 -1
  229. package/dist/esm/BreadCrumb/BreadCrumb.js +1 -1
  230. package/dist/esm/BreadCrumb/Page/Page.js +1 -1
  231. package/dist/esm/BreadCrumb/PathElement/PathElement.js +1 -1
  232. package/dist/esm/BreadCrumb/utils.js +1 -1
  233. package/dist/esm/BulkActions/BulkActions.js +1 -1
  234. package/dist/esm/BulkActions/BulkActions.styles.js +1 -1
  235. package/dist/esm/Button/Button.js +1 -1
  236. package/dist/esm/Calendar/Calendar.js +10 -4
  237. package/dist/esm/Calendar/Calendar.js.map +1 -1
  238. package/dist/esm/Calendar/CalendarHeader/CalendarHeader.js +1 -1
  239. package/dist/esm/Calendar/CalendarNavigation/ComposedNavigation/ComposedNavigation.js +1 -1
  240. package/dist/esm/Calendar/CalendarNavigation/MonthSelector/MonthSelector.js +1 -1
  241. package/dist/esm/Calendar/CalendarNavigation/Navigation/Navigation.js +1 -1
  242. package/dist/esm/Calendar/SingleCalendar/CalendarCell.js +2 -2
  243. package/dist/esm/Calendar/SingleCalendar/CalendarCell.js.map +1 -1
  244. package/dist/esm/Calendar/SingleCalendar/SingleCalendar.js +1 -1
  245. package/dist/esm/Card/Card.js +1 -1
  246. package/dist/esm/Card/Content/Content.js +1 -1
  247. package/dist/esm/Card/Header/Header.js +1 -1
  248. package/dist/esm/Card/Media/Media.js +1 -7
  249. package/dist/esm/Card/Media/Media.js.map +1 -1
  250. package/dist/esm/Carousel/Carousel.js +1 -1
  251. package/dist/esm/Carousel/CarouselControls.js +1 -1
  252. package/dist/esm/Carousel/CarouselSlide/CarouselSlide.js +1 -1
  253. package/dist/esm/Carousel/CarouselThumbnails.js +1 -1
  254. package/dist/esm/CheckBox/CheckBox.js +1 -1
  255. package/dist/esm/CheckBoxGroup/CheckBoxGroup.js +1 -1
  256. package/dist/esm/ColorPicker/ColorPicker.js +1 -1
  257. package/dist/esm/ColorPicker/Fields/Fields.js +1 -1
  258. package/dist/esm/ColorPicker/Picker/Picker.js +1 -1
  259. package/dist/esm/ColorPicker/PresetColors/PresetColors.js +1 -1
  260. package/dist/esm/ColorPicker/SavedColors/SavedColors.js +1 -1
  261. package/dist/esm/Container/Container.js +1 -1
  262. package/dist/esm/Controls/Controls.js +1 -1
  263. package/dist/esm/Controls/LeftControl/LeftControl.js +1 -1
  264. package/dist/esm/Controls/RightControl/RightControl.js +1 -1
  265. package/dist/esm/DatePicker/DatePicker.js +1 -1
  266. package/dist/esm/Dialog/Actions/Actions.js +1 -1
  267. package/dist/esm/Dialog/Content/Content.js +1 -1
  268. package/dist/esm/Dialog/Dialog.js +1 -1
  269. package/dist/esm/Dialog/Title/Title.js +1 -1
  270. package/dist/esm/DotPagination/DotPagination.js +1 -1
  271. package/dist/esm/Drawer/Drawer.js +1 -1
  272. package/dist/esm/DropDownMenu/DropDownMenu.js +1 -1
  273. package/dist/esm/Dropdown/Dropdown.js +1 -1
  274. package/dist/esm/Dropdown/List/List.js +1 -1
  275. package/dist/esm/DropdownButton/DropdownButton.js +1 -1
  276. package/dist/esm/EmptyState/EmptyState.js +1 -1
  277. package/dist/esm/FileUploader/DropZone/DropZone.js +1 -1
  278. package/dist/esm/FileUploader/File/File.js +1 -1
  279. package/dist/esm/FileUploader/FileList/FileList.js +1 -1
  280. package/dist/esm/FileUploader/FileUploader.js +1 -1
  281. package/dist/esm/FileUploader/Preview/Preview.js +1 -1
  282. package/dist/esm/FilterGroup/Counter/Counter.js +1 -1
  283. package/dist/esm/FilterGroup/FilterContent/FilterContent.js +1 -1
  284. package/dist/esm/FilterGroup/FilterGroup.js +1 -1
  285. package/dist/esm/FilterGroup/FilterGroupContext.js +1 -1
  286. package/dist/esm/FilterGroup/LeftPanel/LeftPanel.js +1 -1
  287. package/dist/esm/FilterGroup/RightPanel/RightPanel.js +1 -1
  288. package/dist/esm/Focus/Focus.js +2 -3
  289. package/dist/esm/Focus/Focus.js.map +1 -1
  290. package/dist/esm/Footer/Footer.js +1 -1
  291. package/dist/esm/Forms/Adornment/Adornment.js +1 -1
  292. package/dist/esm/Forms/CharCounter/CharCounter.js +1 -1
  293. package/dist/esm/Forms/FormElement/FormElement.js +1 -1
  294. package/dist/esm/Forms/InfoMessage/InfoMessage.js +1 -1
  295. package/dist/esm/Forms/Label/Label.js +1 -1
  296. package/dist/esm/Forms/Suggestions/Suggestions.js +1 -1
  297. package/dist/esm/Forms/WarningText/WarningText.js +1 -1
  298. package/dist/esm/GlobalActions/GlobalActions.js +1 -1
  299. package/dist/esm/Grid/Grid.js +5 -8
  300. package/dist/esm/Grid/Grid.js.map +1 -1
  301. package/dist/esm/Header/Actions/Actions.js +1 -1
  302. package/dist/esm/Header/Brand/Brand.js +1 -1
  303. package/dist/esm/Header/Header.js +1 -1
  304. package/dist/esm/Header/Navigation/MenuBar/Bar.js +1 -1
  305. package/dist/esm/Header/Navigation/MenuBar/MenuBar.js +1 -1
  306. package/dist/esm/Header/Navigation/MenuItem/MenuItem.js +2 -2
  307. package/dist/esm/Header/Navigation/MenuItem/MenuItem.js.map +1 -1
  308. package/dist/esm/Header/Navigation/Navigation.js +1 -1
  309. package/dist/esm/Header/Navigation/useSelectionPath.js +1 -1
  310. package/dist/esm/Header/Navigation/useSelectionPath.js.map +1 -1
  311. package/dist/esm/Header/Navigation/utils/FocusContext.js +1 -1
  312. package/dist/esm/IconButton/IconButton.js +1 -1
  313. package/dist/esm/InlineEditor/InlineEditor.js +1 -1
  314. package/dist/esm/Input/Input.js +1 -1
  315. package/dist/esm/Kpi/Kpi.js +1 -1
  316. package/dist/esm/Link/Link.js +1 -1
  317. package/dist/esm/Link/Link.js.map +1 -1
  318. package/dist/esm/List/List.js +1 -1
  319. package/dist/esm/List/utils.js +1 -1
  320. package/dist/esm/List/utils.js.map +1 -1
  321. package/dist/esm/ListContainer/ListContainer.js +1 -1
  322. package/dist/esm/ListContainer/ListItem/ListItem.js +1 -1
  323. package/dist/esm/Loading/Loading.js +1 -1
  324. package/dist/esm/LoadingContainer/LoadingContainer.js +1 -1
  325. package/dist/esm/Login/Login.js +1 -1
  326. package/dist/esm/MultiButton/MultiButton.js +1 -1
  327. package/dist/esm/OverflowTooltip/OverflowTooltip.js +1 -1
  328. package/dist/esm/Pagination/Pagination.js +1 -1
  329. package/dist/esm/Pagination/Select.js +1 -1
  330. package/dist/esm/Panel/Panel.js +1 -1
  331. package/dist/esm/ProgressBar/ProgressBar.js +1 -1
  332. package/dist/esm/QueryBuilder/ConfirmationDialog/ConfirmationDialog.js +1 -1
  333. package/dist/esm/QueryBuilder/Context.js +1 -1
  334. package/dist/esm/QueryBuilder/QueryBuilder.js +1 -1
  335. package/dist/esm/QueryBuilder/QueryBuilder.js.map +1 -1
  336. package/dist/esm/QueryBuilder/Rule/Attribute/Attribute.js +1 -1
  337. package/dist/esm/QueryBuilder/Rule/Operator/Operator.js +1 -1
  338. package/dist/esm/QueryBuilder/Rule/Rule.js +1 -1
  339. package/dist/esm/QueryBuilder/Rule/Value/BooleanValue/BooleanValue.js +1 -1
  340. package/dist/esm/QueryBuilder/Rule/Value/DateTimeValue/DateTimeValue.js +1 -1
  341. package/dist/esm/QueryBuilder/Rule/Value/NumericValue/NumericValue.js +1 -1
  342. package/dist/esm/QueryBuilder/Rule/Value/TextValue/TextValue.js +1 -1
  343. package/dist/esm/QueryBuilder/Rule/Value/Value.js +1 -1
  344. package/dist/esm/QueryBuilder/RuleGroup/RuleGroup.js +1 -1
  345. package/dist/esm/QueryBuilder/utils/index.js +1 -1
  346. package/dist/esm/QueryBuilder/utils/index.js.map +1 -1
  347. package/dist/esm/Radio/Radio.js +1 -1
  348. package/dist/esm/RadioGroup/RadioGroup.js +1 -1
  349. package/dist/esm/ScrollTo/Horizontal/HorizontalScrollListItem/HorizontalScrollListItem.js +1 -1
  350. package/dist/esm/ScrollTo/Horizontal/ScrollToHorizontal.js +1 -1
  351. package/dist/esm/ScrollTo/Vertical/ScrollToVertical.js +1 -1
  352. package/dist/esm/ScrollTo/Vertical/VerticalScrollListItem/VerticalScrollListItem.js +1 -1
  353. package/dist/esm/ScrollTo/useScrollTo.js.map +1 -1
  354. package/dist/esm/ScrollTo/utils.js +2 -2
  355. package/dist/esm/ScrollTo/utils.js.map +1 -1
  356. package/dist/esm/Section/Section.js +1 -1
  357. package/dist/esm/Select/Option.js +1 -1
  358. package/dist/esm/Select/OptionGroup.js +1 -1
  359. package/dist/esm/Select/Select.js +3 -2
  360. package/dist/esm/Select/Select.js.map +1 -1
  361. package/dist/esm/SelectionList/SelectionList.js +1 -1
  362. package/dist/esm/SimpleGrid/SimpleGrid.js +1 -1
  363. package/dist/esm/Skeleton/Skeleton.js +1 -1
  364. package/dist/esm/Slider/Slider.js +3 -2
  365. package/dist/esm/Slider/Slider.js.map +1 -1
  366. package/dist/esm/Slider/SliderInput/SliderInput.js +1 -1
  367. package/dist/esm/Slider/utils.js.map +1 -1
  368. package/dist/esm/Snackbar/Snackbar.js +1 -1
  369. package/dist/esm/Snackbar/SnackbarContent/SnackbarContent.js +1 -1
  370. package/dist/esm/SnackbarProvider/SnackbarProvider.js +1 -1
  371. package/dist/esm/Stack/Stack.js +10 -11
  372. package/dist/esm/Stack/Stack.js.map +1 -1
  373. package/dist/esm/Switch/Switch.js +1 -1
  374. package/dist/esm/Tab/Tab.js +1 -1
  375. package/dist/esm/Table/Table.js +1 -1
  376. package/dist/esm/Table/TableBody/TableBody.js +1 -1
  377. package/dist/esm/Table/TableCell/TableCell.js +1 -1
  378. package/dist/esm/Table/TableContainer/TableContainer.js +1 -1
  379. package/dist/esm/Table/TableHead/TableHead.js +1 -1
  380. package/dist/esm/Table/TableHeader/TableHeader.js +1 -1
  381. package/dist/esm/Table/TableRow/TableRow.js +1 -1
  382. package/dist/esm/Table/hooks/useRowExpand.js +1 -1
  383. package/dist/esm/Table/hooks/useRowSelection.js +7 -7
  384. package/dist/esm/Table/hooks/useRowSelection.js.map +1 -1
  385. package/dist/esm/Table/renderers/DateColumnCell/DateColumnCell.js +1 -1
  386. package/dist/esm/Table/renderers/DropdownColumnCell/DropdownColumnCell.js +1 -1
  387. package/dist/esm/Table/renderers/ProgressColumnCell/ProgressColumnCell.js +1 -1
  388. package/dist/esm/Table/renderers/SwitchColumnCell/SwitchColumnCell.js +1 -1
  389. package/dist/esm/Table/renderers/renderers.js +1 -1
  390. package/dist/esm/Table/renderers/renderers.js.map +1 -1
  391. package/dist/esm/TableSection/TableSection.js +1 -1
  392. package/dist/esm/TableSection/TableSection.styles.js +1 -1
  393. package/dist/esm/Tabs/Tabs.js +1 -1
  394. package/dist/esm/Tag/Tag.js +1 -1
  395. package/dist/esm/TagsInput/TagsInput.js +2 -2
  396. package/dist/esm/TagsInput/TagsInput.js.map +1 -1
  397. package/dist/esm/TextArea/TextArea.js +1 -1
  398. package/dist/esm/TimeAgo/TimeAgo.js +1 -1
  399. package/dist/esm/TimePicker/Placeholder.js +1 -1
  400. package/dist/esm/TimePicker/TimePicker.js +1 -1
  401. package/dist/esm/TimePicker/Unit/Unit.js +1 -1
  402. package/dist/esm/ToggleButton/ToggleButton.js +1 -1
  403. package/dist/esm/Tooltip/Tooltip.js +10 -6
  404. package/dist/esm/Tooltip/Tooltip.js.map +1 -1
  405. package/dist/esm/TreeView/TreeItem/DefaultContent.js +1 -1
  406. package/dist/esm/TreeView/TreeItem/TreeItem.js +1 -1
  407. package/dist/esm/TreeView/TreeView.js +1 -1
  408. package/dist/esm/TreeView/internals/DescendantProvider.js +2 -2
  409. package/dist/esm/TreeView/internals/DescendantProvider.js.map +1 -1
  410. package/dist/esm/TreeView/internals/TreeViewProvider.js +1 -1
  411. package/dist/esm/Typography/Typography.js +1 -1
  412. package/dist/esm/VerticalNavigation/Actions/Action.js +13 -11
  413. package/dist/esm/VerticalNavigation/Actions/Action.js.map +1 -1
  414. package/dist/esm/VerticalNavigation/Actions/Action.styles.js +4 -4
  415. package/dist/esm/VerticalNavigation/Actions/Action.styles.js.map +1 -1
  416. package/dist/esm/VerticalNavigation/Actions/Actions.js +9 -9
  417. package/dist/esm/VerticalNavigation/Actions/Actions.js.map +1 -1
  418. package/dist/esm/VerticalNavigation/Header/Header.js +46 -26
  419. package/dist/esm/VerticalNavigation/Header/Header.js.map +1 -1
  420. package/dist/esm/VerticalNavigation/Header/Header.styles.js +3 -1
  421. package/dist/esm/VerticalNavigation/Header/Header.styles.js.map +1 -1
  422. package/dist/esm/VerticalNavigation/Navigation/Navigation.js +23 -29
  423. package/dist/esm/VerticalNavigation/Navigation/Navigation.js.map +1 -1
  424. package/dist/esm/VerticalNavigation/NavigationPopup/NavigationPopup.styles.js +0 -6
  425. package/dist/esm/VerticalNavigation/NavigationPopup/NavigationPopup.styles.js.map +1 -1
  426. package/dist/esm/VerticalNavigation/NavigationPopup/NavigationPopupContainer.js +21 -7
  427. package/dist/esm/VerticalNavigation/NavigationPopup/NavigationPopupContainer.js.map +1 -1
  428. package/dist/esm/VerticalNavigation/NavigationSlider/NavigationSlider.js +41 -30
  429. package/dist/esm/VerticalNavigation/NavigationSlider/NavigationSlider.js.map +1 -1
  430. package/dist/esm/VerticalNavigation/NavigationSlider/NavigationSlider.styles.js +6 -9
  431. package/dist/esm/VerticalNavigation/NavigationSlider/NavigationSlider.styles.js.map +1 -1
  432. package/dist/esm/VerticalNavigation/TreeView/IconWrapper/IconWrapper.js +7 -18
  433. package/dist/esm/VerticalNavigation/TreeView/IconWrapper/IconWrapper.js.map +1 -1
  434. package/dist/esm/VerticalNavigation/TreeView/TreeView.js +614 -631
  435. package/dist/esm/VerticalNavigation/TreeView/TreeView.js.map +1 -1
  436. package/dist/esm/VerticalNavigation/TreeView/TreeView.styles.js.map +1 -1
  437. package/dist/esm/VerticalNavigation/TreeView/TreeViewItem.js +39 -26
  438. package/dist/esm/VerticalNavigation/TreeView/TreeViewItem.js.map +1 -1
  439. package/dist/esm/VerticalNavigation/TreeView/TreeViewItem.styles.js +25 -13
  440. package/dist/esm/VerticalNavigation/TreeView/TreeViewItem.styles.js.map +1 -1
  441. package/dist/esm/VerticalNavigation/VerticalNavigation.js +1 -1
  442. package/dist/esm/VerticalNavigation/VerticalNavigation.js.map +1 -1
  443. package/dist/esm/hocs/withTooltip.js +1 -1
  444. package/dist/esm/hooks/useEmotionCache.js +1 -1
  445. package/dist/esm/hooks/useTheme.js +1 -1
  446. package/dist/esm/providers/Provider.js +1 -1
  447. package/dist/esm/providers/Provider.js.map +1 -1
  448. package/dist/esm/providers/ThemeProvider.js +34 -41
  449. package/dist/esm/providers/ThemeProvider.js.map +1 -1
  450. package/dist/esm/types/generic.js.map +1 -1
  451. package/dist/esm/utils/document.js +4 -0
  452. package/dist/esm/utils/document.js.map +1 -1
  453. package/dist/esm/utils/focusableElementFinder.js +1 -1
  454. package/dist/esm/utils/focusableElementFinder.js.map +1 -1
  455. package/dist/esm/utils/iconVariant.js +1 -1
  456. package/dist/esm/utils/theme.js +2 -2
  457. package/dist/esm/utils/theme.js.map +1 -1
  458. package/dist/types/index.d.ts +83 -232
  459. package/package.json +5 -5
  460. package/dist/cjs/VerticalNavigation/TreeView/IconWrapper/IconWrapper.styles.cjs +0 -20
  461. package/dist/esm/VerticalNavigation/TreeView/IconWrapper/IconWrapper.styles.js +0 -18
  462. package/dist/esm/VerticalNavigation/TreeView/IconWrapper/IconWrapper.styles.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import { useContext } from "react";
2
- import "@emotion/react/jsx-runtime";
2
+ import "react/jsx-runtime";
3
3
  import "@mui/material/styles";
4
4
  import { EmotionContext } from "@hitachivantara/uikit-react-shared";
5
5
  import "@hitachivantara/uikit-styles";
@@ -1,5 +1,5 @@
1
1
  import { useContext, useMemo } from "react";
2
- import "@emotion/react/jsx-runtime";
2
+ import "react/jsx-runtime";
3
3
  import "@mui/material/styles";
4
4
  import { HvThemeContext } from "@hitachivantara/uikit-react-shared";
5
5
  import "@hitachivantara/uikit-styles";
@@ -1,4 +1,4 @@
1
- import { jsxs, jsx } from "@emotion/react/jsx-runtime";
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { useMemo } from "react";
3
3
  import createCache from "@emotion/cache";
4
4
  import { CacheProvider, Global, css, ClassNames } from "@emotion/react";
@@ -1 +1 @@
1
- {"version":3,"file":"Provider.js","sources":["../../../src/providers/Provider.tsx"],"sourcesContent":["import { useMemo } from \"react\";\nimport createCache, { EmotionCache } from \"@emotion/cache\";\nimport {\n CacheProvider,\n ClassNames,\n css as cssReact,\n Global,\n} from \"@emotion/react\";\nimport {\n CssBaseline,\n CssScopedBaseline,\n getThemesVars,\n HvThemeStructure,\n} from \"@hitachivantara/uikit-styles\";\n\nimport { useUniqueId } from \"../hooks/useUniqueId\";\nimport { HvTheme } from \"../types/theme\";\nimport { getElementById } from \"../utils/document\";\nimport { processThemes } from \"../utils/theme\";\nimport {\n defaultCacheKey,\n defaultEmotionCache,\n HvThemeProvider,\n} from \"./ThemeProvider\";\n\n// Provider props\nexport interface HvProviderProps {\n /**\n * Your component tree.\n */\n children?: React.ReactNode;\n /**\n * Id of your root element.\n */\n rootElementId?: string;\n /**\n * By default the baseline styles are applied globally, `global`, to the application for the UI Kit components to work properly.\n * If you need to scope the baseline styles to avoid styling conflicts, you can set this property to `scoped`.\n * To scope the baseline to your root, you need to add the `rootElementId` property.\n * If the `rootElementId` property is not set, the baseline will be scoped to a new container, `hv-uikit-scoped-root*`, created around your content.\n * If you are providing your own baseline styles, you can set this property to `none` to disable the baseline styles.\n */\n cssBaseline?: \"global\" | \"scoped\" | \"none\";\n /**\n * By default the theme styles are applied globally, `global`, to the application.\n * If you need to scope the theme styles to avoid styling conflicts, you can set this property to `scoped`.\n * To scope the theme to your root, you need to add the `rootElementId` property.\n * If the `rootElementId` property is not set, the theme will be scoped to a new container, `hv-uikit-scoped-root*`, created around your content.\n */\n cssTheme?: \"global\" | \"scoped\";\n /**\n * The string used to prefix the class names and uniquely identify them. The key can only contain lower case alphabetical characters.\n * This is useful to avoid class name collisions.\n *\n * If `emotionCache` is passed, this is value is ignored.\n *\n * @default \"hv\"\n */\n classNameKey?: string;\n /**\n * The emotion cache instance to use. If no value is provided, the default cache is used.\n */\n emotionCache?: EmotionCache;\n /**\n * List of themes to be used by UI Kit.\n * You can provide your own themes created with the `createTheme` utility and/or the default themes `ds3` and `ds5` provided by UI Kit.\n *\n * If no value is provided, the `ds5` theme will be used.\n */\n themes?: (HvTheme | HvThemeStructure)[];\n /**\n * The active theme. It must be one of the themes passed to `themes`.\n *\n * If no value is provided, the first theme from the `themes` list is used. If no `themes` list is provided, the `ds5` theme will be used.\n */\n theme?: string;\n /**\n * The active color mode. It must be one of the color modes of the active theme.\n *\n * If no value is provided, the first color mode defined in the active theme is used.\n * For the default themes `ds3` and `ds5`, the `dawn` color mode is the one used.\n */\n colorMode?: string;\n}\n\nconst scopedRootPrefix = \"hv-uikit-scoped-root\" as const;\n\n/**\n * Enables theming capabilities and makes cross-component theme properties available down the tree.\n */\nexport const HvProvider = ({\n children,\n rootElementId,\n cssBaseline = \"global\",\n cssTheme = \"global\",\n themes,\n theme,\n colorMode,\n emotionCache: emotionCacheProp,\n classNameKey = defaultCacheKey,\n}: HvProviderProps) => {\n const generatedId = useUniqueId();\n const scopedRootId = `${scopedRootPrefix}-${generatedId}`;\n\n // Themes\n const themesList: (HvTheme | HvThemeStructure)[] = processThemes(themes);\n\n // Emotion cache\n // Moves UI Kit styles to the top of the <head> so they're loaded first\n // This enables users to override the UI Kit styles if necessary\n const emotionCache = useMemo(() => {\n if (emotionCacheProp) return emotionCacheProp;\n // reuse the default shared cache if `classNameKey` is the same\n if (classNameKey === defaultCacheKey) return defaultEmotionCache;\n\n return createCache({ key: classNameKey, prepend: true });\n }, [classNameKey, emotionCacheProp]);\n\n return (\n <CacheProvider value={emotionCache}>\n <Global\n styles={cssReact`\n ${\n cssBaseline === \"global\" && {\n [`@layer hv-uikit-baseline`]: {\n ...CssBaseline,\n },\n }\n }\n ${getThemesVars(themesList)}\n `}\n />\n <HvThemeProvider\n themes={themesList}\n theme={theme || themesList[0].name}\n emotionCache={emotionCache}\n colorMode={colorMode || Object.keys(themesList[0].colors.modes)[0]}\n themeRootId={\n cssTheme === \"scoped\" ? rootElementId || scopedRootId : undefined\n }\n >\n <ClassNames>\n {({ css }) => {\n if (cssBaseline === \"scoped\") {\n const rootElement = getElementById(rootElementId);\n\n if (rootElement) {\n rootElement.classList.add(\n css({\n [`@layer ${rootElementId}-baseline`]: {\n ...CssScopedBaseline,\n },\n }),\n );\n }\n }\n\n return (cssTheme === \"scoped\" || cssBaseline === \"scoped\") &&\n !rootElementId ? (\n <div\n id={scopedRootId}\n className={\n cssBaseline === \"scoped\"\n ? css({\n [`@layer ${rootElementId}-baseline`]: {\n ...CssScopedBaseline,\n },\n })\n : undefined\n }\n >\n {children}\n </div>\n ) : (\n children\n );\n }}\n </ClassNames>\n </HvThemeProvider>\n </CacheProvider>\n );\n};\n"],"names":["cssReact","css"],"mappings":";;;;;;;;;;AAqFA,MAAM,mBAAmB;AAKlB,MAAM,aAAa,CAAC;AAAA,EACzB;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd,WAAW;AAAA,EACX;AAAA,EACA;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd,eAAe;AACjB,MAAuB;AACrB,QAAM,cAAc;AACpB,QAAM,eAAe,GAAG,gBAAgB,IAAI,WAAW;AAGjD,QAAA,aAA6C,cAAc,MAAM;AAKjE,QAAA,eAAe,QAAQ,MAAM;AAC7B,QAAA;AAAyB,aAAA;AAE7B,QAAI,iBAAiB;AAAwB,aAAA;AAE7C,WAAO,YAAY,EAAE,KAAK,cAAc,SAAS,MAAM;AAAA,EAAA,GACtD,CAAC,cAAc,gBAAgB,CAAC;AAGjC,SAAA,qBAAC,eAAc,EAAA,OAAO,cACpB,UAAA;AAAA,IAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,QAAQA;AAAAA,YAEJ,gBAAgB,YAAY;AAAA,UAC1B,CAAC,0BAA0B,GAAG;AAAA,YAC5B,GAAG;AAAA,UACL;AAAA,QAAA,CAEJ;AAAA,YACE,cAAc,UAAU,CAAC;AAAA;AAAA,MAAA;AAAA,IAE/B;AAAA,IACA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,QAAQ;AAAA,QACR,OAAO,SAAS,WAAW,CAAC,EAAE;AAAA,QAC9B;AAAA,QACA,WAAW,aAAa,OAAO,KAAK,WAAW,CAAC,EAAE,OAAO,KAAK,EAAE,CAAC;AAAA,QACjE,aACE,aAAa,WAAW,iBAAiB,eAAe;AAAA,QAG1D,UAAC,oBAAA,YAAA,EACE,UAAC,CAAA,EAAE,KAAAC,WAAU;AACZ,cAAI,gBAAgB,UAAU;AACtB,kBAAA,cAAc,eAAe,aAAa;AAEhD,gBAAI,aAAa;AACf,0BAAY,UAAU;AAAA,gBACpBA,KAAI;AAAA,kBACF,CAAC,UAAU,aAAa,WAAW,GAAG;AAAA,oBACpC,GAAG;AAAA,kBACL;AAAA,gBAAA,CACD;AAAA,cAAA;AAAA,YAEL;AAAA,UACF;AAEA,kBAAQ,aAAa,YAAY,gBAAgB,aAC/C,CAAC,gBACD;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,IAAI;AAAA,cACJ,WACE,gBAAgB,WACZA,KAAI;AAAA,gBACF,CAAC,UAAU,aAAa,WAAW,GAAG;AAAA,kBACpC,GAAG;AAAA,gBACL;AAAA,cACD,CAAA,IACD;AAAA,cAGL;AAAA,YAAA;AAAA,UAGH,IAAA;AAAA,QAAA,GAGN;AAAA,MAAA;AAAA,IACF;AAAA,EACF,EAAA,CAAA;AAEJ;"}
1
+ {"version":3,"file":"Provider.js","sources":["../../../src/providers/Provider.tsx"],"sourcesContent":["import { useMemo } from \"react\";\nimport createCache, { EmotionCache } from \"@emotion/cache\";\nimport {\n CacheProvider,\n ClassNames,\n css as cssReact,\n Global,\n} from \"@emotion/react\";\nimport {\n CssBaseline,\n CssScopedBaseline,\n getThemesVars,\n HvThemeStructure,\n} from \"@hitachivantara/uikit-styles\";\n\nimport { useUniqueId } from \"../hooks/useUniqueId\";\nimport { HvTheme } from \"../types/theme\";\nimport { getElementById } from \"../utils/document\";\nimport { processThemes } from \"../utils/theme\";\nimport {\n defaultCacheKey,\n defaultEmotionCache,\n HvThemeProvider,\n} from \"./ThemeProvider\";\n\n// Provider props\nexport interface HvProviderProps {\n /**\n * Your component tree.\n */\n children?: React.ReactNode;\n /**\n * Id of your root element.\n */\n rootElementId?: string;\n /**\n * By default the baseline styles are applied globally, `global`, to the application for the UI Kit components to work properly.\n * If you need to scope the baseline styles to avoid styling conflicts, you can set this property to `scoped`.\n * To scope the baseline to your root, you need to add the `rootElementId` property.\n * If the `rootElementId` property is not set, the baseline will be scoped to a new container, `hv-uikit-scoped-root*`, created around your content.\n * If you are providing your own baseline styles, you can set this property to `none` to disable the baseline styles.\n */\n cssBaseline?: \"global\" | \"scoped\" | \"none\";\n /**\n * By default the theme styles are applied globally, `global`, to the application.\n * If you need to scope the theme styles to avoid styling conflicts, you can set this property to `scoped`.\n * To scope the theme to your root, you need to add the `rootElementId` property.\n * If the `rootElementId` property is not set, the theme will be scoped to a new container, `hv-uikit-scoped-root*`, created around your content.\n */\n cssTheme?: \"global\" | \"scoped\";\n /**\n * The string used to prefix the class names and uniquely identify them. The key can only contain lower case alphabetical characters.\n * This is useful to avoid class name collisions.\n *\n * If `emotionCache` is passed, this is value is ignored.\n *\n * @default \"hv\"\n */\n classNameKey?: string;\n /**\n * The emotion cache instance to use. If no value is provided, the default cache is used.\n */\n emotionCache?: EmotionCache;\n /**\n * List of themes to be used by UI Kit.\n * You can provide your own themes created with the `createTheme` utility and/or the default themes `ds3` and `ds5` provided by UI Kit.\n *\n * If no value is provided, the `ds5` theme will be used.\n */\n themes?: (HvTheme | HvThemeStructure)[];\n /**\n * The active theme. It must be one of the themes passed to `themes`.\n *\n * If no value is provided, the first theme from the `themes` list is used. If no `themes` list is provided, the `ds5` theme will be used.\n */\n theme?: string;\n /**\n * The active color mode. It must be one of the color modes of the active theme.\n *\n * If no value is provided, the first color mode defined in the active theme is used.\n * For the default themes `ds3` and `ds5`, the `dawn` color mode is the one used.\n */\n colorMode?: string;\n}\n\nconst scopedRootPrefix = \"hv-uikit-scoped-root\" as const;\n\n/**\n * Enables theming capabilities and makes cross-component theme properties available down the tree.\n */\nexport const HvProvider = ({\n children,\n rootElementId,\n cssBaseline = \"global\",\n cssTheme = \"global\",\n themes,\n theme,\n colorMode,\n emotionCache: emotionCacheProp,\n classNameKey = defaultCacheKey,\n}: HvProviderProps) => {\n const generatedId = useUniqueId();\n const scopedRootId = `${scopedRootPrefix}-${generatedId}`;\n\n // Themes\n const themesList = processThemes(themes);\n\n // Emotion cache\n // Moves UI Kit styles to the top of the <head> so they're loaded first\n // This enables users to override the UI Kit styles if necessary\n const emotionCache = useMemo(() => {\n if (emotionCacheProp) return emotionCacheProp;\n // reuse the default shared cache if `classNameKey` is the same\n if (classNameKey === defaultCacheKey) return defaultEmotionCache;\n\n return createCache({ key: classNameKey, prepend: true });\n }, [classNameKey, emotionCacheProp]);\n\n return (\n <CacheProvider value={emotionCache}>\n <Global\n styles={cssReact`\n ${\n cssBaseline === \"global\" && {\n [`@layer hv-uikit-baseline`]: {\n ...CssBaseline,\n },\n }\n }\n ${getThemesVars(themesList)}\n `}\n />\n <HvThemeProvider\n themes={themesList}\n theme={theme || themesList[0].name}\n emotionCache={emotionCache}\n colorMode={colorMode || Object.keys(themesList[0].colors.modes)[0]}\n themeRootId={\n cssTheme === \"scoped\" ? rootElementId || scopedRootId : undefined\n }\n >\n <ClassNames>\n {({ css }) => {\n if (cssBaseline === \"scoped\") {\n const rootElement = getElementById(rootElementId);\n\n if (rootElement) {\n rootElement.classList.add(\n css({\n [`@layer ${rootElementId}-baseline`]: {\n ...CssScopedBaseline,\n },\n }),\n );\n }\n }\n\n return (cssTheme === \"scoped\" || cssBaseline === \"scoped\") &&\n !rootElementId ? (\n <div\n id={scopedRootId}\n className={\n cssBaseline === \"scoped\"\n ? css({\n [`@layer ${rootElementId}-baseline`]: {\n ...CssScopedBaseline,\n },\n })\n : undefined\n }\n >\n {children}\n </div>\n ) : (\n children\n );\n }}\n </ClassNames>\n </HvThemeProvider>\n </CacheProvider>\n );\n};\n"],"names":["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ACpC,GAAG;AAAA,kBACL;AAAA,gBAAA,CACD;AAAA,cAAA;AAAA,YAEL;AAAA,UACF;AAEA,kBAAQ,aAAa,YAAY,gBAAgB,aAC/C,CAAC,gBACD;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,IAAI;AAAA,cACJ,WACE,gBAAgB,WACZA,KAAI;AAAA,gBACF,CAAC,UAAU,aAAa,WAAW,GAAG;AAAA,kBACpC,GAAG;AAAA,gBACL;AAAA,cACD,CAAA,IACD;AAAA,cAGL;AAAA,YAAA;AAAA,UAGH,IAAA;AAAA,QAAA,GAGN;AAAA,MAAA;AAAA,IACF;AAAA,EACF,EAAA,CAAA;AAEJ;"}
@@ -1,4 +1,4 @@
1
- import { jsx } from "@emotion/react/jsx-runtime";
1
+ import { jsx } from "react/jsx-runtime";
2
2
  import { useState, useEffect, useCallback, useMemo } from "react";
3
3
  import { createTheme, ThemeProvider } from "@mui/material/styles";
4
4
  import { HvThemeContext, EmotionContext } from "@hitachivantara/uikit-react-shared";
@@ -8,41 +8,34 @@ import { setElementAttrs } from "../utils/theme.js";
8
8
  const HvThemeProvider = ({
9
9
  children,
10
10
  themes: themesList,
11
- theme,
11
+ theme: themeProp,
12
12
  emotionCache,
13
- colorMode,
13
+ colorMode: colorModeProp,
14
14
  themeRootId: rootId
15
15
  }) => {
16
- const initTheme = parseTheme(themesList, theme, colorMode);
17
- const [parsedTheme, setParsedTheme] = useState(initTheme);
18
- const [activeTheme, setActiveTheme] = useState(parsedTheme.theme);
19
- const [selectedTheme, setSelectedTheme] = useState(parsedTheme.selectedTheme);
20
- const [selectedMode, setThemeMode] = useState(parsedTheme.selectedMode);
21
- const [colorModes, setColorModes] = useState(parsedTheme.colorModes);
22
- const [themes, setThemes] = useState(themesList.map((t) => t.name));
16
+ const [theme, setTheme] = useState(themeProp);
17
+ const [colorMode, setColorMode] = useState(colorModeProp);
18
+ const {
19
+ theme: activeTheme,
20
+ selectedTheme,
21
+ selectedMode,
22
+ colorModes,
23
+ colorScheme
24
+ } = parseTheme(themesList, theme, colorMode);
25
+ const themes = themesList.map((t) => t.name);
23
26
  useEffect(() => {
24
- const pTheme = parseTheme(themesList, theme, colorMode);
25
- setThemes(themesList.map((t) => t.name));
26
- setParsedTheme(pTheme);
27
- }, [themesList, theme, colorMode]);
27
+ setTheme(themeProp);
28
+ setColorMode(colorModeProp);
29
+ }, [colorModeProp, themeProp]);
28
30
  useEffect(() => {
29
- setActiveTheme(parsedTheme.theme);
30
- setSelectedTheme(parsedTheme.selectedTheme);
31
- setThemeMode(parsedTheme.selectedMode);
32
- setColorModes(parsedTheme.colorModes);
33
- setElementAttrs(
34
- parsedTheme.selectedTheme,
35
- parsedTheme.selectedMode,
36
- parsedTheme.colorScheme,
37
- rootId
38
- );
39
- }, [parsedTheme, rootId]);
31
+ setElementAttrs(selectedTheme, selectedMode, colorScheme, rootId);
32
+ }, [colorScheme, rootId, selectedMode, selectedTheme]);
40
33
  const changeTheme = useCallback(
41
34
  (newTheme = selectedTheme, newMode = selectedMode) => {
42
- const pTheme = parseTheme(themesList, newTheme, newMode);
43
- setParsedTheme(pTheme);
35
+ setTheme(newTheme);
36
+ setColorMode(newMode);
44
37
  },
45
- [selectedMode, selectedTheme, themesList]
38
+ [selectedMode, selectedTheme]
46
39
  );
47
40
  const value = useMemo(
48
41
  () => ({
@@ -64,25 +57,25 @@ const HvThemeProvider = ({
64
57
  rootId
65
58
  ]
66
59
  );
67
- const MuiTheme = createTheme({
68
- components: {
69
- MuiButtonBase: {
70
- defaultProps: {
71
- disableRipple: true
60
+ const muiTheme = useMemo(() => {
61
+ return createTheme({
62
+ components: {
63
+ MuiButtonBase: {
64
+ defaultProps: {
65
+ disableRipple: true
66
+ }
72
67
  }
68
+ },
69
+ breakpoints: {
70
+ ...activeTheme.breakpoints
73
71
  }
74
- },
75
- breakpoints: {
76
- values: {
77
- ...activeTheme.breakpoints.values
78
- }
79
- }
80
- });
72
+ });
73
+ }, [activeTheme.breakpoints]);
81
74
  const emotionCacheValue = useMemo(
82
75
  () => ({ cache: emotionCache }),
83
76
  [emotionCache]
84
77
  );
85
- return /* @__PURE__ */ jsx(ThemeProvider, { theme: MuiTheme, children: /* @__PURE__ */ jsx(HvThemeContext.Provider, { value, children: /* @__PURE__ */ jsx(EmotionContext.Provider, { value: emotionCacheValue, children }) }) });
78
+ return /* @__PURE__ */ jsx(ThemeProvider, { theme: muiTheme, children: /* @__PURE__ */ jsx(HvThemeContext.Provider, { value, children: /* @__PURE__ */ jsx(EmotionContext.Provider, { value: emotionCacheValue, children }) }) });
86
79
  };
87
80
  export {
88
81
  EmotionContext2 as EmotionContext,
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeProvider.js","sources":["../../../src/providers/ThemeProvider.tsx"],"sourcesContent":["import { useCallback, useEffect, useMemo, useState } from \"react\";\nimport { EmotionCache } from \"@emotion/cache\";\nimport {\n createTheme,\n ThemeProvider as MuiThemeProvider,\n} from \"@mui/material/styles\";\nimport {\n defaultCacheKey,\n defaultEmotionCache,\n EmotionContext,\n HvThemeContext,\n type HvThemeContextValue,\n} from \"@hitachivantara/uikit-react-shared\";\nimport { HvThemeStructure, parseTheme } from \"@hitachivantara/uikit-styles\";\n\nimport { HvTheme } from \"../types/theme\";\nimport { setElementAttrs } from \"../utils/theme\";\n\nexport { HvThemeContext };\nexport type { HvThemeContextValue };\n\nexport { defaultCacheKey, defaultEmotionCache, EmotionContext };\n\ninterface HvThemeProviderProps {\n children: React.ReactNode;\n themes: (HvTheme | HvThemeStructure)[];\n theme: string;\n emotionCache: EmotionCache;\n colorMode: string;\n themeRootId?: string;\n}\n\nexport const HvThemeProvider = ({\n children,\n themes: themesList,\n theme,\n emotionCache,\n colorMode,\n themeRootId: rootId,\n}: HvThemeProviderProps) => {\n const initTheme = parseTheme(themesList, theme, colorMode);\n\n const [parsedTheme, setParsedTheme] = useState(initTheme);\n const [activeTheme, setActiveTheme] = useState(parsedTheme.theme);\n const [selectedTheme, setSelectedTheme] = useState(parsedTheme.selectedTheme);\n const [selectedMode, setThemeMode] = useState(parsedTheme.selectedMode);\n const [colorModes, setColorModes] = useState(parsedTheme.colorModes);\n const [themes, setThemes] = useState(themesList.map((t) => t.name));\n\n useEffect(() => {\n const pTheme = parseTheme(themesList, theme, colorMode);\n setThemes(themesList.map((t) => t.name));\n setParsedTheme(pTheme);\n }, [themesList, theme, colorMode]);\n\n useEffect(() => {\n setActiveTheme(parsedTheme.theme);\n setSelectedTheme(parsedTheme.selectedTheme);\n setThemeMode(parsedTheme.selectedMode);\n setColorModes(parsedTheme.colorModes);\n\n setElementAttrs(\n parsedTheme.selectedTheme,\n parsedTheme.selectedMode,\n parsedTheme.colorScheme,\n rootId,\n );\n }, [parsedTheme, rootId]);\n\n const changeTheme = useCallback(\n (newTheme = selectedTheme, newMode = selectedMode) => {\n const pTheme = parseTheme(themesList, newTheme, newMode);\n setParsedTheme(pTheme);\n },\n [selectedMode, selectedTheme, themesList],\n );\n\n const value = useMemo<HvThemeContextValue>(\n () => ({\n themes,\n colorModes,\n activeTheme: activeTheme as HvTheme,\n selectedTheme,\n selectedMode,\n changeTheme,\n rootId,\n }),\n [\n themes,\n colorModes,\n activeTheme,\n selectedTheme,\n selectedMode,\n changeTheme,\n rootId,\n ],\n );\n\n const MuiTheme = createTheme({\n components: {\n MuiButtonBase: {\n defaultProps: {\n disableRipple: true,\n },\n },\n },\n breakpoints: {\n values: {\n ...activeTheme.breakpoints.values,\n },\n },\n });\n\n const emotionCacheValue = useMemo(\n () => ({ cache: emotionCache }),\n [emotionCache],\n );\n\n return (\n <MuiThemeProvider theme={MuiTheme}>\n <HvThemeContext.Provider value={value}>\n <EmotionContext.Provider value={emotionCacheValue}>\n {children}\n </EmotionContext.Provider>\n </HvThemeContext.Provider>\n </MuiThemeProvider>\n );\n};\n"],"names":["MuiThemeProvider"],"mappings":";;;;;;;AAgCO,MAAM,kBAAkB,CAAC;AAAA,EAC9B;AAAA,EACA,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA;A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A,MACA;AAAA,MACA;AAAA,IACF;AAAA,EAAA;AAGF,QAAM,WAAW,YAAY;AAAA,IAC3B,YAAY;AAAA,MACV,eAAe;AAAA,QACb,cAAc;AAAA,UACZ,eAAe;AAAA,QACjB;AAAA,MACF;AAAA,IACF;AAAA,IACA,aAAa;AAAA,MACX,QAAQ;AAAA,QACN,GAAG,YAAY,YAAY;AAAA,MAC7B;AAAA,IACF;AAAA,EAAA,CACD;AAED,QAAM,oBAAoB;AAAA,IACxB,OAAO,EAAE,OAAO;IAChB,CAAC,YAAY;AAAA,EAAA;AAGf,6BACGA,eAAiB,EAAA,OAAO,UACvB,UAAA,oBAAC,eAAe,UAAf,EAAwB,OACvB,UAAA,oBAAC,eAAe,UAAf,EAAwB,OAAO,mBAC7B,SACH,CAAA,GACF,EACF,CAAA;AAEJ;"}
1
+ {"version":3,"file":"ThemeProvider.js","sources":["../../../src/providers/ThemeProvider.tsx"],"sourcesContent":["import { useCallback, useEffect, useMemo, useState } from \"react\";\nimport { EmotionCache } from \"@emotion/cache\";\nimport {\n createTheme,\n ThemeProvider as MuiThemeProvider,\n} from \"@mui/material/styles\";\nimport {\n defaultCacheKey,\n defaultEmotionCache,\n EmotionContext,\n HvThemeContext,\n type HvThemeContextValue,\n} from \"@hitachivantara/uikit-react-shared\";\nimport { HvThemeStructure, parseTheme } from \"@hitachivantara/uikit-styles\";\n\nimport { HvTheme } from \"../types/theme\";\nimport { setElementAttrs } from \"../utils/theme\";\n\nexport { HvThemeContext };\nexport type { HvThemeContextValue };\n\nexport { defaultCacheKey, defaultEmotionCache, EmotionContext };\n\ninterface HvThemeProviderProps {\n children: React.ReactNode;\n themes: (HvTheme | HvThemeStructure)[];\n theme: string;\n emotionCache: EmotionCache;\n colorMode: string;\n themeRootId?: string;\n}\n\nexport const HvThemeProvider = ({\n children,\n themes: themesList,\n theme: themeProp,\n emotionCache,\n colorMode: colorModeProp,\n themeRootId: rootId,\n}: HvThemeProviderProps) => {\n const [theme, setTheme] = useState(themeProp);\n const [colorMode, setColorMode] = useState(colorModeProp);\n\n const {\n theme: activeTheme,\n selectedTheme,\n selectedMode,\n colorModes,\n colorScheme,\n } = parseTheme(themesList, theme, colorMode);\n\n const themes = themesList.map((t) => t.name);\n\n // review in v6 so that theme/colorMode isn't both controlled & uncontrolled\n useEffect(() => {\n setTheme(themeProp);\n setColorMode(colorModeProp);\n }, [colorModeProp, themeProp]);\n\n useEffect(() => {\n setElementAttrs(selectedTheme, selectedMode, colorScheme, rootId);\n }, [colorScheme, rootId, selectedMode, selectedTheme]);\n\n const changeTheme = useCallback(\n (newTheme = selectedTheme, newMode = selectedMode) => {\n setTheme(newTheme);\n setColorMode(newMode);\n },\n [selectedMode, selectedTheme],\n );\n\n const value = useMemo<HvThemeContextValue>(\n () => ({\n themes,\n colorModes,\n activeTheme: activeTheme as HvTheme,\n selectedTheme,\n selectedMode,\n changeTheme,\n rootId,\n }),\n [\n themes,\n colorModes,\n activeTheme,\n selectedTheme,\n selectedMode,\n changeTheme,\n rootId,\n ],\n );\n\n const muiTheme = useMemo(() => {\n return createTheme({\n components: {\n MuiButtonBase: {\n defaultProps: {\n disableRipple: true,\n },\n },\n },\n breakpoints: {\n ...activeTheme.breakpoints,\n },\n });\n }, [activeTheme.breakpoints]);\n\n const emotionCacheValue = useMemo(\n () => ({ cache: emotionCache }),\n [emotionCache],\n );\n\n return (\n <MuiThemeProvider theme={muiTheme}>\n <HvThemeContext.Provider value={value}>\n <EmotionContext.Provider value={emotionCacheValue}>\n {children}\n </EmotionContext.Provider>\n </HvThemeContext.Provider>\n </MuiThemeProvider>\n );\n};\n"],"names":["MuiThemeProvider"],"mappings":";;;;;;;AAgCO,MAAM,kBAAkB,CAAC;AAAA,EAC9B;AAAA,EACA,QAAQ;AAAA,EACR,OAAO;AAAA,EACP;AAAA,EACA,WAAW;AAAA,EACX,aAAa;AACf,MAA4B;AAC1B,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAS,SAAS;AAC5C,QAAM,CAAC,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Ae,UAAf,EAAwB,OAAO,mBAC7B,SACH,CAAA,GACF,EACF,CAAA;AAEJ;"}
@@ -1 +1 @@
1
- {"version":3,"file":"generic.js","sources":["../../../src/types/generic.ts"],"sourcesContent":["import { forwardRef } from \"react\";\nimport type {\n HvExtraDeepProps,\n HvExtraProps,\n} from \"@hitachivantara/uikit-react-shared\";\n\nexport type { HvExtraProps, HvExtraDeepProps };\n\ntype AsProp<C extends React.ElementType> = {\n /** Custom element type to override the root component */\n component?: C;\n};\n\ntype PropsToOmit<C extends React.ElementType, P> = keyof (AsProp<C> & P);\n\n// Workaround to fix the use of Omit with ComponentPropsWithoutRef\n// Without this the event handlers return any instead of the type for the chosen element\ntype FixComponentProps<T> = T extends any ? T : never;\n\ntype PolymorphicComponent<\n C extends React.ElementType,\n Props = {},\n> = React.PropsWithChildren<Props & AsProp<C>> &\n FixComponentProps<\n Omit<React.ComponentPropsWithoutRef<C>, PropsToOmit<C, Props>>\n >;\n\nexport type PolymorphicRef<C extends React.ElementType> =\n React.ComponentPropsWithRef<C>[\"ref\"];\n\nexport type PolymorphicComponentRef<\n C extends React.ElementType,\n Props = {},\n> = PolymorphicComponent<C, Props> & { ref?: PolymorphicRef<C> };\n\n/** HV Base Props. Extends `React.HTMLAttributes` of an element `E`, and filters `K` keys. */\nexport type HvBaseProps<\n E extends HTMLElement = HTMLDivElement,\n K extends keyof React.HTMLAttributes<E> = never,\n> = Omit<React.HTMLAttributes<E>, K>;\n\n/** This type allows to do a deep partial by applying the Partial type to each key recursively */\nexport type DeepPartial<T> = T extends Object\n ? Partial<{\n [P in keyof T]: DeepPartial<T[P]>;\n }>\n : T;\n\n/** This type combines the HvExtraProps and DeepPartial types */\nexport type HvExtraDeepPartialProps<T> = Partial<{\n [P in keyof T]: DeepPartial<T[P]> & HvExtraProps;\n}> &\n HvExtraProps;\n\nexport type Arrayable<T> = T | T[];\n\n/** React.forwardRef with fixed type declarations */\nexport function fixedForwardRef<T, P = {}>(\n // TODO: change `React.ReactElement | null` to `React.ReactNode` in typescript@5\n render: (props: P, ref: React.Ref<T>) => React.ReactElement | null,\n): (props: P & React.RefAttributes<T>) => React.ReactElement | null {\n return forwardRef(render) as any;\n}\n\n// Source code from: https://github.com/piotrwitek/utility-types/blob/master/src/mapped-types.ts\n/**\n * Optional\n * @desc From `T` make a set of properties by key `K` become optional\n * @example\n * type Props = {\n * name: string;\n * age: number;\n * visible: boolean;\n * };\n *\n * // Expect: { name?: string; age?: number; visible?: boolean; }\n * type Props = Optional<Props>;\n *\n * // Expect: { name: string; age?: number; visible?: boolean; }\n * type Props = Optional<Props, 'age' | 'visible'>;\n */\nexport type HvOptional<T extends object, K extends keyof T = keyof T> = Omit<\n T,\n K\n> &\n Partial<Pick<T, K>>;\n"],"names":[],"mappings":";AAyDO,SAAS,gBAEd,QACkE;AAClE,SAAO,WAAW,MAAM;AAC1B;"}
1
+ {"version":3,"file":"generic.js","sources":["../../../src/types/generic.ts"],"sourcesContent":["import { forwardRef } from \"react\";\nimport type {\n HvExtraDeepProps,\n HvExtraProps,\n} from \"@hitachivantara/uikit-react-shared\";\n\nexport type { HvExtraProps, HvExtraDeepProps };\n\ntype AsProp<C extends React.ElementType> = {\n /** Custom element type to override the root component */\n component?: C;\n};\n\ntype PropsToOmit<C extends React.ElementType, P> = keyof (AsProp<C> & P);\n\n// Workaround to fix the use of Omit with ComponentPropsWithoutRef\n// Without this the event handlers return any instead of the type for the chosen element\ntype FixComponentProps<T> = T extends any ? T : never;\n\ntype PolymorphicComponent<\n C extends React.ElementType,\n Props = {},\n> = React.PropsWithChildren<Props & AsProp<C>> &\n FixComponentProps<\n Omit<React.ComponentPropsWithoutRef<C>, PropsToOmit<C, Props>>\n >;\n\nexport type PolymorphicRef<C extends React.ElementType> =\n React.ComponentPropsWithRef<C>[\"ref\"];\n\nexport type PolymorphicComponentRef<\n C extends React.ElementType,\n Props = {},\n> = PolymorphicComponent<C, Props> & { ref?: PolymorphicRef<C> };\n\n/** HV Base Props. Extends `React.HTMLAttributes` of an element `E`, and filters `K` keys. */\nexport type HvBaseProps<\n E extends HTMLElement = HTMLDivElement,\n K extends keyof React.HTMLAttributes<E> = never,\n> = Omit<React.HTMLAttributes<E>, K>;\n\n/** This type allows to do a deep partial by applying the Partial type to each key recursively */\nexport type DeepPartial<T> = T extends {}\n ? Partial<{\n [P in keyof T]: DeepPartial<T[P]>;\n }>\n : T;\n\n/** This type combines the HvExtraProps and DeepPartial types */\nexport type HvExtraDeepPartialProps<T> = Partial<{\n [P in keyof T]: DeepPartial<T[P]> & HvExtraProps;\n}> &\n HvExtraProps;\n\nexport type Arrayable<T> = T | T[];\n\n/** React.forwardRef with fixed type declarations */\nexport function fixedForwardRef<T, P = {}>(\n // TODO: change `React.ReactElement | null` to `React.ReactNode` in typescript@5\n render: (props: P, ref: React.Ref<T>) => React.ReactElement | null,\n): (props: P & React.RefAttributes<T>) => React.ReactElement | null {\n return forwardRef(render) as any;\n}\n\n// Source code from: https://github.com/piotrwitek/utility-types/blob/master/src/mapped-types.ts\n/**\n * Optional\n * @desc From `T` make a set of properties by key `K` become optional\n * @example\n * type Props = {\n * name: string;\n * age: number;\n * visible: boolean;\n * };\n *\n * // Expect: { name?: string; age?: number; visible?: boolean; }\n * type Props = Optional<Props>;\n *\n * // Expect: { name: string; age?: number; visible?: boolean; }\n * type Props = Optional<Props, 'age' | 'visible'>;\n */\nexport type HvOptional<T extends object, K extends keyof T = keyof T> = Omit<\n T,\n K\n> &\n Partial<Pick<T, K>>;\n"],"names":[],"mappings":";AAyDO,SAAS,gBAEd,QACkE;AAClE,SAAO,WAAW,MAAM;AAC1B;"}
@@ -4,7 +4,11 @@ function getDocument() {
4
4
  function getElementById(elementId) {
5
5
  return elementId && getDocument()?.getElementById(elementId) || void 0;
6
6
  }
7
+ function getContainerElement(elementId) {
8
+ return getElementById(elementId) || getDocument()?.body;
9
+ }
7
10
  export {
11
+ getContainerElement,
8
12
  getDocument,
9
13
  getElementById
10
14
  };
@@ -1 +1 @@
1
- {"version":3,"file":"document.js","sources":["../../../src/utils/document.ts"],"sourcesContent":["export function getDocument() {\n return typeof window !== \"undefined\" ? document : undefined;\n}\n\n/** Wrapper around `document.getElementById` */\nexport function getElementById(elementId?: string) {\n return (elementId && getDocument()?.getElementById(elementId)) || undefined;\n}\n\n/** Get a container element by id, falling back to document-body */\nexport function getContainerElement(elementId?: string) {\n return getElementById(elementId) || getDocument()?.body;\n}\n"],"names":[],"mappings":"AAAO,SAAS,cAAc;AACrB,SAAA,OAAO,WAAW,cAAc,WAAW;AACpD;AAGO,SAAS,eAAe,WAAoB;AACjD,SAAQ,aAAa,YAAe,GAAA,eAAe,SAAS,KAAM;AACpE;"}
1
+ {"version":3,"file":"document.js","sources":["../../../src/utils/document.ts"],"sourcesContent":["export function getDocument() {\n return typeof window !== \"undefined\" ? document : undefined;\n}\n\n/** Wrapper around `document.getElementById` */\nexport function getElementById(elementId?: string) {\n return (elementId && getDocument()?.getElementById(elementId)) || undefined;\n}\n\n/** Get a container element by id, falling back to document-body */\nexport function getContainerElement(elementId?: string) {\n return getElementById(elementId) || getDocument()?.body;\n}\n"],"names":[],"mappings":"AAAO,SAAS,cAAc;AACrB,SAAA,OAAO,WAAW,cAAc,WAAW;AACpD;AAGO,SAAS,eAAe,WAAoB;AACjD,SAAQ,aAAa,YAAe,GAAA,eAAe,SAAS,KAAM;AACpE;AAGO,SAAS,oBAAoB,WAAoB;AACtD,SAAO,eAAe,SAAS,KAAK,YAAA,GAAe;AACrD;"}
@@ -1,5 +1,5 @@
1
1
  const SELECTORS = 'input, button, select, textarea, a[href], [tabindex]:not([tabindex="-1"])';
2
- const getFocusableList = (node) => node && node.querySelectorAll(SELECTORS) || [];
2
+ const getFocusableList = (node) => node?.querySelectorAll(SELECTORS) || [];
3
3
  const getPrevNextFocus = (nodeId) => {
4
4
  const nodes = getFocusableList(document);
5
5
  const nbNodes = nodes.length;
@@ -1 +1 @@
1
- {"version":3,"file":"focusableElementFinder.js","sources":["../../../src/utils/focusableElementFinder.ts"],"sourcesContent":["const SELECTORS =\n 'input, button, select, textarea, a[href], [tabindex]:not([tabindex=\"-1\"])';\n\n/** Gets the list of focusable elements. */\nexport const getFocusableList = (node: any) =>\n (node && node.querySelectorAll(SELECTORS)) || [];\n\n/** Auxiliary function to find adjacent nodes to focus. */\nexport const getPrevNextFocus = (nodeId?: string) => {\n const nodes = getFocusableList(document);\n\n const nbNodes = nodes.length;\n let index = 0;\n for (; index < nbNodes; index += 1) {\n if (nodes[index].id === nodeId) {\n break;\n }\n }\n return {\n nextFocus: nodes[index + 1 > nbNodes - 1 ? 0 : index + 1],\n prevFocus: nodes[index - 1 < 0 ? nbNodes - 1 : index - 1],\n };\n};\n\n/** Get the first and last focusable element from a node. */\nexport const getFirstAndLastFocus = (node: any) => {\n const focusableList = getFocusableList(node);\n\n return {\n first: focusableList[0] || null,\n last: focusableList[focusableList.length - 1] || null,\n };\n};\n\nexport default getPrevNextFocus;\n"],"names":[],"mappings":"AAAA,MAAM,YACJ;AAGW,MAAA,mBAAmB,CAAC,SAC9B,QAAQ,KAAK,iBAAiB,SAAS,KAAM,CAAC;AAGpC,MAAA,mBAAmB,CAAC,WAAoB;AAC7C,QAAA,QAAQ,iBAAiB,QAAQ;AAEvC,QAAM,UAAU,MAAM;AACtB,MAAI,QAAQ;AACL,SAAA,QAAQ,SAAS,SAAS,GAAG;AAClC,QAAI,MAAM,KAAK,EAAE,OAAO,QAAQ;AAC9B;AAAA,IACF;AAAA,EACF;AACO,SAAA;AAAA,IACL,WAAW,MAAM,QAAQ,IAAI,UAAU,IAAI,IAAI,QAAQ,CAAC;AAAA,IACxD,WAAW,MAAM,QAAQ,IAAI,IAAI,UAAU,IAAI,QAAQ,CAAC;AAAA,EAAA;AAE5D;AAGa,MAAA,uBAAuB,CAAC,SAAc;AAC3C,QAAA,gBAAgB,iBAAiB,IAAI;AAEpC,SAAA;AAAA,IACL,OAAO,cAAc,CAAC,KAAK;AAAA,IAC3B,MAAM,cAAc,cAAc,SAAS,CAAC,KAAK;AAAA,EAAA;AAErD;"}
1
+ {"version":3,"file":"focusableElementFinder.js","sources":["../../../src/utils/focusableElementFinder.ts"],"sourcesContent":["const SELECTORS =\n 'input, button, select, textarea, a[href], [tabindex]:not([tabindex=\"-1\"])';\n\n/** Gets the list of focusable elements. */\nexport const getFocusableList = (node: any) =>\n node?.querySelectorAll(SELECTORS) || [];\n\n/** Auxiliary function to find adjacent nodes to focus. */\nexport const getPrevNextFocus = (nodeId?: string) => {\n const nodes = getFocusableList(document);\n\n const nbNodes = nodes.length;\n let index = 0;\n for (; index < nbNodes; index += 1) {\n if (nodes[index].id === nodeId) {\n break;\n }\n }\n return {\n nextFocus: nodes[index + 1 > nbNodes - 1 ? 0 : index + 1],\n prevFocus: nodes[index - 1 < 0 ? nbNodes - 1 : index - 1],\n };\n};\n\n/** Get the first and last focusable element from a node. */\nexport const getFirstAndLastFocus = (node: any) => {\n const focusableList = getFocusableList(node);\n\n return {\n first: focusableList[0] || null,\n last: focusableList[focusableList.length - 1] || null,\n };\n};\n\nexport default getPrevNextFocus;\n"],"names":[],"mappings":"AAAA,MAAM,YACJ;AAGK,MAAM,mBAAmB,CAAC,SAC/B,MAAM,iBAAiB,SAAS,KAAK,CAAC;AAG3B,MAAA,mBAAmB,CAAC,WAAoB;AAC7C,QAAA,QAAQ,iBAAiB,QAAQ;AAEvC,QAAM,UAAU,MAAM;AACtB,MAAI,QAAQ;AACL,SAAA,QAAQ,SAAS,SAAS,GAAG;AAClC,QAAI,MAAM,KAAK,EAAE,OAAO,QAAQ;AAC9B;AAAA,IACF;AAAA,EACF;AACO,SAAA;AAAA,IACL,WAAW,MAAM,QAAQ,IAAI,UAAU,IAAI,IAAI,QAAQ,CAAC;AAAA,IACxD,WAAW,MAAM,QAAQ,IAAI,IAAI,UAAU,IAAI,QAAQ,CAAC;AAAA,EAAA;AAE5D;AAGa,MAAA,uBAAuB,CAAC,SAAc;AAC3C,QAAA,gBAAgB,iBAAiB,IAAI;AAEpC,SAAA;AAAA,IACL,OAAO,cAAc,CAAC,KAAK;AAAA,IAC3B,MAAM,cAAc,cAAc,SAAS,CAAC,KAAK;AAAA,EAAA;AAErD;"}
@@ -1,4 +1,4 @@
1
- import { jsx } from "@emotion/react/jsx-runtime";
1
+ import { jsx } from "react/jsx-runtime";
2
2
  import { Info, Fail, Caution, Success } from "@hitachivantara/uikit-react-icons";
3
3
  const iconVariant = (variant, color, semantic) => {
4
4
  switch (variant) {
@@ -1,7 +1,7 @@
1
1
  import { themes } from "@hitachivantara/uikit-styles";
2
- import { getElementById } from "./document.js";
2
+ import { getContainerElement, getElementById } from "./document.js";
3
3
  const setElementAttrs = (themeName, modeName, colorScheme, themeRootId) => {
4
- const element = themeRootId ? document.getElementById(themeRootId) : document.body;
4
+ const element = getContainerElement(themeRootId);
5
5
  if (element) {
6
6
  element.setAttribute(`data-theme`, themeName);
7
7
  element.setAttribute(`data-color-mode`, modeName);
@@ -1 +1 @@
1
- {"version":3,"file":"theme.js","sources":["../../../src/utils/theme.ts"],"sourcesContent":["import {\n HvThemeColorModeStructure,\n HvThemeStructure,\n themes,\n} from \"@hitachivantara/uikit-styles\";\n\nimport { HvCreateThemeProps, HvTheme } from \"../types/theme\";\nimport { getElementById } from \"./document\";\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 styles for child components to inherit\n element.classList.add(`uikit-root-element`);\n element.style.colorScheme = colorScheme;\n }\n};\n\n/**\n * Applies customizations to a theme.\n */\nconst applyThemeCustomizations = (obj: any, customizations: any) => {\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 // Set theme base\n customizedTheme.base = base;\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.forEach((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 }\n // DS5\n return [themes.ds5];\n};\n\nexport const getVarValue = (cssVar: string, rootElementId?: string) => {\n const root = getElementById(rootElementId || \"hv-root\");\n if (!root) return undefined;\n\n return getComputedStyle(root)\n .getPropertyValue(cssVar.replace(\"var(\", \"\").replace(\")\", \"\"))\n .trim();\n};\n"],"names":[],"mappings":";;AAYO,MAAM,kBAAkB,CAC7B,WACA,UACA,aACA,gBACG;AACH,QAAM,UAAU,cACZ,SAAS,eAAe,WAAW,IACnC,SAAS;AAEb,MAAI,SAAS;AACH,YAAA,aAAa,cAAc,SAAS;AACpC,YAAA,aAAa,mBAAmB,QAAQ;AAGxC,YAAA,UAAU,IAAI,oBAAoB;AAC1C,YAAQ,MAAM,cAAc;AAAA,EAC9B;AACF;AAKA,MAAM,2BAA2B,CAAC,KAAU,mBAAwB;AAC5D,QAAA,WAAW,CAAC,QAChB,OAAO,OAAO,QAAQ,YAAY,CAAC,MAAM,QAAQ,GAAG;AAGhD,QAAA,kBAAkB,EAAE,GAAG;AAG7B,SAAO,KAAK,cAAc,EAAE,QAAQ,CAAC,QAAQ;AACvC,QAAA,gBAAgB,GAAG,GAAG;AACpB,UAAA,SAAS,gBAAgB,GAAG,CAAC,KAAK,SAAS,eAAe,GAAG,CAAC,GAAG;AACnE,wBAAgB,GAAG,IAAI;AAAA,UACrB,gBAAgB,GAAG;AAAA,UACnB,eAAe,GAAG;AAAA,QAAA;AAAA,MACpB,WACS,OAAO,gBAAgB,GAAG,MAAM,OAAO,eAAe,GAAG,GAAG;AACrD,wBAAA,GAAG,IAAI,eAAe,GAAG;AAAA,MAC3C;AAAA,IAAA,OACK;AACW,sBAAA,GAAG,IAAI,eAAe,GAAG;AAAA,IAC3C;AAAA,EAA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AK,GAAG;AAAA,MAAA,OACR;AACL,aAAK,KAAK,GAAG;AAAA,MACf;AAAA,IAAA,CACD;AAGM,WAAA;AAAA,EACT;AAEO,SAAA,CAAC,OAAO,GAAG;AACpB;AAEa,MAAA,cAAc,CAAC,QAAgB,kBAA2B;AAC/D,QAAA,OAAO,eAAe,iBAAiB,SAAS;AACtD,MAAI,CAAC;AAAa,WAAA;AAElB,SAAO,iBAAiB,IAAI,EACzB,iBAAiB,OAAO,QAAQ,QAAQ,EAAE,EAAE,QAAQ,KAAK,EAAE,CAAC,EAC5D,KAAK;AACV;"}
1
+ {"version":3,"file":"theme.js","sources":["../../../src/utils/theme.ts"],"sourcesContent":["import {\n HvThemeColorModeStructure,\n HvThemeStructure,\n themes,\n} from \"@hitachivantara/uikit-styles\";\n\nimport { HvCreateThemeProps, HvTheme } from \"../types/theme\";\nimport { getContainerElement, getElementById } from \"./document\";\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 = getContainerElement(themeRootId);\n\n if (element) {\n element.setAttribute(`data-theme`, themeName);\n element.setAttribute(`data-color-mode`, modeName);\n\n // set default styles for child components to inherit\n element.classList.add(`uikit-root-element`);\n element.style.colorScheme = colorScheme;\n }\n};\n\n/**\n * Applies customizations to a theme.\n */\nconst applyThemeCustomizations = (obj: any, customizations: any) => {\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 // Set theme base\n customizedTheme.base = base;\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.forEach((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 }\n // DS5\n return [themes.ds5];\n};\n\nexport const getVarValue = (cssVar: string, rootElementId?: string) => {\n const root = getElementById(rootElementId || \"hv-root\");\n if (!root) return undefined;\n\n return getComputedStyle(root)\n .getPropertyValue(cssVar.replace(\"var(\", \"\").replace(\")\", \"\"))\n .trim();\n};\n"],"names":[],"mappings":";;AAYO,MAAM,kBAAkB,CAC7B,WACA,UACA,aACA,gBACG;AACG,QAAA,UAAU,oBAAoB,WAAW;AAE/C,MAAI,SAAS;AACH,YAAA,aAAa,cAAc,SAAS;AACpC,YAAA,aAAa,mBAAmB,QAAQ;AAGxC,YAAA,UAAU,IAAI,oBAAoB;AAC1C,YAAQ,MAAM,cAAc;AAAA,EAC9B;AACF;AAKA,MAAM,2BAA2B,CAAC,KAAU,mBAAwB;AAC5D,QAAA,WAAW,CAAC,QAChB,OAAO,OAAO,QAAQ,YAAY,CAAC,MAAM,QAAQ,GAAG;AAGhD,QAAA,kBAAkB,EAAE,GAAG;AAG7B,SAAO,KAAK,cAAc,EAAE,QAAQ,CAAC,QAAQ;AACvC,QAAA,gBAAgB,GAAG,GAAG;AACpB,UAAA,SAAS,gBAAgB,GAAG,CAAC,KAAK,SAAS,eAAe,GAAG,CAAC,GAAG;AACnE,wBAAgB,GAAG,IAAI;AAAA,UACrB,gBAAgB,GAAG;AAAA,UACnB,eAAe,GAAG;AAAA,QAAA;AAAA,MACpB,WACS,OAAO,gBAAgB,GAAG,MAAM,OAAO,eAAe,GAAG,GAAG;AACrD,wBAAA,GAAG,IAAI,eAAe,GAAG;AAAA,MAC3C;AAAA,IAAA,OACK;AACW,sBAAA,GAAG,IAAI,eAAe,GAAG;AAAA,IAC3C;AAAA,EAAA,CACD;AAEM,SAAA;AACT;AAMa,MAAA,cAAc,CACzB,UAC+B;AACzB,QAAA;AAAA,IACJ;AAAA,IACA,OAAO;AAAA,IACP,oBAAoB;AAAA,IACpB,GAAG;AAAA,EACD,IAAA;AAGJ,QAAM,kBAA8C,iBAC/C,yBAAyB,OAAO,IAAI,GAAG,cAAc,IACtD,EAAE,GAAG,OAAO,IAAI,EAAE;AAGN,kB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