@rio-cloud/rio-uikit 2.1.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (445) hide show
  1. package/CircularProgress.d.ts +2 -0
  2. package/CircularProgress.js +5 -0
  3. package/CircularProgress.js.map +1 -0
  4. package/RadioCardGroup.d.ts +2 -0
  5. package/RadioCardGroup.js +7 -0
  6. package/RadioCardGroup.js.map +1 -0
  7. package/SearchHighlightText.d.ts +2 -0
  8. package/SearchHighlightText.js +5 -0
  9. package/SearchHighlightText.js.map +1 -0
  10. package/TextTruncateMiddle.d.ts +2 -0
  11. package/TextTruncateMiddle.js +5 -0
  12. package/TextTruncateMiddle.js.map +1 -0
  13. package/Tracker.d.ts +2 -0
  14. package/Tracker.js +5 -0
  15. package/Tracker.js.map +1 -0
  16. package/classNames.d.ts +2 -0
  17. package/classNames.js +5 -0
  18. package/classNames.js.map +1 -0
  19. package/components/accentBar/AccentBar.js +1 -1
  20. package/components/accentBar/AccentBar.js.map +1 -1
  21. package/components/actionBarItem/ActionBarItem.js +7 -7
  22. package/components/actionBarItem/ActionBarItem.js.map +1 -1
  23. package/components/actionBarItem/ActionBarItemIcon.js +1 -1
  24. package/components/actionBarItem/ActionBarItemIcon.js.map +1 -1
  25. package/components/actionBarItem/ActionBarItemList.js +1 -1
  26. package/components/actionBarItem/ActionBarItemList.js.map +1 -1
  27. package/components/actionBarItem/ActionBarItemListItem.js +1 -1
  28. package/components/actionBarItem/ActionBarItemListItem.js.map +1 -1
  29. package/components/actionBarItem/ActionBarItemListSeparator.js +1 -1
  30. package/components/actionBarItem/ActionBarItemListSeparator.js.map +1 -1
  31. package/components/actionBarItem/ActionBarItemPopoverContent.js +3 -3
  32. package/components/actionBarItem/ActionBarItemPopoverContent.js.map +1 -1
  33. package/components/actionBarItem/ActionBarOverlay.js +1 -1
  34. package/components/actionBarItem/ActionBarOverlay.js.map +1 -1
  35. package/components/activity/Activity.js +1 -1
  36. package/components/activity/Activity.js.map +1 -1
  37. package/components/animatedTextReveal/AnimatedTextReveal.js +1 -1
  38. package/components/animatedTextReveal/AnimatedTextReveal.js.map +1 -1
  39. package/components/applicationHeader/AppMenu.js +2 -2
  40. package/components/applicationHeader/AppMenu.js.map +1 -1
  41. package/components/applicationHeader/AppMenuDropdown.js +13 -11
  42. package/components/applicationHeader/AppMenuDropdown.js.map +1 -1
  43. package/components/applicationHeader/ApplicationHeader.js +1 -1
  44. package/components/applicationHeader/ApplicationHeader.js.map +1 -1
  45. package/components/applicationHeader/MobileHeaderModal.js +8 -8
  46. package/components/applicationHeader/MobileHeaderModal.js.map +1 -1
  47. package/components/applicationHeader/MobileSubmoduleNavigation.js +1 -1
  48. package/components/applicationHeader/MobileSubmoduleNavigation.js.map +1 -1
  49. package/components/applicationHeader/NavItems.js +4 -4
  50. package/components/applicationHeader/NavItems.js.map +1 -1
  51. package/components/applicationLayout/ApplicationLayout.js +10 -10
  52. package/components/applicationLayout/ApplicationLayout.js.map +1 -1
  53. package/components/applicationLayout/ApplicationLayoutBody.js +2 -2
  54. package/components/applicationLayout/ApplicationLayoutBody.js.map +1 -1
  55. package/components/applicationLayout/ApplicationLayoutBodyBanner.js +1 -1
  56. package/components/applicationLayout/ApplicationLayoutBodyBanner.js.map +1 -1
  57. package/components/applicationLayout/ApplicationLayoutBodyBottomBar.js +1 -1
  58. package/components/applicationLayout/ApplicationLayoutBodyBottomBar.js.map +1 -1
  59. package/components/applicationLayout/ApplicationLayoutBodyNavigation.js +1 -1
  60. package/components/applicationLayout/ApplicationLayoutBodyNavigation.js.map +1 -1
  61. package/components/applicationLayout/ApplicationLayoutHeader.js +1 -1
  62. package/components/applicationLayout/ApplicationLayoutHeader.js.map +1 -1
  63. package/components/applicationLayout/ApplicationLayoutSidebar.js +1 -1
  64. package/components/applicationLayout/ApplicationLayoutSidebar.js.map +1 -1
  65. package/components/applicationLayout/SubNavigation.js +1 -1
  66. package/components/applicationLayout/SubNavigation.js.map +1 -1
  67. package/components/assetTree/AssetTree.js +1 -1
  68. package/components/assetTree/AssetTree.js.map +1 -1
  69. package/components/assetTree/Tree.js +1 -1
  70. package/components/assetTree/Tree.js.map +1 -1
  71. package/components/assetTree/TreeIcon.js +3 -3
  72. package/components/assetTree/TreeIcon.js.map +1 -1
  73. package/components/assetTree/TreeLeaf.js +4 -4
  74. package/components/assetTree/TreeLeaf.js.map +1 -1
  75. package/components/assetTree/TreeNode.js +1 -1
  76. package/components/assetTree/TreeNode.js.map +1 -1
  77. package/components/assetTree/TreeNodeContainer.js +1 -1
  78. package/components/assetTree/TreeNodeContainer.js.map +1 -1
  79. package/components/assetTree/TreeOption.js +3 -3
  80. package/components/assetTree/TreeOption.js.map +1 -1
  81. package/components/assetTree/TreeOptions.js +4 -4
  82. package/components/assetTree/TreeOptions.js.map +1 -1
  83. package/components/assetTree/TreeRoot.js +3 -3
  84. package/components/assetTree/TreeRoot.js.map +1 -1
  85. package/components/assetTree/TreeSearch.js +3 -3
  86. package/components/assetTree/TreeSearch.js.map +1 -1
  87. package/components/assetTree/TreeSidebar.js +1 -1
  88. package/components/assetTree/TreeSidebar.js.map +1 -1
  89. package/components/assetTree/TreeSidebarCategories.js +4 -4
  90. package/components/assetTree/TreeSidebarCategories.js.map +1 -1
  91. package/components/assetTree/TreeSummary.js +1 -1
  92. package/components/assetTree/TreeSummary.js.map +1 -1
  93. package/components/assetTree/TypeCounter.js +1 -1
  94. package/components/assetTree/TypeCounter.js.map +1 -1
  95. package/components/autosuggest/AutoSuggest.js +1 -1
  96. package/components/autosuggest/AutoSuggest.js.map +1 -1
  97. package/components/avatar/Avatar.js +1 -1
  98. package/components/avatar/Avatar.js.map +1 -1
  99. package/components/banner/Banner.js +1 -1
  100. package/components/banner/Banner.js.map +1 -1
  101. package/components/banner/BannerContent.js +1 -1
  102. package/components/banner/BannerContent.js.map +1 -1
  103. package/components/barList/BarList.js +1 -1
  104. package/components/barList/BarList.js.map +1 -1
  105. package/components/bottomSheet/BottomSheet.js +1 -1
  106. package/components/bottomSheet/BottomSheet.js.map +1 -1
  107. package/components/button/Button.d.ts +53 -7
  108. package/components/button/Button.js +87 -64
  109. package/components/button/Button.js.map +1 -1
  110. package/components/button/ButtonToolbar.js +1 -1
  111. package/components/button/ButtonToolbar.js.map +1 -1
  112. package/components/button/ToggleButton.d.ts +4 -1
  113. package/components/button/ToggleButton.js.map +1 -1
  114. package/components/calendarStripe/CalendarStripe.js +16 -16
  115. package/components/calendarStripe/CalendarStripe.js.map +1 -1
  116. package/components/card/Card.js +1 -1
  117. package/components/card/Card.js.map +1 -1
  118. package/components/charts/RadialBarChart.js +106 -103
  119. package/components/charts/RadialBarChart.js.map +1 -1
  120. package/components/checkbox/Checkbox.js +6 -6
  121. package/components/checkbox/Checkbox.js.map +1 -1
  122. package/components/circularProgress/CircularProgress.d.ts +139 -0
  123. package/components/circularProgress/CircularProgress.js +197 -0
  124. package/components/circularProgress/CircularProgress.js.map +1 -0
  125. package/components/clearableInput/ClearableInput.js +9 -9
  126. package/components/clearableInput/ClearableInput.js.map +1 -1
  127. package/components/dataTabs/DataTabHeader.js +1 -1
  128. package/components/dataTabs/DataTabHeader.js.map +1 -1
  129. package/components/dataTabs/DataTabs.js +4 -4
  130. package/components/dataTabs/DataTabs.js.map +1 -1
  131. package/components/datepicker/DatePicker.js +6 -6
  132. package/components/datepicker/DatePicker.js.map +1 -1
  133. package/components/datepicker/DateRangePicker.js +1 -1
  134. package/components/datepicker/DateRangePicker.js.map +1 -1
  135. package/components/datepicker/DayPicker.js +1 -1
  136. package/components/datepicker/DayPicker.js.map +1 -1
  137. package/components/dialog/Dialog.js +55 -55
  138. package/components/dialog/Dialog.js.map +1 -1
  139. package/components/dialog/DialogBody.js +1 -1
  140. package/components/dialog/DialogBody.js.map +1 -1
  141. package/components/dialog/DialogFooter.js +1 -1
  142. package/components/dialog/DialogFooter.js.map +1 -1
  143. package/components/dialog/DialogHeader.js +1 -1
  144. package/components/dialog/DialogHeader.js.map +1 -1
  145. package/components/dialog/MediaDialog.js +1 -1
  146. package/components/dialog/MediaDialog.js.map +1 -1
  147. package/components/dialog/SplitDialog.js +1 -1
  148. package/components/dialog/SplitDialog.js.map +1 -1
  149. package/components/divider/Divider.js +1 -1
  150. package/components/divider/Divider.js.map +1 -1
  151. package/components/dropdown/ButtonDropdown.js +1 -1
  152. package/components/dropdown/ButtonDropdown.js.map +1 -1
  153. package/components/dropdown/DropdownSubmenu.js +3 -3
  154. package/components/dropdown/DropdownSubmenu.js.map +1 -1
  155. package/components/dropdown/DropdownToggleButton.d.ts +1 -1
  156. package/components/dropdown/DropdownToggleButton.js +4 -3
  157. package/components/dropdown/DropdownToggleButton.js.map +1 -1
  158. package/components/dropdown/SplitCaretButton.js +6 -6
  159. package/components/dropdown/SplitCaretButton.js.map +1 -1
  160. package/components/editableContent/EditableContent.js +1 -1
  161. package/components/editableContent/EditableContent.js.map +1 -1
  162. package/components/ellipsis/TextTruncateMiddle.d.ts +23 -0
  163. package/components/ellipsis/TextTruncateMiddle.js +21 -0
  164. package/components/ellipsis/TextTruncateMiddle.js.map +1 -0
  165. package/components/expander/ExpanderList.js +5 -5
  166. package/components/expander/ExpanderList.js.map +1 -1
  167. package/components/expander/ExpanderPanel.js +1 -1
  168. package/components/expander/ExpanderPanel.js.map +1 -1
  169. package/components/feedback/FeedbackRating.js +1 -1
  170. package/components/feedback/FeedbackRating.js.map +1 -1
  171. package/components/feedback/FeedbackReactions.js +1 -1
  172. package/components/feedback/FeedbackReactions.js.map +1 -1
  173. package/components/formLabel/FormLabel.js +6 -9
  174. package/components/formLabel/FormLabel.js.map +1 -1
  175. package/components/formLabel/LabeledElement.js +1 -1
  176. package/components/formLabel/LabeledElement.js.map +1 -1
  177. package/components/listMenu/ListMenu.js +2 -5
  178. package/components/listMenu/ListMenu.js.map +1 -1
  179. package/components/listMenu/ListMenuGroup.js +2 -2
  180. package/components/listMenu/ListMenuGroup.js.map +1 -1
  181. package/components/loadMore/LoadMoreButton.js +1 -1
  182. package/components/loadMore/LoadMoreButton.js.map +1 -1
  183. package/components/loadMore/LoadMoreProgress.js +1 -1
  184. package/components/loadMore/LoadMoreProgress.js.map +1 -1
  185. package/components/map/components/features/MapSettings.js +4 -4
  186. package/components/map/components/features/MapSettings.js.map +1 -1
  187. package/components/map/components/features/settings/MapSettingsItem.js +1 -1
  188. package/components/map/components/features/settings/MapSettingsItem.js.map +1 -1
  189. package/components/map/components/features/settings/MapSettingsPanel.js +6 -20
  190. package/components/map/components/features/settings/MapSettingsPanel.js.map +1 -1
  191. package/components/map/components/features/settings/MapSettingsTile.js +87 -61
  192. package/components/map/components/features/settings/MapSettingsTile.js.map +1 -1
  193. package/components/map/components/features/settings/ZoomButtons.js +1 -1
  194. package/components/map/components/features/settings/ZoomButtons.js.map +1 -1
  195. package/components/map/components/features/settings/builtinSettings/MapTypeSettings.d.ts +38 -1
  196. package/components/map/components/features/settings/builtinSettings/MapTypeSettings.js +128 -92
  197. package/components/map/components/features/settings/builtinSettings/MapTypeSettings.js.map +1 -1
  198. package/components/map/utils/eventHandling.js +9 -9
  199. package/components/map/utils/eventHandling.js.map +1 -1
  200. package/components/map/utils/mapUtils.d.ts +6 -6
  201. package/components/map/utils/mapUtils.js +14 -19
  202. package/components/map/utils/mapUtils.js.map +1 -1
  203. package/components/mapMarker/ClusterMapMarker.js +1 -1
  204. package/components/mapMarker/ClusterMapMarker.js.map +1 -1
  205. package/components/mapMarker/SingleMapMarker.js +1 -1
  206. package/components/mapMarker/SingleMapMarker.js.map +1 -1
  207. package/components/menuItems/MenuItem.js +1 -1
  208. package/components/menuItems/MenuItem.js.map +1 -1
  209. package/components/menuItems/MenuItemList.js +1 -1
  210. package/components/menuItems/MenuItemList.js.map +1 -1
  211. package/components/navigation/AppNavigationBar.js +4 -4
  212. package/components/navigation/AppNavigationBar.js.map +1 -1
  213. package/components/noData/NoData.js +1 -1
  214. package/components/noData/NoData.js.map +1 -1
  215. package/components/numberControl/NumberControl.js +4 -4
  216. package/components/numberControl/NumberControl.js.map +1 -1
  217. package/components/numberInput/NumberInput.js +1 -1
  218. package/components/numberInput/NumberInput.js.map +1 -1
  219. package/components/onboarding/OnboardingTip.js +4 -4
  220. package/components/onboarding/OnboardingTip.js.map +1 -1
  221. package/components/page/Page.js +1 -1
  222. package/components/page/Page.js.map +1 -1
  223. package/components/pager/Pager.js +1 -1
  224. package/components/pager/Pager.js.map +1 -1
  225. package/components/radiobutton/RadioButton.d.ts +1 -1
  226. package/components/radiobutton/RadioButton.js +5 -5
  227. package/components/radiobutton/RadioButton.js.map +1 -1
  228. package/components/radiobutton/RadioCardGroup.d.ts +86 -0
  229. package/components/radiobutton/RadioCardGroup.js +110 -0
  230. package/components/radiobutton/RadioCardGroup.js.map +1 -0
  231. package/components/resizer/Resizer.js +1 -1
  232. package/components/resizer/Resizer.js.map +1 -1
  233. package/components/responsiveColumnStripe/ResponsiveColumnStripe.js +1 -1
  234. package/components/responsiveColumnStripe/ResponsiveColumnStripe.js.map +1 -1
  235. package/components/rioglyph/Rioglyph.js +1 -1
  236. package/components/rioglyph/Rioglyph.js.map +1 -1
  237. package/components/rioglyph/RioglyphIconType.d.ts +1 -1
  238. package/components/rules/RuleConnector.js +1 -1
  239. package/components/rules/RuleConnector.js.map +1 -1
  240. package/components/rules/RuleContainer.js +27 -27
  241. package/components/rules/RuleContainer.js.map +1 -1
  242. package/components/saveableInput/SaveableDateInput.js +1 -1
  243. package/components/saveableInput/SaveableDateInput.js.map +1 -1
  244. package/components/saveableInput/SaveableInput.js +49 -49
  245. package/components/saveableInput/SaveableInput.js.map +1 -1
  246. package/components/searchHighlight/SearchHighlightText.d.ts +28 -0
  247. package/components/searchHighlight/SearchHighlightText.js +15 -0
  248. package/components/searchHighlight/SearchHighlightText.js.map +1 -0
  249. package/components/selects/BaseSelectDropdown.js +1 -1
  250. package/components/selects/BaseSelectDropdown.js.map +1 -1
  251. package/components/selects/ClearButton.js +4 -4
  252. package/components/selects/ClearButton.js.map +1 -1
  253. package/components/selects/Multiselect.js +6 -6
  254. package/components/selects/Multiselect.js.map +1 -1
  255. package/components/selects/MultiselectToggleFilter.js +4 -4
  256. package/components/selects/MultiselectToggleFilter.js.map +1 -1
  257. package/components/selects/MultiselectToggleSelection.js +1 -1
  258. package/components/selects/MultiselectToggleSelection.js.map +1 -1
  259. package/components/selects/Select.js +6 -6
  260. package/components/selects/Select.js.map +1 -1
  261. package/components/selects/SelectFilter.js +1 -1
  262. package/components/selects/SelectFilter.js.map +1 -1
  263. package/components/selects/WithFeedbackAndAddon.js +1 -1
  264. package/components/selects/WithFeedbackAndAddon.js.map +1 -1
  265. package/components/sidebars/Sidebar.js +54 -54
  266. package/components/sidebars/Sidebar.js.map +1 -1
  267. package/components/sidebars/SidebarBackdrop.js +4 -4
  268. package/components/sidebars/SidebarBackdrop.js.map +1 -1
  269. package/components/sidebars/SidebarFooter.js +1 -1
  270. package/components/sidebars/SidebarFooter.js.map +1 -1
  271. package/components/sidebars/SidebarFullscreenToggle.js +4 -4
  272. package/components/sidebars/SidebarFullscreenToggle.js.map +1 -1
  273. package/components/slider/RangeSlider.js +1 -1
  274. package/components/slider/RangeSlider.js.map +1 -1
  275. package/components/slider/Slider.js +1 -1
  276. package/components/slider/Slider.js.map +1 -1
  277. package/components/smoothScrollbars/SmoothScrollbars.js +1 -1
  278. package/components/smoothScrollbars/SmoothScrollbars.js.map +1 -1
  279. package/components/spinner/Spinner.js +5 -4
  280. package/components/spinner/Spinner.js.map +1 -1
  281. package/components/states/CustomState.d.ts +69 -1
  282. package/components/states/CustomState.js +1 -1
  283. package/components/states/CustomState.js.map +1 -1
  284. package/components/states/EmptyState.d.ts +1 -1
  285. package/components/states/EmptyState.js.map +1 -1
  286. package/components/states/ErrorState.d.ts +1 -1
  287. package/components/states/ErrorState.js.map +1 -1
  288. package/components/states/ForbiddenState.d.ts +1 -1
  289. package/components/states/ForbiddenState.js.map +1 -1
  290. package/components/states/MaintenanceState.d.ts +1 -1
  291. package/components/states/MaintenanceState.js.map +1 -1
  292. package/components/states/NotBookedState.d.ts +1 -1
  293. package/components/states/NotBookedState.js.map +1 -1
  294. package/components/states/NotFoundState.d.ts +1 -1
  295. package/components/states/NotFoundState.js.map +1 -1
  296. package/components/states/StateButton.js +1 -1
  297. package/components/states/StateButton.js.map +1 -1
  298. package/components/statsWidget/StatsWidget.js +1 -1
  299. package/components/statsWidget/StatsWidget.js.map +1 -1
  300. package/components/statsWidget/StatsWidgetBody.js +1 -1
  301. package/components/statsWidget/StatsWidgetBody.js.map +1 -1
  302. package/components/statsWidget/StatsWidgetFooter.js +1 -1
  303. package/components/statsWidget/StatsWidgetFooter.js.map +1 -1
  304. package/components/statsWidget/StatsWidgetHeader.js +1 -1
  305. package/components/statsWidget/StatsWidgetHeader.js.map +1 -1
  306. package/components/statsWidget/StatsWidgetNumber.js +2 -2
  307. package/components/statsWidget/StatsWidgetNumber.js.map +1 -1
  308. package/components/statsWidget/StatsWidgetSpacer.js +1 -1
  309. package/components/statsWidget/StatsWidgetSpacer.js.map +1 -1
  310. package/components/statsWidget/StatsWidgets.js +1 -1
  311. package/components/statsWidget/StatsWidgets.js.map +1 -1
  312. package/components/statusBar/StatusBar.d.ts +126 -2
  313. package/components/statusBar/StatusBar.js +24 -17
  314. package/components/statusBar/StatusBar.js.map +1 -1
  315. package/components/statusBar/StatusBarIcon.d.ts +1 -1
  316. package/components/statusBar/StatusBarIcon.js +4 -4
  317. package/components/statusBar/StatusBarIcon.js.map +1 -1
  318. package/components/statusBar/StatusBarLabel.d.ts +1 -1
  319. package/components/statusBar/StatusBarLabel.js +5 -7
  320. package/components/statusBar/StatusBarLabel.js.map +1 -1
  321. package/components/statusBar/StatusBarProgressBar.d.ts +1 -1
  322. package/components/statusBar/StatusBarProgressBar.js +1 -1
  323. package/components/statusBar/StatusBarProgressBar.js.map +1 -1
  324. package/components/steppedProgressBar/SteppedProgressBar.js +1 -1
  325. package/components/steppedProgressBar/SteppedProgressBar.js.map +1 -1
  326. package/components/switch/Switch.d.ts +16 -1
  327. package/components/switch/Switch.js +77 -35
  328. package/components/switch/Switch.js.map +1 -1
  329. package/components/table/TableCardsSorting.js +4 -4
  330. package/components/table/TableCardsSorting.js.map +1 -1
  331. package/components/table/TableHead.js +1 -1
  332. package/components/table/TableHead.js.map +1 -1
  333. package/components/table/TableSearch.js +1 -1
  334. package/components/table/TableSearch.js.map +1 -1
  335. package/components/table/TableSettingsColumnButtons.d.ts +1 -1
  336. package/components/table/TableSettingsColumnButtons.js +1 -1
  337. package/components/table/TableSettingsColumnButtons.js.map +1 -1
  338. package/components/table/TableSettingsColumnDetails.d.ts +1 -1
  339. package/components/table/TableSettingsColumnDetails.js +1 -1
  340. package/components/table/TableSettingsColumnDetails.js.map +1 -1
  341. package/components/table/TableSettingsDialog.d.ts +51 -1
  342. package/components/table/TableSettingsDialog.js +164 -148
  343. package/components/table/TableSettingsDialog.js.map +1 -1
  344. package/components/table/TableSettingsDialogFooter.js +1 -1
  345. package/components/table/TableSettingsDialogFooter.js.map +1 -1
  346. package/components/table/TableSettingsListContainer.d.ts +1 -1
  347. package/components/table/TableSettingsListContainer.js.map +1 -1
  348. package/components/table/TableSettingsListItem.d.ts +1 -1
  349. package/components/table/TableSettingsListItem.js +8 -8
  350. package/components/table/TableSettingsListItem.js.map +1 -1
  351. package/components/table/TableToolbar.js +1 -1
  352. package/components/table/TableToolbar.js.map +1 -1
  353. package/components/table/TableViewToggles.js +1 -1
  354. package/components/table/TableViewToggles.js.map +1 -1
  355. package/components/tag/Tag.js +1 -1
  356. package/components/tag/Tag.js.map +1 -1
  357. package/components/tag/TagList.js +1 -1
  358. package/components/tag/TagList.js.map +1 -1
  359. package/components/tagManager/CustomSuggestionItem.js +1 -1
  360. package/components/tagManager/CustomSuggestionItem.js.map +1 -1
  361. package/components/tagManager/TagManager.d.ts +14 -2
  362. package/components/tagManager/TagManager.js +6 -6
  363. package/components/tagManager/TagManager.js.map +1 -1
  364. package/components/tagManager/TagManagerItemList.d.ts +1 -1
  365. package/components/tagManager/TagManagerItemList.js +1 -1
  366. package/components/tagManager/TagManagerItemList.js.map +1 -1
  367. package/components/teaser/Teaser.js +1 -1
  368. package/components/teaser/Teaser.js.map +1 -1
  369. package/components/teaser/TeaserContainer.js +1 -1
  370. package/components/teaser/TeaserContainer.js.map +1 -1
  371. package/components/timepicker/TimePicker.d.ts +20 -0
  372. package/components/timepicker/TimePicker.js +153 -99
  373. package/components/timepicker/TimePicker.js.map +1 -1
  374. package/components/tooltip/Tooltip.js +1 -1
  375. package/components/tooltip/Tooltip.js.map +1 -1
  376. package/components/tracker/Tracker.d.ts +85 -0
  377. package/components/tracker/Tracker.js +54 -0
  378. package/components/tracker/Tracker.js.map +1 -0
  379. package/components/tracker/TrackerBlock.d.ts +11 -0
  380. package/components/tracker/TrackerBlock.js +34 -0
  381. package/components/tracker/TrackerBlock.js.map +1 -0
  382. package/components/video/ResponsiveVideo.js +1 -1
  383. package/components/video/ResponsiveVideo.js.map +1 -1
  384. package/hooks/useCookies.d.ts +79 -0
  385. package/hooks/useCookies.js +33 -0
  386. package/hooks/useCookies.js.map +1 -0
  387. package/hooks/useInterval.js +5 -5
  388. package/hooks/useInterval.js.map +1 -1
  389. package/hooks/useIsFocusWithin.js +3 -3
  390. package/hooks/useIsFocusWithin.js.map +1 -1
  391. package/hooks/useLatest.d.ts +16 -0
  392. package/hooks/useLatest.js +11 -0
  393. package/hooks/useLatest.js.map +1 -0
  394. package/hooks/usePostMessage.d.ts +2 -1
  395. package/hooks/usePostMessage.js.map +1 -1
  396. package/hooks/useRioCookieConsent.d.ts +49 -0
  397. package/hooks/useRioCookieConsent.js +44 -0
  398. package/hooks/useRioCookieConsent.js.map +1 -0
  399. package/hooks/useSearch.d.ts +1 -1
  400. package/hooks/useSearch.js +28 -17
  401. package/hooks/useSearch.js.map +1 -1
  402. package/hooks/useSearchHighlight.d.ts +60 -0
  403. package/hooks/useSearchHighlight.js +54 -0
  404. package/hooks/useSearchHighlight.js.map +1 -0
  405. package/hooks/useTimeout.js +11 -11
  406. package/hooks/useTimeout.js.map +1 -1
  407. package/hooks/useUrlState.d.ts +62 -0
  408. package/hooks/useUrlState.js +137 -0
  409. package/hooks/useUrlState.js.map +1 -0
  410. package/mergeClassNameOverrides.d.ts +1 -0
  411. package/mergeClassNameOverrides.js +5 -0
  412. package/mergeClassNameOverrides.js.map +1 -0
  413. package/package.json +17 -18
  414. package/routeUtils.js +11 -5
  415. package/routeUtils.js.map +1 -1
  416. package/themes/Volkswagen/components/applicationHeader/VolkswagenApplicationHeader.js +1 -1
  417. package/themes/Volkswagen/components/applicationHeader/VolkswagenApplicationHeader.js.map +1 -1
  418. package/useCookies.d.ts +2 -0
  419. package/useCookies.js +5 -0
  420. package/useCookies.js.map +1 -0
  421. package/useRioCookieConsent.d.ts +2 -0
  422. package/useRioCookieConsent.js +5 -0
  423. package/useRioCookieConsent.js.map +1 -0
  424. package/useSearchHighlight.d.ts +2 -0
  425. package/useSearchHighlight.js +6 -0
  426. package/useSearchHighlight.js.map +1 -0
  427. package/useUrlState.d.ts +2 -0
  428. package/useUrlState.js +5 -0
  429. package/useUrlState.js.map +1 -0
  430. package/utils/classNames.d.ts +3 -0
  431. package/utils/classNames.js +5 -0
  432. package/utils/classNames.js.map +1 -0
  433. package/utils/mergeClassNameOverrides.d.ts +1 -0
  434. package/utils/mergeClassNameOverrides.js +55 -0
  435. package/utils/mergeClassNameOverrides.js.map +1 -0
  436. package/utils/routeUtils.d.ts +122 -13
  437. package/utils/routeUtils.js +89 -31
  438. package/utils/routeUtils.js.map +1 -1
  439. package/version.d.ts +1 -1
  440. package/version.js +1 -1
  441. package/version.js.map +1 -1
  442. package/components/states/BaseStateProps.d.ts +0 -70
  443. package/components/statusBar/StatusBarProps.d.ts +0 -127
  444. package/components/table/TableSettingsDialog.types.d.ts +0 -39
  445. package/components/tagManager/TagManagerTag.d.ts +0 -14
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip.js","sources":["../../../src/components/tooltip/Tooltip.tsx"],"sourcesContent":["import {\n useEffect,\n useState,\n forwardRef,\n type CSSProperties,\n type ForwardedRef,\n type PropsWithChildren,\n type HTMLAttributes,\n} from 'react';\nimport classNames from 'classnames';\nimport { omit } from 'es-toolkit/compat';\n\nimport { isDesktop } from '../../utils/deviceUtils';\nimport { PLACEMENT } from '../../values/Placement';\nimport { TEXT_ALIGNMENT } from '../../values/TextAlignment';\nimport type { ObjectValues } from '../../utils/ObjectValues';\nimport type { RefComponent } from '../../utils/RefComponent';\n\nconst STYLE_MAP = {\n STYLE_DEFAULT: 'default',\n STYLE_ONBOARDING: 'onboarding',\n} as const;\n\nconst TEXT_ALIGNMENT_MAP = {\n TEXT_ALIGNMENT_LEFT: TEXT_ALIGNMENT.LEFT,\n TEXT_ALIGNMENT_CENTER: TEXT_ALIGNMENT.CENTER,\n TEXT_ALIGNMENT_RIGHT: TEXT_ALIGNMENT.RIGHT,\n} as const;\n\nexport type TooltipWidth = 'auto' | 100 | 150 | 200 | 250 | 300 | 350 | 400 | 450 | 500;\n\nexport type TooltipProps = {\n /**\n * An HTML id attribute, necessary for accessibility.\n */\n id?: string;\n\n /**\n * Sets the direction the Tooltip is positioned towards. This is generally provided by the\n * OverlayTrigger component positioning the tooltip.\n *\n * @default 'bottom'\n */\n placement?: ObjectValues<typeof PLACEMENT>;\n\n /**\n * Defines the position of the text content.\n *\n * Possible values are:\n *\n * - `'center'`\n * - `'left'`\n * - `'right'`\n *\n * @default 'center'\n */\n textAlignment?: ObjectValues<typeof TEXT_ALIGNMENT>;\n\n /**\n * Defines the look of the tooltip.\n * Possible values are: `default` and `onboarding`\n *\n * @default 'default'\n */\n tooltipStyle?: ObjectValues<typeof STYLE_MAP>;\n\n /**\n * Defines the width of 'the tooltip.\n * Possible values are:\n *\n * - `'auto'`\n * - `100`\n * - `150`\n * - `200`\n * - `250`\n * - `300`\n * - `350`\n * - `400`\n * - `450`\n * - `500`\n */\n width?: TooltipWidth;\n\n /**\n * Render Tooltips on mobile devices.\n *\n * @default false\n */\n allowOnTouch?: boolean;\n\n /**\n * Additional props assigned to the arrow element. Internally used.\n */\n arrowProps?: Record<string, unknown>;\n\n /**\n * Additional style properties assigned to the wrapper element.\n */\n style?: CSSProperties;\n\n /**\n * Additional classes to be set on the wrapper element.\n */\n className?: string;\n\n /**\n * Additional classes to be set on the inner element.\n */\n innerClassName?: string;\n} & Omit<HTMLAttributes<HTMLDivElement>, 'id' | 'style' | 'className'>;\n\nexport type TooltipType = RefComponent<PropsWithChildren<TooltipProps>> &\n typeof STYLE_MAP &\n typeof PLACEMENT &\n typeof TEXT_ALIGNMENT_MAP;\n\nconst Tooltip = forwardRef((props: PropsWithChildren<TooltipProps>, ref: ForwardedRef<HTMLDivElement>) => {\n const {\n allowOnTouch = false,\n arrowProps,\n children,\n className = '',\n innerClassName = '',\n placement = 'bottom',\n style,\n textAlignment = 'center',\n tooltipStyle = 'default',\n width = 'auto',\n ...remainingProps\n } = omit(props, ['popper', 'positionLeft', 'positionTop']);\n\n // Mount the component but don't show it yet via CSS.\n // After it is mounted, we set the visibility class to use CSS animation\n const [isMounted, setIsMounted] = useState(false);\n useEffect(() => setIsMounted(true), []);\n\n if (!isDesktop() && !allowOnTouch) {\n // Workaround: we have to return a DOM node as otherwise the\n // react-transition library would throw an error on mobile\n // when triggering a browser reflow and accessing the node directly.\n return <span className='display-none' />;\n }\n\n const wrapperClasses = classNames(\n 'tooltip',\n tooltipStyle && `tooltip-${tooltipStyle}`,\n placement,\n 'fade',\n isMounted && 'show',\n className\n );\n\n const innerClasses = classNames(\n 'tooltip-inner',\n textAlignment && `text-${textAlignment}`,\n width && `width-${width}`,\n innerClassName && innerClassName\n );\n\n /* eslint-disable react/no-unknown-property */\n return (\n <div\n {...remainingProps}\n role='tooltip'\n // x-placement is used by the css to define how to position the arrow.\n x-placement={placement}\n ref={ref}\n className={wrapperClasses}\n style={{ ...style }}\n data-offset={20}\n >\n <div className='tooltip-arrow' {...arrowProps} />\n <div className={innerClasses}>{children}</div>\n </div>\n );\n}) as TooltipType;\n\n// statics\nObject.assign(Tooltip, STYLE_MAP);\nObject.assign(Tooltip, PLACEMENT); // is keyed as-is\nObject.assign(Tooltip, TEXT_ALIGNMENT_MAP);\n\nexport default Tooltip;\n"],"names":["STYLE_MAP","TEXT_ALIGNMENT_MAP","TEXT_ALIGNMENT","Tooltip","forwardRef","props","ref","allowOnTouch","arrowProps","children","className","innerClassName","placement","style","textAlignment","tooltipStyle","width","remainingProps","omit","isMounted","setIsMounted","useState","useEffect","isDesktop","jsx","wrapperClasses","classNames","innerClasses","jsxs","PLACEMENT"],"mappings":";;;;;;;AAkBA,MAAMA,IAAY;AAAA,EACd,eAAe;AAAA,EACf,kBAAkB;AACtB,GAEMC,IAAqB;AAAA,EACvB,qBAAqBC,EAAe;AAAA,EACpC,uBAAuBA,EAAe;AAAA,EACtC,sBAAsBA,EAAe;AACzC,GAyFMC,IAAUC,EAAW,CAACC,GAAwCC,MAAsC;AACtG,QAAM;AAAA,IACF,cAAAC,IAAe;AAAA,IACf,YAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,gBAAAC,IAAiB;AAAA,IACjB,WAAAC,IAAY;AAAA,IACZ,OAAAC;AAAA,IACA,eAAAC,IAAgB;AAAA,IAChB,cAAAC,IAAe;AAAA,IACf,OAAAC,IAAQ;AAAA,IACR,GAAGC;AAAA,EAAA,IACHC,EAAKb,GAAO,CAAC,UAAU,gBAAgB,aAAa,CAAC,GAInD,CAACc,GAAWC,CAAY,IAAIC,EAAS,EAAK;AAGhD,MAFAC,EAAU,MAAMF,EAAa,EAAI,GAAG,CAAA,CAAE,GAElC,CAACG,OAAe,CAAChB;AAIjB,WAAO,gBAAAiB,EAAC,QAAA,EAAK,WAAU,eAAA,CAAe;AAG1C,QAAMC,IAAiBC;AAAA,IACnB;AAAA,IACAX,KAAgB,WAAWA,CAAY;AAAA,IACvCH;AAAA,IACA;AAAA,IACAO,KAAa;AAAA,IACbT;AAAA,EAAA,GAGEiB,IAAeD;AAAA,IACjB;AAAA,IACAZ,KAAiB,QAAQA,CAAa;AAAA,IACtCE,KAAS,SAASA,CAAK;AAAA,IACvBL,KAAkBA;AAAA,EAAA;AAItB,SACI,gBAAAiB;AAAA,IAAC;AAAA,IAAA;AAAA,MACI,GAAGX;AAAA,MACJ,MAAK;AAAA,MAEL,eAAaL;AAAA,MACb,KAAAN;AAAA,MACA,WAAWmB;AAAA,MACX,OAAO,EAAE,GAAGZ,EAAA;AAAA,MACZ,eAAa;AAAA,MAEb,UAAA;AAAA,QAAA,gBAAAW,EAAC,OAAA,EAAI,WAAU,iBAAiB,GAAGhB,EAAA,CAAY;AAAA,QAC/C,gBAAAgB,EAAC,OAAA,EAAI,WAAWG,GAAe,UAAAlB,EAAA,CAAS;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGpD,CAAC;AAGD,OAAO,OAAON,GAASH,CAAS;AAChC,OAAO,OAAOG,GAAS0B,CAAS;AAChC,OAAO,OAAO1B,GAASF,CAAkB;"}
1
+ {"version":3,"file":"Tooltip.js","sources":["../../../src/components/tooltip/Tooltip.tsx"],"sourcesContent":["import {\n useEffect,\n useState,\n forwardRef,\n type CSSProperties,\n type ForwardedRef,\n type PropsWithChildren,\n type HTMLAttributes,\n} from 'react';\nimport { omit } from 'es-toolkit/compat';\n\nimport classNames from '../../utils/classNames';\nimport { isDesktop } from '../../utils/deviceUtils';\nimport { PLACEMENT } from '../../values/Placement';\nimport { TEXT_ALIGNMENT } from '../../values/TextAlignment';\nimport type { ObjectValues } from '../../utils/ObjectValues';\nimport type { RefComponent } from '../../utils/RefComponent';\n\nconst STYLE_MAP = {\n STYLE_DEFAULT: 'default',\n STYLE_ONBOARDING: 'onboarding',\n} as const;\n\nconst TEXT_ALIGNMENT_MAP = {\n TEXT_ALIGNMENT_LEFT: TEXT_ALIGNMENT.LEFT,\n TEXT_ALIGNMENT_CENTER: TEXT_ALIGNMENT.CENTER,\n TEXT_ALIGNMENT_RIGHT: TEXT_ALIGNMENT.RIGHT,\n} as const;\n\nexport type TooltipWidth = 'auto' | 100 | 150 | 200 | 250 | 300 | 350 | 400 | 450 | 500;\n\nexport type TooltipProps = {\n /**\n * An HTML id attribute, necessary for accessibility.\n */\n id?: string;\n\n /**\n * Sets the direction the Tooltip is positioned towards. This is generally provided by the\n * OverlayTrigger component positioning the tooltip.\n *\n * @default 'bottom'\n */\n placement?: ObjectValues<typeof PLACEMENT>;\n\n /**\n * Defines the position of the text content.\n *\n * Possible values are:\n *\n * - `'center'`\n * - `'left'`\n * - `'right'`\n *\n * @default 'center'\n */\n textAlignment?: ObjectValues<typeof TEXT_ALIGNMENT>;\n\n /**\n * Defines the look of the tooltip.\n * Possible values are: `default` and `onboarding`\n *\n * @default 'default'\n */\n tooltipStyle?: ObjectValues<typeof STYLE_MAP>;\n\n /**\n * Defines the width of 'the tooltip.\n * Possible values are:\n *\n * - `'auto'`\n * - `100`\n * - `150`\n * - `200`\n * - `250`\n * - `300`\n * - `350`\n * - `400`\n * - `450`\n * - `500`\n */\n width?: TooltipWidth;\n\n /**\n * Render Tooltips on mobile devices.\n *\n * @default false\n */\n allowOnTouch?: boolean;\n\n /**\n * Additional props assigned to the arrow element. Internally used.\n */\n arrowProps?: Record<string, unknown>;\n\n /**\n * Additional style properties assigned to the wrapper element.\n */\n style?: CSSProperties;\n\n /**\n * Additional classes to be set on the wrapper element.\n */\n className?: string;\n\n /**\n * Additional classes to be set on the inner element.\n */\n innerClassName?: string;\n} & Omit<HTMLAttributes<HTMLDivElement>, 'id' | 'style' | 'className'>;\n\nexport type TooltipType = RefComponent<PropsWithChildren<TooltipProps>> &\n typeof STYLE_MAP &\n typeof PLACEMENT &\n typeof TEXT_ALIGNMENT_MAP;\n\nconst Tooltip = forwardRef((props: PropsWithChildren<TooltipProps>, ref: ForwardedRef<HTMLDivElement>) => {\n const {\n allowOnTouch = false,\n arrowProps,\n children,\n className = '',\n innerClassName = '',\n placement = 'bottom',\n style,\n textAlignment = 'center',\n tooltipStyle = 'default',\n width = 'auto',\n ...remainingProps\n } = omit(props, ['popper', 'positionLeft', 'positionTop']);\n\n // Mount the component but don't show it yet via CSS.\n // After it is mounted, we set the visibility class to use CSS animation\n const [isMounted, setIsMounted] = useState(false);\n useEffect(() => setIsMounted(true), []);\n\n if (!isDesktop() && !allowOnTouch) {\n // Workaround: we have to return a DOM node as otherwise the\n // react-transition library would throw an error on mobile\n // when triggering a browser reflow and accessing the node directly.\n return <span className='display-none' />;\n }\n\n const wrapperClasses = classNames(\n 'tooltip',\n tooltipStyle && `tooltip-${tooltipStyle}`,\n placement,\n 'fade',\n isMounted && 'show',\n className\n );\n\n const innerClasses = classNames(\n 'tooltip-inner',\n textAlignment && `text-${textAlignment}`,\n width && `width-${width}`,\n innerClassName && innerClassName\n );\n\n /* eslint-disable react/no-unknown-property */\n return (\n <div\n {...remainingProps}\n role='tooltip'\n // x-placement is used by the css to define how to position the arrow.\n x-placement={placement}\n ref={ref}\n className={wrapperClasses}\n style={{ ...style }}\n data-offset={20}\n >\n <div className='tooltip-arrow' {...arrowProps} />\n <div className={innerClasses}>{children}</div>\n </div>\n );\n}) as TooltipType;\n\n// statics\nObject.assign(Tooltip, STYLE_MAP);\nObject.assign(Tooltip, PLACEMENT); // is keyed as-is\nObject.assign(Tooltip, TEXT_ALIGNMENT_MAP);\n\nexport default Tooltip;\n"],"names":["STYLE_MAP","TEXT_ALIGNMENT_MAP","TEXT_ALIGNMENT","Tooltip","forwardRef","props","ref","allowOnTouch","arrowProps","children","className","innerClassName","placement","style","textAlignment","tooltipStyle","width","remainingProps","omit","isMounted","setIsMounted","useState","useEffect","isDesktop","jsx","wrapperClasses","classNames","innerClasses","jsxs","PLACEMENT"],"mappings":";;;;;;;AAkBA,MAAMA,IAAY;AAAA,EACd,eAAe;AAAA,EACf,kBAAkB;AACtB,GAEMC,IAAqB;AAAA,EACvB,qBAAqBC,EAAe;AAAA,EACpC,uBAAuBA,EAAe;AAAA,EACtC,sBAAsBA,EAAe;AACzC,GAyFMC,IAAUC,EAAW,CAACC,GAAwCC,MAAsC;AACtG,QAAM;AAAA,IACF,cAAAC,IAAe;AAAA,IACf,YAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,gBAAAC,IAAiB;AAAA,IACjB,WAAAC,IAAY;AAAA,IACZ,OAAAC;AAAA,IACA,eAAAC,IAAgB;AAAA,IAChB,cAAAC,IAAe;AAAA,IACf,OAAAC,IAAQ;AAAA,IACR,GAAGC;AAAA,EAAA,IACHC,EAAKb,GAAO,CAAC,UAAU,gBAAgB,aAAa,CAAC,GAInD,CAACc,GAAWC,CAAY,IAAIC,EAAS,EAAK;AAGhD,MAFAC,EAAU,MAAMF,EAAa,EAAI,GAAG,CAAA,CAAE,GAElC,CAACG,OAAe,CAAChB;AAIjB,WAAO,gBAAAiB,EAAC,QAAA,EAAK,WAAU,eAAA,CAAe;AAG1C,QAAMC,IAAiBC;AAAA,IACnB;AAAA,IACAX,KAAgB,WAAWA,CAAY;AAAA,IACvCH;AAAA,IACA;AAAA,IACAO,KAAa;AAAA,IACbT;AAAA,EAAA,GAGEiB,IAAeD;AAAA,IACjB;AAAA,IACAZ,KAAiB,QAAQA,CAAa;AAAA,IACtCE,KAAS,SAASA,CAAK;AAAA,IACvBL,KAAkBA;AAAA,EAAA;AAItB,SACI,gBAAAiB;AAAA,IAAC;AAAA,IAAA;AAAA,MACI,GAAGX;AAAA,MACJ,MAAK;AAAA,MAEL,eAAaL;AAAA,MACb,KAAAN;AAAA,MACA,WAAWmB;AAAA,MACX,OAAO,EAAE,GAAGZ,EAAA;AAAA,MACZ,eAAa;AAAA,MAEb,UAAA;AAAA,QAAA,gBAAAW,EAAC,OAAA,EAAI,WAAU,iBAAiB,GAAGhB,EAAA,CAAY;AAAA,QAC/C,gBAAAgB,EAAC,OAAA,EAAI,WAAWG,GAAe,UAAAlB,EAAA,CAAS;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGpD,CAAC;AAGD,OAAO,OAAON,GAASH,CAAS;AAChC,OAAO,OAAOG,GAAS0B,CAAS;AAChC,OAAO,OAAO1B,GAASF,CAAkB;"}
@@ -0,0 +1,85 @@
1
+ import { ReactNode } from 'react';
2
+ export type TrackerBlock = {
3
+ /**
4
+ * Unique identifier for a block.
5
+ */
6
+ id?: string;
7
+ /**
8
+ * Defines the block color by setting a UIKIT bg-<name> class.
9
+ */
10
+ color?: string;
11
+ /**
12
+ * Tooltip content shown on hover.
13
+ */
14
+ tooltip?: ReactNode;
15
+ /**
16
+ * Called when clicking the block.
17
+ */
18
+ onClick?: (id: string) => void;
19
+ /**
20
+ * Additional class names for the block.
21
+ */
22
+ className?: string;
23
+ };
24
+ export type TrackerProps = {
25
+ /**
26
+ * Array of block objects.
27
+ */
28
+ data: TrackerBlock[];
29
+ /**
30
+ * Background color of a block, when no color is provided in `data`.
31
+ *
32
+ * @default 'bg-success'
33
+ */
34
+ defaultBackgroundColor?: string;
35
+ /**
36
+ * Add a hover effect to the tracker blocks.
37
+ *
38
+ * @default false
39
+ */
40
+ hoverEffect?: boolean;
41
+ /**
42
+ * Minimum width per tracker block in pixels.
43
+ *
44
+ * The tracker compresses blocks automatically down to this value.
45
+ *
46
+ * @default 5
47
+ */
48
+ minBlockWidth?: number;
49
+ /**
50
+ * Maximum width per tracker block in pixels.
51
+ *
52
+ * @default 10
53
+ */
54
+ maxBlockWidth?: number;
55
+ /**
56
+ * Gap between tracker blocks in pixels.
57
+ *
58
+ * @default 2
59
+ */
60
+ blockGap?: number;
61
+ /**
62
+ * Height per tracker block in pixels.
63
+ *
64
+ * @default 30
65
+ */
66
+ blockHeight?: number;
67
+ /**
68
+ * When enabled, the tracker shows fewer blocks once `minBlockWidth` is reached.
69
+ *
70
+ * @default true
71
+ */
72
+ collapseOnMinBlockWidth?: boolean;
73
+ /**
74
+ * Show the last blocks instead of the first blocks when collapsing due to width.
75
+ *
76
+ * @default false
77
+ */
78
+ collapseShowLastBlocks?: boolean;
79
+ /**
80
+ * Additional class names on the wrapper element.
81
+ */
82
+ className?: string;
83
+ };
84
+ declare const Tracker: (props: TrackerProps) => import("react/jsx-runtime").JSX.Element;
85
+ export default Tracker;
@@ -0,0 +1,54 @@
1
+ import { jsx as m } from "react/jsx-runtime";
2
+ import { useMemo as T } from "react";
3
+ import C from "../../utils/classNames.js";
4
+ import H from "../../hooks/useResizeObserver.js";
5
+ import A from "./TrackerBlock.js";
6
+ const E = 5, O = 10, F = 2, G = 30, R = (d) => {
7
+ const {
8
+ data: t,
9
+ defaultBackgroundColor: k = "bg-success",
10
+ hoverEffect: p = !1,
11
+ minBlockWidth: M = E,
12
+ maxBlockWidth: b = O,
13
+ blockGap: B = F,
14
+ blockHeight: W = G,
15
+ collapseOnMinBlockWidth: n = !0,
16
+ collapseShowLastBlocks: r = !1,
17
+ className: f
18
+ } = d, [g, I, { inlineSize: h }] = H(), c = Math.max(1, M), l = Math.max(c, b), a = Math.max(0, B), x = Math.max(1, W), { visibleData: u, blockWidth: _ } = T(() => {
19
+ if (t.length === 0)
20
+ return { visibleData: t, blockWidth: l };
21
+ const e = h ?? t.length * l + (t.length - 1) * a, s = Math.max(
22
+ 1,
23
+ Math.floor((e + a) / (c + a))
24
+ ), o = n ? Math.min(t.length, s) : t.length, i = r ? t.slice(-o) : t.slice(0, o), D = Math.max(0, e - (i.length - 1) * a) / i.length, L = Math.max(c, Math.min(l, D));
25
+ return { visibleData: i, blockWidth: L };
26
+ }, [
27
+ t,
28
+ h,
29
+ c,
30
+ l,
31
+ a,
32
+ n,
33
+ r
34
+ ]), v = C("tracker", f);
35
+ return /* @__PURE__ */ m("div", { ref: g, className: v, style: { gap: `${a}px` }, children: u.map((e, s) => {
36
+ const o = e.id ?? `${s}`;
37
+ return /* @__PURE__ */ m(
38
+ A,
39
+ {
40
+ id: o,
41
+ block: e,
42
+ defaultBackgroundColor: k,
43
+ hoverEffect: p,
44
+ blockWidth: _,
45
+ blockHeight: x
46
+ },
47
+ o
48
+ );
49
+ }) });
50
+ };
51
+ export {
52
+ R as default
53
+ };
54
+ //# sourceMappingURL=Tracker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tracker.js","sources":["../../../src/components/tracker/Tracker.tsx"],"sourcesContent":["import { useMemo, type ReactNode } from 'react';\n\nimport classNames from '../../utils/classNames';\nimport useResizeObserver from '../../hooks/useResizeObserver';\nimport TrackerBlockItem from './TrackerBlock';\n\nconst DEFAULT_MIN_BLOCK_WIDTH = 5;\nconst DEFAULT_MAX_BLOCK_WIDTH = 10;\nconst DEFAULT_BLOCK_GAP = 2;\nconst DEFAULT_BLOCK_HEIGHT = 30;\n\nexport type TrackerBlock = {\n /**\n * Unique identifier for a block.\n */\n id?: string;\n\n /**\n * Defines the block color by setting a UIKIT bg-<name> class.\n */\n color?: string;\n\n /**\n * Tooltip content shown on hover.\n */\n tooltip?: ReactNode;\n\n /**\n * Called when clicking the block.\n */\n onClick?: (id: string) => void;\n\n /**\n * Additional class names for the block.\n */\n className?: string;\n};\n\nexport type TrackerProps = {\n /**\n * Array of block objects.\n */\n data: TrackerBlock[];\n\n /**\n * Background color of a block, when no color is provided in `data`.\n *\n * @default 'bg-success'\n */\n defaultBackgroundColor?: string;\n\n /**\n * Add a hover effect to the tracker blocks.\n *\n * @default false\n */\n hoverEffect?: boolean;\n\n /**\n * Minimum width per tracker block in pixels.\n *\n * The tracker compresses blocks automatically down to this value.\n *\n * @default 5\n */\n minBlockWidth?: number;\n\n /**\n * Maximum width per tracker block in pixels.\n *\n * @default 10\n */\n maxBlockWidth?: number;\n\n /**\n * Gap between tracker blocks in pixels.\n *\n * @default 2\n */\n blockGap?: number;\n\n /**\n * Height per tracker block in pixels.\n *\n * @default 30\n */\n blockHeight?: number;\n\n /**\n * When enabled, the tracker shows fewer blocks once `minBlockWidth` is reached.\n *\n * @default true\n */\n collapseOnMinBlockWidth?: boolean;\n\n /**\n * Show the last blocks instead of the first blocks when collapsing due to width.\n *\n * @default false\n */\n collapseShowLastBlocks?: boolean;\n\n /**\n * Additional class names on the wrapper element.\n */\n className?: string;\n};\n\nconst Tracker = (props: TrackerProps) => {\n const {\n data,\n defaultBackgroundColor = 'bg-success',\n hoverEffect = false,\n minBlockWidth = DEFAULT_MIN_BLOCK_WIDTH,\n maxBlockWidth = DEFAULT_MAX_BLOCK_WIDTH,\n blockGap = DEFAULT_BLOCK_GAP,\n blockHeight = DEFAULT_BLOCK_HEIGHT,\n collapseOnMinBlockWidth = true,\n collapseShowLastBlocks = false,\n className,\n } = props;\n const [trackerRef, _, { inlineSize }] = useResizeObserver<HTMLDivElement>();\n\n const clampedMinBlockWidth = Math.max(1, minBlockWidth);\n const clampedMaxBlockWidth = Math.max(clampedMinBlockWidth, maxBlockWidth);\n const clampedBlockGap = Math.max(0, blockGap);\n const clampedBlockHeight = Math.max(1, blockHeight);\n\n const { visibleData, blockWidth } = useMemo(() => {\n if (data.length === 0) {\n return { visibleData: data, blockWidth: clampedMaxBlockWidth };\n }\n\n const containerWidth = inlineSize ?? data.length * clampedMaxBlockWidth + (data.length - 1) * clampedBlockGap;\n const maxVisibleWithMinWidth = Math.max(\n 1,\n Math.floor((containerWidth + clampedBlockGap) / (clampedMinBlockWidth + clampedBlockGap))\n );\n const visibleBlocksCount = collapseOnMinBlockWidth\n ? Math.min(data.length, maxVisibleWithMinWidth)\n : data.length;\n const visibleData = collapseShowLastBlocks\n ? data.slice(-visibleBlocksCount)\n : data.slice(0, visibleBlocksCount);\n\n const availableWidth = Math.max(0, containerWidth - (visibleData.length - 1) * clampedBlockGap);\n const widthPerBlock = availableWidth / visibleData.length;\n const blockWidth = Math.max(clampedMinBlockWidth, Math.min(clampedMaxBlockWidth, widthPerBlock));\n\n return { visibleData, blockWidth };\n }, [\n data,\n inlineSize,\n clampedMinBlockWidth,\n clampedMaxBlockWidth,\n clampedBlockGap,\n collapseOnMinBlockWidth,\n collapseShowLastBlocks,\n ]);\n\n const wrapperClasses = classNames('tracker', className);\n\n return (\n <div ref={trackerRef} className={wrapperClasses} style={{ gap: `${clampedBlockGap}px` }}>\n {visibleData.map((block, index) => {\n const id = block.id ?? `${index}`;\n return (\n <TrackerBlockItem\n key={id}\n id={id}\n block={block}\n defaultBackgroundColor={defaultBackgroundColor}\n hoverEffect={hoverEffect}\n blockWidth={blockWidth}\n blockHeight={clampedBlockHeight}\n />\n );\n })}\n </div>\n );\n};\n\nexport default Tracker;\n"],"names":["DEFAULT_MIN_BLOCK_WIDTH","DEFAULT_MAX_BLOCK_WIDTH","DEFAULT_BLOCK_GAP","DEFAULT_BLOCK_HEIGHT","Tracker","props","data","defaultBackgroundColor","hoverEffect","minBlockWidth","maxBlockWidth","blockGap","blockHeight","collapseOnMinBlockWidth","collapseShowLastBlocks","className","trackerRef","_","inlineSize","useResizeObserver","clampedMinBlockWidth","clampedMaxBlockWidth","clampedBlockGap","clampedBlockHeight","visibleData","blockWidth","useMemo","containerWidth","maxVisibleWithMinWidth","visibleBlocksCount","widthPerBlock","wrapperClasses","classNames","block","index","id","jsx","TrackerBlockItem"],"mappings":";;;;;AAMA,MAAMA,IAA0B,GAC1BC,IAA0B,IAC1BC,IAAoB,GACpBC,IAAuB,IAmGvBC,IAAU,CAACC,MAAwB;AACrC,QAAM;AAAA,IACF,MAAAC;AAAA,IACA,wBAAAC,IAAyB;AAAA,IACzB,aAAAC,IAAc;AAAA,IACd,eAAAC,IAAgBT;AAAA,IAChB,eAAAU,IAAgBT;AAAA,IAChB,UAAAU,IAAWT;AAAA,IACX,aAAAU,IAAcT;AAAA,IACd,yBAAAU,IAA0B;AAAA,IAC1B,wBAAAC,IAAyB;AAAA,IACzB,WAAAC;AAAA,EAAA,IACAV,GACE,CAACW,GAAYC,GAAG,EAAE,YAAAC,EAAA,CAAY,IAAIC,EAAA,GAElCC,IAAuB,KAAK,IAAI,GAAGX,CAAa,GAChDY,IAAuB,KAAK,IAAID,GAAsBV,CAAa,GACnEY,IAAkB,KAAK,IAAI,GAAGX,CAAQ,GACtCY,IAAqB,KAAK,IAAI,GAAGX,CAAW,GAE5C,EAAE,aAAAY,GAAa,YAAAC,EAAA,IAAeC,EAAQ,MAAM;AAC9C,QAAIpB,EAAK,WAAW;AAChB,aAAO,EAAE,aAAaA,GAAM,YAAYe,EAAA;AAG5C,UAAMM,IAAiBT,KAAcZ,EAAK,SAASe,KAAwBf,EAAK,SAAS,KAAKgB,GACxFM,IAAyB,KAAK;AAAA,MAChC;AAAA,MACA,KAAK,OAAOD,IAAiBL,MAAoBF,IAAuBE,EAAgB;AAAA,IAAA,GAEtFO,IAAqBhB,IACrB,KAAK,IAAIP,EAAK,QAAQsB,CAAsB,IAC5CtB,EAAK,QACLkB,IAAcV,IACdR,EAAK,MAAM,CAACuB,CAAkB,IAC9BvB,EAAK,MAAM,GAAGuB,CAAkB,GAGhCC,IADiB,KAAK,IAAI,GAAGH,KAAkBH,EAAY,SAAS,KAAKF,CAAe,IACvDE,EAAY,QAC7CC,IAAa,KAAK,IAAIL,GAAsB,KAAK,IAAIC,GAAsBS,CAAa,CAAC;AAE/F,WAAO,EAAE,aAAAN,GAAa,YAAAC,EAAAA;AAAAA,EAC1B,GAAG;AAAA,IACCnB;AAAA,IACAY;AAAA,IACAE;AAAA,IACAC;AAAA,IACAC;AAAA,IACAT;AAAA,IACAC;AAAA,EAAA,CACH,GAEKiB,IAAiBC,EAAW,WAAWjB,CAAS;AAEtD,2BACK,OAAA,EAAI,KAAKC,GAAY,WAAWe,GAAgB,OAAO,EAAE,KAAK,GAAGT,CAAe,QAC5E,YAAY,IAAI,CAACW,GAAOC,MAAU;AAC/B,UAAMC,IAAKF,EAAM,MAAM,GAAGC,CAAK;AAC/B,WACI,gBAAAE;AAAA,MAACC;AAAAA,MAAA;AAAA,QAEG,IAAAF;AAAA,QACA,OAAAF;AAAA,QACA,wBAAA1B;AAAA,QACA,aAAAC;AAAA,QACA,YAAAiB;AAAA,QACA,aAAaF;AAAA,MAAA;AAAA,MANRY;AAAA,IAAA;AAAA,EASjB,CAAC,EAAA,CACL;AAER;"}
@@ -0,0 +1,11 @@
1
+ import { TrackerBlock as TrackerBlockData } from './Tracker';
2
+ type TrackerBlockProps = {
3
+ id: string;
4
+ block: TrackerBlockData;
5
+ defaultBackgroundColor: string;
6
+ hoverEffect: boolean;
7
+ blockWidth: number;
8
+ blockHeight: number;
9
+ };
10
+ declare const TrackerBlock: (props: TrackerBlockProps) => import("react/jsx-runtime").JSX.Element;
11
+ export default TrackerBlock;
@@ -0,0 +1,34 @@
1
+ import { jsx as c } from "react/jsx-runtime";
2
+ import d from "../../utils/classNames.js";
3
+ import m from "../tooltip/SimpleTooltip.js";
4
+ const u = (n) => {
5
+ const { id: e, block: o, defaultBackgroundColor: a, hoverEffect: s, blockWidth: i, blockHeight: k } = n, t = !!o.onClick, p = d(
6
+ "tracker-block",
7
+ o.color || a,
8
+ s && "tracker-block-hover",
9
+ t && "cursor-pointer",
10
+ o.className
11
+ ), r = /* @__PURE__ */ c(
12
+ "div",
13
+ {
14
+ className: p,
15
+ onClick: () => o.onClick?.(e),
16
+ onKeyDown: (l) => {
17
+ t && (l.key === "Enter" || l.key === " ") && (l.preventDefault(), o.onClick?.(e));
18
+ },
19
+ role: t ? "button" : void 0,
20
+ tabIndex: t ? 0 : void 0,
21
+ "aria-label": typeof o.tooltip == "string" ? o.tooltip : void 0,
22
+ style: {
23
+ width: `${i}px`,
24
+ minWidth: `${i}px`,
25
+ height: `${k}px`
26
+ }
27
+ }
28
+ );
29
+ return o.tooltip ? /* @__PURE__ */ c(m, { content: o.tooltip, allowOnTouch: !0, placement: "top", delay: { show: 100, hide: 50 }, children: r }) : r;
30
+ };
31
+ export {
32
+ u as default
33
+ };
34
+ //# sourceMappingURL=TrackerBlock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TrackerBlock.js","sources":["../../../src/components/tracker/TrackerBlock.tsx"],"sourcesContent":["import classNames from '../../utils/classNames';\nimport SimpleTooltip from '../tooltip/SimpleTooltip';\nimport type { TrackerBlock as TrackerBlockData } from './Tracker';\n\ntype TrackerBlockProps = {\n id: string;\n block: TrackerBlockData;\n defaultBackgroundColor: string;\n hoverEffect: boolean;\n blockWidth: number;\n blockHeight: number;\n};\n\nconst TrackerBlock = (props: TrackerBlockProps) => {\n const { id, block, defaultBackgroundColor, hoverEffect, blockWidth, blockHeight } = props;\n\n const isClickable = Boolean(block.onClick);\n\n const blockClasses = classNames(\n 'tracker-block',\n block.color || defaultBackgroundColor,\n hoverEffect && 'tracker-block-hover',\n isClickable && 'cursor-pointer',\n block.className\n );\n\n const blockElement = (\n <div\n className={blockClasses}\n onClick={() => block.onClick?.(id)}\n onKeyDown={event => {\n if (!isClickable) {\n return;\n }\n\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n block.onClick?.(id);\n }\n }}\n role={isClickable ? 'button' : undefined}\n tabIndex={isClickable ? 0 : undefined}\n aria-label={typeof block.tooltip === 'string' ? block.tooltip : undefined}\n style={{\n width: `${blockWidth}px`,\n minWidth: `${blockWidth}px`,\n height: `${blockHeight}px`,\n }}\n />\n );\n\n if (!block.tooltip) {\n return blockElement;\n }\n\n return (\n <SimpleTooltip content={block.tooltip} allowOnTouch placement='top' delay={{ show: 100, hide: 50 }}>\n {blockElement}\n </SimpleTooltip>\n );\n};\n\nexport default TrackerBlock;\n"],"names":["TrackerBlock","props","id","block","defaultBackgroundColor","hoverEffect","blockWidth","blockHeight","isClickable","blockClasses","classNames","blockElement","jsx","event","SimpleTooltip"],"mappings":";;;AAaA,MAAMA,IAAe,CAACC,MAA6B;AAC/C,QAAM,EAAE,IAAAC,GAAI,OAAAC,GAAO,wBAAAC,GAAwB,aAAAC,GAAa,YAAAC,GAAY,aAAAC,MAAgBN,GAE9EO,IAAc,EAAQL,EAAM,SAE5BM,IAAeC;AAAA,IACjB;AAAA,IACAP,EAAM,SAASC;AAAA,IACfC,KAAe;AAAA,IACfG,KAAe;AAAA,IACfL,EAAM;AAAA,EAAA,GAGJQ,IACF,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,WAAWH;AAAA,MACX,SAAS,MAAMN,EAAM,UAAUD,CAAE;AAAA,MACjC,WAAW,CAAAW,MAAS;AAChB,QAAKL,MAIDK,EAAM,QAAQ,WAAWA,EAAM,QAAQ,SACvCA,EAAM,eAAA,GACNV,EAAM,UAAUD,CAAE;AAAA,MAE1B;AAAA,MACA,MAAMM,IAAc,WAAW;AAAA,MAC/B,UAAUA,IAAc,IAAI;AAAA,MAC5B,cAAY,OAAOL,EAAM,WAAY,WAAWA,EAAM,UAAU;AAAA,MAChE,OAAO;AAAA,QACH,OAAO,GAAGG,CAAU;AAAA,QACpB,UAAU,GAAGA,CAAU;AAAA,QACvB,QAAQ,GAAGC,CAAW;AAAA,MAAA;AAAA,IAC1B;AAAA,EAAA;AAIR,SAAKJ,EAAM,4BAKNW,GAAA,EAAc,SAASX,EAAM,SAAS,cAAY,IAAC,WAAU,OAAM,OAAO,EAAE,MAAM,KAAK,MAAM,MACzF,UAAAQ,GACL,IANOA;AAQf;"}
@@ -1,5 +1,5 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
- import _ from "classnames";
2
+ import _ from "../../utils/classNames.js";
3
3
  const n = "4by3", l = "16by9", o = (r) => {
4
4
  const { src: a, className: s = "", allowFullScreen: t = !0, aspectRatio: c = "16by9" } = r, i = _("video-responsive", `video-responsive-${c}`, s && s);
5
5
  return /* @__PURE__ */ e("div", { className: i, children: /* @__PURE__ */ e("iframe", { src: a, allowFullScreen: t }) });
@@ -1 +1 @@
1
- {"version":3,"file":"ResponsiveVideo.js","sources":["../../../src/components/video/ResponsiveVideo.tsx"],"sourcesContent":["import classNames from 'classnames';\n\nconst FOUR_BY_THREE = '4by3';\nconst SIXTEEN_BY_NINE = '16by9';\n\nexport type AspectRatio = typeof FOUR_BY_THREE | typeof SIXTEEN_BY_NINE;\n\nexport type ResponsiveVideoProps = {\n /**\n * The link to the source of the video file.\n */\n src: string;\n\n /**\n * Defined the aspect ratio of the video.\n *\n * Possible values are:\n *\n * - `ResponsiveVideo.ASPECT_RATIO_4_BY_3`\n * - `ResponsiveVideo.ASPECT_RATIO_16_BY_9`\n * - `'4by3'`\n * - `'16by9'`\n *\n * @default '16by9'\n */\n aspectRatio: '4by3' | '16by9';\n\n /**\n * Allows the fullscreen feature of the underlying embedded iframe.\n *\n * @default true\n */\n allowFullScreen?: boolean;\n\n /**\n * Additional classes added to the wrapping element.\n */\n className?: string;\n};\n\nconst ResponsiveVideo = (props: ResponsiveVideoProps) => {\n const { src, className = '', allowFullScreen = true, aspectRatio = '16by9' } = props;\n\n const wrapperClassName = classNames('video-responsive', `video-responsive-${aspectRatio}`, className && className);\n\n return (\n <div className={wrapperClassName}>\n <iframe src={src} allowFullScreen={allowFullScreen} />\n </div>\n );\n};\n\nResponsiveVideo.ASPECT_RATIO_4_BY_3 = FOUR_BY_THREE as typeof FOUR_BY_THREE;\nResponsiveVideo.ASPECT_RATIO_16_BY_9 = SIXTEEN_BY_NINE as typeof SIXTEEN_BY_NINE;\n\nexport default ResponsiveVideo;\n"],"names":["FOUR_BY_THREE","SIXTEEN_BY_NINE","ResponsiveVideo","props","src","className","allowFullScreen","aspectRatio","wrapperClassName","classNames","jsx"],"mappings":";;AAEA,MAAMA,IAAgB,QAChBC,IAAkB,SAqClBC,IAAkB,CAACC,MAAgC;AACrD,QAAM,EAAE,KAAAC,GAAK,WAAAC,IAAY,IAAI,iBAAAC,IAAkB,IAAM,aAAAC,IAAc,YAAYJ,GAEzEK,IAAmBC,EAAW,oBAAoB,oBAAoBF,CAAW,IAAIF,KAAaA,CAAS;AAEjH,SACI,gBAAAK,EAAC,SAAI,WAAWF,GACZ,4BAAC,UAAA,EAAO,KAAAJ,GAAU,iBAAAE,GAAkC,EAAA,CACxD;AAER;AAEAJ,EAAgB,sBAAsBF;AACtCE,EAAgB,uBAAuBD;"}
1
+ {"version":3,"file":"ResponsiveVideo.js","sources":["../../../src/components/video/ResponsiveVideo.tsx"],"sourcesContent":["import classNames from '../../utils/classNames';\n\nconst FOUR_BY_THREE = '4by3';\nconst SIXTEEN_BY_NINE = '16by9';\n\nexport type AspectRatio = typeof FOUR_BY_THREE | typeof SIXTEEN_BY_NINE;\n\nexport type ResponsiveVideoProps = {\n /**\n * The link to the source of the video file.\n */\n src: string;\n\n /**\n * Defined the aspect ratio of the video.\n *\n * Possible values are:\n *\n * - `ResponsiveVideo.ASPECT_RATIO_4_BY_3`\n * - `ResponsiveVideo.ASPECT_RATIO_16_BY_9`\n * - `'4by3'`\n * - `'16by9'`\n *\n * @default '16by9'\n */\n aspectRatio: '4by3' | '16by9';\n\n /**\n * Allows the fullscreen feature of the underlying embedded iframe.\n *\n * @default true\n */\n allowFullScreen?: boolean;\n\n /**\n * Additional classes added to the wrapping element.\n */\n className?: string;\n};\n\nconst ResponsiveVideo = (props: ResponsiveVideoProps) => {\n const { src, className = '', allowFullScreen = true, aspectRatio = '16by9' } = props;\n\n const wrapperClassName = classNames('video-responsive', `video-responsive-${aspectRatio}`, className && className);\n\n return (\n <div className={wrapperClassName}>\n <iframe src={src} allowFullScreen={allowFullScreen} />\n </div>\n );\n};\n\nResponsiveVideo.ASPECT_RATIO_4_BY_3 = FOUR_BY_THREE as typeof FOUR_BY_THREE;\nResponsiveVideo.ASPECT_RATIO_16_BY_9 = SIXTEEN_BY_NINE as typeof SIXTEEN_BY_NINE;\n\nexport default ResponsiveVideo;\n"],"names":["FOUR_BY_THREE","SIXTEEN_BY_NINE","ResponsiveVideo","props","src","className","allowFullScreen","aspectRatio","wrapperClassName","classNames","jsx"],"mappings":";;AAEA,MAAMA,IAAgB,QAChBC,IAAkB,SAqClBC,IAAkB,CAACC,MAAgC;AACrD,QAAM,EAAE,KAAAC,GAAK,WAAAC,IAAY,IAAI,iBAAAC,IAAkB,IAAM,aAAAC,IAAc,YAAYJ,GAEzEK,IAAmBC,EAAW,oBAAoB,oBAAoBF,CAAW,IAAIF,KAAaA,CAAS;AAEjH,SACI,gBAAAK,EAAC,SAAI,WAAWF,GACZ,4BAAC,UAAA,EAAO,KAAAJ,GAAU,iBAAAE,GAAkC,EAAA,CACxD;AAER;AAEAJ,EAAgB,sBAAsBF;AACtCE,EAAgB,uBAAuBD;"}
@@ -0,0 +1,79 @@
1
+ export type CookieSameSite = 'Strict' | 'Lax' | 'None';
2
+ export type CookieOptions = {
3
+ /**
4
+ * Cookie path scope.
5
+ *
6
+ * @default '/'
7
+ */
8
+ path?: string;
9
+ /**
10
+ * Cookie domain scope (for example `.rio.cloud`).
11
+ */
12
+ domain?: string;
13
+ /**
14
+ * Absolute expiration date for the cookie.
15
+ */
16
+ expires?: Date | string;
17
+ /**
18
+ * Cookie lifetime in seconds.
19
+ */
20
+ maxAge?: number;
21
+ /**
22
+ * Cross-site cookie behavior.
23
+ *
24
+ * Possible values are:
25
+ *
26
+ * - `Strict`
27
+ * - `Lax`
28
+ * - `None`
29
+ */
30
+ sameSite?: CookieSameSite;
31
+ /**
32
+ * Adds the `Secure` flag so the cookie is sent over HTTPS only.
33
+ */
34
+ secure?: boolean;
35
+ };
36
+ export type UseCookiesResult = {
37
+ /**
38
+ * Sets a cookie with optional metadata.
39
+ *
40
+ * @param name - Cookie name.
41
+ * @param value - Cookie value.
42
+ * @param options - Additional cookie options.
43
+ */
44
+ setCookie: (name: string, value: string, options?: CookieOptions) => void;
45
+ /**
46
+ * Deletes a cookie by name.
47
+ *
48
+ * @param name - Cookie name.
49
+ * @param options - Optional path/domain to target the correct cookie scope.
50
+ */
51
+ deleteCookie: (name: string, options?: Pick<CookieOptions, 'path' | 'domain'>) => void;
52
+ /**
53
+ * Returns true if the cookie exists.
54
+ *
55
+ * @param name - Cookie name.
56
+ */
57
+ hasCookie: (name: string) => boolean;
58
+ /**
59
+ * Reads a cookie value.
60
+ *
61
+ * @param name - Cookie name.
62
+ */
63
+ getCookie: (name: string) => string | undefined;
64
+ };
65
+ /**
66
+ * Returns helpers to set, delete, and read browser cookies.
67
+ *
68
+ * @returns {UseCookiesResult} Cookie helper functions.
69
+ *
70
+ * @example
71
+ * const { setCookie, deleteCookie, hasCookie, getCookie } = useCookies();
72
+ *
73
+ * setCookie('token', 'abc123', { path: '/', maxAge: 60 * 60 });
74
+ * const isLoggedIn = hasCookie('token');
75
+ * const token = getCookie('token');
76
+ * deleteCookie('token');
77
+ */
78
+ declare const useCookies: () => UseCookiesResult;
79
+ export default useCookies;
@@ -0,0 +1,33 @@
1
+ import { useCallback as a } from "react";
2
+ const u = () => typeof document > "u" ? {} : document.cookie.split(";").map((n) => n.trim()).filter(Boolean).reduce(
3
+ (n, o) => {
4
+ const s = o.indexOf("="), i = s >= 0 ? o.slice(0, s) : o, t = s >= 0 ? o.slice(s + 1) : "";
5
+ return n[decodeURIComponent(i)] = decodeURIComponent(t), n;
6
+ },
7
+ {}
8
+ ), f = () => {
9
+ const n = a((t, c, e = {}) => {
10
+ if (typeof document > "u")
11
+ return;
12
+ const r = [`${encodeURIComponent(t)}=${encodeURIComponent(c)}`, `path=${e.path ?? "/"}`];
13
+ if (e.domain && r.push(`domain=${e.domain}`), e.expires) {
14
+ const m = e.expires instanceof Date ? e.expires.toUTCString() : e.expires;
15
+ r.push(`expires=${m}`);
16
+ }
17
+ typeof e.maxAge == "number" && r.push(`max-age=${e.maxAge}`), e.sameSite && r.push(`samesite=${e.sameSite}`), e.secure && r.push("secure"), document.cookie = r.join("; ");
18
+ }, []), o = a(
19
+ (t, c = {}) => {
20
+ n(t, "", {
21
+ ...c,
22
+ expires: /* @__PURE__ */ new Date(0),
23
+ maxAge: 0
24
+ });
25
+ },
26
+ [n]
27
+ ), s = a((t) => Object.hasOwn(u(), t), []), i = a((t) => u()[t], []);
28
+ return { setCookie: n, deleteCookie: o, hasCookie: s, getCookie: i };
29
+ };
30
+ export {
31
+ f as default
32
+ };
33
+ //# sourceMappingURL=useCookies.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCookies.js","sources":["../../src/hooks/useCookies.ts"],"sourcesContent":["import { useCallback } from 'react';\n\nexport type CookieSameSite = 'Strict' | 'Lax' | 'None';\n\nexport type CookieOptions = {\n /**\n * Cookie path scope.\n *\n * @default '/'\n */\n path?: string;\n\n /**\n * Cookie domain scope (for example `.rio.cloud`).\n */\n domain?: string;\n\n /**\n * Absolute expiration date for the cookie.\n */\n expires?: Date | string;\n\n /**\n * Cookie lifetime in seconds.\n */\n maxAge?: number;\n\n /**\n * Cross-site cookie behavior.\n *\n * Possible values are:\n *\n * - `Strict`\n * - `Lax`\n * - `None`\n */\n sameSite?: CookieSameSite;\n\n /**\n * Adds the `Secure` flag so the cookie is sent over HTTPS only.\n */\n secure?: boolean;\n};\n\nexport type UseCookiesResult = {\n /**\n * Sets a cookie with optional metadata.\n *\n * @param name - Cookie name.\n * @param value - Cookie value.\n * @param options - Additional cookie options.\n */\n setCookie: (name: string, value: string, options?: CookieOptions) => void;\n\n /**\n * Deletes a cookie by name.\n *\n * @param name - Cookie name.\n * @param options - Optional path/domain to target the correct cookie scope.\n */\n deleteCookie: (name: string, options?: Pick<CookieOptions, 'path' | 'domain'>) => void;\n\n /**\n * Returns true if the cookie exists.\n *\n * @param name - Cookie name.\n */\n hasCookie: (name: string) => boolean;\n\n /**\n * Reads a cookie value.\n *\n * @param name - Cookie name.\n */\n getCookie: (name: string) => string | undefined;\n};\n\nconst parseCookies = (): Record<string, string> => {\n if (typeof document === 'undefined') {\n return {};\n }\n\n return document.cookie\n .split(';')\n .map(entry => entry.trim())\n .filter(Boolean)\n .reduce(\n (acc, entry) => {\n const separatorIndex = entry.indexOf('=');\n const rawName = separatorIndex >= 0 ? entry.slice(0, separatorIndex) : entry;\n const rawValue = separatorIndex >= 0 ? entry.slice(separatorIndex + 1) : '';\n\n acc[decodeURIComponent(rawName)] = decodeURIComponent(rawValue);\n return acc;\n },\n {} as Record<string, string>\n );\n};\n\n/**\n * Returns helpers to set, delete, and read browser cookies.\n *\n * @returns {UseCookiesResult} Cookie helper functions.\n *\n * @example\n * const { setCookie, deleteCookie, hasCookie, getCookie } = useCookies();\n *\n * setCookie('token', 'abc123', { path: '/', maxAge: 60 * 60 });\n * const isLoggedIn = hasCookie('token');\n * const token = getCookie('token');\n * deleteCookie('token');\n */\nconst useCookies = (): UseCookiesResult => {\n const setCookie = useCallback((name: string, value: string, options: CookieOptions = {}) => {\n if (typeof document === 'undefined') {\n return;\n }\n\n const segments = [`${encodeURIComponent(name)}=${encodeURIComponent(value)}`, `path=${options.path ?? '/'}`];\n\n if (options.domain) {\n segments.push(`domain=${options.domain}`);\n }\n\n if (options.expires) {\n const expires = options.expires instanceof Date ? options.expires.toUTCString() : options.expires;\n segments.push(`expires=${expires}`);\n }\n\n if (typeof options.maxAge === 'number') {\n segments.push(`max-age=${options.maxAge}`);\n }\n\n if (options.sameSite) {\n segments.push(`samesite=${options.sameSite}`);\n }\n\n if (options.secure) {\n segments.push('secure');\n }\n\n // biome-ignore lint/suspicious/noDocumentCookie: this hook intentionally manages cookies through the browser cookie API.\n document.cookie = segments.join('; ');\n }, []);\n\n const deleteCookie = useCallback(\n (name: string, options: Pick<CookieOptions, 'path' | 'domain'> = {}) => {\n setCookie(name, '', {\n ...options,\n expires: new Date(0),\n maxAge: 0,\n });\n },\n [setCookie]\n );\n\n const hasCookie = useCallback((name: string) => {\n return Object.hasOwn(parseCookies(), name);\n }, []);\n\n const getCookie = useCallback((name: string) => {\n return parseCookies()[name];\n }, []);\n\n return { setCookie, deleteCookie, hasCookie, getCookie };\n};\n\nexport default useCookies;\n"],"names":["parseCookies","entry","acc","separatorIndex","rawName","rawValue","useCookies","setCookie","useCallback","name","value","options","segments","expires","deleteCookie","hasCookie","getCookie"],"mappings":";AA6EA,MAAMA,IAAe,MACb,OAAO,WAAa,MACb,CAAA,IAGJ,SAAS,OACX,MAAM,GAAG,EACT,IAAI,CAAAC,MAASA,EAAM,KAAA,CAAM,EACzB,OAAO,OAAO,EACd;AAAA,EACG,CAACC,GAAKD,MAAU;AACZ,UAAME,IAAiBF,EAAM,QAAQ,GAAG,GAClCG,IAAUD,KAAkB,IAAIF,EAAM,MAAM,GAAGE,CAAc,IAAIF,GACjEI,IAAWF,KAAkB,IAAIF,EAAM,MAAME,IAAiB,CAAC,IAAI;AAEzE,WAAAD,EAAI,mBAAmBE,CAAO,CAAC,IAAI,mBAAmBC,CAAQ,GACvDH;AAAA,EACX;AAAA,EACA,CAAA;AAAC,GAiBPI,IAAa,MAAwB;AACvC,QAAMC,IAAYC,EAAY,CAACC,GAAcC,GAAeC,IAAyB,OAAO;AACxF,QAAI,OAAO,WAAa;AACpB;AAGJ,UAAMC,IAAW,CAAC,GAAG,mBAAmBH,CAAI,CAAC,IAAI,mBAAmBC,CAAK,CAAC,IAAI,QAAQC,EAAQ,QAAQ,GAAG,EAAE;AAM3G,QAJIA,EAAQ,UACRC,EAAS,KAAK,UAAUD,EAAQ,MAAM,EAAE,GAGxCA,EAAQ,SAAS;AACjB,YAAME,IAAUF,EAAQ,mBAAmB,OAAOA,EAAQ,QAAQ,gBAAgBA,EAAQ;AAC1F,MAAAC,EAAS,KAAK,WAAWC,CAAO,EAAE;AAAA,IACtC;AAEA,IAAI,OAAOF,EAAQ,UAAW,YAC1BC,EAAS,KAAK,WAAWD,EAAQ,MAAM,EAAE,GAGzCA,EAAQ,YACRC,EAAS,KAAK,YAAYD,EAAQ,QAAQ,EAAE,GAG5CA,EAAQ,UACRC,EAAS,KAAK,QAAQ,GAI1B,SAAS,SAASA,EAAS,KAAK,IAAI;AAAA,EACxC,GAAG,CAAA,CAAE,GAECE,IAAeN;AAAA,IACjB,CAACC,GAAcE,IAAkD,OAAO;AACpE,MAAAJ,EAAUE,GAAM,IAAI;AAAA,QAChB,GAAGE;AAAA,QACH,SAAS,oBAAI,KAAK,CAAC;AAAA,QACnB,QAAQ;AAAA,MAAA,CACX;AAAA,IACL;AAAA,IACA,CAACJ,CAAS;AAAA,EAAA,GAGRQ,IAAYP,EAAY,CAACC,MACpB,OAAO,OAAOT,EAAA,GAAgBS,CAAI,GAC1C,CAAA,CAAE,GAECO,IAAYR,EAAY,CAACC,MACpBT,EAAA,EAAeS,CAAI,GAC3B,CAAA,CAAE;AAEL,SAAO,EAAE,WAAAF,GAAW,cAAAO,GAAc,WAAAC,GAAW,WAAAC,EAAA;AACjD;"}
@@ -1,12 +1,12 @@
1
- import { useRef as u, useEffect as o } from "react";
1
+ import { useRef as u, useEffect as s } from "react";
2
2
  const f = (e, r) => {
3
3
  const t = u(null), n = u(e);
4
- return o(() => {
4
+ return s(() => {
5
5
  n.current = e;
6
- }, [e]), o(() => {
7
- const s = () => n.current();
6
+ }, [e]), s(() => {
7
+ const o = () => n.current();
8
8
  if (typeof r == "number")
9
- return t.current = window.setInterval(s, r), () => window.clearInterval(t.current ?? void 0);
9
+ return t.current = setInterval(o, r), () => clearInterval(t.current ?? void 0);
10
10
  }, [r]), t;
11
11
  };
12
12
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"useInterval.js","sources":["../../src/hooks/useInterval.ts"],"sourcesContent":["import { useEffect, useRef } from 'react';\n\n// See https://overreacted.io/making-setinterval-declarative-with-react-hooks/\n\n/**\n * Custom hook to execute a callback function at specified intervals.\n *\n * @param callback - The callback function to be executed.\n * @param delay - The interval duration in milliseconds. Set to null to stop the interval.\n *\n * @returns A mutable ref object that holds the interval ID.\n */\nconst useInterval = (callback: () => void, delay: number | null): React.MutableRefObject<number | null> => {\n const intervalRef = useRef<number | null>(null);\n const savedCallback = useRef<() => void>(callback);\n\n useEffect(() => {\n savedCallback.current = callback;\n }, [callback]);\n\n useEffect(() => {\n const tick = () => savedCallback.current();\n\n if (typeof delay === 'number') {\n intervalRef.current = window.setInterval(tick, delay);\n return () => window.clearInterval(intervalRef.current ?? undefined);\n }\n }, [delay]);\n\n return intervalRef;\n};\n\nexport default useInterval;\n"],"names":["useInterval","callback","delay","intervalRef","useRef","savedCallback","useEffect","tick"],"mappings":";AAYA,MAAMA,IAAc,CAACC,GAAsBC,MAAgE;AACvG,QAAMC,IAAcC,EAAsB,IAAI,GACxCC,IAAgBD,EAAmBH,CAAQ;AAEjD,SAAAK,EAAU,MAAM;AACZ,IAAAD,EAAc,UAAUJ;AAAA,EAC5B,GAAG,CAACA,CAAQ,CAAC,GAEbK,EAAU,MAAM;AACZ,UAAMC,IAAO,MAAMF,EAAc,QAAA;AAEjC,QAAI,OAAOH,KAAU;AACjB,aAAAC,EAAY,UAAU,OAAO,YAAYI,GAAML,CAAK,GAC7C,MAAM,OAAO,cAAcC,EAAY,WAAW,MAAS;AAAA,EAE1E,GAAG,CAACD,CAAK,CAAC,GAEHC;AACX;"}
1
+ {"version":3,"file":"useInterval.js","sources":["../../src/hooks/useInterval.ts"],"sourcesContent":["import { useEffect, useRef } from 'react';\n\n// See https://overreacted.io/making-setinterval-declarative-with-react-hooks/\n\n/**\n * Custom hook to execute a callback function at specified intervals.\n *\n * @param callback - The callback function to be executed.\n * @param delay - The interval duration in milliseconds. Set to null to stop the interval.\n *\n * @returns A mutable ref object that holds the interval ID.\n */\nconst useInterval = (callback: () => void, delay: number | null): React.MutableRefObject<number | null> => {\n const intervalRef = useRef<number | null>(null);\n const savedCallback = useRef<() => void>(callback);\n\n useEffect(() => {\n savedCallback.current = callback;\n }, [callback]);\n\n useEffect(() => {\n const tick = () => savedCallback.current();\n\n if (typeof delay === 'number') {\n intervalRef.current = setInterval(tick, delay) as unknown as number;\n return () => clearInterval(intervalRef.current ?? undefined);\n }\n }, [delay]);\n\n return intervalRef;\n};\n\nexport default useInterval;\n"],"names":["useInterval","callback","delay","intervalRef","useRef","savedCallback","useEffect","tick"],"mappings":";AAYA,MAAMA,IAAc,CAACC,GAAsBC,MAAgE;AACvG,QAAMC,IAAcC,EAAsB,IAAI,GACxCC,IAAgBD,EAAmBH,CAAQ;AAEjD,SAAAK,EAAU,MAAM;AACZ,IAAAD,EAAc,UAAUJ;AAAA,EAC5B,GAAG,CAACA,CAAQ,CAAC,GAEbK,EAAU,MAAM;AACZ,UAAMC,IAAO,MAAMF,EAAc,QAAA;AAEjC,QAAI,OAAOH,KAAU;AACjB,aAAAC,EAAY,UAAU,YAAYI,GAAML,CAAK,GACtC,MAAM,cAAcC,EAAY,WAAW,MAAS;AAAA,EAEnE,GAAG,CAACD,CAAK,CAAC,GAEHC;AACX;"}
@@ -1,5 +1,5 @@
1
1
  import { useRef as a, useState as E, useEffect as I } from "react";
2
- const F = ({
2
+ const L = ({
3
3
  ref: d,
4
4
  onFocusWithin: u = () => {
5
5
  },
@@ -17,7 +17,7 @@ const F = ({
17
17
  const f = () => {
18
18
  s(), r || (i(!0), u());
19
19
  }, l = (v) => {
20
- s(), t.current = window.setTimeout(() => {
20
+ s(), t.current = setTimeout(() => {
21
21
  e.contains(v.relatedTarget) || (i(!1), o()), t.current = null;
22
22
  }, c);
23
23
  };
@@ -30,6 +30,6 @@ const F = ({
30
30
  };
31
31
  };
32
32
  export {
33
- F as default
33
+ L as default
34
34
  };
35
35
  //# sourceMappingURL=useIsFocusWithin.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useIsFocusWithin.js","sources":["../../src/hooks/useIsFocusWithin.ts"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\n\ntype UseIsFocusWithinOptions<T extends HTMLElement> = {\n /**\n * Optional external ref to the DOM element to track.\n * If not provided, the hook will return its own internal ref.\n */\n ref?: React.RefObject<T>;\n\n /**\n * Optional callback triggered when focus enters the element or its children.\n */\n onFocusWithin?: () => void;\n\n /**\n * Optional callback triggered when focus leaves the element and all its children.\n */\n onBlurWithin?: () => void;\n\n /**\n * Optional delay (in ms) before calling onBlurWithin.\n * Useful when focus might quickly shift between internal elements.\n * @default 0\n */\n delay?: number;\n};\n\n/**\n * React hook that tracks whether focus is currently within a given element or its children.\n * Provides a boolean state and a ref to attach to the tracked element.\n *\n * @param options Hook configuration including external ref, callbacks, and optional delay.\n * @returns An object containing the ref and whether focus is currently within the element.\n */\nconst useIsFocusWithin = <T extends HTMLElement>({\n ref: externalRef,\n onFocusWithin = () => {},\n onBlurWithin = () => {},\n delay = 0,\n}: UseIsFocusWithinOptions<T> = {}) => {\n const internalRef = useRef<T>(null);\n const targetRef = externalRef ?? internalRef;\n\n const [isFocusedWithin, setIsFocusedWithin] = useState(false);\n const timeoutId = useRef<number | null>(null);\n\n const clearTimeoutIfAny = () => {\n if (timeoutId.current !== null) {\n window.clearTimeout(timeoutId.current);\n timeoutId.current = null;\n }\n };\n\n useEffect(() => {\n const node = targetRef.current;\n if (!node) {\n return;\n }\n\n const handleFocusIn = () => {\n clearTimeoutIfAny();\n if (!isFocusedWithin) {\n setIsFocusedWithin(true);\n onFocusWithin();\n }\n };\n\n const handleFocusOut = (e: FocusEvent) => {\n clearTimeoutIfAny();\n timeoutId.current = window.setTimeout(() => {\n if (!node.contains(e.relatedTarget as Node)) {\n setIsFocusedWithin(false);\n onBlurWithin();\n }\n timeoutId.current = null;\n }, delay);\n };\n\n node.addEventListener('focusin', handleFocusIn);\n node.addEventListener('focusout', handleFocusOut);\n\n return () => {\n node.removeEventListener('focusin', handleFocusIn);\n node.removeEventListener('focusout', handleFocusOut);\n clearTimeoutIfAny();\n };\n }, [targetRef, delay, onFocusWithin, onBlurWithin, isFocusedWithin]);\n\n return {\n ref: targetRef,\n isFocusedWithin,\n };\n};\n\nexport default useIsFocusWithin;\n"],"names":["useIsFocusWithin","externalRef","onFocusWithin","onBlurWithin","delay","internalRef","useRef","targetRef","isFocusedWithin","setIsFocusedWithin","useState","timeoutId","clearTimeoutIfAny","useEffect","node","handleFocusIn","handleFocusOut","e"],"mappings":";AAkCA,MAAMA,IAAmB,CAAwB;AAAA,EAC7C,KAAKC;AAAA,EACL,eAAAC,IAAgB,MAAM;AAAA,EAAC;AAAA,EACvB,cAAAC,IAAe,MAAM;AAAA,EAAC;AAAA,EACtB,OAAAC,IAAQ;AACZ,IAAgC,OAAO;AACnC,QAAMC,IAAcC,EAAU,IAAI,GAC5BC,IAAYN,KAAeI,GAE3B,CAACG,GAAiBC,CAAkB,IAAIC,EAAS,EAAK,GACtDC,IAAYL,EAAsB,IAAI,GAEtCM,IAAoB,MAAM;AAC5B,IAAID,EAAU,YAAY,SACtB,OAAO,aAAaA,EAAU,OAAO,GACrCA,EAAU,UAAU;AAAA,EAE5B;AAEA,SAAAE,EAAU,MAAM;AACZ,UAAMC,IAAOP,EAAU;AACvB,QAAI,CAACO;AACD;AAGJ,UAAMC,IAAgB,MAAM;AACxB,MAAAH,EAAA,GACKJ,MACDC,EAAmB,EAAI,GACvBP,EAAA;AAAA,IAER,GAEMc,IAAiB,CAACC,MAAkB;AACtC,MAAAL,EAAA,GACAD,EAAU,UAAU,OAAO,WAAW,MAAM;AACxC,QAAKG,EAAK,SAASG,EAAE,aAAqB,MACtCR,EAAmB,EAAK,GACxBN,EAAA,IAEJQ,EAAU,UAAU;AAAA,MACxB,GAAGP,CAAK;AAAA,IACZ;AAEA,WAAAU,EAAK,iBAAiB,WAAWC,CAAa,GAC9CD,EAAK,iBAAiB,YAAYE,CAAc,GAEzC,MAAM;AACT,MAAAF,EAAK,oBAAoB,WAAWC,CAAa,GACjDD,EAAK,oBAAoB,YAAYE,CAAc,GACnDJ,EAAA;AAAA,IACJ;AAAA,EACJ,GAAG,CAACL,GAAWH,GAAOF,GAAeC,GAAcK,CAAe,CAAC,GAE5D;AAAA,IACH,KAAKD;AAAA,IACL,iBAAAC;AAAA,EAAA;AAER;"}
1
+ {"version":3,"file":"useIsFocusWithin.js","sources":["../../src/hooks/useIsFocusWithin.ts"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\n\ntype UseIsFocusWithinOptions<T extends HTMLElement> = {\n /**\n * Optional external ref to the DOM element to track.\n * If not provided, the hook will return its own internal ref.\n */\n ref?: React.RefObject<T>;\n\n /**\n * Optional callback triggered when focus enters the element or its children.\n */\n onFocusWithin?: () => void;\n\n /**\n * Optional callback triggered when focus leaves the element and all its children.\n */\n onBlurWithin?: () => void;\n\n /**\n * Optional delay (in ms) before calling onBlurWithin.\n * Useful when focus might quickly shift between internal elements.\n * @default 0\n */\n delay?: number;\n};\n\n/**\n * React hook that tracks whether focus is currently within a given element or its children.\n * Provides a boolean state and a ref to attach to the tracked element.\n *\n * @param options Hook configuration including external ref, callbacks, and optional delay.\n * @returns An object containing the ref and whether focus is currently within the element.\n */\nconst useIsFocusWithin = <T extends HTMLElement>({\n ref: externalRef,\n onFocusWithin = () => {},\n onBlurWithin = () => {},\n delay = 0,\n}: UseIsFocusWithinOptions<T> = {}) => {\n const internalRef = useRef<T>(null);\n const targetRef = externalRef ?? internalRef;\n\n const [isFocusedWithin, setIsFocusedWithin] = useState(false);\n const timeoutId = useRef<number | null>(null);\n\n const clearTimeoutIfAny = () => {\n if (timeoutId.current !== null) {\n window.clearTimeout(timeoutId.current);\n timeoutId.current = null;\n }\n };\n\n useEffect(() => {\n const node = targetRef.current;\n if (!node) {\n return;\n }\n\n const handleFocusIn = () => {\n clearTimeoutIfAny();\n if (!isFocusedWithin) {\n setIsFocusedWithin(true);\n onFocusWithin();\n }\n };\n\n const handleFocusOut = (e: FocusEvent) => {\n clearTimeoutIfAny();\n timeoutId.current = setTimeout(() => {\n if (!node.contains(e.relatedTarget as Node)) {\n setIsFocusedWithin(false);\n onBlurWithin();\n }\n timeoutId.current = null;\n }, delay) as unknown as number;\n };\n\n node.addEventListener('focusin', handleFocusIn);\n node.addEventListener('focusout', handleFocusOut);\n\n return () => {\n node.removeEventListener('focusin', handleFocusIn);\n node.removeEventListener('focusout', handleFocusOut);\n clearTimeoutIfAny();\n };\n }, [targetRef, delay, onFocusWithin, onBlurWithin, isFocusedWithin]);\n\n return {\n ref: targetRef,\n isFocusedWithin,\n };\n};\n\nexport default useIsFocusWithin;\n"],"names":["useIsFocusWithin","externalRef","onFocusWithin","onBlurWithin","delay","internalRef","useRef","targetRef","isFocusedWithin","setIsFocusedWithin","useState","timeoutId","clearTimeoutIfAny","useEffect","node","handleFocusIn","handleFocusOut","e"],"mappings":";AAkCA,MAAMA,IAAmB,CAAwB;AAAA,EAC7C,KAAKC;AAAA,EACL,eAAAC,IAAgB,MAAM;AAAA,EAAC;AAAA,EACvB,cAAAC,IAAe,MAAM;AAAA,EAAC;AAAA,EACtB,OAAAC,IAAQ;AACZ,IAAgC,OAAO;AACnC,QAAMC,IAAcC,EAAU,IAAI,GAC5BC,IAAYN,KAAeI,GAE3B,CAACG,GAAiBC,CAAkB,IAAIC,EAAS,EAAK,GACtDC,IAAYL,EAAsB,IAAI,GAEtCM,IAAoB,MAAM;AAC5B,IAAID,EAAU,YAAY,SACtB,OAAO,aAAaA,EAAU,OAAO,GACrCA,EAAU,UAAU;AAAA,EAE5B;AAEA,SAAAE,EAAU,MAAM;AACZ,UAAMC,IAAOP,EAAU;AACvB,QAAI,CAACO;AACD;AAGJ,UAAMC,IAAgB,MAAM;AACxB,MAAAH,EAAA,GACKJ,MACDC,EAAmB,EAAI,GACvBP,EAAA;AAAA,IAER,GAEMc,IAAiB,CAACC,MAAkB;AACtC,MAAAL,EAAA,GACAD,EAAU,UAAU,WAAW,MAAM;AACjC,QAAKG,EAAK,SAASG,EAAE,aAAqB,MACtCR,EAAmB,EAAK,GACxBN,EAAA,IAEJQ,EAAU,UAAU;AAAA,MACxB,GAAGP,CAAK;AAAA,IACZ;AAEA,WAAAU,EAAK,iBAAiB,WAAWC,CAAa,GAC9CD,EAAK,iBAAiB,YAAYE,CAAc,GAEzC,MAAM;AACT,MAAAF,EAAK,oBAAoB,WAAWC,CAAa,GACjDD,EAAK,oBAAoB,YAAYE,CAAc,GACnDJ,EAAA;AAAA,IACJ;AAAA,EACJ,GAAG,CAACL,GAAWH,GAAOF,GAAeC,GAAcK,CAAe,CAAC,GAE5D;AAAA,IACH,KAAKD;AAAA,IACL,iBAAAC;AAAA,EAAA;AAER;"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Keeps a mutable ref in sync with the latest value from the current render.
3
+ *
4
+ * Useful when an effect or callback must always access the newest value
5
+ * without adding that value to a dependency array and re-triggering logic.
6
+ *
7
+ * Common use cases:
8
+ * - Access latest callback props inside long-lived effects/listeners
9
+ * - Avoid stale closures in timers, subscriptions, and event handlers
10
+ *
11
+ * @typeParam TValue - The value type to keep up to date.
12
+ * @param value - Current value from render scope.
13
+ * @returns A ref whose `.current` always points to the latest value.
14
+ */
15
+ declare const useLatest: <TValue>(value: TValue) => React.MutableRefObject<TValue>;
16
+ export default useLatest;
@@ -0,0 +1,11 @@
1
+ import { useRef as r, useEffect as s } from "react";
2
+ const o = (t) => {
3
+ const e = r(t);
4
+ return s(() => {
5
+ e.current = t;
6
+ }, [t]), e;
7
+ };
8
+ export {
9
+ o as default
10
+ };
11
+ //# sourceMappingURL=useLatest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useLatest.js","sources":["../../src/hooks/useLatest.ts"],"sourcesContent":["import { useEffect, useRef } from 'react';\n\n/**\n * Keeps a mutable ref in sync with the latest value from the current render.\n *\n * Useful when an effect or callback must always access the newest value\n * without adding that value to a dependency array and re-triggering logic.\n *\n * Common use cases:\n * - Access latest callback props inside long-lived effects/listeners\n * - Avoid stale closures in timers, subscriptions, and event handlers\n *\n * @typeParam TValue - The value type to keep up to date.\n * @param value - Current value from render scope.\n * @returns A ref whose `.current` always points to the latest value.\n */\nconst useLatest = <TValue>(value: TValue): React.MutableRefObject<TValue> => {\n const ref = useRef(value);\n\n useEffect(() => {\n ref.current = value;\n }, [value]);\n\n return ref;\n};\n\nexport default useLatest;\n"],"names":["useLatest","value","ref","useRef","useEffect"],"mappings":";AAgBA,MAAMA,IAAY,CAASC,MAAkD;AACzE,QAAMC,IAAMC,EAAOF,CAAK;AAExB,SAAAG,EAAU,MAAM;AACZ,IAAAF,EAAI,UAAUD;AAAA,EAClB,GAAG,CAACA,CAAK,CAAC,GAEHC;AACX;"}
@@ -23,7 +23,8 @@ export type RemoteAction = {
23
23
  *
24
24
  * @param messagePrefix a custom prefix to limit the event listener for these events
25
25
  * @param onReceiveMessage a callback function triggered when a message is received
26
- * @returns
26
+ * @deprecated Please use the {@link import('./useIncomingPostMessages')#default useIncomingPostMessages} and/or
27
+ * {@link import('./usePostMessageSender')#default usePostMessageSender} hooks instead.
27
28
  */
28
29
  declare const usePostMessage: (messagePrefix: string, onReceiveMessage?: (eventData: any) => void) => {
29
30
  sendMessageToParent: (message: RemoteAction) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"usePostMessage.js","sources":["../../src/hooks/usePostMessage.ts"],"sourcesContent":["import { useEffect } from 'react';\nimport { isEmpty, noop } from 'es-toolkit/compat';\n\nexport type RemoteAction = {\n /**\n * The RemoteAction is inspired by a plain redux action where the type is the\n * action identifier.\n *\n * @example\n *\n * ```json\n * {\n * \"type\": \"EVENT_SET_VISIBLE_WIDGETS\",\n * \"payload\": [\"foo\", \"bar\"],\n * }\n * ```\n */\n type: string;\n\n /**\n * The action payload itself.\n */\n payload: any;\n};\n\n/**\n * A custom hook to ease the exchange of postMessage events between iframes and the parent window.\n *\n * @param messagePrefix a custom prefix to limit the event listener for these events\n * @param onReceiveMessage a callback function triggered when a message is received\n * @returns\n */\nconst usePostMessage = (messagePrefix: string, onReceiveMessage?: (eventData: any) => void) => {\n const sendMessageToParent = (message: RemoteAction) => {\n const referrer = document.referrer;\n if (referrer) {\n window.parent.postMessage(message, referrer);\n }\n };\n\n const sendMessageToWidget = (message: RemoteAction, targetFrames: HTMLIFrameElement | HTMLIFrameElement[]) => {\n if (!targetFrames || isEmpty(targetFrames)) {\n return;\n }\n\n const frames = Array.isArray(targetFrames) ? [...targetFrames] : [targetFrames];\n\n [...frames].forEach(target => {\n const contentWindow = target.contentWindow;\n if (contentWindow) {\n contentWindow.postMessage(message, '*');\n }\n });\n };\n\n const receiveMessage = (event: MessageEvent, callback: (eventData: any) => void) => {\n const actionType = event.data.type;\n if (!actionType) {\n return;\n }\n\n if (actionType.startsWith(messagePrefix)) {\n callback(event.data);\n }\n };\n\n useEffect(() => {\n const listenerCallback = (event: MessageEvent) => receiveMessage(event, onReceiveMessage || noop);\n window.addEventListener('message', listenerCallback, false);\n return () => window.removeEventListener('message', listenerCallback, false);\n }, []);\n\n return {\n sendMessageToParent,\n sendMessageToWidget,\n };\n};\n\nexport default usePostMessage;\n"],"names":["usePostMessage","messagePrefix","onReceiveMessage","sendMessageToParent","message","referrer","sendMessageToWidget","targetFrames","isEmpty","target","contentWindow","receiveMessage","event","callback","actionType","useEffect","listenerCallback","noop"],"mappings":";;AAgCA,MAAMA,IAAiB,CAACC,GAAuBC,MAAgD;AAC3F,QAAMC,IAAsB,CAACC,MAA0B;AACnD,UAAMC,IAAW,SAAS;AAC1B,IAAIA,KACA,OAAO,OAAO,YAAYD,GAASC,CAAQ;AAAA,EAEnD,GAEMC,IAAsB,CAACF,GAAuBG,MAA0D;AAC1G,QAAI,CAACA,KAAgBC,EAAQD,CAAY;AACrC;AAKJ,KAAC,GAFc,MAAM,QAAQA,CAAY,IAAI,CAAC,GAAGA,CAAY,IAAI,CAACA,CAAY,CAEpE,EAAE,QAAQ,CAAAE,MAAU;AAC1B,YAAMC,IAAgBD,EAAO;AAC7B,MAAIC,KACAA,EAAc,YAAYN,GAAS,GAAG;AAAA,IAE9C,CAAC;AAAA,EACL,GAEMO,IAAiB,CAACC,GAAqBC,MAAuC;AAChF,UAAMC,IAAaF,EAAM,KAAK;AAC9B,IAAKE,KAIDA,EAAW,WAAWb,CAAa,KACnCY,EAASD,EAAM,IAAI;AAAA,EAE3B;AAEA,SAAAG,EAAU,MAAM;AACZ,UAAMC,IAAmB,CAACJ,MAAwBD,EAAeC,GAAOV,KAAoBe,CAAI;AAChG,kBAAO,iBAAiB,WAAWD,GAAkB,EAAK,GACnD,MAAM,OAAO,oBAAoB,WAAWA,GAAkB,EAAK;AAAA,EAC9E,GAAG,CAAA,CAAE,GAEE;AAAA,IACH,qBAAAb;AAAA,IACA,qBAAAG;AAAA,EAAA;AAER;"}
1
+ {"version":3,"file":"usePostMessage.js","sources":["../../src/hooks/usePostMessage.ts"],"sourcesContent":["import { useEffect } from 'react';\nimport { isEmpty, noop } from 'es-toolkit/compat';\n\nexport type RemoteAction = {\n /**\n * The RemoteAction is inspired by a plain redux action where the type is the\n * action identifier.\n *\n * @example\n *\n * ```json\n * {\n * \"type\": \"EVENT_SET_VISIBLE_WIDGETS\",\n * \"payload\": [\"foo\", \"bar\"],\n * }\n * ```\n */\n type: string;\n\n /**\n * The action payload itself.\n */\n payload: any;\n};\n\n/**\n * A custom hook to ease the exchange of postMessage events between iframes and the parent window.\n *\n * @param messagePrefix a custom prefix to limit the event listener for these events\n * @param onReceiveMessage a callback function triggered when a message is received\n * @deprecated Please use the {@link import('./useIncomingPostMessages')#default useIncomingPostMessages} and/or\n * {@link import('./usePostMessageSender')#default usePostMessageSender} hooks instead.\n */\nconst usePostMessage = (messagePrefix: string, onReceiveMessage?: (eventData: any) => void) => {\n const sendMessageToParent = (message: RemoteAction) => {\n const referrer = document.referrer;\n if (referrer) {\n window.parent.postMessage(message, referrer);\n }\n };\n\n const sendMessageToWidget = (message: RemoteAction, targetFrames: HTMLIFrameElement | HTMLIFrameElement[]) => {\n if (!targetFrames || isEmpty(targetFrames)) {\n return;\n }\n\n const frames = Array.isArray(targetFrames) ? [...targetFrames] : [targetFrames];\n\n [...frames].forEach(target => {\n const contentWindow = target.contentWindow;\n if (contentWindow) {\n contentWindow.postMessage(message, '*');\n }\n });\n };\n\n const receiveMessage = (event: MessageEvent, callback: (eventData: any) => void) => {\n const actionType = event.data.type;\n if (!actionType) {\n return;\n }\n\n if (actionType.startsWith(messagePrefix)) {\n callback(event.data);\n }\n };\n\n useEffect(() => {\n const listenerCallback = (event: MessageEvent) => receiveMessage(event, onReceiveMessage || noop);\n window.addEventListener('message', listenerCallback, false);\n return () => window.removeEventListener('message', listenerCallback, false);\n }, []);\n\n return {\n sendMessageToParent,\n sendMessageToWidget,\n };\n};\n\nexport default usePostMessage;\n"],"names":["usePostMessage","messagePrefix","onReceiveMessage","sendMessageToParent","message","referrer","sendMessageToWidget","targetFrames","isEmpty","target","contentWindow","receiveMessage","event","callback","actionType","useEffect","listenerCallback","noop"],"mappings":";;AAiCA,MAAMA,IAAiB,CAACC,GAAuBC,MAAgD;AAC3F,QAAMC,IAAsB,CAACC,MAA0B;AACnD,UAAMC,IAAW,SAAS;AAC1B,IAAIA,KACA,OAAO,OAAO,YAAYD,GAASC,CAAQ;AAAA,EAEnD,GAEMC,IAAsB,CAACF,GAAuBG,MAA0D;AAC1G,QAAI,CAACA,KAAgBC,EAAQD,CAAY;AACrC;AAKJ,KAAC,GAFc,MAAM,QAAQA,CAAY,IAAI,CAAC,GAAGA,CAAY,IAAI,CAACA,CAAY,CAEpE,EAAE,QAAQ,CAAAE,MAAU;AAC1B,YAAMC,IAAgBD,EAAO;AAC7B,MAAIC,KACAA,EAAc,YAAYN,GAAS,GAAG;AAAA,IAE9C,CAAC;AAAA,EACL,GAEMO,IAAiB,CAACC,GAAqBC,MAAuC;AAChF,UAAMC,IAAaF,EAAM,KAAK;AAC9B,IAAKE,KAIDA,EAAW,WAAWb,CAAa,KACnCY,EAASD,EAAM,IAAI;AAAA,EAE3B;AAEA,SAAAG,EAAU,MAAM;AACZ,UAAMC,IAAmB,CAACJ,MAAwBD,EAAeC,GAAOV,KAAoBe,CAAI;AAChG,kBAAO,iBAAiB,WAAWD,GAAkB,EAAK,GACnD,MAAM,OAAO,oBAAoB,WAAWA,GAAkB,EAAK;AAAA,EAC9E,GAAG,CAAA,CAAE,GAEE;AAAA,IACH,qBAAAb;AAAA,IACA,qBAAAG;AAAA,EAAA;AAER;"}
@@ -0,0 +1,49 @@
1
+ export type RioCookieConsentStatus = 'missing' | 'invalid' | 'ux-cookies-accepted' | 'marketing-cookies-accepted' | 'custom';
2
+ export type RioCookieConsentInfo = {
3
+ /**
4
+ * Name of the RIO consent cookie.
5
+ */
6
+ cookieName: 'cookie_settings';
7
+ /**
8
+ * Indicates whether the consent cookie exists.
9
+ */
10
+ isSet: boolean;
11
+ /**
12
+ * Raw cookie value as read from `document.cookie`.
13
+ */
14
+ rawValue?: string;
15
+ /**
16
+ * Parsed and normalized cookie switches when JSON parsing succeeds.
17
+ */
18
+ parsedValue?: Record<string, number>;
19
+ /**
20
+ * True when UX cookies are accepted (`switch-49 === 1`).
21
+ */
22
+ uxCookiesAccepted: boolean;
23
+ /**
24
+ * True when marketing cookies are accepted (`switch-2 === 1`).
25
+ */
26
+ marketingCookiesAccepted: boolean;
27
+ /**
28
+ * Computed consent status derived from parsed cookie values.
29
+ */
30
+ status: RioCookieConsentStatus;
31
+ };
32
+ export type UseRioCookieConsentResult = {
33
+ /**
34
+ * Reads and parses the RIO cookie consent settings.
35
+ */
36
+ getRioCookieConsentInfo: () => RioCookieConsentInfo;
37
+ };
38
+ /**
39
+ * Returns helpers for reading RIO's cookie consent state from `cookie_settings`.
40
+ *
41
+ * @returns {UseRioCookieConsentResult} Cookie consent helper functions.
42
+ *
43
+ * @example
44
+ * const { getRioCookieConsentInfo } = useRioCookieConsent();
45
+ * const consent = getRioCookieConsentInfo();
46
+ * const uxAccepted = consent.uxCookiesAccepted;
47
+ */
48
+ declare const useRioCookieConsent: () => UseRioCookieConsentResult;
49
+ export default useRioCookieConsent;