@rio-cloud/rio-uikit 2.0.1 → 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 (567) 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.d.ts +2 -2
  22. package/components/actionBarItem/ActionBarItem.js +7 -7
  23. package/components/actionBarItem/ActionBarItem.js.map +1 -1
  24. package/components/actionBarItem/ActionBarItemIcon.js +1 -1
  25. package/components/actionBarItem/ActionBarItemIcon.js.map +1 -1
  26. package/components/actionBarItem/ActionBarItemList.js +1 -1
  27. package/components/actionBarItem/ActionBarItemList.js.map +1 -1
  28. package/components/actionBarItem/ActionBarItemListItem.js +1 -1
  29. package/components/actionBarItem/ActionBarItemListItem.js.map +1 -1
  30. package/components/actionBarItem/ActionBarItemListSeparator.js +1 -1
  31. package/components/actionBarItem/ActionBarItemListSeparator.js.map +1 -1
  32. package/components/actionBarItem/ActionBarItemPopoverContent.js +3 -3
  33. package/components/actionBarItem/ActionBarItemPopoverContent.js.map +1 -1
  34. package/components/actionBarItem/ActionBarOverlay.js +1 -1
  35. package/components/actionBarItem/ActionBarOverlay.js.map +1 -1
  36. package/components/activity/Activity.js +1 -1
  37. package/components/activity/Activity.js.map +1 -1
  38. package/components/animatedTextReveal/AnimatedTextReveal.js +1 -1
  39. package/components/animatedTextReveal/AnimatedTextReveal.js.map +1 -1
  40. package/components/applicationHeader/AppMenu.js +2 -2
  41. package/components/applicationHeader/AppMenu.js.map +1 -1
  42. package/components/applicationHeader/AppMenuDropdown.js +13 -11
  43. package/components/applicationHeader/AppMenuDropdown.js.map +1 -1
  44. package/components/applicationHeader/ApplicationHeader.d.ts +6 -7
  45. package/components/applicationHeader/ApplicationHeader.js +1 -1
  46. package/components/applicationHeader/ApplicationHeader.js.map +1 -1
  47. package/components/applicationHeader/MobileHeaderModal.js +8 -8
  48. package/components/applicationHeader/MobileHeaderModal.js.map +1 -1
  49. package/components/applicationHeader/MobileSubmoduleNavigation.js +1 -1
  50. package/components/applicationHeader/MobileSubmoduleNavigation.js.map +1 -1
  51. package/components/applicationHeader/NavItems.js +4 -4
  52. package/components/applicationHeader/NavItems.js.map +1 -1
  53. package/components/applicationLayout/ApplicationLayout.js +10 -10
  54. package/components/applicationLayout/ApplicationLayout.js.map +1 -1
  55. package/components/applicationLayout/ApplicationLayoutBody.js +2 -2
  56. package/components/applicationLayout/ApplicationLayoutBody.js.map +1 -1
  57. package/components/applicationLayout/ApplicationLayoutBodyBanner.js +1 -1
  58. package/components/applicationLayout/ApplicationLayoutBodyBanner.js.map +1 -1
  59. package/components/applicationLayout/ApplicationLayoutBodyBottomBar.js +1 -1
  60. package/components/applicationLayout/ApplicationLayoutBodyBottomBar.js.map +1 -1
  61. package/components/applicationLayout/ApplicationLayoutBodyNavigation.js +1 -1
  62. package/components/applicationLayout/ApplicationLayoutBodyNavigation.js.map +1 -1
  63. package/components/applicationLayout/ApplicationLayoutHeader.js +1 -1
  64. package/components/applicationLayout/ApplicationLayoutHeader.js.map +1 -1
  65. package/components/applicationLayout/ApplicationLayoutSidebar.js +1 -1
  66. package/components/applicationLayout/ApplicationLayoutSidebar.js.map +1 -1
  67. package/components/applicationLayout/SubNavigation.d.ts +7 -0
  68. package/components/applicationLayout/SubNavigation.js +1 -1
  69. package/components/applicationLayout/SubNavigation.js.map +1 -1
  70. package/components/assetTree/AssetTree.d.ts +7 -0
  71. package/components/assetTree/AssetTree.js +1 -1
  72. package/components/assetTree/AssetTree.js.map +1 -1
  73. package/components/assetTree/Tree.d.ts +15 -0
  74. package/components/assetTree/Tree.js +1 -1
  75. package/components/assetTree/Tree.js.map +1 -1
  76. package/components/assetTree/TreeIcon.d.ts +30 -0
  77. package/components/assetTree/TreeIcon.js +16 -0
  78. package/components/assetTree/TreeIcon.js.map +1 -0
  79. package/components/assetTree/TreeLeaf.js +23 -23
  80. package/components/assetTree/TreeLeaf.js.map +1 -1
  81. package/components/assetTree/TreeNode.js +25 -25
  82. package/components/assetTree/TreeNode.js.map +1 -1
  83. package/components/assetTree/TreeNodeContainer.js +1 -1
  84. package/components/assetTree/TreeNodeContainer.js.map +1 -1
  85. package/components/assetTree/TreeOption.js +3 -3
  86. package/components/assetTree/TreeOption.js.map +1 -1
  87. package/components/assetTree/TreeOptions.js +4 -4
  88. package/components/assetTree/TreeOptions.js.map +1 -1
  89. package/components/assetTree/TreeRoot.js +3 -3
  90. package/components/assetTree/TreeRoot.js.map +1 -1
  91. package/components/assetTree/TreeSearch.d.ts +2 -0
  92. package/components/assetTree/TreeSearch.js +3 -3
  93. package/components/assetTree/TreeSearch.js.map +1 -1
  94. package/components/assetTree/TreeSidebar.js +1 -1
  95. package/components/assetTree/TreeSidebar.js.map +1 -1
  96. package/components/assetTree/TreeSidebarCategories.js +4 -4
  97. package/components/assetTree/TreeSidebarCategories.js.map +1 -1
  98. package/components/assetTree/TreeSummary.js +1 -1
  99. package/components/assetTree/TreeSummary.js.map +1 -1
  100. package/components/assetTree/TypeCounter.js +1 -1
  101. package/components/assetTree/TypeCounter.js.map +1 -1
  102. package/components/autosuggest/AutoSuggest.js +1 -1
  103. package/components/autosuggest/AutoSuggest.js.map +1 -1
  104. package/components/avatar/Avatar.js +1 -1
  105. package/components/avatar/Avatar.js.map +1 -1
  106. package/components/banner/Banner.js +1 -1
  107. package/components/banner/Banner.js.map +1 -1
  108. package/components/banner/BannerContent.js +1 -1
  109. package/components/banner/BannerContent.js.map +1 -1
  110. package/components/barList/BarList.d.ts +26 -0
  111. package/components/barList/BarList.js +1 -1
  112. package/components/barList/BarList.js.map +1 -1
  113. package/components/bottomSheet/BottomSheet.d.ts +17 -3
  114. package/components/bottomSheet/BottomSheet.js +1 -1
  115. package/components/bottomSheet/BottomSheet.js.map +1 -1
  116. package/components/bottomSheet/TimedBottomSheet.d.ts +10 -0
  117. package/components/bottomSheet/TimedBottomSheet.js.map +1 -1
  118. package/components/button/Button.d.ts +53 -7
  119. package/components/button/Button.js +87 -64
  120. package/components/button/Button.js.map +1 -1
  121. package/components/button/ButtonToolbar.js +1 -1
  122. package/components/button/ButtonToolbar.js.map +1 -1
  123. package/components/button/ToggleButton.d.ts +4 -1
  124. package/components/button/ToggleButton.js.map +1 -1
  125. package/components/calendarStripe/CalendarStripe.d.ts +1 -1
  126. package/components/calendarStripe/CalendarStripe.js +48 -50
  127. package/components/calendarStripe/CalendarStripe.js.map +1 -1
  128. package/components/card/Card.js +1 -1
  129. package/components/card/Card.js.map +1 -1
  130. package/components/charts/Area.d.ts +2 -2
  131. package/components/charts/Area.js.map +1 -1
  132. package/components/charts/Line.d.ts +2 -2
  133. package/components/charts/Line.js.map +1 -1
  134. package/components/charts/RadialBarChart.js +106 -103
  135. package/components/charts/RadialBarChart.js.map +1 -1
  136. package/components/checkbox/Checkbox.d.ts +0 -3
  137. package/components/checkbox/Checkbox.js +6 -6
  138. package/components/checkbox/Checkbox.js.map +1 -1
  139. package/components/circularProgress/CircularProgress.d.ts +139 -0
  140. package/components/circularProgress/CircularProgress.js +197 -0
  141. package/components/circularProgress/CircularProgress.js.map +1 -0
  142. package/components/clearableInput/ClearableInput.d.ts +21 -20
  143. package/components/clearableInput/ClearableInput.js +9 -9
  144. package/components/clearableInput/ClearableInput.js.map +1 -1
  145. package/components/collapse/Collapse.d.ts +3 -0
  146. package/components/collapse/Collapse.js +12 -12
  147. package/components/collapse/Collapse.js.map +1 -1
  148. package/components/contentLoader/ContentLoader.d.ts +10 -2
  149. package/components/contentLoader/ContentLoader.js.map +1 -1
  150. package/components/dataTabs/DataTabHeader.js +1 -1
  151. package/components/dataTabs/DataTabHeader.js.map +1 -1
  152. package/components/dataTabs/DataTabs.d.ts +6 -0
  153. package/components/dataTabs/DataTabs.js +4 -4
  154. package/components/dataTabs/DataTabs.js.map +1 -1
  155. package/components/datepicker/DatePicker.js +6 -6
  156. package/components/datepicker/DatePicker.js.map +1 -1
  157. package/components/datepicker/DateRangePicker.js +1 -1
  158. package/components/datepicker/DateRangePicker.js.map +1 -1
  159. package/components/datepicker/DayPicker.js +1 -1
  160. package/components/datepicker/DayPicker.js.map +1 -1
  161. package/components/dialog/ConfirmationDialog.d.ts +22 -0
  162. package/components/dialog/ConfirmationDialog.js.map +1 -1
  163. package/components/dialog/Dialog.d.ts +13 -1
  164. package/components/dialog/Dialog.js +55 -55
  165. package/components/dialog/Dialog.js.map +1 -1
  166. package/components/dialog/DialogBody.js +1 -1
  167. package/components/dialog/DialogBody.js.map +1 -1
  168. package/components/dialog/DialogFooter.js +1 -1
  169. package/components/dialog/DialogFooter.js.map +1 -1
  170. package/components/dialog/DialogHeader.js +1 -1
  171. package/components/dialog/DialogHeader.js.map +1 -1
  172. package/components/dialog/MediaDialog.js +1 -1
  173. package/components/dialog/MediaDialog.js.map +1 -1
  174. package/components/dialog/ReleaseNotesDialog.d.ts +3 -3
  175. package/components/dialog/ReleaseNotesDialog.js.map +1 -1
  176. package/components/dialog/SplitDialog.js +1 -1
  177. package/components/dialog/SplitDialog.js.map +1 -1
  178. package/components/divider/Divider.js +1 -1
  179. package/components/divider/Divider.js.map +1 -1
  180. package/components/dropdown/ButtonDropdown.d.ts +4 -0
  181. package/components/dropdown/ButtonDropdown.js +52 -52
  182. package/components/dropdown/ButtonDropdown.js.map +1 -1
  183. package/components/dropdown/DropdownSubmenu.d.ts +4 -0
  184. package/components/dropdown/DropdownSubmenu.js +3 -3
  185. package/components/dropdown/DropdownSubmenu.js.map +1 -1
  186. package/components/dropdown/DropdownToggleButton.d.ts +1 -1
  187. package/components/dropdown/DropdownToggleButton.js +4 -3
  188. package/components/dropdown/DropdownToggleButton.js.map +1 -1
  189. package/components/dropdown/SplitCaretButton.js +6 -6
  190. package/components/dropdown/SplitCaretButton.js.map +1 -1
  191. package/components/editableContent/EditableContent.d.ts +6 -0
  192. package/components/editableContent/EditableContent.js +1 -1
  193. package/components/editableContent/EditableContent.js.map +1 -1
  194. package/components/ellipsis/TextTruncateMiddle.d.ts +23 -0
  195. package/components/ellipsis/TextTruncateMiddle.js +21 -0
  196. package/components/ellipsis/TextTruncateMiddle.js.map +1 -0
  197. package/components/expander/ExpanderList.d.ts +3 -0
  198. package/components/expander/ExpanderList.js +5 -5
  199. package/components/expander/ExpanderList.js.map +1 -1
  200. package/components/expander/ExpanderPanel.d.ts +14 -4
  201. package/components/expander/ExpanderPanel.js +1 -1
  202. package/components/expander/ExpanderPanel.js.map +1 -1
  203. package/components/fade/Fade.d.ts +1 -1
  204. package/components/fade/Fade.js.map +1 -1
  205. package/components/feedback/FeedbackRating.js +1 -1
  206. package/components/feedback/FeedbackRating.js.map +1 -1
  207. package/components/feedback/FeedbackReactions.js +1 -1
  208. package/components/feedback/FeedbackReactions.js.map +1 -1
  209. package/components/filepicker/FilePicker.d.ts +0 -2
  210. package/components/filepicker/FilePicker.js.map +1 -1
  211. package/components/formLabel/FormLabel.js +6 -9
  212. package/components/formLabel/FormLabel.js.map +1 -1
  213. package/components/formLabel/LabeledElement.js +1 -1
  214. package/components/formLabel/LabeledElement.js.map +1 -1
  215. package/components/groupedItemList/GroupedItemList.d.ts +10 -7
  216. package/components/groupedItemList/GroupedItemList.js.map +1 -1
  217. package/components/listMenu/ListMenu.js +2 -5
  218. package/components/listMenu/ListMenu.js.map +1 -1
  219. package/components/listMenu/ListMenuGroup.d.ts +2 -1
  220. package/components/listMenu/ListMenuGroup.js +2 -2
  221. package/components/listMenu/ListMenuGroup.js.map +1 -1
  222. package/components/loadMore/LoadMoreButton.js +1 -1
  223. package/components/loadMore/LoadMoreButton.js.map +1 -1
  224. package/components/loadMore/LoadMoreProgress.js +1 -1
  225. package/components/loadMore/LoadMoreProgress.js.map +1 -1
  226. package/components/map/components/Map.js.map +1 -1
  227. package/components/map/components/constants.js.map +1 -1
  228. package/components/map/components/features/ContextMenuItem.d.ts +1 -1
  229. package/components/map/components/features/ContextMenuItem.js +2 -17
  230. package/components/map/components/features/ContextMenuItem.js.map +1 -1
  231. package/components/map/components/features/MapSettings.js +4 -4
  232. package/components/map/components/features/MapSettings.js.map +1 -1
  233. package/components/map/components/features/basics/Polyline.d.ts +4 -1
  234. package/components/map/components/features/basics/Polyline.js +1 -1
  235. package/components/map/components/features/basics/Polyline.js.map +1 -1
  236. package/components/map/components/features/layers/MarkerLayer.d.ts +3 -1
  237. package/components/map/components/features/layers/MarkerLayer.js.map +1 -1
  238. package/components/map/components/features/layers/clustering/ClusterLayer.js +1 -1
  239. package/components/map/components/features/layers/clustering/ClusterLayer.js.map +1 -1
  240. package/components/map/components/features/layers/clustering/SimpleClusterLayer.d.ts +3 -2
  241. package/components/map/components/features/layers/clustering/SimpleClusterLayer.js.map +1 -1
  242. package/components/map/components/features/layers/overlayLayers/RoadRestrictionLayer.js +7 -7
  243. package/components/map/components/features/layers/overlayLayers/RoadRestrictionLayer.js.map +1 -1
  244. package/components/map/components/features/layers/overlayLayers/TrafficLayer.js +4 -4
  245. package/components/map/components/features/layers/overlayLayers/TrafficLayer.js.map +1 -1
  246. package/components/map/components/features/settings/MapSettingsItem.js +1 -1
  247. package/components/map/components/features/settings/MapSettingsItem.js.map +1 -1
  248. package/components/map/components/features/settings/MapSettingsPanel.js +6 -20
  249. package/components/map/components/features/settings/MapSettingsPanel.js.map +1 -1
  250. package/components/map/components/features/settings/MapSettingsTile.js +87 -61
  251. package/components/map/components/features/settings/MapSettingsTile.js.map +1 -1
  252. package/components/map/components/features/settings/ZoomButtons.js +1 -1
  253. package/components/map/components/features/settings/ZoomButtons.js.map +1 -1
  254. package/components/map/components/features/settings/builtinSettings/MapTypeSettings.d.ts +38 -1
  255. package/components/map/components/features/settings/builtinSettings/MapTypeSettings.js +128 -92
  256. package/components/map/components/features/settings/builtinSettings/MapTypeSettings.js.map +1 -1
  257. package/components/map/utils/clustering.d.ts +6 -1
  258. package/components/map/utils/clustering.js +25 -19
  259. package/components/map/utils/clustering.js.map +1 -1
  260. package/components/map/utils/eventHandling.js +9 -9
  261. package/components/map/utils/eventHandling.js.map +1 -1
  262. package/components/map/utils/mapUtils.d.ts +6 -6
  263. package/components/map/utils/mapUtils.js +14 -19
  264. package/components/map/utils/mapUtils.js.map +1 -1
  265. package/components/map/utils/rendering.d.ts +1 -1
  266. package/components/map/utils/rendering.js +23 -23
  267. package/components/map/utils/rendering.js.map +1 -1
  268. package/components/mapMarker/ClusterMapMarker.js +1 -1
  269. package/components/mapMarker/ClusterMapMarker.js.map +1 -1
  270. package/components/mapMarker/SingleMapMarker.js +1 -1
  271. package/components/mapMarker/SingleMapMarker.js.map +1 -1
  272. package/components/menuItems/MenuItem.d.ts +23 -0
  273. package/components/menuItems/MenuItem.js +1 -1
  274. package/components/menuItems/MenuItem.js.map +1 -1
  275. package/components/menuItems/MenuItemList.js +1 -1
  276. package/components/menuItems/MenuItemList.js.map +1 -1
  277. package/components/navigation/AppNavigationBar.js +4 -4
  278. package/components/navigation/AppNavigationBar.js.map +1 -1
  279. package/components/noData/NoData.js +1 -1
  280. package/components/noData/NoData.js.map +1 -1
  281. package/components/notification/Notification.js +4 -4
  282. package/components/notification/Notification.js.map +1 -1
  283. package/components/numberControl/NumberControl.js +4 -4
  284. package/components/numberControl/NumberControl.js.map +1 -1
  285. package/components/numberInput/NumberInput.js +1 -1
  286. package/components/numberInput/NumberInput.js.map +1 -1
  287. package/components/onboarding/OnboardingTip.d.ts +18 -12
  288. package/components/onboarding/OnboardingTip.js +4 -4
  289. package/components/onboarding/OnboardingTip.js.map +1 -1
  290. package/components/overlay/OverlayTrigger.d.ts +43 -1
  291. package/components/overlay/OverlayTrigger.js.map +1 -1
  292. package/components/page/Page.js +1 -1
  293. package/components/page/Page.js.map +1 -1
  294. package/components/pager/Pager.d.ts +3 -0
  295. package/components/pager/Pager.js +1 -1
  296. package/components/pager/Pager.js.map +1 -1
  297. package/components/popover/Popover.d.ts +1 -0
  298. package/components/popover/Popover.js.map +1 -1
  299. package/components/preloader/ImagePreloader.d.ts +1 -1
  300. package/components/preloader/ImagePreloader.js.map +1 -1
  301. package/components/radiobutton/RadioButton.d.ts +10 -6
  302. package/components/radiobutton/RadioButton.js +5 -5
  303. package/components/radiobutton/RadioButton.js.map +1 -1
  304. package/components/radiobutton/RadioCardGroup.d.ts +86 -0
  305. package/components/radiobutton/RadioCardGroup.js +110 -0
  306. package/components/radiobutton/RadioCardGroup.js.map +1 -0
  307. package/components/releaseNotes/ReleaseNotes.d.ts +0 -3
  308. package/components/releaseNotes/ReleaseNotes.js.map +1 -1
  309. package/components/resizer/Resizer.d.ts +17 -3
  310. package/components/resizer/Resizer.js +1 -1
  311. package/components/resizer/Resizer.js.map +1 -1
  312. package/components/responsiveColumnStripe/ResponsiveColumnStripe.js +1 -1
  313. package/components/responsiveColumnStripe/ResponsiveColumnStripe.js.map +1 -1
  314. package/components/rioglyph/Rioglyph.d.ts +20 -8
  315. package/components/rioglyph/Rioglyph.js +1 -1
  316. package/components/rioglyph/Rioglyph.js.map +1 -1
  317. package/components/rioglyph/RioglyphIconType.d.ts +1 -1
  318. package/components/rules/RuleConnector.js +1 -1
  319. package/components/rules/RuleConnector.js.map +1 -1
  320. package/components/rules/RuleContainer.js +27 -27
  321. package/components/rules/RuleContainer.js.map +1 -1
  322. package/components/rules/RulesWrapper.js +1 -1
  323. package/components/rules/RulesWrapper.js.map +1 -1
  324. package/components/saveableInput/SaveableDateInput.d.ts +20 -2
  325. package/components/saveableInput/SaveableDateInput.js +1 -1
  326. package/components/saveableInput/SaveableDateInput.js.map +1 -1
  327. package/components/saveableInput/SaveableInput.d.ts +10 -2
  328. package/components/saveableInput/SaveableInput.js +49 -49
  329. package/components/saveableInput/SaveableInput.js.map +1 -1
  330. package/components/searchHighlight/SearchHighlightText.d.ts +28 -0
  331. package/components/searchHighlight/SearchHighlightText.js +15 -0
  332. package/components/searchHighlight/SearchHighlightText.js.map +1 -0
  333. package/components/selects/BaseSelectDropdown.js +90 -79
  334. package/components/selects/BaseSelectDropdown.js.map +1 -1
  335. package/components/selects/ClearButton.js +4 -4
  336. package/components/selects/ClearButton.js.map +1 -1
  337. package/components/selects/Multiselect.js +6 -6
  338. package/components/selects/Multiselect.js.map +1 -1
  339. package/components/selects/MultiselectToggleFilter.js +4 -4
  340. package/components/selects/MultiselectToggleFilter.js.map +1 -1
  341. package/components/selects/MultiselectToggleSelection.js +1 -1
  342. package/components/selects/MultiselectToggleSelection.js.map +1 -1
  343. package/components/selects/Select.d.ts +5 -0
  344. package/components/selects/Select.js +93 -93
  345. package/components/selects/Select.js.map +1 -1
  346. package/components/selects/SelectFilter.js +1 -1
  347. package/components/selects/SelectFilter.js.map +1 -1
  348. package/components/selects/WithFeedbackAndAddon.js +1 -1
  349. package/components/selects/WithFeedbackAndAddon.js.map +1 -1
  350. package/components/sidebars/Sidebar.d.ts +19 -3
  351. package/components/sidebars/Sidebar.js +54 -54
  352. package/components/sidebars/Sidebar.js.map +1 -1
  353. package/components/sidebars/SidebarBackdrop.js +4 -4
  354. package/components/sidebars/SidebarBackdrop.js.map +1 -1
  355. package/components/sidebars/SidebarFooter.js +1 -1
  356. package/components/sidebars/SidebarFooter.js.map +1 -1
  357. package/components/sidebars/SidebarFullscreenToggle.js +4 -4
  358. package/components/sidebars/SidebarFullscreenToggle.js.map +1 -1
  359. package/components/slider/RangeSlider.d.ts +15 -0
  360. package/components/slider/RangeSlider.js +1 -1
  361. package/components/slider/RangeSlider.js.map +1 -1
  362. package/components/slider/Slider.d.ts +9 -0
  363. package/components/slider/Slider.js +1 -1
  364. package/components/slider/Slider.js.map +1 -1
  365. package/components/smoothScrollbars/SmoothScrollbars.d.ts +44 -0
  366. package/components/smoothScrollbars/SmoothScrollbars.js +1 -1
  367. package/components/smoothScrollbars/SmoothScrollbars.js.map +1 -1
  368. package/components/spinner/Spinner.d.ts +3 -3
  369. package/components/spinner/Spinner.js +5 -4
  370. package/components/spinner/Spinner.js.map +1 -1
  371. package/components/states/CustomState.d.ts +69 -1
  372. package/components/states/CustomState.js +1 -1
  373. package/components/states/CustomState.js.map +1 -1
  374. package/components/states/EmptyState.d.ts +1 -1
  375. package/components/states/EmptyState.js.map +1 -1
  376. package/components/states/ErrorState.d.ts +1 -1
  377. package/components/states/ErrorState.js.map +1 -1
  378. package/components/states/ForbiddenState.d.ts +1 -1
  379. package/components/states/ForbiddenState.js.map +1 -1
  380. package/components/states/MaintenanceState.d.ts +1 -1
  381. package/components/states/MaintenanceState.js.map +1 -1
  382. package/components/states/NotBookedState.d.ts +1 -1
  383. package/components/states/NotBookedState.js.map +1 -1
  384. package/components/states/NotFoundState.d.ts +1 -1
  385. package/components/states/NotFoundState.js.map +1 -1
  386. package/components/states/StateButton.js +1 -1
  387. package/components/states/StateButton.js.map +1 -1
  388. package/components/states/StateIcon.d.ts +14 -1
  389. package/components/states/StateIcon.js.map +1 -1
  390. package/components/statsWidget/StatsWidget.d.ts +2 -0
  391. package/components/statsWidget/StatsWidget.js +1 -1
  392. package/components/statsWidget/StatsWidget.js.map +1 -1
  393. package/components/statsWidget/StatsWidgetBody.d.ts +1 -0
  394. package/components/statsWidget/StatsWidgetBody.js +1 -1
  395. package/components/statsWidget/StatsWidgetBody.js.map +1 -1
  396. package/components/statsWidget/StatsWidgetFooter.js +1 -1
  397. package/components/statsWidget/StatsWidgetFooter.js.map +1 -1
  398. package/components/statsWidget/StatsWidgetHeader.js +1 -1
  399. package/components/statsWidget/StatsWidgetHeader.js.map +1 -1
  400. package/components/statsWidget/StatsWidgetNumber.d.ts +2 -0
  401. package/components/statsWidget/StatsWidgetNumber.js +2 -2
  402. package/components/statsWidget/StatsWidgetNumber.js.map +1 -1
  403. package/components/statsWidget/StatsWidgetSpacer.js +1 -1
  404. package/components/statsWidget/StatsWidgetSpacer.js.map +1 -1
  405. package/components/statsWidget/StatsWidgets.js +1 -1
  406. package/components/statsWidget/StatsWidgets.js.map +1 -1
  407. package/components/statusBar/StatusBar.d.ts +98 -3
  408. package/components/statusBar/StatusBar.js +24 -17
  409. package/components/statusBar/StatusBar.js.map +1 -1
  410. package/components/statusBar/StatusBarIcon.d.ts +2 -2
  411. package/components/statusBar/StatusBarIcon.js +4 -4
  412. package/components/statusBar/StatusBarIcon.js.map +1 -1
  413. package/components/statusBar/StatusBarLabel.d.ts +2 -2
  414. package/components/statusBar/StatusBarLabel.js +5 -7
  415. package/components/statusBar/StatusBarLabel.js.map +1 -1
  416. package/components/statusBar/StatusBarProgressBar.d.ts +1 -1
  417. package/components/statusBar/StatusBarProgressBar.js +1 -1
  418. package/components/statusBar/StatusBarProgressBar.js.map +1 -1
  419. package/components/steppedProgressBar/SteppedProgressBar.d.ts +1 -1
  420. package/components/steppedProgressBar/SteppedProgressBar.js +1 -1
  421. package/components/steppedProgressBar/SteppedProgressBar.js.map +1 -1
  422. package/components/switch/Switch.d.ts +28 -1
  423. package/components/switch/Switch.js +77 -35
  424. package/components/switch/Switch.js.map +1 -1
  425. package/components/table/SortArrowDown.d.ts +1 -1
  426. package/components/table/SortArrowDown.js.map +1 -1
  427. package/components/table/SortArrowUp.d.ts +1 -1
  428. package/components/table/SortArrowUp.js.map +1 -1
  429. package/components/table/TableCardsSorting.js +4 -4
  430. package/components/table/TableCardsSorting.js.map +1 -1
  431. package/components/table/TableHead.js +1 -1
  432. package/components/table/TableHead.js.map +1 -1
  433. package/components/table/TableSearch.js +1 -1
  434. package/components/table/TableSearch.js.map +1 -1
  435. package/components/table/TableSettingsColumnButtons.d.ts +1 -1
  436. package/components/table/TableSettingsColumnButtons.js +1 -1
  437. package/components/table/TableSettingsColumnButtons.js.map +1 -1
  438. package/components/table/TableSettingsColumnDetails.d.ts +1 -1
  439. package/components/table/TableSettingsColumnDetails.js +1 -1
  440. package/components/table/TableSettingsColumnDetails.js.map +1 -1
  441. package/components/table/TableSettingsDialog.d.ts +56 -1
  442. package/components/table/TableSettingsDialog.js +170 -144
  443. package/components/table/TableSettingsDialog.js.map +1 -1
  444. package/components/table/TableSettingsDialogFooter.js +9 -9
  445. package/components/table/TableSettingsDialogFooter.js.map +1 -1
  446. package/components/table/TableSettingsListContainer.d.ts +1 -1
  447. package/components/table/TableSettingsListContainer.js.map +1 -1
  448. package/components/table/TableSettingsListItem.d.ts +1 -1
  449. package/components/table/TableSettingsListItem.js +8 -8
  450. package/components/table/TableSettingsListItem.js.map +1 -1
  451. package/components/table/TableToolbar.js +1 -1
  452. package/components/table/TableToolbar.js.map +1 -1
  453. package/components/table/TableViewToggles.d.ts +21 -1
  454. package/components/table/TableViewToggles.js +1 -1
  455. package/components/table/TableViewToggles.js.map +1 -1
  456. package/components/tag/Tag.d.ts +7 -2
  457. package/components/tag/Tag.js +1 -1
  458. package/components/tag/Tag.js.map +1 -1
  459. package/components/tag/TagList.js +1 -1
  460. package/components/tag/TagList.js.map +1 -1
  461. package/components/tagManager/CustomSuggestionItem.js +1 -1
  462. package/components/tagManager/CustomSuggestionItem.js.map +1 -1
  463. package/components/tagManager/TagManager.d.ts +29 -2
  464. package/components/tagManager/TagManager.js +6 -6
  465. package/components/tagManager/TagManager.js.map +1 -1
  466. package/components/tagManager/TagManagerItemList.d.ts +1 -1
  467. package/components/tagManager/TagManagerItemList.js +1 -1
  468. package/components/tagManager/TagManagerItemList.js.map +1 -1
  469. package/components/teaser/Teaser.d.ts +57 -55
  470. package/components/teaser/Teaser.js +1 -1
  471. package/components/teaser/Teaser.js.map +1 -1
  472. package/components/teaser/TeaserContainer.d.ts +1 -1
  473. package/components/teaser/TeaserContainer.js +1 -1
  474. package/components/teaser/TeaserContainer.js.map +1 -1
  475. package/components/timepicker/TimePicker.d.ts +20 -0
  476. package/components/timepicker/TimePicker.js +153 -99
  477. package/components/timepicker/TimePicker.js.map +1 -1
  478. package/components/tooltip/SimpleTooltip.d.ts +22 -4
  479. package/components/tooltip/SimpleTooltip.js.map +1 -1
  480. package/components/tooltip/Tooltip.d.ts +22 -2
  481. package/components/tooltip/Tooltip.js +1 -1
  482. package/components/tooltip/Tooltip.js.map +1 -1
  483. package/components/tracker/Tracker.d.ts +85 -0
  484. package/components/tracker/Tracker.js +54 -0
  485. package/components/tracker/Tracker.js.map +1 -0
  486. package/components/tracker/TrackerBlock.d.ts +11 -0
  487. package/components/tracker/TrackerBlock.js +34 -0
  488. package/components/tracker/TrackerBlock.js.map +1 -0
  489. package/components/video/ResponsiveVideo.d.ts +8 -3
  490. package/components/video/ResponsiveVideo.js +1 -1
  491. package/components/video/ResponsiveVideo.js.map +1 -1
  492. package/hooks/useCookies.d.ts +79 -0
  493. package/hooks/useCookies.js +33 -0
  494. package/hooks/useCookies.js.map +1 -0
  495. package/hooks/useInterval.js +5 -5
  496. package/hooks/useInterval.js.map +1 -1
  497. package/hooks/useIsFocusWithin.js +3 -3
  498. package/hooks/useIsFocusWithin.js.map +1 -1
  499. package/hooks/useKey.d.ts +1 -1
  500. package/hooks/useKey.js.map +1 -1
  501. package/hooks/useLatest.d.ts +16 -0
  502. package/hooks/useLatest.js +11 -0
  503. package/hooks/useLatest.js.map +1 -0
  504. package/hooks/useOnboarding.d.ts +86 -80
  505. package/hooks/useOnboarding.js.map +1 -1
  506. package/hooks/usePostMessage.d.ts +2 -1
  507. package/hooks/usePostMessage.js.map +1 -1
  508. package/hooks/useRioCookieConsent.d.ts +49 -0
  509. package/hooks/useRioCookieConsent.js +44 -0
  510. package/hooks/useRioCookieConsent.js.map +1 -0
  511. package/hooks/useSearch.d.ts +1 -1
  512. package/hooks/useSearch.js +28 -17
  513. package/hooks/useSearch.js.map +1 -1
  514. package/hooks/useSearchHighlight.d.ts +60 -0
  515. package/hooks/useSearchHighlight.js +54 -0
  516. package/hooks/useSearchHighlight.js.map +1 -0
  517. package/hooks/useTableExport.js.map +1 -1
  518. package/hooks/useTimeout.js +11 -11
  519. package/hooks/useTimeout.js.map +1 -1
  520. package/hooks/useUncontrollable.d.ts +1 -1
  521. package/hooks/useUncontrollable.js.map +1 -1
  522. package/hooks/useUrlState.d.ts +62 -0
  523. package/hooks/useUrlState.js +137 -0
  524. package/hooks/useUrlState.js.map +1 -0
  525. package/mergeClassNameOverrides.d.ts +1 -0
  526. package/mergeClassNameOverrides.js +5 -0
  527. package/mergeClassNameOverrides.js.map +1 -0
  528. package/package.json +18 -21
  529. package/routeUtils.js +11 -5
  530. package/routeUtils.js.map +1 -1
  531. package/themes/Volkswagen/components/applicationHeader/VolkswagenApplicationHeader.js +1 -1
  532. package/themes/Volkswagen/components/applicationHeader/VolkswagenApplicationHeader.js.map +1 -1
  533. package/useCookies.d.ts +2 -0
  534. package/useCookies.js +5 -0
  535. package/useCookies.js.map +1 -0
  536. package/useRioCookieConsent.d.ts +2 -0
  537. package/useRioCookieConsent.js +5 -0
  538. package/useRioCookieConsent.js.map +1 -0
  539. package/useSearchHighlight.d.ts +2 -0
  540. package/useSearchHighlight.js +6 -0
  541. package/useSearchHighlight.js.map +1 -0
  542. package/useUrlState.d.ts +2 -0
  543. package/useUrlState.js +5 -0
  544. package/useUrlState.js.map +1 -0
  545. package/utils/classNames.d.ts +3 -0
  546. package/utils/classNames.js +5 -0
  547. package/utils/classNames.js.map +1 -0
  548. package/utils/colorScheme.js +14 -13
  549. package/utils/colorScheme.js.map +1 -1
  550. package/utils/cssuseragent.js.map +1 -1
  551. package/utils/mergeClassNameOverrides.d.ts +1 -0
  552. package/utils/mergeClassNameOverrides.js +55 -0
  553. package/utils/mergeClassNameOverrides.js.map +1 -0
  554. package/utils/routeUtils.d.ts +122 -13
  555. package/utils/routeUtils.js +89 -31
  556. package/utils/routeUtils.js.map +1 -1
  557. package/utils/scrollItemIntoView.js +12 -11
  558. package/utils/scrollItemIntoView.js.map +1 -1
  559. package/utils/urlFeatureToggles.js +19 -20
  560. package/utils/urlFeatureToggles.js.map +1 -1
  561. package/version.d.ts +1 -1
  562. package/version.js +1 -1
  563. package/version.js.map +1 -1
  564. package/components/states/BaseStateProps.d.ts +0 -66
  565. package/components/statusBar/StatusBar.types.d.ts +0 -85
  566. package/components/table/TableSettingsDialog.types.d.ts +0 -39
  567. package/components/tagManager/TagManagerTag.d.ts +0 -5
@@ -11,7 +11,7 @@ export type OverlayTriggerProps = {
11
11
  * Manually toggling `show` does **not** wait for `delay` to change the visibility.
12
12
  *
13
13
  * @controllable onToggle
14
- * @default: false
14
+ * @default false
15
15
  */
16
16
  show?: boolean;
17
17
  /**
@@ -31,6 +31,15 @@ export type OverlayTriggerProps = {
31
31
  *
32
32
  * The `click` trigger ignores the configured `delay`.
33
33
  *
34
+ * Possible values are:
35
+ *
36
+ * - `OverlayTrigger.TRIGGER_CLICK`
37
+ * - `OverlayTrigger.TRIGGER_HOVER`
38
+ * - `OverlayTrigger.TRIGGER_HOVER`
39
+ * - `'hover'`
40
+ * - `'click'`
41
+ * - `'focus'`
42
+ *
34
43
  * @default 'hover'
35
44
  */
36
45
  trigger?: TriggerType;
@@ -48,6 +57,39 @@ export type OverlayTriggerProps = {
48
57
  /**
49
58
  * The placement of the Overlay in relation to it's `target`.
50
59
  *
60
+ * possible values are:
61
+ *
62
+ * - `OverlayTrigger.AUTO_START`
63
+ * - `OverlayTrigger.AUTO`
64
+ * - `OverlayTrigger.AUTO_END`
65
+ * - `OverlayTrigger.TOP_START`
66
+ * - `OverlayTrigger.TOP`
67
+ * - `OverlayTrigger.TOP_END`
68
+ * - `OverlayTrigger.RIGHT_START`
69
+ * - `OverlayTrigger.RIGHT`
70
+ * - `OverlayTrigger.RIGHT_END`
71
+ * - `OverlayTrigger.BOTTOM_START`
72
+ * - `OverlayTrigger.BOTTOM`
73
+ * - `OverlayTrigger.BOTTOM_END`
74
+ * - `OverlayTrigger.LEFT_START`
75
+ * - `OverlayTrigger.LEFT`
76
+ * - `OverlayTrigger.LEFT_END`
77
+ * - `'auto-start'`
78
+ * - `'auto'`
79
+ * - `'auto-end'`
80
+ * - `'top-start'`
81
+ * - `'top'`
82
+ * - `'top-end'`
83
+ * - `'right-start'`
84
+ * - `'right'`
85
+ * - `'right-end'`
86
+ * - `'bottom-start'`
87
+ * - `'bottom'`
88
+ * - `'bottom-end'`
89
+ * - `'left-start'`
90
+ * - `'left'`
91
+ * - `'left-end'`
92
+ *
51
93
  * @default 'top'
52
94
  */
53
95
  placement?: Placement;
@@ -1 +1 @@
1
- {"version":3,"file":"OverlayTrigger.js","sources":["../../../src/components/overlay/OverlayTrigger.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useRef, useState, type PropsWithChildren } from 'react';\nimport ReactDOM from 'react-dom';\nimport { usePopper, type Modifier } from 'react-popper';\nimport type { Options } from '@popperjs/core';\n\nimport { PLACEMENT, type Placement } from '../../values/Placement';\nimport { TRIGGER, type TriggerType } from '../../values/Trigger';\nimport mergeRefs from '../../utils/mergeRefs';\nimport { useClickOutsideWithRef } from '../../hooks/useClickOutside';\nimport { useChainedTimeout } from '../../hooks/useTimeout';\nimport { useUncontrolledProp } from '../../hooks/useUncontrollable';\n\ntype PopperConfig = Partial<Options>;\n\nexport type OverlayTriggerProps = {\n /**\n * The visibility of the Overlay. `show` is a _controlled_ prop so should be paired\n * with `onToggle` to avoid breaking user interactions.\n *\n * Manually toggling `show` does **not** wait for `delay` to change the visibility.\n *\n * @controllable onToggle\n * @default: false\n */\n show?: boolean;\n\n /**\n * The initial visibility state of the Overlay.\n *\n * @default false\n */\n defaultShow?: boolean;\n\n /**\n * Defines the usage of React Portal.\n *\n * @default true\n */\n enablePortal?: boolean;\n\n /**\n * Specify which action or actions trigger Overlay visibility\n *\n * The `click` trigger ignores the configured `delay`.\n *\n * @default 'hover'\n */\n trigger?: TriggerType;\n\n /**\n * A millisecond delay amount to show and hide the Overlay once triggered\n */\n delay?: number | { show?: number; hide?: number };\n\n /**\n * An element or text to overlay next to the target.\n */\n overlay: React.ReactElement;\n\n /**\n * The placement of the Overlay in relation to it's `target`.\n *\n * @default 'top'\n */\n placement?: Placement;\n\n /**\n * A Popper.js config object passed to the underlying popper instance.\n * If no custom config is provided, a default config will be used. This default config\n * includes an arrow element. In case you want to use a custom config and an arrow, include the arrow\n * modifier so the correct arrow element can be injected for the arrow modifier.\n *\n * @example\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 popperConfig?: PopperConfig;\n\n /**\n * Specify whether the overlay should trigger onHide when the user clicks outside the overlay.\n *\n * @default true\n */\n rootClose?: boolean;\n\n /**\n * A callback that fires when the user triggers a change in tooltip visibility.\n *\n * `onToggle` is called with the desired next `show`, and generally should be passed\n * back to the `show` prop. `onToggle` fires _after_ the configured `delay`\n *\n * @controllable `show`\n */\n onToggle?: (show: boolean) => void;\n};\n\ntype TriggerProps = {\n ref: React.Ref<unknown>;\n onClick?: React.MouseEventHandler;\n onFocus?: React.FocusEventHandler;\n onBlur?: React.FocusEventHandler;\n onMouseOver?: React.MouseEventHandler;\n onMouseOut?: React.MouseEventHandler;\n};\n\nconst OverlayTrigger = (props: PropsWithChildren<OverlayTriggerProps>) => {\n const {\n show: propsShow,\n defaultShow = false,\n enablePortal = true,\n trigger = TRIGGER.HOVER,\n delay,\n overlay,\n placement = 'top',\n popperConfig,\n onToggle = () => {},\n rootClose = true,\n children,\n } = props;\n\n // Use a hook to handle controlled props that work in pairs like in this case the \"show\" and \"onToggle\"\n // props. It returns a setter function that automatically triggers the callback.\n const [show, setShow] = useUncontrolledProp(propsShow, defaultShow, onToggle);\n\n const hoverStateRef = useRef<string>('');\n\n const timeout = useChainedTimeout();\n\n const { onFocus, onBlur, onClick } =\n typeof children !== 'function' ? React.Children.only(children as any).props : ({} as any);\n\n // Simple implementation of mouseEnter and mouseLeave.\n // React's built version is broken: https://github.com/facebook/react/issues/4251\n // for cases when the trigger is disabled and mouseOut/Over can cause flicker\n // moving from one child element to another.\n const handleMouseOverOut = (\n handler: (...args: [React.MouseEvent, ...unknown[]]) => void,\n args: [React.MouseEvent, ...unknown[]],\n _relatedNative: 'fromElement' | 'toElement'\n ) => {\n const [event] = args;\n const target = event.currentTarget as Node;\n\n const related = event.relatedTarget as Node | null;\n\n if ((!related || related !== target) && !target.contains(related)) {\n handler(...args);\n }\n };\n\n const handleShow = () => {\n timeout.clear();\n hoverStateRef.current = 'show';\n\n if (delay === 0 || (typeof delay !== 'number' && !delay?.show)) {\n setShow(true);\n return;\n }\n\n timeout.set(\n () => {\n if (hoverStateRef.current === 'show') {\n setShow(true);\n }\n },\n typeof delay === 'number' ? delay : delay?.show\n );\n };\n\n const handleHide = () => {\n timeout.clear();\n hoverStateRef.current = 'hide';\n\n if (typeof delay === 'number' || !delay?.hide) {\n setShow(false);\n return;\n }\n\n timeout.set(() => {\n if (hoverStateRef.current === 'hide') {\n setShow(false);\n }\n }, delay?.hide);\n };\n\n const handleFocus = useCallback(\n (...args: unknown[]) => {\n handleShow();\n onFocus?.(...args);\n },\n [handleShow, onFocus]\n );\n\n const handleBlur = useCallback(\n (...args: unknown[]) => {\n handleHide();\n onBlur?.(...args);\n },\n [handleHide, onBlur]\n );\n\n const handleClick = useCallback(\n (...args: unknown[]) => {\n setShow(!show);\n onClick?.(...args);\n },\n [onClick, setShow, show]\n );\n\n const handleMouseOver = useCallback(\n (...args: [React.MouseEvent, ...unknown[]]) => {\n handleMouseOverOut(handleShow, args, 'fromElement');\n },\n [handleShow]\n );\n\n const handleMouseOut = useCallback(\n (...args: [React.MouseEvent, ...unknown[]]) => {\n handleMouseOverOut(handleHide, args, 'toElement');\n },\n [handleHide]\n );\n\n const [triggerNode, setTriggerNode] = useState<HTMLButtonElement | null>(null);\n const [popperElement, setPopperElement] = useState<HTMLDivElement | null>(null);\n const [arrowElement, setArrowElement] = useState<HTMLDivElement | null>(null);\n\n const [arrowPlacement, setArrowPlacement] = useState(placement);\n\n const handleClickOutside = useCallback(\n (event: MouseEvent | TouchEvent) => {\n const isToggleTarget = triggerNode?.contains(event.target as Node);\n const isOverlayTarget = popperElement?.contains(event.target as Node);\n\n // Check if the click occurred outside the trigger element. Clicking on the trigger\n // itself is handled by the onClick handler\n if (show && rootClose && !isToggleTarget && !isOverlayTarget) {\n handleHide();\n }\n },\n [triggerNode, popperElement, rootClose, handleHide]\n );\n\n useClickOutsideWithRef(triggerNode, handleClickOutside);\n\n const triggerProps: TriggerProps = {\n ref: mergeRefs([(children as any).ref, setTriggerNode]),\n };\n\n if (trigger === 'click') {\n triggerProps.onClick = handleClick;\n } else if (trigger === 'focus') {\n triggerProps.onFocus = handleFocus;\n triggerProps.onBlur = handleBlur;\n } else if (trigger === 'hover') {\n triggerProps.onMouseOver = handleMouseOver;\n triggerProps.onMouseOut = handleMouseOut;\n }\n\n const defaultPopperConfig = {\n placement,\n modifiers: [\n {\n name: 'arrow',\n options: {\n element: arrowElement,\n },\n },\n {\n name: 'flip',\n options: {\n fallbackPlacements: ['right', 'left', 'top'],\n },\n },\n ],\n };\n\n if (popperConfig) {\n popperConfig.placement = placement;\n\n // if it has an arrow modifier, inject the arrow element\n const updatedModifiers: Modifier<any, any>[] = [];\n popperConfig.modifiers?.map((mod: Modifier<any, any>) => {\n if (mod.name !== 'arrow') {\n return updatedModifiers.push(mod);\n }\n return updatedModifiers.push({\n ...mod,\n options: {\n ...mod.options,\n element: arrowElement,\n },\n });\n });\n\n popperConfig.modifiers = updatedModifiers;\n }\n\n const popper = usePopper(triggerNode, popperElement, popperConfig || defaultPopperConfig);\n\n // In case the overlay causes an overflow and the \"flip\" modifier\n // changes the overlays placement, we nee to update the arrow placement as well\n useEffect(() => {\n if (popper.state) {\n // Adjust arrow styles based on placement if necessary\n setArrowPlacement(popper.state.placement);\n }\n }, [popper.state?.placement]);\n\n const overlayElement = React.cloneElement(overlay, {\n ...popper.attributes.popper,\n ref: setPopperElement,\n placement: arrowPlacement,\n style: { ...popper.styles.popper },\n arrowProps: {\n ...popper.attributes.arrow,\n style: popper.styles.arrow,\n ref: setArrowElement,\n },\n });\n\n return (\n <>\n {show && (enablePortal ? ReactDOM.createPortal(overlayElement, document.body) : overlayElement)}\n {React.cloneElement(children as any, triggerProps)}\n </>\n );\n};\n\nOverlayTrigger.TRIGGER_CLICK = TRIGGER.CLICK;\nOverlayTrigger.TRIGGER_HOVER = TRIGGER.HOVER;\nOverlayTrigger.TRIGGER_FOCUS = TRIGGER.FOCUS;\n\n// placement\nOverlayTrigger.AUTO_START = PLACEMENT.AUTO_START;\nOverlayTrigger.AUTO = PLACEMENT.AUTO;\nOverlayTrigger.AUTO_END = PLACEMENT.AUTO_END;\nOverlayTrigger.TOP_START = PLACEMENT.TOP_START;\nOverlayTrigger.TOP = PLACEMENT.TOP;\nOverlayTrigger.TOP_END = PLACEMENT.TOP_END;\nOverlayTrigger.RIGHT_START = PLACEMENT.RIGHT_START;\nOverlayTrigger.RIGHT = PLACEMENT.RIGHT;\nOverlayTrigger.RIGHT_END = PLACEMENT.RIGHT_END;\nOverlayTrigger.BOTTOM_START = PLACEMENT.BOTTOM_START;\nOverlayTrigger.BOTTOM = PLACEMENT.BOTTOM;\nOverlayTrigger.BOTTOM_END = PLACEMENT.BOTTOM_END;\nOverlayTrigger.LEFT_START = PLACEMENT.LEFT_START;\nOverlayTrigger.LEFT = PLACEMENT.LEFT;\nOverlayTrigger.LEFT_END = PLACEMENT.LEFT_END;\n\nexport default OverlayTrigger;\n"],"names":["OverlayTrigger","props","propsShow","defaultShow","enablePortal","trigger","TRIGGER","delay","overlay","placement","popperConfig","onToggle","rootClose","children","show","setShow","useUncontrolledProp","hoverStateRef","useRef","timeout","useChainedTimeout","onFocus","onBlur","onClick","React","handleMouseOverOut","handler","args","_relatedNative","event","target","related","handleShow","handleHide","handleFocus","useCallback","handleBlur","handleClick","handleMouseOver","handleMouseOut","triggerNode","setTriggerNode","useState","popperElement","setPopperElement","arrowElement","setArrowElement","arrowPlacement","setArrowPlacement","handleClickOutside","isToggleTarget","isOverlayTarget","useClickOutsideWithRef","triggerProps","mergeRefs","defaultPopperConfig","updatedModifiers","mod","popper","usePopper","useEffect","overlayElement","jsxs","Fragment","ReactDOM","PLACEMENT"],"mappings":";;;;;;;;;;AAqHA,MAAMA,IAAiB,CAACC,MAAkD;AACtE,QAAM;AAAA,IACF,MAAMC;AAAA,IACN,aAAAC,IAAc;AAAA,IACd,cAAAC,IAAe;AAAA,IACf,SAAAC,IAAUC,EAAQ;AAAA,IAClB,OAAAC;AAAA,IACA,SAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,cAAAC;AAAA,IACA,UAAAC,IAAW,MAAM;AAAA,IAAC;AAAA,IAClB,WAAAC,IAAY;AAAA,IACZ,UAAAC;AAAA,EAAA,IACAZ,GAIE,CAACa,GAAMC,CAAO,IAAIC,GAAoBd,GAAWC,GAAaQ,CAAQ,GAEtEM,IAAgBC,GAAe,EAAE,GAEjCC,IAAUC,GAAA,GAEV,EAAE,SAAAC,GAAS,QAAAC,GAAQ,SAAAC,EAAA,IACrB,OAAOV,KAAa,aAAaW,EAAM,SAAS,KAAKX,CAAe,EAAE,QAAS,CAAA,GAM7EY,IAAqB,CACvBC,GACAC,GACAC,MACC;AACD,UAAM,CAACC,CAAK,IAAIF,GACVG,IAASD,EAAM,eAEfE,IAAUF,EAAM;AAEtB,KAAK,CAACE,KAAWA,MAAYD,MAAW,CAACA,EAAO,SAASC,CAAO,KAC5DL,EAAQ,GAAGC,CAAI;AAAA,EAEvB,GAEMK,IAAa,MAAM;AAIrB,QAHAb,EAAQ,MAAA,GACRF,EAAc,UAAU,QAEpBV,MAAU,KAAM,OAAOA,KAAU,Y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;AACtCjE,EAAe,OAAOiE,EAAU;AAChCjE,EAAe,WAAWiE,EAAU;"}
1
+ {"version":3,"file":"OverlayTrigger.js","sources":["../../../src/components/overlay/OverlayTrigger.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useRef, useState, type PropsWithChildren } from 'react';\nimport ReactDOM from 'react-dom';\nimport { usePopper, type Modifier } from 'react-popper';\nimport type { Options } from '@popperjs/core';\n\nimport { PLACEMENT, type Placement } from '../../values/Placement';\nimport { TRIGGER, type TriggerType } from '../../values/Trigger';\nimport mergeRefs from '../../utils/mergeRefs';\nimport { useClickOutsideWithRef } from '../../hooks/useClickOutside';\nimport { useChainedTimeout } from '../../hooks/useTimeout';\nimport { useUncontrolledProp } from '../../hooks/useUncontrollable';\n\ntype PopperConfig = Partial<Options>;\n\nexport type OverlayTriggerProps = {\n /**\n * The visibility of the Overlay. `show` is a _controlled_ prop so should be paired\n * with `onToggle` to avoid breaking user interactions.\n *\n * Manually toggling `show` does **not** wait for `delay` to change the visibility.\n *\n * @controllable onToggle\n * @default false\n */\n show?: boolean;\n\n /**\n * The initial visibility state of the Overlay.\n *\n * @default false\n */\n defaultShow?: boolean;\n\n /**\n * Defines the usage of React Portal.\n *\n * @default true\n */\n enablePortal?: boolean;\n\n /**\n * Specify which action or actions trigger Overlay visibility\n *\n * The `click` trigger ignores the configured `delay`.\n *\n * Possible values are:\n *\n * - `OverlayTrigger.TRIGGER_CLICK`\n * - `OverlayTrigger.TRIGGER_HOVER`\n * - `OverlayTrigger.TRIGGER_HOVER`\n * - `'hover'`\n * - `'click'`\n * - `'focus'`\n *\n * @default 'hover'\n */\n trigger?: TriggerType;\n\n /**\n * A millisecond delay amount to show and hide the Overlay once triggered\n */\n delay?: number | { show?: number; hide?: number };\n\n /**\n * An element or text to overlay next to the target.\n */\n overlay: React.ReactElement;\n\n /**\n * The placement of the Overlay in relation to it's `target`.\n *\n * possible values are:\n *\n * - `OverlayTrigger.AUTO_START`\n * - `OverlayTrigger.AUTO`\n * - `OverlayTrigger.AUTO_END`\n * - `OverlayTrigger.TOP_START`\n * - `OverlayTrigger.TOP`\n * - `OverlayTrigger.TOP_END`\n * - `OverlayTrigger.RIGHT_START`\n * - `OverlayTrigger.RIGHT`\n * - `OverlayTrigger.RIGHT_END`\n * - `OverlayTrigger.BOTTOM_START`\n * - `OverlayTrigger.BOTTOM`\n * - `OverlayTrigger.BOTTOM_END`\n * - `OverlayTrigger.LEFT_START`\n * - `OverlayTrigger.LEFT`\n * - `OverlayTrigger.LEFT_END`\n * - `'auto-start'`\n * - `'auto'`\n * - `'auto-end'`\n * - `'top-start'`\n * - `'top'`\n * - `'top-end'`\n * - `'right-start'`\n * - `'right'`\n * - `'right-end'`\n * - `'bottom-start'`\n * - `'bottom'`\n * - `'bottom-end'`\n * - `'left-start'`\n * - `'left'`\n * - `'left-end'`\n *\n * @default 'top'\n */\n placement?: Placement;\n\n /**\n * A Popper.js config object passed to the underlying popper instance.\n * If no custom config is provided, a default config will be used. This default config\n * includes an arrow element. In case you want to use a custom config and an arrow, include the arrow\n * modifier so the correct arrow element can be injected for the arrow modifier.\n *\n * @example\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 popperConfig?: PopperConfig;\n\n /**\n * Specify whether the overlay should trigger onHide when the user clicks outside the overlay.\n *\n * @default true\n */\n rootClose?: boolean;\n\n /**\n * A callback that fires when the user triggers a change in tooltip visibility.\n *\n * `onToggle` is called with the desired next `show`, and generally should be passed\n * back to the `show` prop. `onToggle` fires _after_ the configured `delay`\n *\n * @controllable `show`\n */\n onToggle?: (show: boolean) => void;\n};\n\ntype TriggerProps = {\n ref: React.Ref<unknown>;\n onClick?: React.MouseEventHandler;\n onFocus?: React.FocusEventHandler;\n onBlur?: React.FocusEventHandler;\n onMouseOver?: React.MouseEventHandler;\n onMouseOut?: React.MouseEventHandler;\n};\n\nconst OverlayTrigger = (props: PropsWithChildren<OverlayTriggerProps>) => {\n const {\n show: propsShow,\n defaultShow = false,\n enablePortal = true,\n trigger = TRIGGER.HOVER,\n delay,\n overlay,\n placement = 'top',\n popperConfig,\n onToggle = () => {},\n rootClose = true,\n children,\n } = props;\n\n // Use a hook to handle controlled props that work in pairs like in this case the \"show\" and \"onToggle\"\n // props. It returns a setter function that automatically triggers the callback.\n const [show, setShow] = useUncontrolledProp(propsShow, defaultShow, onToggle);\n\n const hoverStateRef = useRef<string>('');\n\n const timeout = useChainedTimeout();\n\n const { onFocus, onBlur, onClick } =\n typeof children !== 'function' ? React.Children.only(children as any).props : ({} as any);\n\n // Simple implementation of mouseEnter and mouseLeave.\n // React's built version is broken: https://github.com/facebook/react/issues/4251\n // for cases when the trigger is disabled and mouseOut/Over can cause flicker\n // moving from one child element to another.\n const handleMouseOverOut = (\n handler: (...args: [React.MouseEvent, ...unknown[]]) => void,\n args: [React.MouseEvent, ...unknown[]],\n _relatedNative: 'fromElement' | 'toElement'\n ) => {\n const [event] = args;\n const target = event.currentTarget as Node;\n\n const related = event.relatedTarget as Node | null;\n\n if ((!related || related !== target) && !target.contains(related)) {\n handler(...args);\n }\n };\n\n const handleShow = () => {\n timeout.clear();\n hoverStateRef.current = 'show';\n\n if (delay === 0 || (typeof delay !== 'number' && !delay?.show)) {\n setShow(true);\n return;\n }\n\n timeout.set(\n () => {\n if (hoverStateRef.current === 'show') {\n setShow(true);\n }\n },\n typeof delay === 'number' ? delay : delay?.show\n );\n };\n\n const handleHide = () => {\n timeout.clear();\n hoverStateRef.current = 'hide';\n\n if (typeof delay === 'number' || !delay?.hide) {\n setShow(false);\n return;\n }\n\n timeout.set(() => {\n if (hoverStateRef.current === 'hide') {\n setShow(false);\n }\n }, delay?.hide);\n };\n\n const handleFocus = useCallback(\n (...args: unknown[]) => {\n handleShow();\n onFocus?.(...args);\n },\n [handleShow, onFocus]\n );\n\n const handleBlur = useCallback(\n (...args: unknown[]) => {\n handleHide();\n onBlur?.(...args);\n },\n [handleHide, onBlur]\n );\n\n const handleClick = useCallback(\n (...args: unknown[]) => {\n setShow(!show);\n onClick?.(...args);\n },\n [onClick, setShow, show]\n );\n\n const handleMouseOver = useCallback(\n (...args: [React.MouseEvent, ...unknown[]]) => {\n handleMouseOverOut(handleShow, args, 'fromElement');\n },\n [handleShow]\n );\n\n const handleMouseOut = useCallback(\n (...args: [React.MouseEvent, ...unknown[]]) => {\n handleMouseOverOut(handleHide, args, 'toElement');\n },\n [handleHide]\n );\n\n const [triggerNode, setTriggerNode] = useState<HTMLButtonElement | null>(null);\n const [popperElement, setPopperElement] = useState<HTMLDivElement | null>(null);\n const [arrowElement, setArrowElement] = useState<HTMLDivElement | null>(null);\n\n const [arrowPlacement, setArrowPlacement] = useState(placement);\n\n const handleClickOutside = useCallback(\n (event: MouseEvent | TouchEvent) => {\n const isToggleTarget = triggerNode?.contains(event.target as Node);\n const isOverlayTarget = popperElement?.contains(event.target as Node);\n\n // Check if the click occurred outside the trigger element. Clicking on the trigger\n // itself is handled by the onClick handler\n if (show && rootClose && !isToggleTarget && !isOverlayTarget) {\n handleHide();\n }\n },\n [triggerNode, popperElement, rootClose, handleHide]\n );\n\n useClickOutsideWithRef(triggerNode, handleClickOutside);\n\n const triggerProps: TriggerProps = {\n ref: mergeRefs([(children as any).ref, setTriggerNode]),\n };\n\n if (trigger === 'click') {\n triggerProps.onClick = handleClick;\n } else if (trigger === 'focus') {\n triggerProps.onFocus = handleFocus;\n triggerProps.onBlur = handleBlur;\n } else if (trigger === 'hover') {\n triggerProps.onMouseOver = handleMouseOver;\n triggerProps.onMouseOut = handleMouseOut;\n }\n\n const defaultPopperConfig = {\n placement,\n modifiers: [\n {\n name: 'arrow',\n options: {\n element: arrowElement,\n },\n },\n {\n name: 'flip',\n options: {\n fallbackPlacements: ['right', 'left', 'top'],\n },\n },\n ],\n };\n\n if (popperConfig) {\n popperConfig.placement = placement;\n\n // if it has an arrow modifier, inject the arrow element\n const updatedModifiers: Modifier<any, any>[] = [];\n popperConfig.modifiers?.map((mod: Modifier<any, any>) => {\n if (mod.name !== 'arrow') {\n return updatedModifiers.push(mod);\n }\n return updatedModifiers.push({\n ...mod,\n options: {\n ...mod.options,\n element: arrowElement,\n },\n });\n });\n\n popperConfig.modifiers = updatedModifiers;\n }\n\n const popper = usePopper(triggerNode, popperElement, popperConfig || defaultPopperConfig);\n\n // In case the overlay causes an overflow and the \"flip\" modifier\n // changes the overlays placement, we nee to update the arrow placement as well\n useEffect(() => {\n if (popper.state) {\n // Adjust arrow styles based on placement if necessary\n setArrowPlacement(popper.state.placement);\n }\n }, [popper.state?.placement]);\n\n const overlayElement = React.cloneElement(overlay, {\n ...popper.attributes.popper,\n ref: setPopperElement,\n placement: arrowPlacement,\n style: { ...popper.styles.popper },\n arrowProps: {\n ...popper.attributes.arrow,\n style: popper.styles.arrow,\n ref: setArrowElement,\n },\n });\n\n return (\n <>\n {show && (enablePortal ? ReactDOM.createPortal(overlayElement, document.body) : overlayElement)}\n {React.cloneElement(children as any, triggerProps)}\n </>\n );\n};\n\nOverlayTrigger.TRIGGER_CLICK = TRIGGER.CLICK;\nOverlayTrigger.TRIGGER_HOVER = TRIGGER.HOVER;\nOverlayTrigger.TRIGGER_FOCUS = TRIGGER.FOCUS;\n\n// placement\nOverlayTrigger.AUTO_START = PLACEMENT.AUTO_START;\nOverlayTrigger.AUTO = PLACEMENT.AUTO;\nOverlayTrigger.AUTO_END = PLACEMENT.AUTO_END;\nOverlayTrigger.TOP_START = PLACEMENT.TOP_START;\nOverlayTrigger.TOP = PLACEMENT.TOP;\nOverlayTrigger.TOP_END = PLACEMENT.TOP_END;\nOverlayTrigger.RIGHT_START = PLACEMENT.RIGHT_START;\nOverlayTrigger.RIGHT = PLACEMENT.RIGHT;\nOverlayTrigger.RIGHT_END = PLACEMENT.RIGHT_END;\nOverlayTrigger.BOTTOM_START = PLACEMENT.BOTTOM_START;\nOverlayTrigger.BOTTOM = PLACEMENT.BOTTOM;\nOverlayTrigger.BOTTOM_END = PLACEMENT.BOTTOM_END;\nOverlayTrigger.LEFT_START = PLACEMENT.LEFT_START;\nOverlayTrigger.LEFT = PLACEMENT.LEFT;\nOverlayTrigger.LEFT_END = PLACEMENT.LEFT_END;\n\nexport default OverlayTrigger;\n"],"names":["OverlayTrigger","props","propsShow","defaultShow","enablePortal","trigger","TRIGGER","delay","overlay","placement","popperConfig","onToggle","rootClose","children","show","setShow","useUncontrolledProp","hoverStateRef","useRef","timeout","useChainedTimeout","onFocus","onBlur","onClick","React","handleMouseOverOut","handler","args","_relatedNative","event","target","related","handleShow","handleHide","handleFocus","useCallback","handleBlur","handleClick","handleMouseOver","handleMouseOut","triggerNode","setTriggerNode","useState","popperElement","setPopperElement","arrowElement","setArrowElement","arrowPlacement","setArrowPlacement","handleClickOutside","isToggleTarget","isOverlayTarget","useClickOutsideWithRef","triggerProps","mergeRefs","defaultPopperConfig","updatedModifiers","mod","popper","usePopper","useEffect","overlayElement","jsxs","Fragment","ReactDOM","PLACEMENT"],"mappings":";;;;;;;;;;AA+JA,MAAMA,IAAiB,CAACC,MAAkD;AACtE,QAAM;AAAA,IACF,MAAMC;AAAA,IACN,aAAAC,IAAc;AAAA,IACd,cAAAC,IAAe;AAAA,IACf,SAAAC,IAAUC,EAAQ;AAAA,IAClB,OAAAC;AAAA,IACA,SAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,cAAAC;AAAA,IACA,UAAAC,IAAW,MAAM;AAAA,IAAC;AAAA,IAClB,WAAAC,IAAY;AAAA,IACZ,UAAAC;AAAA,EAAA,IACAZ,GAIE,CAACa,GAAMC,CAAO,IAAIC,GAAoBd,GAAWC,GAAaQ,CAAQ,GAEtEM,IAAgBC,GAAe,EAAE,GAEjCC,IAAUC,GAAA,GAEV,EAAE,SAAAC,GAAS,QAAAC,GAAQ,SAAAC,EAAA,IACrB,OAAOV,KAAa,aAAaW,EAAM,SAAS,KAAKX,CAAe,EAAE,QAAS,CAAA,GAM7EY,IAA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,WAAWiE,EAAU;AACpCjE,EAAe,YAAYiE,EAAU;AACrCjE,EAAe,MAAMiE,EAAU;AAC/BjE,EAAe,UAAUiE,EAAU;AACnCjE,EAAe,cAAciE,EAAU;AACvCjE,EAAe,QAAQiE,EAAU;AACjCjE,EAAe,YAAYiE,EAAU;AACrCjE,EAAe,eAAeiE,EAAU;AACxCjE,EAAe,SAASiE,EAAU;AAClCjE,EAAe,aAAaiE,EAAU;AACtCjE,EAAe,aAAaiE,EAAU;AACtCjE,EAAe,OAAOiE,EAAU;AAChCjE,EAAe,WAAWiE,EAAU;"}
@@ -1,5 +1,5 @@
1
1
  import { jsx as n } from "react/jsx-runtime";
2
- import p from "classnames";
2
+ import p from "../../utils/classNames.js";
3
3
  const f = (o) => {
4
4
  const { className: e, width: r, orientation: s = "portrait", shadow: i = !0, border: d = !1, children: c } = o, h = p(
5
5
  "Page",
@@ -1 +1 @@
1
- {"version":3,"file":"Page.js","sources":["../../../src/components/page/Page.tsx"],"sourcesContent":["import type React from 'react';\nimport type { PropsWithChildren } from 'react';\nimport classNames from 'classnames';\n\nexport type PageProps = {\n /**\n * Defines the width in pixel of the page. In landscape mode, the width is set as height.\n * The component uses internally the aspect-ratio of a standard DIN A4 page.\n * Please make sure the element does not get stretched when using flexbox.\n */\n width: number;\n\n /**\n * Defines the layout of the page\n *\n * @default 'portrait'\n */\n orientation?: 'portrait' | 'landscape';\n\n /**\n * Defines to use a pre-defined shadow style. May be disabled on white background.\n *\n * @default true\n */\n shadow?: boolean;\n\n /**\n * Defines to use a pre-defined border style. This may be used to render\n * the page on a white background of as part of another element like a panel.\n */\n border?: boolean;\n\n /**\n * Additional classes to be set on the wrapper element\n */\n className?: string;\n};\n\nconst Page = (props: PropsWithChildren<PageProps>) => {\n const { className, width, orientation = 'portrait', shadow = true, border = false, children } = props;\n\n const wrapperClassNames = classNames(\n 'Page',\n orientation,\n shadow && 'shadow-hard',\n border && 'border border-width-2',\n className\n );\n\n const isPortrait = orientation === 'portrait';\n\n const style: React.CSSProperties = {};\n\n if (width && isPortrait) {\n style.width = `${width}px`;\n }\n\n if (width && !isPortrait) {\n style.height = `${width}px`;\n }\n\n return (\n <div className={wrapperClassNames} style={style}>\n {children}\n </div>\n );\n};\n\nexport default Page;\n"],"names":["Page","props","className","width","orientation","shadow","border","children","wrapperClassNames","classNames","isPortrait","style","jsx"],"mappings":";;AAsCA,MAAMA,IAAO,CAACC,MAAwC;AAClD,QAAM,EAAE,WAAAC,GAAW,OAAAC,GAAO,aAAAC,IAAc,YAAY,QAAAC,IAAS,IAAM,QAAAC,IAAS,IAAO,UAAAC,EAAA,IAAaN,GAE1FO,IAAoBC;AAAA,IACtB;AAAA,IACAL;AAAA,IACAC,KAAU;AAAA,IACVC,KAAU;AAAA,IACVJ;AAAA,EAAA,GAGEQ,IAAaN,MAAgB,YAE7BO,IAA6B,CAAA;AAEnC,SAAIR,KAASO,MACTC,EAAM,QAAQ,GAAGR,CAAK,OAGtBA,KAAS,CAACO,MACVC,EAAM,SAAS,GAAGR,CAAK,OAIvB,gBAAAS,EAAC,OAAA,EAAI,WAAWJ,GAAmB,OAAAG,GAC9B,UAAAJ,GACL;AAER;"}
1
+ {"version":3,"file":"Page.js","sources":["../../../src/components/page/Page.tsx"],"sourcesContent":["import type React from 'react';\nimport type { PropsWithChildren } from 'react';\n\nimport classNames from '../../utils/classNames';\n\nexport type PageProps = {\n /**\n * Defines the width in pixel of the page. In landscape mode, the width is set as height.\n * The component uses internally the aspect-ratio of a standard DIN A4 page.\n * Please make sure the element does not get stretched when using flexbox.\n */\n width: number;\n\n /**\n * Defines the layout of the page\n *\n * @default 'portrait'\n */\n orientation?: 'portrait' | 'landscape';\n\n /**\n * Defines to use a pre-defined shadow style. May be disabled on white background.\n *\n * @default true\n */\n shadow?: boolean;\n\n /**\n * Defines to use a pre-defined border style. This may be used to render\n * the page on a white background of as part of another element like a panel.\n */\n border?: boolean;\n\n /**\n * Additional classes to be set on the wrapper element\n */\n className?: string;\n};\n\nconst Page = (props: PropsWithChildren<PageProps>) => {\n const { className, width, orientation = 'portrait', shadow = true, border = false, children } = props;\n\n const wrapperClassNames = classNames(\n 'Page',\n orientation,\n shadow && 'shadow-hard',\n border && 'border border-width-2',\n className\n );\n\n const isPortrait = orientation === 'portrait';\n\n const style: React.CSSProperties = {};\n\n if (width && isPortrait) {\n style.width = `${width}px`;\n }\n\n if (width && !isPortrait) {\n style.height = `${width}px`;\n }\n\n return (\n <div className={wrapperClassNames} style={style}>\n {children}\n </div>\n );\n};\n\nexport default Page;\n"],"names":["Page","props","className","width","orientation","shadow","border","children","wrapperClassNames","classNames","isPortrait","style","jsx"],"mappings":";;AAuCA,MAAMA,IAAO,CAACC,MAAwC;AAClD,QAAM,EAAE,WAAAC,GAAW,OAAAC,GAAO,aAAAC,IAAc,YAAY,QAAAC,IAAS,IAAM,QAAAC,IAAS,IAAO,UAAAC,EAAA,IAAaN,GAE1FO,IAAoBC;AAAA,IACtB;AAAA,IACAL;AAAA,IACAC,KAAU;AAAA,IACVC,KAAU;AAAA,IACVJ;AAAA,EAAA,GAGEQ,IAAaN,MAAgB,YAE7BO,IAA6B,CAAA;AAEnC,SAAIR,KAASO,MACTC,EAAM,QAAQ,GAAGR,CAAK,OAGtBA,KAAS,CAACO,MACVC,EAAM,SAAS,GAAGR,CAAK,OAIvB,gBAAAS,EAAC,OAAA,EAAI,WAAWJ,GAAmB,OAAAG,GAC9B,UAAAJ,GACL;AAER;"}
@@ -16,6 +16,7 @@ export type PagerProps = {
16
16
  /**
17
17
  * Set right alignment for "previous" pager content to be aligned
18
18
  * to the right side of the pager and the arrow on the left side.
19
+ *
19
20
  * @default false
20
21
  */
21
22
  alignRight?: boolean;
@@ -31,11 +32,13 @@ export type PagerProps = {
31
32
  variant?: ObjectValues<typeof PagerVariant>;
32
33
  /**
33
34
  * Sets the pager disabled.
35
+ *
34
36
  * @default false
35
37
  */
36
38
  disabled?: boolean;
37
39
  /**
38
40
  * Callback function for when the component is clicked.
41
+ *
39
42
  * @param event
40
43
  * @returns
41
44
  */
@@ -1,6 +1,6 @@
1
1
  import { jsxs as r, jsx as s } from "react/jsx-runtime";
2
2
  import { useState as I } from "react";
3
- import e from "classnames";
3
+ import e from "../../utils/classNames.js";
4
4
  const i = {
5
5
  VARIANT_FULL: "full",
6
6
  VARIANT_COMPACT: "compact"
@@ -1 +1 @@
1
- {"version":3,"file":"Pager.js","sources":["../../../src/components/pager/Pager.tsx"],"sourcesContent":["import type React from 'react';\nimport { useState } from 'react';\nimport classNames from 'classnames';\n\nimport type { ObjectValues } from '../../utils/ObjectValues';\n\nexport const PagerVariant = {\n VARIANT_FULL: 'full',\n VARIANT_COMPACT: 'compact',\n} as const;\n\nexport type PagerProps = {\n /**\n * The title or name of the section next/previous section.\n */\n title: string | React.ReactNode;\n\n /**\n * The optional label for the full variant.\n */\n label?: string | React.ReactNode;\n\n /**\n * Set right alignment for \"previous\" pager content to be aligned\n * to the right side of the pager and the arrow on the left side.\n * @default false\n */\n alignRight?: boolean;\n\n /**\n * Define how large the component should be rendered.\n *\n * Possible values are:\n * `Pager.VARIANT_FULL`, `Pager.VARIANT_COMPACT` or\n * `full`, `compact`.\n *\n * @default `full`\n */\n variant?: ObjectValues<typeof PagerVariant>;\n\n /**\n * Sets the pager disabled.\n * @default false\n */\n disabled?: boolean;\n\n /**\n * Callback function for when the component is clicked.\n * @param event\n * @returns\n */\n onClick?: (event: React.MouseEvent<HTMLDivElement>) => void;\n\n /**\n * Additional classes for the wrapper element.\n */\n className?: string;\n};\n\nconst Pager = (props: PagerProps) => {\n const {\n title,\n label,\n alignRight = false,\n variant = PagerVariant.VARIANT_FULL,\n disabled = false,\n onClick,\n className,\n ...remainingProps\n } = props;\n\n const [isHover, setIsHover] = useState(false);\n\n const handleEnter = () => !disabled && setIsHover(true);\n const handleLeave = () => setIsHover(false);\n\n const isCompactVariant = variant === Pager.VARIANT_COMPACT;\n\n const wrapperClassesBase = classNames(\n 'Pager',\n 'bg-white',\n 'border',\n 'display-flex justify-space-between align-items-center',\n isHover && 'border-color-highlight',\n alignRight && 'flex-row-reverse',\n disabled && 'pointer-events-none',\n 'cursor-pointer user-select-none'\n );\n\n const iconClassesBase = classNames(\n 'rioglyph',\n disabled ? 'text-color-light' : 'text-color-darker',\n isHover && 'text-color-highlight'\n );\n\n const titleClassesBase = classNames(\n disabled ? 'text-color-light' : 'text-color-darker',\n isHover && 'text-color-highlight'\n );\n\n // The compact version has a slightly different markup and different classes for the\n // individual parts, hence we extend the base classes\n if (isCompactVariant) {\n const wrapperClassesCompact = classNames(\n wrapperClassesBase,\n 'rounded-circle',\n 'padding-y-5 padding-x-15',\n 'width-auto',\n className\n );\n\n const iconClassesCompact = classNames(\n iconClassesBase,\n alignRight ? 'rioglyph-chevron-left margin-right-5' : 'rioglyph-chevron-right margin-left-5',\n 'text-size-10'\n );\n\n return (\n <div\n {...remainingProps}\n className={wrapperClassesCompact}\n onMouseEnter={handleEnter}\n onMouseLeave={handleLeave}\n onClick={onClick}\n >\n <div className={`display-flex flex-1-1 flex-column ${alignRight ? 'align-items-end' : ''}`}>\n <div className={titleClassesBase}>{title}</div>\n </div>\n <span className={iconClassesCompact} />\n </div>\n );\n }\n\n const wrapperClassesFull = classNames(\n wrapperClassesBase,\n 'rounded',\n 'padding-y-15 padding-x-20',\n 'width-100pct',\n className\n );\n\n const iconClassesFull = classNames(\n iconClassesBase,\n alignRight ? 'rioglyph-arrow-left margin-right-10' : 'rioglyph-arrow-right margin-left-10',\n 'text-size-200pct'\n );\n\n const titleClassesFull = classNames(titleClassesBase, alignRight && 'text-right', 'text-size-16 text-medium');\n\n return (\n <div\n {...remainingProps}\n className={wrapperClassesFull}\n onMouseEnter={handleEnter}\n onMouseLeave={handleLeave}\n onClick={onClick}\n >\n <div className={`display-flex flex-1-1 flex-column ${alignRight ? 'align-items-end' : ''}`}>\n <div className='text-color-gray line-height-16'>{label}</div>\n <div className={titleClassesFull}>{title}</div>\n </div>\n <div className='text-size-12 display-grid place-items-center'>\n <span className={iconClassesFull} />\n </div>\n </div>\n );\n};\n\nPager.VARIANT_FULL = PagerVariant.VARIANT_FULL;\nPager.VARIANT_COMPACT = PagerVariant.VARIANT_COMPACT;\n\nexport default Pager;\n"],"names":["PagerVariant","Pager","props","title","label","alignRight","variant","disabled","onClick","className","remainingProps","isHover","setIsHover","useState","handleEnter","handleLeave","isCompactVariant","wrapperClassesBase","classNames","iconClassesBase","titleClassesBase","wrapperClassesCompact","iconClassesCompact","jsxs","jsx","wrapperClassesFull","iconClassesFull","titleClassesFull"],"mappings":";;;AAMO,MAAMA,IAAe;AAAA,EACxB,cAAc;AAAA,EACd,iBAAiB;AACrB,GAkDMC,IAAQ,CAACC,MAAsB;AACjC,QAAM;AAAA,IACF,OAAAC;AAAA,IACA,OAAAC;AAAA,IACA,YAAAC,IAAa;AAAA,IACb,SAAAC,IAAUN,EAAa;AAAA,IACvB,UAAAO,IAAW;AAAA,IACX,SAAAC;AAAA,IACA,WAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACHR,GAEE,CAACS,GAASC,CAAU,IAAIC,EAAS,EAAK,GAEtCC,IAAc,MAAM,CAACP,KAAYK,EAAW,EAAI,GAChDG,IAAc,MAAMH,EAAW,EAAK,GAEpCI,IAAmBV,MAAYL,EAAM,iBAErCgB,IAAqBC;AAAA,IACvB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACAP,KAAW;AAAA,IACXN,KAAc;AAAA,IACdE,KAAY;AAAA,IACZ;AAAA,EAAA,GAGEY,IAAkBD;AAAA,IACpB;AAAA,IACAX,IAAW,qBAAqB;AAAA,IAChCI,KAAW;AAAA,EAAA,GAGTS,IAAmBF;AAAA,IACrBX,IAAW,qBAAqB;AAAA,IAChCI,KAAW;AAAA,EAAA;AAKf,MAAIK,GAAkB;AAClB,UAAMK,IAAwBH;AAAA,MAC1BD;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACAR;AAAA,IAAA,GAGEa,IAAqBJ;AAAA,MACvBC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AEAzB,EAAM,eAAeD,EAAa;AAClCC,EAAM,kBAAkBD,EAAa;"}
1
+ {"version":3,"file":"Pager.js","sources":["../../../src/components/pager/Pager.tsx"],"sourcesContent":["import type React from 'react';\nimport { useState } from 'react';\n\nimport classNames from '../../utils/classNames';\nimport type { ObjectValues } from '../../utils/ObjectValues';\n\nexport const PagerVariant = {\n VARIANT_FULL: 'full',\n VARIANT_COMPACT: 'compact',\n} as const;\n\nexport type PagerProps = {\n /**\n * The title or name of the section next/previous section.\n */\n title: string | React.ReactNode;\n\n /**\n * The optional label for the full variant.\n */\n label?: string | React.ReactNode;\n\n /**\n * Set right alignment for \"previous\" pager content to be aligned\n * to the right side of the pager and the arrow on the left side.\n *\n * @default false\n */\n alignRight?: boolean;\n\n /**\n * Define how large the component should be rendered.\n *\n * Possible values are:\n * `Pager.VARIANT_FULL`, `Pager.VARIANT_COMPACT` or\n * `full`, `compact`.\n *\n * @default `full`\n */\n variant?: ObjectValues<typeof PagerVariant>;\n\n /**\n * Sets the pager disabled.\n *\n * @default false\n */\n disabled?: boolean;\n\n /**\n * Callback function for when the component is clicked.\n *\n * @param event\n * @returns\n */\n onClick?: (event: React.MouseEvent<HTMLDivElement>) => void;\n\n /**\n * Additional classes for the wrapper element.\n */\n className?: string;\n};\n\nconst Pager = (props: PagerProps) => {\n const {\n title,\n label,\n alignRight = false,\n variant = PagerVariant.VARIANT_FULL,\n disabled = false,\n onClick,\n className,\n ...remainingProps\n } = props;\n\n const [isHover, setIsHover] = useState(false);\n\n const handleEnter = () => !disabled && setIsHover(true);\n const handleLeave = () => setIsHover(false);\n\n const isCompactVariant = variant === Pager.VARIANT_COMPACT;\n\n const wrapperClassesBase = classNames(\n 'Pager',\n 'bg-white',\n 'border',\n 'display-flex justify-space-between align-items-center',\n isHover && 'border-color-highlight',\n alignRight && 'flex-row-reverse',\n disabled && 'pointer-events-none',\n 'cursor-pointer user-select-none'\n );\n\n const iconClassesBase = classNames(\n 'rioglyph',\n disabled ? 'text-color-light' : 'text-color-darker',\n isHover && 'text-color-highlight'\n );\n\n const titleClassesBase = classNames(\n disabled ? 'text-color-light' : 'text-color-darker',\n isHover && 'text-color-highlight'\n );\n\n // The compact version has a slightly different markup and different classes for the\n // individual parts, hence we extend the base classes\n if (isCompactVariant) {\n const wrapperClassesCompact = classNames(\n wrapperClassesBase,\n 'rounded-circle',\n 'padding-y-5 padding-x-15',\n 'width-auto',\n className\n );\n\n const iconClassesCompact = classNames(\n iconClassesBase,\n alignRight ? 'rioglyph-chevron-left margin-right-5' : 'rioglyph-chevron-right margin-left-5',\n 'text-size-10'\n );\n\n return (\n <div\n {...remainingProps}\n className={wrapperClassesCompact}\n onMouseEnter={handleEnter}\n onMouseLeave={handleLeave}\n onClick={onClick}\n >\n <div className={`display-flex flex-1-1 flex-column ${alignRight ? 'align-items-end' : ''}`}>\n <div className={titleClassesBase}>{title}</div>\n </div>\n <span className={iconClassesCompact} />\n </div>\n );\n }\n\n const wrapperClassesFull = classNames(\n wrapperClassesBase,\n 'rounded',\n 'padding-y-15 padding-x-20',\n 'width-100pct',\n className\n );\n\n const iconClassesFull = classNames(\n iconClassesBase,\n alignRight ? 'rioglyph-arrow-left margin-right-10' : 'rioglyph-arrow-right margin-left-10',\n 'text-size-200pct'\n );\n\n const titleClassesFull = classNames(titleClassesBase, alignRight && 'text-right', 'text-size-16 text-medium');\n\n return (\n <div\n {...remainingProps}\n className={wrapperClassesFull}\n onMouseEnter={handleEnter}\n onMouseLeave={handleLeave}\n onClick={onClick}\n >\n <div className={`display-flex flex-1-1 flex-column ${alignRight ? 'align-items-end' : ''}`}>\n <div className='text-color-gray line-height-16'>{label}</div>\n <div className={titleClassesFull}>{title}</div>\n </div>\n <div className='text-size-12 display-grid place-items-center'>\n <span className={iconClassesFull} />\n </div>\n </div>\n );\n};\n\nPager.VARIANT_FULL = PagerVariant.VARIANT_FULL;\nPager.VARIANT_COMPACT = PagerVariant.VARIANT_COMPACT;\n\nexport default Pager;\n"],"names":["PagerVariant","Pager","props","title","label","alignRight","variant","disabled","onClick","className","remainingProps","isHover","setIsHover","useState","handleEnter","handleLeave","isCompactVariant","wrapperClassesBase","classNames","iconClassesBase","titleClassesBase","wrapperClassesCompact","iconClassesCompact","jsxs","jsx","wrapperClassesFull","iconClassesFull","titleClassesFull"],"mappings":";;;AAMO,MAAMA,IAAe;AAAA,EACxB,cAAc;AAAA,EACd,iBAAiB;AACrB,GAqDMC,IAAQ,CAACC,MAAsB;AACjC,QAAM;AAAA,IACF,OAAAC;AAAA,IACA,OAAAC;AAAA,IACA,YAAAC,IAAa;AAAA,IACb,SAAAC,IAAUN,EAAa;AAAA,IACvB,UAAAO,IAAW;AAAA,IACX,SAAAC;AAAA,IACA,WAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACHR,GAEE,CAACS,GAASC,CAAU,IAAIC,EAAS,EAAK,GAEtCC,IAAc,MAAM,CAACP,KAAYK,EAAW,EAAI,GAChDG,IAAc,MAAMH,EAAW,EAAK,GAEpCI,IAAmBV,MAAYL,EAAM,iBAErCgB,IAAqBC;AAAA,IACvB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACAP,KAAW;AAAA,IACXN,KAAc;AAAA,IACdE,KAAY;AAAA,IACZ;AAAA,EAAA,GAGEY,IAAkBD;AAAA,IACpB;AAAA,IACAX,IAAW,qBAAqB;AAAA,IAChCI,KAAW;AAAA,EAAA,GAGTS,IAAmBF;AAAA,IACrBX,IAAW,qBAAqB;AAAA,IAChCI,KAAW;AAAA,EAAA;AAKf,MAAIK,GAAkB;AAClB,UAAMK,IAAwBH;AAAA,MAC1BD;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACAR;AAAA,IAAA,GAGEa,IAAqBJ;AAAA,MACvBC;AAAA,MACAd,IAAa,yCAAyC;AAAA,MACtD;AAAA,IAAA;AAGJ,WACI,gBAAAkB;AAAA,MAAC;AAAA,MAAA;AAAA,QACI,GAAGb;AAAA,QACJ,WAAWW;AAAA,QACX,cAAcP;AAAA,QACd,cAAcC;AAAA,QACd,SAAAP;AAAA,QAEA,UAAA;AAAA,UAAA,gBAAAgB,EAAC,OAAA,EAAI,WAAW,qCAAqCnB,IAAa,oBAAoB,EAAE,IACpF,UAAA,gBAAAmB,EAAC,OAAA,EAAI,WAAWJ,GAAmB,UAAAjB,EAAA,CAAM,GAC7C;AAAA,UACA,gBAAAqB,EAAC,QAAA,EAAK,WAAWF,EAAA,CAAoB;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGjD;AAEA,QAAMG,IAAqBP;AAAA,IACvBD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACAR;AAAA,EAAA,GAGEiB,IAAkBR;AAAA,IACpBC;AAAA,IACAd,IAAa,wCAAwC;AAAA,IACrD;AAAA,EAAA,GAGEsB,IAAmBT,EAAWE,GAAkBf,KAAc,cAAc,0BAA0B;AAE5G,SACI,gBAAAkB;AAAA,IAAC;AAAA,IAAA;AAAA,MACI,GAAGb;AAAA,MACJ,WAAWe;AAAA,MACX,cAAcX;AAAA,MACd,cAAcC;AAAA,MACd,SAAAP;AAAA,MAEA,UAAA;AAAA,QAAA,gBAAAe,EAAC,SAAI,WAAW,qCAAqClB,IAAa,oBAAoB,EAAE,IACpF,UAAA;AAAA,UAAA,gBAAAmB,EAAC,OAAA,EAAI,WAAU,kCAAkC,UAAApB,GAAM;AAAA,UACvD,gBAAAoB,EAAC,OAAA,EAAI,WAAWG,GAAmB,UAAAxB,EAAA,CAAM;AAAA,QAAA,GAC7C;AAAA,QACA,gBAAAqB,EAAC,SAAI,WAAU,gDACX,4BAAC,QAAA,EAAK,WAAWE,GAAiB,EAAA,CACtC;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGZ;AAEAzB,EAAM,eAAeD,EAAa;AAClCC,EAAM,kBAAkBD,EAAa;"}
@@ -17,6 +17,7 @@ export type PopoverProps = Omit<ComponentProps<'div'>, 'title'> & {
17
17
  * This is generally provided by the OverlayTrigger component positioning the Popover.
18
18
  *
19
19
  * Possible values are:
20
+ *
20
21
  * - `auto`
21
22
  * - `top`
22
23
  * - `right`
@@ -1 +1 @@
1
- {"version":3,"file":"Popover.js","sources":["../../../src/components/popover/Popover.tsx"],"sourcesContent":["import React, {\n forwardRef,\n type ForwardRefExoticComponent,\n type RefAttributes,\n type PropsWithChildren,\n type ReactNode,\n type ComponentProps,\n isValidElement,\n useState,\n useEffect,\n} from 'react';\n\nimport { PLACEMENT } from '../../values/Placement';\n\nexport const PLACEMENT_MAP = {\n AUTO: PLACEMENT.AUTO,\n TOP: PLACEMENT.TOP,\n RIGHT: PLACEMENT.RIGHT,\n BOTTOM: PLACEMENT.BOTTOM,\n LEFT: PLACEMENT.LEFT,\n} as const;\n\nexport type PopoverProps = Omit<ComponentProps<'div'>, 'title'> & {\n /**\n * HTML ID attribute, necessary for accessibility.\n */\n id: string;\n\n /**\n * Sets the direction the Popover is positioned towards.\n *\n * This is generally provided by the OverlayTrigger component positioning the Popover.\n *\n * Possible values are:\n * - `auto`\n * - `top`\n * - `right`\n * - `bottom`\n * - `left`\n */\n placement?: 'auto' | 'top' | 'right' | 'bottom' | 'left';\n\n /**\n * Additional props assigned to the arrow element. Internally used.\n */\n arrowProps?: Record<string, unknown>;\n\n /**\n * Any element to be rendered as the title of the Popover.\n *\n * It creates a `Popover.Title` inside the `Popover` passing the title directly into it.\n */\n title?: string | ReactNode;\n\n /**\n * Additional classes to be set on the `Popover.Title` element.\n */\n titleClassName?: string;\n\n /**\n * Additional classes to be set on the `Popover.Content` element.\n */\n contentClassName?: string;\n\n /**\n * Additional class names for the wrapper element.\n */\n className?: string;\n};\n\nconst PopoverTitle = ({ className = '', children }: PropsWithChildren<{ className?: string }>) => (\n <div className={`popover-header popover-title ${className}`}>{children}</div>\n);\n\nconst PopoverContent = ({ className = '', children }: PropsWithChildren<{ className?: string }>) => (\n <div className={`popover-content popover-body ${className}`}>{children}</div>\n);\n\nconst isPopoverTitleOrContent = (element: ReactNode): boolean => {\n return isValidElement(element) && (element.type === PopoverTitle || element.type === PopoverContent);\n};\n\ntype PopoverType = ForwardRefExoticComponent<PropsWithChildren<PopoverProps> & RefAttributes<HTMLDivElement>> & {\n Title: typeof PopoverTitle;\n Content: typeof PopoverContent;\n};\n\nconst Popover = forwardRef<HTMLDivElement, PropsWithChildren<PopoverProps>>((props, ref) => {\n const {\n placement = 'bottom',\n arrowProps,\n title,\n titleClassName = '',\n contentClassName = '',\n children,\n className = '',\n ...remainingProps\n } = props;\n\n const hasTitle = !!title;\n const hasCustomContent = React.Children.toArray(children).some(isPopoverTitleOrContent);\n\n // Mount the component but don't show it yet via CSS.\n // After it is mounted, we set the visibility class to use CSS animation\n const [isMounted, setIsMounted] = useState(false);\n useEffect(() => setIsMounted(true), []);\n\n return (\n <div\n {...remainingProps}\n role='tooltip'\n // x-placement is used by the css to define how to position the arrow.\n // eslint-disable-next-line react/no-unknown-property\n x-placement={placement}\n ref={ref}\n className={`popover fade ${isMounted ? 'show' : ''} ${className}`}\n >\n <div className='arrow' {...arrowProps} />\n {hasTitle && <PopoverTitle className={titleClassName}>{title}</PopoverTitle>}\n {hasCustomContent ? children : <PopoverContent className={contentClassName}>{children}</PopoverContent>}\n </div>\n );\n}) as PopoverType;\n\nPopover.Title = PopoverTitle;\nPopover.Content = PopoverContent;\n\nObject.assign(Popover, PLACEMENT_MAP);\n\nexport default Popover;\n"],"names":["PLACEMENT_MAP","PLACEMENT","PopoverTitle","className","children","jsx","PopoverContent","isPopoverTitleOrContent","element","isValidElement","Popover","forwardRef","props","ref","placement","arrowProps","title","titleClassName","contentClassName","remainingProps","hasTitle","hasCustomContent","React","isMounted","setIsMounted","useState","useEffect","jsxs"],"mappings":";;;AAcO,MAAMA,IAAgB;AAAA,EACzB,MAAMC,EAAU;AAAA,EAChB,KAAKA,EAAU;AAAA,EACf,OAAOA,EAAU;AAAA,EACjB,QAAQA,EAAU;AAAA,EAClB,MAAMA,EAAU;AACpB,GAkDMC,IAAe,CAAC,EA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A;AAAA,EAAA;AAGlG,CAAC;AAEDM,EAAQ,QAAQR;AAChBQ,EAAQ,UAAUJ;AAElB,OAAO,OAAOI,GAASV,CAAa;"}
1
+ {"version":3,"file":"Popover.js","sources":["../../../src/components/popover/Popover.tsx"],"sourcesContent":["import React, {\n forwardRef,\n type ForwardRefExoticComponent,\n type RefAttributes,\n type PropsWithChildren,\n type ReactNode,\n type ComponentProps,\n isValidElement,\n useState,\n useEffect,\n} from 'react';\n\nimport { PLACEMENT } from '../../values/Placement';\n\nexport const PLACEMENT_MAP = {\n AUTO: PLACEMENT.AUTO,\n TOP: PLACEMENT.TOP,\n RIGHT: PLACEMENT.RIGHT,\n BOTTOM: PLACEMENT.BOTTOM,\n LEFT: PLACEMENT.LEFT,\n} as const;\n\nexport type PopoverProps = Omit<ComponentProps<'div'>, 'title'> & {\n /**\n * HTML ID attribute, necessary for accessibility.\n */\n id: string;\n\n /**\n * Sets the direction the Popover is positioned towards.\n *\n * This is generally provided by the OverlayTrigger component positioning the Popover.\n *\n * Possible values are:\n *\n * - `auto`\n * - `top`\n * - `right`\n * - `bottom`\n * - `left`\n */\n placement?: 'auto' | 'top' | 'right' | 'bottom' | 'left';\n\n /**\n * Additional props assigned to the arrow element. Internally used.\n */\n arrowProps?: Record<string, unknown>;\n\n /**\n * Any element to be rendered as the title of the Popover.\n *\n * It creates a `Popover.Title` inside the `Popover` passing the title directly into it.\n */\n title?: string | ReactNode;\n\n /**\n * Additional classes to be set on the `Popover.Title` element.\n */\n titleClassName?: string;\n\n /**\n * Additional classes to be set on the `Popover.Content` element.\n */\n contentClassName?: string;\n\n /**\n * Additional class names for the wrapper element.\n */\n className?: string;\n};\n\nconst PopoverTitle = ({ className = '', children }: PropsWithChildren<{ className?: string }>) => (\n <div className={`popover-header popover-title ${className}`}>{children}</div>\n);\n\nconst PopoverContent = ({ className = '', children }: PropsWithChildren<{ className?: string }>) => (\n <div className={`popover-content popover-body ${className}`}>{children}</div>\n);\n\nconst isPopoverTitleOrContent = (element: ReactNode): boolean => {\n return isValidElement(element) && (element.type === PopoverTitle || element.type === PopoverContent);\n};\n\ntype PopoverType = ForwardRefExoticComponent<PropsWithChildren<PopoverProps> & RefAttributes<HTMLDivElement>> & {\n Title: typeof PopoverTitle;\n Content: typeof PopoverContent;\n};\n\nconst Popover = forwardRef<HTMLDivElement, PropsWithChildren<PopoverProps>>((props, ref) => {\n const {\n placement = 'bottom',\n arrowProps,\n title,\n titleClassName = '',\n contentClassName = '',\n children,\n className = '',\n ...remainingProps\n } = props;\n\n const hasTitle = !!title;\n const hasCustomContent = React.Children.toArray(children).some(isPopoverTitleOrContent);\n\n // Mount the component but don't show it yet via CSS.\n // After it is mounted, we set the visibility class to use CSS animation\n const [isMounted, setIsMounted] = useState(false);\n useEffect(() => setIsMounted(true), []);\n\n return (\n <div\n {...remainingProps}\n role='tooltip'\n // x-placement is used by the css to define how to position the arrow.\n // eslint-disable-next-line react/no-unknown-property\n x-placement={placement}\n ref={ref}\n className={`popover fade ${isMounted ? 'show' : ''} ${className}`}\n >\n <div className='arrow' {...arrowProps} />\n {hasTitle && <PopoverTitle className={titleClassName}>{title}</PopoverTitle>}\n {hasCustomContent ? children : <PopoverContent className={contentClassName}>{children}</PopoverContent>}\n </div>\n );\n}) as PopoverType;\n\nPopover.Title = PopoverTitle;\nPopover.Content = PopoverContent;\n\nObject.assign(Popover, PLACEMENT_MAP);\n\nexport default Popover;\n"],"names":["PLACEMENT_MAP","PLACEMENT","PopoverTitle","className","children","jsx","PopoverContent","isPopoverTitleOrContent","element","isValidElement","Popover","forwardRef","props","ref","placement","arrowProps","title","titleClassName","contentClassName","remainingProps","hasTitle","hasCustomContent","React","isMounted","setIsMounted","useState","useEffect","jsxs"],"mappings":";;;AAcO,MAAMA,IAAgB;AAAA,EACzB,MAAMC,EAAU;AAAA,EAChB,KAAKA,EAAU;AAAA,EACf,OAAOA,EAAU;AAAA,EACjB,QAAQA,EAAU;AAAA,EAClB,MAAMA,EAAU;AACpB,GAm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AA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGlG,CAAC;AAEDM,EAAQ,QAAQR;AAChBQ,EAAQ,UAAUJ;AAElB,OAAO,OAAOI,GAASV,CAAa;"}
@@ -34,7 +34,7 @@ export type ImagePreloaderProps = {
34
34
  *
35
35
  * The function will receive props containing the `status` and `image` properties.
36
36
  *
37
- * `status` will be one of 'PENDING', 'FAILED' or 'LOADED'. `image` is the Image element.
37
+ * `status` will be one of `PENDING`, `FAILED` or `LOADED`. `image` is the Image element.
38
38
  */
39
39
  children?: ImagePreloaderChild;
40
40
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ImagePreloader.js","sources":["../../../src/components/preloader/ImagePreloader.tsx"],"sourcesContent":["import { type JSX, useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { noop } from 'es-toolkit/compat';\n\nconst loadImage =\n (onLoad: (event: Event) => void, onError: (event: Event | string) => void) =>\n (src: string, isAnonymous: boolean) => {\n const image = new Image();\n\n if (isAnonymous) {\n image.crossOrigin = 'anonymous';\n }\n\n // attach listeners\n image.onload = onLoad;\n image.onerror = onError;\n\n // preload the actual image\n image.src = src;\n\n return image;\n };\n\ntype ImagePreloaderStatus = 'PENDING' | 'FAILED' | 'LOADED';\n\nexport type ImagePreloaderChild = (props: {\n status: ImagePreloaderStatus;\n image: HTMLImageElement;\n}) => JSX.Element | null;\n\nexport type ImagePreloaderProps = {\n /**\n * The URL of the image to load.\n */\n src: string;\n\n /**\n * Invoked when the image is loaded.\n *\n * @param image The native Image object.\n */\n onLoaded?: (image: HTMLImageElement) => void;\n\n /**\n * Invoked when the image failed to load.\n *\n * @param image The native Image object.\n */\n onFailed?: (image: HTMLImageElement) => void;\n\n /**\n * Whether to set the \"crossOrigin\" to \"anonymous\".\n *\n * @default false\n */\n isAnonymous?: boolean;\n\n /**\n * A render function can be used to access both the current state and the image element.\n *\n * Using this, you can decide how to render the different states and/or the loaded image.\n *\n * The function will receive props containing the `status` and `image` properties.\n *\n * `status` will be one of 'PENDING', 'FAILED' or 'LOADED'. `image` is the Image element.\n */\n children?: ImagePreloaderChild;\n};\n\nconst ImagePreloader = (props: ImagePreloaderProps) => {\n const { src, isAnonymous = false, onLoaded = noop, onFailed = noop, children } = props;\n\n const [status, setStatus] = useState<ImagePreloaderStatus>('PENDING');\n const [image, setImage] = useState<HTMLImageElement | null>(null);\n const imageRef = useRef<HTMLImageElement | null>(null);\n\n const willUnmount = useRef(false);\n\n const handleImageLoaded = useCallback(() => {\n const currentImage = imageRef.current;\n\n if (willUnmount.current || !currentImage) {\n return;\n }\n setStatus('LOADED');\n onLoaded(currentImage);\n }, [onLoaded]);\n\n const handleImageFailed = useCallback(() => {\n const currentImage = imageRef.current;\n\n if (willUnmount.current || !currentImage) {\n return;\n }\n setStatus('FAILED');\n onFailed(currentImage);\n }, [onFailed]);\n\n const loadImageWithCallbacks = useMemo(\n () => loadImage(handleImageLoaded, handleImageFailed),\n [handleImageLoaded, handleImageFailed]\n );\n\n useEffect(() => {\n willUnmount.current = false;\n setStatus('PENDING');\n\n const nextImage = loadImageWithCallbacks(src, isAnonymous);\n imageRef.current = nextImage;\n setImage(nextImage);\n\n return () => {\n willUnmount.current = true;\n };\n }, [src, isAnonymous, loadImageWithCallbacks]);\n\n return children && image ? children({ status, image }) : null;\n};\n\nImagePreloader.STATUS_PENDING = 'PENDING';\nImagePreloader.STATUS_LOADED = 'LOADED';\nImagePreloader.STATUS_FAILED = 'FAILED';\n\nexport default ImagePreloader;\n"],"names":["loadImage","onLoad","onError","src","isAnonymous","image","ImagePreloader","props","onLoaded","noop","onFailed","children","status","setStatus","useState","setImage","imageRef","useRef","willUnmount","handleImageLoaded","useCallback","currentImage","handleImageFailed","loadImageWithCallbacks","useMemo","useEffect","nextImage"],"mappings":";;AAGA,MAAMA,IACF,CAACC,GAAgCC,MACjC,CAACC,GAAaC,MAAyB;AACnC,QAAMC,IAAQ,IAAI,MAAA;AAElB,SAAID,MACAC,EAAM,cAAc,cAIxBA,EAAM,SAAS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ources":["../../../src/components/preloader/ImagePreloader.tsx"],"sourcesContent":["import { type JSX, useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { noop } from 'es-toolkit/compat';\n\nconst loadImage =\n (onLoad: (event: Event) => void, onError: (event: Event | string) => void) =>\n (src: string, isAnonymous: boolean) => {\n const image = new Image();\n\n if (isAnonymous) {\n image.crossOrigin = 'anonymous';\n }\n\n // attach listeners\n image.onload = onLoad;\n image.onerror = onError;\n\n // preload the actual image\n image.src = src;\n\n return image;\n };\n\ntype ImagePreloaderStatus = 'PENDING' | 'FAILED' | 'LOADED';\n\nexport type ImagePreloaderChild = (props: {\n status: ImagePreloaderStatus;\n image: HTMLImageElement;\n}) => JSX.Element | null;\n\nexport type ImagePreloaderProps = {\n /**\n * The URL of the image to load.\n */\n src: string;\n\n /**\n * Invoked when the image is loaded.\n *\n * @param image The native Image object.\n */\n onLoaded?: (image: HTMLImageElement) => void;\n\n /**\n * Invoked when the image failed to load.\n *\n * @param image The native Image object.\n */\n onFailed?: (image: HTMLImageElement) => void;\n\n /**\n * Whether to set the \"crossOrigin\" to \"anonymous\".\n *\n * @default false\n */\n isAnonymous?: boolean;\n\n /**\n * A render function can be used to access both the current state and the image element.\n *\n * Using this, you can decide how to render the different states and/or the loaded image.\n *\n * The function will receive props containing the `status` and `image` properties.\n *\n * `status` will be one of `PENDING`, `FAILED` or `LOADED`. `image` is the Image element.\n */\n children?: ImagePreloaderChild;\n};\n\nconst ImagePreloader = (props: ImagePreloaderProps) => {\n const { src, isAnonymous = false, onLoaded = noop, onFailed = noop, children } = props;\n\n const [status, setStatus] = useState<ImagePreloaderStatus>('PENDING');\n const [image, setImage] = useState<HTMLImageElement | null>(null);\n const imageRef = useRef<HTMLImageElement | null>(null);\n\n const willUnmount = useRef(false);\n\n const handleImageLoaded = useCallback(() => {\n const currentImage = imageRef.current;\n\n if (willUnmount.current || !currentImage) {\n return;\n }\n setStatus('LOADED');\n onLoaded(currentImage);\n }, [onLoaded]);\n\n const handleImageFailed = useCallback(() => {\n const currentImage = imageRef.current;\n\n if (willUnmount.current || !currentImage) {\n return;\n }\n setStatus('FAILED');\n onFailed(currentImage);\n }, [onFailed]);\n\n const loadImageWithCallbacks = useMemo(\n () => loadImage(handleImageLoaded, handleImageFailed),\n [handleImageLoaded, handleImageFailed]\n );\n\n useEffect(() => {\n willUnmount.current = false;\n setStatus('PENDING');\n\n const nextImage = loadImageWithCallbacks(src, isAnonymous);\n imageRef.current = nextImage;\n setImage(nextImage);\n\n return () => {\n willUnmount.current = true;\n };\n }, [src, isAnonymous, loadImageWithCallbacks]);\n\n return children && image ? children({ status, image }) : null;\n};\n\nImagePreloader.STATUS_PENDING = 'PENDING';\nImagePreloader.STATUS_LOADED = 'LOADED';\nImagePreloader.STATUS_FAILED = 'FAILED';\n\nexport default ImagePreloader;\n"],"names":["loadImage","onLoad","onError","src","isAnonymous","image","ImagePreloader","props","onLoaded","noop","onFailed","children","status","setStatus","useState","setImage","imageRef","useRef","willUnmount","handleImageLoaded","useCallback","currentImage","handleImageFailed","loadImageWithCallbacks","useMemo","useEffect","nextImage"],"mappings":";;AAGA,MAAMA,IACF,CAACC,GAAgCC,MACjC,CAACC,GAAaC,MAAyB;AACnC,QAAMC,IAAQ,IAAI,MAAA;AAElB,SAAID,MACAC,EAAM,cAAc,cAIxBA,EAAM,SAASJ,GACfI,EAAM,UAAUH,GAGhBG,EAAM,MAAMF,GAELE;AACX,GAgDEC,IAAiB,CAACC,MAA+B;AACnD,QAAM,EAAE,KAAAJ,GAAK,aAAAC,IAAc,IAAO,UAAAI,IAAWC,GAAM,UAAAC,IAAWD,GAAM,UAAAE,EAAA,IAAaJ,GAE3E,CAACK,GAAQC,CAAS,IAAIC,EAA+B,SAAS,GAC9D,CAACT,GAAOU,CAAQ,IAAID,EAAkC,IAAI,GAC1DE,IAAWC,EAAgC,IAAI,GAE/CC,IAAcD,EAAO,EAAK,GAE1BE,IAAoBC,EAAY,MAAM;AACxC,UAAMC,IAAeL,EAAS;AAE9B,IAAIE,EAAY,WAAW,CAACG,MAG5BR,EAAU,QAAQ,GAClBL,EAASa,CAAY;AAAA,EACzB,GAAG,CAACb,CAAQ,CAAC,GAEPc,IAAoBF,EAAY,MAAM;AACxC,UAAMC,IAAeL,EAAS;AAE9B,IAAIE,EAAY,WAAW,CAACG,MAG5BR,EAAU,QAAQ,GAClBH,EAASW,CAAY;AAAA,EACzB,GAAG,CAACX,CAAQ,CAAC,GAEPa,IAAyBC;AAAA,IAC3B,MAAMxB,EAAUmB,GAAmBG,CAAiB;AAAA,IACpD,CAACH,GAAmBG,CAAiB;AAAA,EAAA;AAGzC,SAAAG,EAAU,MAAM;AACZ,IAAAP,EAAY,UAAU,IACtBL,EAAU,SAAS;AAEnB,UAAMa,IAAYH,EAAuBpB,GAAKC,CAAW;AACzD,WAAAY,EAAS,UAAUU,GACnBX,EAASW,CAAS,GAEX,MAAM;AACT,MAAAR,EAAY,UAAU;AAAA,IAC1B;AAAA,EACJ,GAAG,CAACf,GAAKC,GAAamB,CAAsB,CAAC,GAEtCZ,KAAYN,IAAQM,EAAS,EAAE,QAAAC,GAAQ,OAAAP,EAAA,CAAO,IAAI;AAC7D;AAEAC,EAAe,iBAAiB;AAChCA,EAAe,gBAAgB;AAC/BA,EAAe,gBAAgB;"}
@@ -1,5 +1,5 @@
1
1
  import { ChangeEventHandler, MouseEventHandler, PropsWithChildren, ReactNode, Ref, HTMLProps } from 'react';
2
- export type RadioButtonProps = Omit<HTMLProps<HTMLLabelElement>, 'label' | 'onClick'> & {
2
+ export type RadioButtonProps = Omit<HTMLProps<HTMLLabelElement>, 'label' | 'onClick' | 'onChange'> & {
3
3
  /**
4
4
  * Define any rioglyph icon like "rioglyph-truck".
5
5
  */
@@ -7,7 +7,7 @@ export type RadioButtonProps = Omit<HTMLProps<HTMLLabelElement>, 'label' | 'onCl
7
7
  /**
8
8
  * The label position.
9
9
  *
10
- * Possible values are: "horizontal" or "vertical".
10
+ * Possible values are: `'horizontal'` or `'vertical'`.
11
11
  *
12
12
  * @default 'vertical'
13
13
  */
@@ -25,7 +25,7 @@ export type RadioButtonProps = Omit<HTMLProps<HTMLLabelElement>, 'label' | 'onCl
25
25
  /**
26
26
  * Callback function that is invoked when the radio button is clicked.
27
27
  *
28
- * @default noop
28
+ * @default () => {}
29
29
  */
30
30
  onClick?: MouseEventHandler<{
31
31
  value: string | string[] | number;
@@ -34,7 +34,7 @@ export type RadioButtonProps = Omit<HTMLProps<HTMLLabelElement>, 'label' | 'onCl
34
34
  * Callback function that is invoked when the radio button is toggled and the state should change (for controlled
35
35
  * usage).
36
36
  *
37
- * @default noop
37
+ * @default () => {}
38
38
  */
39
39
  onChange?: ChangeEventHandler;
40
40
  /**
@@ -81,8 +81,10 @@ export type RadioButtonProps = Omit<HTMLProps<HTMLLabelElement>, 'label' | 'onCl
81
81
  name?: string;
82
82
  /**
83
83
  * The value attribute is a string containing the radio button's value but __it is never shown to the user__.
84
+ *
84
85
  * It serves a special purpose for inputs of type radio: when a form is submitted, only radio buttons which are
85
86
  * currently checked are submitted, and the reported value is the value of the value attribute.
87
+ *
86
88
  * If the value is not otherwise specified, it is the string on by default.
87
89
  *
88
90
  * This is useful when using native `FormData` when submitting a form to get the selected radio button value.
@@ -92,8 +94,10 @@ export type RadioButtonProps = Omit<HTMLProps<HTMLLabelElement>, 'label' | 'onCl
92
94
  * Number of the index used for keyboard support.
93
95
  *
94
96
  * An index of 0 means that the element should be focusable in sequential keyboard navigation, but its order is
95
- * defined by the document's source order. To disable the focus set the value to -1. A positive value means the
96
- * element should be focusable in sequential keyboard navigation, with its order defined by the value of the number.
97
+ * defined by the document's source order. To disable the focus set the value to -1.
98
+ *
99
+ * A positive value means the element should be focusable in sequential keyboard navigation,
100
+ * with its order defined by the value of the number.
97
101
  *
98
102
  * @default 0
99
103
  */
@@ -1,7 +1,7 @@
1
1
  import { jsxs as N, jsx as n } from "react/jsx-runtime";
2
2
  import { useRef as O } from "react";
3
- import g from "classnames";
4
- import { noop as x } from "es-toolkit/compat";
3
+ import { noop as g } from "es-toolkit/compat";
4
+ import x from "../../utils/classNames.js";
5
5
  const S = (s) => {
6
6
  const { icon: o, iconSize: e, iconLabelPosition: a, text: i } = s, l = {
7
7
  width: `${e}px`,
@@ -19,8 +19,8 @@ const S = (s) => {
19
19
  iconLabelPosition: e = "vertical",
20
20
  iconSize: a = 16,
21
21
  label: i,
22
- onClick: l = x,
23
- onChange: m = x,
22
+ onClick: l = g,
23
+ onChange: m = g,
24
24
  checked: c,
25
25
  defaultChecked: I,
26
26
  disabled: u = !1,
@@ -53,7 +53,7 @@ const S = (s) => {
53
53
  b.checked = !b.checked;
54
54
  }
55
55
  }
56
- }, C = i || r, B = g("radio", L && "radio-inline", h), E = g(y && "icon-right", h);
56
+ }, C = i || r, B = x("radio", L && "radio-inline", h), E = x(y && "icon-right", h);
57
57
  return /* @__PURE__ */ N(
58
58
  "label",
59
59
  {
@@ -1 +1 @@
1
- {"version":3,"file":"RadioButton.js","sources":["../../../src/components/radiobutton/RadioButton.tsx"],"sourcesContent":["import {\n type ChangeEventHandler,\n type KeyboardEvent,\n type MouseEventHandler,\n type PropsWithChildren,\n type ReactNode,\n type Ref,\n useRef,\n type HTMLProps,\n} from 'react';\nimport classNames from 'classnames';\nimport { noop } from 'es-toolkit/compat';\n\ntype RadioButtonIconProps = {\n icon: string;\n iconSize: number;\n iconLabelPosition: 'vertical' | 'horizontal';\n text: string | ReactNode;\n};\n\nconst RadioButtonIcon = (props: RadioButtonIconProps) => {\n const { icon, iconSize, iconLabelPosition, text } = props;\n\n const iconStyles = {\n width: `${iconSize}px`,\n height: `${iconSize}px`,\n fontSize: `${iconSize}px`,\n lineHeight: `${iconSize}px`,\n };\n\n return (\n <span className={`radio-icon label-${iconLabelPosition}`}>\n <span className={`rioglyph ${icon}`} style={iconStyles} />\n <span className='radio-label'>{text}</span>\n </span>\n );\n};\n\nexport type RadioButtonProps = Omit<HTMLProps<HTMLLabelElement>, 'label' | 'onClick'> & {\n /**\n * Define any rioglyph icon like \"rioglyph-truck\".\n */\n icon?: string;\n\n /**\n * The label position.\n *\n * Possible values are: \"horizontal\" or \"vertical\".\n *\n * @default 'vertical'\n */\n iconLabelPosition?: 'vertical' | 'horizontal';\n\n /**\n * The icon Size in px.\n *\n * @default 16\n */\n iconSize?: number;\n\n /**\n * Defines the label text.\n */\n label?: string | ReactNode;\n\n /**\n * Callback function that is invoked when the radio button is clicked.\n *\n * @default noop\n */\n onClick?: MouseEventHandler<{ value: string | string[] | number }>;\n\n /**\n * Callback function that is invoked when the radio button is toggled and the state should change (for controlled\n * usage).\n *\n * @default noop\n */\n onChange?: ChangeEventHandler;\n\n /**\n * Defines whether the radio is checked (for controlled usage).\n */\n checked?: boolean;\n\n /**\n * Defines whether the radio is initially checked (state can be changed on click).\n */\n defaultChecked?: boolean;\n\n /**\n * Defines whether the checkbox is disabled.\n *\n * @default false\n */\n disabled?: boolean;\n\n /**\n * Additional classes to be set on the input element.\n */\n className?: string;\n\n /**\n * Defines whether the radio button is applying an inline style.\n *\n * Use this in combination with other radio buttons.\n *\n * @default false\n */\n inline?: boolean;\n\n /**\n * Displays the icon on the right side of the text.\n *\n * @default false\n */\n right?: boolean;\n\n /**\n * Allows for rendering a completely different layout with or without a radio tick.\n *\n * @default false\n */\n custom?: boolean;\n\n /**\n * Name to be given to the input element.\n */\n name?: string;\n\n /**\n * The value attribute is a string containing the radio button's value but __it is never shown to the user__.\n * It serves a special purpose for inputs of type radio: when a form is submitted, only radio buttons which are\n * currently checked are submitted, and the reported value is the value of the value attribute.\n * If the value is not otherwise specified, it is the string on by default.\n *\n * This is useful when using native `FormData` when submitting a form to get the selected radio button value.\n */\n value?: string;\n\n /**\n * Number of the index used for keyboard support.\n *\n * An index of 0 means that the element should be focusable in sequential keyboard navigation, but its order is\n * defined by the document's source order. To disable the focus set the value to -1. A positive value means the\n * element should be focusable in sequential keyboard navigation, with its order defined by the value of the number.\n *\n * @default 0\n */\n tabIndex?: number;\n\n /**\n * Ref which is added to the input element.\n */\n inputRef?: Ref<HTMLInputElement>;\n};\n\nconst RadioButton = (props: PropsWithChildren<RadioButtonProps>) => {\n const {\n icon = '',\n iconLabelPosition = 'vertical',\n iconSize = 16,\n label,\n onClick = noop,\n onChange = noop,\n checked,\n defaultChecked,\n disabled = false,\n className,\n inline = false,\n right = false,\n custom = false,\n name,\n value,\n tabIndex = 0,\n inputRef,\n children,\n ...remainingProps\n } = props;\n\n const isControlled = checked !== null && checked !== undefined;\n\n const labelRef = useRef<HTMLLabelElement>(null);\n\n const handleToggleKeyDown = (event: KeyboardEvent<HTMLLabelElement>) => {\n switch (event.key) {\n case ' ': // toggle on space\n case 'Enter': // open on enter\n toggle(event);\n break;\n\n default:\n break;\n }\n };\n\n const toggle = (event: KeyboardEvent<HTMLLabelElement>) => {\n event.preventDefault();\n\n if (disabled) {\n return;\n }\n\n // Controlled case - uses \"onChange()\" instead of \"onClick()\" callback\n if (isControlled) {\n onChange(event);\n return;\n }\n\n // Uncontrolled case - set the input checked or unchecked\n if (labelRef.current) {\n const checkbox = labelRef.current.firstChild as HTMLInputElement;\n checkbox.checked = !checkbox.checked;\n }\n };\n\n const text = label || children;\n\n const labelClassnames = classNames('radio', inline && 'radio-inline', className);\n const inputClassnames = classNames(right && 'icon-right', className);\n\n const renderCustomIcon = !!icon;\n const renderCustomContent = custom && children;\n const renderDefault = !icon && !custom;\n\n return (\n <label\n {...remainingProps}\n className={labelClassnames}\n tabIndex={tabIndex}\n onKeyDown={handleToggleKeyDown}\n ref={labelRef}\n >\n <input\n type='radio'\n defaultChecked={defaultChecked}\n checked={checked}\n disabled={disabled}\n className={inputClassnames}\n ref={inputRef}\n onClick={onClick}\n // Only wire onChange for controlled usage; uncontrolled relies on native state + onClick.\n onChange={isControlled ? onChange : undefined}\n name={name}\n value={value}\n />\n {renderCustomIcon && (\n <RadioButtonIcon icon={icon} iconSize={iconSize} iconLabelPosition={iconLabelPosition} text={text} />\n )}\n {renderDefault && (\n <span className='radio-text'>\n <span>{text}</span>\n </span>\n )}\n {renderCustomContent && children}\n </label>\n );\n};\n\nRadioButton.ICON_LABEL_VERTICAL = 'vertical';\nRadioButton.ICON_LABEL_HORIZONTAL = 'horizontal';\n\nexport default RadioButton;\n"],"names":["RadioButtonIcon","props","icon","iconSize","iconLabelPosition","text","iconStyles","jsxs","jsx","RadioButton","label","onClick","noop","onChange","checked","defaultChecked","disabled","className","inline","right","custom","name","value","tabIndex","inputRef","children","remainingProps","isControlled","labelRef","useRef","handleToggleKeyDown","event","toggle","checkbox","labelClassnames","classNames","inputClassnames"],"mappings":";;;;AAoBA,MAAMA,IAAkB,CAACC,MAAgC;AACrD,QAAM,EAAE,MAAAC,GAAM,UAAAC,GAAU,mBAAAC,GAAmB,MAAAC,MAASJ,GAE9CK,IAAa;AAAA,IACf,OAAO,GAAGH,CAAQ;AAAA,IAClB,QAAQ,GAAGA,CAAQ;AAAA,IACnB,UAAU,GAAGA,CAAQ;AAAA,IACrB,YAAY,GAAGA,CAAQ;AAAA,EAAA;AAG3B,SACI,gBAAAI,EAAC,QAAA,EAAK,WAAW,oBAAoBH,CAAiB,IAClD,UAAA;AAAA,IAAA,gBAAAI,EAAC,UAAK,WAAW,YAAYN,CAAI,IAAI,OAAOI,GAAY;AAAA,IACxD,gBAAAE,EAAC,QAAA,EAAK,WAAU,eAAe,UAAAH,EAAA,CAAK;AAAA,EAAA,GACxC;AAER,GAyHMI,IAAc,CAACR,MAA+C;AAChE,QAAM;AAAA,IACF,MAAAC,IAAO;AAAA,IACP,mBAAAE,IAAoB;AAAA,IACpB,UAAAD,IAAW;AAAA,IACX,OAAAO;AAAA,IACA,SAAAC,IAAUC;AAAA,IACV,UAAAC,IAAWD;AAAA,IACX,SAAAE;AAAA,IACA,gBAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,WAAAC;AAAA,IACA,QAAAC,IAAS;AAAA,IACT,OAAAC,IAAQ;AAAA,IACR,QAAAC,IAAS;AAAA,IACT,MAAAC;AAAA,I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AAAA,QAxBzF,CAACH,KAAQ,CAACkB,uBA2BnB,QAAA,EAAK,WAAU,cACZ,UAAA,gBAAAZ,EAAC,QAAA,EAAM,aAAK,EAAA,CAChB;AAAA,QA9BgBY,KAAUK,KAgCNA;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGpC;AAEAhB,EAAY,sBAAsB;AAClCA,EAAY,wBAAwB;"}
1
+ {"version":3,"file":"RadioButton.js","sources":["../../../src/components/radiobutton/RadioButton.tsx"],"sourcesContent":["import {\n type ChangeEvent,\n type ChangeEventHandler,\n type KeyboardEvent,\n type MouseEventHandler,\n type PropsWithChildren,\n type ReactNode,\n type Ref,\n useRef,\n type HTMLProps,\n} from 'react';\nimport { noop } from 'es-toolkit/compat';\n\nimport classNames from '../../utils/classNames';\n\ntype RadioButtonIconProps = {\n icon: string;\n iconSize: number;\n iconLabelPosition: 'vertical' | 'horizontal';\n text: string | ReactNode;\n};\n\nconst RadioButtonIcon = (props: RadioButtonIconProps) => {\n const { icon, iconSize, iconLabelPosition, text } = props;\n\n const iconStyles = {\n width: `${iconSize}px`,\n height: `${iconSize}px`,\n fontSize: `${iconSize}px`,\n lineHeight: `${iconSize}px`,\n };\n\n return (\n <span className={`radio-icon label-${iconLabelPosition}`}>\n <span className={`rioglyph ${icon}`} style={iconStyles} />\n <span className='radio-label'>{text}</span>\n </span>\n );\n};\n\nexport type RadioButtonProps = Omit<HTMLProps<HTMLLabelElement>, 'label' | 'onClick' | 'onChange'> & {\n /**\n * Define any rioglyph icon like \"rioglyph-truck\".\n */\n icon?: string;\n\n /**\n * The label position.\n *\n * Possible values are: `'horizontal'` or `'vertical'`.\n *\n * @default 'vertical'\n */\n iconLabelPosition?: 'vertical' | 'horizontal';\n\n /**\n * The icon Size in px.\n *\n * @default 16\n */\n iconSize?: number;\n\n /**\n * Defines the label text.\n */\n label?: string | ReactNode;\n\n /**\n * Callback function that is invoked when the radio button is clicked.\n *\n * @default () => {}\n */\n onClick?: MouseEventHandler<{ value: string | string[] | number }>;\n\n /**\n * Callback function that is invoked when the radio button is toggled and the state should change (for controlled\n * usage).\n *\n * @default () => {}\n */\n onChange?: ChangeEventHandler;\n\n /**\n * Defines whether the radio is checked (for controlled usage).\n */\n checked?: boolean;\n\n /**\n * Defines whether the radio is initially checked (state can be changed on click).\n */\n defaultChecked?: boolean;\n\n /**\n * Defines whether the checkbox is disabled.\n *\n * @default false\n */\n disabled?: boolean;\n\n /**\n * Additional classes to be set on the input element.\n */\n className?: string;\n\n /**\n * Defines whether the radio button is applying an inline style.\n *\n * Use this in combination with other radio buttons.\n *\n * @default false\n */\n inline?: boolean;\n\n /**\n * Displays the icon on the right side of the text.\n *\n * @default false\n */\n right?: boolean;\n\n /**\n * Allows for rendering a completely different layout with or without a radio tick.\n *\n * @default false\n */\n custom?: boolean;\n\n /**\n * Name to be given to the input element.\n */\n name?: string;\n\n /**\n * The value attribute is a string containing the radio button's value but __it is never shown to the user__.\n *\n * It serves a special purpose for inputs of type radio: when a form is submitted, only radio buttons which are\n * currently checked are submitted, and the reported value is the value of the value attribute.\n *\n * If the value is not otherwise specified, it is the string on by default.\n *\n * This is useful when using native `FormData` when submitting a form to get the selected radio button value.\n */\n value?: string;\n\n /**\n * Number of the index used for keyboard support.\n *\n * An index of 0 means that the element should be focusable in sequential keyboard navigation, but its order is\n * defined by the document's source order. To disable the focus set the value to -1.\n *\n * A positive value means the element should be focusable in sequential keyboard navigation,\n * with its order defined by the value of the number.\n *\n * @default 0\n */\n tabIndex?: number;\n\n /**\n * Ref which is added to the input element.\n */\n inputRef?: Ref<HTMLInputElement>;\n};\n\nconst RadioButton = (props: PropsWithChildren<RadioButtonProps>) => {\n const {\n icon = '',\n iconLabelPosition = 'vertical',\n iconSize = 16,\n label,\n onClick = noop,\n onChange = noop,\n checked,\n defaultChecked,\n disabled = false,\n className,\n inline = false,\n right = false,\n custom = false,\n name,\n value,\n tabIndex = 0,\n inputRef,\n children,\n ...remainingProps\n } = props;\n\n const isControlled = checked !== null && checked !== undefined;\n\n const labelRef = useRef<HTMLLabelElement>(null);\n\n const handleToggleKeyDown = (event: KeyboardEvent<HTMLLabelElement>) => {\n switch (event.key) {\n case ' ': // toggle on space\n case 'Enter': // open on enter\n toggle(event);\n break;\n\n default:\n break;\n }\n };\n\n const toggle = (event: KeyboardEvent<HTMLLabelElement>) => {\n event.preventDefault();\n\n if (disabled) {\n return;\n }\n\n // Controlled case - uses \"onChange()\" instead of \"onClick()\" callback\n if (isControlled) {\n onChange(event as unknown as ChangeEvent<HTMLInputElement>);\n return;\n }\n\n // Uncontrolled case - set the input checked or unchecked\n if (labelRef.current) {\n const checkbox = labelRef.current.firstChild as HTMLInputElement;\n checkbox.checked = !checkbox.checked;\n }\n };\n\n const text = label || children;\n\n const labelClassnames = classNames('radio', inline && 'radio-inline', className);\n const inputClassnames = classNames(right && 'icon-right', className);\n\n const renderCustomIcon = !!icon;\n const renderCustomContent = custom && children;\n const renderDefault = !icon && !custom;\n\n return (\n <label\n {...remainingProps}\n className={labelClassnames}\n tabIndex={tabIndex}\n onKeyDown={handleToggleKeyDown}\n ref={labelRef}\n >\n <input\n type='radio'\n defaultChecked={defaultChecked}\n checked={checked}\n disabled={disabled}\n className={inputClassnames}\n ref={inputRef}\n onClick={onClick}\n // Only wire onChange for controlled usage; uncontrolled relies on native state + onClick.\n onChange={isControlled ? onChange : undefined}\n name={name}\n value={value}\n />\n {renderCustomIcon && (\n <RadioButtonIcon icon={icon} iconSize={iconSize} iconLabelPosition={iconLabelPosition} text={text} />\n )}\n {renderDefault && (\n <span className='radio-text'>\n <span>{text}</span>\n </span>\n )}\n {renderCustomContent && children}\n </label>\n );\n};\n\nRadioButton.ICON_LABEL_VERTICAL = 'vertical';\nRadioButton.ICON_LABEL_HORIZONTAL = 'horizontal';\n\nexport default RadioButton;\n"],"names":["RadioButtonIcon","props","icon","iconSize","iconLabelPosition","text","iconStyles","jsxs","jsx","RadioButton","label","onClick","noop","onChange","checked","defaultChecked","disabled","className","inline","right","custom","name","value","tabIndex","inputRef","children","remainingProps","isControlled","labelRef","useRef","handleToggleKeyDown","event","toggle","checkbox","labelClassnames","classNames","inputClassnames"],"mappings":";;;;AAsBA,MAAMA,IAAkB,CAACC,MAAgC;AACrD,QAAM,EAAE,MAAAC,GAAM,UAAAC,GAAU,mBAAAC,GAAmB,MAAAC,MAASJ,GAE9CK,IAAa;AAAA,IACf,OAAO,GAAGH,CAAQ;AAAA,IAClB,QAAQ,GAAGA,CAAQ;AAAA,IACnB,UAAU,GAAGA,CAAQ;AAAA,IACrB,YAAY,GAAGA,CAAQ;AAAA,EAAA;AAG3B,SACI,gBAAAI,EAAC,QAAA,EAAK,WAAW,oBAAoBH,CAAiB,IAClD,UAAA;AAAA,IAAA,gBAAAI,EAAC,UAAK,WAAW,YAAYN,CAAI,IAAI,OAAOI,GAAY;AAAA,IACxD,gBAAAE,EAAC,QAAA,EAAK,WAAU,eAAe,UAAAH,EAAA,CAAK;AAAA,EAAA,GACxC;AAER,GA6HMI,IAAc,CAACR,MAA+C;AAChE,QAAM;AAAA,IACF,MAAAC,IAAO;AAAA,IACP,mBAAAE,IAAoB;AAAA,IACpB,UAAAD,IAAW;AAAA,IACX,OAAAO;AAAA,IACA,SAAAC,IAAUC;AAAA,IACV,UAAAC,IAAWD;AAAA,IACX,SAAAE;AAAA,IACA,gBAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,WAAAC;AAAA,IACA,QAAAC,IAAS;AAAA,IACT,OAAAC,IAAQ;AAAA,IACR,QAAAC,IAAS;AAAA,IACT,MAAAC;AAAA,IACA,OAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACHzB,GAEE0B,IAAeb,KAAY,MAE3Bc,IAAWC,EAAyB,IAAI,GAExCC,IAAsB,CAACC,MAA2C;AACpE,YAAQA,EAAM,KAAA;AAAA,MACV,KAAK;AAAA;AAAA,MACL,KAAK;AACD,QAA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 @@
1
+ import { ChangeEvent, HTMLProps, ReactNode } from 'react';
2
+ export type RadioCardOption = {
3
+ /**
4
+ * Value passed to the underlying input element.
5
+ */
6
+ value: string;
7
+ /**
8
+ * Card headline content.
9
+ */
10
+ label: string | ReactNode;
11
+ /**
12
+ * Optional description shown below the card headline.
13
+ */
14
+ description?: string | ReactNode;
15
+ /**
16
+ * Disables the option.
17
+ *
18
+ * @default false
19
+ */
20
+ disabled?: boolean;
21
+ /**
22
+ * Additional classes to apply to a single card.
23
+ */
24
+ className?: string;
25
+ };
26
+ export type RadioCardGroupProps = Omit<HTMLProps<HTMLDivElement>, 'onChange' | 'defaultValue'> & {
27
+ /**
28
+ * Name used for all radios in this group.
29
+ */
30
+ name: string;
31
+ /**
32
+ * List of selectable options.
33
+ */
34
+ options?: RadioCardOption[];
35
+ /**
36
+ * Selected value (controlled usage).
37
+ */
38
+ value?: string;
39
+ /**
40
+ * Initially selected value (uncontrolled usage).
41
+ */
42
+ defaultValue?: string;
43
+ /**
44
+ * Card layout variant.
45
+ *
46
+ * Possible values are: `'inline'`, `'stacked'` or `'stacked-horizontal'`.
47
+ *
48
+ * @default 'inline'
49
+ */
50
+ variant?: 'inline' | 'stacked' | 'stacked-horizontal';
51
+ /**
52
+ * Gap utility class used for the inline layout.
53
+ *
54
+ * @default 'gap-15'
55
+ */
56
+ gap?: string;
57
+ /**
58
+ * Callback invoked when selection changes.
59
+ */
60
+ onChange?: (value: string, event: ChangeEvent<HTMLInputElement>) => void;
61
+ /**
62
+ * Additional classes applied to each card.
63
+ */
64
+ cardClassName?: string;
65
+ };
66
+ type RadioCardItemProps = Omit<HTMLProps<HTMLLabelElement>, 'onClick' | 'onChange' | 'onBlur' | 'onFocus'> & {
67
+ /**
68
+ * Value passed to the underlying radio input.
69
+ */
70
+ value: string;
71
+ /**
72
+ * Disables this radio card.
73
+ *
74
+ * @default false
75
+ */
76
+ disabled?: boolean;
77
+ };
78
+ type InternalRadioCardItemProps = {
79
+ _itemIndex?: number;
80
+ _itemsCount?: number;
81
+ };
82
+ export declare const RadioCardItem: (props: RadioCardItemProps & InternalRadioCardItemProps) => import("react/jsx-runtime").JSX.Element;
83
+ type RadioCardIndicatorProps = Omit<HTMLProps<HTMLSpanElement>, 'children'>;
84
+ export declare const RadioCardIndicator: ({ className, ...remainingProps }: RadioCardIndicatorProps) => import("react/jsx-runtime").JSX.Element;
85
+ declare const RadioCardGroup: (props: RadioCardGroupProps) => import("react/jsx-runtime").JSX.Element;
86
+ export default RadioCardGroup;