@hitachivantara/uikit-react-lab 4.0.3 → 4.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (420) hide show
  1. package/dist/ColorPicker/ColorPicker.js +25 -78
  2. package/dist/ColorPicker/ColorPicker.js.map +1 -1
  3. package/dist/ColorPicker/Fields/Fields.js +15 -47
  4. package/dist/ColorPicker/Fields/Fields.js.map +1 -1
  5. package/dist/ColorPicker/Fields/index.js +0 -2
  6. package/dist/ColorPicker/Fields/index.js.map +1 -1
  7. package/dist/ColorPicker/Fields/styles.js +0 -2
  8. package/dist/ColorPicker/Fields/styles.js.map +1 -1
  9. package/dist/ColorPicker/Picker/Picker.js +5 -23
  10. package/dist/ColorPicker/Picker/Picker.js.map +1 -1
  11. package/dist/ColorPicker/Picker/index.js +0 -2
  12. package/dist/ColorPicker/Picker/index.js.map +1 -1
  13. package/dist/ColorPicker/Picker/styles.js +0 -2
  14. package/dist/ColorPicker/Picker/styles.js.map +1 -1
  15. package/dist/ColorPicker/PresetColors/PresetColors.js +2 -24
  16. package/dist/ColorPicker/PresetColors/PresetColors.js.map +1 -1
  17. package/dist/ColorPicker/PresetColors/index.js +0 -2
  18. package/dist/ColorPicker/PresetColors/index.js.map +1 -1
  19. package/dist/ColorPicker/PresetColors/styles.js +0 -2
  20. package/dist/ColorPicker/PresetColors/styles.js.map +1 -1
  21. package/dist/ColorPicker/index.js +0 -2
  22. package/dist/ColorPicker/index.js.map +1 -1
  23. package/dist/ColorPicker/styles.js +0 -2
  24. package/dist/ColorPicker/styles.js.map +1 -1
  25. package/dist/Drawer/Drawer.js +10 -50
  26. package/dist/Drawer/Drawer.js.map +1 -1
  27. package/dist/Drawer/index.js +0 -2
  28. package/dist/Drawer/index.js.map +1 -1
  29. package/dist/Drawer/styles.js +0 -3
  30. package/dist/Drawer/styles.js.map +1 -1
  31. package/dist/ImageCarousel/ImageCarousel.js +46 -149
  32. package/dist/ImageCarousel/ImageCarousel.js.map +1 -1
  33. package/dist/ImageCarousel/index.js +0 -2
  34. package/dist/ImageCarousel/index.js.map +1 -1
  35. package/dist/ImageCarousel/styles.js +0 -5
  36. package/dist/ImageCarousel/styles.js.map +1 -1
  37. package/dist/InlineEditor/InlineEditor.js +25 -82
  38. package/dist/InlineEditor/InlineEditor.js.map +1 -1
  39. package/dist/InlineEditor/index.js +0 -2
  40. package/dist/InlineEditor/index.js.map +1 -1
  41. package/dist/InlineEditor/styles.js +0 -14
  42. package/dist/InlineEditor/styles.js.map +1 -1
  43. package/dist/NavigationAnchors/NavigationAnchors.js +44 -116
  44. package/dist/NavigationAnchors/NavigationAnchors.js.map +1 -1
  45. package/dist/NavigationAnchors/NavigationOption.js +0 -10
  46. package/dist/NavigationAnchors/NavigationOption.js.map +1 -1
  47. package/dist/NavigationAnchors/index.js +0 -2
  48. package/dist/NavigationAnchors/index.js.map +1 -1
  49. package/dist/NavigationAnchors/styles.js +0 -2
  50. package/dist/NavigationAnchors/styles.js.map +1 -1
  51. package/dist/NotificationPanel/EmptyStatePanel/EmptyStatePanel.js +5 -26
  52. package/dist/NotificationPanel/EmptyStatePanel/EmptyStatePanel.js.map +1 -1
  53. package/dist/NotificationPanel/EmptyStatePanel/index.js +0 -2
  54. package/dist/NotificationPanel/EmptyStatePanel/index.js.map +1 -1
  55. package/dist/NotificationPanel/EmptyStatePanel/styles.js +0 -2
  56. package/dist/NotificationPanel/EmptyStatePanel/styles.js.map +1 -1
  57. package/dist/NotificationPanel/Notification/Notification.js +12 -57
  58. package/dist/NotificationPanel/Notification/Notification.js.map +1 -1
  59. package/dist/NotificationPanel/Notification/index.js +0 -2
  60. package/dist/NotificationPanel/Notification/index.js.map +1 -1
  61. package/dist/NotificationPanel/Notification/styles.js +0 -14
  62. package/dist/NotificationPanel/Notification/styles.js.map +1 -1
  63. package/dist/NotificationPanel/NotificationPanel.js +23 -92
  64. package/dist/NotificationPanel/NotificationPanel.js.map +1 -1
  65. package/dist/NotificationPanel/NotificationsIndicator/NotificationsIndicator.js +4 -35
  66. package/dist/NotificationPanel/NotificationsIndicator/NotificationsIndicator.js.map +1 -1
  67. package/dist/NotificationPanel/NotificationsIndicator/index.js +0 -2
  68. package/dist/NotificationPanel/NotificationsIndicator/index.js.map +1 -1
  69. package/dist/NotificationPanel/NotificationsIndicator/styles.js +0 -2
  70. package/dist/NotificationPanel/NotificationsIndicator/styles.js.map +1 -1
  71. package/dist/NotificationPanel/index.js +0 -2
  72. package/dist/NotificationPanel/index.js.map +1 -1
  73. package/dist/NotificationPanel/styles.js +0 -2
  74. package/dist/NotificationPanel/styles.js.map +1 -1
  75. package/dist/StepNavigation/DefaultNavigation/DefaultNavigation.js +15 -44
  76. package/dist/StepNavigation/DefaultNavigation/DefaultNavigation.js.map +1 -1
  77. package/dist/StepNavigation/DefaultNavigation/Step/Step.js +9 -41
  78. package/dist/StepNavigation/DefaultNavigation/Step/Step.js.map +1 -1
  79. package/dist/StepNavigation/DefaultNavigation/Step/index.js +0 -2
  80. package/dist/StepNavigation/DefaultNavigation/Step/index.js.map +1 -1
  81. package/dist/StepNavigation/DefaultNavigation/Step/styles.js +0 -2
  82. package/dist/StepNavigation/DefaultNavigation/Step/styles.js.map +1 -1
  83. package/dist/StepNavigation/DefaultNavigation/index.js +0 -2
  84. package/dist/StepNavigation/DefaultNavigation/index.js.map +1 -1
  85. package/dist/StepNavigation/DefaultNavigation/styles.js +0 -2
  86. package/dist/StepNavigation/DefaultNavigation/styles.js.map +1 -1
  87. package/dist/StepNavigation/DefaultNavigation/utils.js +0 -3
  88. package/dist/StepNavigation/DefaultNavigation/utils.js.map +1 -1
  89. package/dist/StepNavigation/SimpleNavigation/Dot/Dot.js +6 -47
  90. package/dist/StepNavigation/SimpleNavigation/Dot/Dot.js.map +1 -1
  91. package/dist/StepNavigation/SimpleNavigation/Dot/index.js +0 -2
  92. package/dist/StepNavigation/SimpleNavigation/Dot/index.js.map +1 -1
  93. package/dist/StepNavigation/SimpleNavigation/Dot/styles.js.map +1 -1
  94. package/dist/StepNavigation/SimpleNavigation/SimpleNavigation.js +14 -44
  95. package/dist/StepNavigation/SimpleNavigation/SimpleNavigation.js.map +1 -1
  96. package/dist/StepNavigation/SimpleNavigation/index.js +0 -2
  97. package/dist/StepNavigation/SimpleNavigation/index.js.map +1 -1
  98. package/dist/StepNavigation/SimpleNavigation/styles.js +0 -2
  99. package/dist/StepNavigation/SimpleNavigation/styles.js.map +1 -1
  100. package/dist/StepNavigation/SimpleNavigation/utils.js +0 -6
  101. package/dist/StepNavigation/SimpleNavigation/utils.js.map +1 -1
  102. package/dist/StepNavigation/StepNavigation.js +39 -106
  103. package/dist/StepNavigation/StepNavigation.js.map +1 -1
  104. package/dist/StepNavigation/index.js +0 -2
  105. package/dist/StepNavigation/index.js.map +1 -1
  106. package/dist/StepNavigation/styles.js +0 -2
  107. package/dist/StepNavigation/styles.js.map +1 -1
  108. package/dist/StepNavigation/utils.js.map +1 -1
  109. package/dist/TimeAgo/TimeAgo.js +13 -44
  110. package/dist/TimeAgo/TimeAgo.js.map +1 -1
  111. package/dist/TimeAgo/formatUtils.js +15 -35
  112. package/dist/TimeAgo/formatUtils.js.map +1 -1
  113. package/dist/TimeAgo/index.js +0 -3
  114. package/dist/TimeAgo/index.js.map +1 -1
  115. package/dist/TimeAgo/styles.js.map +1 -1
  116. package/dist/TimeAgo/useTimeAgo.js +7 -16
  117. package/dist/TimeAgo/useTimeAgo.js.map +1 -1
  118. package/dist/TimeAgo/useTimeout.js +0 -2
  119. package/dist/TimeAgo/useTimeout.js.map +1 -1
  120. package/dist/Wizard/Wizard.js +30 -82
  121. package/dist/Wizard/Wizard.js.map +1 -1
  122. package/dist/Wizard/WizardActions/WizardActions.js +26 -81
  123. package/dist/Wizard/WizardActions/WizardActions.js.map +1 -1
  124. package/dist/Wizard/WizardActions/index.js +0 -2
  125. package/dist/Wizard/WizardActions/index.js.map +1 -1
  126. package/dist/Wizard/WizardActions/styles.js +0 -2
  127. package/dist/Wizard/WizardActions/styles.js.map +1 -1
  128. package/dist/Wizard/WizardContainer/WizardContainer.js +5 -35
  129. package/dist/Wizard/WizardContainer/WizardContainer.js.map +1 -1
  130. package/dist/Wizard/WizardContainer/index.js +0 -2
  131. package/dist/Wizard/WizardContainer/index.js.map +1 -1
  132. package/dist/Wizard/WizardContainer/styles.js +0 -2
  133. package/dist/Wizard/WizardContainer/styles.js.map +1 -1
  134. package/dist/Wizard/WizardContent/LoadingContainer.js +2 -25
  135. package/dist/Wizard/WizardContent/LoadingContainer.js.map +1 -1
  136. package/dist/Wizard/WizardContent/WizardContent.js +10 -53
  137. package/dist/Wizard/WizardContent/WizardContent.js.map +1 -1
  138. package/dist/Wizard/WizardContent/index.js +0 -2
  139. package/dist/Wizard/WizardContent/index.js.map +1 -1
  140. package/dist/Wizard/WizardContent/styles.js +0 -2
  141. package/dist/Wizard/WizardContent/styles.js.map +1 -1
  142. package/dist/Wizard/WizardContext/WizardContext.js +0 -4
  143. package/dist/Wizard/WizardContext/WizardContext.js.map +1 -1
  144. package/dist/Wizard/WizardContext/WizardContextProvider.js +1 -10
  145. package/dist/Wizard/WizardContext/WizardContextProvider.js.map +1 -1
  146. package/dist/Wizard/WizardContext/index.js +0 -3
  147. package/dist/Wizard/WizardContext/index.js.map +1 -1
  148. package/dist/Wizard/WizardTitle/WizardTitle.js +16 -57
  149. package/dist/Wizard/WizardTitle/WizardTitle.js.map +1 -1
  150. package/dist/Wizard/WizardTitle/index.js +0 -2
  151. package/dist/Wizard/WizardTitle/index.js.map +1 -1
  152. package/dist/Wizard/WizardTitle/styles.js +0 -2
  153. package/dist/Wizard/WizardTitle/styles.js.map +1 -1
  154. package/dist/Wizard/index.js +0 -8
  155. package/dist/Wizard/index.js.map +1 -1
  156. package/dist/Wizard/styles.js +0 -2
  157. package/dist/Wizard/styles.js.map +1 -1
  158. package/dist/index.js +0 -23
  159. package/dist/index.js.map +1 -1
  160. package/dist/legacy/ColorPicker/ColorPicker.js +26 -51
  161. package/dist/legacy/ColorPicker/ColorPicker.js.map +1 -1
  162. package/dist/legacy/ColorPicker/Fields/Fields.js +17 -27
  163. package/dist/legacy/ColorPicker/Fields/Fields.js.map +1 -1
  164. package/dist/legacy/ColorPicker/Fields/index.js.map +1 -1
  165. package/dist/legacy/ColorPicker/Fields/styles.js.map +1 -1
  166. package/dist/legacy/ColorPicker/Picker/Picker.js +7 -7
  167. package/dist/legacy/ColorPicker/Picker/Picker.js.map +1 -1
  168. package/dist/legacy/ColorPicker/Picker/index.js.map +1 -1
  169. package/dist/legacy/ColorPicker/Picker/styles.js.map +1 -1
  170. package/dist/legacy/ColorPicker/PresetColors/PresetColors.js +2 -7
  171. package/dist/legacy/ColorPicker/PresetColors/PresetColors.js.map +1 -1
  172. package/dist/legacy/ColorPicker/PresetColors/index.js.map +1 -1
  173. package/dist/legacy/ColorPicker/PresetColors/styles.js.map +1 -1
  174. package/dist/legacy/ColorPicker/index.js.map +1 -1
  175. package/dist/legacy/ColorPicker/styles.js +0 -1
  176. package/dist/legacy/ColorPicker/styles.js.map +1 -1
  177. package/dist/legacy/Drawer/Drawer.js +11 -30
  178. package/dist/legacy/Drawer/Drawer.js.map +1 -1
  179. package/dist/legacy/Drawer/index.js.map +1 -1
  180. package/dist/legacy/Drawer/styles.js +0 -2
  181. package/dist/legacy/Drawer/styles.js.map +1 -1
  182. package/dist/legacy/ImageCarousel/ImageCarousel.js +46 -120
  183. package/dist/legacy/ImageCarousel/ImageCarousel.js.map +1 -1
  184. package/dist/legacy/ImageCarousel/index.js.map +1 -1
  185. package/dist/legacy/ImageCarousel/styles.js +0 -3
  186. package/dist/legacy/ImageCarousel/styles.js.map +1 -1
  187. package/dist/legacy/InlineEditor/InlineEditor.js +26 -55
  188. package/dist/legacy/InlineEditor/InlineEditor.js.map +1 -1
  189. package/dist/legacy/InlineEditor/index.js.map +1 -1
  190. package/dist/legacy/InlineEditor/styles.js +0 -5
  191. package/dist/legacy/InlineEditor/styles.js.map +1 -1
  192. package/dist/legacy/NavigationAnchors/NavigationAnchors.js +44 -82
  193. package/dist/legacy/NavigationAnchors/NavigationAnchors.js.map +1 -1
  194. package/dist/legacy/NavigationAnchors/NavigationOption.js +0 -5
  195. package/dist/legacy/NavigationAnchors/NavigationOption.js.map +1 -1
  196. package/dist/legacy/NavigationAnchors/index.js.map +1 -1
  197. package/dist/legacy/NavigationAnchors/styles.js +0 -1
  198. package/dist/legacy/NavigationAnchors/styles.js.map +1 -1
  199. package/dist/legacy/NotificationPanel/EmptyStatePanel/EmptyStatePanel.js +5 -16
  200. package/dist/legacy/NotificationPanel/EmptyStatePanel/EmptyStatePanel.js.map +1 -1
  201. package/dist/legacy/NotificationPanel/EmptyStatePanel/index.js.map +1 -1
  202. package/dist/legacy/NotificationPanel/EmptyStatePanel/styles.js +0 -1
  203. package/dist/legacy/NotificationPanel/EmptyStatePanel/styles.js.map +1 -1
  204. package/dist/legacy/NotificationPanel/Notification/Notification.js +12 -44
  205. package/dist/legacy/NotificationPanel/Notification/Notification.js.map +1 -1
  206. package/dist/legacy/NotificationPanel/Notification/index.js.map +1 -1
  207. package/dist/legacy/NotificationPanel/Notification/styles.js +0 -5
  208. package/dist/legacy/NotificationPanel/Notification/styles.js.map +1 -1
  209. package/dist/legacy/NotificationPanel/NotificationPanel.js +23 -61
  210. package/dist/legacy/NotificationPanel/NotificationPanel.js.map +1 -1
  211. package/dist/legacy/NotificationPanel/NotificationsIndicator/NotificationsIndicator.js +4 -17
  212. package/dist/legacy/NotificationPanel/NotificationsIndicator/NotificationsIndicator.js.map +1 -1
  213. package/dist/legacy/NotificationPanel/NotificationsIndicator/index.js.map +1 -1
  214. package/dist/legacy/NotificationPanel/NotificationsIndicator/styles.js +0 -1
  215. package/dist/legacy/NotificationPanel/NotificationsIndicator/styles.js.map +1 -1
  216. package/dist/legacy/NotificationPanel/index.js.map +1 -1
  217. package/dist/legacy/NotificationPanel/styles.js +0 -1
  218. package/dist/legacy/NotificationPanel/styles.js.map +1 -1
  219. package/dist/legacy/StepNavigation/DefaultNavigation/DefaultNavigation.js +16 -27
  220. package/dist/legacy/StepNavigation/DefaultNavigation/DefaultNavigation.js.map +1 -1
  221. package/dist/legacy/StepNavigation/DefaultNavigation/Step/Step.js +10 -29
  222. package/dist/legacy/StepNavigation/DefaultNavigation/Step/Step.js.map +1 -1
  223. package/dist/legacy/StepNavigation/DefaultNavigation/Step/index.js.map +1 -1
  224. package/dist/legacy/StepNavigation/DefaultNavigation/Step/styles.js +0 -1
  225. package/dist/legacy/StepNavigation/DefaultNavigation/Step/styles.js.map +1 -1
  226. package/dist/legacy/StepNavigation/DefaultNavigation/index.js.map +1 -1
  227. package/dist/legacy/StepNavigation/DefaultNavigation/styles.js +0 -1
  228. package/dist/legacy/StepNavigation/DefaultNavigation/styles.js.map +1 -1
  229. package/dist/legacy/StepNavigation/DefaultNavigation/utils.js +0 -2
  230. package/dist/legacy/StepNavigation/DefaultNavigation/utils.js.map +1 -1
  231. package/dist/legacy/StepNavigation/SimpleNavigation/Dot/Dot.js +7 -21
  232. package/dist/legacy/StepNavigation/SimpleNavigation/Dot/Dot.js.map +1 -1
  233. package/dist/legacy/StepNavigation/SimpleNavigation/Dot/index.js.map +1 -1
  234. package/dist/legacy/StepNavigation/SimpleNavigation/Dot/styles.js.map +1 -1
  235. package/dist/legacy/StepNavigation/SimpleNavigation/SimpleNavigation.js +15 -26
  236. package/dist/legacy/StepNavigation/SimpleNavigation/SimpleNavigation.js.map +1 -1
  237. package/dist/legacy/StepNavigation/SimpleNavigation/index.js.map +1 -1
  238. package/dist/legacy/StepNavigation/SimpleNavigation/styles.js +0 -1
  239. package/dist/legacy/StepNavigation/SimpleNavigation/styles.js.map +1 -1
  240. package/dist/legacy/StepNavigation/SimpleNavigation/utils.js +0 -6
  241. package/dist/legacy/StepNavigation/SimpleNavigation/utils.js.map +1 -1
  242. package/dist/legacy/StepNavigation/StepNavigation.js +40 -78
  243. package/dist/legacy/StepNavigation/StepNavigation.js.map +1 -1
  244. package/dist/legacy/StepNavigation/index.js.map +1 -1
  245. package/dist/legacy/StepNavigation/styles.js +0 -1
  246. package/dist/legacy/StepNavigation/styles.js.map +1 -1
  247. package/dist/legacy/StepNavigation/utils.js.map +1 -1
  248. package/dist/legacy/TimeAgo/TimeAgo.js +14 -27
  249. package/dist/legacy/TimeAgo/TimeAgo.js.map +1 -1
  250. package/dist/legacy/TimeAgo/formatUtils.js +16 -18
  251. package/dist/legacy/TimeAgo/formatUtils.js.map +1 -1
  252. package/dist/legacy/TimeAgo/index.js.map +1 -1
  253. package/dist/legacy/TimeAgo/styles.js.map +1 -1
  254. package/dist/legacy/TimeAgo/useTimeAgo.js +8 -11
  255. package/dist/legacy/TimeAgo/useTimeAgo.js.map +1 -1
  256. package/dist/legacy/TimeAgo/useTimeout.js.map +1 -1
  257. package/dist/legacy/Wizard/Wizard.js +30 -56
  258. package/dist/legacy/Wizard/Wizard.js.map +1 -1
  259. package/dist/legacy/Wizard/WizardActions/WizardActions.js +26 -55
  260. package/dist/legacy/Wizard/WizardActions/WizardActions.js.map +1 -1
  261. package/dist/legacy/Wizard/WizardActions/index.js.map +1 -1
  262. package/dist/legacy/Wizard/WizardActions/styles.js +0 -1
  263. package/dist/legacy/Wizard/WizardActions/styles.js.map +1 -1
  264. package/dist/legacy/Wizard/WizardContainer/WizardContainer.js +5 -17
  265. package/dist/legacy/Wizard/WizardContainer/WizardContainer.js.map +1 -1
  266. package/dist/legacy/Wizard/WizardContainer/index.js.map +1 -1
  267. package/dist/legacy/Wizard/WizardContainer/styles.js +0 -1
  268. package/dist/legacy/Wizard/WizardContainer/styles.js.map +1 -1
  269. package/dist/legacy/Wizard/WizardContent/LoadingContainer.js +2 -8
  270. package/dist/legacy/Wizard/WizardContent/LoadingContainer.js.map +1 -1
  271. package/dist/legacy/Wizard/WizardContent/WizardContent.js +10 -26
  272. package/dist/legacy/Wizard/WizardContent/WizardContent.js.map +1 -1
  273. package/dist/legacy/Wizard/WizardContent/index.js.map +1 -1
  274. package/dist/legacy/Wizard/WizardContent/styles.js +0 -1
  275. package/dist/legacy/Wizard/WizardContent/styles.js.map +1 -1
  276. package/dist/legacy/Wizard/WizardContext/WizardContext.js +0 -2
  277. package/dist/legacy/Wizard/WizardContext/WizardContext.js.map +1 -1
  278. package/dist/legacy/Wizard/WizardContext/WizardContextProvider.js +1 -5
  279. package/dist/legacy/Wizard/WizardContext/WizardContextProvider.js.map +1 -1
  280. package/dist/legacy/Wizard/WizardContext/index.js.map +1 -1
  281. package/dist/legacy/Wizard/WizardTitle/WizardTitle.js +16 -41
  282. package/dist/legacy/Wizard/WizardTitle/WizardTitle.js.map +1 -1
  283. package/dist/legacy/Wizard/WizardTitle/index.js.map +1 -1
  284. package/dist/legacy/Wizard/WizardTitle/styles.js +0 -1
  285. package/dist/legacy/Wizard/WizardTitle/styles.js.map +1 -1
  286. package/dist/legacy/Wizard/index.js.map +1 -1
  287. package/dist/legacy/Wizard/styles.js +0 -1
  288. package/dist/legacy/Wizard/styles.js.map +1 -1
  289. package/dist/legacy/index.js.map +1 -1
  290. package/dist/modern/ColorPicker/ColorPicker.js +1 -25
  291. package/dist/modern/ColorPicker/ColorPicker.js.map +1 -1
  292. package/dist/modern/ColorPicker/Fields/Fields.js +3 -10
  293. package/dist/modern/ColorPicker/Fields/Fields.js.map +1 -1
  294. package/dist/modern/ColorPicker/Fields/index.js.map +1 -1
  295. package/dist/modern/ColorPicker/Fields/styles.js.map +1 -1
  296. package/dist/modern/ColorPicker/Picker/Picker.js +3 -3
  297. package/dist/modern/ColorPicker/Picker/Picker.js.map +1 -1
  298. package/dist/modern/ColorPicker/Picker/index.js.map +1 -1
  299. package/dist/modern/ColorPicker/Picker/styles.js.map +1 -1
  300. package/dist/modern/ColorPicker/PresetColors/PresetColors.js +0 -5
  301. package/dist/modern/ColorPicker/PresetColors/PresetColors.js.map +1 -1
  302. package/dist/modern/ColorPicker/PresetColors/index.js.map +1 -1
  303. package/dist/modern/ColorPicker/PresetColors/styles.js.map +1 -1
  304. package/dist/modern/ColorPicker/index.js.map +1 -1
  305. package/dist/modern/ColorPicker/styles.js +0 -1
  306. package/dist/modern/ColorPicker/styles.js.map +1 -1
  307. package/dist/modern/Drawer/Drawer.js +11 -30
  308. package/dist/modern/Drawer/Drawer.js.map +1 -1
  309. package/dist/modern/Drawer/index.js.map +1 -1
  310. package/dist/modern/Drawer/styles.js +0 -2
  311. package/dist/modern/Drawer/styles.js.map +1 -1
  312. package/dist/modern/ImageCarousel/ImageCarousel.js +18 -83
  313. package/dist/modern/ImageCarousel/ImageCarousel.js.map +1 -1
  314. package/dist/modern/ImageCarousel/index.js.map +1 -1
  315. package/dist/modern/ImageCarousel/styles.js +0 -1
  316. package/dist/modern/ImageCarousel/styles.js.map +1 -1
  317. package/dist/modern/InlineEditor/InlineEditor.js +16 -43
  318. package/dist/modern/InlineEditor/InlineEditor.js.map +1 -1
  319. package/dist/modern/InlineEditor/index.js.map +1 -1
  320. package/dist/modern/InlineEditor/styles.js +0 -5
  321. package/dist/modern/InlineEditor/styles.js.map +1 -1
  322. package/dist/modern/NavigationAnchors/NavigationAnchors.js +40 -74
  323. package/dist/modern/NavigationAnchors/NavigationAnchors.js.map +1 -1
  324. package/dist/modern/NavigationAnchors/NavigationOption.js +0 -6
  325. package/dist/modern/NavigationAnchors/NavigationOption.js.map +1 -1
  326. package/dist/modern/NavigationAnchors/index.js.map +1 -1
  327. package/dist/modern/NavigationAnchors/styles.js +0 -1
  328. package/dist/modern/NavigationAnchors/styles.js.map +1 -1
  329. package/dist/modern/NotificationPanel/EmptyStatePanel/EmptyStatePanel.js +0 -11
  330. package/dist/modern/NotificationPanel/EmptyStatePanel/EmptyStatePanel.js.map +1 -1
  331. package/dist/modern/NotificationPanel/EmptyStatePanel/index.js.map +1 -1
  332. package/dist/modern/NotificationPanel/EmptyStatePanel/styles.js +0 -1
  333. package/dist/modern/NotificationPanel/EmptyStatePanel/styles.js.map +1 -1
  334. package/dist/modern/NotificationPanel/Notification/Notification.js +2 -33
  335. package/dist/modern/NotificationPanel/Notification/Notification.js.map +1 -1
  336. package/dist/modern/NotificationPanel/Notification/index.js.map +1 -1
  337. package/dist/modern/NotificationPanel/Notification/styles.js +0 -5
  338. package/dist/modern/NotificationPanel/Notification/styles.js.map +1 -1
  339. package/dist/modern/NotificationPanel/NotificationPanel.js +16 -50
  340. package/dist/modern/NotificationPanel/NotificationPanel.js.map +1 -1
  341. package/dist/modern/NotificationPanel/NotificationsIndicator/NotificationsIndicator.js +6 -19
  342. package/dist/modern/NotificationPanel/NotificationsIndicator/NotificationsIndicator.js.map +1 -1
  343. package/dist/modern/NotificationPanel/NotificationsIndicator/index.js.map +1 -1
  344. package/dist/modern/NotificationPanel/NotificationsIndicator/styles.js +0 -1
  345. package/dist/modern/NotificationPanel/NotificationsIndicator/styles.js.map +1 -1
  346. package/dist/modern/NotificationPanel/index.js.map +1 -1
  347. package/dist/modern/NotificationPanel/styles.js +0 -1
  348. package/dist/modern/NotificationPanel/styles.js.map +1 -1
  349. package/dist/modern/StepNavigation/DefaultNavigation/DefaultNavigation.js +14 -23
  350. package/dist/modern/StepNavigation/DefaultNavigation/DefaultNavigation.js.map +1 -1
  351. package/dist/modern/StepNavigation/DefaultNavigation/Step/Step.js +1 -20
  352. package/dist/modern/StepNavigation/DefaultNavigation/Step/Step.js.map +1 -1
  353. package/dist/modern/StepNavigation/DefaultNavigation/Step/index.js.map +1 -1
  354. package/dist/modern/StepNavigation/DefaultNavigation/Step/styles.js +0 -1
  355. package/dist/modern/StepNavigation/DefaultNavigation/Step/styles.js.map +1 -1
  356. package/dist/modern/StepNavigation/DefaultNavigation/index.js.map +1 -1
  357. package/dist/modern/StepNavigation/DefaultNavigation/styles.js +0 -1
  358. package/dist/modern/StepNavigation/DefaultNavigation/styles.js.map +1 -1
  359. package/dist/modern/StepNavigation/DefaultNavigation/utils.js +0 -2
  360. package/dist/modern/StepNavigation/DefaultNavigation/utils.js.map +1 -1
  361. package/dist/modern/StepNavigation/SimpleNavigation/Dot/Dot.js +1 -15
  362. package/dist/modern/StepNavigation/SimpleNavigation/Dot/Dot.js.map +1 -1
  363. package/dist/modern/StepNavigation/SimpleNavigation/Dot/index.js.map +1 -1
  364. package/dist/modern/StepNavigation/SimpleNavigation/Dot/styles.js.map +1 -1
  365. package/dist/modern/StepNavigation/SimpleNavigation/SimpleNavigation.js +14 -23
  366. package/dist/modern/StepNavigation/SimpleNavigation/SimpleNavigation.js.map +1 -1
  367. package/dist/modern/StepNavigation/SimpleNavigation/index.js.map +1 -1
  368. package/dist/modern/StepNavigation/SimpleNavigation/styles.js +0 -1
  369. package/dist/modern/StepNavigation/SimpleNavigation/styles.js.map +1 -1
  370. package/dist/modern/StepNavigation/SimpleNavigation/utils.js +0 -6
  371. package/dist/modern/StepNavigation/SimpleNavigation/utils.js.map +1 -1
  372. package/dist/modern/StepNavigation/StepNavigation.js +25 -62
  373. package/dist/modern/StepNavigation/StepNavigation.js.map +1 -1
  374. package/dist/modern/StepNavigation/index.js.map +1 -1
  375. package/dist/modern/StepNavigation/styles.js +0 -1
  376. package/dist/modern/StepNavigation/styles.js.map +1 -1
  377. package/dist/modern/StepNavigation/utils.js.map +1 -1
  378. package/dist/modern/TimeAgo/TimeAgo.js +11 -24
  379. package/dist/modern/TimeAgo/TimeAgo.js.map +1 -1
  380. package/dist/modern/TimeAgo/formatUtils.js +16 -18
  381. package/dist/modern/TimeAgo/formatUtils.js.map +1 -1
  382. package/dist/modern/TimeAgo/index.js.map +1 -1
  383. package/dist/modern/TimeAgo/styles.js.map +1 -1
  384. package/dist/modern/TimeAgo/useTimeAgo.js +1 -3
  385. package/dist/modern/TimeAgo/useTimeAgo.js.map +1 -1
  386. package/dist/modern/TimeAgo/useTimeout.js.map +1 -1
  387. package/dist/modern/Wizard/Wizard.js +21 -46
  388. package/dist/modern/Wizard/Wizard.js.map +1 -1
  389. package/dist/modern/Wizard/WizardActions/WizardActions.js +0 -24
  390. package/dist/modern/Wizard/WizardActions/WizardActions.js.map +1 -1
  391. package/dist/modern/Wizard/WizardActions/index.js.map +1 -1
  392. package/dist/modern/Wizard/WizardActions/styles.js +0 -1
  393. package/dist/modern/Wizard/WizardActions/styles.js.map +1 -1
  394. package/dist/modern/Wizard/WizardContainer/WizardContainer.js +7 -19
  395. package/dist/modern/Wizard/WizardContainer/WizardContainer.js.map +1 -1
  396. package/dist/modern/Wizard/WizardContainer/index.js.map +1 -1
  397. package/dist/modern/Wizard/WizardContainer/styles.js +0 -1
  398. package/dist/modern/Wizard/WizardContainer/styles.js.map +1 -1
  399. package/dist/modern/Wizard/WizardContent/LoadingContainer.js +4 -10
  400. package/dist/modern/Wizard/WizardContent/LoadingContainer.js.map +1 -1
  401. package/dist/modern/Wizard/WizardContent/WizardContent.js +0 -14
  402. package/dist/modern/Wizard/WizardContent/WizardContent.js.map +1 -1
  403. package/dist/modern/Wizard/WizardContent/index.js.map +1 -1
  404. package/dist/modern/Wizard/WizardContent/styles.js +0 -1
  405. package/dist/modern/Wizard/WizardContent/styles.js.map +1 -1
  406. package/dist/modern/Wizard/WizardContext/WizardContext.js +0 -2
  407. package/dist/modern/Wizard/WizardContext/WizardContext.js.map +1 -1
  408. package/dist/modern/Wizard/WizardContext/WizardContextProvider.js +0 -4
  409. package/dist/modern/Wizard/WizardContext/WizardContextProvider.js.map +1 -1
  410. package/dist/modern/Wizard/WizardContext/index.js.map +1 -1
  411. package/dist/modern/Wizard/WizardTitle/WizardTitle.js +2 -23
  412. package/dist/modern/Wizard/WizardTitle/WizardTitle.js.map +1 -1
  413. package/dist/modern/Wizard/WizardTitle/index.js.map +1 -1
  414. package/dist/modern/Wizard/WizardTitle/styles.js +0 -1
  415. package/dist/modern/Wizard/WizardTitle/styles.js.map +1 -1
  416. package/dist/modern/Wizard/index.js.map +1 -1
  417. package/dist/modern/Wizard/styles.js +0 -1
  418. package/dist/modern/Wizard/styles.js.map +1 -1
  419. package/dist/modern/index.js.map +1 -1
  420. package/package.json +4 -4
@@ -1,38 +1,25 @@
1
1
  "use strict";
2
2
 
3
3
  require("core-js/modules/es.object.keys.js");
4
-
5
4
  require("core-js/modules/es.symbol.js");
6
-
7
5
  require("core-js/modules/es.array.filter.js");
8
-
9
6
  require("core-js/modules/es.object.to-string.js");
10
-
11
7
  require("core-js/modules/es.object.get-own-property-descriptor.js");
12
-
13
8
  require("core-js/modules/web.dom-collections.for-each.js");
14
-
15
9
  require("core-js/modules/es.object.get-own-property-descriptors.js");
16
-
17
10
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
18
-
19
11
  Object.defineProperty(exports, "__esModule", {
20
12
  value: true
21
13
  });
22
14
  exports.default = void 0;
23
-
24
15
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
25
-
26
16
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
27
-
28
17
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
29
-
30
18
  var truncateStyles = {
31
19
  overflow: "hidden",
32
20
  textOverflow: "ellipsis",
33
21
  whiteSpace: "nowrap"
34
22
  };
35
-
36
23
  var styles = function styles(theme) {
37
24
  return {
38
25
  root: {},
@@ -74,7 +61,6 @@ var styles = function styles(theme) {
74
61
  }
75
62
  };
76
63
  };
77
-
78
64
  var _default = styles;
79
65
  exports.default = _default;
80
66
  //# sourceMappingURL=styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"styles.js","names":["truncateStyles","overflow","textOverflow","whiteSpace","styles","theme","root","inputRoot","inputBorderContainer","top","bottom","input","padding","hvSpacing","text","textEmpty","color","hv","typography","placeholderText","button","cursor","height","width","maxWidth","justifyContent","backgroundColor","visibility","icon","iconVisible","largeText","margin"],"sources":["../../src/InlineEditor/styles.js"],"sourcesContent":["const truncateStyles = {\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n};\n\nconst styles = (theme) => ({\n root: {},\n inputRoot: {},\n inputBorderContainer: {\n top: \"unset\",\n bottom: 0,\n },\n input: {\n padding: theme.hvSpacing(\"8px\", 0),\n },\n text: {\n ...truncateStyles,\n },\n textEmpty: {\n color: theme.hv.typography.placeholderText.color,\n },\n button: {\n cursor: \"text\",\n height: \"100%\",\n width: \"100%\",\n maxWidth: \"100%\",\n justifyContent: \"flex-start\",\n\n backgroundColor: \"transparent\",\n \"&:hover, &:active, &:focus\": {\n backgroundColor: \"transparent\",\n \"& $icon\": {\n visibility: \"visible\",\n },\n },\n },\n icon: {\n cursor: \"pointer\",\n visibility: \"hidden\",\n },\n iconVisible: {\n visibility: \"visible\",\n },\n largeText: {\n margin: theme.hvSpacing(\"8px\", 0),\n },\n});\n\nexport default styles;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAMA,cAAc,GAAG;EACrBC,QAAQ,EAAE,QADW;EAErBC,YAAY,EAAE,UAFO;EAGrBC,UAAU,EAAE;AAHS,CAAvB;;AAMA,IAAMC,MAAM,GAAG,SAATA,MAAS,CAACC,KAAD;EAAA,OAAY;IACzBC,IAAI,EAAE,EADmB;IAEzBC,SAAS,EAAE,EAFc;IAGzBC,oBAAoB,EAAE;MACpBC,GAAG,EAAE,OADe;MAEpBC,MAAM,EAAE;IAFY,CAHG;IAOzBC,KAAK,EAAE;MACLC,OAAO,EAAEP,KAAK,CAACQ,SAAN,CAAgB,KAAhB,EAAuB,CAAvB;IADJ,CAPkB;IAUzBC,IAAI,oBACCd,cADD,CAVqB;IAazBe,SAAS,EAAE;MACTC,KAAK,EAAEX,KAAK,CAACY,EAAN,CAASC,UAAT,CAAoBC,eAApB,CAAoCH;IADlC,CAbc;IAgBzBI,MAAM,EAAE;MACNC,MAAM,EAAE,MADF;MAENC,MAAM,EAAE,MAFF;MAGNC,KAAK,EAAE,MAHD;MAINC,QAAQ,EAAE,MAJJ;MAKNC,cAAc,EAAE,YALV;MAONC,eAAe,EAAE,aAPX;MAQN,8BAA8B;QAC5BA,eAAe,EAAE,aADW;QAE5B,WAAW;UACTC,UAAU,EAAE;QADH;MAFiB;IARxB,CAhBiB;IA+BzBC,IAAI,EAAE;MACJP,MAAM,EAAE,SADJ;MAEJM,UAAU,EAAE;IAFR,CA/BmB;IAmCzBE,WAAW,EAAE;MACXF,UAAU,EAAE;IADD,CAnCY;IAsCzBG,SAAS,EAAE;MACTC,MAAM,EAAE1B,KAAK,CAACQ,SAAN,CAAgB,KAAhB,EAAuB,CAAvB;IADC;EAtCc,CAAZ;AAAA,CAAf;;eA2CeT,M"}
1
+ {"version":3,"file":"styles.js","names":["truncateStyles","overflow","textOverflow","whiteSpace","styles","theme","root","inputRoot","inputBorderContainer","top","bottom","input","padding","hvSpacing","text","textEmpty","color","hv","typography","placeholderText","button","cursor","height","width","maxWidth","justifyContent","backgroundColor","visibility","icon","iconVisible","largeText","margin"],"sources":["../../src/InlineEditor/styles.js"],"sourcesContent":["const truncateStyles = {\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n};\n\nconst styles = (theme) => ({\n root: {},\n inputRoot: {},\n inputBorderContainer: {\n top: \"unset\",\n bottom: 0,\n },\n input: {\n padding: theme.hvSpacing(\"8px\", 0),\n },\n text: {\n ...truncateStyles,\n },\n textEmpty: {\n color: theme.hv.typography.placeholderText.color,\n },\n button: {\n cursor: \"text\",\n height: \"100%\",\n width: \"100%\",\n maxWidth: \"100%\",\n justifyContent: \"flex-start\",\n\n backgroundColor: \"transparent\",\n \"&:hover, &:active, &:focus\": {\n backgroundColor: \"transparent\",\n \"& $icon\": {\n visibility: \"visible\",\n },\n },\n },\n icon: {\n cursor: \"pointer\",\n visibility: \"hidden\",\n },\n iconVisible: {\n visibility: \"visible\",\n },\n largeText: {\n margin: theme.hvSpacing(\"8px\", 0),\n },\n});\n\nexport default styles;\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA,IAAMA,cAAc,GAAG;EACrBC,QAAQ,EAAE,QAAQ;EAClBC,YAAY,EAAE,UAAU;EACxBC,UAAU,EAAE;AACd,CAAC;AAED,IAAMC,MAAM,GAAG,SAATA,MAAM,CAAIC,KAAK;EAAA,OAAM;IACzBC,IAAI,EAAE,CAAC,CAAC;IACRC,SAAS,EAAE,CAAC,CAAC;IACbC,oBAAoB,EAAE;MACpBC,GAAG,EAAE,OAAO;MACZC,MAAM,EAAE;IACV,CAAC;IACDC,KAAK,EAAE;MACLC,OAAO,EAAEP,KAAK,CAACQ,SAAS,CAAC,KAAK,EAAE,CAAC;IACnC,CAAC;IACDC,IAAI,oBACCd,cAAc,CAClB;IACDe,SAAS,EAAE;MACTC,KAAK,EAAEX,KAAK,CAACY,EAAE,CAACC,UAAU,CAACC,eAAe,CAACH;IAC7C,CAAC;IACDI,MAAM,EAAE;MACNC,MAAM,EAAE,MAAM;MACdC,MAAM,EAAE,MAAM;MACdC,KAAK,EAAE,MAAM;MACbC,QAAQ,EAAE,MAAM;MAChBC,cAAc,EAAE,YAAY;MAE5BC,eAAe,EAAE,aAAa;MAC9B,4BAA4B,EAAE;QAC5BA,eAAe,EAAE,aAAa;QAC9B,SAAS,EAAE;UACTC,UAAU,EAAE;QACd;MACF;IACF,CAAC;IACDC,IAAI,EAAE;MACJP,MAAM,EAAE,SAAS;MACjBM,UAAU,EAAE;IACd,CAAC;IACDE,WAAW,EAAE;MACXF,UAAU,EAAE;IACd,CAAC;IACDG,SAAS,EAAE;MACTC,MAAM,EAAE1B,KAAK,CAACQ,SAAS,CAAC,KAAK,EAAE,CAAC;IAClC;EACF,CAAC;AAAA,CAAC;AAAC,eAEYT,MAAM;AAAA"}
@@ -1,106 +1,60 @@
1
1
  "use strict";
2
2
 
3
3
  require("core-js/modules/es.object.keys.js");
4
-
5
4
  require("core-js/modules/es.symbol.js");
6
-
7
5
  require("core-js/modules/es.array.filter.js");
8
-
9
6
  require("core-js/modules/es.object.get-own-property-descriptor.js");
10
-
11
7
  require("core-js/modules/web.dom-collections.for-each.js");
12
-
13
8
  require("core-js/modules/es.object.get-own-property-descriptors.js");
14
-
15
9
  require("core-js/modules/es.array.iterator.js");
16
-
17
10
  require("core-js/modules/es.string.iterator.js");
18
-
19
11
  require("core-js/modules/es.weak-map.js");
20
-
21
12
  require("core-js/modules/web.dom-collections.iterator.js");
22
-
23
13
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
24
-
25
14
  var _typeof = require("@babel/runtime/helpers/typeof");
26
-
27
15
  Object.defineProperty(exports, "__esModule", {
28
16
  value: true
29
17
  });
30
18
  exports.default = void 0;
31
-
32
- require("core-js/modules/es.regexp.exec.js");
33
-
34
- require("core-js/modules/es.string.split.js");
35
-
36
19
  require("core-js/modules/es.array.find.js");
37
-
38
20
  require("core-js/modules/es.object.to-string.js");
39
-
40
21
  require("core-js/modules/es.array.map.js");
41
-
42
22
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
43
-
44
23
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
45
-
46
24
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
47
-
48
25
  var _react = _interopRequireWildcard(require("react"));
49
-
50
26
  var _propTypes = _interopRequireDefault(require("prop-types"));
51
-
52
27
  var _clsx = _interopRequireDefault(require("clsx"));
53
-
54
28
  var _material = require("@mui/material");
55
-
56
29
  var _styles = require("@mui/styles");
57
-
58
30
  var _uikitReactCore = require("@hitachivantara/uikit-react-core");
59
-
60
31
  var _styles2 = _interopRequireDefault(require("./styles"));
61
-
62
32
  var _NavigationOption = _interopRequireDefault(require("./NavigationOption"));
63
-
64
33
  var _jsxRuntime = require("react/jsx-runtime");
65
-
66
34
  var _excluded = ["selectedIndex", "scrollElementId", "href", "onClick", "className", "classes", "options", "floating", "offset"];
67
-
68
35
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
69
-
70
36
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
71
-
72
37
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
73
-
74
38
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
75
-
76
39
  var RETRY_MAX = 5;
77
-
78
40
  var getScrollTop = function getScrollTop() {
79
41
  var c = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window;
80
-
81
42
  if (c === window) {
82
43
  return window.scrollY || window.pageYOffset || document.documentElement && document.documentElement.scrollTop || document.body.scrollTop;
83
44
  }
84
-
85
45
  return c.scrollTop;
86
46
  };
87
-
88
47
  var verticalScrollOffset = function verticalScrollOffset(t) {
89
48
  var c = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window;
90
-
91
49
  if (c === window) {
92
50
  var _t$getBoundingClientR;
93
-
94
51
  return ((t === null || t === void 0 ? void 0 : (_t$getBoundingClientR = t.getBoundingClientRect) === null || _t$getBoundingClientR === void 0 ? void 0 : _t$getBoundingClientR.call(t).top) || 0) + (window.scrollY || window.pageYOffset);
95
52
  }
96
-
97
53
  if (getComputedStyle(c).position !== "static") {
98
54
  return t.offsetTop;
99
55
  }
100
-
101
56
  return t.offsetTop - c.offsetTop;
102
57
  };
103
-
104
58
  var scrollElement = function scrollElement(element, container) {
105
59
  var offset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
106
60
  var elemTop = verticalScrollOffset(element, container);
@@ -109,102 +63,96 @@ var scrollElement = function scrollElement(element, container) {
109
63
  behavior: "smooth"
110
64
  });
111
65
  };
112
-
113
66
  var isScrolledToTheBottom = function isScrolledToTheBottom(container) {
114
67
  var containerScrollTop = getScrollTop(container);
115
-
116
68
  if (container === window) {
117
69
  // accounting for cases where html/body are set to height:100%
118
70
  var scrollHeight = document.documentElement && document.documentElement.scrollHeight || document.body.scrollHeight;
119
71
  return containerScrollTop + window.innerHeight >= scrollHeight;
120
72
  }
121
-
122
73
  return containerScrollTop + container.offsetHeight >= container.scrollHeight;
123
- }; // find the last nav item that whose top scrolled out of the container's visible area
124
-
74
+ };
125
75
 
76
+ // find the last nav item that whose top scrolled out of the container's visible area
126
77
  var findFirstVisibleElement = function findFirstVisibleElement(container, options, offset) {
127
78
  var boundsTop = verticalScrollOffset(container);
128
- var i = 0; // find index of first element whose top is still visible inside the container
129
-
79
+ var i = 0;
80
+ // find index of first element whose top is still visible inside the container
130
81
  for (; i < options.length; i += 1) {
131
82
  var ele = document.getElementById(options[i].value);
132
-
133
83
  if (ele) {
134
84
  var elemTop = verticalScrollOffset(ele) - (options[i].offset || offset);
135
-
136
85
  if (elemTop > boundsTop) {
137
86
  break;
138
87
  }
139
88
  }
140
- } // return the previous index, the element that last scrolled past the top
141
-
89
+ }
142
90
 
91
+ // return the previous index, the element that last scrolled past the top
143
92
  return i - 1;
144
93
  };
94
+
145
95
  /**
146
96
  * A navigation component to help in changing views, still in development
147
97
  */
148
-
149
-
150
98
  var NavigationAnchors = function NavigationAnchors(_ref) {
151
99
  var _ref$selectedIndex = _ref.selectedIndex,
152
- selectedIndexProp = _ref$selectedIndex === void 0 ? 0 : _ref$selectedIndex,
153
- scrollElementId = _ref.scrollElementId,
154
- _ref$href = _ref.href,
155
- href = _ref$href === void 0 ? true : _ref$href,
156
- onClick = _ref.onClick,
157
- className = _ref.className,
158
- classes = _ref.classes,
159
- options = _ref.options,
160
- floating = _ref.floating,
161
- _ref$offset = _ref.offset,
162
- offset = _ref$offset === void 0 ? 0 : _ref$offset,
163
- other = (0, _objectWithoutProperties2.default)(_ref, _excluded);
164
-
100
+ selectedIndexProp = _ref$selectedIndex === void 0 ? 0 : _ref$selectedIndex,
101
+ scrollElementId = _ref.scrollElementId,
102
+ _ref$href = _ref.href,
103
+ href = _ref$href === void 0 ? true : _ref$href,
104
+ onClick = _ref.onClick,
105
+ className = _ref.className,
106
+ classes = _ref.classes,
107
+ options = _ref.options,
108
+ floating = _ref.floating,
109
+ _ref$offset = _ref.offset,
110
+ offset = _ref$offset === void 0 ? 0 : _ref$offset,
111
+ other = (0, _objectWithoutProperties2.default)(_ref, _excluded);
165
112
  var _useState = (0, _react.useState)(selectedIndexProp),
166
- _useState2 = (0, _slicedToArray2.default)(_useState, 2),
167
- selectedIndex = _useState2[0],
168
- setSelectedIndex = _useState2[1];
169
-
113
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
114
+ selectedIndex = _useState2[0],
115
+ setSelectedIndex = _useState2[1];
170
116
  var scrollEle = (0, _react.useRef)();
171
117
  var requestedAnimationFrame = (0, _react.useRef)(0);
172
- var lastContainerScrollTop = (0, _react.useRef)(); // ref to use a often-changing value in useCallback, has recommended in
173
- // https://reactjs.org/docs/hooks-faq.html#how-to-read-an-often-changing-value-from-usecallback
118
+ var lastContainerScrollTop = (0, _react.useRef)();
174
119
 
120
+ // ref to use a often-changing value in useCallback, has recommended in
121
+ // https://reactjs.org/docs/hooks-faq.html#how-to-read-an-often-changing-value-from-usecallback
175
122
  var selectedIndexRef = (0, _react.useRef)(selectedIndex);
176
123
  (0, _react.useEffect)(function () {
177
124
  selectedIndexRef.current = selectedIndex;
178
- }, [selectedIndex]); // get and store the container's dom element
125
+ }, [selectedIndex]);
179
126
 
127
+ // get and store the container's dom element
180
128
  (0, _react.useEffect)(function () {
181
129
  scrollEle.current = scrollElementId && document.getElementById(scrollElementId) || window;
182
130
  lastContainerScrollTop.current = verticalScrollOffset(scrollEle.current);
183
131
  }, [scrollElementId]);
184
132
  var checkScroll = (0, _react.useCallback)(function () {
185
133
  var _window;
186
-
187
134
  if (requestedAnimationFrame.current === 0 && (_window = window) !== null && _window !== void 0 && _window.requestAnimationFrame) {
188
135
  requestedAnimationFrame.current = window.requestAnimationFrame(function () {
189
136
  requestedAnimationFrame.current = 0;
190
137
  var firstVisibleElementIndex = findFirstVisibleElement(scrollEle.current, options, offset);
191
- var newSelectedIndex = firstVisibleElementIndex; // select the first element when all elements are bellow the container's top
138
+ var newSelectedIndex = firstVisibleElementIndex;
192
139
 
140
+ // select the first element when all elements are bellow the container's top
193
141
  if (firstVisibleElementIndex < 0) {
194
142
  newSelectedIndex = 0;
195
- } // if the user has reached the bottom of the container, select the first nav item still visible
143
+ }
144
+
145
+ // if the user has reached the bottom of the container, select the first nav item still visible
196
146
  // (usually this selects the last nav item, when it can't reach the top the container)
197
147
  // in theory only needed when scrolling down, but no... because of the Safari bouncing behaviour
198
-
199
-
200
148
  if (newSelectedIndex < options.length - 1 && isScrolledToTheBottom(scrollEle.current)) {
201
149
  newSelectedIndex += 1;
202
150
  }
203
-
204
151
  var containerScrollTop = getScrollTop(scrollEle.current);
205
152
  var isScrollingDown = containerScrollTop > lastContainerScrollTop.current;
206
- lastContainerScrollTop.current = containerScrollTop; // only update the selected item if the scroll direction is moving away from it
153
+ lastContainerScrollTop.current = containerScrollTop;
207
154
 
155
+ // only update the selected item if the scroll direction is moving away from it
208
156
  if (isScrollingDown) {
209
157
  if (newSelectedIndex < selectedIndexRef.current) {
210
158
  newSelectedIndex = selectedIndexRef.current;
@@ -212,50 +160,45 @@ var NavigationAnchors = function NavigationAnchors(_ref) {
212
160
  } else if (newSelectedIndex > selectedIndexRef.current) {
213
161
  newSelectedIndex = selectedIndexRef.current;
214
162
  }
215
-
216
163
  setSelectedIndex(newSelectedIndex);
217
164
  });
218
165
  }
219
- }, [offset, options]); // registers and unregisters the scroll listener
166
+ }, [offset, options]);
220
167
 
168
+ // registers and unregisters the scroll listener
221
169
  (0, _react.useEffect)(function () {
222
170
  if (scrollEle.current) {
223
171
  scrollEle.current.addEventListener("scroll", checkScroll, false);
224
172
  }
225
-
226
173
  return function () {
227
174
  if (scrollEle.current) {
228
175
  scrollEle.current.removeEventListener("scroll", checkScroll);
229
176
  }
230
-
231
177
  if (requestedAnimationFrame.current !== 0) {
232
178
  window.cancelAnimationFrame(requestedAnimationFrame.current);
233
179
  requestedAnimationFrame.current = 0;
234
180
  }
235
181
  };
236
- }, [checkScroll]); // waits for the elements to be rendered and scrolls to the one referenced
237
- // in the URL hash, if any
182
+ }, [checkScroll]);
238
183
 
184
+ // waits for the elements to be rendered and scrolls to the one referenced
185
+ // in the URL hash, if any
239
186
  (0, _react.useEffect)(function () {
240
187
  var checkRenderedInterval;
241
-
242
188
  if (href) {
243
189
  var hashValue = document.location.hash.split("#")[1] || "";
244
190
  var option = options.find(function (o) {
245
191
  return o.value === hashValue;
246
192
  });
247
-
248
193
  if (option) {
249
194
  var retry = 0;
250
195
  checkRenderedInterval = setInterval(function () {
251
196
  var ele = document.getElementById(option.value);
252
-
253
197
  if (ele) {
254
198
  scrollElement(ele, scrollEle.current, option.offset || offset);
255
199
  clearInterval(checkRenderedInterval);
256
200
  } else {
257
201
  retry += 1;
258
-
259
202
  if (retry === RETRY_MAX) {
260
203
  clearInterval(checkRenderedInterval);
261
204
  }
@@ -263,39 +206,35 @@ var NavigationAnchors = function NavigationAnchors(_ref) {
263
206
  }, 1000);
264
207
  }
265
208
  }
266
-
267
209
  return function () {
268
210
  clearInterval(checkRenderedInterval);
269
- }; // we really want to run this just in the first load
211
+ };
212
+
213
+ // we really want to run this just in the first load
270
214
  // in fact this doesn't even belong here, the logic should be external
271
215
  // eslint-disable-next-line react-hooks/exhaustive-deps
272
216
  }, []);
273
-
274
217
  var handleListItemClick = function handleListItemClick(event, id, index) {
275
218
  var option = options.find(function (o) {
276
219
  return o.value === id;
277
220
  });
278
-
279
221
  if (option) {
280
222
  var ele = document.getElementById(id);
281
-
282
223
  if (ele) {
283
224
  scrollElement(ele, scrollEle.current, option.offset || offset);
284
225
  }
285
-
286
226
  if (!href && onClick) {
287
227
  onClick(event, index, option);
288
228
  } else if (href) {
289
229
  window.history.pushState({}, "", "#".concat(options[index].value));
290
230
  }
231
+ setSelectedIndex(index);
291
232
 
292
- setSelectedIndex(index); // Safari scrolls immediately (no smooth scroll support),
233
+ // Safari scrolls immediately (no smooth scroll support),
293
234
  // so this ref value must be updated asap
294
-
295
235
  selectedIndexRef.current = index;
296
236
  }
297
237
  };
298
-
299
238
  var navOptions = (0, _react.useMemo)(function () {
300
239
  return options.map(function (option) {
301
240
  return (0, _NavigationOption.default)(option.label);
@@ -321,13 +260,11 @@ var NavigationAnchors = function NavigationAnchors(_ref) {
321
260
  })
322
261
  }));
323
262
  };
324
-
325
263
  process.env.NODE_ENV !== "production" ? NavigationAnchors.propTypes = {
326
264
  /**
327
265
  * Class names to be applied.
328
266
  */
329
267
  className: _propTypes.default.string,
330
-
331
268
  /**
332
269
  * A Jss Object used to override or extend the styles applied.
333
270
  */
@@ -336,7 +273,6 @@ process.env.NODE_ENV !== "production" ? NavigationAnchors.propTypes = {
336
273
  listItemGutters: _propTypes.default.string,
337
274
  listItemSelected: _propTypes.default.string
338
275
  }).isRequired,
339
-
340
276
  /**
341
277
  * An Array of Objects with Label and Value. Label is the displayed Element and Value is the local navigation location applied
342
278
  */
@@ -346,36 +282,30 @@ process.env.NODE_ENV !== "production" ? NavigationAnchors.propTypes = {
346
282
  label: _propTypes.default.string.isRequired,
347
283
  offset: _propTypes.default.number
348
284
  })).isRequired,
349
-
350
285
  /**
351
286
  * True if the href location link should be applied. It will create an a element around every list item
352
287
  */
353
288
  href: _propTypes.default.bool,
354
-
355
289
  /**
356
290
  * A callback called on click of every list item, if the href is false
357
291
  */
358
292
  onClick: _propTypes.default.func,
359
-
360
293
  /**
361
294
  * Whether the anchors are always in a fixed position
362
295
  *
363
296
  * @deprecated Currently does nothing. Style the component instead.
364
297
  */
365
298
  floating: (0, _material.deprecatedPropType)(_propTypes.default.bool),
366
-
367
299
  /**
368
300
  * Currently selected index passed from the parent.
369
301
  */
370
302
  selectedIndex: _propTypes.default.number,
371
-
372
303
  /**
373
304
  * The Id of the scrollable container containing displayed elements.
374
305
  *
375
306
  * Defaults to `window` if unspecified.
376
307
  */
377
308
  scrollElementId: _propTypes.default.string,
378
-
379
309
  /**
380
310
  * Defines the offset from the top of each element for getting an optimal viewing region in the container.
381
311
  * This allows to exclude regions of the container that are obscured by other content (such as fixed-positioned toolbars or titles)
@@ -385,10 +315,8 @@ process.env.NODE_ENV !== "production" ? NavigationAnchors.propTypes = {
385
315
  */
386
316
  offset: _propTypes.default.number
387
317
  } : void 0;
388
-
389
318
  var _default = (0, _styles.withStyles)(_styles2.default, {
390
319
  name: "HvNavigationAnchors"
391
320
  })(NavigationAnchors);
392
-
393
321
  exports.default = _default;
394
322
  //# sourceMappingURL=NavigationAnchors.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NavigationAnchors.js","names":["RETRY_MAX","getScrollTop","c","window","scrollY","pageYOffset","document","documentElement","scrollTop","body","verticalScrollOffset","t","getBoundingClientRect","top","getComputedStyle","position","offsetTop","scrollElement","element","container","offset","elemTop","scrollTo","behavior","isScrolledToTheBottom","containerScrollTop","scrollHeight","innerHeight","offsetHeight","findFirstVisibleElement","options","boundsTop","i","length","ele","getElementById","value","NavigationAnchors","selectedIndex","selectedIndexProp","scrollElementId","href","onClick","className","classes","floating","other","useState","setSelectedIndex","scrollEle","useRef","requestedAnimationFrame","lastContainerScrollTop","selectedIndexRef","useEffect","current","checkScroll","useCallback","requestAnimationFrame","firstVisibleElementIndex","newSelectedIndex","isScrollingDown","addEventListener","removeEventListener","cancelAnimationFrame","checkRenderedInterval","hashValue","location","hash","split","option","find","o","retry","setInterval","clearInterval","handleListItemClick","event","id","index","history","pushState","navOptions","useMemo","map","navigationOption","label","clsx","root","NavOpt","selected","listItemSelected","gutters","listItemGutters","key","propTypes","PropTypes","string","shape","isRequired","arrayOf","number","bool","func","deprecatedPropType","withStyles","styles","name"],"sources":["../../src/NavigationAnchors/NavigationAnchors.js"],"sourcesContent":["import React, { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport PropTypes from \"prop-types\";\nimport clsx from \"clsx\";\nimport { deprecatedPropType } from \"@mui/material\";\nimport { withStyles } from \"@mui/styles\";\nimport { HvListContainer, HvListItem } from \"@hitachivantara/uikit-react-core\";\nimport styles from \"./styles\";\nimport navigationOption from \"./NavigationOption\";\n\nconst RETRY_MAX = 5;\n\nconst getScrollTop = (c = window) => {\n if (c === window) {\n return (\n window.scrollY ||\n window.pageYOffset ||\n (document.documentElement && document.documentElement.scrollTop) ||\n document.body.scrollTop\n );\n }\n\n return c.scrollTop;\n};\n\nconst verticalScrollOffset = (t, c = window) => {\n if (c === window) {\n return (t?.getBoundingClientRect?.().top || 0) + (window.scrollY || window.pageYOffset);\n }\n if (getComputedStyle(c).position !== \"static\") {\n return t.offsetTop;\n }\n\n return t.offsetTop - c.offsetTop;\n};\n\nconst scrollElement = (element, container, offset = 0) => {\n const elemTop = verticalScrollOffset(element, container);\n container.scrollTo({\n top: elemTop - offset,\n behavior: \"smooth\",\n });\n};\n\nconst isScrolledToTheBottom = (container) => {\n const containerScrollTop = getScrollTop(container);\n\n if (container === window) {\n // accounting for cases where html/body are set to height:100%\n const scrollHeight =\n (document.documentElement && document.documentElement.scrollHeight) ||\n document.body.scrollHeight;\n\n return containerScrollTop + window.innerHeight >= scrollHeight;\n }\n\n return containerScrollTop + container.offsetHeight >= container.scrollHeight;\n};\n\n// find the last nav item that whose top scrolled out of the container's visible area\nconst findFirstVisibleElement = (container, options, offset) => {\n const boundsTop = verticalScrollOffset(container);\n\n let i = 0;\n // find index of first element whose top is still visible inside the container\n for (; i < options.length; i += 1) {\n const ele = document.getElementById(options[i].value);\n\n if (ele) {\n const elemTop = verticalScrollOffset(ele) - (options[i].offset || offset);\n\n if (elemTop > boundsTop) {\n break;\n }\n }\n }\n\n // return the previous index, the element that last scrolled past the top\n return i - 1;\n};\n\n/**\n * A navigation component to help in changing views, still in development\n */\nconst NavigationAnchors = ({\n selectedIndex: selectedIndexProp = 0,\n scrollElementId,\n href = true,\n onClick,\n className,\n classes,\n options,\n floating,\n offset = 0,\n ...other\n}) => {\n const [selectedIndex, setSelectedIndex] = useState(selectedIndexProp);\n\n const scrollEle = useRef();\n const requestedAnimationFrame = useRef(0);\n\n const lastContainerScrollTop = useRef();\n\n // ref to use a often-changing value in useCallback, has recommended in\n // https://reactjs.org/docs/hooks-faq.html#how-to-read-an-often-changing-value-from-usecallback\n const selectedIndexRef = useRef(selectedIndex);\n useEffect(() => {\n selectedIndexRef.current = selectedIndex;\n }, [selectedIndex]);\n\n // get and store the container's dom element\n useEffect(() => {\n scrollEle.current = (scrollElementId && document.getElementById(scrollElementId)) || window;\n lastContainerScrollTop.current = verticalScrollOffset(scrollEle.current);\n }, [scrollElementId]);\n\n const checkScroll = useCallback(() => {\n if (requestedAnimationFrame.current === 0 && window?.requestAnimationFrame) {\n requestedAnimationFrame.current = window.requestAnimationFrame(() => {\n requestedAnimationFrame.current = 0;\n\n const firstVisibleElementIndex = findFirstVisibleElement(\n scrollEle.current,\n options,\n offset\n );\n\n let newSelectedIndex = firstVisibleElementIndex;\n\n // select the first element when all elements are bellow the container's top\n if (firstVisibleElementIndex < 0) {\n newSelectedIndex = 0;\n }\n\n // if the user has reached the bottom of the container, select the first nav item still visible\n // (usually this selects the last nav item, when it can't reach the top the container)\n // in theory only needed when scrolling down, but no... because of the Safari bouncing behaviour\n if (newSelectedIndex < options.length - 1 && isScrolledToTheBottom(scrollEle.current)) {\n newSelectedIndex += 1;\n }\n\n const containerScrollTop = getScrollTop(scrollEle.current);\n const isScrollingDown = containerScrollTop > lastContainerScrollTop.current;\n lastContainerScrollTop.current = containerScrollTop;\n\n // only update the selected item if the scroll direction is moving away from it\n if (isScrollingDown) {\n if (newSelectedIndex < selectedIndexRef.current) {\n newSelectedIndex = selectedIndexRef.current;\n }\n } else if (newSelectedIndex > selectedIndexRef.current) {\n newSelectedIndex = selectedIndexRef.current;\n }\n\n setSelectedIndex(newSelectedIndex);\n });\n }\n }, [offset, options]);\n\n // registers and unregisters the scroll listener\n useEffect(() => {\n if (scrollEle.current) {\n scrollEle.current.addEventListener(\"scroll\", checkScroll, false);\n }\n\n return () => {\n if (scrollEle.current) {\n scrollEle.current.removeEventListener(\"scroll\", checkScroll);\n }\n\n if (requestedAnimationFrame.current !== 0) {\n window.cancelAnimationFrame(requestedAnimationFrame.current);\n requestedAnimationFrame.current = 0;\n }\n };\n }, [checkScroll]);\n\n // waits for the elements to be rendered and scrolls to the one referenced\n // in the URL hash, if any\n useEffect(() => {\n let checkRenderedInterval;\n\n if (href) {\n const hashValue = document.location.hash.split(\"#\")[1] || \"\";\n\n const option = options.find((o) => o.value === hashValue);\n\n if (option) {\n let retry = 0;\n checkRenderedInterval = setInterval(() => {\n const ele = document.getElementById(option.value);\n\n if (ele) {\n scrollElement(ele, scrollEle.current, option.offset || offset);\n clearInterval(checkRenderedInterval);\n } else {\n retry += 1;\n if (retry === RETRY_MAX) {\n clearInterval(checkRenderedInterval);\n }\n }\n }, 1000);\n }\n }\n\n return () => {\n clearInterval(checkRenderedInterval);\n };\n\n // we really want to run this just in the first load\n // in fact this doesn't even belong here, the logic should be external\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const handleListItemClick = (event, id, index) => {\n const option = options.find((o) => o.value === id);\n\n if (option) {\n const ele = document.getElementById(id);\n if (ele) {\n scrollElement(ele, scrollEle.current, option.offset || offset);\n }\n\n if (!href && onClick) {\n onClick(event, index, option);\n } else if (href) {\n window.history.pushState({}, \"\", `#${options[index].value}`);\n }\n\n setSelectedIndex(index);\n\n // Safari scrolls immediately (no smooth scroll support),\n // so this ref value must be updated asap\n selectedIndexRef.current = index;\n }\n };\n\n const navOptions = useMemo(() => {\n return options.map((option) => {\n return navigationOption(option.label);\n });\n }, [options]);\n\n return (\n <HvListContainer interactive className={clsx(className, classes.root)} {...other}>\n {options.map((option, index) => {\n const NavOpt = navOptions[index];\n\n return (\n <HvListItem\n classes={{\n selected: classes.listItemSelected,\n gutters: classes.listItemGutters,\n }}\n key={option.key || option.label}\n onClick={(event) => handleListItemClick(event, option.value, index)}\n selected={selectedIndex === index}\n >\n <NavOpt />\n </HvListItem>\n );\n })}\n </HvListContainer>\n );\n};\n\nNavigationAnchors.propTypes = {\n /**\n * Class names to be applied.\n */\n className: PropTypes.string,\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n root: PropTypes.string,\n listItemGutters: PropTypes.string,\n listItemSelected: PropTypes.string,\n }).isRequired,\n /**\n * An Array of Objects with Label and Value. Label is the displayed Element and Value is the local navigation location applied\n */\n options: PropTypes.arrayOf(\n PropTypes.shape({\n key: PropTypes.string,\n value: PropTypes.string.isRequired,\n label: PropTypes.string.isRequired,\n offset: PropTypes.number,\n })\n ).isRequired,\n /**\n * True if the href location link should be applied. It will create an a element around every list item\n */\n href: PropTypes.bool,\n /**\n * A callback called on click of every list item, if the href is false\n */\n onClick: PropTypes.func,\n /**\n * Whether the anchors are always in a fixed position\n *\n * @deprecated Currently does nothing. Style the component instead.\n */\n floating: deprecatedPropType(PropTypes.bool),\n /**\n * Currently selected index passed from the parent.\n */\n selectedIndex: PropTypes.number,\n /**\n * The Id of the scrollable container containing displayed elements.\n *\n * Defaults to `window` if unspecified.\n */\n scrollElementId: PropTypes.string,\n /**\n * Defines the offset from the top of each element for getting an optimal viewing region in the container.\n * This allows to exclude regions of the container that are obscured by other content (such as fixed-positioned toolbars or titles)\n * or to put more breathing room between the targeted element and the edges of the container.\n *\n * Each element can also have a specific offset via the options property.\n */\n offset: PropTypes.number,\n};\n\nexport default withStyles(styles, { name: \"HvNavigationAnchors\" })(NavigationAnchors);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;AAEA,IAAMA,SAAS,GAAG,CAAlB;;AAEA,IAAMC,YAAY,GAAG,SAAfA,YAAe,GAAgB;EAAA,IAAfC,CAAe,uEAAXC,MAAW;;EACnC,IAAID,CAAC,KAAKC,MAAV,EAAkB;IAChB,OACEA,MAAM,CAACC,OAAP,IACAD,MAAM,CAACE,WADP,IAECC,QAAQ,CAACC,eAAT,IAA4BD,QAAQ,CAACC,eAAT,CAAyBC,SAFtD,IAGAF,QAAQ,CAACG,IAAT,CAAcD,SAJhB;EAMD;;EAED,OAAON,CAAC,CAACM,SAAT;AACD,CAXD;;AAaA,IAAME,oBAAoB,GAAG,SAAvBA,oBA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E,MAAM,EAAE4E,kBAAA,CAAUK;AAvDU,CAA9B;;eA0De,IAAAI,kBAAA,EAAWC,gBAAX,EAAmB;EAAEC,IAAI,EAAE;AAAR,CAAnB,EAAoDtE,iBAApD,C"}
1
+ {"version":3,"file":"NavigationAnchors.js","names":["RETRY_MAX","getScrollTop","c","window","scrollY","pageYOffset","document","documentElement","scrollTop","body","verticalScrollOffset","t","getBoundingClientRect","top","getComputedStyle","position","offsetTop","scrollElement","element","container","offset","elemTop","scrollTo","behavior","isScrolledToTheBottom","containerScrollTop","scrollHeight","innerHeight","offsetHeight","findFirstVisibleElement","options","boundsTop","i","length","ele","getElementById","value","NavigationAnchors","selectedIndex","selectedIndexProp","scrollElementId","href","onClick","className","classes","floating","other","useState","setSelectedIndex","scrollEle","useRef","requestedAnimationFrame","lastContainerScrollTop","selectedIndexRef","useEffect","current","checkScroll","useCallback","requestAnimationFrame","firstVisibleElementIndex","newSelectedIndex","isScrollingDown","addEventListener","removeEventListener","cancelAnimationFrame","checkRenderedInterval","hashValue","location","hash","split","option","find","o","retry","setInterval","clearInterval","handleListItemClick","event","id","index","history","pushState","navOptions","useMemo","map","navigationOption","label","clsx","root","NavOpt","selected","listItemSelected","gutters","listItemGutters","key","propTypes","PropTypes","string","shape","isRequired","arrayOf","number","bool","func","deprecatedPropType","withStyles","styles","name"],"sources":["../../src/NavigationAnchors/NavigationAnchors.js"],"sourcesContent":["import React, { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport PropTypes from \"prop-types\";\nimport clsx from \"clsx\";\nimport { deprecatedPropType } from \"@mui/material\";\nimport { withStyles } from \"@mui/styles\";\nimport { HvListContainer, HvListItem } from \"@hitachivantara/uikit-react-core\";\nimport styles from \"./styles\";\nimport navigationOption from \"./NavigationOption\";\n\nconst RETRY_MAX = 5;\n\nconst getScrollTop = (c = window) => {\n if (c === window) {\n return (\n window.scrollY ||\n window.pageYOffset ||\n (document.documentElement && document.documentElement.scrollTop) ||\n document.body.scrollTop\n );\n }\n\n return c.scrollTop;\n};\n\nconst verticalScrollOffset = (t, c = window) => {\n if (c === window) {\n return (t?.getBoundingClientRect?.().top || 0) + (window.scrollY || window.pageYOffset);\n }\n if (getComputedStyle(c).position !== \"static\") {\n return t.offsetTop;\n }\n\n return t.offsetTop - c.offsetTop;\n};\n\nconst scrollElement = (element, container, offset = 0) => {\n const elemTop = verticalScrollOffset(element, container);\n container.scrollTo({\n top: elemTop - offset,\n behavior: \"smooth\",\n });\n};\n\nconst isScrolledToTheBottom = (container) => {\n const containerScrollTop = getScrollTop(container);\n\n if (container === window) {\n // accounting for cases where html/body are set to height:100%\n const scrollHeight =\n (document.documentElement && document.documentElement.scrollHeight) ||\n document.body.scrollHeight;\n\n return containerScrollTop + window.innerHeight >= scrollHeight;\n }\n\n return containerScrollTop + container.offsetHeight >= container.scrollHeight;\n};\n\n// find the last nav item that whose top scrolled out of the container's visible area\nconst findFirstVisibleElement = (container, options, offset) => {\n const boundsTop = verticalScrollOffset(container);\n\n let i = 0;\n // find index of first element whose top is still visible inside the container\n for (; i < options.length; i += 1) {\n const ele = document.getElementById(options[i].value);\n\n if (ele) {\n const elemTop = verticalScrollOffset(ele) - (options[i].offset || offset);\n\n if (elemTop > boundsTop) {\n break;\n }\n }\n }\n\n // return the previous index, the element that last scrolled past the top\n return i - 1;\n};\n\n/**\n * A navigation component to help in changing views, still in development\n */\nconst NavigationAnchors = ({\n selectedIndex: selectedIndexProp = 0,\n scrollElementId,\n href = true,\n onClick,\n className,\n classes,\n options,\n floating,\n offset = 0,\n ...other\n}) => {\n const [selectedIndex, setSelectedIndex] = useState(selectedIndexProp);\n\n const scrollEle = useRef();\n const requestedAnimationFrame = useRef(0);\n\n const lastContainerScrollTop = useRef();\n\n // ref to use a often-changing value in useCallback, has recommended in\n // https://reactjs.org/docs/hooks-faq.html#how-to-read-an-often-changing-value-from-usecallback\n const selectedIndexRef = useRef(selectedIndex);\n useEffect(() => {\n selectedIndexRef.current = selectedIndex;\n }, [selectedIndex]);\n\n // get and store the container's dom element\n useEffect(() => {\n scrollEle.current = (scrollElementId && document.getElementById(scrollElementId)) || window;\n lastContainerScrollTop.current = verticalScrollOffset(scrollEle.current);\n }, [scrollElementId]);\n\n const checkScroll = useCallback(() => {\n if (requestedAnimationFrame.current === 0 && window?.requestAnimationFrame) {\n requestedAnimationFrame.current = window.requestAnimationFrame(() => {\n requestedAnimationFrame.current = 0;\n\n const firstVisibleElementIndex = findFirstVisibleElement(\n scrollEle.current,\n options,\n offset\n );\n\n let newSelectedIndex = firstVisibleElementIndex;\n\n // select the first element when all elements are bellow the container's top\n if (firstVisibleElementIndex < 0) {\n newSelectedIndex = 0;\n }\n\n // if the user has reached the bottom of the container, select the first nav item still visible\n // (usually this selects the last nav item, when it can't reach the top the container)\n // in theory only needed when scrolling down, but no... because of the Safari bouncing behaviour\n if (newSelectedIndex < options.length - 1 && isScrolledToTheBottom(scrollEle.current)) {\n newSelectedIndex += 1;\n }\n\n const containerScrollTop = getScrollTop(scrollEle.current);\n const isScrollingDown = containerScrollTop > lastContainerScrollTop.current;\n lastContainerScrollTop.current = containerScrollTop;\n\n // only update the selected item if the scroll direction is moving away from it\n if (isScrollingDown) {\n if (newSelectedIndex < selectedIndexRef.current) {\n newSelectedIndex = selectedIndexRef.current;\n }\n } else if (newSelectedIndex > selectedIndexRef.current) {\n newSelectedIndex = selectedIndexRef.current;\n }\n\n setSelectedIndex(newSelectedIndex);\n });\n }\n }, [offset, options]);\n\n // registers and unregisters the scroll listener\n useEffect(() => {\n if (scrollEle.current) {\n scrollEle.current.addEventListener(\"scroll\", checkScroll, false);\n }\n\n return () => {\n if (scrollEle.current) {\n scrollEle.current.removeEventListener(\"scroll\", checkScroll);\n }\n\n if (requestedAnimationFrame.current !== 0) {\n window.cancelAnimationFrame(requestedAnimationFrame.current);\n requestedAnimationFrame.current = 0;\n }\n };\n }, [checkScroll]);\n\n // waits for the elements to be rendered and scrolls to the one referenced\n // in the URL hash, if any\n useEffect(() => {\n let checkRenderedInterval;\n\n if (href) {\n const hashValue = document.location.hash.split(\"#\")[1] || \"\";\n\n const option = options.find((o) => o.value === hashValue);\n\n if (option) {\n let retry = 0;\n checkRenderedInterval = setInterval(() => {\n const ele = document.getElementById(option.value);\n\n if (ele) {\n scrollElement(ele, scrollEle.current, option.offset || offset);\n clearInterval(checkRenderedInterval);\n } else {\n retry += 1;\n if (retry === RETRY_MAX) {\n clearInterval(checkRenderedInterval);\n }\n }\n }, 1000);\n }\n }\n\n return () => {\n clearInterval(checkRenderedInterval);\n };\n\n // we really want to run this just in the first load\n // in fact this doesn't even belong here, the logic should be external\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const handleListItemClick = (event, id, index) => {\n const option = options.find((o) => o.value === id);\n\n if (option) {\n const ele = document.getElementById(id);\n if (ele) {\n scrollElement(ele, scrollEle.current, option.offset || offset);\n }\n\n if (!href && onClick) {\n onClick(event, index, option);\n } else if (href) {\n window.history.pushState({}, \"\", `#${options[index].value}`);\n }\n\n setSelectedIndex(index);\n\n // Safari scrolls immediately (no smooth scroll support),\n // so this ref value must be updated asap\n selectedIndexRef.current = index;\n }\n };\n\n const navOptions = useMemo(() => {\n return options.map((option) => {\n return navigationOption(option.label);\n });\n }, [options]);\n\n return (\n <HvListContainer interactive className={clsx(className, classes.root)} {...other}>\n {options.map((option, index) => {\n const NavOpt = navOptions[index];\n\n return (\n <HvListItem\n classes={{\n selected: classes.listItemSelected,\n gutters: classes.listItemGutters,\n }}\n key={option.key || option.label}\n onClick={(event) => handleListItemClick(event, option.value, index)}\n selected={selectedIndex === index}\n >\n <NavOpt />\n </HvListItem>\n );\n })}\n </HvListContainer>\n );\n};\n\nNavigationAnchors.propTypes = {\n /**\n * Class names to be applied.\n */\n className: PropTypes.string,\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n root: PropTypes.string,\n listItemGutters: PropTypes.string,\n listItemSelected: PropTypes.string,\n }).isRequired,\n /**\n * An Array of Objects with Label and Value. Label is the displayed Element and Value is the local navigation location applied\n */\n options: PropTypes.arrayOf(\n PropTypes.shape({\n key: PropTypes.string,\n value: PropTypes.string.isRequired,\n label: PropTypes.string.isRequired,\n offset: PropTypes.number,\n })\n ).isRequired,\n /**\n * True if the href location link should be applied. It will create an a element around every list item\n */\n href: PropTypes.bool,\n /**\n * A callback called on click of every list item, if the href is false\n */\n onClick: PropTypes.func,\n /**\n * Whether the anchors are always in a fixed position\n *\n * @deprecated Currently does nothing. Style the component instead.\n */\n floating: deprecatedPropType(PropTypes.bool),\n /**\n * Currently selected index passed from the parent.\n */\n selectedIndex: PropTypes.number,\n /**\n * The Id of the scrollable container containing displayed elements.\n *\n * Defaults to `window` if unspecified.\n */\n scrollElementId: PropTypes.string,\n /**\n * Defines the offset from the top of each element for getting an optimal viewing region in the container.\n * This allows to exclude regions of the container that are obscured by other content (such as fixed-positioned toolbars or titles)\n * or to put more breathing room between the targeted element and the edges of the container.\n *\n * Each element can also have a specific offset via the options property.\n */\n offset: PropTypes.number,\n};\n\nexport default withStyles(styles, { name: \"HvNavigationAnchors\" })(NavigationAnchors);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAkD;AAAA;AAAA;AAAA;AAAA;AAAA;AAElD,IAAMA,SAAS,GAAG,CAAC;AAEnB,IAAMC,YAAY,GAAG,SAAfA,YAAY,GAAmB;EAAA,IAAfC,CAAC,uEAAGC,MAAM;EAC9B,IAAID,CAAC,KAAKC,MAAM,EAAE;IAChB,OACEA,MAAM,CAACC,OAAO,IACdD,MAAM,CAACE,WAAW,IACjBC,QAAQ,CAACC,eAAe,IAAID,QAAQ,CAACC,eAAe,CAACC,SAAU,IAChEF,QAAQ,CAACG,IAAI,CAACD,SAAS;EAE3B;EAEA,OAAON,CAAC,CAACM,SAAS;AACpB,CAAC;AAED,IAAME,oBAAoB,GAAG,SAAvBA,oBAAoB,CAAIC,CAAC,EAAiB;EAAA,IAA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AACE,KAAK,CAAC;IACvBV,IAAI,EAAEQ,kBAAS,CAACC,MAAM;IACtBJ,eAAe,EAAEG,kBAAS,CAACC,MAAM;IACjCN,gBAAgB,EAAEK,kBAAS,CAACC;EAC9B,CAAC,CAAC,CAACE,UAAU;EACb;AACF;AACA;EACErE,OAAO,EAAEkE,kBAAS,CAACI,OAAO,CACxBJ,kBAAS,CAACE,KAAK,CAAC;IACdJ,GAAG,EAAEE,kBAAS,CAACC,MAAM;IACrB7D,KAAK,EAAE4D,kBAAS,CAACC,MAAM,CAACE,UAAU;IAClCb,KAAK,EAAEU,kBAAS,CAACC,MAAM,CAACE,UAAU;IAClC/E,MAAM,EAAE4E,kBAAS,CAACK;EACpB,CAAC,CAAC,CACH,CAACF,UAAU;EACZ;AACF;AACA;EACE1D,IAAI,EAAEuD,kBAAS,CAACM,IAAI;EACpB;AACF;AACA;EACE5D,OAAO,EAAEsD,kBAAS,CAACO,IAAI;EACvB;AACF;AACA;AACA;AACA;EACE1D,QAAQ,EAAE,IAAA2D,4BAAkB,EAACR,kBAAS,CAACM,IAAI,CAAC;EAC5C;AACF;AACA;EACEhE,aAAa,EAAE0D,kBAAS,CAACK,MAAM;EAC/B;AACF;AACA;AACA;AACA;EACE7D,eAAe,EAAEwD,kBAAS,CAACC,MAAM;EACjC;AACF;AACA;AACA;AACA;AACA;AACA;EACE7E,MAAM,EAAE4E,kBAAS,CAACK;AACpB,CAAC;AAAC,eAEa,IAAAI,kBAAU,EAACC,gBAAM,EAAE;EAAEC,IAAI,EAAE;AAAsB,CAAC,CAAC,CAACtE,iBAAiB,CAAC;AAAA"}
@@ -1,40 +1,30 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = void 0;
9
-
10
8
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
11
-
12
9
  require("core-js/modules/es.object.to-string.js");
13
-
14
10
  require("core-js/modules/es.array.of.js");
15
-
16
11
  var _uikitReactCore = require("@hitachivantara/uikit-react-core");
17
-
18
12
  var hideTooltip = function hideTooltip(evt) {
19
13
  var isOverFlow = evt.target.children.length > 1 ? Array.of.apply(Array, (0, _toConsumableArray2.default)(evt.target.children)).some(function (child) {
20
14
  return child.scrollWidth > child.clientWidth;
21
15
  }) : evt.target.scrollWidth > evt.target.clientWidth;
22
16
  return !isOverFlow;
23
17
  };
24
-
25
18
  var wrapperTooltip = function wrapperTooltip(Component, label) {
26
19
  var ComponentFunction = function ComponentFunction() {
27
20
  return Component;
28
21
  };
29
-
30
22
  return (0, _uikitReactCore.withTooltip)(ComponentFunction, label, "top", hideTooltip);
31
23
  };
32
-
33
24
  var NavigationOption = function NavigationOption(label) {
34
25
  var NavOpt = wrapperTooltip(label, label);
35
26
  return NavOpt;
36
27
  };
37
-
38
28
  var _default = NavigationOption;
39
29
  exports.default = _default;
40
30
  //# sourceMappingURL=NavigationOption.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NavigationOption.js","names":["hideTooltip","evt","isOverFlow","target","children","length","Array","of","some","child","scrollWidth","clientWidth","wrapperTooltip","Component","label","ComponentFunction","withTooltip","NavigationOption","NavOpt"],"sources":["../../src/NavigationAnchors/NavigationOption.js"],"sourcesContent":["import { withTooltip } from \"@hitachivantara/uikit-react-core\";\n\nconst hideTooltip = (evt) => {\n const isOverFlow =\n evt.target.children.length > 1\n ? Array.of(...evt.target.children).some((child) => child.scrollWidth > child.clientWidth)\n : evt.target.scrollWidth > evt.target.clientWidth;\n return !isOverFlow;\n};\n\nconst wrapperTooltip = (Component, label) => {\n const ComponentFunction = () => Component;\n return withTooltip(ComponentFunction, label, \"top\", hideTooltip);\n};\n\nconst NavigationOption = (label) => {\n const NavOpt = wrapperTooltip(label, label);\n return NavOpt;\n};\n\nexport default NavigationOption;\n"],"mappings":";;;;;;;;;;;;;;;AAAA;;AAEA,IAAMA,WAAW,GAAG,SAAdA,WAAc,CAACC,GAAD,EAAS;EAC3B,IAAMC,UAAU,GACdD,GAAG,CAACE,MAAJ,CAAWC,QAAX,CAAoBC,MAApB,GAA6B,CAA7B,GACIC,KAAK,CAACC,EAAN,OAAAD,KAAK,mCAAOL,GAAG,CAACE,MAAJ,CAAWC,QAAlB,EAAL,CAAiCI,IAAjC,CAAsC,UAACC,KAAD;IAAA,OAAWA,KAAK,CAACC,WAAN,GAAoBD,KAAK,CAACE,WAArC;EAAA,CAAtC,CADJ,GAEIV,GAAG,CAACE,MAAJ,CAAWO,WAAX,GAAyBT,GAAG,CAACE,MAAJ,CAAWQ,WAH1C;EAIA,OAAO,CAACT,UAAR;AACD,CAND;;AAQA,IAAMU,cAAc,GAAG,SAAjBA,cAAiB,CAACC,SAAD,EAAYC,KAAZ,EAAsB;EAC3C,IAAMC,iBAAiB,GAAG,SAApBA,iBAAoB;IAAA,OAAMF,SAAN;EAAA,CAA1B;;EACA,OAAO,IAAAG,2BAAA,EAAYD,iBAAZ,EAA+BD,KAA/B,EAAsC,KAAtC,EAA6Cd,WAA7C,CAAP;AACD,CAHD;;AAKA,IAAMiB,gBAAgB,GAAG,SAAnBA,gBAAmB,CAACH,KAAD,EAAW;EAClC,IAAMI,MAAM,GAAGN,cAAc,CAACE,KAAD,EAAQA,KAAR,CAA7B;EACA,OAAOI,MAAP;AACD,CAHD;;eAKeD,gB"}
1
+ {"version":3,"file":"NavigationOption.js","names":["hideTooltip","evt","isOverFlow","target","children","length","Array","of","some","child","scrollWidth","clientWidth","wrapperTooltip","Component","label","ComponentFunction","withTooltip","NavigationOption","NavOpt"],"sources":["../../src/NavigationAnchors/NavigationOption.js"],"sourcesContent":["import { withTooltip } from \"@hitachivantara/uikit-react-core\";\n\nconst hideTooltip = (evt) => {\n const isOverFlow =\n evt.target.children.length > 1\n ? Array.of(...evt.target.children).some((child) => child.scrollWidth > child.clientWidth)\n : evt.target.scrollWidth > evt.target.clientWidth;\n return !isOverFlow;\n};\n\nconst wrapperTooltip = (Component, label) => {\n const ComponentFunction = () => Component;\n return withTooltip(ComponentFunction, label, \"top\", hideTooltip);\n};\n\nconst NavigationOption = (label) => {\n const NavOpt = wrapperTooltip(label, label);\n return NavOpt;\n};\n\nexport default NavigationOption;\n"],"mappings":";;;;;;;;;;AAAA;AAEA,IAAMA,WAAW,GAAG,SAAdA,WAAW,CAAIC,GAAG,EAAK;EAC3B,IAAMC,UAAU,GACdD,GAAG,CAACE,MAAM,CAACC,QAAQ,CAACC,MAAM,GAAG,CAAC,GAC1BC,KAAK,CAACC,EAAE,OAARD,KAAK,mCAAOL,GAAG,CAACE,MAAM,CAACC,QAAQ,EAAC,CAACI,IAAI,CAAC,UAACC,KAAK;IAAA,OAAKA,KAAK,CAACC,WAAW,GAAGD,KAAK,CAACE,WAAW;EAAA,EAAC,GACvFV,GAAG,CAACE,MAAM,CAACO,WAAW,GAAGT,GAAG,CAACE,MAAM,CAACQ,WAAW;EACrD,OAAO,CAACT,UAAU;AACpB,CAAC;AAED,IAAMU,cAAc,GAAG,SAAjBA,cAAc,CAAIC,SAAS,EAAEC,KAAK,EAAK;EAC3C,IAAMC,iBAAiB,GAAG,SAApBA,iBAAiB;IAAA,OAASF,SAAS;EAAA;EACzC,OAAO,IAAAG,2BAAW,EAACD,iBAAiB,EAAED,KAAK,EAAE,KAAK,EAAEd,WAAW,CAAC;AAClE,CAAC;AAED,IAAMiB,gBAAgB,GAAG,SAAnBA,gBAAgB,CAAIH,KAAK,EAAK;EAClC,IAAMI,MAAM,GAAGN,cAAc,CAACE,KAAK,EAAEA,KAAK,CAAC;EAC3C,OAAOI,MAAM;AACf,CAAC;AAAC,eAEaD,gBAAgB;AAAA"}
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
@@ -11,6 +10,5 @@ Object.defineProperty(exports, "default", {
11
10
  return _NavigationAnchors.default;
12
11
  }
13
12
  });
14
-
15
13
  var _NavigationAnchors = _interopRequireDefault(require("./NavigationAnchors"));
16
14
  //# sourceMappingURL=index.js.map