@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":"TreeSidebarCategories.js","sources":["../../../src/components/assetTree/TreeSidebarCategories.tsx"],"sourcesContent":["import type React from 'react';\nimport classNames from 'classnames';\nimport { noop } from 'es-toolkit/function';\n\nimport OverlayTrigger from '../overlay/OverlayTrigger';\nimport Tooltip from '../tooltip/Tooltip';\nimport type { TreeCategoryNode } from './TreeCategory';\n\nconst ACTIVE_CLASS_NAME = 'active';\nconst SELECTED_CLASS_NAME = 'selected';\n\nconst TOOLTIP_DELAY = 1500;\n\nexport type TreeSidebarCategoriesProps = {\n currentCategoryId?: string;\n onSelectCategory?: (selectedCategory: string) => void;\n children?: TreeCategoryNode[];\n};\n\nconst TreeSidebarCategories = (props: TreeSidebarCategoriesProps) => {\n const { children, currentCategoryId, onSelectCategory = noop } = props;\n\n if (!children) {\n return null;\n }\n\n return (\n <>\n {children.map(child => {\n const id = child.props.id;\n const icon = child.props.icon || '';\n const label = child.props.label;\n\n const statusClassName = classNames(\n currentCategoryId === id ? ACTIVE_CLASS_NAME : '',\n child.props.hasSelection && SELECTED_CLASS_NAME\n );\n\n const handleSelectCategory = (event: React.MouseEvent<HTMLLIElement>) => {\n event.stopPropagation();\n onSelectCategory(id);\n };\n\n const category = (\n <li key={id} onClick={handleSelectCategory} className={statusClassName}>\n <div className='selection-bubble'>\n <span className={`rioglyph ${icon}`} />\n </div>\n </li>\n );\n\n if (label) {\n return (\n <OverlayTrigger\n key={`category-tooltip-${id}`}\n placement={Tooltip.RIGHT}\n delay={{ show: TOOLTIP_DELAY, hide: 0 }}\n overlay={\n <Tooltip id='tooltip' width='auto'>\n <span>{label}</span>\n </Tooltip>\n }\n >\n {category}\n </OverlayTrigger>\n );\n }\n\n return category;\n })}\n </>\n );\n};\n\nexport default TreeSidebarCategories;\n"],"names":["ACTIVE_CLASS_NAME","SELECTED_CLASS_NAME","TOOLTIP_DELAY","TreeSidebarCategories","props","children","currentCategoryId","onSelectCategory","noop","jsx","Fragment","child","id","icon","label","statusClassName","classNames","category","event","OverlayTrigger","Tooltip"],"mappings":";;;;;AAQA,MAAMA,IAAoB,UACpBC,IAAsB,YAEtBC,IAAgB,MAQhBC,IAAwB,CAACC,MAAsC;AACjE,QAAM,EAAE,UAAAC,GAAU,mBAAAC,GAAmB,kBAAAC,IAAmBC,MAASJ;AAEjE,SAAKC,IAKD,gBAAAI,EAAAC,GAAA,EACK,UAAAL,EAAS,IAAI,CAAAM,MAAS;AACnB,UAAMC,IAAKD,EAAM,MAAM,IACjBE,IAAOF,EAAM,MAAM,QAAQ,IAC3BG,IAAQH,EAAM,MAAM,OAEpBI,IAAkBC;AAAA,MACpBV,MAAsBM,IAAKZ,IAAoB;AAAA,MAC/CW,EAAM,MAAM,gBAAgBV;AAAA,IAAA,GAQ1BgB,IACF,gBAAAR,EAAC,MAAA,EAAY,SANY,CAACS,MAA2C;AACrE,MAAAA,EAAM,gBAAA,GACNX,EAAiBK,CAAE;AAAA,IACvB,GAGgD,WAAWG,GACnD,UAAA,gBAAAN,EAAC,OAAA,EAAI,WAAU,oBACX,UAAA,gBAAAA,EAAC,UAAK,WAAW,YAAYI,CAAI,GAAA,CAAI,GACzC,KAHKD,CAIT;AAGJ,WAAIE,IAEI,gBAAAL;AAAA,MAACU;AAAA,MAAA;AAAA,QAEG,WAAWC,EAAQ;AAAA,QACnB,OAAO,EAAE,MAAMlB,GAAe,MAAM,EAAA;AAAA,QACpC,SACI,gBAAAO,EAACW,GAAA,EAAQ,IAAG,WAAU,OAAM,QACxB,UAAA,gBAAAX,EAAC,QAAA,EAAM,UAAAK,EAAA,CAAM,EAAA,CACjB;AAAA,QAGH,UAAAG;AAAA,MAAA;AAAA,MATI,oBAAoBL,CAAE;AAAA,IAAA,IAchCK;AAAA,EACX,CAAC,EAAA,CACL,IA/CO;AAiDf;"}
1
+ {"version":3,"file":"TreeSidebarCategories.js","sources":["../../../src/components/assetTree/TreeSidebarCategories.tsx"],"sourcesContent":["import type React from 'react';\nimport { noop } from 'es-toolkit/function';\n\nimport classNames from '../../utils/classNames';\nimport OverlayTrigger from '../overlay/OverlayTrigger';\nimport Tooltip from '../tooltip/Tooltip';\nimport type { TreeCategoryNode } from './TreeCategory';\n\nconst ACTIVE_CLASS_NAME = 'active';\nconst SELECTED_CLASS_NAME = 'selected';\n\nconst TOOLTIP_DELAY = 1500;\n\nexport type TreeSidebarCategoriesProps = {\n currentCategoryId?: string;\n onSelectCategory?: (selectedCategory: string) => void;\n children?: TreeCategoryNode[];\n};\n\nconst TreeSidebarCategories = (props: TreeSidebarCategoriesProps) => {\n const { children, currentCategoryId, onSelectCategory = noop } = props;\n\n if (!children) {\n return null;\n }\n\n return (\n <>\n {children.map(child => {\n const id = child.props.id;\n const icon = child.props.icon || '';\n const label = child.props.label;\n\n const statusClassName = classNames(\n currentCategoryId === id ? ACTIVE_CLASS_NAME : '',\n child.props.hasSelection && SELECTED_CLASS_NAME\n );\n\n const handleSelectCategory = (event: React.MouseEvent<HTMLLIElement>) => {\n event.stopPropagation();\n onSelectCategory(id);\n };\n\n const category = (\n <li key={id} onClick={handleSelectCategory} className={statusClassName}>\n <div className='selection-bubble'>\n <span className={`rioglyph ${icon}`} />\n </div>\n </li>\n );\n\n if (label) {\n return (\n <OverlayTrigger\n key={`category-tooltip-${id}`}\n placement={Tooltip.RIGHT}\n delay={{ show: TOOLTIP_DELAY, hide: 0 }}\n overlay={\n <Tooltip id='tooltip' width='auto'>\n <span>{label}</span>\n </Tooltip>\n }\n >\n {category}\n </OverlayTrigger>\n );\n }\n\n return category;\n })}\n </>\n );\n};\n\nexport default TreeSidebarCategories;\n"],"names":["ACTIVE_CLASS_NAME","SELECTED_CLASS_NAME","TOOLTIP_DELAY","TreeSidebarCategories","props","children","currentCategoryId","onSelectCategory","noop","jsx","Fragment","child","id","icon","label","statusClassName","classNames","category","event","OverlayTrigger","Tooltip"],"mappings":";;;;;AAQA,MAAMA,IAAoB,UACpBC,IAAsB,YAEtBC,IAAgB,MAQhBC,IAAwB,CAACC,MAAsC;AACjE,QAAM,EAAE,UAAAC,GAAU,mBAAAC,GAAmB,kBAAAC,IAAmBC,MAASJ;AAEjE,SAAKC,IAKD,gBAAAI,EAAAC,GAAA,EACK,UAAAL,EAAS,IAAI,CAAAM,MAAS;AACnB,UAAMC,IAAKD,EAAM,MAAM,IACjBE,IAAOF,EAAM,MAAM,QAAQ,IAC3BG,IAAQH,EAAM,MAAM,OAEpBI,IAAkBC;AAAA,MACpBV,MAAsBM,IAAKZ,IAAoB;AAAA,MAC/CW,EAAM,MAAM,gBAAgBV;AAAA,IAAA,GAQ1BgB,IACF,gBAAAR,EAAC,MAAA,EAAY,SANY,CAACS,MAA2C;AACrE,MAAAA,EAAM,gBAAA,GACNX,EAAiBK,CAAE;AAAA,IACvB,GAGgD,WAAWG,GACnD,UAAA,gBAAAN,EAAC,OAAA,EAAI,WAAU,oBACX,UAAA,gBAAAA,EAAC,UAAK,WAAW,YAAYI,CAAI,GAAA,CAAI,GACzC,KAHKD,CAIT;AAGJ,WAAIE,IAEI,gBAAAL;AAAA,MAACU;AAAA,MAAA;AAAA,QAEG,WAAWC,EAAQ;AAAA,QACnB,OAAO,EAAE,MAAMlB,GAAe,MAAM,EAAA;AAAA,QACpC,SACI,gBAAAO,EAACW,GAAA,EAAQ,IAAG,WAAU,OAAM,QACxB,UAAA,gBAAAX,EAAC,QAAA,EAAM,UAAAK,EAAA,CAAM,EAAA,CACjB;AAAA,QAGH,UAAAG;AAAA,MAAA;AAAA,MATI,oBAAoBL,CAAE;AAAA,IAAA,IAchCK;AAAA,EACX,CAAC,EAAA,CACL,IA/CO;AAiDf;"}
@@ -1,6 +1,6 @@
1
1
  import { jsx as e, jsxs as u, Fragment as c } from "react/jsx-runtime";
2
2
  import m from "react";
3
- import d from "classnames";
3
+ import d from "../../utils/classNames.js";
4
4
  import r from "./TypeCounter.js";
5
5
  import { TreeSummaryRow as p } from "./TreeSummaryRow.js";
6
6
  const v = ({ assetCounts: a }) => {
@@ -1 +1 @@
1
- {"version":3,"file":"TreeSummary.js","sources":["../../../src/components/assetTree/TreeSummary.tsx"],"sourcesContent":["import React, { type PropsWithChildren } from 'react';\nimport classNames from 'classnames';\n\nimport TypeCounter from './TypeCounter';\nimport TreeSummaryRow from './TreeSummaryRow';\n\nexport type AssetType = 'truck' | 'trailer' | 'bus' | 'van' | 'driver' | 'car';\n\nexport type TreeSummaryCounts = {\n /**\n * The amount of trucks\n */\n truck?: number;\n\n /**\n * The amount of trailers\n */\n trailer?: number;\n\n /**\n * The amount of buses\n */\n bus?: number;\n\n /**\n * The amount of vans\n */\n van?: number;\n\n /**\n * The amount of cars\n */\n car?: number;\n\n /**\n * The amount of drivers\n */\n driver?: number;\n};\n\nexport type DefaultAssetCountsProps = {\n assetCounts: TreeSummaryCounts;\n};\n\nconst DefaultAssetCounts = ({ assetCounts }: DefaultAssetCountsProps) => {\n const { truck, bus, van, trailer, car, driver } = assetCounts;\n return (\n <>\n <TypeCounter hideOnZero icon='truck-baseline' value={truck} />\n <TypeCounter hideOnZero icon='trailer-baseline' value={trailer} />\n <TypeCounter hideOnZero icon='bus-baseline' value={bus} />\n <TypeCounter hideOnZero icon='van-baseline' value={van} />\n <TypeCounter hideOnZero icon='car-baseline' value={car} />\n <TypeCounter hideOnZero icon='driver' value={driver} />\n </>\n );\n};\n\nexport type TreeSummaryProps = {\n /**\n * The object containing various asset type counter.\n */\n assetCounts?: TreeSummaryCounts;\n\n /**\n * The number of grid columns used for the built-in `TreeSummaryRow`.\n *\n * @default 4\n */\n gridCols?: number;\n\n /**\n * Additional classes added to the wrapping element.\n */\n className?: string;\n};\n\nconst TreeSummary = React.memo((props: PropsWithChildren<TreeSummaryProps>) => {\n const { className = '', assetCounts = {}, gridCols, children } = props;\n\n const classes = classNames(\n 'TreeSummary',\n 'display-flex flex-wrap',\n 'align-items-center',\n 'gap-10',\n 'padding-left-3',\n className\n );\n\n return (\n <div className={classes}>\n {children || (\n <TreeSummaryRow gridCols={gridCols}>\n <DefaultAssetCounts assetCounts={assetCounts} />\n </TreeSummaryRow>\n )}\n </div>\n );\n});\n\nexport default TreeSummary;\n"],"names":["DefaultAssetCounts","assetCounts","truck","bus","van","trailer","car","driver","jsxs","Fragment","jsx","TypeCounter","TreeSummary","React","props","className","gridCols","children","classes","classNames","TreeSummaryRow"],"mappings":";;;;;AA4CA,MAAMA,IAAqB,CAAC,EAAE,aAAAC,QAA2C;AACrE,QAAM,EAAE,OAAAC,GAAO,KAAAC,GAAK,KAAAC,GAAK,SAAAC,GAAS,KAAAC,GAAK,QAAAC,MAAWN;AAClD,SACI,gBAAAO,EAAAC,GAAA,EACI,UAAA;AAAA,IAAA,gBAAAC,EAACC,KAAY,YAAU,IAAC,MAAK,kBAAiB,OAAOT,GAAO;AAAA,sBAC3DS,GAAA,EAAY,YAAU,IAAC,MAAK,oBAAmB,OAAON,GAAS;AAAA,sBAC/DM,GAAA,EAAY,YAAU,IAAC,MAAK,gBAAe,OAAOR,GAAK;AAAA,sBACvDQ,GAAA,EAAY,YAAU,IAAC,MAAK,gBAAe,OAAOP,GAAK;AAAA,sBACvDO,GAAA,EAAY,YAAU,IAAC,MAAK,gBAAe,OAAOL,GAAK;AAAA,sBACvDK,GAAA,EAAY,YAAU,IAAC,MAAK,UAAS,OAAOJ,EAAA,CAAQ;AAAA,EAAA,GACzD;AAER,GAqBMK,IAAcC,EAAM,KAAK,CAACC,MAA+C;AAC3E,QAAM,EAAE,WAAAC,IAAY,IAAI,aAAAd,IAAc,CAAA,GAAI,UAAAe,GAAU,UAAAC,MAAaH,GAE3DI,IAAUC;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACAJ;AAAA,EAAA;AAGJ,SACI,gBAAAL,EAAC,OAAA,EAAI,WAAWQ,GACX,UAAAD,KACG,gBAAAP,EAACU,GAAA,EAAe,UAAAJ,GACZ,UAAA,gBAAAN,EAACV,GAAA,EAAmB,aAAAC,EAAA,CAA0B,EAAA,CAClD,GAER;AAER,CAAC;"}
1
+ {"version":3,"file":"TreeSummary.js","sources":["../../../src/components/assetTree/TreeSummary.tsx"],"sourcesContent":["import React, { type PropsWithChildren } from 'react';\n\nimport classNames from '../../utils/classNames';\nimport TypeCounter from './TypeCounter';\nimport TreeSummaryRow from './TreeSummaryRow';\n\nexport type AssetType = 'truck' | 'trailer' | 'bus' | 'van' | 'driver' | 'car';\n\nexport type TreeSummaryCounts = {\n /**\n * The amount of trucks\n */\n truck?: number;\n\n /**\n * The amount of trailers\n */\n trailer?: number;\n\n /**\n * The amount of buses\n */\n bus?: number;\n\n /**\n * The amount of vans\n */\n van?: number;\n\n /**\n * The amount of cars\n */\n car?: number;\n\n /**\n * The amount of drivers\n */\n driver?: number;\n};\n\nexport type DefaultAssetCountsProps = {\n assetCounts: TreeSummaryCounts;\n};\n\nconst DefaultAssetCounts = ({ assetCounts }: DefaultAssetCountsProps) => {\n const { truck, bus, van, trailer, car, driver } = assetCounts;\n return (\n <>\n <TypeCounter hideOnZero icon='truck-baseline' value={truck} />\n <TypeCounter hideOnZero icon='trailer-baseline' value={trailer} />\n <TypeCounter hideOnZero icon='bus-baseline' value={bus} />\n <TypeCounter hideOnZero icon='van-baseline' value={van} />\n <TypeCounter hideOnZero icon='car-baseline' value={car} />\n <TypeCounter hideOnZero icon='driver' value={driver} />\n </>\n );\n};\n\nexport type TreeSummaryProps = {\n /**\n * The object containing various asset type counter.\n */\n assetCounts?: TreeSummaryCounts;\n\n /**\n * The number of grid columns used for the built-in `TreeSummaryRow`.\n *\n * @default 4\n */\n gridCols?: number;\n\n /**\n * Additional classes added to the wrapping element.\n */\n className?: string;\n};\n\nconst TreeSummary = React.memo((props: PropsWithChildren<TreeSummaryProps>) => {\n const { className = '', assetCounts = {}, gridCols, children } = props;\n\n const classes = classNames(\n 'TreeSummary',\n 'display-flex flex-wrap',\n 'align-items-center',\n 'gap-10',\n 'padding-left-3',\n className\n );\n\n return (\n <div className={classes}>\n {children || (\n <TreeSummaryRow gridCols={gridCols}>\n <DefaultAssetCounts assetCounts={assetCounts} />\n </TreeSummaryRow>\n )}\n </div>\n );\n});\n\nexport default TreeSummary;\n"],"names":["DefaultAssetCounts","assetCounts","truck","bus","van","trailer","car","driver","jsxs","Fragment","jsx","TypeCounter","TreeSummary","React","props","className","gridCols","children","classes","classNames","TreeSummaryRow"],"mappings":";;;;;AA4CA,MAAMA,IAAqB,CAAC,EAAE,aAAAC,QAA2C;AACrE,QAAM,EAAE,OAAAC,GAAO,KAAAC,GAAK,KAAAC,GAAK,SAAAC,GAAS,KAAAC,GAAK,QAAAC,MAAWN;AAClD,SACI,gBAAAO,EAAAC,GAAA,EACI,UAAA;AAAA,IAAA,gBAAAC,EAACC,KAAY,YAAU,IAAC,MAAK,kBAAiB,OAAOT,GAAO;AAAA,sBAC3DS,GAAA,EAAY,YAAU,IAAC,MAAK,oBAAmB,OAAON,GAAS;AAAA,sBAC/DM,GAAA,EAAY,YAAU,IAAC,MAAK,gBAAe,OAAOR,GAAK;AAAA,sBACvDQ,GAAA,EAAY,YAAU,IAAC,MAAK,gBAAe,OAAOP,GAAK;AAAA,sBACvDO,GAAA,EAAY,YAAU,IAAC,MAAK,gBAAe,OAAOL,GAAK;AAAA,sBACvDK,GAAA,EAAY,YAAU,IAAC,MAAK,UAAS,OAAOJ,EAAA,CAAQ;AAAA,EAAA,GACzD;AAER,GAqBMK,IAAcC,EAAM,KAAK,CAACC,MAA+C;AAC3E,QAAM,EAAE,WAAAC,IAAY,IAAI,aAAAd,IAAc,CAAA,GAAI,UAAAe,GAAU,UAAAC,MAAaH,GAE3DI,IAAUC;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACAJ;AAAA,EAAA;AAGJ,SACI,gBAAAL,EAAC,OAAA,EAAI,WAAWQ,GACX,UAAAD,KACG,gBAAAP,EAACU,GAAA,EAAe,UAAAJ,GACZ,UAAA,gBAAAN,EAACV,GAAA,EAAmB,aAAAC,EAAA,CAA0B,EAAA,CAClD,GAER;AAER,CAAC;"}
@@ -1,7 +1,7 @@
1
1
  import { jsxs as v, jsx as t } from "react/jsx-runtime";
2
2
  import { forwardRef as x, useRef as N } from "react";
3
- import i from "classnames";
4
3
  import { noop as R } from "es-toolkit/function";
4
+ import i from "../../utils/classNames.js";
5
5
  import k from "../../hooks/useHover.js";
6
6
  import w from "../../utils/mergeRefs.js";
7
7
  import { withRioglyphPrefix as T } from "./treeUtils.js";
@@ -1 +1 @@
1
- {"version":3,"file":"TypeCounter.js","sources":["../../../src/components/assetTree/TypeCounter.tsx"],"sourcesContent":["import type React from 'react';\nimport { forwardRef, useRef } from 'react';\nimport classNames from 'classnames';\nimport { noop } from 'es-toolkit/function';\n\nimport useHover from '../../hooks/useHover';\nimport mergeRefs from '../../utils/mergeRefs';\nimport { withRioglyphPrefix } from './treeUtils';\n\nexport type TypeCounterProps = {\n /**\n * The item type for that counter. This will be used as a return value for the onClick callback.\n */\n type?: string;\n\n /**\n * The icon name. Note, when using the built-in generic type counter, the icon name will the\n * same as the item type. So make sure there is a corresponding icon for the defined type.\n */\n icon?: string;\n\n /**\n * Sets the active styling if active\n */\n isActive?: boolean;\n\n /**\n * Should be set when there is a type filter set in the tree to style the counter accordingly.\n *\n * @default false\n */\n hasFilter?: boolean;\n\n /**\n * Allows for interactivity. Use this prop when you allow clicking on the counter.\n *\n * @default false\n */\n enableActivity?: boolean;\n\n /**\n * Defines if the counter is rendered at all when the value is not defined ot 0.\n *\n * @default false\n */\n hideOnZero?: boolean;\n\n /**\n * Callback function when the counter is clicked. It returns the type value.\n * Make sure the \"type\" prop is defined to receive the value in the callback.\n *\n * @param type\n * @returns\n */\n onClick?: (type: string) => void;\n\n /**\n * A custom value to be shown in the counter.\n */\n value?: string | React.ReactNode | number;\n};\n\nconst TypeCounter = forwardRef<HTMLDivElement, TypeCounterProps>((props, ref) => {\n const {\n icon,\n value,\n isActive,\n hasFilter = false,\n enableActivity = false,\n onClick = noop,\n type,\n hideOnZero = false,\n ...remainingProps\n } = props;\n\n const internalRef = useRef<HTMLDivElement>(null);\n const mergedRef = mergeRefs([ref, internalRef]);\n\n const isHover = useHover(internalRef);\n\n const wrapperClassName = classNames(\n 'TypeCounter',\n 'display-flex align-items-center',\n 'user-select-none',\n 'margin-right-2',\n enableActivity ? 'cursor-pointer' : 'pointer-events-none',\n enableActivity && hasFilter && !isActive && !isHover && 'opacity-50'\n );\n\n const counterClassNames = classNames(\n 'TreeLabelCount',\n 'label label-condensed',\n isHover && !isActive && 'bg-white text-color-darker',\n isHover && !isActive && 'border-color-gray',\n isHover && isActive && 'border-color-primary',\n isActive ? 'label-primary' : 'label-muted label-filled'\n );\n\n const handleClick = () => type && onClick(type);\n\n if (hideOnZero && !value) {\n return null;\n }\n\n const iconName = withRioglyphPrefix(icon);\n\n return (\n <div ref={mergedRef} {...remainingProps} className={wrapperClassName} onClick={handleClick}>\n <span className={`rioglyph ${iconName} text-size-16 margin-right-2`} />\n <span className={counterClassNames}>{value || 0}</span>\n </div>\n );\n});\n\nexport default TypeCounter;\n"],"names":["TypeCounter","forwardRef","props","ref","icon","value","isActive","hasFilter","enableActivity","onClick","noop","type","hideOnZero","remainingProps","internalRef","useRef","mergedRef","mergeRefs","isHover","useHover","wrapperClassName","classNames","counterClassNames","handleClick","iconName","withRioglyphPrefix","jsxs","jsx"],"mappings":";;;;;;;AA8DA,MAAMA,IAAcC,EAA6C,CAACC,GAAOC,MAAQ;AAC7E,QAAM;AAAA,IACF,MAAAC;AAAA,IACA,OAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,gBAAAC,IAAiB;AAAA,IACjB,SAAAC,IAAUC;AAAA,IACV,MAAAC;AAAA,IACA,YAAAC,IAAa;AAAA,IACb,GAAGC;AAAA,EAAA,IACHX,GAEEY,IAAcC,EAAuB,IAAI,GACzCC,IAAYC,EAAU,CAACd,GAAKW,CAAW,CAAC,GAExCI,IAAUC,EAASL,CAAW,GAE9BM,IAAmBC;AAAA,IACrB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACAb,IAAiB,mBAAmB;AAAA,IACpCA,KAAkBD,KAAa,CAACD,KAAY,CAACY,KAAW;AAAA,EAAA,GAGtDI,IAAoBD;AAAA,IACtB;AAAA,IACA;AAAA,IACAH,KAAW,CAACZ,KAAY;AAAA,IACxBY,KAAW,CAACZ,KAAY;AAAA,IACxBY,KAAWZ,KAAY;AAAA,IACvBA,IAAW,kBAAkB;AAAA,EAAA,GAG3BiB,IAAc,MAAMZ,KAAQF,EAAQE,CAAI;AAE9C,MAAIC,KAAc,CAACP;AACf,WAAO;AAGX,QAAMmB,IAAWC,EAAmBrB,CAAI;AAExC,SACI,gBAAAsB,EAAC,SAAI,KAAKV,GAAY,GAAGH,GAAgB,WAAWO,GAAkB,SAASG,GAC3E,UAAA;AAAA,IAAA,gBAAAI,EAAC,QAAA,EAAK,WAAW,YAAYH,CAAQ,gCAAgC;AAAA,IACrE,gBAAAG,EAAC,QAAA,EAAK,WAAWL,GAAoB,eAAS,EAAA,CAAE;AAAA,EAAA,GACpD;AAER,CAAC;"}
1
+ {"version":3,"file":"TypeCounter.js","sources":["../../../src/components/assetTree/TypeCounter.tsx"],"sourcesContent":["import type React from 'react';\nimport { forwardRef, useRef } from 'react';\nimport { noop } from 'es-toolkit/function';\n\nimport classNames from '../../utils/classNames';\nimport useHover from '../../hooks/useHover';\nimport mergeRefs from '../../utils/mergeRefs';\nimport { withRioglyphPrefix } from './treeUtils';\n\nexport type TypeCounterProps = {\n /**\n * The item type for that counter. This will be used as a return value for the onClick callback.\n */\n type?: string;\n\n /**\n * The icon name. Note, when using the built-in generic type counter, the icon name will the\n * same as the item type. So make sure there is a corresponding icon for the defined type.\n */\n icon?: string;\n\n /**\n * Sets the active styling if active\n */\n isActive?: boolean;\n\n /**\n * Should be set when there is a type filter set in the tree to style the counter accordingly.\n *\n * @default false\n */\n hasFilter?: boolean;\n\n /**\n * Allows for interactivity. Use this prop when you allow clicking on the counter.\n *\n * @default false\n */\n enableActivity?: boolean;\n\n /**\n * Defines if the counter is rendered at all when the value is not defined ot 0.\n *\n * @default false\n */\n hideOnZero?: boolean;\n\n /**\n * Callback function when the counter is clicked. It returns the type value.\n * Make sure the \"type\" prop is defined to receive the value in the callback.\n *\n * @param type\n * @returns\n */\n onClick?: (type: string) => void;\n\n /**\n * A custom value to be shown in the counter.\n */\n value?: string | React.ReactNode | number;\n};\n\nconst TypeCounter = forwardRef<HTMLDivElement, TypeCounterProps>((props, ref) => {\n const {\n icon,\n value,\n isActive,\n hasFilter = false,\n enableActivity = false,\n onClick = noop,\n type,\n hideOnZero = false,\n ...remainingProps\n } = props;\n\n const internalRef = useRef<HTMLDivElement>(null);\n const mergedRef = mergeRefs([ref, internalRef]);\n\n const isHover = useHover(internalRef);\n\n const wrapperClassName = classNames(\n 'TypeCounter',\n 'display-flex align-items-center',\n 'user-select-none',\n 'margin-right-2',\n enableActivity ? 'cursor-pointer' : 'pointer-events-none',\n enableActivity && hasFilter && !isActive && !isHover && 'opacity-50'\n );\n\n const counterClassNames = classNames(\n 'TreeLabelCount',\n 'label label-condensed',\n isHover && !isActive && 'bg-white text-color-darker',\n isHover && !isActive && 'border-color-gray',\n isHover && isActive && 'border-color-primary',\n isActive ? 'label-primary' : 'label-muted label-filled'\n );\n\n const handleClick = () => type && onClick(type);\n\n if (hideOnZero && !value) {\n return null;\n }\n\n const iconName = withRioglyphPrefix(icon);\n\n return (\n <div ref={mergedRef} {...remainingProps} className={wrapperClassName} onClick={handleClick}>\n <span className={`rioglyph ${iconName} text-size-16 margin-right-2`} />\n <span className={counterClassNames}>{value || 0}</span>\n </div>\n );\n});\n\nexport default TypeCounter;\n"],"names":["TypeCounter","forwardRef","props","ref","icon","value","isActive","hasFilter","enableActivity","onClick","noop","type","hideOnZero","remainingProps","internalRef","useRef","mergedRef","mergeRefs","isHover","useHover","wrapperClassName","classNames","counterClassNames","handleClick","iconName","withRioglyphPrefix","jsxs","jsx"],"mappings":";;;;;;;AA8DA,MAAMA,IAAcC,EAA6C,CAACC,GAAOC,MAAQ;AAC7E,QAAM;AAAA,IACF,MAAAC;AAAA,IACA,OAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,gBAAAC,IAAiB;AAAA,IACjB,SAAAC,IAAUC;AAAA,IACV,MAAAC;AAAA,IACA,YAAAC,IAAa;AAAA,IACb,GAAGC;AAAA,EAAA,IACHX,GAEEY,IAAcC,EAAuB,IAAI,GACzCC,IAAYC,EAAU,CAACd,GAAKW,CAAW,CAAC,GAExCI,IAAUC,EAASL,CAAW,GAE9BM,IAAmBC;AAAA,IACrB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACAb,IAAiB,mBAAmB;AAAA,IACpCA,KAAkBD,KAAa,CAACD,KAAY,CAACY,KAAW;AAAA,EAAA,GAGtDI,IAAoBD;AAAA,IACtB;AAAA,IACA;AAAA,IACAH,KAAW,CAACZ,KAAY;AAAA,IACxBY,KAAW,CAACZ,KAAY;AAAA,IACxBY,KAAWZ,KAAY;AAAA,IACvBA,IAAW,kBAAkB;AAAA,EAAA,GAG3BiB,IAAc,MAAMZ,KAAQF,EAAQE,CAAI;AAE9C,MAAIC,KAAc,CAACP;AACf,WAAO;AAGX,QAAMmB,IAAWC,EAAmBrB,CAAI;AAExC,SACI,gBAAAsB,EAAC,SAAI,KAAKV,GAAY,GAAGH,GAAgB,WAAWO,GAAkB,SAASG,GAC3E,UAAA;AAAA,IAAA,gBAAAI,EAAC,QAAA,EAAK,WAAW,YAAYH,CAAQ,gCAAgC;AAAA,IACrE,gBAAAG,EAAC,QAAA,EAAK,WAAWL,GAAoB,eAAS,EAAA,CAAE;AAAA,EAAA,GACpD;AAER,CAAC;"}
@@ -1,9 +1,9 @@
1
1
  import { jsxs as _, jsx as d } from "react/jsx-runtime";
2
2
  import { useState as h, useRef as E, useEffect as F } from "react";
3
- import j from "classnames";
4
3
  import { isEmpty as ge } from "es-toolkit/compat";
5
4
  import { noop as a } from "es-toolkit/function";
6
5
  import { isNil as fe } from "es-toolkit/predicate";
6
+ import j from "../../utils/classNames.js";
7
7
  import he from "../clearableInput/ClearableInput.js";
8
8
  import { DOWN as B, scrollItemIntoView as Se, UP as Ie } from "../../utils/scrollItemIntoView.js";
9
9
  import { useDropDirection as be } from "../../utils/useDropDirection.js";
@@ -1 +1 @@
1
- {"version":3,"file":"AutoSuggest.js","sources":["../../../src/components/autosuggest/AutoSuggest.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\nimport classNames from 'classnames';\nimport { isEmpty } from 'es-toolkit/compat';\nimport { noop } from 'es-toolkit/function';\nimport { isNil } from 'es-toolkit/predicate';\n\nimport ClearableInput from '../clearableInput/ClearableInput';\nimport { scrollItemIntoView, UP, DOWN } from '../../utils/scrollItemIntoView';\nimport { useDropDirection } from '../../utils/useDropDirection';\nimport DropdownHeader from '../selects/DropdownHeader';\nimport MenuItem from '../menuItems/MenuItem';\nimport useClickOutside from '../../hooks/useClickOutside';\nimport AutoSuggestAddons from './AutoSuggestAddons';\nimport DropdownSpinner from './DropdownSpinner';\nimport NoItemMessage from './NoItemMessage';\n\nexport type AutoSuggestSuggestion = {\n /**\n * The text label for a suggestion item. If present, this will be returned when selecting the suggestion.\n */\n label?: string;\n\n /**\n * Set to disable the suggestion and disallow selecting it.\n *\n * @default false\n */\n disabled?: boolean;\n\n /**\n * Optional custom suggestion node that will be rendered as given. Example, this is used by the TagManager\n * to render a placeholder with an icon next to it.\n */\n customSuggestion?: React.ReactNode;\n\n /**\n * Additional key-value pairs that are not relevant for rendering but may be handled on your side.\n */\n [name: string]: string | React.ReactNode;\n};\n\nexport type SelectedSuggestion = {\n suggestionValue: string | React.ReactElement;\n suggestion: AutoSuggestSuggestion;\n};\n\nexport type AutoSuggestInputProps = {\n /**\n * A native input id attribute. Passed through as HTML attribute to the input element.\n */\n id?: string;\n\n /**\n * The value to be set for the input. Using this prop the input can be controlled from the outside.\n */\n value?: string;\n\n /**\n * String that will be displayed inside the input when nothing is typed in.\n * @default `Start typing ...`\n */\n placeholder?: string | React.ReactNode;\n\n /**\n * Icon class name that shall be used. If defined, the input element is wrapped in an input-group\n * and the icon will be set in an input-addon. Example: `rioglyph-search`.\n */\n icon?: string;\n\n /**\n * Callback function which will be called when the input changes. __This is usually not needed__ as\n * the \"onSuggestionsFetchRequested\" callback takes care of any input change. It is listed here\n * for completeness and for certain edge cases.\n *\n * __Note:__ It might be removed in the future when not needed.'\n * @deprecated please use `onSuggestionsFetchRequested` instead\n * @param changeEvent\n * @param changeProps\n * @returns\n */\n onChange?: (changeEvent: React.SyntheticEvent, changeProps: { newValue: string }) => void;\n\n /**\n * Callback function which gets triggered when the input gaines focus.\n */\n onFocus?: VoidFunction;\n\n /**\n * Callback function which gets triggered when the input looses the focus.\n */\n onBlur?: VoidFunction;\n\n /**\n * Callback function which will be called when the input is cleared. __This is usually not needed__ as\n * the \"onSuggestionsFetchRequested\" callback takes care of any input change. It is listed here\n * for completeness and for certain edge cases.\n *\n * __Note:__ It might be removed in the future when not needed.\n */\n onClear?: VoidFunction;\n\n /**\n * Boolean value that adds the class `has-error` to the input\n * component. Use this for validation use cases. The Autosuggest component\n * should be wrapped in a `form-group` element with the class `has-feedback`.\n * @default false\n */\n hasError?: boolean;\n\n /**\n * Defines the tab index to be added to the input element.\n * @default 0\n */\n tabIndex?: number;\n\n /**\n * Boolean value that disabled the input component.\n * @default false\n */\n disabled?: boolean;\n\n /**\n * The React ref for the underlying input.\n */\n inputRef?: React.MutableRefObject<HTMLInputElement>;\n\n /**\n * Additional class names that are added to the input component.\n */\n className?: string;\n};\n\nexport type AutoSuggestProps<T = AutoSuggestSuggestion> = {\n /**\n * A native input id attribute on the component root. Passed through as HTML attribute to the input element.\n */\n id?: string;\n\n /**\n * Object to define properties for the input component. For the input, the ClearableInput\n * component is used.\n */\n inputProps?: AutoSuggestInputProps;\n\n /**\n * Array of items which will be displayed. Items can be arbitrary objects as long as they\n * have a label defined.\n *\n * __Important__: in case you specify your own custom renderer via `renderSuggestion` prop, you\n * can pass our own object that does not need to have a label. In this case you may want to\n * specify the `customSuggestionKey` to avoid react throwing an error of rendering menu items with the same key.\n */\n suggestions?: AutoSuggestSuggestion[];\n\n /**\n * Text that will be shown when there is not match found. If nothing is defined the dropdown-menu\n * will not be rendered.\n */\n noItemMessage?: string | React.ReactNode;\n\n /**\n * Callback function which will be called every time you need to recalculate suggestions e.i.\n * when the filter is updates after each input. It will also be called when the input is\n * cleared. The value would be an empty string in this case.\n * @param result\n * @returns\n */\n onSuggestionsFetchRequested?: (result: { value: string }) => void;\n\n /**\n * Callback function which will be called when a suggestion is selected from the dropdown menu.\n * @param event\n * @param selectedSuggestion\n * @returns\n */\n onSuggestionSelected?: (\n event: React.MouseEvent<HTMLLIElement> | React.KeyboardEvent<HTMLDivElement>,\n selectedSuggestion: SelectedSuggestion\n ) => void;\n\n /**\n * Callback function which will be called every time the highlighted selection changes.\n * @param suggestion\n * @returns\n */\n onSuggestionHighlighted?: (suggestion: AutoSuggestSuggestion | null) => void;\n\n /**\n * Function that returns a string which will be displayed inside the input.\n * This is required when a custom render function for suggestions is provided.\n * Overwrite this function to provide the value to be used for a suggestion.\n * Default implementation is: `suggestion => suggestion.label`\n *\n * @param suggestion\n * @returns\n */\n getSuggestionValue?: (suggestion: AutoSuggestSuggestion) => string;\n\n /**\n * Function that defines how suggestions are rendered on the dropdown-menu.\n * Use this to customize the appearance for instance when you want to show an icon\n * for a suggestion.\n * Default implementation is: `suggestion => suggestion.label`\n *\n * @param suggestion\n * @returns\n */\n renderSuggestion?: (suggestion: AutoSuggestSuggestion) => React.ReactNode;\n\n /**\n * When rendering your own custom suggestions that do not have the `label` attribute, use this prop to specify\n * a unique value for each suggestion which will be used as a react key for the individual menu items.\n */\n customSuggestionKey?: string;\n\n /**\n * Boolean that disabled autoDropDirection and opens the dropdown-menu be above the toggle.\n * @default false\n */\n dropup?: boolean;\n\n /**\n * Defines whether the dropdown opens right aligned or not.\n * Set to true additionally disables autoDrop feature.\n * @default false\n */\n pullRight?: boolean;\n\n /**\n * Boolean that enables autoDrop feature.\n * @default true\n */\n autoDropDirection?: boolean;\n\n /**\n * Shows a loading spinner instead of the items if set to true.\n * @default false\n */\n isLoading?: boolean;\n\n /**\n * Boolean that enables opening the dropdown menu when gaining focus.\n * @default false\n */\n openOnFocus?: boolean;\n\n /**\n * Boolean that enables the selection of an item to close the dropdown or not.\n * @default true\n */\n closeOnSelect?: boolean;\n\n /**\n * Defines whether or not a selected item is shown in the input after it was selected.\n * @default true\n */\n showSelectedItemsInInput?: boolean;\n\n /**\n * Sets autocomplete value for autosuggest forms.\n */\n autoComplete?: string;\n\n /**\n * Adds a list of input-addons elements in front of the input.\n */\n leadingInputAddons?: React.ReactNode[];\n\n /**\n * Adds a list of input-addons elements after the input.\n */\n trailingInputAddons?: React.ReactNode[];\n\n /**\n * Additional class names that are added to the dropdown element.\n */\n dropdownClassName?: string;\n\n /**\n * Additional class names that are added to the wrapping element.\n */\n className?: string;\n};\n\nexport const AutoSuggest = (props: AutoSuggestProps) => {\n const {\n id,\n onSuggestionSelected = noop,\n onSuggestionsFetchRequested = noop,\n onSuggestionHighlighted = noop,\n renderSuggestion,\n customSuggestionKey,\n getSuggestionValue,\n suggestions = [],\n autoDropDirection = true,\n pullRight = false,\n dropup = false,\n isLoading = false,\n openOnFocus = false,\n closeOnSelect = true,\n showSelectedItemsInInput = true,\n autoComplete = 'off',\n inputProps = {\n id,\n disabled: false,\n onChange: noop,\n onClear: noop,\n onBlur: noop,\n onFocus: noop,\n placeholder: 'Start typing',\n hasError: false,\n tabIndex: 0,\n value: undefined,\n icon: undefined,\n },\n leadingInputAddons,\n trailingInputAddons,\n noItemMessage,\n dropdownClassName = '',\n className = '',\n ...remainingProps\n } = props;\n\n const [isOpen, setIsOpen] = useState(false);\n const [value, setValue] = useState(inputProps.value || '');\n const [highlightedItemIndex, setHighlightedItemIndex] = useState(-1);\n const [direction, setDirection] = useState(DOWN);\n\n const componentRef = useClickOutside(() => closeMenu());\n const dropdownMenuRef = useRef<HTMLUListElement>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n const optionNodesRef = useRef<HTMLLIElement[]>([]);\n\n // Update internal value state from outside when external input value is given.\n // This is important for when this component is used as a controlled component\n const externalValue = inputProps.value;\n if (!isNil(externalValue) && value !== externalValue) {\n setValue(externalValue ?? '');\n }\n\n // Fetch suggestions on mounting the component by using the external\n // fetch callback\n useEffect(() => onSuggestionsFetchRequested({ value }), []);\n\n // When a new suggestion is highlighted it may be not in view as the dropdown menu\n // has an overflow and can scroll. In this case, we need to scroll to the highlighted suggestion\n // so the user can see it\n useEffect(() => {\n const focusedItem = getFocusedOptionNode();\n scrollItemIntoView(direction, dropdownMenuRef.current, focusedItem);\n }, [highlightedItemIndex, direction]);\n\n // Used to store the list item reference to allow highlighting a single node.\n // Update that list of nodes again when the suggestions change from the outside.\n useEffect(() => {\n const optionNodes = Array.from(dropdownMenuRef.current?.getElementsByTagName('li') || []);\n optionNodesRef.current = optionNodes;\n }, [suggestions]);\n\n // Overwrite position of dropdown menu in case auto drop is enabled\n const dropDirection = useDropDirection({ pullRight, dropup, autoDropDirection, dropdownMenuRef }, [suggestions]);\n\n const openMenu = () => {\n if (isOpen) {\n return;\n }\n setIsOpen(true);\n };\n\n const closeMenu = () => {\n setIsOpen(false);\n };\n\n const handleFocus = (_event: React.FocusEvent<HTMLInputElement>) => {\n if (openOnFocus) {\n openMenu();\n }\n if (inputProps.onFocus) {\n inputProps.onFocus();\n }\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\n switch (event.key) {\n case 'ArrowDown': {\n // select below on arrow down key\n const newHighlightedIndex = highlightedItemIndex + 1;\n if (isOpen && suggestions.length > newHighlightedIndex) {\n setHighlightedItemIndex(newHighlightedIndex);\n handleHighlightedSuggestionChanged(Number(newHighlightedIndex));\n setDirection(DOWN);\n }\n return;\n }\n case 'ArrowUp':\n // select above on arrow up key\n if (isOpen && highlightedItemIndex > 0) {\n const newHighlightedIndex = highlightedItemIndex - 1;\n setHighlightedItemIndex(newHighlightedIndex);\n handleHighlightedSuggestionChanged(Number(newHighlightedIndex));\n setDirection(UP);\n }\n return;\n case 'Enter':\n // select on enter\n if (isOpen && suggestions[highlightedItemIndex]) {\n onSuggestionClicked(event, suggestions[highlightedItemIndex]);\n } else {\n openMenu();\n }\n break;\n case 'Escape':\n case 'Tab':\n // close on esc key or on tab\n closeMenu();\n break;\n default:\n break;\n }\n };\n\n const getFocusedOptionNode = () => {\n return [...optionNodesRef.current].find((item: HTMLLIElement) => item.className.includes('active'));\n };\n\n const handleInputChange = (\n newValue: string,\n event: React.MouseEvent<HTMLSpanElement, MouseEvent> | React.ChangeEvent<HTMLInputElement>\n ) => {\n if (value !== newValue) {\n updateInputValue(newValue, event);\n }\n };\n\n const updateInputValue = (\n newValue: string,\n event:\n | React.MouseEvent<HTMLSpanElement, MouseEvent>\n | React.ChangeEvent<HTMLInputElement>\n | React.KeyboardEvent<HTMLDivElement>,\n shouldCloseMenu = false\n ) => {\n const closeMenuEventually = shouldCloseMenu ? false : isOpen;\n\n setIsOpen(!isOpen ? true : closeMenuEventually);\n setValue(newValue);\n setHighlightedItemIndex(-1);\n\n // Fire callback so the parent component can filter the suggestions accordingly\n onSuggestionsFetchRequested({ value: newValue });\n\n handleHighlightedSuggestionChanged(-1);\n\n // Trigger onChange callback to notify usage component only when value has actually changed\n const { value: newExternalValue, onChange = () => {} } = inputProps;\n if (newValue !== newExternalValue) {\n onChange(event, { newValue });\n }\n };\n\n const handleHighlightedSuggestionChanged = (currentHighlightedItemIndex: number) => {\n const currentHighlightedSuggestion =\n currentHighlightedItemIndex === -1 ? null : suggestions[currentHighlightedItemIndex];\n onSuggestionHighlighted(currentHighlightedSuggestion);\n };\n\n const clearInputValue = (_event: React.MouseEvent<HTMLSpanElement, MouseEvent>) => {\n setValue('');\n setHighlightedItemIndex(-1);\n\n // Focus the input field after clearing it's value in order to allow\n // entering new values right away\n if (inputRef.current) {\n inputRef.current.focus();\n }\n\n // Reset filter value so all suggestions are shown again\n onSuggestionsFetchRequested({ value: '' });\n\n handleHighlightedSuggestionChanged(-1);\n\n // Additionally, fire the onClear callback as the service may react on it\n if (inputProps.onClear) {\n inputProps.onClear();\n }\n };\n\n const getDefaultSuggestionValue = (suggestion: AutoSuggestSuggestion): string => {\n return suggestion.label ?? (suggestion[customSuggestionKey ?? ''] as string) ?? '';\n };\n\n const onSuggestionClicked = (\n event: React.MouseEvent<HTMLLIElement> | React.KeyboardEvent<HTMLDivElement>,\n suggestion: AutoSuggestSuggestion\n ) => {\n const getSuggestionValueFunction = getSuggestionValue ? getSuggestionValue : getDefaultSuggestionValue;\n\n const suggestionValue = getSuggestionValueFunction(suggestion);\n\n updateInputValue(suggestionValue, event, closeOnSelect);\n\n // fire callback with the selected item\n onSuggestionSelected(event, {\n suggestion,\n suggestionValue,\n });\n };\n\n const renderInput = () => {\n const { id: inputPropId, icon, value: ignoredExternalValue, ...remainingInputProps } = inputProps;\n const clearableProps = { id: id ?? inputPropId, ...remainingInputProps };\n\n const input = (\n <ClearableInput\n {...clearableProps}\n ref={inputRef}\n autoComplete={autoComplete}\n onChange={handleInputChange}\n onClear={clearInputValue}\n onFocus={handleFocus}\n onClick={openMenu}\n value={showSelectedItemsInInput ? value : ''}\n />\n );\n\n if (icon || leadingInputAddons || trailingInputAddons) {\n return (\n <AutoSuggestAddons\n icon={icon}\n leadingInputAddons={leadingInputAddons}\n trailingInputAddons={trailingInputAddons}\n >\n {input}\n </AutoSuggestAddons>\n );\n }\n\n return input;\n };\n\n const renderDefaultSuggestion = (suggestion: AutoSuggestSuggestion): React.ReactNode => suggestion.label;\n\n const renderDropdownMenu = () => {\n const dropdownMenuClasses = classNames(\n 'dropdown-menu',\n dropDirection.pullRight && 'pull-right',\n dropdownClassName\n );\n\n if (isLoading) {\n return <DropdownSpinner className={dropdownMenuClasses} />;\n }\n\n const hasNoSuggestions = isEmpty(suggestions);\n\n if (hasNoSuggestions && !noItemMessage) {\n return null;\n }\n\n return (\n <ul role='menu' className={dropdownMenuClasses} ref={dropdownMenuRef}>\n {hasNoSuggestions && noItemMessage && <NoItemMessage key='NoItemMessage' message={noItemMessage} />}\n {suggestions.map((suggestion, index) => {\n // In case a custom renderer is used but the customSuggestionKey is not set, throw an error\n if (renderSuggestion && !suggestion.label && !customSuggestionKey) {\n throw new Error(\n 'The \"customSuggestionKey\" need to be set when using a custom renderer ' +\n 'and not using the \"label\" prop for suggestions'\n );\n }\n\n const key = `index-${suggestion.label ?? suggestion[customSuggestionKey ?? '']}`;\n\n if (suggestion.header && suggestion.label) {\n return <DropdownHeader key={key} label={(suggestion as AutoSuggestSuggestion).label} />;\n }\n\n const renderFunction = renderSuggestion ? renderSuggestion : renderDefaultSuggestion;\n\n return (\n <MenuItem\n key={key}\n active={index === highlightedItemIndex}\n disabled={suggestion.disabled}\n value={\n suggestion.customSuggestion ? suggestion.customSuggestion : renderFunction(suggestion)\n }\n onSelect={(_: number | undefined, event: React.MouseEvent<HTMLLIElement>) =>\n onSuggestionClicked(event, suggestion)\n }\n index={index}\n />\n );\n })}\n </ul>\n );\n };\n\n const classes = classNames(\n 'AutoSuggest',\n 'dropdown',\n isOpen && 'open',\n dropDirection.dropup && 'dropup',\n className\n );\n\n return (\n <div {...remainingProps} className={classes} onKeyDown={handleKeyDown} ref={componentRef}>\n {renderInput()}\n {renderDropdownMenu()}\n </div>\n );\n};\n\nexport default AutoSuggest;\n"],"names":["AutoSuggest","props","id","onSuggestionSelected","noop","onSuggestionsFetchRequested","onSuggestionHighlighted","renderSuggestion","customSuggestionKey","getSuggestionValue","suggestions","autoDropDirection","pullRight","dropup","isLoading","openOnFocus","closeOnSelect","showSelectedItemsInInput","autoComplete","inputProps","leadingInputAddons","trailingInputAddons","noItemMessage","dropdownClassName","className","remainingProps","isOpen","setIsOpen","useState","value","setValue","highlightedItemIndex","setHighlightedItemIndex","direction","setDirection","DOWN","componentRef","useClickOutside","closeMenu","dropdownMenuRef","useRef","inputRef","optionNodesRef","externalValue","isNil","useEffect","focusedItem","getFocusedOptionNode","scrollItemIntoView","optionNodes","dropDirection","useDropDirection","openMenu","handleFocus","_event","handleKeyDown","event","newHighlightedIndex","handleHighlightedSuggestionChanged","UP","onSuggestionClicked","item","handleInputChange","newValue","updateInputValue","shouldCloseMenu","newExternalValue","onChange","currentHighlightedItemIndex","currentHighlightedSuggestion","clearInputValue","getDefaultSuggestionValue","suggestion","suggestionValue","renderInput","inputPropId","icon","ignoredExternalValue","remainingInputProps","clearableProps","input","jsx","ClearableInput","AutoSuggestAddons","renderDefaultSuggestion","renderDropdownMenu","dropdownMenuClasses","classNames","DropdownSpinner","hasNoSuggestions","isEmpty","NoItemMessage","index","key","DropdownHeader","renderFunction","MenuItem","_","classes","jsxs"],"mappings":";;;;;;;;;;;;;;;AA4RO,MAAMA,KAAc,CAACC,MAA4B;AACpD,QAAM;AAAA,IACF,IAAAC;AAAA,IACA,sBAAAC,IAAuBC;AAAA,IACvB,6BAAAC,IAA8BD;AAAA,IAC9B,yBAAAE,IAA0BF;AAAA,IAC1B,kBAAAG;AAAA,IACA,qBAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,aAAAC,IAAc,CAAA;AAAA,IACd,mBAAAC,IAAoB;AAAA,IACpB,WAAAC,IAAY;AAAA,IACZ,QAAAC,IAAS;AAAA,IACT,WAAAC,IAAY;AAAA,IACZ,aAAAC,IAAc;AAAA,IACd,eAAAC,IAAgB;AAAA,IAChB,0BAAAC,IAA2B;AAAA,IAC3B,cAAAC,IAAe;AAAA,IACf,YAAAC,IAAa;AAAA,MACT,IAAAjB;AAAA,MACA,UAAU;AAAA,MACV,UAAUE;AAAA,MACV,SAASA;AAAA,MACT,QAAQA;AAAA,MACR,SAASA;AAAA,MACT,aAAa;AAAA,MACb,UAAU;AAAA,MACV,UAAU;AAAA,MACV,OAAO;AAAA,MACP,MAAM;AAAA,IAAA;AAAA,IAEV,oBAAAgB;AAAA,IACA,qBAAAC;AAAA,IACA,eAAAC;AAAA,IACA,mBAAAC,IAAoB;AAAA,IACpB,WAAAC,KA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UAAA;AAAA,IAAAsC,GAAA;AAAA,IACAW,GAAA;AAAA,EAAmB,GACxB;AAER;"}
1
+ {"version":3,"file":"AutoSuggest.js","sources":["../../../src/components/autosuggest/AutoSuggest.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\nimport { isEmpty } from 'es-toolkit/compat';\nimport { noop } from 'es-toolkit/function';\nimport { isNil } from 'es-toolkit/predicate';\n\nimport classNames from '../../utils/classNames';\nimport ClearableInput from '../clearableInput/ClearableInput';\nimport { scrollItemIntoView, UP, DOWN } from '../../utils/scrollItemIntoView';\nimport { useDropDirection } from '../../utils/useDropDirection';\nimport DropdownHeader from '../selects/DropdownHeader';\nimport MenuItem from '../menuItems/MenuItem';\nimport useClickOutside from '../../hooks/useClickOutside';\nimport AutoSuggestAddons from './AutoSuggestAddons';\nimport DropdownSpinner from './DropdownSpinner';\nimport NoItemMessage from './NoItemMessage';\n\nexport type AutoSuggestSuggestion = {\n /**\n * The text label for a suggestion item. If present, this will be returned when selecting the suggestion.\n */\n label?: string;\n\n /**\n * Set to disable the suggestion and disallow selecting it.\n *\n * @default false\n */\n disabled?: boolean;\n\n /**\n * Optional custom suggestion node that will be rendered as given. Example, this is used by the TagManager\n * to render a placeholder with an icon next to it.\n */\n customSuggestion?: React.ReactNode;\n\n /**\n * Additional key-value pairs that are not relevant for rendering but may be handled on your side.\n */\n [name: string]: string | React.ReactNode;\n};\n\nexport type SelectedSuggestion = {\n suggestionValue: string | React.ReactElement;\n suggestion: AutoSuggestSuggestion;\n};\n\nexport type AutoSuggestInputProps = {\n /**\n * A native input id attribute. Passed through as HTML attribute to the input element.\n */\n id?: string;\n\n /**\n * The value to be set for the input. Using this prop the input can be controlled from the outside.\n */\n value?: string;\n\n /**\n * String that will be displayed inside the input when nothing is typed in.\n * @default `Start typing ...`\n */\n placeholder?: string | React.ReactNode;\n\n /**\n * Icon class name that shall be used. If defined, the input element is wrapped in an input-group\n * and the icon will be set in an input-addon. Example: `rioglyph-search`.\n */\n icon?: string;\n\n /**\n * Callback function which will be called when the input changes. __This is usually not needed__ as\n * the \"onSuggestionsFetchRequested\" callback takes care of any input change. It is listed here\n * for completeness and for certain edge cases.\n *\n * __Note:__ It might be removed in the future when not needed.'\n * @deprecated please use `onSuggestionsFetchRequested` instead\n * @param changeEvent\n * @param changeProps\n * @returns\n */\n onChange?: (changeEvent: React.SyntheticEvent, changeProps: { newValue: string }) => void;\n\n /**\n * Callback function which gets triggered when the input gaines focus.\n */\n onFocus?: VoidFunction;\n\n /**\n * Callback function which gets triggered when the input looses the focus.\n */\n onBlur?: VoidFunction;\n\n /**\n * Callback function which will be called when the input is cleared. __This is usually not needed__ as\n * the \"onSuggestionsFetchRequested\" callback takes care of any input change. It is listed here\n * for completeness and for certain edge cases.\n *\n * __Note:__ It might be removed in the future when not needed.\n */\n onClear?: VoidFunction;\n\n /**\n * Boolean value that adds the class `has-error` to the input\n * component. Use this for validation use cases. The Autosuggest component\n * should be wrapped in a `form-group` element with the class `has-feedback`.\n * @default false\n */\n hasError?: boolean;\n\n /**\n * Defines the tab index to be added to the input element.\n * @default 0\n */\n tabIndex?: number;\n\n /**\n * Boolean value that disabled the input component.\n * @default false\n */\n disabled?: boolean;\n\n /**\n * The React ref for the underlying input.\n */\n inputRef?: React.MutableRefObject<HTMLInputElement>;\n\n /**\n * Additional class names that are added to the input component.\n */\n className?: string;\n};\n\nexport type AutoSuggestProps<T = AutoSuggestSuggestion> = {\n /**\n * A native input id attribute on the component root. Passed through as HTML attribute to the input element.\n */\n id?: string;\n\n /**\n * Object to define properties for the input component. For the input, the ClearableInput\n * component is used.\n */\n inputProps?: AutoSuggestInputProps;\n\n /**\n * Array of items which will be displayed. Items can be arbitrary objects as long as they\n * have a label defined.\n *\n * __Important__: in case you specify your own custom renderer via `renderSuggestion` prop, you\n * can pass our own object that does not need to have a label. In this case you may want to\n * specify the `customSuggestionKey` to avoid react throwing an error of rendering menu items with the same key.\n */\n suggestions?: AutoSuggestSuggestion[];\n\n /**\n * Text that will be shown when there is not match found. If nothing is defined the dropdown-menu\n * will not be rendered.\n */\n noItemMessage?: string | React.ReactNode;\n\n /**\n * Callback function which will be called every time you need to recalculate suggestions e.i.\n * when the filter is updates after each input. It will also be called when the input is\n * cleared. The value would be an empty string in this case.\n * @param result\n * @returns\n */\n onSuggestionsFetchRequested?: (result: { value: string }) => void;\n\n /**\n * Callback function which will be called when a suggestion is selected from the dropdown menu.\n * @param event\n * @param selectedSuggestion\n * @returns\n */\n onSuggestionSelected?: (\n event: React.MouseEvent<HTMLLIElement> | React.KeyboardEvent<HTMLDivElement>,\n selectedSuggestion: SelectedSuggestion\n ) => void;\n\n /**\n * Callback function which will be called every time the highlighted selection changes.\n * @param suggestion\n * @returns\n */\n onSuggestionHighlighted?: (suggestion: AutoSuggestSuggestion | null) => void;\n\n /**\n * Function that returns a string which will be displayed inside the input.\n * This is required when a custom render function for suggestions is provided.\n * Overwrite this function to provide the value to be used for a suggestion.\n * Default implementation is: `suggestion => suggestion.label`\n *\n * @param suggestion\n * @returns\n */\n getSuggestionValue?: (suggestion: AutoSuggestSuggestion) => string;\n\n /**\n * Function that defines how suggestions are rendered on the dropdown-menu.\n * Use this to customize the appearance for instance when you want to show an icon\n * for a suggestion.\n * Default implementation is: `suggestion => suggestion.label`\n *\n * @param suggestion\n * @returns\n */\n renderSuggestion?: (suggestion: AutoSuggestSuggestion) => React.ReactNode;\n\n /**\n * When rendering your own custom suggestions that do not have the `label` attribute, use this prop to specify\n * a unique value for each suggestion which will be used as a react key for the individual menu items.\n */\n customSuggestionKey?: string;\n\n /**\n * Boolean that disabled autoDropDirection and opens the dropdown-menu be above the toggle.\n * @default false\n */\n dropup?: boolean;\n\n /**\n * Defines whether the dropdown opens right aligned or not.\n * Set to true additionally disables autoDrop feature.\n * @default false\n */\n pullRight?: boolean;\n\n /**\n * Boolean that enables autoDrop feature.\n * @default true\n */\n autoDropDirection?: boolean;\n\n /**\n * Shows a loading spinner instead of the items if set to true.\n * @default false\n */\n isLoading?: boolean;\n\n /**\n * Boolean that enables opening the dropdown menu when gaining focus.\n * @default false\n */\n openOnFocus?: boolean;\n\n /**\n * Boolean that enables the selection of an item to close the dropdown or not.\n * @default true\n */\n closeOnSelect?: boolean;\n\n /**\n * Defines whether or not a selected item is shown in the input after it was selected.\n * @default true\n */\n showSelectedItemsInInput?: boolean;\n\n /**\n * Sets autocomplete value for autosuggest forms.\n */\n autoComplete?: string;\n\n /**\n * Adds a list of input-addons elements in front of the input.\n */\n leadingInputAddons?: React.ReactNode[];\n\n /**\n * Adds a list of input-addons elements after the input.\n */\n trailingInputAddons?: React.ReactNode[];\n\n /**\n * Additional class names that are added to the dropdown element.\n */\n dropdownClassName?: string;\n\n /**\n * Additional class names that are added to the wrapping element.\n */\n className?: string;\n};\n\nexport const AutoSuggest = (props: AutoSuggestProps) => {\n const {\n id,\n onSuggestionSelected = noop,\n onSuggestionsFetchRequested = noop,\n onSuggestionHighlighted = noop,\n renderSuggestion,\n customSuggestionKey,\n getSuggestionValue,\n suggestions = [],\n autoDropDirection = true,\n pullRight = false,\n dropup = false,\n isLoading = false,\n openOnFocus = false,\n closeOnSelect = true,\n showSelectedItemsInInput = true,\n autoComplete = 'off',\n inputProps = {\n id,\n disabled: false,\n onChange: noop,\n onClear: noop,\n onBlur: noop,\n onFocus: noop,\n placeholder: 'Start typing',\n hasError: false,\n tabIndex: 0,\n value: undefined,\n icon: undefined,\n },\n leadingInputAddons,\n trailingInputAddons,\n noItemMessage,\n dropdownClassName = '',\n className = '',\n ...remainingProps\n } = props;\n\n const [isOpen, setIsOpen] = useState(false);\n const [value, setValue] = useState(inputProps.value || '');\n const [highlightedItemIndex, setHighlightedItemIndex] = useState(-1);\n const [direction, setDirection] = useState(DOWN);\n\n const componentRef = useClickOutside(() => closeMenu());\n const dropdownMenuRef = useRef<HTMLUListElement>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n const optionNodesRef = useRef<HTMLLIElement[]>([]);\n\n // Update internal value state from outside when external input value is given.\n // This is important for when this component is used as a controlled component\n const externalValue = inputProps.value;\n if (!isNil(externalValue) && value !== externalValue) {\n setValue(externalValue ?? '');\n }\n\n // Fetch suggestions on mounting the component by using the external\n // fetch callback\n useEffect(() => onSuggestionsFetchRequested({ value }), []);\n\n // When a new suggestion is highlighted it may be not in view as the dropdown menu\n // has an overflow and can scroll. In this case, we need to scroll to the highlighted suggestion\n // so the user can see it\n useEffect(() => {\n const focusedItem = getFocusedOptionNode();\n scrollItemIntoView(direction, dropdownMenuRef.current, focusedItem);\n }, [highlightedItemIndex, direction]);\n\n // Used to store the list item reference to allow highlighting a single node.\n // Update that list of nodes again when the suggestions change from the outside.\n useEffect(() => {\n const optionNodes = Array.from(dropdownMenuRef.current?.getElementsByTagName('li') || []);\n optionNodesRef.current = optionNodes;\n }, [suggestions]);\n\n // Overwrite position of dropdown menu in case auto drop is enabled\n const dropDirection = useDropDirection({ pullRight, dropup, autoDropDirection, dropdownMenuRef }, [suggestions]);\n\n const openMenu = () => {\n if (isOpen) {\n return;\n }\n setIsOpen(true);\n };\n\n const closeMenu = () => {\n setIsOpen(false);\n };\n\n const handleFocus = (_event: React.FocusEvent<HTMLInputElement>) => {\n if (openOnFocus) {\n openMenu();\n }\n if (inputProps.onFocus) {\n inputProps.onFocus();\n }\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\n switch (event.key) {\n case 'ArrowDown': {\n // select below on arrow down key\n const newHighlightedIndex = highlightedItemIndex + 1;\n if (isOpen && suggestions.length > newHighlightedIndex) {\n setHighlightedItemIndex(newHighlightedIndex);\n handleHighlightedSuggestionChanged(Number(newHighlightedIndex));\n setDirection(DOWN);\n }\n return;\n }\n case 'ArrowUp':\n // select above on arrow up key\n if (isOpen && highlightedItemIndex > 0) {\n const newHighlightedIndex = highlightedItemIndex - 1;\n setHighlightedItemIndex(newHighlightedIndex);\n handleHighlightedSuggestionChanged(Number(newHighlightedIndex));\n setDirection(UP);\n }\n return;\n case 'Enter':\n // select on enter\n if (isOpen && suggestions[highlightedItemIndex]) {\n onSuggestionClicked(event, suggestions[highlightedItemIndex]);\n } else {\n openMenu();\n }\n break;\n case 'Escape':\n case 'Tab':\n // close on esc key or on tab\n closeMenu();\n break;\n default:\n break;\n }\n };\n\n const getFocusedOptionNode = () => {\n return [...optionNodesRef.current].find((item: HTMLLIElement) => item.className.includes('active'));\n };\n\n const handleInputChange = (\n newValue: string,\n event: React.MouseEvent<HTMLSpanElement, MouseEvent> | React.ChangeEvent<HTMLInputElement>\n ) => {\n if (value !== newValue) {\n updateInputValue(newValue, event);\n }\n };\n\n const updateInputValue = (\n newValue: string,\n event:\n | React.MouseEvent<HTMLSpanElement, MouseEvent>\n | React.ChangeEvent<HTMLInputElement>\n | React.KeyboardEvent<HTMLDivElement>,\n shouldCloseMenu = false\n ) => {\n const closeMenuEventually = shouldCloseMenu ? false : isOpen;\n\n setIsOpen(!isOpen ? true : closeMenuEventually);\n setValue(newValue);\n setHighlightedItemIndex(-1);\n\n // Fire callback so the parent component can filter the suggestions accordingly\n onSuggestionsFetchRequested({ value: newValue });\n\n handleHighlightedSuggestionChanged(-1);\n\n // Trigger onChange callback to notify usage component only when value has actually changed\n const { value: newExternalValue, onChange = () => {} } = inputProps;\n if (newValue !== newExternalValue) {\n onChange(event, { newValue });\n }\n };\n\n const handleHighlightedSuggestionChanged = (currentHighlightedItemIndex: number) => {\n const currentHighlightedSuggestion =\n currentHighlightedItemIndex === -1 ? null : suggestions[currentHighlightedItemIndex];\n onSuggestionHighlighted(currentHighlightedSuggestion);\n };\n\n const clearInputValue = (_event: React.MouseEvent<HTMLSpanElement, MouseEvent>) => {\n setValue('');\n setHighlightedItemIndex(-1);\n\n // Focus the input field after clearing it's value in order to allow\n // entering new values right away\n if (inputRef.current) {\n inputRef.current.focus();\n }\n\n // Reset filter value so all suggestions are shown again\n onSuggestionsFetchRequested({ value: '' });\n\n handleHighlightedSuggestionChanged(-1);\n\n // Additionally, fire the onClear callback as the service may react on it\n if (inputProps.onClear) {\n inputProps.onClear();\n }\n };\n\n const getDefaultSuggestionValue = (suggestion: AutoSuggestSuggestion): string => {\n return suggestion.label ?? (suggestion[customSuggestionKey ?? ''] as string) ?? '';\n };\n\n const onSuggestionClicked = (\n event: React.MouseEvent<HTMLLIElement> | React.KeyboardEvent<HTMLDivElement>,\n suggestion: AutoSuggestSuggestion\n ) => {\n const getSuggestionValueFunction = getSuggestionValue ? getSuggestionValue : getDefaultSuggestionValue;\n\n const suggestionValue = getSuggestionValueFunction(suggestion);\n\n updateInputValue(suggestionValue, event, closeOnSelect);\n\n // fire callback with the selected item\n onSuggestionSelected(event, {\n suggestion,\n suggestionValue,\n });\n };\n\n const renderInput = () => {\n const { id: inputPropId, icon, value: ignoredExternalValue, ...remainingInputProps } = inputProps;\n const clearableProps = { id: id ?? inputPropId, ...remainingInputProps };\n\n const input = (\n <ClearableInput\n {...clearableProps}\n ref={inputRef}\n autoComplete={autoComplete}\n onChange={handleInputChange}\n onClear={clearInputValue}\n onFocus={handleFocus}\n onClick={openMenu}\n value={showSelectedItemsInInput ? value : ''}\n />\n );\n\n if (icon || leadingInputAddons || trailingInputAddons) {\n return (\n <AutoSuggestAddons\n icon={icon}\n leadingInputAddons={leadingInputAddons}\n trailingInputAddons={trailingInputAddons}\n >\n {input}\n </AutoSuggestAddons>\n );\n }\n\n return input;\n };\n\n const renderDefaultSuggestion = (suggestion: AutoSuggestSuggestion): React.ReactNode => suggestion.label;\n\n const renderDropdownMenu = () => {\n const dropdownMenuClasses = classNames(\n 'dropdown-menu',\n dropDirection.pullRight && 'pull-right',\n dropdownClassName\n );\n\n if (isLoading) {\n return <DropdownSpinner className={dropdownMenuClasses} />;\n }\n\n const hasNoSuggestions = isEmpty(suggestions);\n\n if (hasNoSuggestions && !noItemMessage) {\n return null;\n }\n\n return (\n <ul role='menu' className={dropdownMenuClasses} ref={dropdownMenuRef}>\n {hasNoSuggestions && noItemMessage && <NoItemMessage key='NoItemMessage' message={noItemMessage} />}\n {suggestions.map((suggestion, index) => {\n // In case a custom renderer is used but the customSuggestionKey is not set, throw an error\n if (renderSuggestion && !suggestion.label && !customSuggestionKey) {\n throw new Error(\n 'The \"customSuggestionKey\" need to be set when using a custom renderer ' +\n 'and not using the \"label\" prop for suggestions'\n );\n }\n\n const key = `index-${suggestion.label ?? suggestion[customSuggestionKey ?? '']}`;\n\n if (suggestion.header && suggestion.label) {\n return <DropdownHeader key={key} label={(suggestion as AutoSuggestSuggestion).label} />;\n }\n\n const renderFunction = renderSuggestion ? renderSuggestion : renderDefaultSuggestion;\n\n return (\n <MenuItem\n key={key}\n active={index === highlightedItemIndex}\n disabled={suggestion.disabled}\n value={\n suggestion.customSuggestion ? suggestion.customSuggestion : renderFunction(suggestion)\n }\n onSelect={(_: number | undefined, event: React.MouseEvent<HTMLLIElement>) =>\n onSuggestionClicked(event, suggestion)\n }\n index={index}\n />\n );\n })}\n </ul>\n );\n };\n\n const classes = classNames(\n 'AutoSuggest',\n 'dropdown',\n isOpen && 'open',\n dropDirection.dropup && 'dropup',\n className\n );\n\n return (\n <div {...remainingProps} className={classes} onKeyDown={handleKeyDown} ref={componentRef}>\n {renderInput()}\n {renderDropdownMenu()}\n </div>\n );\n};\n\nexport default AutoSuggest;\n"],"names":["AutoSuggest","props","id","onSuggestionSelected","noop","onSuggestionsFetchRequested","onSuggestionHighlighted","renderSuggestion","customSuggestionKey","getSuggestionValue","suggestions","autoDropDirection","pullRight","dropup","isLoading","openOnFocus","closeOnSelect","showSelectedItemsInInput","autoComplete","inputProps","leadingInputAddons","trailingInputAddons","noItemMessage","dropdownClassName","className","remainingProps","isOpen","setIsOpen","useState","value","setValue","highlightedItemIndex","setHighlightedItemIndex","direction","setDirection","DOWN","componentRef","useClickOutside","closeMenu","dropdownMenuRef","useRef","inputRef","optionNodesRef","externalValue","isNil","useEffect","focusedItem","getFocusedOptionNode","scrollItemIntoView","optionNodes","dropDirection","useDropDirection","openMenu","handleFocus","_event","handleKeyDown","event","newHighlightedIndex","handleHighlightedSuggestionChanged","UP","onSuggestionClicked","item","handleInputChange","newValue","updateInputValue","shouldCloseMenu","newExternalValue","onChange","currentHighlightedItemIndex","currentHighlightedSuggestion","clearInputValue","getDefaultSuggestionValue","suggestion","suggestionValue","renderInput","inputPropId","icon","ignoredExternalValue","remainingInputProps","clearableProps","input","jsx","ClearableInput","AutoSuggestAddons","renderDefaultSuggestion","renderDropdownMenu","dropdownMenuClasses","classNames","DropdownSpinner","hasNoSuggestions","isEmpty","NoItemMessage","index","key","DropdownHeader","renderFunction","MenuItem","_","classes","jsxs"],"mappings":";;;;;;;;;;;;;;;AA4RO,MAAMA,KAAc,CAACC,MAA4B;AACpD,QAAM;AAAA,IACF,IAAAC;AAAA,IACA,sBAAAC,IAAuBC;AAAA,IACvB,6BAAAC,IAA8BD;AAAA,IAC9B,yBAAAE,IAA0BF;AAAA,IAC1B,kBAAAG;AAAA,IACA,qBAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,aAAAC,IAAc,CAAA;AAAA,IACd,mBAAAC,IAAoB;AAAA,IACpB,WAAAC,IAAY;AAAA,IACZ,QAAAC,IAAS;AAAA,IACT,WAAAC,IAAY;AAAA,IACZ,aAAAC,IAAc;AAAA,IACd,eAAAC,IAAgB;AAAA,IAChB,0BAAAC,IAA2B;AAAA,IAC3B,cAAAC,IAAe;AAAA,IACf,YAAAC,IAAa;AAAA,MACT,IAAAjB;AAAA,MACA,UAAU;AAAA,MACV,UAAUE;AAAA,MACV,SAASA;AAAA,MACT,QAAQA;AAAA,MACR,SAASA;AAAA,MACT,aAAa;AAAA,MACb,UAAU;AAAA,MACV,UAAU;AAAA,MACV,OAAO;AAAA,MACP,MAAM;AAAA,IAAA;AAAA,IAEV,oBAAAgB;AAAA,IACA,qBAAAC;AAAA,IACA,eAAAC;AAAA,IACA,mBAAAC,IAAoB;AAAA,IACpB,WAAAC,KAAY;AAAA,IACZ,GAAGC;AAAA,EAAA,IACHxB,GAEE,CAACyB,GAAQC,CAAS,IAAIC,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-1,5 +1,5 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
- import _ from "classnames";
2
+ import _ from "../../utils/classNames.js";
3
3
  import g from "../tooltip/SimpleTooltip.js";
4
4
  import I from "./AvatarContent.js";
5
5
  const N = 100, O = 0, M = (s) => {
@@ -1 +1 @@
1
- {"version":3,"file":"Avatar.js","sources":["../../../src/components/avatar/Avatar.tsx"],"sourcesContent":["import type { ComponentProps } from 'react';\nimport classNames from 'classnames';\n\nimport SimpleTooltip from '../tooltip/SimpleTooltip';\nimport AvatarContent from './AvatarContent';\n\nconst TOOLTIP_SHOW_TIMEOUT_IN_MS = 100;\nconst TOOLTIP_HIDE_TIMEOUT_IN_MS = 0;\n\nexport type AvatarProps = ComponentProps<'div'> & {\n /**\n * When a name is provided, the Avatar automatically generates and displays the initials of that name.\n * The name also appears in a tooltip when hovered over.\n */\n name?: string;\n\n /**\n * The abbreviation can also be defined manually. It is recommended to limit abbreviations\n * to a maximum of 2 to 3 characters.\n */\n abbr?: string;\n\n /**\n * The image to be shown. When an image is displayed, the abbreviation is not shown.\n */\n image?: string;\n\n /**\n * The image alt text. If not given, the name will be used.\n */\n alt?: string;\n\n /**\n * The name of an icon that should be shown instead of initials. If nothing is provided,\n * a default icon will be shown.\n *\n * @default 'user'\n */\n iconName?: string;\n\n /**\n * The height and width of the component.\n *\n * @default 40\n */\n size?: number;\n\n /**\n * The background color for the component. By default, the text and icon color is derived from the background color.\n *\n * @default 'bg-lighter'\n */\n backgroundColor?: string;\n\n /**\n * The content of the Avatars tooltip. if nothing is provided, the name is used.\n */\n tooltip?: string | JSX.Element;\n\n /**\n * Additional classes set to the icon element.\n */\n iconClassName?: string;\n\n /**\n * Additional classes set to the wrapper element.\n */\n className?: string;\n};\n\nconst Avatar = (props: AvatarProps) => {\n const {\n name,\n abbr,\n image,\n alt,\n iconName = 'user',\n size = 40,\n backgroundColor = 'bg-lighter',\n tooltip,\n iconClassName,\n className = '',\n ...remainingProps\n } = props;\n\n const classes = classNames('Avatar', backgroundColor, className);\n\n const tooltipContent = tooltip || name;\n\n const wrapWithTooltip = (content: JSX.Element) =>\n tooltipContent ? (\n <SimpleTooltip\n content={tooltipContent}\n placement='bottom'\n delay={{ show: TOOLTIP_SHOW_TIMEOUT_IN_MS, hide: TOOLTIP_HIDE_TIMEOUT_IN_MS }}\n popperConfig={{\n modifiers: [\n {\n name: 'offset',\n options: {\n offset: [0, 5],\n },\n },\n {\n name: 'arrow',\n options: {},\n },\n ],\n }}\n >\n {content}\n </SimpleTooltip>\n ) : (\n content\n );\n\n return wrapWithTooltip(\n <div {...remainingProps} className={classes} style={{ height: `${size}px` }}>\n <AvatarContent\n name={name}\n abbr={abbr}\n image={image}\n alt={alt}\n iconName={iconName}\n iconClassName={iconClassName}\n />\n </div>\n );\n};\n\nexport default Avatar;\n"],"names":["TOOLTIP_SHOW_TIMEOUT_IN_MS","TOOLTIP_HIDE_TIMEOUT_IN_MS","Avatar","props","name","abbr","image","alt","iconName","size","backgroundColor","tooltip","iconClassName","className","remainingProps","classes","classNames","tooltipContent","content","jsx","SimpleTooltip","AvatarContent"],"mappings":";;;;AAMA,MAAMA,IAA6B,KAC7BC,IAA6B,GA+D7BC,IAAS,CAACC,MAAuB;AACnC,QAAM;AAAA,IACF,MAAAC;AAAA,IACA,MAAAC;AAAA,IACA,OAAAC;AAAA,IACA,KAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,MAAAC,IAAO;AAAA,IACP,iBAAAC,IAAkB;AAAA,IAClB,SAAAC;AAAA,IACA,eAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,GAAGC;AAAA,EAAA,IACHX,GAEEY,IAAUC,EAAW,UAAUN,GAAiBG,CAAS,GAEzDI,IAAiBN,KAAWP;AA6BlC,UA3BwB,CAACc,MACrBD,IACI,gBAAAE;AAAA,IAACC;AAAA,IAAA;AAAA,MACG,SAASH;AAAA,MACT,WAAU;AAAA,MACV,OAAO,EAAE,MAAMjB,GAA4B,MAAMC,EAAA;AAAA,MACjD,cAAc;AAAA,QACV,WAAW;AAAA,UACP;AAAA,YACI,MAAM;AAAA,YACN,SAAS;AAAA,cACL,QAAQ,CAAC,GAAG,CAAC;AAAA,YAAA;AAAA,UACjB;AAAA,UAEJ;AAAA,YACI,MAAM;AAAA,YACN,SAAS,CAAA;AAAA,UAAC;AAAA,QACd;AAAA,MACJ;AAAA,MAGH,UAAAiB;AAAA,IAAA;AAAA,EAAA,IAGLA;AAAA,IAIJ,gBAAAC,EAAC,OAAA,EAAK,GAAGL,GAAgB,WAAWC,GAAS,OAAO,EAAE,QAAQ,GAAGN,CAAI,KAAA,GACjE,UAAA,gBAAAU;AAAA,MAACE;AAAA,MAAA;AAAA,QACG,MAAAjB;AAAA,QACA,MAAAC;AAAA,QACA,OAAAC;AAAA,QACA,KAAAC;AAAA,QACA,UAAAC;AAAA,QACA,eAAAI;AAAA,MAAA;AAAA,IAAA,EACJ,CACJ;AAAA,EAAA;AAER;"}
1
+ {"version":3,"file":"Avatar.js","sources":["../../../src/components/avatar/Avatar.tsx"],"sourcesContent":["import type { ComponentProps } from 'react';\n\nimport classNames from '../../utils/classNames';\nimport SimpleTooltip from '../tooltip/SimpleTooltip';\nimport AvatarContent from './AvatarContent';\n\nconst TOOLTIP_SHOW_TIMEOUT_IN_MS = 100;\nconst TOOLTIP_HIDE_TIMEOUT_IN_MS = 0;\n\nexport type AvatarProps = ComponentProps<'div'> & {\n /**\n * When a name is provided, the Avatar automatically generates and displays the initials of that name.\n * The name also appears in a tooltip when hovered over.\n */\n name?: string;\n\n /**\n * The abbreviation can also be defined manually. It is recommended to limit abbreviations\n * to a maximum of 2 to 3 characters.\n */\n abbr?: string;\n\n /**\n * The image to be shown. When an image is displayed, the abbreviation is not shown.\n */\n image?: string;\n\n /**\n * The image alt text. If not given, the name will be used.\n */\n alt?: string;\n\n /**\n * The name of an icon that should be shown instead of initials. If nothing is provided,\n * a default icon will be shown.\n *\n * @default 'user'\n */\n iconName?: string;\n\n /**\n * The height and width of the component.\n *\n * @default 40\n */\n size?: number;\n\n /**\n * The background color for the component. By default, the text and icon color is derived from the background color.\n *\n * @default 'bg-lighter'\n */\n backgroundColor?: string;\n\n /**\n * The content of the Avatars tooltip. if nothing is provided, the name is used.\n */\n tooltip?: string | JSX.Element;\n\n /**\n * Additional classes set to the icon element.\n */\n iconClassName?: string;\n\n /**\n * Additional classes set to the wrapper element.\n */\n className?: string;\n};\n\nconst Avatar = (props: AvatarProps) => {\n const {\n name,\n abbr,\n image,\n alt,\n iconName = 'user',\n size = 40,\n backgroundColor = 'bg-lighter',\n tooltip,\n iconClassName,\n className = '',\n ...remainingProps\n } = props;\n\n const classes = classNames('Avatar', backgroundColor, className);\n\n const tooltipContent = tooltip || name;\n\n const wrapWithTooltip = (content: JSX.Element) =>\n tooltipContent ? (\n <SimpleTooltip\n content={tooltipContent}\n placement='bottom'\n delay={{ show: TOOLTIP_SHOW_TIMEOUT_IN_MS, hide: TOOLTIP_HIDE_TIMEOUT_IN_MS }}\n popperConfig={{\n modifiers: [\n {\n name: 'offset',\n options: {\n offset: [0, 5],\n },\n },\n {\n name: 'arrow',\n options: {},\n },\n ],\n }}\n >\n {content}\n </SimpleTooltip>\n ) : (\n content\n );\n\n return wrapWithTooltip(\n <div {...remainingProps} className={classes} style={{ height: `${size}px` }}>\n <AvatarContent\n name={name}\n abbr={abbr}\n image={image}\n alt={alt}\n iconName={iconName}\n iconClassName={iconClassName}\n />\n </div>\n );\n};\n\nexport default Avatar;\n"],"names":["TOOLTIP_SHOW_TIMEOUT_IN_MS","TOOLTIP_HIDE_TIMEOUT_IN_MS","Avatar","props","name","abbr","image","alt","iconName","size","backgroundColor","tooltip","iconClassName","className","remainingProps","classes","classNames","tooltipContent","content","jsx","SimpleTooltip","AvatarContent"],"mappings":";;;;AAMA,MAAMA,IAA6B,KAC7BC,IAA6B,GA+D7BC,IAAS,CAACC,MAAuB;AACnC,QAAM;AAAA,IACF,MAAAC;AAAA,IACA,MAAAC;AAAA,IACA,OAAAC;AAAA,IACA,KAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,MAAAC,IAAO;AAAA,IACP,iBAAAC,IAAkB;AAAA,IAClB,SAAAC;AAAA,IACA,eAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,GAAGC;AAAA,EAAA,IACHX,GAEEY,IAAUC,EAAW,UAAUN,GAAiBG,CAAS,GAEzDI,IAAiBN,KAAWP;AA6BlC,UA3BwB,CAACc,MACrBD,IACI,gBAAAE;AAAA,IAACC;AAAA,IAAA;AAAA,MACG,SAASH;AAAA,MACT,WAAU;AAAA,MACV,OAAO,EAAE,MAAMjB,GAA4B,MAAMC,EAAA;AAAA,MACjD,cAAc;AAAA,QACV,WAAW;AAAA,UACP;AAAA,YACI,MAAM;AAAA,YACN,SAAS;AAAA,cACL,QAAQ,CAAC,GAAG,CAAC;AAAA,YAAA;AAAA,UACjB;AAAA,UAEJ;AAAA,YACI,MAAM;AAAA,YACN,SAAS,CAAA;AAAA,UAAC;AAAA,QACd;AAAA,MACJ;AAAA,MAGH,UAAAiB;AAAA,IAAA;AAAA,EAAA,IAGLA;AAAA,IAIJ,gBAAAC,EAAC,OAAA,EAAK,GAAGL,GAAgB,WAAWC,GAAS,OAAO,EAAE,QAAQ,GAAGN,CAAI,KAAA,GACjE,UAAA,gBAAAU;AAAA,MAACE;AAAA,MAAA;AAAA,QACG,MAAAjB;AAAA,QACA,MAAAC;AAAA,QACA,OAAAC;AAAA,QACA,KAAAC;AAAA,QACA,UAAAC;AAAA,QACA,eAAAI;AAAA,MAAA;AAAA,IAAA,EACJ,CACJ;AAAA,EAAA;AAER;"}
@@ -1,7 +1,7 @@
1
1
  import { jsx as e, jsxs as d } from "react/jsx-runtime";
2
2
  import { createContext as H, useState as y, useRef as E, useEffect as x } from "react";
3
3
  import { useReducedMotion as T, AnimatePresence as b, motion as C } from "motion/react";
4
- import q from "classnames";
4
+ import q from "../../utils/classNames.js";
5
5
  import D from "../card/Card.js";
6
6
  import m from "../button/Button.js";
7
7
  import F from "./BannerActions.js";
@@ -1 +1 @@
1
- {"version":3,"file":"Banner.js","sources":["../../../src/components/banner/Banner.tsx"],"sourcesContent":["import { useState, useEffect, createContext, useRef, type ReactNode } from 'react';\nimport { motion, AnimatePresence, useReducedMotion } from 'motion/react';\n\nimport classNames from 'classnames';\n\nimport Card from '../card/Card';\nimport Button from '../button/Button';\nimport BannerPageActions from './BannerActions';\nimport BannerPageContent from './BannerContent';\nimport BannerPageIcon from './BannerIcon';\nimport BannerPage from './BannerPage';\n\nconst BannerContext = createContext<{ nextPage: () => void; prevPage: () => void } | undefined>(undefined);\n\ntype BannerProps = {\n /**\n * Defines if the content is shown or not.\n *\n * @default true\n */\n show: boolean;\n\n /**\n * Defines if a close button is shown or not. You can still add a custom\n * CTA button to the content that handles visibility.\n *\n * @default true\n */\n dismissible?: boolean;\n\n /**\n * Callback when the close button is clicked.\n *\n * @returns\n */\n onClose?: () => void;\n\n /**\n * Defines the time when the next page is shown in milliseconds.\n *\n * @default 20_000\n */\n pageTimeout?: number;\n\n /**\n * Defines if the page navigation buttons shall be shown or not.\n *\n * @default true\n */\n showPageNavigation?: boolean;\n\n /**\n * Defines if a border is shown or not. When placed on a white background, please disable the border\n * so it looks better.\n *\n * @default true\n */\n border?: boolean;\n\n /**\n * Enables or disables initial animation.\n *\n * @default true\n */\n initialAnimation?: boolean;\n\n /**\n * Additional classname added to the wrapper element.\n */\n className?: string;\n\n /**\n * The actual banner content. Wrap your content in a <Banner.Page> component.\n *\n * When having multiple pages, usa an array of <Banner.Page> components.\n */\n children: ReactNode | ReactNode[];\n};\n\nconst Banner = (props: BannerProps) => {\n const {\n show = true,\n dismissible = true,\n onClose = () => {},\n pageTimeout = 20_000,\n showPageNavigation = true,\n border = true,\n initialAnimation = true,\n className = '',\n children,\n ...remainingProps\n } = props;\n\n const pages = Array.isArray(children) ? children : [children];\n const pageAmount = pages.length;\n const hasMultiplePages = pageAmount > 1;\n\n const [currentPage, setCurrentPage] = useState(0);\n\n const shouldReduceMotion = useReducedMotion();\n const hasAnimation = !shouldReduceMotion && initialAnimation;\n\n const contentRef = useRef<HTMLDivElement>(null);\n const [contentHeight, setContentHeight] = useState(0);\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: \"currentPage\" resets interval on manual page change\n useEffect(() => {\n if (!show || pageAmount === 1) {\n return;\n }\n\n const interval = setInterval(() => {\n nextPage();\n }, pageTimeout);\n\n return () => clearInterval(interval);\n }, [pageAmount, pageTimeout, show, currentPage]);\n\n // Update height measurement after layout is complete\n // biome-ignore lint/correctness/useExhaustiveDependencies: <explanation>\n useEffect(() => {\n if (!contentRef.current) {\n return;\n }\n\n // Use ResizeObserver to get accurate measurements after layout\n const resizeObserver = new ResizeObserver(entries => {\n const entry = entries[0];\n if (entry) {\n // Use getBoundingClientRect for most accurate height\n const height = entry.target.getBoundingClientRect().height;\n setContentHeight(height);\n }\n });\n\n resizeObserver.observe(contentRef.current);\n\n return () => resizeObserver.disconnect();\n }, [show, currentPage]);\n\n const nextPage = () => {\n if (hasMultiplePages) {\n setCurrentPage(prev => (prev + 1) % pageAmount);\n }\n };\n\n const prevPage = () => {\n if (hasMultiplePages) {\n setCurrentPage(prev => (prev - 1 + pageAmount) % pageAmount);\n }\n };\n\n const cardClasses = classNames(\n 'Banner display-flex text-color-darker overflow-hidden',\n 'position-relative',\n !border && 'border-color-white',\n className\n );\n\n return (\n <BannerContext.Provider value={{ nextPage, prevPage }}>\n <AnimatePresence>\n {show && (\n <motion.div\n initial={{ height: 0, opacity: 0 }}\n animate={{ height: contentHeight, opacity: 1 }}\n exit={{ height: 0, opacity: 0 }}\n transition={{\n height: { duration: 0.2 },\n opacity: { duration: 0.2 },\n ease: 'easeInOut',\n }}\n >\n <div ref={contentRef} style={{ position: 'relative' }}>\n <Card className={cardClasses} padding={20} {...remainingProps}>\n <div className='flex-1-1 overflow-hidden'>\n <AnimatePresence mode='wait'>\n <motion.div\n key={currentPage}\n initial={hasAnimation ? { opacity: 0, x: 100 } : false}\n animate={{ opacity: 1, x: 0 }}\n exit={hasAnimation ? { opacity: 0, x: -100 } : undefined}\n transition={{\n duration: 1.5,\n ease: [0.25, 1, 0.5, 1],\n }}\n >\n {pages[currentPage]}\n </motion.div>\n </AnimatePresence>\n\n {hasMultiplePages && showPageNavigation && (\n <div className='margin-5'>\n <div className='position-absolute bottom-5' style={{ right: '45px' }}>\n <div className='display-flex'>\n <Button\n bsStyle='muted'\n bsSize='xs'\n onClick={prevPage}\n iconName='rioglyph-arrow-left'\n iconOnly\n />\n <Button\n bsStyle='muted'\n bsSize='xs'\n onClick={nextPage}\n iconName='rioglyph-arrow-right'\n iconOnly\n />\n </div>\n </div>\n </div>\n )}\n </div>\n {dismissible && (\n <div className='flex-0 margin-left-10 margin-right--5 margin-top--5 margin-top-0-ls align-self-start align-self-center-ls'>\n <Button\n bsStyle='muted'\n bsSize='sm'\n onClick={onClose}\n iconName='rioglyph-remove'\n iconOnly\n />\n </div>\n )}\n </Card>\n </div>\n </motion.div>\n )}\n </AnimatePresence>\n </BannerContext.Provider>\n );\n};\n\nBanner.Page = BannerPage;\nBanner.Icon = BannerPageIcon;\nBanner.Content = BannerPageContent;\nBanner.Actions = BannerPageActions;\n\nexport default Banner;\n"],"names":["BannerContext","createContext","Banner","props","show","dismissible","onClose","pageTimeout","showPageNavigation","border","initialAnimation","className","children","remainingProps","pages","pageAmount","hasMultiplePages","currentPage","setCurrentPage","useState","hasAnimation","useReducedMotion","contentRef","useRef","contentHeight","setContentHeight","useEffect","interval","nextPage","resizeObserver","entries","entry","height","prev","prevPage","cardClasses","classNames","jsx","AnimatePresence","motion","jsxs","Card","Button","BannerPage","BannerPageIcon","BannerPageContent","BannerPageActions"],"mappings":";;;;;;;;;;AAYA,MAAMA,IAAgBC,EAA0E,MAAS,GAmEnGC,IAAS,CAACC,MAAuB;AACnC,QAAM;AAAA,IACF,MAAAC,IAAO;AAAA,IACP,aAAAC,IAAc;AAAA,IACd,SAAAC,IAA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B,EAAC,SAAI,WAAU,YACX,4BAAC,OAAA,EAAI,WAAU,8BAA6B,OAAO,EAAE,OAAO,OAAA,GACxD,UAAA,gBAAAG,EAAC,OAAA,EAAI,WAAU,gBACX,UAAA;AAAA,YAAA,gBAAAH;AAAA,cAACK;AAAA,cAAA;AAAA,gBACG,SAAQ;AAAA,gBACR,QAAO;AAAA,gBACP,SAASR;AAAA,gBACT,UAAS;AAAA,gBACT,UAAQ;AAAA,cAAA;AAAA,YAAA;AAAA,YAEZ,gBAAAG;AAAA,cAACK;AAAA,cAAA;AAAA,gBACG,SAAQ;AAAA,gBACR,QAAO;AAAA,gBACP,SAASd;AAAA,gBACT,UAAS;AAAA,gBACT,UAAQ;AAAA,cAAA;AAAA,YAAA;AAAA,UACZ,EAAA,CACJ,GACJ,EAAA,CACJ;AAAA,QAAA,GAER;AAAA,QACCvB,KACG,gBAAAgC,EAAC,OAAA,EAAI,WAAU,6GACX,UAAA,gBAAAA;AAAA,UAACK;AAAA,UAAA;AAAA,YACG,SAAQ;AAAA,YACR,QAAO;AAAA,YACP,SAASpC;AAAA,YACT,UAAS;AAAA,YACT,UAAQ;AAAA,UAAA;AAAA,QAAA,EACZ,CACJ;AAAA,MAAA,EAAA,CAER,EAAA,CACJ;AAAA,IAAA;AAAA,EAAA,GAGZ,EAAA,CACJ;AAER;AAEAJ,EAAO,OAAOyC;AACdzC,EAAO,OAAO0C;AACd1C,EAAO,UAAU2C;AACjB3C,EAAO,UAAU4C;"}
1
+ {"version":3,"file":"Banner.js","sources":["../../../src/components/banner/Banner.tsx"],"sourcesContent":["import { useState, useEffect, createContext, useRef, type ReactNode } from 'react';\nimport { motion, AnimatePresence, useReducedMotion } from 'motion/react';\n\nimport classNames from '../../utils/classNames';\nimport Card from '../card/Card';\nimport Button from '../button/Button';\nimport BannerPageActions from './BannerActions';\nimport BannerPageContent from './BannerContent';\nimport BannerPageIcon from './BannerIcon';\nimport BannerPage from './BannerPage';\n\nconst BannerContext = createContext<{ nextPage: () => void; prevPage: () => void } | undefined>(undefined);\n\ntype BannerProps = {\n /**\n * Defines if the content is shown or not.\n *\n * @default true\n */\n show: boolean;\n\n /**\n * Defines if a close button is shown or not. You can still add a custom\n * CTA button to the content that handles visibility.\n *\n * @default true\n */\n dismissible?: boolean;\n\n /**\n * Callback when the close button is clicked.\n *\n * @returns\n */\n onClose?: () => void;\n\n /**\n * Defines the time when the next page is shown in milliseconds.\n *\n * @default 20_000\n */\n pageTimeout?: number;\n\n /**\n * Defines if the page navigation buttons shall be shown or not.\n *\n * @default true\n */\n showPageNavigation?: boolean;\n\n /**\n * Defines if a border is shown or not. When placed on a white background, please disable the border\n * so it looks better.\n *\n * @default true\n */\n border?: boolean;\n\n /**\n * Enables or disables initial animation.\n *\n * @default true\n */\n initialAnimation?: boolean;\n\n /**\n * Additional classname added to the wrapper element.\n */\n className?: string;\n\n /**\n * The actual banner content. Wrap your content in a <Banner.Page> component.\n *\n * When having multiple pages, usa an array of <Banner.Page> components.\n */\n children: ReactNode | ReactNode[];\n};\n\nconst Banner = (props: BannerProps) => {\n const {\n show = true,\n dismissible = true,\n onClose = () => {},\n pageTimeout = 20_000,\n showPageNavigation = true,\n border = true,\n initialAnimation = true,\n className = '',\n children,\n ...remainingProps\n } = props;\n\n const pages = Array.isArray(children) ? children : [children];\n const pageAmount = pages.length;\n const hasMultiplePages = pageAmount > 1;\n\n const [currentPage, setCurrentPage] = useState(0);\n\n const shouldReduceMotion = useReducedMotion();\n const hasAnimation = !shouldReduceMotion && initialAnimation;\n\n const contentRef = useRef<HTMLDivElement>(null);\n const [contentHeight, setContentHeight] = useState(0);\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: \"currentPage\" resets interval on manual page change\n useEffect(() => {\n if (!show || pageAmount === 1) {\n return;\n }\n\n const interval = setInterval(() => {\n nextPage();\n }, pageTimeout);\n\n return () => clearInterval(interval);\n }, [pageAmount, pageTimeout, show, currentPage]);\n\n // Update height measurement after layout is complete\n // biome-ignore lint/correctness/useExhaustiveDependencies: <explanation>\n useEffect(() => {\n if (!contentRef.current) {\n return;\n }\n\n // Use ResizeObserver to get accurate measurements after layout\n const resizeObserver = new ResizeObserver(entries => {\n const entry = entries[0];\n if (entry) {\n // Use getBoundingClientRect for most accurate height\n const height = entry.target.getBoundingClientRect().height;\n setContentHeight(height);\n }\n });\n\n resizeObserver.observe(contentRef.current);\n\n return () => resizeObserver.disconnect();\n }, [show, currentPage]);\n\n const nextPage = () => {\n if (hasMultiplePages) {\n setCurrentPage(prev => (prev + 1) % pageAmount);\n }\n };\n\n const prevPage = () => {\n if (hasMultiplePages) {\n setCurrentPage(prev => (prev - 1 + pageAmount) % pageAmount);\n }\n };\n\n const cardClasses = classNames(\n 'Banner display-flex text-color-darker overflow-hidden',\n 'position-relative',\n !border && 'border-color-white',\n className\n );\n\n return (\n <BannerContext.Provider value={{ nextPage, prevPage }}>\n <AnimatePresence>\n {show && (\n <motion.div\n initial={{ height: 0, opacity: 0 }}\n animate={{ height: contentHeight, opacity: 1 }}\n exit={{ height: 0, opacity: 0 }}\n transition={{\n height: { duration: 0.2 },\n opacity: { duration: 0.2 },\n ease: 'easeInOut',\n }}\n >\n <div ref={contentRef} style={{ position: 'relative' }}>\n <Card className={cardClasses} padding={20} {...remainingProps}>\n <div className='flex-1-1 overflow-hidden'>\n <AnimatePresence mode='wait'>\n <motion.div\n key={currentPage}\n initial={hasAnimation ? { opacity: 0, x: 100 } : false}\n animate={{ opacity: 1, x: 0 }}\n exit={hasAnimation ? { opacity: 0, x: -100 } : undefined}\n transition={{\n duration: 1.5,\n ease: [0.25, 1, 0.5, 1],\n }}\n >\n {pages[currentPage]}\n </motion.div>\n </AnimatePresence>\n\n {hasMultiplePages && showPageNavigation && (\n <div className='margin-5'>\n <div className='position-absolute bottom-5' style={{ right: '45px' }}>\n <div className='display-flex'>\n <Button\n bsStyle='muted'\n bsSize='xs'\n onClick={prevPage}\n iconName='rioglyph-arrow-left'\n iconOnly\n />\n <Button\n bsStyle='muted'\n bsSize='xs'\n onClick={nextPage}\n iconName='rioglyph-arrow-right'\n iconOnly\n />\n </div>\n </div>\n </div>\n )}\n </div>\n {dismissible && (\n <div className='flex-0 margin-left-10 margin-right--5 margin-top--5 margin-top-0-ls align-self-start align-self-center-ls'>\n <Button\n bsStyle='muted'\n bsSize='sm'\n onClick={onClose}\n iconName='rioglyph-remove'\n iconOnly\n />\n </div>\n )}\n </Card>\n </div>\n </motion.div>\n )}\n </AnimatePresence>\n </BannerContext.Provider>\n );\n};\n\nBanner.Page = BannerPage;\nBanner.Icon = BannerPageIcon;\nBanner.Content = BannerPageContent;\nBanner.Actions = BannerPageActions;\n\nexport default Banner;\n"],"names":["BannerContext","createContext","Banner","props","show","dismissible","onClose","pageTimeout","showPageNavigation","border","initialAnimation","className","children","remainingProps","pages","pageAmount","hasMultiplePages","currentPage","setCurrentPage","useState","hasAnimation","useReducedMotion","contentRef","useRef","contentHeight","setContentHeight","useEffect","interval","nextPage","resizeObserver","entries","entry","height","prev","prevPage","cardClasses","classNames","jsx","AnimatePresence","motion","jsxs","Card","Button","BannerPage","BannerPageIcon","BannerPageContent","BannerPageActions"],"mappings":";;;;;;;;;;AAWA,MAAMA,IAAgBC,EAA0E,MAAS,GAmEnGC,IAAS,CAACC,MAAuB;AACnC,QAAM;AAAA,IACF,MAAAC,IAAO;AAAA,IACP,aAAAC,IAAc;AAAA,IACd,SAAAC,IAAU,MAAM;AAAA,IAAC;AAAA,IACjB,aAAAC,IAAc;AAAA,IACd,oBAAAC,IAAqB;AAAA,IACrB,QAAAC,IAAS;AAAA,IACT,kBAAAC,IAAmB;AAAA,IACnB,WAAAC,IAAY;AAAA,IACZ,UAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACHV,GAEEW,IAAQ,MAAM,QAAQF,CAAQ,IAAIA,IAAW,CAACA,CAAQ,GACtDG,IAAaD,EAAM,QACnBE,IAAmBD,IAAa,GAEhC,CAACE,GAAaC,CAAc,IAAIC,EAAS,CAAC,GAG1CC,IA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;AAAA,gBACR,QAAO;AAAA,gBACP,SAASd;AAAA,gBACT,UAAS;AAAA,gBACT,UAAQ;AAAA,cAAA;AAAA,YAAA;AAAA,UACZ,EAAA,CACJ,GACJ,EAAA,CACJ;AAAA,QAAA,GAER;AAAA,QACCvB,KACG,gBAAAgC,EAAC,OAAA,EAAI,WAAU,6GACX,UAAA,gBAAAA;AAAA,UAACK;AAAA,UAAA;AAAA,YACG,SAAQ;AAAA,YACR,QAAO;AAAA,YACP,SAASpC;AAAA,YACT,UAAS;AAAA,YACT,UAAQ;AAAA,UAAA;AAAA,QAAA,EACZ,CACJ;AAAA,MAAA,EAAA,CAER,EAAA,CACJ;AAAA,IAAA;AAAA,EAAA,GAGZ,EAAA,CACJ;AAER;AAEAJ,EAAO,OAAOyC;AACdzC,EAAO,OAAO0C;AACd1C,EAAO,UAAU2C;AACjB3C,EAAO,UAAU4C;"}
@@ -1,5 +1,5 @@
1
1
  import { jsxs as t, jsx as s } from "react/jsx-runtime";
2
- import f from "classnames";
2
+ import f from "../../utils/classNames.js";
3
3
  import x from "../../hooks/useResizeObserver.js";
4
4
  const h = 400, z = (r) => {
5
5
  const {
@@ -1 +1 @@
1
- {"version":3,"file":"BannerContent.js","sources":["../../../src/components/banner/BannerContent.tsx"],"sourcesContent":["import type { PropsWithChildren } from 'react';\nimport classNames from 'classnames';\n\nimport useResizeObserver from '../../useResizeObserver';\n\nconst DEFAULT_MIN_WIDTH_BREAKPOINT = 400;\n\ntype BannerContentProps = Partial<Pick<HTMLDivElement, 'id'>> & {\n /**\n * The title for the banner.\n */\n title?: string | React.ReactElement;\n\n /**\n * Use this to add the banner call-to-action buttons. Wrap them in a <Banner.Actions> component.\n */\n actions?: React.ReactElement;\n\n /**\n * Breakpoint in pixels where the action buttons are placed under the banner text.\n *\n * On larger screens, the buttons are next to the text.\n *\n * @default 400\n */\n minWidthBreakpoint?: number;\n\n /**\n * Additional classname added to the wrapper element.\n */\n className?: string;\n};\n\nconst BannerContent = (props: PropsWithChildren<BannerContentProps>) => {\n const {\n title,\n actions,\n children,\n minWidthBreakpoint = DEFAULT_MIN_WIDTH_BREAKPOINT,\n className = '',\n ...remainingProps\n } = props;\n\n // Check size of the container for responsive breakpoints\n const [contentRef, _, { inlineSize }] = useResizeObserver();\n const containerWidth = inlineSize ?? 0;\n\n const contentWithActionClass = classNames(\n 'flex-1-1',\n 'BannerContent',\n 'display-flex gap-15',\n containerWidth < minWidthBreakpoint ? 'flex-column' : 'flex-row align-items-center',\n className\n );\n\n if (actions) {\n return (\n <div ref={contentRef} className={contentWithActionClass} {...remainingProps}>\n <div className='flex-1-1 min-width-100'>\n {title && <div className='text-size-16 text-medium'>{title}</div>}\n {children}\n </div>\n {actions}\n </div>\n );\n }\n\n return (\n <div className='flex-1-1'>\n {title && <div className='text-size-16 text-medium'>{title}</div>}\n {children}\n </div>\n );\n};\n\nexport default BannerContent;\n"],"names":["DEFAULT_MIN_WIDTH_BREAKPOINT","BannerContent","props","title","actions","children","minWidthBreakpoint","className","remainingProps","contentRef","_","inlineSize","useResizeObserver","contentWithActionClass","classNames","jsxs","jsx"],"mappings":";;;AAKA,MAAMA,IAA+B,KA4B/BC,IAAgB,CAACC,MAAiD;AACpE,QAAM;AAAA,IACF,OAAAC;AAAA,IACA,SAAAC;AAAA,IACA,UAAAC;AAAA,IACA,oBAAAC,IAAqBN;AAAA,IACrB,WAAAO,IAAY;AAAA,IACZ,GAAGC;AAAA,EAAA,IACHN,GAGE,CAACO,GAAYC,GAAG,EAAE,YAAAC,EAAA,CAAY,IAAIC,EAAA,GAGlCC,IAAyBC;AAAA,IAC3B;AAAA,IACA;AAAA,IACA;AAAA,KALmBH,KAAc,KAMhBL,IAAqB,gBAAgB;AAAA,IACtDC;AAAA,EAAA;AAGJ,SAAIH,sBAEK,OAAA,EAAI,KAAKK,GAAY,WAAWI,GAAyB,GAAGL,GACzD,UAAA;AAAA,IAAA,gBAAAO,EAAC,OAAA,EAAI,WAAU,0BACV,UAAA;AAAA,MAAAZ,KAAS,gBAAAa,EAAC,OAAA,EAAI,WAAU,4BAA4B,UAAAb,GAAM;AAAA,MAC1DE;AAAA,IAAA,GACL;AAAA,IACCD;AAAA,EAAA,GACL,IAKJ,gBAAAW,EAAC,OAAA,EAAI,WAAU,YACV,UAAA;AAAA,IAAAZ,KAAS,gBAAAa,EAAC,OAAA,EAAI,WAAU,4BAA4B,UAAAb,GAAM;AAAA,IAC1DE;AAAA,EAAA,GACL;AAER;"}
1
+ {"version":3,"file":"BannerContent.js","sources":["../../../src/components/banner/BannerContent.tsx"],"sourcesContent":["import type { PropsWithChildren } from 'react';\n\nimport classNames from '../../utils/classNames';\nimport useResizeObserver from '../../useResizeObserver';\n\nconst DEFAULT_MIN_WIDTH_BREAKPOINT = 400;\n\ntype BannerContentProps = Partial<Pick<HTMLDivElement, 'id'>> & {\n /**\n * The title for the banner.\n */\n title?: string | React.ReactElement;\n\n /**\n * Use this to add the banner call-to-action buttons. Wrap them in a <Banner.Actions> component.\n */\n actions?: React.ReactElement;\n\n /**\n * Breakpoint in pixels where the action buttons are placed under the banner text.\n *\n * On larger screens, the buttons are next to the text.\n *\n * @default 400\n */\n minWidthBreakpoint?: number;\n\n /**\n * Additional classname added to the wrapper element.\n */\n className?: string;\n};\n\nconst BannerContent = (props: PropsWithChildren<BannerContentProps>) => {\n const {\n title,\n actions,\n children,\n minWidthBreakpoint = DEFAULT_MIN_WIDTH_BREAKPOINT,\n className = '',\n ...remainingProps\n } = props;\n\n // Check size of the container for responsive breakpoints\n const [contentRef, _, { inlineSize }] = useResizeObserver();\n const containerWidth = inlineSize ?? 0;\n\n const contentWithActionClass = classNames(\n 'flex-1-1',\n 'BannerContent',\n 'display-flex gap-15',\n containerWidth < minWidthBreakpoint ? 'flex-column' : 'flex-row align-items-center',\n className\n );\n\n if (actions) {\n return (\n <div ref={contentRef} className={contentWithActionClass} {...remainingProps}>\n <div className='flex-1-1 min-width-100'>\n {title && <div className='text-size-16 text-medium'>{title}</div>}\n {children}\n </div>\n {actions}\n </div>\n );\n }\n\n return (\n <div className='flex-1-1'>\n {title && <div className='text-size-16 text-medium'>{title}</div>}\n {children}\n </div>\n );\n};\n\nexport default BannerContent;\n"],"names":["DEFAULT_MIN_WIDTH_BREAKPOINT","BannerContent","props","title","actions","children","minWidthBreakpoint","className","remainingProps","contentRef","_","inlineSize","useResizeObserver","contentWithActionClass","classNames","jsxs","jsx"],"mappings":";;;AAKA,MAAMA,IAA+B,KA4B/BC,IAAgB,CAACC,MAAiD;AACpE,QAAM;AAAA,IACF,OAAAC;AAAA,IACA,SAAAC;AAAA,IACA,UAAAC;AAAA,IACA,oBAAAC,IAAqBN;AAAA,IACrB,WAAAO,IAAY;AAAA,IACZ,GAAGC;AAAA,EAAA,IACHN,GAGE,CAACO,GAAYC,GAAG,EAAE,YAAAC,EAAA,CAAY,IAAIC,EAAA,GAGlCC,IAAyBC;AAAA,IAC3B;AAAA,IACA;AAAA,IACA;AAAA,KALmBH,KAAc,KAMhBL,IAAqB,gBAAgB;AAAA,IACtDC;AAAA,EAAA;AAGJ,SAAIH,sBAEK,OAAA,EAAI,KAAKK,GAAY,WAAWI,GAAyB,GAAGL,GACzD,UAAA;AAAA,IAAA,gBAAAO,EAAC,OAAA,EAAI,WAAU,0BACV,UAAA;AAAA,MAAAZ,KAAS,gBAAAa,EAAC,OAAA,EAAI,WAAU,4BAA4B,UAAAb,GAAM;AAAA,MAC1DE;AAAA,IAAA,GACL;AAAA,IACCD;AAAA,EAAA,GACL,IAKJ,gBAAAW,EAAC,OAAA,EAAI,WAAU,YACV,UAAA;AAAA,IAAAZ,KAAS,gBAAAa,EAAC,OAAA,EAAI,WAAU,4BAA4B,UAAAb,GAAM;AAAA,IAC1DE;AAAA,EAAA,GACL;AAER;"}
@@ -1,7 +1,7 @@
1
1
  import { jsxs as h, jsx as e } from "react/jsx-runtime";
2
2
  import f, { useMemo as j } from "react";
3
- import n from "classnames";
4
3
  import { motion as u } from "motion/react";
4
+ import n from "../../utils/classNames.js";
5
5
  import { SortDirection as A } from "../../utils/SortUtils.js";
6
6
  import { useSortedBars as H } from "./useSortedBars.js";
7
7
  const O = {
@@ -1 +1 @@
1
- {"version":3,"file":"BarList.js","sources":["../../../src/components/barList/BarList.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport classNames from 'classnames';\nimport { motion, type Variants } from 'motion/react';\n\nimport { SortDirection, type SortDirectionType } from '../../utils/SortUtils';\nimport { useSortedBars } from './useSortedBars';\n\n/**\n * A single entry in the BarList.\n *\n * @template T Custom payload merged into the row data.\n */\nexport type BarListRow<T> = T & {\n /**\n * Optional unique identifier. Falls back to `name` when not provided.\n */\n key?: string;\n\n /**\n * Optional URL. When provided, the label renders as a link.\n */\n href?: string;\n\n /**\n * Numeric value used for sorting and bar width calculations.\n */\n value: number;\n\n /**\n * Label shown for the bar.\n */\n name: string;\n\n /**\n * Text color override for this specific row.\n */\n color?: string;\n\n /**\n * Progress color override for this specific row.\n */\n barColor?: string;\n\n /**\n * Background color override for this specific row.\n */\n background?: string;\n};\n\n/**\n * Props for the BarList component.\n *\n * @template T - The type of the custom data associated with each bar row.\n */\ntype BarListProps<T = unknown> = React.HTMLAttributes<HTMLDivElement> & {\n /**\n * Array of bar row data to be rendered.\n */\n data: BarListRow<T>[];\n\n /**\n * Optional function to format the numeric value displayed on the right side of each bar.\n * Can return a string or a React element.\n *\n * @example\n * valueFormatter={(value) => `${value}%`}\n */\n valueFormatter?: (value: number) => string | React.ReactElement;\n\n /**\n * A reference value used to calculate relative widths.\n * If not provided, the maximum value in `data` will be used.\n *\n * @default max(data.value)\n */\n referenceValue?: number;\n\n /**\n * Whether to animate the bar width transitions using Framer Motion.\n *\n * @default false\n */\n showAnimation?: boolean;\n\n /**\n * Callback fired when a bar is clicked.\n *\n * @param payload - The full data object of the clicked bar.\n */\n onSelectRow?: (payload: BarListRow<T>) => void;\n\n /**\n * The sort order for the bars. Options are 'asc', 'desc', or 'none'.\n *\n * @default 'none'\n */\n sortOrder?: SortDirectionType | 'none';\n\n /**\n * Height of each bar row in pixels.\n *\n * @default 32\n */\n rowHeight?: number;\n\n /**\n * Opacity applied to non-hovered bars (between 0 and 1).\n *\n * @default 0.5\n */\n opacity?: number;\n\n /**\n * CSS color string used for the active/progress portion of each bar.\n *\n * @default 'bg-highlight-light'\n */\n barColor?: string;\n\n /**\n * CSS color string used for the text labels.\n *\n * @default 'text-color-darker'\n */\n labelColor?: string;\n\n /**\n * CSS color string used for the bar background.\n *\n * @default 'bg-transparent'\n */\n background?: string;\n\n /**\n * Additional className added to the wrapper element.\n */\n className?: string;\n};\n\n// Animation variants\nconst containerVariants: Variants = {\n animate: {\n transition: {\n staggerChildren: 0.1,\n },\n },\n};\n\nconst barVariants: Variants = {\n initial: { width: 0 },\n animate: (width: number) => ({\n width: `${width}%`,\n transition: { duration: 0.8, ease: 'easeOut' },\n }),\n};\n\nconst DEFAULT_ROW_HEIGHT = 25;\nconst DEFAULT_OPACITY = 0.5;\n\nconst BarListInner = <T,>(props: BarListProps<T>, forwardedRef: React.ForwardedRef<HTMLDivElement>) => {\n const {\n data = [],\n valueFormatter = value => value.toString(),\n showAnimation = false,\n onSelectRow,\n referenceValue,\n sortOrder = SortDirection.DESCENDING,\n barColor = 'bg-highlight-light',\n labelColor = 'text-color-darker',\n background = 'bg-transparent',\n rowHeight = DEFAULT_ROW_HEIGHT,\n opacity = DEFAULT_OPACITY,\n className = '',\n ...remainingProps\n } = props;\n\n const sortedData = useSortedBars(data, sortOrder, item => item.value);\n\n const [hoveredIndex, setHoveredIndex] = React.useState<number | null>(null);\n\n const widths = useMemo(() => {\n const base = referenceValue ?? Math.max(...sortedData.map(item => item.value), 0);\n return sortedData.map(item => (base === 0 || item.value === 0 ? 0 : Math.max((item.value / base) * 100, 2)));\n }, [sortedData, referenceValue]);\n\n return (\n <div\n {...remainingProps}\n ref={forwardedRef}\n className={classNames('display-flex justify-content-between gap-15', className)}\n >\n <motion.div\n variants={showAnimation ? containerVariants : undefined}\n initial='initial'\n animate='animate'\n className='width-100pct space-y-5'\n >\n {sortedData.map((item, index) => {\n const width = widths[index];\n\n const itemLabelColor = item.color ?? labelColor;\n const itemBarColor = item.barColor ?? barColor;\n const itemBackground = item.background ?? background;\n\n return (\n <div\n key={item.key ?? item.name}\n onMouseEnter={() => setHoveredIndex(index)}\n onMouseLeave={() => setHoveredIndex(null)}\n onClick={() => onSelectRow?.(item)}\n className={classNames(\n 'position-relative width-100pct rounded-small',\n 'transition-all transition-ease-in-out transition-duration-01',\n itemBackground,\n onSelectRow && 'cursor-pointer',\n hoveredIndex === index && 'bg-lightest'\n )}\n >\n {/* Animated Progress Bar */}\n <motion.div\n custom={width}\n variants={showAnimation ? barVariants : undefined}\n className={classNames(\n 'display-flex align-items-center rounded-small',\n 'transition-all transition-ease-in-out transition-duration-01',\n itemBarColor\n )}\n style={{ height: `${rowHeight}px`, opacity: hoveredIndex === index ? 1 : opacity }}\n role='presentation'\n />\n\n {/* Label */}\n <div className='position-absolute left-0 top-50pct translate-y-50pct display-flex width-100pct padding-left-10'>\n {item.href ? (\n <a\n href={item.href}\n className={itemLabelColor}\n target='_blank'\n rel='noreferrer'\n onClick={event => event.stopPropagation()}\n >\n {item.name}\n </a>\n ) : (\n <div className={itemLabelColor}>{item.name}</div>\n )}\n </div>\n </div>\n );\n })}\n </motion.div>\n\n {/* legend */}\n <div className='space-y-5'>\n {sortedData.map(item => (\n <div\n key={item.key ?? item.name}\n className={classNames('display-flex align-items-center justify-content-end')}\n style={{ height: `${rowHeight}px` }}\n >\n <div className='text-color-darkest'>{valueFormatter(item.value)}</div>\n </div>\n ))}\n </div>\n </div>\n );\n};\n\nBarListInner.displayName = 'BarList';\n\nconst BarList = React.forwardRef(BarListInner) as <T>(\n props: BarListProps<T> & { ref?: React.ForwardedRef<HTMLDivElement> }\n) => ReturnType<typeof BarListInner>;\n\nexport default BarList;\n"],"names":["containerVariants","barVariants","width","DEFAULT_ROW_HEIGHT","DEFAULT_OPACITY","BarListInner","props","forwardedRef","data","valueFormatter","value","showAnimation","onSelectRow","referenceValue","sortOrder","SortDirection","barColor","labelColor","background","rowHeight","opacity","className","remainingProps","sortedData","useSortedBars","item","hoveredIndex","setHoveredIndex","React","widths","useMemo","base","jsxs","classNames","jsx","motion","index","itemLabelColor","itemBarColor","itemBackground","event","BarList"],"mappings":";;;;;;AA4IA,MAAMA,IAA8B;AAAA,EAChC,SAAS;AAAA,IACL,YAAY;AAAA,MACR,iBAAiB;AAAA,IAAA;AAAA,EACrB;AAER,GAEMC,IAAwB;AAAA,EAC1B,SAAS,EAAE,OAAO,EAAA;AAAA,EAClB,SAAS,CAACC,OAAmB;AAAA,IACzB,OAAO,GAAGA,CAAK;AAAA,IACf,YAAY,EAAE,UAAU,KAAK,MAAM,UAAA;AAAA,EAAU;AAErD,GAEMC,IAAqB,IACrBC,IAAkB,KAElBC,IAAe,CAAKC,GAAwBC,MAAqD;AACnG,QAAM;AAAA,IACF,MAAAC,IAAO,CAAA;AAAA,IACP,gBAAAC,IAAiB,CAAAC,MAASA,EAAM,SAAA;AAAA,IAChC,eAAAC,IAAgB;AAAA,IAChB,aAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,WAAAC,IAAYC,EAAc;AAAA,IAC1B,UAAAC,IAAW;AAAA,IACX,YAAAC,IAAa;AAAA,IACb,YAAAC,IAAa;AAAA,IACb,WAAAC,IAAYhB;AAAA,IACZ,SAAAiB,IAAUhB;AAAA,IACV,WAAAiB,IAAY;AAAA,IACZ,GAAGC;AAAA,EAAA,IACHhB,GAEEiB,IAAaC,EAAchB,GAAMM,GAAW,CAAAW,MAAQA,EAAK,KAAK,GAE9D,CAACC,GAAcC,CAAe,IAAIC,EAAM,SAAwB,IAAI,GAEpEC,IAASC,EAAQ,MAAM;AACzB,UAAMC,IAAOlB,KAAkB,KAAK,IAAI,GAAGU,EAAW,IAAI,CAAAE,MAAQA,EAAK,KAAK,GAAG,CAAC;AAChF,WAAOF,EAAW,IAAI,CAAAE,MAASM,MAAS,KAA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c,EAAC,OAAA,EAAI,WAAU,kGACV,YAAK,OACF,gBAAAA;AAAA,sBAAC;AAAA,sBAAA;AAAA,wBACG,MAAMT,EAAK;AAAA,wBACX,WAAWY;AAAA,wBACX,QAAO;AAAA,wBACP,KAAI;AAAA,wBACJ,SAAS,CAAAG,MAASA,EAAM,gBAAA;AAAA,wBAEvB,UAAAf,EAAK;AAAA,sBAAA;AAAA,oBAAA,IAGV,gBAAAS,EAAC,OAAA,EAAI,WAAWG,GAAiB,UAAAZ,EAAK,MAAK,EAAA,CAEnD;AAAA,kBAAA;AAAA,gBAAA;AAAA,gBAxCKA,EAAK,OAAOA,EAAK;AAAA,cAAA;AAAA,YA2ClC,CAAC;AAAA,UAAA;AAAA,QAAA;AAAA,0BAIJ,OAAA,EAAI,WAAU,aACV,UAAAF,EAAW,IAAI,CAAAE,MACZ,gBAAAS;AAAA,UAAC;AAAA,UAAA;AAAA,YAEG,WAAWD,EAAW,qDAAqD;AAAA,YAC3E,OAAO,EAAE,QAAQ,GAAGd,CAAS,KAAA;AAAA,YAE7B,4BAAC,OAAA,EAAI,WAAU,sBAAsB,UAAAV,EAAegB,EAAK,KAAK,EAAA,CAAE;AAAA,UAAA;AAAA,UAJ3DA,EAAK,OAAOA,EAAK;AAAA,QAAA,CAM7B,EAAA,CACL;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGZ;AAEApB,EAAa,cAAc;AAE3B,MAAMoC,IAAUb,EAAM,WAAWvB,CAAY;"}
1
+ {"version":3,"file":"BarList.js","sources":["../../../src/components/barList/BarList.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport { motion, type Variants } from 'motion/react';\n\nimport classNames from '../../utils/classNames';\nimport { SortDirection, type SortDirectionType } from '../../utils/SortUtils';\nimport { useSortedBars } from './useSortedBars';\n\n/**\n * A single entry in the BarList.\n *\n * @template T Custom payload merged into the row data.\n */\nexport type BarListRow<T> = T & {\n /**\n * Optional unique identifier. Falls back to `name` when not provided.\n */\n key?: string;\n\n /**\n * Optional URL. When provided, the label renders as a link.\n */\n href?: string;\n\n /**\n * Numeric value used for sorting and bar width calculations.\n */\n value: number;\n\n /**\n * Label shown for the bar.\n */\n name: string;\n\n /**\n * Text color override for this specific row.\n */\n color?: string;\n\n /**\n * Progress color override for this specific row.\n */\n barColor?: string;\n\n /**\n * Background color override for this specific row.\n */\n background?: string;\n};\n\n/**\n * Props for the BarList component.\n *\n * @template T - The type of the custom data associated with each bar row.\n */\ntype BarListProps<T = unknown> = React.HTMLAttributes<HTMLDivElement> & {\n /**\n * Array of bar row data to be rendered.\n */\n data: BarListRow<T>[];\n\n /**\n * Optional function to format the numeric value displayed on the right side of each bar.\n * Can return a string or a React element.\n *\n * @example\n * valueFormatter={(value) => `${value}%`}\n */\n valueFormatter?: (value: number) => string | React.ReactElement;\n\n /**\n * A reference value used to calculate relative widths.\n * If not provided, the maximum value in `data` will be used.\n *\n * @default max(data.value)\n */\n referenceValue?: number;\n\n /**\n * Whether to animate the bar width transitions using Framer Motion.\n *\n * @default false\n */\n showAnimation?: boolean;\n\n /**\n * Callback fired when a bar is clicked.\n *\n * @param payload - The full data object of the clicked bar.\n */\n onSelectRow?: (payload: BarListRow<T>) => void;\n\n /**\n * The sort order for the bars. Options are 'asc', 'desc', or 'none'.\n *\n * @default 'none'\n */\n sortOrder?: SortDirectionType | 'none';\n\n /**\n * Height of each bar row in pixels.\n *\n * @default 32\n */\n rowHeight?: number;\n\n /**\n * Opacity applied to non-hovered bars (between 0 and 1).\n *\n * @default 0.5\n */\n opacity?: number;\n\n /**\n * CSS color string used for the active/progress portion of each bar.\n *\n * @default 'bg-highlight-light'\n */\n barColor?: string;\n\n /**\n * CSS color string used for the text labels.\n *\n * @default 'text-color-darker'\n */\n labelColor?: string;\n\n /**\n * CSS color string used for the bar background.\n *\n * @default 'bg-transparent'\n */\n background?: string;\n\n /**\n * Additional className added to the wrapper element.\n */\n className?: string;\n};\n\n// Animation variants\nconst containerVariants: Variants = {\n animate: {\n transition: {\n staggerChildren: 0.1,\n },\n },\n};\n\nconst barVariants: Variants = {\n initial: { width: 0 },\n animate: (width: number) => ({\n width: `${width}%`,\n transition: { duration: 0.8, ease: 'easeOut' },\n }),\n};\n\nconst DEFAULT_ROW_HEIGHT = 25;\nconst DEFAULT_OPACITY = 0.5;\n\nconst BarListInner = <T,>(props: BarListProps<T>, forwardedRef: React.ForwardedRef<HTMLDivElement>) => {\n const {\n data = [],\n valueFormatter = value => value.toString(),\n showAnimation = false,\n onSelectRow,\n referenceValue,\n sortOrder = SortDirection.DESCENDING,\n barColor = 'bg-highlight-light',\n labelColor = 'text-color-darker',\n background = 'bg-transparent',\n rowHeight = DEFAULT_ROW_HEIGHT,\n opacity = DEFAULT_OPACITY,\n className = '',\n ...remainingProps\n } = props;\n\n const sortedData = useSortedBars(data, sortOrder, item => item.value);\n\n const [hoveredIndex, setHoveredIndex] = React.useState<number | null>(null);\n\n const widths = useMemo(() => {\n const base = referenceValue ?? Math.max(...sortedData.map(item => item.value), 0);\n return sortedData.map(item => (base === 0 || item.value === 0 ? 0 : Math.max((item.value / base) * 100, 2)));\n }, [sortedData, referenceValue]);\n\n return (\n <div\n {...remainingProps}\n ref={forwardedRef}\n className={classNames('display-flex justify-content-between gap-15', className)}\n >\n <motion.div\n variants={showAnimation ? containerVariants : undefined}\n initial='initial'\n animate='animate'\n className='width-100pct space-y-5'\n >\n {sortedData.map((item, index) => {\n const width = widths[index];\n\n const itemLabelColor = item.color ?? labelColor;\n const itemBarColor = item.barColor ?? barColor;\n const itemBackground = item.background ?? background;\n\n return (\n <div\n key={item.key ?? item.name}\n onMouseEnter={() => setHoveredIndex(index)}\n onMouseLeave={() => setHoveredIndex(null)}\n onClick={() => onSelectRow?.(item)}\n className={classNames(\n 'position-relative width-100pct rounded-small',\n 'transition-all transition-ease-in-out transition-duration-01',\n itemBackground,\n onSelectRow && 'cursor-pointer',\n hoveredIndex === index && 'bg-lightest'\n )}\n >\n {/* Animated Progress Bar */}\n <motion.div\n custom={width}\n variants={showAnimation ? barVariants : undefined}\n className={classNames(\n 'display-flex align-items-center rounded-small',\n 'transition-all transition-ease-in-out transition-duration-01',\n itemBarColor\n )}\n style={{ height: `${rowHeight}px`, opacity: hoveredIndex === index ? 1 : opacity }}\n role='presentation'\n />\n\n {/* Label */}\n <div className='position-absolute left-0 top-50pct translate-y-50pct display-flex width-100pct padding-left-10'>\n {item.href ? (\n <a\n href={item.href}\n className={itemLabelColor}\n target='_blank'\n rel='noreferrer'\n onClick={event => event.stopPropagation()}\n >\n {item.name}\n </a>\n ) : (\n <div className={itemLabelColor}>{item.name}</div>\n )}\n </div>\n </div>\n );\n })}\n </motion.div>\n\n {/* legend */}\n <div className='space-y-5'>\n {sortedData.map(item => (\n <div\n key={item.key ?? item.name}\n className={classNames('display-flex align-items-center justify-content-end')}\n style={{ height: `${rowHeight}px` }}\n >\n <div className='text-color-darkest'>{valueFormatter(item.value)}</div>\n </div>\n ))}\n </div>\n </div>\n );\n};\n\nBarListInner.displayName = 'BarList';\n\nconst BarList = React.forwardRef(BarListInner) as <T>(\n props: BarListProps<T> & { ref?: React.ForwardedRef<HTMLDivElement> }\n) => ReturnType<typeof BarListInner>;\n\nexport default BarList;\n"],"names":["containerVariants","barVariants","width","DEFAULT_ROW_HEIGHT","DEFAULT_OPACITY","BarListInner","props","forwardedRef","data","valueFormatter","value","showAnimation","onSelectRow","referenceValue","sortOrder","SortDirection","barColor","labelColor","background","rowHeight","opacity","className","remainingProps","sortedData","useSortedBars","item","hoveredIndex","setHoveredIndex","React","widths","useMemo","base","jsxs","classNames","jsx","motion","index","itemLabelColor","itemBarColor","itemBackground","event","BarList"],"mappings":";;;;;;AA4IA,MAAMA,IAA8B;AAAA,EAChC,SAAS;AAAA,IACL,YAAY;AAAA,MACR,iBAAiB;AAAA,IAAA;AAAA,EACrB;AAER,GAEMC,IAAwB;AAAA,EAC1B,SAAS,EAAE,OAAO,EAAA;AAAA,EAClB,SAAS,CAACC,OAAmB;AAAA,IACzB,OA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;AAAA,YA2ClC,CAAC;AAAA,UAAA;AAAA,QAAA;AAAA,0BAIJ,OAAA,EAAI,WAAU,aACV,UAAAF,EAAW,IAAI,CAAAE,MACZ,gBAAAS;AAAA,UAAC;AAAA,UAAA;AAAA,YAEG,WAAWD,EAAW,qDAAqD;AAAA,YAC3E,OAAO,EAAE,QAAQ,GAAGd,CAAS,KAAA;AAAA,YAE7B,4BAAC,OAAA,EAAI,WAAU,sBAAsB,UAAAV,EAAegB,EAAK,KAAK,EAAA,CAAE;AAAA,UAAA;AAAA,UAJ3DA,EAAK,OAAOA,EAAK;AAAA,QAAA,CAM7B,EAAA,CACL;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGZ;AAEApB,EAAa,cAAc;AAE3B,MAAMoC,IAAUb,EAAM,WAAWvB,CAAY;"}
@@ -1,9 +1,9 @@
1
1
  import { jsxs as n, Fragment as I, jsx as e } from "react/jsx-runtime";
2
2
  import { useState as g, useEffect as M } from "react";
3
3
  import { createPortal as j } from "react-dom";
4
- import f from "classnames";
5
4
  import { motion as R } from "motion/react";
6
5
  import { isFunction as V } from "es-toolkit/predicate";
6
+ import f from "../../utils/classNames.js";
7
7
  import { getOrCreatePortalRoot as _ } from "../../utils/portalRoot.js";
8
8
  const $ = -1e3, r = 15, J = (u) => {
9
9
  const {
@@ -1 +1 @@
1
- {"version":3,"file":"BottomSheet.js","sources":["../../../src/components/bottomSheet/BottomSheet.tsx"],"sourcesContent":["import {\n type MutableRefObject,\n type PropsWithChildren,\n type ReactElement,\n type ReactNode,\n useEffect,\n useState,\n} from 'react';\nimport { createPortal } from 'react-dom';\nimport classNames from 'classnames';\nimport { motion } from 'motion/react';\nimport { isFunction } from 'es-toolkit/predicate';\n\nimport { getOrCreatePortalRoot } from '../../utils/portalRoot';\n\nconst OFFSET_POSITION = -1000;\nconst DEFAULT_OFFSET_PX = 15;\n\nexport type BottomSheetProps = {\n /**\n * Set the visibility of the bottom sheet. The component is already mounted and just moved offscreen.\n *\n * @default false\n */\n show: boolean;\n\n /**\n * Callback for when the sheet closes.\n */\n onClose?: (isShown: boolean) => void;\n\n /**\n * The width of the bottom sheet. This is useful for desktop when not using the entire screen width.\n * When no width is given it will take the width of the content and maximum `100%` of the screen.\n * So it this case you might want to apply a `max-width-xxx` via `className` to control it better.\n */\n width?: number | string;\n\n /**\n * The height of the bottom sheet. If no height is given, the height is automatically\n * calculated from the content.\n */\n height?: number | string;\n\n /**\n * The title content shown in the header. If no title is given, the bottom sheet header is not shown.\n */\n title?: string | ReactNode;\n\n /**\n * Defines whether or not the close button is shown.\n * @default true\n */\n showCloseButton?: boolean;\n\n /**\n * Defines whether or not the maximize button in the header is shown.\n * @default false\n */\n showMaximizeButton?: boolean;\n\n /**\n * The callback function triggered when the maximize button is clicked and the height changes.\n *\n * @default () => {}\n */\n onHeightChange?: VoidFunction;\n\n /**\n * Set to `true` to detach the bottom sheet from the left side and the bottom and create a little offset.\n *\n * @default false\n */\n detach?: boolean;\n\n /**\n * Defines the amount of pixels for the sheet.\n *\n * @default 15\n */\n detachOffset?: number;\n\n /**\n * Set to `true` to render a modal like backdrop to emphasize the bottom sheet.\n *\n * @default false\n */\n hasBackdrop?: boolean;\n\n /**\n * Callback function triggered when the backdrop is clicked. Usually used to close the bottom sheet.\n *\n * @default () => {}\n */\n onBackdropClick?: VoidFunction;\n\n /**\n * A react ref added to the bottom sheet body.\n */\n bodyRef?: MutableRefObject<HTMLDivElement | null>;\n\n /**\n * Additional classes to be set on the body element.\n */\n bodyClassName?: string;\n\n /**\n * Additional classes to be set on the wrapping element.\n */\n className?: string;\n};\n\nconst BottomSheet = (props: BottomSheetProps & PropsWithChildren) => {\n const {\n show = false,\n onClose,\n width,\n height,\n title,\n detach = false,\n detachOffset = DEFAULT_OFFSET_PX,\n hasBackdrop = false,\n showCloseButton = true,\n showMaximizeButton = false,\n onHeightChange = () => {},\n bodyRef,\n bodyClassName,\n className,\n children,\n onBackdropClick = () => {},\n ...remainingProps\n } = props;\n\n const [isShown, setIsShown] = useState(show);\n const [isMaxHeight, setIsMaxHeight] = useState(false);\n\n useEffect(() => setIsShown(show), [show]);\n\n const modalRoot = getOrCreatePortalRoot();\n\n const handleToggle = () => {\n const newValue = !isShown;\n if (isFunction(onClose)) {\n onClose(newValue);\n } else {\n setIsShown(newValue);\n }\n };\n\n const handleBackdropClick = () => {\n onBackdropClick();\n handleToggle();\n };\n\n const handleMaximize = () => {\n const newValue = !isMaxHeight;\n setIsMaxHeight(newValue);\n onHeightChange();\n };\n\n const sheetClasses = classNames(\n 'bottom-sheet',\n 'position-fixed left-0',\n !height && !isMaxHeight && 'height-auto',\n 'bg-white',\n 'shadow-hard',\n detach ? 'rounded' : 'rounded-top-left rounded-top-right',\n className && className\n );\n\n const sheetBodyClasses = classNames('bottom-sheet-body', 'height-100pct', bodyClassName && bodyClassName);\n\n const sheetHeight = isMaxHeight ? window.innerHeight : height;\n\n // Note: we always have to kep the body element in the DOM as there might be a ref assigned to it.\n // Unmounting it will lead to losing the reference and breaking the functionality that is implemented on that ref.\n // That is the reason why there is no \"AnimatePresence\" with an \"exit\" animation here.\n // Instead, we change the \"animate\" values.\n\n return createPortal(\n <>\n <motion.div\n {...remainingProps}\n className={sheetClasses}\n style={{\n width,\n maxWidth: detach ? `calc(100% - ${DEFAULT_OFFSET_PX * 2}px)` : '100%',\n margin: detach ? `${DEFAULT_OFFSET_PX}px` : 0,\n }}\n initial={{ opacity: 0 }}\n animate={{\n opacity: isShown ? 1 : 0,\n y: 0,\n bottom: isShown ? 0 : OFFSET_POSITION,\n height: isShown ? sheetHeight : 0,\n }}\n >\n <div className='bottom-sheet-header'>\n {title && (\n <div\n className={\n 'bottom-sheet-title display-flex justify-content-between padding-15 ' +\n 'border border-top-none border-left-none border-right-none border-color-lighter'\n }\n >\n <div className='text-size-18'>{title}</div>\n </div>\n )}\n {showCloseButton && (\n <div className='bottom-sheet-close position-absolute top-10 right-10'>\n <button type='button' className='btn btn-muted btn-sm btn-icon-only' onClick={handleToggle}>\n <span className='rioglyph rioglyph-remove' />\n </button>\n </div>\n )}\n {showMaximizeButton && (\n <div\n className={\n 'bottom-sheet-maximize height-30 ' +\n 'position-absolute top-5 left-50pct translate-x-50 cursor-pointer'\n }\n onClick={handleMaximize}\n >\n <div className='height-5 width-40 rounded bg-lighter' />\n </div>\n )}\n </div>\n <div className={sheetBodyClasses} ref={bodyRef}>\n {isShown && children}\n </div>\n </motion.div>\n\n {hasBackdrop && isShown && <div className='bottom-sheet-backdrop' onClick={handleBackdropClick} />}\n </>,\n modalRoot\n ) as ReactElement;\n};\n\nexport default BottomSheet;\n"],"names":["OFFSET_POSITION","DEFAULT_OFFSET_PX","BottomSheet","props","show","onClose","width","height","title","detach","detachOffset","hasBackdrop","showCloseButton","showMaximizeButton","onHeightChange","bodyRef","bodyClassName","className","children","onBackdropClick","remainingProps","isShown","setIsShown","useState","isMaxHeight","setIsMaxHeight","useEffect","modalRoot","getOrCreatePortalRoot","handleToggle","newValue","isFunction","handleBackdropClick","handleMaximize","sheetClasses","classNames","sheetBodyClasses","sheetHeight","createPortal","jsxs","Fragment","motion","jsx"],"mappings":";;;;;;;AAeA,MAAMA,IAAkB,MAClBC,IAAoB,IAgGpBC,IAAc,CAACC,MAAgD;AACjE,QAAM;AAAA,IACF,MAAAC,IAAO;AAAA,IACP,SAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC,IAAS;AAAA,IACT,cAAAC,IAAeT;AAAA,IACf,aAAAU,IAAc;AAAA,IACd,iBAAAC,IAAkB;AAAA,IAClB,oBAAAC,IAAqB;AAAA,IACrB,gBAAAC,IAAiB,MAAM;AAAA,IAAC;AAAA,IACxB,SAAAC;AAAA,IACA,eAAAC;AAAA,IACA,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,iBAAAC,IAAkB,MAAM;AAAA,IAAC;AAAA,IACzB,GAAGC;AAAA,EAAA,IACHjB,GAEE,CAACkB,GAASC,CAAU,IA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UAAA;AAAA,cAAA/B,KACG,gBAAAkC;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACG,WACI;AAAA,kBAIJ,UAAA,gBAAAA,EAAC,OAAA,EAAI,WAAU,gBAAgB,UAAAlC,EAAA,CAAM;AAAA,gBAAA;AAAA,cAAA;AAAA,cAG5CI,KACG,gBAAA8B,EAAC,OAAA,EAAI,WAAU,wDACX,UAAA,gBAAAA,EAAC,YAAO,MAAK,UAAS,WAAU,sCAAqC,SAASb,GAC1E,UAAA,gBAAAa,EAAC,UAAK,WAAU,4BAA2B,GAC/C,EAAA,CACJ;AAAA,cAEH7B,KACG,gBAAA6B;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACG,WACI;AAAA,kBAGJ,SAAST;AAAA,kBAET,UAAA,gBAAAS,EAAC,OAAA,EAAI,WAAU,uCAAA,CAAuC;AAAA,gBAAA;AAAA,cAAA;AAAA,YAC1D,GAER;AAAA,8BACC,OAAA,EAAI,WAAWN,GAAkB,KAAKrB,GAClC,eAAWG,EAAA,CAChB;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,MAGHP,KAAeU,KAAW,gBAAAqB,EAAC,SAAI,WAAU,yBAAwB,SAASV,EAAA,CAAqB;AAAA,IAAA,GACpG;AAAA,IACAL;AAAA,EAAA;AAER;"}
1
+ {"version":3,"file":"BottomSheet.js","sources":["../../../src/components/bottomSheet/BottomSheet.tsx"],"sourcesContent":["import {\n type MutableRefObject,\n type PropsWithChildren,\n type ReactElement,\n type ReactNode,\n useEffect,\n useState,\n} from 'react';\nimport { createPortal } from 'react-dom';\nimport { motion } from 'motion/react';\nimport { isFunction } from 'es-toolkit/predicate';\n\nimport classNames from '../../utils/classNames';\nimport { getOrCreatePortalRoot } from '../../utils/portalRoot';\n\nconst OFFSET_POSITION = -1000;\nconst DEFAULT_OFFSET_PX = 15;\n\nexport type BottomSheetProps = {\n /**\n * Set the visibility of the bottom sheet. The component is already mounted and just moved offscreen.\n *\n * @default false\n */\n show: boolean;\n\n /**\n * Callback for when the sheet closes.\n */\n onClose?: (isShown: boolean) => void;\n\n /**\n * The width of the bottom sheet. This is useful for desktop when not using the entire screen width.\n * When no width is given it will take the width of the content and maximum `100%` of the screen.\n * So it this case you might want to apply a `max-width-xxx` via `className` to control it better.\n */\n width?: number | string;\n\n /**\n * The height of the bottom sheet. If no height is given, the height is automatically\n * calculated from the content.\n */\n height?: number | string;\n\n /**\n * The title content shown in the header. If no title is given, the bottom sheet header is not shown.\n */\n title?: string | ReactNode;\n\n /**\n * Defines whether or not the close button is shown.\n * @default true\n */\n showCloseButton?: boolean;\n\n /**\n * Defines whether or not the maximize button in the header is shown.\n * @default false\n */\n showMaximizeButton?: boolean;\n\n /**\n * The callback function triggered when the maximize button is clicked and the height changes.\n *\n * @default () => {}\n */\n onHeightChange?: VoidFunction;\n\n /**\n * Set to `true` to detach the bottom sheet from the left side and the bottom and create a little offset.\n *\n * @default false\n */\n detach?: boolean;\n\n /**\n * Defines the amount of pixels for the sheet.\n *\n * @default 15\n */\n detachOffset?: number;\n\n /**\n * Set to `true` to render a modal like backdrop to emphasize the bottom sheet.\n *\n * @default false\n */\n hasBackdrop?: boolean;\n\n /**\n * Callback function triggered when the backdrop is clicked. Usually used to close the bottom sheet.\n *\n * @default () => {}\n */\n onBackdropClick?: VoidFunction;\n\n /**\n * A react ref added to the bottom sheet body.\n */\n bodyRef?: MutableRefObject<HTMLDivElement | null>;\n\n /**\n * Additional classes to be set on the body element.\n */\n bodyClassName?: string;\n\n /**\n * Additional classes to be set on the wrapping element.\n */\n className?: string;\n};\n\nconst BottomSheet = (props: BottomSheetProps & PropsWithChildren) => {\n const {\n show = false,\n onClose,\n width,\n height,\n title,\n detach = false,\n detachOffset = DEFAULT_OFFSET_PX,\n hasBackdrop = false,\n showCloseButton = true,\n showMaximizeButton = false,\n onHeightChange = () => {},\n bodyRef,\n bodyClassName,\n className,\n children,\n onBackdropClick = () => {},\n ...remainingProps\n } = props;\n\n const [isShown, setIsShown] = useState(show);\n const [isMaxHeight, setIsMaxHeight] = useState(false);\n\n useEffect(() => setIsShown(show), [show]);\n\n const modalRoot = getOrCreatePortalRoot();\n\n const handleToggle = () => {\n const newValue = !isShown;\n if (isFunction(onClose)) {\n onClose(newValue);\n } else {\n setIsShown(newValue);\n }\n };\n\n const handleBackdropClick = () => {\n onBackdropClick();\n handleToggle();\n };\n\n const handleMaximize = () => {\n const newValue = !isMaxHeight;\n setIsMaxHeight(newValue);\n onHeightChange();\n };\n\n const sheetClasses = classNames(\n 'bottom-sheet',\n 'position-fixed left-0',\n !height && !isMaxHeight && 'height-auto',\n 'bg-white',\n 'shadow-hard',\n detach ? 'rounded' : 'rounded-top-left rounded-top-right',\n className && className\n );\n\n const sheetBodyClasses = classNames('bottom-sheet-body', 'height-100pct', bodyClassName && bodyClassName);\n\n const sheetHeight = isMaxHeight ? window.innerHeight : height;\n\n // Note: we always have to kep the body element in the DOM as there might be a ref assigned to it.\n // Unmounting it will lead to losing the reference and breaking the functionality that is implemented on that ref.\n // That is the reason why there is no \"AnimatePresence\" with an \"exit\" animation here.\n // Instead, we change the \"animate\" values.\n\n return createPortal(\n <>\n <motion.div\n {...remainingProps}\n className={sheetClasses}\n style={{\n width,\n maxWidth: detach ? `calc(100% - ${DEFAULT_OFFSET_PX * 2}px)` : '100%',\n margin: detach ? `${DEFAULT_OFFSET_PX}px` : 0,\n }}\n initial={{ opacity: 0 }}\n animate={{\n opacity: isShown ? 1 : 0,\n y: 0,\n bottom: isShown ? 0 : OFFSET_POSITION,\n height: isShown ? sheetHeight : 0,\n }}\n >\n <div className='bottom-sheet-header'>\n {title && (\n <div\n className={\n 'bottom-sheet-title display-flex justify-content-between padding-15 ' +\n 'border border-top-none border-left-none border-right-none border-color-lighter'\n }\n >\n <div className='text-size-18'>{title}</div>\n </div>\n )}\n {showCloseButton && (\n <div className='bottom-sheet-close position-absolute top-10 right-10'>\n <button type='button' className='btn btn-muted btn-sm btn-icon-only' onClick={handleToggle}>\n <span className='rioglyph rioglyph-remove' />\n </button>\n </div>\n )}\n {showMaximizeButton && (\n <div\n className={\n 'bottom-sheet-maximize height-30 ' +\n 'position-absolute top-5 left-50pct translate-x-50 cursor-pointer'\n }\n onClick={handleMaximize}\n >\n <div className='height-5 width-40 rounded bg-lighter' />\n </div>\n )}\n </div>\n <div className={sheetBodyClasses} ref={bodyRef}>\n {isShown && children}\n </div>\n </motion.div>\n\n {hasBackdrop && isShown && <div className='bottom-sheet-backdrop' onClick={handleBackdropClick} />}\n </>,\n modalRoot\n ) as ReactElement;\n};\n\nexport default BottomSheet;\n"],"names":["OFFSET_POSITION","DEFAULT_OFFSET_PX","BottomSheet","props","show","onClose","width","height","title","detach","detachOffset","hasBackdrop","showCloseButton","showMaximizeButton","onHeightChange","bodyRef","bodyClassName","className","children","onBackdropClick","remainingProps","isShown","setIsShown","useState","isMaxHeight","setIsMaxHeight","useEffect","modalRoot","getOrCreatePortalRoot","handleToggle","newValue","isFunction","handleBackdropClick","handleMaximize","sheetClasses","classNames","sheetBodyClasses","sheetHeight","createPortal","jsxs","Fragment","motion","jsx"],"mappings":";;;;;;;AAeA,MAAMA,IAAkB,MAClBC,IAAoB,IAgGpBC,IAAc,CAACC,MAAgD;AACjE,QAAM;AAAA,IACF,MAAAC,IAAO;AAAA,IACP,SAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC,IAAS;AAAA,IACT,cAAAC,IAAeT;AAAA,IACf,aAAAU,IAAc;AAAA,IACd,iBAAAC,IAAkB;AAAA,IAClB,oBAAAC,IAAqB;AAAA,IACrB,gBAAAC,IAAiB,MAAM;AAAA,IAAC;AAAA,IACxB,SAAAC;AAAA,IACA,eAAAC;AAAA,IACA,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,iBAAAC,IAAkB,MAAM;AAAA,IAAC;AAAA,IACzB,GAAGC;AAAA,EAAA,IACHjB,GAEE,CAACkB,GAASC,CAAU,IAAIC,EAASn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